summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-03-06 23:53:12 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-03-06 23:53:12 +0000
commit275b29e85327b7839939a8a1f174ba40ff7093ae (patch)
tree924af4b524350eeadc13d0a1562ef86720e89cf9 /sys/dev
parent4ba75e622b750f080153d58dc236f862a14e2eb7 (diff)
Turn usbd_xfer_isread() into a public function so that we can use
it in various drivers, mainly HC, instead of always rerolling our own.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbdi.c12
-rw-r--r--sys/dev/usb/usbdivar.h11
2 files changed, 11 insertions, 12 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index b09f21c7235..4cb218287f4 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.68 2014/03/06 23:28:01 mpi Exp $ */
+/* $OpenBSD: usbdi.c,v 1.69 2014/03/06 23:53:11 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 $ */
@@ -111,16 +111,6 @@ usbd_iface_claimed(struct usbd_device *dev, int ifaceidx)
return (dev->ifaces[ifaceidx].claimed);
}
-static __inline int
-usbd_xfer_isread(struct usbd_xfer *xfer)
-{
- if (xfer->rqflags & URQ_REQUEST)
- return (xfer->request.bmRequestType & UT_READ);
- else
- return (xfer->pipe->endpoint->edesc->bEndpointAddress &
- UE_DIR_IN);
-}
-
#ifdef USB_DEBUG
void
usbd_dump_iface(struct usbd_interface *iface)
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index f099a2cac1f..4602518a384 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.54 2014/03/06 23:51:04 mpi Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.55 2014/03/06 23:53:11 mpi Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -282,4 +282,13 @@ void usb_schedsoftintr(struct usbd_bus *);
#define UHUB_UNK_PRODUCT UHUBCF_PRODUCT_DEFAULT /* wildcarded 'product' */
#define UHUB_UNK_RELEASE UHUBCF_RELEASE_DEFAULT /* wildcarded 'release' */
+static inline int
+usbd_xfer_isread(struct usbd_xfer *xfer)
+{
+ if (xfer->rqflags & URQ_REQUEST)
+ return (xfer->request.bmRequestType & UT_READ);
+
+ return (xfer->pipe->endpoint->edesc->bEndpointAddress & UE_DIR_IN);
+}
+
#endif /* _USBDIVAR_H_ */