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

m. allan noah kitno455 at gmail.com
Thu Feb 25 15:38:43 UTC 2010


Do you find that the machine actually makes any control packets once
it starts scanning? Many scanners only use those at initial
configuration, which is taken care of by the host OS, and calls to set
interface, etc. I have found that I generally only use bulk packets
with most scanners...

allan

On Thu, Feb 25, 2010 at 10:27 AM, Gernot Hassenpflug
<aikishugyo at gmail.com> wrote:
> 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
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>             to sane-devel-request at lists.alioth.debian.org
>



-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list