class/bluetty class/usblp core/hcd image/microtek input/hid-core media/dabusb media/vicam net/ax8817x
There are issues with some of the code that is now 'revealed' when CONFIG_USB_DEBUG is now set. usblp, dabusb, and vicam *will not compile* after this patch has been applied (and CONFIG_USB_DEBUG is set) presumably because the now-revealed debug code has been copied over from the 2.4 driver (and not updated). I have made additional patches to correct these compile errors (which will come in followup mails shortly). There was one compile error relating to dabusb.c which I could not see how to fix. I commented that line out, and that commenting out is included in the patch in this mail.
I am new to kernel development (any comments on what I've just done appreciated!), and I noticed that quite a lot of other USB drivers have commented out lines such as //#define DEBUG //#define VERBOSE
I don't know whether that sort of thing should be activated by CONFIG_USB_DEBUG. If someone could confirm this for me, I could make another pass over the USB drivers to implement this behaviour.
Greg, is there anything else along these (very basic) lines I could patch up? I dont have enough knowledge to produce "proper code" just yet, but I'm learning as I go over the source.
Patch is available from http://www.reactivated.net/patches/linux-kernel/2.6.0-test5/usb-more-debug-output.patch and also shown below.
--
diff -ru linux-2.6.0-test5/drivers/usb/class/bluetty.c linux/drivers/usb/class/bluetty.c --- linux-2.6.0-test5/drivers/usb/class/bluetty.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/class/bluetty.c 2003-09-16 14:11:57.000000000 +0100 @@ -113,7 +113,12 @@ #include <linux/module.h> #include <asm/uaccess.h>
-#define DEBUG +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include <linux/usb.h>
/* diff -ru linux-2.6.0-test5/drivers/usb/class/usblp.c linux/drivers/usb/class/usblp.c --- linux-2.6.0-test5/drivers/usb/class/usblp.c 2003-09-16 14:05:20.000000000 +0100 +++ linux/drivers/usb/class/usblp.c 2003-09-16 16:01:46.000000000 +0100 @@ -54,7 +54,13 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/lp.h> -#undef DEBUG + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include <linux/usb.h>
/* diff -ru linux-2.6.0-test5/drivers/usb/core/hcd.c linux/drivers/usb/core/hcd.c --- linux-2.6.0-test5/drivers/usb/core/hcd.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/core/hcd.c 2003-09-16 14:14:41.000000000 +0100 @@ -25,7 +25,9 @@ #include <linux/config.h>
#ifdef CONFIG_USB_DEBUG -#define DEBUG + #define DEBUG +#else + #undef DEBUG #endif
#include <linux/module.h> diff -ru linux-2.6.0-test5/drivers/usb/image/microtek.c linux/drivers/usb/image/microtek.c --- linux-2.6.0-test5/drivers/usb/image/microtek.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/image/microtek.c 2003-09-16 15:51:20.000000000 +0100 @@ -149,7 +149,11 @@
/* Should we do debugging? */
-//#define MTS_DO_DEBUG +#ifdef CONFIG_USB_DEBUG + #define MTS_DO_DEBUG +#else + #undef MTS_DO_DEBUG +#endif
/* USB layer driver interface */
diff -ru linux-2.6.0-test5/drivers/usb/input/hid-core.c linux/drivers/usb/input/hid-core.c --- linux-2.6.0-test5/drivers/usb/input/hid-core.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/input/hid-core.c 2003-09-16 14:24:27.000000000 +0100 @@ -25,7 +25,11 @@ #include <asm/byteorder.h> #include <linux/input.h>
-#undef DEBUG +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #undef DEBUG_DATA
#include <linux/usb.h> diff -ru linux-2.6.0-test5/drivers/usb/media/dabusb.c linux/drivers/usb/media/dabusb.c --- linux-2.6.0-test5/drivers/usb/media/dabusb.c 2003-09-09 08:50:01.000000000 +0100 +++ linux-2.6.0-test5-dsd/drivers/usb/media/dabusb.c 2003-09-16 19:35:55.498031808 +0100 @@ -36,6 +36,13 @@ #include <asm/uaccess.h> #include <asm/atomic.h> #include <linux/delay.h> + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include <linux/usb.h> #include <linux/smp_lock.h>
@@ -89,7 +96,9 @@ static void dump_urb (struct urb *urb) { dbg("urb :%p", urb); - dbg("next :%p", urb->next); + /* Causes error. Looks like there is no pointer to the next urb in the 2.6 urb struct (whereas there was in 2.4) + dbg("next :%p", urb->next); + -- [EMAIL PROTECTED] */ dbg("dev :%p", urb->dev); dbg("pipe :%08X", urb->pipe); dbg("status :%d", urb->status); diff -ru linux-2.6.0-test5/drivers/usb/media/vicam.c linux/drivers/usb/media/vicam.c --- linux-2.6.0-test5/drivers/usb/media/vicam.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/media/vicam.c 2003-09-16 17:36:39.000000000 +0100 @@ -44,7 +44,11 @@ #include <linux/proc_fs.h> #include "usbvideo.h"
-// #define VICAM_DEBUG +#ifdef CONFIG_USB_DEBUG + #define VICAM_DEBUG +#else + #undef VICAM_DEBUG +#endif
#ifdef VICAM_DEBUG #define ADBG(lineno,fmt,args...) printk(fmt, jiffies, __FUNCTION__, lineno, ##args) diff -ru linux-2.6.0-test5/drivers/usb/net/ax8817x.c linux/drivers/usb/net/ax8817x.c --- linux-2.6.0-test5/drivers/usb/net/ax8817x.c 2003-09-09 08:50:01.000000000 +0100 +++ linux/drivers/usb/net/ax8817x.c 2003-09-16 14:35:20.000000000 +0100 @@ -66,6 +66,13 @@
#include <linux/init.h> #include <linux/module.h> + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include <linux/usb.h>
#include <linux/netdevice.h>
-- Daniel Drake (dsd) http://www.reactivated.net
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel