summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_port.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_port.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_port.h')
-rw-r--r--sys/dev/usb/usb_port.h59
1 files changed, 41 insertions, 18 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 55b4db2..82e072d 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_port.h,v 1.11 1999/09/11 08:19:27 augustss Exp $ */
+/* $NetBSD: usb_port.h,v 1.13 1999/10/13 08:10:58 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -50,6 +50,16 @@
#include "opt_usbverbose.h"
+#ifdef USB_DEBUG
+#define UHID_DEBUG 1
+#define OHCI_DEBUG 1
+#define UGEN_DEBUG 1
+#define UHCI_DEBUG 1
+#define UHUB_DEBUG 1
+#define ULPT_DEBUG 1
+#define UAUDIO_DEBUG 1
+#endif
+
typedef struct device *device_ptr_t;
#define USBBASEDEVICE struct device
#define USBDEV(bdev) (&(bdev))
@@ -123,7 +133,6 @@ __CONCAT(dname,_detach)(self, flags) \
(struct __CONCAT(dname,_softc) *)self
#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc; \
if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
return (ENXIO); \
sc = __CONCAT(dname,_cd).cd_devs[unit]; \
@@ -131,7 +140,7 @@ __CONCAT(dname,_detach)(self, flags) \
return (ENXIO)
#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = __CONCAT(dname,_cd).cd_devs[unit]
+ sc = __CONCAT(dname,_cd).cd_devs[unit]
#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
(config_found_sm(parent, args, print, sub))
@@ -140,6 +149,15 @@ __CONCAT(dname,_detach)(self, flags) \
/*
* OpenBSD
*/
+#ifdef USB_DEBUG
+#define UHID_DEBUG 1
+#define OHCI_DEBUG 1
+#define UGEN_DEBUG 1
+#define UHCI_DEBUG 1
+#define UHUB_DEBUG 1
+#define ULPT_DEBUG 1
+#endif
+
#define memcpy(d, s, l) bcopy((s),(d),(l))
#define memset(d, v, l) bzero((d),(l))
#define bswap32(x) swap32(x)
@@ -150,6 +168,10 @@ __CONCAT(dname,_detach)(self, flags) \
#define uhidpoll uhidselect
#define ugenpoll ugenselect
+#define powerhook_establish(fn, sc) 0
+#define powerhook_disestablish(hdl)
+#define PWR_RESUME 0
+
typedef struct device device_ptr_t;
#define USBBASEDEVICE struct device
#define USBDEV(bdev) (&(bdev))
@@ -223,7 +245,6 @@ __CONCAT(dname,_detach)(self, flags) \
(struct __CONCAT(dname,_softc) *)self
#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc; \
if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
return (ENXIO); \
sc = __CONCAT(dname,_cd).cd_devs[unit]; \
@@ -231,7 +252,7 @@ __CONCAT(dname,_detach)(self, flags) \
return (ENXIO)
#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = __CONCAT(dname,_cd).cd_devs[unit]
+ sc = __CONCAT(dname,_cd).cd_devs[unit]
#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
(config_found_sm(parent, args, print, sub))
@@ -257,15 +278,22 @@ __CONCAT(dname,_detach)(self, flags) \
*/
#define memcpy(d, s, l) bcopy((s),(d),(l))
#define memset(d, v, l) bzero((d),(l))
-#define bswap32(x) swap32(x) /* XXX not available in FreeBSD */
-#define kthread_create1
-#define kthread_create
-
+#define bswap32(x) swap32(x)
+#define kthread_create1(function, sc, priv, string, name)
+#define kthread_create(create_function, sc)
+#define kthread_exit(err)
#define usb_timeout(f, d, t, h) ((h) = timeout((f), (d), (t)))
#define usb_untimeout(f, d, h) untimeout((f), (d), (h))
-#define USB_DECLARE_DRIVER_INIT(dname, init...) \
+#define clalloc(p, s, x) (clist_alloc_cblocks((p), (s), (x)), 0)
+#define clfree(p) clist_free_cblocks((p))
+
+#define powerhook_establish(fn, sc) 0
+#define powerhook_disestablish(hdl)
+#define PWR_RESUME 0
+
+#define USB_DECLARE_DRIVER_INIT(dname, init) \
static device_probe_t __CONCAT(dname,_match); \
static device_attach_t __CONCAT(dname,_attach); \
static device_detach_t __CONCAT(dname,_detach); \
@@ -288,6 +316,7 @@ static driver_t __CONCAT(dname,_driver) = { \
#define METHODS_NONE {0,0}
#define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, METHODS_NONE)
+
#define USB_MATCH(dname) \
static int \
__CONCAT(dname,_match)(device_t self)
@@ -319,14 +348,12 @@ __CONCAT(dname,_detach)(device_t self)
struct __CONCAT(dname,_softc) *sc = device_get_softc(self)
#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit); \
+ sc = devclass_get_softc(__CONCAT(dname,_devclass), unit); \
if (!sc) \
return (ENXIO)
#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit)
+ sc = devclass_get_softc(__CONCAT(dname,_devclass), unit)
#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
(device_probe_and_attach((bdev)) == 0 ? (bdev) : 0)
@@ -355,7 +382,3 @@ __CONCAT(dname,_detach)(device_t self)
#define logprintf printf
#endif /* __FreeBSD__ */
-
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#elif defined(__FreeBSD__)
-#endif
OpenPOWER on IntegriCloud