Commit e2a5c7a9 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[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.
parent f5510e19
...@@ -107,7 +107,13 @@ ...@@ -107,7 +107,13 @@
* *
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
// #define DEBUG // error path messages, extra info
// #define VERBOSE // more; success messages
#include <linux/config.h> #include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -120,25 +126,15 @@ ...@@ -120,25 +126,15 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unaligned.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 <linux/usb.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/scatterlist.h> #include <asm/scatterlist.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#define DRIVER_VERSION "25-Aug-2003" #define DRIVER_VERSION "25-Aug-2003"
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* /*
...@@ -148,13 +144,8 @@ ...@@ -148,13 +144,8 @@
* For high speed, each frame comfortably fits almost 36 max size * For high speed, each frame comfortably fits almost 36 max size
* Ethernet packets (so queues should be bigger). * Ethernet packets (so queues should be bigger).
*/ */
#ifdef REALLY_QUEUE
#define RX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4) #define RX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4)
#define TX_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 // packets are always ethernet inside
// ... except they can be bigger (limit of 64K with NetChip framing) // ... except they can be bigger (limit of 64K with NetChip framing)
...@@ -1006,7 +997,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf) ...@@ -1006,7 +997,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf)
if (!info->control || !info->data) { if (!info->control || !info->data) {
dev_dbg (&intf->dev, dev_dbg (&intf->dev,
"master #%u/%p slave #%u/%p\n", "master #%u/%p slave #%u/%p\n",
info->u->bMasterInterface0 info->u->bMasterInterface0,
info->control, info->control,
info->u->bSlaveInterface0, info->u->bSlaveInterface0,
info->data); info->data);
...@@ -1142,10 +1133,13 @@ get_ethernet_addr (struct usbnet *dev, struct ether_desc *e) ...@@ -1142,10 +1133,13 @@ get_ethernet_addr (struct usbnet *dev, struct ether_desc *e)
unsigned char buf [13]; unsigned char buf [13];
tmp = usb_string (dev->udev, e->iMACAddress, buf, sizeof buf); 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; return tmp;
else if (tmp != 12) }
return -EINVAL;
for (i = tmp = 0; i < 6; i++, tmp += 2) for (i = tmp = 0; i < 6; i++, tmp += 2)
dev->net->dev_addr [i] = dev->net->dev_addr [i] =
(nibble (buf [tmp]) << 4) + nibble (buf [tmp + 1]); (nibble (buf [tmp]) << 4) + nibble (buf [tmp + 1]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment