HI,

Here's a patch against 2.3.99-pre3 that adds a USB debug output
configuration option. This moves the #define DEBUG to be dependent on
this configuration option for the usbcore and hub parts of the usb
stack.

Thanks,

greg k-h
[EMAIL PROTECTED]
diff -Naur -X dontdiff linux-2.3.99-pre3/Documentation/Configure.help 
linux-2.3.99-pre3-greg/Documentation/Configure.help
--- linux-2.3.99-pre3/Documentation/Configure.help      Thu Mar 23 08:38:57 2000
+++ linux-2.3.99-pre3-greg/Documentation/Configure.help Mon Mar 27 08:17:48 2000
@@ -8986,6 +8986,12 @@
   The module will be called usbcore.o. If you want to compile it as a
   module, say M here and read Documentation/modules.txt.
 
+USB verbose debug messages
+CONFIG_USB_DEBUG
+  Say Y here if you want the USB core drivers to produce a bunch of
+  debug messages to the system log. Select this if you are having a
+  problem with USB support and want to see more of what is going on.
+
 UHCI (intel PIIX4, VIA, ...) support?
 CONFIG_USB_UHCI
   The Universal Host Controller Interface is a standard by Intel for
diff -Naur -X dontdiff linux-2.3.99-pre3/drivers/usb/Config.in 
linux-2.3.99-pre3-greg/drivers/usb/Config.in
--- linux-2.3.99-pre3/drivers/usb/Config.in     Mon Mar 27 08:08:12 2000
+++ linux-2.3.99-pre3-greg/drivers/usb/Config.in        Mon Mar 27 07:11:06 2000
@@ -6,6 +6,7 @@
 
 tristate 'Support for USB' CONFIG_USB
 if [ ! "$CONFIG_USB" = "n" ]; then
+   bool '  USB verbose debug messages' CONFIG_USB_DEBUG
 
 comment 'USB Controllers'
    if [ "$CONFIG_USB_UHCI_ALT" != "y" ]; then
diff -Naur -X dontdiff linux-2.3.99-pre3/drivers/usb/hub.c 
linux-2.3.99-pre3-greg/drivers/usb/hub.c
--- linux-2.3.99-pre3/drivers/usb/hub.c Mon Mar 27 08:08:12 2000
+++ linux-2.3.99-pre3-greg/drivers/usb/hub.c    Mon Mar 27 07:17:25 2000
@@ -11,7 +11,11 @@
 #include <linux/list.h>
 #include <linux/malloc.h>
 #include <linux/smp_lock.h>
-#define DEBUG
+#ifdef CONFIG_USB_DEBUG
+       #define DEBUG
+#else
+       #undef DEBUG
+#endif
 #include <linux/usb.h>
 
 #include <asm/uaccess.h>
diff -Naur -X dontdiff linux-2.3.99-pre3/drivers/usb/usb-debug.c 
linux-2.3.99-pre3-greg/drivers/usb/usb-debug.c
--- linux-2.3.99-pre3/drivers/usb/usb-debug.c   Mon Mar 27 08:08:12 2000
+++ linux-2.3.99-pre3-greg/drivers/usb/usb-debug.c      Mon Mar 27 07:17:24 2000
@@ -8,7 +8,11 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/malloc.h>
-#define DEBUG
+#ifdef CONFIG_USB_DEBUG
+       #define DEBUG
+#else
+       #undef DEBUG
+#endif
 #include <linux/usb.h>
 
 static void usb_show_endpoint(struct usb_endpoint_descriptor *endpoint)
diff -Naur -X dontdiff linux-2.3.99-pre3/drivers/usb/usb.c 
linux-2.3.99-pre3-greg/drivers/usb/usb.c
--- linux-2.3.99-pre3/drivers/usb/usb.c Mon Mar 27 08:08:12 2000
+++ linux-2.3.99-pre3-greg/drivers/usb/usb.c    Mon Mar 27 07:59:17 2000
@@ -24,7 +24,11 @@
 #include <linux/bitops.h>
 #include <linux/malloc.h>
 #include <linux/interrupt.h>  /* for in_interrupt() */
-#define DEBUG
+#ifdef CONFIG_USB_DEBUG
+       #define DEBUG
+#else
+       #undef DEBUG
+#endif
 #include <linux/usb.h>
 
 /*
@@ -1674,7 +1678,7 @@
                        dev->have_langid = -1;
                        dev->string_langid = tbuf[2] | (tbuf[3]<< 8);
                                /* always use the first langid listed */
-                       info("USB device number %d default language ID 0x%x",
+                       dbg("USB device number %d default language ID 0x%x",
                                dev->devnum, dev->string_langid);
                }
        }
@@ -1789,14 +1793,16 @@
                return -1;
        }
 
-       info("new device strings: Mfr=%d, Product=%d, SerialNumber=%d",
+       dbg("new device strings: Mfr=%d, Product=%d, SerialNumber=%d",
                dev->descriptor.iManufacturer, dev->descriptor.iProduct, 
dev->descriptor.iSerialNumber);
+#ifdef DEBUG
        if (dev->descriptor.iManufacturer)
                usb_show_string(dev, "Manufacturer", dev->descriptor.iManufacturer);
        if (dev->descriptor.iProduct)
                usb_show_string(dev, "Product", dev->descriptor.iProduct);
        if (dev->descriptor.iSerialNumber)
                usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
+#endif
 
        /* now that the basic setup is over, add a /proc/bus/usb entry */
         usbdevfs_add_device(dev);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to