diff options
Diffstat (limited to 'uClinux-2.4.20-uc1/drivers/usb/usb.c')
-rw-r--r-- | uClinux-2.4.20-uc1/drivers/usb/usb.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/uClinux-2.4.20-uc1/drivers/usb/usb.c b/uClinux-2.4.20-uc1/drivers/usb/usb.c index 71920db..266b90b 100644 --- a/uClinux-2.4.20-uc1/drivers/usb/usb.c +++ b/uClinux-2.4.20-uc1/drivers/usb/usb.c @@ -38,7 +38,9 @@ #endif #include <linux/usb.h> +#ifdef CONFIG_BOARD_W90N745 #include "hcd.h" +#endif static const int usb_bandwidth_option = #ifdef CONFIG_USB_BANDWIDTH @@ -945,6 +947,9 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus) if (!dev) return NULL; +#ifdef CONFIG_BOARD_W90N745 + dev = (struct usb_device *)((unsigned long)dev | 0x80000000); +#endif memset(dev, 0, sizeof(*dev)); usb_bus_get(bus); @@ -1032,6 +1037,9 @@ void usb_free_urb(struct urb* urb) /*-------------------------------------------------------------------*/ int usb_submit_urb(struct urb *urb) { +#ifdef CONFIG_BOARD_W90N745 + urb->transfer_buffer=(struct urb*)((unsigned long)(urb->transfer_buffer) | 0x80000000); +#endif if (urb && urb->dev && urb->dev->bus && urb->dev->bus->op) return urb->dev->bus->op->submit_urb(urb); else @@ -1174,6 +1182,9 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u if (!dr) return -ENOMEM; +#ifdef CONFIG_BOARD_W90N745 + dr = (struct usb_ctrlrequest *)((unsigned long)dr | 0x80000000); +#endif dr->bRequestType = requesttype; dr->bRequest = request; dr->wValue = cpu_to_le16p(&value); @@ -1712,8 +1723,13 @@ void usb_disconnect(struct usb_device **pdev) *pdev = NULL; +#ifndef CONFIG_BOARD_W90N745 info("USB disconnect on device %s-%s address %d", dev->bus->bus_name, dev->devpath, dev->devnum); +#else + info("USB disconnect on device %s address %d", + dev->devpath, dev->devnum); +#endif if (dev->actconfig) { for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { @@ -1851,6 +1867,7 @@ int usb_get_status(struct usb_device *dev, int type, int target, void *data) int usb_get_protocol(struct usb_device *dev, int ifnum) { +#ifndef CONFIG_BOARD_W90N745 unsigned char type; int ret; @@ -1860,8 +1877,26 @@ int usb_get_protocol(struct usb_device *dev, int ifnum) return ret; return type; +#else + unsigned char *typeP = NULL; + int ret; + + typeP = kmalloc(sizeof(unsigned char), GFP_KERNEL); + if(!typeP) { + printk("usb_get_protocol kmalloc failed\n"); + return -ENOMEM; + } + typeP = (unsigned char *)((unsigned long)typeP | 0x80000000); + if ((ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), + USB_REQ_GET_PROTOCOL, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + 0, ifnum, typeP, 1, HZ * GET_TIMEOUT)) < 0) + return ret; + + return *typeP; +#endif } + int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol) { return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), @@ -1934,6 +1969,9 @@ int usb_clear_halt(struct usb_device *dev, int pipe) return -ENOMEM; } +#ifdef CONFIG_BOARD_W90N745 + buffer = (unsigned char *)((unsigned long)buffer | 0x80000000); +#endif result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), USB_REQ_GET_STATUS, USB_DIR_IN | USB_RECIP_ENDPOINT, 0, endp, buffer, sizeof(status), HZ * SET_TIMEOUT); @@ -2069,6 +2107,9 @@ int usb_get_configuration(struct usb_device *dev) err("unable to allocate memory for configuration descriptors"); return -ENOMEM; } +#ifdef CONFIG_BOARD_W90N745 + buffer = (unsigned char *)((unsigned long)buffer | 0x80000000); +#endif desc = (struct usb_config_descriptor *)buffer; for (cfgno = 0; cfgno < dev->descriptor.bNumConfigurations; cfgno++) { @@ -2095,6 +2136,9 @@ int usb_get_configuration(struct usb_device *dev) goto err; } +#ifdef CONFIG_BOARD_W90N745 + bigbuffer = (unsigned char *)((unsigned long)bigbuffer | 0x80000000); +#endif /* Now that we know the length, get the whole thing */ result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, bigbuffer, length); if (result < 0) { @@ -2146,6 +2190,9 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) if (!tbuf) return -ENOMEM; +#ifdef CONFIG_BOARD_W90N745 + tbuf = (unsigned char *)((unsigned long)tbuf | 0x80000000); +#endif /* get langid for strings if it's not yet known */ if (!dev->have_langid) { err = usb_get_string(dev, 0, 0, tbuf, 4); |