[sane-devel] SniffUSB: URB direction and TransferFlags IN/OUT confusion

Gernot Hassenpflug aikishugyo at gmail.com
Thu Feb 25 15:27:43 UTC 2010


On Thu, Feb 25, 2010 at 8:28 PM, Pierre Willenbrock
<pierre at pirsoft.dnsalias.org> wrote:
> Gernot Hassenpflug schrieb:
>> 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:
>
> What happens is this: The device driver(mass-storage driver, hid-driver
> etc) sends requests that go to the host controller driver that tells the
> host controller to make it happen. For that, the information in the URB
> is used to create a request structure and put it into one of the queues
> of the host controller. Later, the host controller tells its driver that
> this request has been worked on. The host controller driver then
> modifies the URB accordingly(status codes, data received) and sends it
> back to the driver.
>
> On Windows, in between the host controller and the driver, there can be
> "filters", and that is the place where usbsnoop hooks into.

Thank you very much. I'm still ploughing through "usb in a nutshell",
the usb 2.0 spec docs, a short but eminently useful weblog on reverse
engineering windows device drivers, and am getting the idea now of how
the host sends data or requests it.

I notice that in the latter document, usbsnoop I think (from what was
written) was used and before the setup packet it gives in the log:
1) UrbLink
2) RequestTypeReservedBits
3) Value (which I understand is a parameter for the command)
4) Index (which I understand is the command, or offset for it)
followed by the setup package byte representation using the above information.

Usbsnoop which I use (2.0) does not seem to give the values 2,3,4,
which makes it a bit more tricky to enter values into C programs for
things like usb_control_msg (I'm not up to speed on sanei so not sure
what to use initially yet, simple is best maybe).

Which version of usbsnoop do people prefer here?

Best regards,
Gernot



More information about the sane-devel mailing list