summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_transfer.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-05-21 17:39:21 +0000
committerthompsa <thompsa@FreeBSD.org>2009-05-21 17:39:21 +0000
commitf4c4ceb94b1048adb65b5938741887848b17c24e (patch)
tree0ef2c96a3ab98a95903c2e7ae5064e6bc61456c0 /sys/dev/usb/usb_transfer.c
parent6cd12e776ba8c5ceb7901cbec696585e6ef53900 (diff)
downloadFreeBSD-src-f4c4ceb94b1048adb65b5938741887848b17c24e.zip
FreeBSD-src-f4c4ceb94b1048adb65b5938741887848b17c24e.tar.gz
Improve device mode (gadget) stall handling.
Some hardware easily comes out of sync with regard to whether the current or the next control transfer should be stalled, if a stall command is always issued before receiving the SETUP packet. After this patch the stall command will only be issued when a transfer should actually be stalled. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_transfer.c')
-rw-r--r--sys/dev/usb/usb_transfer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index 1dd444b..304edd5 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -1225,9 +1225,13 @@ usb2_start_hardware_sub(struct usb2_xfer *xfer)
usb2_frlength_t len;
/* Check for control endpoint stall */
- if (xfer->flags.stall_pipe) {
- /* no longer active */
+ if (xfer->flags.stall_pipe && xfer->flags_int.control_act) {
+ /* the control transfer is no longer active */
+ xfer->flags_int.control_stall = 1;
xfer->flags_int.control_act = 0;
+ } else {
+ /* don't stall control transfer by default */
+ xfer->flags_int.control_stall = 0;
}
/* Check for invalid number of frames */
OpenPOWER on IntegriCloud