[sane-devel] SniffUSB: URB direction and TransferFlags IN/OUT confusion
Gernot Hassenpflug
aikishugyo at gmail.com
Thu Feb 25 11:00:49 UTC 2010
On Thu, Feb 25, 2010 at 7:05 PM, Pierre Willenbrock
<pierre at pirsoft.dnsalias.org> wrote:
> Gernot Hassenpflug schrieb:
>> On Thu, Feb 25, 2010 at 1:05 AM, m. allan noah <kitno455 at gmail.com> wrote:
>> /../
>> Are endpoints apart from the default 0x00000000 able to have both IN
>> and OUT now? Or did I misunderstand the log file (and spike4 output
>> also)?
>
> The bulk endpoints are either in or out. The type is encoded (iirc) in
> bit7 of the endpoint number, 1 means in, 0 means out. usbsnoop always
> dumps the buffer when a request goes down to the device, even when it is
> about to be overwritten.
Hello Pierre, thank you for that. And especially for the tip on where
usbsnoop sits: without thinking I'd assumed I was seeing communication
between Host and Function (device), but now that I have gotten through
about 1/3 of the USB 2.0 spec document (after reading most of the USB
tutorials I could find) I have to realize I don't know what I am
looking at exactly!
>>>> 2) snoop headings like ">>> URB 16 going down >>>" and "<<< URB
>>>> 16 coming back <<<" are both followed by: /../
>
> This is just the USB Request Block(URB) that goes down to the lower
> levels of the usb stack and coming back from there. It is just the same
> URB going through usbsnoop in different directions, as evidenced by the
> same URB number. Remember that usbsnoop sits in the stack and acts like
> a filter, and that urb processing happens asynchronously.
OK, I'll post again after I digest that, and more specs, to figure out
when the host is talking to the function (device). I see from the
specs that there is also a hub between the two, but as far as I can
tell it should be transparent to sniffusb.
Recap: the host has buffers, the function (device) has endpoints. The
endpoints (except default) have to be configured before being used (I
see that info fine in the sniff logs), and they are unidirectional
(except default which is bi-directional). Some URBs show
TransferBuffer length but no data, but I guess I will examine the spec
docs and log further to find out what I am missing in understanding.
Thanks for the useful comments and helpful tips so far everyone,
Gernot Hassenpflug
More information about the sane-devel
mailing list