Hi,
I try to integrate the USB driver (from distribution 2.4.28) into MontaVista's embedded powerpc linux and found a strange problem with /include/linux/usb.h:
In the following structure, I need to move the "struct semaphore exclusive_access" to the end of the structute to the end of structure to make it work. Otherwise, I will always get the following error message and the driver does not work:
usb.c: not enough configurations
struct usb_device { int devnum; /* Address on USB bus */ char devpath [16]; /* Use in messages: /port/port/... */
enum { USB_SPEED_UNKNOWN = 0, /* enumerating */ USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ USB_SPEED_HIGH /* usb 2.0 */ } speed;
struct usb_tt *tt; /* low/full speed dev, highspeed hub */ int ttport; /* device port on that tt hub */
atomic_t refcnt; /* Reference count */ struct semaphore serialize; struct semaphore exclusive_access; /* prevent driver & proc accesses */ /* from overlapping cmds at device */
unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT)
*/ unsigned int halted[2]; /* endpoint halts; one bit per endpoint # & direction; */ /* [0] = IN, [1] = OUT */ int epmaxpacketin[16]; /* INput endpoint specific maximums */ int epmaxpacketout[16]; /* OUTput endpoint specific maximums */struct usb_device *parent; struct usb_bus *bus; /* Bus we're part of */
struct usb_device_descriptor descriptor;/* Descriptor */ struct usb_config_descriptor *config; /* All of the configs */ struct usb_config_descriptor *actconfig;/* the active configuration */
char **rawdescriptors; /* Raw descriptors for each config */
int have_langid; /* whether string_langid is valid yet */ int string_langid; /* language ID for strings */
void *hcpriv; /* Host Controller private data */
/* usbdevfs inode list */ struct list_head inodes; struct list_head filelist;
/*
- Child devices - these can be either new devices
- (if this is a hub device), or different instances
- of this same device.
- Each instance needs its own set of data structures.
int maxchild; /* Number of ports if hub */ struct usb_device *children[USB_MAXCHILDREN]; };
Any glue???