Bug#655387: [PATCH] usb: cdc_ether: Ignore bogus union descriptor for RNDIS devices

2012-01-11 Thread Iker Salmón San Millán
2012/1/11 Bjørn Mork bj...@mork.no

 if you have the patience to test yet-another-patch.


 Bjørn


Yes, I do, but:

2012/1/11 Oliver Neukum said:
You are trying something subtle here. Stop doing that. Use a dedicated flag
or a clearly named goto.

All this is obviusly over my programming skills so, just tell me what to do
and i'll do it.

Iker


Bug#655387: Samsung galaxy S won't tether trough usb due to bad CDC descriptors

2012-01-10 Thread Iker Salmón San Millán
El 10 de enero de 2012 21:21, Jonathan Nieder jrnie...@gmail.com escribió:

 Iker Salmón San Millán wrote:

  This bug affects all kernels i've tried in debian wheezy, sid and
  experimental, I found a bug report in ubuntu where i found this patch
 that
  solves the problem, but the user who wrote the patch described it as
  workaroung instead of fix:

 Link, please.

 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/796006


 Also, could you describe the symptoms further?  What steps would I
 perform to reproduce the bug if I had the hardware, what are the
 expected and actual results, and how does the difference indicate a
 bug?

 If you connect the samsung galaxy S (i know also SII is affected) to the
usb hub and activate usb tethering it won't create usb0 interface and dmesg
shows this:

[  509.033511] usb 2-2: USB disconnect, device number 5
[  509.304059] usb 2-2: new high-speed USB device number 6 using ehci_hcd
[  509.438155] usb 2-2: New USB device found, idVendor=04e8, idProduct=6881
[  509.438165] usb 2-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[  509.438172] usb 2-2: Product: SAMSUNG_Android
[  509.438178] usb 2-2: Manufacturer: SAMSUNG
[  509.438183] usb 2-2: SerialNumber: 353271BC9D8400EC
[  509.743606] usbcore: registered new interface driver cdc_ether
[  509.745205] usb 2-2: bad CDC descriptors
[  509.745231] usbcore: registered new interface driver rndis_host
[  509.753788] usb 2-2: bad CDC descriptors
[  509.753821] usbcore: registered new interface driver rndis_wlan

If you apply the patch and rebuild the kernel the usb0 interface is created
correctly when you activate usb tether.

I don't know what else can i comment, surely there are people much more
prepared than me to report this things, but i'll try my best if you ask me
something or ask me tro try anything


 Thanks for your work,
 Jonathan


No, Thanks for yours
Iker


Bug#655387: [PATCH] usb: cdc_ether: Ignore bogus union descriptor for RNDIS devices

2012-01-10 Thread Iker Salmón San Millán
Sorry, but didn't work, same dmesg with bad cdc descriptors and usb0
interface is not created.
I tested with 3.2.0-rc7 kernel.

Regards, iker

2012/1/10 Bjørn Mork bj...@mork.no

 Some RNDIS devices include a bogus CDC Union descriptor pointing
 to non-existing interfaces.  The RNDIS code is already prepared
 to handle devices without a CDC Union descriptor, so we can just
 ignore it.

 Cc: Markus Kolb linux-201...@tower-net.de
 Cc: Iker Salmón San Millán sha...@esdebian.org
 Cc: Jonathan Nieder jrnie...@gmail.com
 Cc: Oliver Neukum oli...@neukum.name
 Cc: 655...@bugs.debian.org
 Cc: sta...@vger.kernel.org
 Signed-off-by: Bjørn Mork bj...@mork.no
 ---
 How about this, which IMHO is less intrusive? Only build-tested, as I
 don't have any of the failing devices, so it will obviously need
 testing from anyone with such a device.

  drivers/net/usb/cdc_ether.c |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)

 diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
 index 41a61ef..2109f34 100644
 --- a/drivers/net/usb/cdc_ether.c
 +++ b/drivers/net/usb/cdc_ether.c
 @@ -195,7 +195,15 @@ int usbnet_generic_cdc_bind(struct usbnet *dev,
 struct usb_interface *intf)
info-control,
info-u-bSlaveInterface0,
info-data);
 -   goto bad_desc;
 +   /* Fallback to guessing for rndis
 +* class devices with bogus union
 +* descriptor.
 +* Fixes some Samsung Android devices
 +*/
 +   if (rndis)
 +   info-u = NULL;
 +   else
 +   goto bad_desc;
}
if (info-control != intf) {
dev_dbg(intf-dev, bogus CDC Union\n);
 --
 1.7.7.3