summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.h
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-07 18:08:06 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-07 18:08:06 +0000
commit98e3a0a3b6a5b0271467c9f199a555d22161f072 (patch)
tree04221a5a893956a1fe82881463802b2e507063b3 /sys/dev/usb/usbdi.h
parent3a7a8acd4f0393073cd00591e53b1b8a4eb1bd60 (diff)
Sync ulpt driver with NetBSD
Diffstat (limited to 'sys/dev/usb/usbdi.h')
-rw-r--r--sys/dev/usb/usbdi.h73
1 files changed, 38 insertions, 35 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 517287ea75d..0a571b0bcee 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: usbdi.h,v 1.14 2002/04/01 21:47:07 nate Exp $ */
-/* $NetBSD: usbdi.h,v 1.53 2001/08/15 00:04:59 augustss Exp $ */
+/* $OpenBSD: usbdi.h,v 1.15 2002/05/07 18:08:05 nate Exp $ */
+/* $NetBSD: usbdi.h,v 1.61 2002/02/11 15:20:23 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
/*
@@ -48,25 +48,25 @@ typedef void *usbd_private_handle;
typedef enum { /* keep in sync with usbd_status_msgs */
USBD_NORMAL_COMPLETION = 0, /* must be 0 */
- USBD_IN_PROGRESS,
+ USBD_IN_PROGRESS, /* 1 */
/* errors */
- USBD_PENDING_REQUESTS,
- USBD_NOT_STARTED,
- USBD_INVAL,
- USBD_NOMEM,
- USBD_CANCELLED,
- USBD_BAD_ADDRESS,
- USBD_IN_USE,
- USBD_NO_ADDR,
- USBD_SET_ADDR_FAILED,
- USBD_NO_POWER,
- USBD_TOO_DEEP,
- USBD_IOERROR,
- USBD_NOT_CONFIGURED,
- USBD_TIMEOUT,
- USBD_SHORT_XFER,
- USBD_STALLED,
- USBD_INTERRUPTED,
+ USBD_PENDING_REQUESTS, /* 2 */
+ USBD_NOT_STARTED, /* 3 */
+ USBD_INVAL, /* 4 */
+ USBD_NOMEM, /* 5 */
+ USBD_CANCELLED, /* 6 */
+ USBD_BAD_ADDRESS, /* 7 */
+ USBD_IN_USE, /* 8 */
+ USBD_NO_ADDR, /* 9 */
+ USBD_SET_ADDR_FAILED, /* 10 */
+ USBD_NO_POWER, /* 11 */
+ USBD_TOO_DEEP, /* 12 */
+ USBD_IOERROR, /* 13 */
+ USBD_NOT_CONFIGURED, /* 14 */
+ USBD_TIMEOUT, /* 15 */
+ USBD_SHORT_XFER, /* 16 */
+ USBD_STALLED, /* 17 */
+ USBD_INTERRUPTED, /* 18 */
USBD_ERROR_MAX /* must be last */
} usbd_status;
@@ -117,16 +117,17 @@ usb_endpoint_descriptor_t *usbd_interface2endpoint_descriptor
usbd_status usbd_abort_pipe(usbd_pipe_handle pipe);
usbd_status usbd_clear_endpoint_stall(usbd_pipe_handle pipe);
usbd_status usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe);
+void usbd_clear_endpoint_toggle(usbd_pipe_handle pipe);
usbd_status usbd_endpoint_count(usbd_interface_handle dev, u_int8_t *count);
usbd_status usbd_interface_count(usbd_device_handle dev, u_int8_t *count);
-usbd_status usbd_interface2device_handle(usbd_interface_handle iface,
- usbd_device_handle *dev);
+void usbd_interface2device_handle(usbd_interface_handle iface,
+ usbd_device_handle *dev);
usbd_status usbd_device2interface_handle(usbd_device_handle dev,
u_int8_t ifaceno, usbd_interface_handle *iface);
usbd_device_handle usbd_pipe2device_handle(usbd_pipe_handle);
-void *usbd_alloc_buffer(usbd_xfer_handle req, u_int32_t size);
-void usbd_free_buffer(usbd_xfer_handle req);
+void *usbd_alloc_buffer(usbd_xfer_handle xfer, u_int32_t size);
+void usbd_free_buffer(usbd_xfer_handle xfer);
void *usbd_get_buffer(usbd_xfer_handle xfer);
usbd_status usbd_sync_transfer(usbd_xfer_handle req);
usbd_status usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
@@ -139,10 +140,11 @@ usbd_status usbd_do_request_async(usbd_device_handle pipe,
usb_device_request_t *req, void *data);
usbd_status usbd_do_request_flags(usbd_device_handle pipe,
usb_device_request_t *req,
- void *data, u_int16_t flags, int *);
+ void *data, u_int16_t flags, int*, u_int32_t);
usbd_status usbd_do_request_flags_pipe(
usbd_device_handle dev, usbd_pipe_handle pipe,
- usb_device_request_t *req, void *data, u_int16_t flags, int *actlen);
+ usb_device_request_t *req, void *data, u_int16_t flags, int *actlen,
+ u_int32_t);
usb_interface_descriptor_t *usbd_get_interface_descriptor
(usbd_interface_handle iface);
usb_config_descriptor_t *usbd_get_config_descriptor(usbd_device_handle dev);
@@ -150,7 +152,7 @@ usb_device_descriptor_t *usbd_get_device_descriptor(usbd_device_handle dev);
usbd_status usbd_set_interface(usbd_interface_handle, int);
int usbd_get_no_alts(usb_config_descriptor_t *, int);
usbd_status usbd_get_interface(usbd_interface_handle iface, u_int8_t *aiface);
-void usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di, int);
+void usbd_fill_deviceinfo(usbd_device_handle, struct usb_device_info *, int);
int usbd_get_interface_altindex(usbd_interface_handle iface);
usb_interface_descriptor_t *usbd_find_idesc(usb_config_descriptor_t *cd,
@@ -267,14 +269,15 @@ struct usb_attach_arg {
int usbd_driver_load(module_t mod, int what, void *arg);
#endif
-/*
- * XXX
- * splusb MUST be the lowest level interrupt so that within USB callbacks
- * the level can be raised the appropriate level.
- * XXX Should probably use a softsplusb.
- */
-/* XXX */
+/* XXX Perhaps USB should have its own levels? */
+#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+#define splusb splsoftnet
+#else
+#define splusb splsoftclock
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
+#else
#define splusb splbio
+#endif /* USB_USE_SOFTINTR */
#define splhardusb splbio
#define IPL_USB IPL_BIO
-/* XXX */