summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb.h
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-11-17 22:33:51 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-11-17 22:33:51 +0000
commitaeb2d2626b24c89dbb68adb9caebd10bbe02dd43 (patch)
tree4ffabed555c86f3e004db50f4d745f46d25b77c9 /sys/dev/usb/usb.h
parenta586d3a066b64caa068a9a83440201f39e4d6677 (diff)
downloadFreeBSD-src-aeb2d2626b24c89dbb68adb9caebd10bbe02dd43.zip
FreeBSD-src-aeb2d2626b24c89dbb68adb9caebd10bbe02dd43.tar.gz
Synchronisation with NetBSD as of 1999/11/16:
Cleaning up the code: - Declare many functions static - Change variable names to make them more self explanatory - Change usbd_request_handle -> usbd_xfer_handle - Syntactical changes - Remove some unused code - Other KNF changes Interrupt context handling - Change delay to usbd_delay_ms were possible (takes polling mode into account) - Change detection mechanism for interrupt context Add support for pre-allocation DMA-able memory by device driver Add preliminary support for isochronous to the UHCI driver (not for OHCI yet). usb.c, uhci.c, ohci.c - Initial attempt at detachable USB host controllers - Handle the use_polling flag with a lttle more care and only set it if we are cold booting. usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c - Make sure an aborted pipe is marked as not running. - Start queued request in the right order. - Insert some more DIAGNOSTIC sanity checks. - Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN. usb.c, usb_subr.c - Add an event mechanism so that a userland process can watch devices come and go. ohci.c - Handle the case when a USB transfer is so long that it crosses two page (4K) boundaries. OHCI cannot do that with a single TD so we make a chain. ulpt.c - Use a bigger buffer when transferring data. - Pre-allocate the DMA buffer. This makes the driver slightly more efficient. - Comment out the GET_DEVICE_ID code, because for some unknown reason it causes printing to fail sometimes. usb.h - Add a macro to extract the isoc type. - Add a macro to check whether the routine has been entered after splusb and if not, complain. usbdi.c - Fix a glitch in dequeueing and aborting requests on interrupt pipes. - Add a flag in the request to determine if the data copying is done by the driver or the usbdi layer.
Diffstat (limited to 'sys/dev/usb/usb.h')
-rw-r--r--sys/dev/usb/usb.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index 4152b72..0d4703b 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.h,v 1.33 1999/09/11 08:19:27 augustss Exp $ */
+/* $NetBSD: usb.h,v 1.37 1999/10/13 18:52:54 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -43,6 +43,7 @@
#define _USB_H_
#include <sys/types.h>
+#include <sys/time.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/ioctl.h>
@@ -244,6 +245,7 @@ typedef struct {
#define UE_ISO_ASYNC 0x04
#define UE_ISO_ADAPT 0x08
#define UE_ISO_SYNC 0x0c
+#define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE)
uWord wMaxPacketSize;
uByte bInterval;
} usb_endpoint_descriptor_t;
@@ -339,13 +341,13 @@ typedef struct {
#define USUBCLASS_AUDIOSTREAM 2
#define USUBCLASS_MIDISTREAM 3
#define UCLASS_CDC 2 /* communication */
-#define USUBCLASS_DIRECT_LINE_CONTROL_MODEL 1
+#define USUBCLASS_DIRECT_LINE_CONTROL_MODEL 1
#define USUBCLASS_ABSTRACT_CONTROL_MODEL 2
-#define USUBCLASS_TELEPHONE_CONTROL_MODEL 3
-#define USUBCLASS_MULTICHANNEL_CONTROL_MODEL 4
-#define USUBCLASS_CAPI_CONTROLMODEL 5
-#define USUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL 6
-#define USUBCLASS_ATM_NETWORKING_CONTROL_MODEL 7
+#define USUBCLASS_TELEPHONE_CONTROL_MODEL 3
+#define USUBCLASS_MULTICHANNEL_CONTROL_MODEL 4
+#define USUBCLASS_CAPI_CONTROLMODEL 5
+#define USUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL 6
+#define USUBCLASS_ATM_NETWORKING_CONTROL_MODEL 7
#define UPROTO_CDC_AT 1
#define UCLASS_HID 3
#define USUBCLASS_BOOT 1
@@ -379,7 +381,7 @@ typedef struct {
#define UPROTO_DATA_V120 0x92 /* V.24 rate adaption */
#define UPROTO_DATA_CAPI 0x93 /* CAPI 2.0 commands */
#define UPROTO_DATA_HOST_BASED 0xfd /* Host based driver */
-#define UPROTO_DATA_PUF 0xfe /* see Prot. Unit Func. Desc. */
+#define UPROTO_DATA_PUF 0xfe /* see Prot. Unit Func. Desc.*/
#define UPROTO_DATA_VENDOR 0xff /* Vendor specific */
@@ -494,7 +496,7 @@ struct usb_device_info {
};
struct usb_ctl_report {
- int report;
+ int report;
u_char data[1024]; /* filled data size will vary */
};
@@ -502,6 +504,17 @@ struct usb_device_stats {
u_long requests[4]; /* indexed by transfer type UE_* */
};
+typedef struct { u_int32_t cookie; } usb_event_cookie_t;
+/* Events that can be read from /dev/usb */
+struct usb_event {
+ int ue_type;
+#define USB_EVENT_ATTACH 1
+#define USB_EVENT_DETACH 2
+ struct usb_device_info ue_device;
+ struct timespec ue_time;
+ usb_event_cookie_t ue_cookie;
+};
+
/* USB controller */
#define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request)
#define USB_SETDEBUG _IOW ('U', 2, int)
OpenPOWER on IntegriCloud