Reputation: 1398
I try to hook-up a USB cellular GOBI 3000 MODEM in QMI mode on a Host port. The USB host subsystem works since I already hooked-up other devices (capacitive touch screen etc). The drivers required are the usual "usbnet.ko", there is also a "GobiSerial.ko" and a "GobiNet.ko". After I boot, I see the device on my USB HUB with the proper, manufacturer, VID, PID, with 4 interfaces. When I plug the MODEM, I have the following message on the terminal:
[352326.921871] usb 1-1.4: new full speed USB device using s5p-ohci and address 8
[352327.038871] usb 1-1.4: config 1 has an invalid interface number: 8 but max is 3
[352327.044804] usb 1-1.4: config 1 has no interface number 1
This message is generated by "drivers/usb/core/config.c" in function "usb_parse_interface". When I list the device on the USB, I see it (no driver were binded):
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=5ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=5ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
As we can see on the line "C:", the device has 4 interfaces. Then, on lines "I:" it lists the 4 interfaces as "0, 2, 3 and 8". In "include/linux/usb.h" it is said that "The USB standard says that interfaces are supposed to be numbered from 0 to desc.bNumInterfaces-1, but a lot of devices get this wrong." In Fact, if I connect another brand of Modem, it connects because it follows that rule. Look at that:
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=GobiNet
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=5ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=GobiSerial
E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=5ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=GobiSerial
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
As you can see, the 4 interfaces are numbered from 0 to 3. Now, that Modem is working on other systems in the world. What is the trick to get the drivers to bind to a device with non sequentially numbered interfaces?
I'd be happy with just some clues on where to look for that answer. I did not find an answer in O'Reilly's "Linux Device Drivers" neither in the source code and I've been looking for more than a day.
Here is the set-up:
Custom ARM Cortex A8 platform running Android Gingerbread with kernel 2.6.35.7. For that, it's the same as a standard Linux ARM. It just doesn't have all the bells and whistles of a full ubuntu system.
Upvotes: 2
Views: 3117
Reputation: 1398
The problem is solved and even though it looked like what was explained in the question, it had nothing to do with that. Even if there are several places in the Kernel code saying the USB interfaces should be numbered in sequence, it can handle it pretty much in any order. My real problem was a broken build system. At least one file was not getting updated and when I added traces in another file, it trigged an update on a module. That fixed the problem, making it work like "magic". I guess, I will start doing a "make clean" when I experience very strange things. After all, on a machine with lots of RAM and a killer Harddisk, it does not take that long to recompile the kernel.
Upvotes: 2