summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_transfer.c
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2010-11-22 01:11:28 +0000
committerweongyo <weongyo@FreeBSD.org>2010-11-22 01:11:28 +0000
commit1dec7bdf779e4fd81bb16a8ae1824b574065d674 (patch)
treee30a5d6b6cba53b47cf43788661135e40dde3c9e /sys/dev/usb/usb_transfer.c
parentef35e5a176dd37c34a8da9292301a56bc04ebe7e (diff)
downloadFreeBSD-src-1dec7bdf779e4fd81bb16a8ae1824b574065d674.zip
FreeBSD-src-1dec7bdf779e4fd81bb16a8ae1824b574065d674.tar.gz
Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers. Its implementations are almost based on BPF code and very similar with it except it's little bit customized for USB packet only. The userland program usbdump(8) would be committed soon. Discussed with: hps, thompsa, yongari
Diffstat (limited to 'sys/dev/usb/usb_transfer.c')
-rw-r--r--sys/dev/usb/usb_transfer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index e0f5a3b..cdaa227 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -60,6 +60,7 @@
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
+#include <dev/usb/usb_pf.h>
struct usb_std_packet_size {
struct {
@@ -2196,6 +2197,9 @@ usbd_callback_wrapper(struct usb_xfer_queue *pq)
}
}
+ if (xfer->usb_state != USB_ST_SETUP)
+ usbpf_xfertap(xfer, USBPF_XFERTAP_DONE);
+
/* call processing routine */
(xfer->callback) (xfer, xfer->error);
@@ -2383,6 +2387,8 @@ usbd_transfer_start_cb(void *arg)
DPRINTF("start\n");
+ usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
+
/* start the transfer */
(ep->methods->start) (xfer);
@@ -2560,6 +2566,8 @@ usbd_pipe_start(struct usb_xfer_queue *pq)
}
DPRINTF("start\n");
+ usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
+
/* start USB transfer */
(ep->methods->start) (xfer);
OpenPOWER on IntegriCloud