Re: RNDIS device detection

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

 



On Mon, 19 Apr 2010, avictor.za@xxxxxxxxx wrote:

> hi David,
> 
> I'm hoping you can point me in the right direction to get this working.
> 
> I have a USB device, which supposedly exposes an Ethernet Gadget
> (RNDIS) interface.
> The device is detected fine and works under Windows, but I just can't
> get it detected on Linux.
> 
> The usbnet_probe() in usbnet.c doesn't even get called
> 
> 
> > modprobe rndis_host
> > dmesg
> [   81.345662] usbcore: registered new interface driver cdc_ether
> [   81.365087] usbcore: registered new interface driver rndis_host
> [   93.620023] usb 1-6: new high speed USB device using ehci_hcd and address 2
> [   93.852765] usb 1-6: config 1 has 0 interfaces, different from the
> descriptor's value: 1
> [   93.853384] usb 1-6: configuration #1 chosen from 2 choices

> > cat /debugfs/usb/devices
> 
> T:  Bus=01 Lev=01 Prnt=01 Port=05 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
> P:  Vendor=07a6 ProdID=4610 Rev= 2.18
> S:  Manufacturer=Linux 2.6.20-Amazon_SE/dwc_otg_pcd
> S:  Product=RNDIS/Ethernet Gadget
> S:  SerialNumber=080112111113
> C:  #Ifs= 2 Cfg#= 2 Atr=c0 MxPwr=500mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=
> E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
> I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> C:* #Ifs= 0 Cfg#= 1 Atr=c0 MxPwr=500mA
> 
> 
> The host is an x86 running 2.6.31.9.
> 
> Any suggestions would be much appreciated.

Hah, this is amusing.  It looks like you found a bug in the code Linux 
uses for choosing the "best" configuration.

Below is a patch to fix the bug; you can test it.  For regular kernels,
you should be able to work around the problem by manually telling the
kernel which configuration to use:

	echo 2 >/sys/bus/usb/devices/1-6/bConfigurationValue

Of course, for this to work you have to make sure that 
CONFIG_USB_NET_RNDIS_HOST is enabled in your kernel.

Alan Stern



Index: usb-2.6/drivers/usb/core/generic.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/generic.c
+++ usb-2.6/drivers/usb/core/generic.c
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_
 		 * than a vendor-specific driver. */
 		else if (udev->descriptor.bDeviceClass !=
 						USB_CLASS_VENDOR_SPEC &&
-				(!desc || desc->bInterfaceClass !=
+				(desc && desc->bInterfaceClass !=
 						USB_CLASS_VENDOR_SPEC)) {
 			best = c;
 			break;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux