Re: reverse-engineering a usb device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

Sorry, I didn't read your next email before reply.

Anyway, I can't help you much, but maybe I can help you translating
those byte sequences.

Arranged in host-device dialog:
down 25.875:
55 53 42 43 -> dCBWSignature: Command from host to device
08 8d e2 81 -> dCBWTag: Command tag, reply the answer with this tag
.... -> There should be extra several bytes here, regarding the command
that host issued

up   25.875:
55 53 42 53 -> dCSWSignature: Command reply from device to host
08 8d e2 81 -> dCSWTag: This is reply to 0x81e28d08 command
... -> There should be another extra several bytes here, regarding the
command status

Most of your packets are consist of standard MSD query. However, there
are patterns that I don't recognize. These packets have no CBW/CSW
signature. Either it's a corrupted command or part of the data from last
MSD query (but I don't think it is).

down 25.875: 00 00 00 00 7f 20 00 00 
up     25.875: 70 00 02 00 00 00 00 0a
down 25.891: 00 00 00 00 00 00 00 0a 
up     25.891: 70 00 02 00 00 00 00 0a 
down 25.906: 70 00 02 00 00 00 00 0a 
up     25.906: 70 00 02 00 00 00 00 0a

The only command that's allowed in MSD bulk endpoint is just CBW/CSW.
Other commands (including MSD class specific command) should be
delivered through default/control pipe. That is if the device strictly
following the USB standard (and if my memory about USB standard is still
intact =D ).

Hope that helps.

Regards,
-daniel

On Fri, 2009-02-13 at 15:14 +0100, Christoph Gysin wrote:
> > The buttons on USB devices usually are connected into HID interface. I
> > guess that's how your SanDisk card reader button communicates too.
> 
> Unfortunately this is not the case.
> 
> > If you look at the `lsusb -v` output you'll see how many interfaces that
> > it implements. The MSD (Mass Storage Class) is the data channel, which
> > normally unrelated to buttons or leds on the device.
> 
> My device has only one interface type 08 (mass storage) with two
> endpoints type bulk. No interrupt enpoint unfortuantely.
> 
> > This page may help you: http://www.frogmouth.net/hid-doco/linux-hid.html
> 
> Thanks, I'll check it out.
> 
> > Also, your USB endpoints info can be viewed
> > in  /sys/class/usb_endpoint/usbdev
> 
> I prefer usbview by GregKH.
> 
> Thanks,
> Chris


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux