summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usbdi.h
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-02 09:49:36 +0000
committerjoe <joe@FreeBSD.org>2002-04-02 09:49:36 +0000
commit2104113695511c03369543a79653dd5c3cf5f15d (patch)
tree1090a50a5fde6e5d19b418a59ea4d27dffe43271 /sys/dev/usb/usbdi.h
parentb4aab89cbc8252f1064803ddc1dba28b2be03b49 (diff)
downloadFreeBSD-src-2104113695511c03369543a79653dd5c3cf5f15d.zip
FreeBSD-src-2104113695511c03369543a79653dd5c3cf5f15d.tar.gz
MFNetBSD: uhub.c (1.49), usb.c (1.51), usbdi.h (1.48), usbdivar.h (1.63)
date: 2001/01/21 19:00:06; author: augustss; Change the operation of the USB event thread. Before it only performed USB device discovery, now it can also perform (short) tasks for device drivers that need a process context, but don't have one. This is not pretty, but better than using busy-wait in an interrupt context.
Diffstat (limited to 'sys/dev/usb/usbdi.h')
-rw-r--r--sys/dev/usb/usbdi.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 64f4644..f1824c5 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.h,v 1.47 2001/01/21 02:39:53 augustss Exp $ */
+/* $NetBSD: usbdi.h,v 1.48 2001/01/21 19:00:06 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -177,6 +177,21 @@ usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor
usbd_status usbd_reload_device_desc(usbd_device_handle);
+/*
+ * The usb_task structs form a queue of things to run in the USB event
+ * thread. Normally this is just device discovery when a connect/disconnect
+ * has been detected. But it may also be used by drivers that need to
+ * perform (short) tasks that must have a process context.
+ */
+struct usb_task {
+ SIMPLEQ_ENTRY(usb_task) next;
+ void (*fun)(void *);
+ void *arg;
+ char onqueue;
+};
+
+void usb_add_task(usbd_device_handle dev, struct usb_task *task);
+
struct usb_devno {
u_int16_t ud_vendor;
u_int16_t ud_product;
OpenPOWER on IntegriCloud