ChangeSet 1.1628, 2004/05/13 14:13:38-07:00, [EMAIL PROTECTED] [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 <linux/config.h> +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include <linux/module.h> #include <linux/kmod.h> #include <linux/sched.h> @@ -120,25 +126,15 @@ #include <linux/mii.h> #include <asm/uaccess.h> #include <asm/unaligned.h> - - -// #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 <linux/usb.h> - #include <asm/io.h> #include <asm/scatterlist.h> #include <linux/mm.h> #include <linux/dma-mapping.h> - #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]); ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id%62&alloc_ida84&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel