aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-08 21:14:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-08 21:14:42 -0400
commit5b65c09e9966cae543d4727984f098b699aa1653 (patch)
treef14a114072367f33aeefd24dbbee7ded9111ffdd /drivers
parent837525e344298335ea56c3b8c9ca7abbc97f0285 (diff)
parent6fd75b19483b2f6e6619602a535b4939e46921c1 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: OHCI: Fix machine check in ohci_hub_status_data USB: Fix up bogus bInterval values in endpoint descriptors USB: cxacru: ignore error trying to start ADSL in atm_start USB: cxacru: create sysfs attributes in atm_start instead of bind USB: cxacru: add Documentation file USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu USB: usb gadgets avoid le{16,32}_to_cpup() usblp: Don't let suspend to kill ->used USB: set default y for CONFIG_USB_DEVICE_CLASS
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/atm/cxacru.c52
-rw-r--r--drivers/usb/class/usblp.c5
-rw-r--r--drivers/usb/core/Kconfig22
-rw-r--r--drivers/usb/core/config.c42
-rw-r--r--drivers/usb/gadget/epautoconf.c2
-rw-r--r--drivers/usb/gadget/inode.c8
-rw-r--r--drivers/usb/gadget/net2280.c6
-rw-r--r--drivers/usb/gadget/omap_udc.c6
-rw-r--r--drivers/usb/gadget/rndis.c35
-rw-r--r--drivers/usb/host/ohci-hub.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h21
11 files changed, 136 insertions, 65 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 30b7bfbc985a..8bcf7fe1dd80 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -476,8 +476,6 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done,
476 add_timer(&timer); 476 add_timer(&timer);
477 wait_for_completion(done); 477 wait_for_completion(done);
478 status = urb->status; 478 status = urb->status;
479 if (status == -ECONNRESET)
480 status = -ETIMEDOUT;
481 del_timer_sync(&timer); 479 del_timer_sync(&timer);
482 480
483 if (actual_length) 481 if (actual_length)
@@ -629,10 +627,22 @@ static int cxacru_card_status(struct cxacru_data *instance)
629 return 0; 627 return 0;
630} 628}
631 629
630static void cxacru_remove_device_files(struct usbatm_data *usbatm_instance,
631 struct atm_dev *atm_dev)
632{
633 struct usb_interface *intf = usbatm_instance->usb_intf;
634
635 #define CXACRU_DEVICE_REMOVE_FILE(_name) \
636 device_remove_file(&intf->dev, &dev_attr_##_name);
637 CXACRU_ALL_FILES(REMOVE);
638 #undef CXACRU_DEVICE_REMOVE_FILE
639}
640
632static int cxacru_atm_start(struct usbatm_data *usbatm_instance, 641static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
633 struct atm_dev *atm_dev) 642 struct atm_dev *atm_dev)
634{ 643{
635 struct cxacru_data *instance = usbatm_instance->driver_data; 644 struct cxacru_data *instance = usbatm_instance->driver_data;
645 struct usb_interface *intf = usbatm_instance->usb_intf;
636 /* 646 /*
637 struct atm_dev *atm_dev = usbatm_instance->atm_dev; 647 struct atm_dev *atm_dev = usbatm_instance->atm_dev;
638 */ 648 */
@@ -649,14 +659,18 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
649 return ret; 659 return ret;
650 } 660 }
651 661
662 #define CXACRU_DEVICE_CREATE_FILE(_name) \
663 ret = device_create_file(&intf->dev, &dev_attr_##_name); \
664 if (unlikely(ret)) \
665 goto fail_sysfs;
666 CXACRU_ALL_FILES(CREATE);
667 #undef CXACRU_DEVICE_CREATE_FILE
668
652 /* start ADSL */ 669 /* start ADSL */
653 mutex_lock(&instance->adsl_state_serialize); 670 mutex_lock(&instance->adsl_state_serialize);
654 ret = cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_START, NULL, 0, NULL, 0); 671 ret = cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_START, NULL, 0, NULL, 0);
655 if (ret < 0) { 672 if (ret < 0)
656 atm_err(usbatm_instance, "cxacru_atm_start: CHIP_ADSL_LINE_START returned %d\n", ret); 673 atm_err(usbatm_instance, "cxacru_atm_start: CHIP_ADSL_LINE_START returned %d\n", ret);
657 mutex_unlock(&instance->adsl_state_serialize);
658 return ret;
659 }
660 674
661 /* Start status polling */ 675 /* Start status polling */
662 mutex_lock(&instance->poll_state_serialize); 676 mutex_lock(&instance->poll_state_serialize);
@@ -680,6 +694,11 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
680 if (start_polling) 694 if (start_polling)
681 cxacru_poll_status(&instance->poll_work.work); 695 cxacru_poll_status(&instance->poll_work.work);
682 return 0; 696 return 0;
697
698fail_sysfs:
699 usb_err(usbatm_instance, "cxacru_atm_start: device_create_file failed (%d)\n", ret);
700 cxacru_remove_device_files(usbatm_instance, atm_dev);
701 return ret;
683} 702}
684 703
685static void cxacru_poll_status(struct work_struct *work) 704static void cxacru_poll_status(struct work_struct *work)
@@ -1065,13 +1084,6 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
1065 goto fail; 1084 goto fail;
1066 } 1085 }
1067 1086
1068 #define CXACRU_DEVICE_CREATE_FILE(_name) \
1069 ret = device_create_file(&intf->dev, &dev_attr_##_name); \
1070 if (unlikely(ret)) \
1071 goto fail_sysfs;
1072 CXACRU_ALL_FILES(CREATE);
1073 #undef CXACRU_DEVICE_CREATE_FILE
1074
1075 usb_fill_int_urb(instance->rcv_urb, 1087 usb_fill_int_urb(instance->rcv_urb,
1076 usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD), 1088 usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD),
1077 instance->rcv_buf, PAGE_SIZE, 1089 instance->rcv_buf, PAGE_SIZE,
@@ -1092,14 +1104,6 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
1092 1104
1093 return 0; 1105 return 0;
1094 1106
1095 fail_sysfs:
1096 dbg("cxacru_bind: device_create_file failed (%d)\n", ret);
1097
1098 #define CXACRU_DEVICE_REMOVE_FILE(_name) \
1099 device_remove_file(&intf->dev, &dev_attr_##_name);
1100 CXACRU_ALL_FILES(REMOVE);
1101 #undef CXACRU_DEVICE_REVOVE_FILE
1102
1103 fail: 1107 fail:
1104 free_page((unsigned long) instance->snd_buf); 1108 free_page((unsigned long) instance->snd_buf);
1105 free_page((unsigned long) instance->rcv_buf); 1109 free_page((unsigned long) instance->rcv_buf);
@@ -1146,11 +1150,6 @@ static void cxacru_unbind(struct usbatm_data *usbatm_instance,
1146 free_page((unsigned long) instance->snd_buf); 1150 free_page((unsigned long) instance->snd_buf);
1147 free_page((unsigned long) instance->rcv_buf); 1151 free_page((unsigned long) instance->rcv_buf);
1148 1152
1149 #define CXACRU_DEVICE_REMOVE_FILE(_name) \
1150 device_remove_file(&intf->dev, &dev_attr_##_name);
1151 CXACRU_ALL_FILES(REMOVE);
1152 #undef CXACRU_DEVICE_REVOVE_FILE
1153
1154 kfree(instance); 1153 kfree(instance);
1155 1154
1156 usbatm_instance->driver_data = NULL; 1155 usbatm_instance->driver_data = NULL;
@@ -1231,6 +1230,7 @@ static struct usbatm_driver cxacru_driver = {
1231 .heavy_init = cxacru_heavy_init, 1230 .heavy_init = cxacru_heavy_init,
1232 .unbind = cxacru_unbind, 1231 .unbind = cxacru_unbind,
1233 .atm_start = cxacru_atm_start, 1232 .atm_start = cxacru_atm_start,
1233 .atm_stop = cxacru_remove_device_files,
1234 .bulk_in = CXACRU_EP_DATA, 1234 .bulk_in = CXACRU_EP_DATA,
1235 .bulk_out = CXACRU_EP_DATA, 1235 .bulk_out = CXACRU_EP_DATA,
1236 .rx_padding = 3, 1236 .rx_padding = 3,
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 7b1edfe46b28..6778f9af7943 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -347,10 +347,8 @@ static int handle_bidir (struct usblp *usblp)
347 if (usblp->bidir && usblp->used && !usblp->sleeping) { 347 if (usblp->bidir && usblp->used && !usblp->sleeping) {
348 usblp->readcount = 0; 348 usblp->readcount = 0;
349 usblp->readurb->dev = usblp->dev; 349 usblp->readurb->dev = usblp->dev;
350 if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) { 350 if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0)
351 usblp->used = 0;
352 return -EIO; 351 return -EIO;
353 }
354 } 352 }
355 353
356 return 0; 354 return 0;
@@ -412,6 +410,7 @@ static int usblp_open(struct inode *inode, struct file *file)
412 usblp->readurb->status = 0; 410 usblp->readurb->status = 0;
413 411
414 if (handle_bidir(usblp) < 0) { 412 if (handle_bidir(usblp) < 0) {
413 usblp->used = 0;
415 file->private_data = NULL; 414 file->private_data = NULL;
416 retval = -EIO; 415 retval = -EIO;
417 } 416 }
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index f493fb1eaa27..346fc030c929 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -40,21 +40,25 @@ config USB_DEVICEFS
40config USB_DEVICE_CLASS 40config USB_DEVICE_CLASS
41 bool "USB device class-devices (DEPRECATED)" 41 bool "USB device class-devices (DEPRECATED)"
42 depends on USB 42 depends on USB
43 default n 43 default y
44 ---help--- 44 ---help---
45 Userspace access to USB devices is granted by device-nodes exported 45 Userspace access to USB devices is granted by device-nodes exported
46 directly from the usbdev in sysfs. Old versions of the driver 46 directly from the usbdev in sysfs. Old versions of the driver
47 core and udev needed additional class devices to export device nodes. 47 core and udev needed additional class devices to export device nodes.
48 48
49 These additional devices are difficult to handle in userspace, if 49 These additional devices are difficult to handle in userspace, if
50 information about USB interfaces must be available. One device contains 50 information about USB interfaces must be available. One device
51 the device node, the other device contains the interface data. Both 51 contains the device node, the other device contains the interface
52 devices are at the same level in sysfs (siblings) and one can't access 52 data. Both devices are at the same level in sysfs (siblings) and one
53 the other. The device node created directly by the usbdev is the parent 53 can't access the other. The device node created directly by the
54 device of the interface and therefore easily accessible from the interface 54 usb device is the parent device of the interface and therefore
55 event. 55 easily accessible from the interface event.
56 56
57 This option provides backward compatibility if needed. 57 This option provides backward compatibility for libusb device
58 nodes (lsusb) when usbfs is not used, and the following udev rule
59 doesn't exist:
60 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
61 NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
58 62
59config USB_DYNAMIC_MINORS 63config USB_DYNAMIC_MINORS
60 bool "Dynamic USB minor allocation (EXPERIMENTAL)" 64 bool "Dynamic USB minor allocation (EXPERIMENTAL)"
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 2d4fd530e5e4..dd3482328ad2 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1,4 +1,5 @@
1#include <linux/usb.h> 1#include <linux/usb.h>
2#include <linux/usb/ch9.h>
2#include <linux/module.h> 3#include <linux/module.h>
3#include <linux/init.h> 4#include <linux/init.h>
4#include <linux/slab.h> 5#include <linux/slab.h>
@@ -49,7 +50,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
49 unsigned char *buffer0 = buffer; 50 unsigned char *buffer0 = buffer;
50 struct usb_endpoint_descriptor *d; 51 struct usb_endpoint_descriptor *d;
51 struct usb_host_endpoint *endpoint; 52 struct usb_host_endpoint *endpoint;
52 int n, i; 53 int n, i, j;
53 54
54 d = (struct usb_endpoint_descriptor *) buffer; 55 d = (struct usb_endpoint_descriptor *) buffer;
55 buffer += d->bLength; 56 buffer += d->bLength;
@@ -84,6 +85,45 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
84 memcpy(&endpoint->desc, d, n); 85 memcpy(&endpoint->desc, d, n);
85 INIT_LIST_HEAD(&endpoint->urb_list); 86 INIT_LIST_HEAD(&endpoint->urb_list);
86 87
88 /* If the bInterval value is outside the legal range,
89 * set it to a default value: 32 ms */
90 i = 0; /* i = min, j = max, n = default */
91 j = 255;
92 if (usb_endpoint_xfer_int(d)) {
93 i = 1;
94 switch (to_usb_device(ddev)->speed) {
95 case USB_SPEED_HIGH:
96 n = 9; /* 32 ms = 2^(9-1) uframes */
97 j = 16;
98 break;
99 default: /* USB_SPEED_FULL or _LOW */
100 /* For low-speed, 10 ms is the official minimum.
101 * But some "overclocked" devices might want faster
102 * polling so we'll allow it. */
103 n = 32;
104 break;
105 }
106 } else if (usb_endpoint_xfer_isoc(d)) {
107 i = 1;
108 j = 16;
109 switch (to_usb_device(ddev)->speed) {
110 case USB_SPEED_HIGH:
111 n = 9; /* 32 ms = 2^(9-1) uframes */
112 break;
113 default: /* USB_SPEED_FULL */
114 n = 6; /* 32 ms = 2^(6-1) frames */
115 break;
116 }
117 }
118 if (d->bInterval < i || d->bInterval > j) {
119 dev_warn(ddev, "config %d interface %d altsetting %d "
120 "endpoint 0x%X has an invalid bInterval %d, "
121 "changing to %d\n",
122 cfgno, inum, asnum,
123 d->bEndpointAddress, d->bInterval, n);
124 endpoint->desc.bInterval = n;
125 }
126
87 /* Skip over any Class Specific or Vendor Specific descriptors; 127 /* Skip over any Class Specific or Vendor Specific descriptors;
88 * find the next endpoint or interface descriptor */ 128 * find the next endpoint or interface descriptor */
89 endpoint->extra = buffer; 129 endpoint->extra = buffer;
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index f28af06905a5..6042364402b8 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -132,7 +132,7 @@ ep_matches (
132 * where it's an output parameter representing the full speed limit. 132 * where it's an output parameter representing the full speed limit.
133 * the usb spec fixes high speed bulk maxpacket at 512 bytes. 133 * the usb spec fixes high speed bulk maxpacket at 512 bytes.
134 */ 134 */
135 max = 0x7ff & le16_to_cpup (&desc->wMaxPacketSize); 135 max = 0x7ff & le16_to_cpu(desc->wMaxPacketSize);
136 switch (type) { 136 switch (type) {
137 case USB_ENDPOINT_XFER_INT: 137 case USB_ENDPOINT_XFER_INT:
138 /* INT: limit 64 bytes full speed, 1024 high speed */ 138 /* INT: limit 64 bytes full speed, 1024 high speed */
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 188c74a95216..46d0e5252744 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1369,12 +1369,12 @@ config_buf (struct dev_data *dev, u8 type, unsigned index)
1369 hs = !hs; 1369 hs = !hs;
1370 if (hs) { 1370 if (hs) {
1371 dev->req->buf = dev->hs_config; 1371 dev->req->buf = dev->hs_config;
1372 len = le16_to_cpup (&dev->hs_config->wTotalLength); 1372 len = le16_to_cpu(dev->hs_config->wTotalLength);
1373 } else 1373 } else
1374#endif 1374#endif
1375 { 1375 {
1376 dev->req->buf = dev->config; 1376 dev->req->buf = dev->config;
1377 len = le16_to_cpup (&dev->config->wTotalLength); 1377 len = le16_to_cpu(dev->config->wTotalLength);
1378 } 1378 }
1379 ((u8 *)dev->req->buf) [1] = type; 1379 ((u8 *)dev->req->buf) [1] = type;
1380 return len; 1380 return len;
@@ -1885,7 +1885,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
1885 1885
1886 /* full or low speed config */ 1886 /* full or low speed config */
1887 dev->config = (void *) kbuf; 1887 dev->config = (void *) kbuf;
1888 total = le16_to_cpup (&dev->config->wTotalLength); 1888 total = le16_to_cpu(dev->config->wTotalLength);
1889 if (!is_valid_config (dev->config) || total >= length) 1889 if (!is_valid_config (dev->config) || total >= length)
1890 goto fail; 1890 goto fail;
1891 kbuf += total; 1891 kbuf += total;
@@ -1894,7 +1894,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
1894 /* optional high speed config */ 1894 /* optional high speed config */
1895 if (kbuf [1] == USB_DT_CONFIG) { 1895 if (kbuf [1] == USB_DT_CONFIG) {
1896 dev->hs_config = (void *) kbuf; 1896 dev->hs_config = (void *) kbuf;
1897 total = le16_to_cpup (&dev->hs_config->wTotalLength); 1897 total = le16_to_cpu(dev->hs_config->wTotalLength);
1898 if (!is_valid_config (dev->hs_config) || total >= length) 1898 if (!is_valid_config (dev->hs_config) || total >= length)
1899 goto fail; 1899 goto fail;
1900 kbuf += total; 1900 kbuf += total;
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 52779c52b56d..d975ecf18e00 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2440,9 +2440,9 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
2440 2440
2441 tmp = 0; 2441 tmp = 0;
2442 2442
2443#define w_value le16_to_cpup (&u.r.wValue) 2443#define w_value le16_to_cpu(u.r.wValue)
2444#define w_index le16_to_cpup (&u.r.wIndex) 2444#define w_index le16_to_cpu(u.r.wIndex)
2445#define w_length le16_to_cpup (&u.r.wLength) 2445#define w_length le16_to_cpu(u.r.wLength)
2446 2446
2447 /* ack the irq */ 2447 /* ack the irq */
2448 writel (1 << SETUP_PACKET_INTERRUPT, &dev->regs->irqstat0); 2448 writel (1 << SETUP_PACKET_INTERRUPT, &dev->regs->irqstat0);
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index b394e63894d2..c4975a6cf777 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -1651,9 +1651,9 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
1651 UDC_EP_NUM_REG = 0; 1651 UDC_EP_NUM_REG = 0;
1652 } while (UDC_IRQ_SRC_REG & UDC_SETUP); 1652 } while (UDC_IRQ_SRC_REG & UDC_SETUP);
1653 1653
1654#define w_value le16_to_cpup (&u.r.wValue) 1654#define w_value le16_to_cpu(u.r.wValue)
1655#define w_index le16_to_cpup (&u.r.wIndex) 1655#define w_index le16_to_cpu(u.r.wIndex)
1656#define w_length le16_to_cpup (&u.r.wLength) 1656#define w_length le16_to_cpu(u.r.wLength)
1657 1657
1658 /* Delegate almost all control requests to the gadget driver, 1658 /* Delegate almost all control requests to the gadget driver,
1659 * except for a handful of ch9 status/feature requests that 1659 * except for a handful of ch9 status/feature requests that
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 6ec8cf1a3ccb..708657c89132 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -186,10 +186,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
186 DEBUG("query OID %08x value, len %d:\n", OID, buf_len); 186 DEBUG("query OID %08x value, len %d:\n", OID, buf_len);
187 for (i = 0; i < buf_len; i += 16) { 187 for (i = 0; i < buf_len; i += 16) {
188 DEBUG ("%03d: %08x %08x %08x %08x\n", i, 188 DEBUG ("%03d: %08x %08x %08x %08x\n", i,
189 le32_to_cpup((__le32 *)&buf[i]), 189 le32_to_cpu(get_unaligned((__le32 *)
190 le32_to_cpup((__le32 *)&buf[i + 4]), 190 &buf[i])),
191 le32_to_cpup((__le32 *)&buf[i + 8]), 191 le32_to_cpu(get_unaligned((__le32 *)
192 le32_to_cpup((__le32 *)&buf[i + 12])); 192 &buf[i + 4])),
193 le32_to_cpu(get_unaligned((__le32 *)
194 &buf[i + 8])),
195 le32_to_cpu(get_unaligned((__le32 *)
196 &buf[i + 12])));
193 } 197 }
194 } 198 }
195 199
@@ -665,7 +669,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
665 break; 669 break;
666 case OID_PNP_QUERY_POWER: 670 case OID_PNP_QUERY_POWER:
667 DEBUG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__, 671 DEBUG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__,
668 le32_to_cpup((__le32 *) buf) - 1); 672 le32_to_cpu(get_unaligned((__le32 *)buf)) - 1);
669 /* only suspend is a real power state, and 673 /* only suspend is a real power state, and
670 * it can't be entered by OID_PNP_SET_POWER... 674 * it can't be entered by OID_PNP_SET_POWER...
671 */ 675 */
@@ -704,10 +708,14 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
704 DEBUG("set OID %08x value, len %d:\n", OID, buf_len); 708 DEBUG("set OID %08x value, len %d:\n", OID, buf_len);
705 for (i = 0; i < buf_len; i += 16) { 709 for (i = 0; i < buf_len; i += 16) {
706 DEBUG ("%03d: %08x %08x %08x %08x\n", i, 710 DEBUG ("%03d: %08x %08x %08x %08x\n", i,
707 le32_to_cpup((__le32 *)&buf[i]), 711 le32_to_cpu(get_unaligned((__le32 *)
708 le32_to_cpup((__le32 *)&buf[i + 4]), 712 &buf[i])),
709 le32_to_cpup((__le32 *)&buf[i + 8]), 713 le32_to_cpu(get_unaligned((__le32 *)
710 le32_to_cpup((__le32 *)&buf[i + 12])); 714 &buf[i + 4])),
715 le32_to_cpu(get_unaligned((__le32 *)
716 &buf[i + 8])),
717 le32_to_cpu(get_unaligned((__le32 *)
718 &buf[i + 12])));
711 } 719 }
712 } 720 }
713 721
@@ -721,7 +729,8 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
721 * PROMISCUOUS, DIRECTED, 729 * PROMISCUOUS, DIRECTED,
722 * MULTICAST, ALL_MULTICAST, BROADCAST 730 * MULTICAST, ALL_MULTICAST, BROADCAST
723 */ 731 */
724 *params->filter = (u16) le32_to_cpup((__le32 *)buf); 732 *params->filter = (u16) le32_to_cpu(get_unaligned(
733 (__le32 *)buf));
725 DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n", 734 DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
726 __FUNCTION__, *params->filter); 735 __FUNCTION__, *params->filter);
727 736
@@ -771,7 +780,7 @@ update_linkstate:
771 * resuming, Windows forces a reset, and then SET_POWER D0. 780 * resuming, Windows forces a reset, and then SET_POWER D0.
772 * FIXME ... then things go batty; Windows wedges itself. 781 * FIXME ... then things go batty; Windows wedges itself.
773 */ 782 */
774 i = le32_to_cpup((__force __le32 *)buf); 783 i = le32_to_cpu(get_unaligned((__le32 *)buf));
775 DEBUG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1); 784 DEBUG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1);
776 switch (i) { 785 switch (i) {
777 case NdisDeviceStateD0: 786 case NdisDeviceStateD0:
@@ -1058,8 +1067,8 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
1058 return -ENOMEM; 1067 return -ENOMEM;
1059 1068
1060 tmp = (__le32 *) buf; 1069 tmp = (__le32 *) buf;
1061 MsgType = le32_to_cpup(tmp++); 1070 MsgType = le32_to_cpu(get_unaligned(tmp++));
1062 MsgLength = le32_to_cpup(tmp++); 1071 MsgLength = le32_to_cpu(get_unaligned(tmp++));
1063 1072
1064 if (configNr >= RNDIS_MAX_CONFIGS) 1073 if (configNr >= RNDIS_MAX_CONFIGS)
1065 return -ENOTSUPP; 1074 return -ENOTSUPP;
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 216c9c9d4d6d..bb9cc595219e 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -417,6 +417,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
417 unsigned long flags; 417 unsigned long flags;
418 418
419 spin_lock_irqsave (&ohci->lock, flags); 419 spin_lock_irqsave (&ohci->lock, flags);
420 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
421 goto done;
420 422
421 /* undocumented erratum seen on at least rev D */ 423 /* undocumented erratum seen on at least rev D */
422 if ((ohci->flags & OHCI_QUIRK_AMD756) 424 if ((ohci->flags & OHCI_QUIRK_AMD756)
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index d230ee72f9cd..54979c239c63 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1179,8 +1179,8 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
1179 US_SC_DEVICE, US_PR_DEVICE, NULL, 1179 US_SC_DEVICE, US_PR_DEVICE, NULL,
1180 US_FL_FIX_INQUIRY ), 1180 US_FL_FIX_INQUIRY ),
1181 1181
1182/* These are virtual windows driver CDs, which the zd1211rw driver automatically 1182/* These are virtual windows driver CDs, which the zd1211rw driver
1183 * converts into a WLAN devices. */ 1183 * automatically converts into WLAN devices. */
1184UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, 1184UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
1185 "ZyXEL", 1185 "ZyXEL",
1186 "G-220F USB-WLAN Install", 1186 "G-220F USB-WLAN Install",
@@ -1193,6 +1193,14 @@ UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0101,
1193 US_SC_DEVICE, US_PR_DEVICE, NULL, 1193 US_SC_DEVICE, US_PR_DEVICE, NULL,
1194 US_FL_IGNORE_DEVICE ), 1194 US_FL_IGNORE_DEVICE ),
1195 1195
1196/* SanDisk that has a second LUN for a driver ISO, reported by
1197 * Ben Collins <bcollins@ubuntu.com> */
1198UNUSUAL_DEV( 0x0781, 0x5406, 0x0000, 0xffff,
1199 "SanDisk",
1200 "U3 Cruzer Micro driver ISO",
1201 US_SC_DEVICE, US_PR_DEVICE, NULL,
1202 US_FL_SINGLE_LUN ),
1203
1196#ifdef CONFIG_USB_STORAGE_ISD200 1204#ifdef CONFIG_USB_STORAGE_ISD200
1197UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1205UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
1198 "ATI", 1206 "ATI",
@@ -1271,6 +1279,15 @@ UNUSUAL_DEV( 0x0dd8, 0x1060, 0x0000, 0xffff,
1271 US_SC_DEVICE, US_PR_DEVICE, NULL, 1279 US_SC_DEVICE, US_PR_DEVICE, NULL,
1272 US_FL_FIX_INQUIRY ), 1280 US_FL_FIX_INQUIRY ),
1273 1281
1282/* Reported by Edward Chapman (taken from linux-usb mailing list)
1283 Netac OnlyDisk Mini U2CV2 512MB USB 2.0 Flash Drive */
1284UNUSUAL_DEV( 0x0dd8, 0xd202, 0x0000, 0x9999,
1285 "Netac",
1286 "USB Flash Disk",
1287 US_SC_DEVICE, US_PR_DEVICE, NULL,
1288 US_FL_IGNORE_RESIDUE ),
1289
1290
1274/* Patch by Stephan Walter <stephan.walter@epfl.ch> 1291/* Patch by Stephan Walter <stephan.walter@epfl.ch>
1275 * I don't know why, but it works... */ 1292 * I don't know why, but it works... */
1276UNUSUAL_DEV( 0x0dda, 0x0001, 0x0012, 0x0012, 1293UNUSUAL_DEV( 0x0dda, 0x0001, 0x0012, 0x0012,