[patch 2.6.21-git] handle more rndis_host oddities
David Brownell <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Workaround another device firmware bug, wherein CDC descriptors get placed in a wrong place never previously observed in the wild. Fix a bug where a seeming RNDIS device returns a bogus response during device initialization. Signed-off-by: David Brownell <[email protected]> --- drivers/usb/net/cdc_ether.c | 16 ++++++++++++++++ drivers/usb/net/rndis_host.c | 1 + 2 files changed, 17 insertions(+) --- g26.orig/drivers/usb/net/cdc_ether.c 2007-04-29 10:05:01.000000000 -0700 +++ g26/drivers/usb/net/cdc_ether.c 2007-04-29 10:06:44.000000000 -0700 @@ -91,6 +91,22 @@ int usbnet_generic_cdc_bind(struct usbne "CDC descriptors on config\n"); } + /* Maybe CDC descriptors are after the endpoint? This bug has + * been seen on some 2Wire Inc RNDIS-ish products. + */ + if (len == 0) { + struct usb_host_endpoint *hep; + + hep = intf->cur_altsetting->endpoint; + if (hep) { + buf = hep->extra; + len = hep->extralen; + } + if (len) + dev_dbg(&intf->dev, + "CDC descriptors on endpoint\n"); + } + /* this assumes that if there's a non-RNDIS vendor variant * of cdc-acm, it'll fail RNDIS requests cleanly. */ --- g26.orig/drivers/usb/net/rndis_host.c 2007-04-29 10:05:01.000000000 -0700 +++ g26/drivers/usb/net/rndis_host.c 2007-04-29 10:06:44.000000000 -0700 @@ -515,6 +515,7 @@ static int rndis_bind(struct usbnet *dev dev_err(&intf->dev, "dev can't take %u byte packets (max %u)\n", dev->hard_mtu, tmp); + retval = -EINVAL; goto fail_and_release; } ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel