USB driver not detecting mouse? (lots of detail)
I've attached the patch for the changes I had to make to get the USB driver compiled under 2.2.12. If anyone sees anything funny looking, pls let me know. Thanks!
Quoted 7 lines · --- Ira K Weiny
Quoted 2 lines
I got the 2.3 USB code from cvs.on.openprojects.net. I had to update it
a
Quoted 2 lines
bit to include the 2.2
spinlock.hsince it seems to have moved in the 2.3 kernel. If I think of it, I'll try to make some patches once I gethome...
===
------------------------------------------------------------
David Hay \|/ ____ \|/ [email protected] ~@-/ oO \-@~ http://home.earthlink.net/~dhay/ /_( \__/ )_\
~ Live well ~ Laugh often ~ Love much ~ \__U_/
usr/src/linux/drivers/usb/hub.c renamed from home/dhay/linux/drivers/usb/hub.c +4 -0
@@ -12,7 +12,11 @@#include <linux/malloc.h> #include <linux/smp_lock.h> #include <linux/module.h> +#if LINUX_VERSION_CODE <0x020300 +#include <asm/spinlock.h> +#else #include <linux/spinlock.h> +#endif #include <asm/uaccess.h>
usr/src/linux/drivers/usb/mouse.c renamed from home/dhay/linux/drivers/usb/mouse.c +4 -0
@@ -40,7 +40,11 @@#include <linux/init.h> #include <linux/malloc.h> #include <linux/module.h> +#if LINUX_VERSION_CODE <0x020300 +#include <asm/spinlock.h> +#else #include <linux/spinlock.h> +#endif #include "usb.h"
usr/src/linux/drivers/usb/ohci.c renamed from home/dhay/linux/drivers/usb/ohci.c +13 -0
@@ -37,7 +37,11 @@#include <linux/malloc.h> #include <linux/smp_lock.h> #include <linux/errno.h> +#if LINUX_VERSION_CODE <0x020300 +#include <asm/spinlock.h> +#else #include <linux/spinlock.h> +#endif #include <asm/io.h> #include <asm/irq.h>
@@ -2747,14 +2751,23 @@*/ static int init_ohci (struct pci_dev *dev) { +#if LINUX_VERSION_CODE <0x020300 +unsigned long mem_base = dev->base_address[0 ]; +#else unsigned long mem_base = dev->resource[0 ].flags; +#endif /* If its OHCI, its memory */ if (mem_base &PCI_BASE_ADDRESS_SPACE_IO )return -ENODEV ;/* Get the memory address and map it for IO */ +#if LINUX_VERSION_CODE <0x020300 + mem_base &=PCI_BASE_ADDRESS_MEM_MASK ; +#else mem_base = dev->resource[0 ].start; +#endif +/* no interrupt won't work... */ if (dev->irq ==0 ) {
usr/src/linux/drivers/usb/usb.h renamed from home/dhay/linux/drivers/usb/usb.h +8 -0
@@ -1,6 +1,14 @@#ifndef __LINUX_USB_H#define __LINUX_USB_H +#if LINUX_VERSION_CODE <0x020300 +#define DECLARE_WAIT_QUEUE_HEAD (w) struct wait_queue *w = NULL +#define DECLARE_WAITQUEUE (w,c) struct wait_queue w = {(c), NULL} +#define wait_queue_head_t struct wait_queue * +#define init_waitqueue_head (w) *(w) = 0 +#define DECLARE_MUTEX_LOCKED (sem) struct semaphore sem = MUTEX_LOCKED +#endif +#include <linux/types.h> #include <linux/ioctl.h>