diff options
author | hselasky <hselasky@FreeBSD.org> | 2012-12-24 10:10:18 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2012-12-24 10:10:18 +0000 |
commit | 80058fed10e6e72c3b02d2b7192ca154f469b1d8 (patch) | |
tree | 01f8a28305b12f04e95d88f2fc6e3c089c31d4ca /sys/dev/usb/usb_msctest.c | |
parent | da7a62683030c2747662ae8b6bda3acac95e794d (diff) | |
download | FreeBSD-src-80058fed10e6e72c3b02d2b7192ca154f469b1d8.zip FreeBSD-src-80058fed10e6e72c3b02d2b7192ca154f469b1d8.tar.gz |
Fix more regression issue after r244503.
usbd_transfer_setup() does not set a default length for USB transfers.
Only the number of frames is automatically setup.
MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/usb_msctest.c')
-rw-r--r-- | sys/dev/usb/usb_msctest.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c index 7555f55..c5e8f49 100644 --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -300,6 +300,8 @@ bbb_command_callback(struct usb_xfer *xfer, usb_error_t error) sc->cbw->bCDBLength = sizeof(sc->cbw->CBWCDB); DPRINTFN(0, "Truncating long command\n"); } + usbd_xfer_set_frame_len(xfer, 0, + sizeof(struct bbb_cbw)); usbd_transfer_submit(xfer); break; @@ -386,7 +388,7 @@ bbb_data_write_callback(struct usb_xfer *xfer, usb_error_t error) if (sc->data_rem == 0) { bbb_transfer_start(sc, ST_STATUS); - return; + break; } if (max_bulk > sc->data_rem) { max_bulk = sc->data_rem; @@ -394,7 +396,7 @@ bbb_data_write_callback(struct usb_xfer *xfer, usb_error_t error) usbd_xfer_set_timeout(xfer, sc->data_timeout); usbd_xfer_set_frame_data(xfer, 0, sc->data_ptr, max_bulk); usbd_transfer_submit(xfer); - return; + break; default: /* Error */ if (error == USB_ERR_CANCELLED) { @@ -402,8 +404,7 @@ bbb_data_write_callback(struct usb_xfer *xfer, usb_error_t error) } else { bbb_transfer_start(sc, ST_DATA_WR_CS); } - return; - + break; } } @@ -438,6 +439,8 @@ bbb_status_callback(struct usb_xfer *xfer, usb_error_t error) break; case USB_ST_SETUP: + usbd_xfer_set_frame_len(xfer, 0, + sizeof(struct bbb_csw)); usbd_transfer_submit(xfer); break; |