aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/usb/usbmon.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/usb/usbmon.txt')
-rw-r--r--Documentation/usb/usbmon.txt27
1 files changed, 20 insertions, 7 deletions
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt
index 270481906dc8..6c3c625b7f30 100644
--- a/Documentation/usb/usbmon.txt
+++ b/Documentation/usb/usbmon.txt
@@ -229,16 +229,26 @@ struct usbmon_packet {
229 int status; /* 28: */ 229 int status; /* 28: */
230 unsigned int length; /* 32: Length of data (submitted or actual) */ 230 unsigned int length; /* 32: Length of data (submitted or actual) */
231 unsigned int len_cap; /* 36: Delivered length */ 231 unsigned int len_cap; /* 36: Delivered length */
232 unsigned char setup[8]; /* 40: Only for Control 'S' */ 232 union { /* 40: */
233}; /* 48 bytes total */ 233 unsigned char setup[SETUP_LEN]; /* Only for Control S-type */
234 struct iso_rec { /* Only for ISO */
235 int error_count;
236 int numdesc;
237 } iso;
238 } s;
239 int interval; /* 48: Only for Interrupt and ISO */
240 int start_frame; /* 52: For ISO */
241 unsigned int xfer_flags; /* 56: copy of URB's transfer_flags */
242 unsigned int ndesc; /* 60: Actual number of ISO descriptors */
243}; /* 64 total length */
234 244
235These events can be received from a character device by reading with read(2), 245These events can be received from a character device by reading with read(2),
236with an ioctl(2), or by accessing the buffer with mmap. 246with an ioctl(2), or by accessing the buffer with mmap. However, read(2)
247only returns first 48 bytes for compatibility reasons.
237 248
238The character device is usually called /dev/usbmonN, where N is the USB bus 249The character device is usually called /dev/usbmonN, where N is the USB bus
239number. Number zero (/dev/usbmon0) is special and means "all buses". 250number. Number zero (/dev/usbmon0) is special and means "all buses".
240However, this feature is not implemented yet. Note that specific naming 251Note that specific naming policy is set by your Linux distribution.
241policy is set by your Linux distribution.
242 252
243If you create /dev/usbmon0 by hand, make sure that it is owned by root 253If you create /dev/usbmon0 by hand, make sure that it is owned by root
244and has mode 0600. Otherwise, unpriviledged users will be able to snoop 254and has mode 0600. Otherwise, unpriviledged users will be able to snoop
@@ -279,9 +289,10 @@ size is out of [unspecified] bounds for this kernel, the call fails with
279This call returns the current size of the buffer in bytes. 289This call returns the current size of the buffer in bytes.
280 290
281 MON_IOCX_GET, defined as _IOW(MON_IOC_MAGIC, 6, struct mon_get_arg) 291 MON_IOCX_GET, defined as _IOW(MON_IOC_MAGIC, 6, struct mon_get_arg)
292 MON_IOCX_GETX, defined as _IOW(MON_IOC_MAGIC, 10, struct mon_get_arg)
282 293
283This call waits for events to arrive if none were in the kernel buffer, 294These calls wait for events to arrive if none were in the kernel buffer,
284then returns the first event. Its argument is a pointer to the following 295then return the first event. The argument is a pointer to the following
285structure: 296structure:
286 297
287struct mon_get_arg { 298struct mon_get_arg {
@@ -294,6 +305,8 @@ Before the call, hdr, data, and alloc should be filled. Upon return, the area
294pointed by hdr contains the next event structure, and the data buffer contains 305pointed by hdr contains the next event structure, and the data buffer contains
295the data, if any. The event is removed from the kernel buffer. 306the data, if any. The event is removed from the kernel buffer.
296 307
308The MON_IOCX_GET copies 48 bytes, MON_IOCX_GETX copies 64 bytes.
309
297 MON_IOCX_MFETCH, defined as _IOWR(MON_IOC_MAGIC, 7, struct mon_mfetch_arg) 310 MON_IOCX_MFETCH, defined as _IOWR(MON_IOC_MAGIC, 7, struct mon_mfetch_arg)
298 311
299This ioctl is primarily used when the application accesses the buffer 312This ioctl is primarily used when the application accesses the buffer