summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-06-12 19:40:20 +0000
committerimp <imp@FreeBSD.org>2007-06-12 19:40:20 +0000
commitbed92e37b990e7d96eecf2017d1eb53cfcf0eb4b (patch)
tree408dfdf4d19cb2980934e832dd0e70d9983b1c71
parentac79d73e564811041d31e1a7c080c7dbc1040b97 (diff)
downloadFreeBSD-src-bed92e37b990e7d96eecf2017d1eb53cfcf0eb4b.zip
FreeBSD-src-bed92e37b990e7d96eecf2017d1eb53cfcf0eb4b.tar.gz
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.
-rw-r--r--sys/dev/usb/hid.c3
-rw-r--r--sys/dev/usb/usbdi.c14
-rw-r--r--sys/dev/usb/usbdi.h28
-rw-r--r--sys/dev/usb/usbdi_util.c5
-rw-r--r--sys/dev/usb/usbdivar.h17
-rw-r--r--sys/dev/usb/uvisor.c4
-rw-r--r--sys/dev/usb/uvscom.c5
7 files changed, 3 insertions, 73 deletions
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
index b2e15ae..dc8f8e1 100644
--- a/sys/dev/usb/hid.c
+++ b/sys/dev/usb/hid.c
@@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__NetBSD__)
-#include <sys/kernel.h>
-#endif
#include <sys/malloc.h>
#include <dev/usb/usb.h>
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index a507eec..eb9ad33 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -42,17 +42,12 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/kernel.h>
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
#include <sys/module.h>
#include <sys/bus.h>
#include "usb_if.h"
#if defined(DIAGNOSTIC) && defined(__i386__)
#include <machine/cpu.h>
#endif
-#endif
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -65,10 +60,8 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_mem.h>
#include <dev/usb/usb_quirks.h>
-#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 fb1af43..52f2a01 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 46f1a8f..b39bc9c 100644
--- a/sys/dev/usb/usbdi_util.c
+++ b/sys/dev/usb/usbdi_util.c
@@ -45,12 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/malloc.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/proc.h>
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
#include <sys/bus.h>
-#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 1c8386a..eeb386c 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 <sys/callout.h>
-#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 69288f4..8552e27 100644
--- a/sys/dev/usb/uvisor.c
+++ b/sys/dev/usb/uvisor.c
@@ -58,12 +58,8 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
#include <sys/module.h>
#include <sys/bus.h>
-#endif
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/sysctl.h>
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index ca98af4..7a6b241 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -48,14 +48,9 @@ __FBSDID("$FreeBSD$");
#include <sys/serial.h>
#include <sys/tty.h>
#include <sys/file.h>
-#if defined(__FreeBSD__)
#include <sys/bus.h>
#include <sys/ioccom.h>
#include <sys/selinfo.h>
-#else
-#include <sys/ioctl.h>
-#include <sys/device.h>
-#endif
#include <sys/proc.h>
#include <sys/poll.h>
#include <sys/sysctl.h>
OpenPOWER on IntegriCloud