summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-01-18 21:18:51 +0000
committerhselasky <hselasky@FreeBSD.org>2011-01-18 21:18:51 +0000
commit35d5fee7aa515cf92391bd533a8b4565c49b919c (patch)
tree1439c526c24fdf3a4820b9cffac345f001eeac0a /sys/dev/usb
parent460d7b088e1fcacc12a5985f400dd2b4e41a65fd (diff)
downloadFreeBSD-src-35d5fee7aa515cf92391bd533a8b4565c49b919c.zip
FreeBSD-src-35d5fee7aa515cf92391bd533a8b4565c49b919c.tar.gz
Make USB packet filtering code optional.
Approved by: thompsa (mentor)
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/controller/usb_controller.c6
-rw-r--r--sys/dev/usb/usb_freebsd.h1
-rw-r--r--sys/dev/usb/usb_transfer.c9
3 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index 867f8c5..408390c 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -206,8 +206,9 @@ usb_detach(device_t dev)
usb_proc_free(&bus->control_xfer_proc);
+#if USB_HAVE_PF
usbpf_detach(bus);
-
+#endif
return (0);
}
@@ -436,8 +437,9 @@ usb_attach_sub(device_t dev, struct usb_bus *bus)
usb_devclass_ptr = devclass_find("usbus");
mtx_unlock(&Giant);
+#if USB_HAVE_PF
usbpf_attach(bus);
-
+#endif
/* Initialise USB process messages */
bus->explore_msg[0].hdr.pm_callback = &usb_bus_explore;
bus->explore_msg[0].bus = bus;
diff --git a/sys/dev/usb/usb_freebsd.h b/sys/dev/usb/usb_freebsd.h
index efc27f2..49aa471 100644
--- a/sys/dev/usb/usb_freebsd.h
+++ b/sys/dev/usb/usb_freebsd.h
@@ -41,6 +41,7 @@
#define USB_HAVE_TT_SUPPORT 1
#define USB_HAVE_POWERD 1
#define USB_HAVE_MSCTEST 1
+#define USB_HAVE_PF 1
#define USB_TD_GET_PROC(td) (td)->td_proc
#define USB_PROC_GET_GID(td) (td)->p_pgid
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index b355d1a..11d67d5 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -2196,9 +2196,10 @@ usbd_callback_wrapper(struct usb_xfer_queue *pq)
}
}
+#if USB_HAVE_PF
if (xfer->usb_state != USB_ST_SETUP)
usbpf_xfertap(xfer, USBPF_XFERTAP_DONE);
-
+#endif
/* call processing routine */
(xfer->callback) (xfer, xfer->error);
@@ -2386,8 +2387,9 @@ usbd_transfer_start_cb(void *arg)
DPRINTF("start\n");
+#if USB_HAVE_PF
usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
-
+#endif
/* start the transfer */
(ep->methods->start) (xfer);
@@ -2565,8 +2567,9 @@ usbd_pipe_start(struct usb_xfer_queue *pq)
}
DPRINTF("start\n");
+#if USB_HAVE_PF
usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
-
+#endif
/* start USB transfer */
(ep->methods->start) (xfer);
OpenPOWER on IntegriCloud