summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-03-06 23:28:02 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-03-06 23:28:02 +0000
commit2c2a2223932e1b995d9c56d1265be52f99665f6b (patch)
tree75a04b624fb17bd518ab1b80289a9e6b0ec5bff2 /sys/dev/usb/usbdi.c
parent9cef6b062576306595e4e76dfab0ce49805ab692 (diff)
Makes the "cleartoggle" function provided by HC drivers optional
because upcoming xhci(4) driver won't use it.
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r--sys/dev/usb/usbdi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 8104133ee6b..b09f21c7235 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.67 2013/11/15 10:17:39 pirofti Exp $ */
+/* $OpenBSD: usbdi.c,v 1.68 2014/03/06 23:28:01 mpi Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -573,7 +573,7 @@ usbd_clear_endpoint_stall(struct usbd_pipe *pipe)
* Clearing en endpoint stall resets the endpoint toggle, so
* do the same to the HC toggle.
*/
- pipe->methods->cleartoggle(pipe);
+ usbd_clear_endpoint_toggle(pipe);
req.bmRequestType = UT_WRITE_ENDPOINT;
req.bRequest = UR_CLEAR_FEATURE;
@@ -592,7 +592,7 @@ usbd_clear_endpoint_stall_async(struct usbd_pipe *pipe)
usb_device_request_t req;
usbd_status err;
- pipe->methods->cleartoggle(pipe);
+ usbd_clear_endpoint_toggle(pipe);
req.bmRequestType = UT_WRITE_ENDPOINT;
req.bRequest = UR_CLEAR_FEATURE;
@@ -606,7 +606,8 @@ usbd_clear_endpoint_stall_async(struct usbd_pipe *pipe)
void
usbd_clear_endpoint_toggle(struct usbd_pipe *pipe)
{
- pipe->methods->cleartoggle(pipe);
+ if (pipe->methods->cleartoggle != NULL)
+ pipe->methods->cleartoggle(pipe);
}
int