diff options
| author | Pete Zaitcev <zaitcev@redhat.com> | 2005-03-07 06:52:55 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-03-07 06:52:55 -0800 |
| commit | 0bcdd9489f3c853cdb38291f1d5385f6ab660223 (patch) | |
| tree | 5b6e7934abdd4992c4caf2dcbb219b856aa78167 /include/linux/usb.h | |
| parent | 73ad99b6fcf5b8b2a3cf41a1b98f1c548be258d3 (diff) | |
[PATCH] USB: add usbmon, a USB monitoring framework
This patch adds so-called "usbmon", or USB monitoring framework, similar
to what tcpdump provides for Ethernet. This is an initial version, but
it should be safe and useful. It adds an overhead of an if () statement
into submission and giveback paths even when not monitoring, but this
was deemed a lesser evil than stealth manipulation of function pointers.
The patch makes two changes to hcd.c which make usbmon more useful:
- Change the way we determine that DMA should not be mapped for root
hubs, so that usbmon knows easily when it's safe to capture data.
- Return exports of usb_bus_list and usb_bus_list_lock for those who
wish to build usbmon as a module.
This version of the patch changes #define to inlines for hooks and
drops extra mod_ops.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb.h')
| -rw-r--r-- | include/linux/usb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7dbcc054c7dc..d4403982dafd 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -285,6 +285,10 @@ struct usb_bus { struct class_device class_dev; /* class device for this bus */ void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ +#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) + struct mon_bus *mon_bus; /* non-null when associated */ + int monitored; /* non-zero when monitored */ +#endif }; #define to_usb_bus(d) container_of(d, struct usb_bus, class_dev) |
