svn commit: r217558 - in head/sys/dev/usb: . controller
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Jan 18 21:18:52 UTC 2011
Author: hselasky
Date: Tue Jan 18 21:18:51 2011
New Revision: 217558
URL: http://svn.freebsd.org/changeset/base/217558
Log:
Make USB packet filtering code optional.
Approved by: thompsa (mentor)
Modified:
head/sys/dev/usb/controller/usb_controller.c
head/sys/dev/usb/usb_freebsd.h
head/sys/dev/usb/usb_transfer.c
Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c Tue Jan 18 21:18:31 2011 (r217557)
+++ head/sys/dev/usb/controller/usb_controller.c Tue Jan 18 21:18:51 2011 (r217558)
@@ -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_
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;
Modified: head/sys/dev/usb/usb_freebsd.h
==============================================================================
--- head/sys/dev/usb/usb_freebsd.h Tue Jan 18 21:18:31 2011 (r217557)
+++ head/sys/dev/usb/usb_freebsd.h Tue Jan 18 21:18:51 2011 (r217558)
@@ -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
Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c Tue Jan 18 21:18:31 2011 (r217557)
+++ head/sys/dev/usb/usb_transfer.c Tue Jan 18 21:18:51 2011 (r217558)
@@ -2196,9 +2196,10 @@ usbd_callback_wrapper(struct usb_xfer_qu
}
}
+#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 *p
}
DPRINTF("start\n");
+#if USB_HAVE_PF
usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
-
+#endif
/* start USB transfer */
(ep->methods->start) (xfer);
More information about the svn-src-all
mailing list