On Sun, 9 May 2004, Zariel Skotlex wrote:

> Anyway, lsusb -v yields the following (I decided to include everything.. which
> is just the ohci, ehci and modem data):

As you found out, the string descriptors values listed here each belong to 
the previous descriptor:

> 
> Bus 002 Device 002: ID 07b2:5100 Motorola BCS, Inc. 
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0 
>   bDeviceProtocol         0 
>   bMaxPacketSize0        32
>   idVendor           0x07b2 Motorola BCS, Inc.
>   idProduct          0x5100 
>   bcdDevice            1.01
>   iManufacturer           1     

Blank, maybe because this is the first string query.

>   iProduct                2 Broadcom Corporation

That's really the Manufacturer.

>   iSerial                 3 USB Cable Modem

That's really the Product.

>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           80
>     bNumInterfaces          2
>     bConfigurationValue     1
>     iConfiguration          4

I would expect that to be the Serial number but instead it's blank -- in
other words, it's correct.  Who knows why...

>     bmAttributes         0xe0
>       Self Powered
>       Remote Wakeup
>     MaxPower              100mA
>   unknown descriptor type: 05 24 00 10 01
>   unknown descriptor type: 05 24 06 00 01
>   unknown descriptor type: 0d 24 0f 03 00 00 00 00 ea 05 00 00 00
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass      6 Ethernet Networking
>       bInterfaceProtocol      0 
>       iInterface              5 000CE53D2E1B

That's really the Serial number.

>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x85  EP 5 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               none
>         wMaxPacketSize          8
>         bInterval              64
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass        10 Data
>       bInterfaceSubClass      0 Unused
>       bInterfaceProtocol      0 
>       iInterface              6 Communication Interface Class

That's the string for the previous interface.  Notice that the string 
index listed here is 6.

>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       1
>       bNumEndpoints           2
>       bInterfaceClass        10 Data
>       bInterfaceSubClass      0 Unused
>       bInterfaceProtocol      0 
>       iInterface              6 Data Interface Class

That's the string for the previous interface.  Notice that the string 
index again is 6.

>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               none
>         wMaxPacketSize         64
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               none
>         wMaxPacketSize         64
>         bInterval               0
>   Language IDs: (length=42)
>      0044 Tatar(Tatar)
>      0061 Nepali(Nepali)
>      0074 (null)((null))
>      0061 Nepali(Nepali)
>      0020 Urdu(Urdu)
>      0049 Tamil(Tamil)
>      006e (null)((null))
>      0074 (null)((null))
>      0065 (null)((null))
>      0072 (null)((null))
>      0066 (null)((null))
>      0061 Nepali(Nepali)
>      0063 (null)((null))
>      0065 (null)((null))
>      0020 Urdu(Urdu)
>      0043 Uzbek(Uzbek)
>      006c (null)((null))
>      0061 Nepali(Nepali)
>      0073 (null)((null))
>      0073 (null)((null))

If you go to the trouble of decoding the ASCII values, you'll find that 
this says "Data Interface Class", which is the string for the previous 
interface.  These string values are corroborated by the 2.4 results:

> Finally.. here's how usbls -v looks like under 2.4 (ie when the modem works):
> 
> //-------------------------------------------------------
> Bus 002 Device 003: ID 07b2:5100 Motorola BCS, Inc. 
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0 
>   bDeviceProtocol         0 
>   bMaxPacketSize0        32
>   idVendor           0x07b2 Motorola BCS, Inc.
>   idProduct          0x5100 
>   bcdDevice            1.01
>   iManufacturer           1 Broadcom Corporation
>   iProduct                2 USB Cable Modem
>   iSerial                 3 000CE53D2E1B
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           80
>     bNumInterfaces          2
>     bConfigurationValue     1
>     iConfiguration          4
>     bmAttributes         0xe0
>       Self Powered
>       Remote Wakeup
>     MaxPower              100mA
>   unknown descriptor type: 05 24 00 10 01
>   unknown descriptor type: 05 24 06 00 01
>   unknown descriptor type: 0d 24 0f 03 00 00 00 00 ea 05 00 00 00
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass      6 Ethernet Networking
>       bInterfaceProtocol      0 
>       iInterface              5 Communication Interface Class
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x85  EP 5 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               none
>         wMaxPacketSize          8
>         bInterval              64
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass        10 Data
>       bInterfaceSubClass      0 Unused
>       bInterfaceProtocol      0 
>       iInterface              6 Data Interface Class
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       1
>       bNumEndpoints           2
>       bInterfaceClass        10 Data
>       bInterfaceSubClass      0 Unused
>       bInterfaceProtocol      0 
>       iInterface              6 Data Interface Class
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               none
>         wMaxPacketSize         64
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               none
>         wMaxPacketSize         64
>         bInterval               0
>   Language IDs: (length=4)
>      0409 English(US)
> //-------------------------------------------------------
> I ran a vimdiff between both, and lo and behold (CDCEther is on the left, usbnet
> on the right)....
> 
> //-------------------------------------------------------
> iManufacturer 1 Broadcom Corporation          |    iManufacturer           1 
> iProduct      2 USB Cable Modem               |    iProduct                2 Broadcom
> Corporation
> iSerial               3 000CE53D2E1B                  |    iSerial                 3 
> USB
> Cable Modem
> iInterface      5 Communication Interface Class |    iInterface              5
> 000CE53D2E1B
> //-------------------------------------------------------
> 
> I looks like somewhere usbnet read the data with an offset it shouldn't have (or
> did the string descriptor came with an unexpected offset?). Hmm... interesting
> (this would explain why it fails on the get HW address... instead of the
> hardware address it is reading "Communication Interface Class"!)

Just so.  For some reason, under 2.6 the modem is returning for most of
the queries the answer to the _previous_ query.  This makes no sense to me
at all.  It's not a simple matter of changing the string index -- on the
two occasions the modem was asked for string 6 it gave two different
results!

I can't imagine why it should behave like this.  Firmware bug, obviously, 
but a very strange one.

However, I can tell you that the code responsible for retrieving string
descriptors changed between 2.4 and 2.6.  Under 2.4 the code simply asks
for 255 bytes of data and accepts as much as the device will send.  Under
2.6 the code first asks just for 2 bytes (which contain the actual length)
and then asks for just that much data.  But I can't see how this would
cause the modem to misbehave in the way you're seeing.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to