From 9ab3a4add13465aff526ebaae1b98fc38b55334c Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 12 Jun 2007 19:40:20 +0000 Subject: [PATCH] First pass at removing __OtherBSD__. We can't blindly remove all of them in bulk because there is at least one feature that's unimplemented on FreeBSD that needs to be done and these are good placeholders. --- sys/dev/usb/hid.c | 3 --- sys/dev/usb/usbdi.c | 14 +++----------- sys/dev/usb/usbdi.h | 28 ---------------------------- sys/dev/usb/usbdi_util.c | 5 ----- sys/dev/usb/usbdivar.h | 17 ----------------- sys/dev/usb/uvisor.c | 4 ---- sys/dev/usb/uvscom.c | 5 ----- 7 files changed, 3 insertions(+), 73 deletions(-) diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c index b2e15ae77cab..dc8f8e128574 100644 --- a/sys/dev/usb/hid.c +++ b/sys/dev/usb/hid.c @@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__NetBSD__) -#include -#endif #include #include diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index a507eec61132..eb9ad33230a4 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -42,17 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__NetBSD__) || defined(__OpenBSD__) -#include -#include -#elif defined(__FreeBSD__) #include #include #include "usb_if.h" #if defined(DIAGNOSTIC) && defined(__i386__) #include #endif -#endif #include #include @@ -65,10 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__FreeBSD__) #include "usb_if.h" #define delay(d) DELAY(d) -#endif #ifdef USB_DEBUG #define DPRINTF(x) if (usbdebug) logprintf x @@ -532,6 +525,7 @@ usbd_free_xfer(usbd_xfer_handle xfer) DPRINTFN(5,("usbd_free_xfer: %p\n", xfer)); if (xfer->rqflags & URQ_DEV_DMABUF) usbd_free_buffer(xfer); +/* XXX Does FreeBSD need to do something similar? */ #if defined(__NetBSD__) && defined(DIAGNOSTIC) if (callout_pending(&xfer->timeout_handle)) { callout_stop(&xfer->timeout_handle); @@ -1084,7 +1078,8 @@ usbd_do_request_flags_pipe(usbd_device_handle dev, usbd_pipe_handle pipe, usbd_status err; #ifdef DIAGNOSTIC -#if defined(__i386__) && defined(__FreeBSD__) +/* XXX amd64 too? */ +#if defined(__i386__) KASSERT(curthread->td_intr_nesting_level == 0, ("usbd_do_request: in interrupt context")); #endif @@ -1361,7 +1356,6 @@ usbd_get_string(usbd_device_handle dev, int si, char *buf) return (USBD_NORMAL_COMPLETION); } -#if defined(__FreeBSD__) int usbd_driver_load(module_t mod, int what, void *arg) { @@ -1369,5 +1363,3 @@ usbd_driver_load(module_t mod, int what, void *arg) return (0); } - -#endif diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index fb1af43f94db..52f2a01f091c 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -232,29 +232,6 @@ struct usb_attach_arg { int nifaces; /* number of interfaces */ }; -#if defined(__NetBSD__) || defined(__OpenBSD__) -/* Match codes. */ -/* First five codes is for a whole device. */ -#define UMATCH_VENDOR_PRODUCT_REV 14 -#define UMATCH_VENDOR_PRODUCT 13 -#define UMATCH_VENDOR_DEVCLASS_DEVPROTO 12 -#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO 11 -#define UMATCH_DEVCLASS_DEVSUBCLASS 10 -/* Next six codes are for interfaces. */ -#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE 9 -#define UMATCH_VENDOR_PRODUCT_CONF_IFACE 8 -#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO 7 -#define UMATCH_VENDOR_IFACESUBCLASS 6 -#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO 5 -#define UMATCH_IFACECLASS_IFACESUBCLASS 4 -#define UMATCH_IFACECLASS 3 -#define UMATCH_IFACECLASS_GENERIC 2 -/* Generic driver */ -#define UMATCH_GENERIC 1 -/* No match */ -#define UMATCH_NONE 0 - -#elif defined(__FreeBSD__) /* FreeBSD needs values less than zero */ #define UMATCH_VENDOR_PRODUCT_REV (-10) #define UMATCH_VENDOR_PRODUCT (-20) @@ -272,12 +249,9 @@ struct usb_attach_arg { #define UMATCH_GENERIC (-140) #define UMATCH_NONE (ENXIO) -#endif - #define USBD_SHOW_DEVICE_CLASS 0x1 #define USBD_SHOW_INTERFACE_CLASS 0x2 -#if defined(__FreeBSD__) int usbd_driver_load(module_t mod, int what, void *arg); static inline int @@ -294,8 +268,6 @@ usb_get_iface(device_t dev) return (uap->iface); } -#endif - /* XXX Perhaps USB should have its own levels? */ #ifdef USB_USE_SOFTINTR #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c index 46f1a8f69cb7..b39bc9cd1003 100644 --- a/sys/dev/usb/usbdi_util.c +++ b/sys/dev/usb/usbdi_util.c @@ -45,12 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__NetBSD__) || defined(__OpenBSD__) -#include -#include -#elif defined(__FreeBSD__) #include -#endif #include #include diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index 1c8386aa2236..eeb386c6f4b9 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -38,10 +38,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if defined(__NetBSD__) -#include -#endif - /* From usb_mem.h */ struct usb_dma_block; typedef struct { @@ -297,9 +293,6 @@ void usb_schedsoftintr(struct usbd_bus *); /* Locator stuff. */ -#if defined(__NetBSD__) -#include "locators.h" -#elif defined(__FreeBSD__) || defined(__OpenBSD__) /* XXX these values are used to statically bind some elements in the USB tree * to specific driver instances. This should be somehow emulated in FreeBSD * but can be done later on. @@ -311,16 +304,6 @@ void usb_schedsoftintr(struct usbd_bus *); #define UHUBCF_VENDOR_DEFAULT -1 #define UHUBCF_PRODUCT_DEFAULT -1 #define UHUBCF_RELEASE_DEFAULT -1 -#endif - -#if defined (__OpenBSD__) -#define UHUBCF_PORT 0 -#define UHUBCF_CONFIGURATION 1 -#define UHUBCF_INTERFACE 2 -#define UHUBCF_VENDOR 3 -#define UHUBCF_PRODUCT 4 -#define UHUBCF_RELEASE 5 -#endif #define uhubcf_port cf_loc[UHUBCF_PORT] #define uhubcf_configuration cf_loc[UHUBCF_CONFIGURATION] diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index 69288f498176..8552e27169ca 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -58,12 +58,8 @@ #include #include #include -#if defined(__NetBSD__) || defined(__OpenBSD__) -#include -#elif defined(__FreeBSD__) #include #include -#endif #include #include #include diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index ca98af451f52..7a6b24105f6b 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -48,14 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__FreeBSD__) #include #include #include -#else -#include -#include -#endif #include #include #include