Date: Sun, 6 Jan 2008 14:14:13 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 132622 for review Message-ID: <200801061414.m06EEDtk072072@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132622 Change 132622 by hselasky@hselasky_laptop001 on 2008/01/06 14:13:16 Add generic support for handling alternate setting requests in device side mode. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#98 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#98 (text+ko) ==== @@ -3362,7 +3362,26 @@ case UT_WRITE_INTERFACE: switch (req.bRequest) { case UR_SET_INTERFACE: - if (iface->alt_index != req.wValue[0]) { + if (state == ST_POST_STATUS) { + /* we are complete */ + break; + } + if (iface->alt_index == req.wValue[0]) { + /* no change - nothing to do */ + break; + } + error = device_detach(iface->subdev); + if (error) { + goto tr_stalled; + } + error = usbd_set_alt_interface_index(udev, + req.wIndex[0], req.wValue[0]); + if (error) { + goto tr_stalled; + } + error = usbd_probe_and_attach(udev, + req.wIndex[0]); + if (error) { goto tr_stalled; } break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801061414.m06EEDtk072072>