diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-05-21 17:39:21 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-05-21 17:39:21 +0000 |
commit | f4c4ceb94b1048adb65b5938741887848b17c24e (patch) | |
tree | 0ef2c96a3ab98a95903c2e7ae5064e6bc61456c0 /sys/dev/usb/controller/atmegadci.c | |
parent | 6cd12e776ba8c5ceb7901cbec696585e6ef53900 (diff) | |
download | FreeBSD-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/controller/atmegadci.c')
-rw-r--r-- | sys/dev/usb/controller/atmegadci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/atmegadci.c b/sys/dev/usb/controller/atmegadci.c index a4b1274..df1fe78 100644 --- a/sys/dev/usb/controller/atmegadci.c +++ b/sys/dev/usb/controller/atmegadci.c @@ -751,7 +751,7 @@ atmegadci_setup_standard_chain_sub(struct atmegadci_std_temp *temp) td->offset = temp->offset; td->remainder = temp->len; td->error = 0; - td->did_stall = 0; + td->did_stall = temp->did_stall; td->short_pkt = temp->short_pkt; td->alt_next = temp->setup_alt_next; } @@ -782,6 +782,7 @@ atmegadci_setup_standard_chain(struct usb2_xfer *xfer) temp.td_next = xfer->td_start[0]; temp.offset = 0; temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.did_stall = !xfer->flags_int.control_stall; sc = ATMEGA_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); |