<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/usb/mon/usb_mon.h, branch v3.0.54</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.54</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.54'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2009-09-23T13:46:19+00:00</updated>
<entry>
<title>USB: usbmon: end ugly tricks with DMA peeking</title>
<updated>2009-09-23T13:46:19+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2009-06-11T14:53:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4e9e92003529e5c7bb11281f7c2c9b3fe8858403'/>
<id>urn:sha1:4e9e92003529e5c7bb11281f7c2c9b3fe8858403</id>
<content type='text'>
This patch fixes crashes when usbmon attempts to access GART aperture.
The old code attempted to take a bus address and convert it into a
virtual address, which clearly was impossible on systems with actual
IOMMUs. Let us not persist in this foolishness, and use transfer_buffer
in all cases instead.

I think downsides are negligible. The ones I see are:
 - A driver may pass an address of one buffer down as transfer_buffer,
   and entirely different entity mapped for DMA, resulting in misleading
   output of usbmon. Note, however, that PIO based controllers would
   do transfer the same data that usbmon sees here.
 - Out of tree drivers may crash usbmon if they store garbage in
   transfer_buffer. I inspected the in-tree drivers, and clarified
   the documentation in comments.
 - Drivers that use get_user_pages will not be possible to monitor.
   I only found one driver with this problem (drivers/staging/rspiusb).
 - Same happens with with usb_storage transferring from highmem, but
   it works fine on 64-bit systems, so I think it's not a concern.
   At least we don't crash anymore.

Why didn't we do this in 2.6.10? That's because back in those days
it was popular not to fill in transfer_buffer, so almost all
traffic would be invisible (e.g. all of HID was like that).
But now, the tree is almost 100% PIO friendly, so we can do the
right thing at last.

Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: reorganize urb-&gt;status use in usbmon</title>
<updated>2007-10-12T21:55:23+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-08-24T19:41:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9347d51c52afcf1a77d2104f162cf8a085624c83'/>
<id>urn:sha1:9347d51c52afcf1a77d2104f162cf8a085624c83</id>
<content type='text'>
This patch (as978) reorganizes the way usbmon uses urb-&gt;status.  It
now accepts the status value as an argument.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>usbmon: Add class for binary interface</title>
<updated>2007-07-12T23:29:47+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2007-05-03T23:51:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ce7cd137fced114d49178b73d468b82096a107fb'/>
<id>urn:sha1:ce7cd137fced114d49178b73d468b82096a107fb</id>
<content type='text'>
Add a class which allows for an easier integration with udev.

This code was originally written by Paolo Abeni, and arrived to my tree
as a part of big patch to add binary API on December 18. As I understand,
Paolo always meant the class to be a part of the whole thing. This is his
udev rule to go along with the patch:

KERNEL=="usbmon[0-9]*", NAME="usbmon%n", MODE="0440",OWNER="root",GROUP="bin"

Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>usbmon: bus zero</title>
<updated>2007-04-27T20:28:39+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2007-04-11T20:47:26+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ecb658d387dc09f344b3d755e8674076072032c7'/>
<id>urn:sha1:ecb658d387dc09f344b3d755e8674076072032c7</id>
<content type='text'>
Add the "bus zero" feature to the usbmon. If a user process specifies bus
with number zero, it receives events from all buses. This is useful when
we wish to see initial enumeration when a bus is created, typically after
a modprobe. Until now, an application had to loop until a new bus could
be open, then start capturing on it. This procedure was cumbersome and
could lose initial events. Also, often it's too bothersome to find exactly
to which bus a specific device is attached.

Paolo Albeni provided the original concept implementation. I added the
handling of "bus-&gt;monitored" flag and generally fixed it up.

Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>usbmon: Extended text API</title>
<updated>2007-04-27T20:28:33+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2007-02-25T03:27:33+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f1c9e30b5e4cdd8aae5f0ea87004b1b61ec41881'/>
<id>urn:sha1:f1c9e30b5e4cdd8aae5f0ea87004b1b61ec41881</id>
<content type='text'>
This patch adds a new text API, codenamed '1u', which captures more URB
fields than old '1t' interface did. Also the '1u' text API is compatible
with the future "bus zero" extension.

Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>usbmon: Remove erroneous __exit</title>
<updated>2007-02-23T23:03:45+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2007-02-20T18:37:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=21641e3fb1c2e53b3a0acf68e6f62f1f82f61445'/>
<id>urn:sha1:21641e3fb1c2e53b3a0acf68e6f62f1f82f61445</id>
<content type='text'>
mon_bin_exit() and mon_text_exit() are called from __init code, so don't mark
them as __exit.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: add binary API to usbmon</title>
<updated>2007-02-07T23:44:34+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2006-12-31T06:43:10+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6f23ee1fefdc1f80bd8a3ab04a1c41ab2dec14c9'/>
<id>urn:sha1:6f23ee1fefdc1f80bd8a3ab04a1c41ab2dec14c9</id>
<content type='text'>
This patch adds a new, "binary" API in addition to the old, text API usbmon
had before. The new API allows for less CPU use, and it allows to capture
all data from a packet where old API only captured 32 bytes at most. There
are some limitations and conditions to this, e.g. in case someone constructs
a URB with 1GB of data, it's not likely to be captured, because even the
huge buffers of the new reader are finite. Nonetheless, I expect this new
capability to capture all data for all real life scenarios.

The downside is, a special user mode application is required where cat(1)
worked before. I have sample code at http://people.redhat.com/zaitcev/linux/
and Paolo Abeni is working on patching libpcap.

This patch was initially written by Paolo and later I tweaked it, and
we had a little back-and-forth. So this is a jointly authored patch, but
I am submitting this I am responsible for the bugs.

Signed-off-by: Paolo Abeni &lt;paolo.abeni@email.it&gt;
Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>usbmon: don't call mon_dmapeek if DMA isn't being used</title>
<updated>2006-09-27T18:58:56+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2006-08-30T15:35:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4d6cd48380c4d361cc8ec34359df22377d85d202'/>
<id>urn:sha1:4d6cd48380c4d361cc8ec34359df22377d85d202</id>
<content type='text'>
This patch (as755b) fixes a bug in usbmon.  Rather than assuming all
USB host controllers use DMA, the code will check the usb_bus data
structure.  If DMA isn't used, we don't want to try peeking into a
non-existent DMA buffer!

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: Make file operations structs in drivers/usb const.</title>
<updated>2006-09-27T18:58:52+00:00</updated>
<author>
<name>Luiz Fernando N. Capitulino</name>
<email>lcapitulino@mandriva.com.br</email>
</author>
<published>2006-08-05T23:37:11+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=066202dd48cf3296b6cc22b5fcf89aef33fa0efc'/>
<id>urn:sha1:066202dd48cf3296b6cc22b5fcf89aef33fa0efc</id>
<content type='text'>
Making structs const prevents accidental bugs and with the proper debug
options they're protected against corruption.

Signed-off-by: Luiz Fernando N. Capitulino &lt;lcapitulino@mandriva.com.br&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>[PATCH] USB: implement error event in usbmon</title>
<updated>2006-06-21T22:04:17+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2006-06-10T05:03:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=12e72feab5d9a23107f245b0f241a2484cbb5a4e'/>
<id>urn:sha1:12e72feab5d9a23107f245b0f241a2484cbb5a4e</id>
<content type='text'>
Implement the "error" event in usbmon.

Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
