summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r--sys/dev/usb/usb_subr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index bbb2b78..2ec453e 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -780,6 +780,18 @@ usbd_setup_pipe(usbd_device_handle dev, usbd_interface_handle iface,
return (err);
}
+ if (dev->quirks->uq_flags & UQ_OPEN_CLEARSTALL) {
+ /* Clear any stall and make sure DATA0 toggle will be used next. */
+ if (UE_GET_ADDR(ep->edesc->bEndpointAddress) != USB_CONTROL_ENDPOINT) {
+ err = usbd_clear_endpoint_stall(p);
+ if (err && err != USBD_STALLED && err != USBD_TIMEOUT) {
+ printf("usbd_setup_pipe: failed to start "
+ "endpoint, %s\n", usbd_errstr(err));
+ return (err);
+ }
+ }
+ }
+
*pipe = p;
return (USBD_NORMAL_COMPLETION);
}
OpenPOWER on IntegriCloud