Date: Wed, 4 Jun 2008 16:20:16 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 142894 for review Message-ID: <200806041620.m54GKGJm098114@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=142894 Change 142894 by hselasky@hselasky_laptop001 on 2008/06/04 16:19:51 USB Device Side Mode: Make sure that non-interface specific control endpint messages gets broadcasted. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#125 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#125 (text+ko) ==== @@ -3380,6 +3380,7 @@ uint16_t wValue; uint16_t wIndex; uint8_t state; + uint8_t iface_index; union { uWord wStatus; uint8_t buf[2]; @@ -3528,13 +3529,15 @@ } break; default: + if (state == ST_DATA) { + goto tr_bad_context; + } if ((req.bmRequestType & 0x1F) == UT_INTERFACE) { - if (state == ST_DATA) { - goto tr_bad_context; - } - goto tr_handle_iface_request; + iface_index = req.wIndex[0]; /* unicast */ + } else { + iface_index = 0;/* broadcast */ } - goto tr_stalled; + goto tr_handle_iface_request; } goto tr_valid; @@ -3641,7 +3644,7 @@ goto tr_valid; tr_handle_iface_request: - iface = usbd_get_iface(udev, req.wIndex[0]); + iface = usbd_get_iface(udev, iface_index); if (iface == NULL) { goto tr_stalled; } @@ -3672,6 +3675,10 @@ goto tr_handle_iface_request_builtin; tr_handle_iface_request_builtin: + if ((req.bmRequestType & 0x1F) != UT_INTERFACE) { + iface_index++; /* iterate */ + goto tr_handle_iface_request; + } switch (req.bmRequestType) { case UT_WRITE_INTERFACE: switch (req.bRequest) { @@ -3722,6 +3729,8 @@ goto tr_stalled; } break; + default: + goto tr_stalled; } goto tr_valid;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806041620.m54GKGJm098114>