ChangeSet 1.1628, 2004/05/13 14:13:38-07:00, david-b@pacbell.net [PATCH] USB: missing probe() diagnostics for CDC Ethernet This patch should help correct the "missing diagnostics with CONFIG_USB_DEBUG during CDC Ethernet probe()" issue. Some folk are having problems with firmware that doesn't respond properly to descriptor fetches -- which is unnecessarily confusing because the diagnostics aren't being printed. drivers/usb/net/usbnet.c | 34 ++++++++++++++-------------------- 1 files changed, 14 insertions(+), 20 deletions(-) diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c --- a/drivers/usb/net/usbnet.c Fri May 14 15:28:13 2004 +++ b/drivers/usb/net/usbnet.c Fri May 14 15:28:13 2004 @@ -107,7 +107,13 @@ * *-------------------------------------------------------------------------*/ +// #define DEBUG // error path messages, extra info +// #define VERBOSE // more; success messages + #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -120,25 +126,15 @@ #include #include #include - - -// #define DEBUG // error path messages, extra info -// #define VERBOSE // more; success messages -#define REALLY_QUEUE - -#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) -# define DEBUG -#endif #include - #include #include #include #include - #define DRIVER_VERSION "25-Aug-2003" + /*-------------------------------------------------------------------------*/ /* @@ -148,13 +144,8 @@ * For high speed, each frame comfortably fits almost 36 max size * Ethernet packets (so queues should be bigger). */ -#ifdef REALLY_QUEUE #define RX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4) #define TX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4) -#else -#define RX_QLEN(dev) 1 -#define TX_QLEN(dev) 1 -#endif // packets are always ethernet inside // ... except they can be bigger (limit of 64K with NetChip framing) @@ -1006,7 +997,7 @@ if (!info->control || !info->data) { dev_dbg (&intf->dev, "master #%u/%p slave #%u/%p\n", - info->u->bMasterInterface0 + info->u->bMasterInterface0, info->control, info->u->bSlaveInterface0, info->data); @@ -1142,10 +1133,13 @@ unsigned char buf [13]; tmp = usb_string (dev->udev, e->iMACAddress, buf, sizeof buf); - if (tmp < 0) + if (tmp != 12) { + dev_dbg (&dev->udev->dev, + "bad MAC string %d fetch, %d\n", e->iMACAddress, tmp); + if (tmp >= 0) + tmp = -EINVAL; return tmp; - else if (tmp != 12) - return -EINVAL; + } for (i = tmp = 0; i < 6; i++, tmp += 2) dev->net->dev_addr [i] = (nibble (buf [tmp]) << 4) + nibble (buf [tmp + 1]);