diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 11:12:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 11:12:54 -0400 |
commit | 641e22e04c48af5d813f119c55336e02a22756f5 (patch) | |
tree | 9f7f693e8dd030e1d28585893e6e53bd86b1208c /drivers | |
parent | 31f6e1bd3b58c9a67e5ea0c2d372fbf5fc9e326d (diff) | |
parent | fa91d43b914b77637653d984416e17e182f7b807 (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: (29 commits)
USB: Add support for Olimex arm-usb-ocd JTAG interface serial port
USB: Add support for Sierra Wireless Aircard 595U
USB: ldusb bugfix
USB: ftdi_sio: Add USB Product Id for OpenDCC
USB: fix ratelimit call semantics
USB: handle errors in power/level attribute
USB: make the autosuspend workqueue thread freezable
USB: Fix USB OHCI Subvendor for Toshiba Portege 4000
USB: usblp: Use correct DMA address in case of probe error
USB: Fix debug output of ark3116
USB: Onetouch - switch to using input_dev->dev.parent
USB: don't try to kzalloc 0 bytes
USB: remove short initial timeout for device descriptor fetch
USB: Deref URB after usbmon is done with it
USB: Remove duplicate IDs from option card driver
USB: auerswald: fix file release handler
USB: fsl_usb2_udc: Fix UMTI_WIDE support and a compile warning
USB: set the correct Interrupt interval in usb_bulk_msg
USB: New device PID for ftdi_sio driver
USB: remove unneeded WARN_ON
...
Diffstat (limited to 'drivers')
28 files changed, 207 insertions, 87 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 5a21f06bf8a5..675ac99a79c6 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -91,6 +91,22 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
91 | "CDC descriptors on config\n"); | 91 | "CDC descriptors on config\n"); |
92 | } | 92 | } |
93 | 93 | ||
94 | /* Maybe CDC descriptors are after the endpoint? This bug has | ||
95 | * been seen on some 2Wire Inc RNDIS-ish products. | ||
96 | */ | ||
97 | if (len == 0) { | ||
98 | struct usb_host_endpoint *hep; | ||
99 | |||
100 | hep = intf->cur_altsetting->endpoint; | ||
101 | if (hep) { | ||
102 | buf = hep->extra; | ||
103 | len = hep->extralen; | ||
104 | } | ||
105 | if (len) | ||
106 | dev_dbg(&intf->dev, | ||
107 | "CDC descriptors on endpoint\n"); | ||
108 | } | ||
109 | |||
94 | /* this assumes that if there's a non-RNDIS vendor variant | 110 | /* this assumes that if there's a non-RNDIS vendor variant |
95 | * of cdc-acm, it'll fail RNDIS requests cleanly. | 111 | * of cdc-acm, it'll fail RNDIS requests cleanly. |
96 | */ | 112 | */ |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 980e4aaa97aa..cd991a0f75bb 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -515,6 +515,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) | |||
515 | dev_err(&intf->dev, | 515 | dev_err(&intf->dev, |
516 | "dev can't take %u byte packets (max %u)\n", | 516 | "dev can't take %u byte packets (max %u)\n", |
517 | dev->hard_mtu, tmp); | 517 | dev->hard_mtu, tmp); |
518 | retval = -EINVAL; | ||
518 | goto fail_and_release; | 519 | goto fail_and_release; |
519 | } | 520 | } |
520 | 521 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f9cd42d058b0..5b16d9a1269a 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1252,20 +1252,23 @@ EXPORT_SYMBOL_GPL(usbnet_probe); | |||
1252 | 1252 | ||
1253 | /*-------------------------------------------------------------------------*/ | 1253 | /*-------------------------------------------------------------------------*/ |
1254 | 1254 | ||
1255 | /* FIXME these suspend/resume methods assume non-CDC style | 1255 | /* |
1256 | * devices, with only one interface. | 1256 | * suspend the whole driver as soon as the first interface is suspended |
1257 | * resume only when the last interface is resumed | ||
1257 | */ | 1258 | */ |
1258 | 1259 | ||
1259 | int usbnet_suspend (struct usb_interface *intf, pm_message_t message) | 1260 | int usbnet_suspend (struct usb_interface *intf, pm_message_t message) |
1260 | { | 1261 | { |
1261 | struct usbnet *dev = usb_get_intfdata(intf); | 1262 | struct usbnet *dev = usb_get_intfdata(intf); |
1262 | 1263 | ||
1263 | /* accelerate emptying of the rx and queues, to avoid | 1264 | if (!dev->suspend_count++) { |
1264 | * having everything error out. | 1265 | /* accelerate emptying of the rx and queues, to avoid |
1265 | */ | 1266 | * having everything error out. |
1266 | netif_device_detach (dev->net); | 1267 | */ |
1267 | (void) unlink_urbs (dev, &dev->rxq); | 1268 | netif_device_detach (dev->net); |
1268 | (void) unlink_urbs (dev, &dev->txq); | 1269 | (void) unlink_urbs (dev, &dev->rxq); |
1270 | (void) unlink_urbs (dev, &dev->txq); | ||
1271 | } | ||
1269 | return 0; | 1272 | return 0; |
1270 | } | 1273 | } |
1271 | EXPORT_SYMBOL_GPL(usbnet_suspend); | 1274 | EXPORT_SYMBOL_GPL(usbnet_suspend); |
@@ -1274,8 +1277,10 @@ int usbnet_resume (struct usb_interface *intf) | |||
1274 | { | 1277 | { |
1275 | struct usbnet *dev = usb_get_intfdata(intf); | 1278 | struct usbnet *dev = usb_get_intfdata(intf); |
1276 | 1279 | ||
1277 | netif_device_attach (dev->net); | 1280 | if (!--dev->suspend_count) { |
1278 | tasklet_schedule (&dev->bh); | 1281 | netif_device_attach (dev->net); |
1282 | tasklet_schedule (&dev->bh); | ||
1283 | } | ||
1279 | return 0; | 1284 | return 0; |
1280 | } | 1285 | } |
1281 | EXPORT_SYMBOL_GPL(usbnet_resume); | 1286 | EXPORT_SYMBOL_GPL(usbnet_resume); |
diff --git a/drivers/net/usb/usbnet.h b/drivers/net/usb/usbnet.h index 82db5a8e528e..a3f8b9e7bc00 100644 --- a/drivers/net/usb/usbnet.h +++ b/drivers/net/usb/usbnet.h | |||
@@ -32,6 +32,7 @@ struct usbnet { | |||
32 | const char *driver_name; | 32 | const char *driver_name; |
33 | wait_queue_head_t *wait; | 33 | wait_queue_head_t *wait; |
34 | struct mutex phy_mutex; | 34 | struct mutex phy_mutex; |
35 | unsigned char suspend_count; | ||
35 | 36 | ||
36 | /* i/o info: pipes etc */ | 37 | /* i/o info: pipes etc */ |
37 | unsigned in, out; | 38 | unsigned in, out; |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 15e740e3a5c4..7b1edfe46b28 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1003,7 +1003,7 @@ abort: | |||
1003 | usblp->writebuf, usblp->writeurb->transfer_dma); | 1003 | usblp->writebuf, usblp->writeurb->transfer_dma); |
1004 | if (usblp->readbuf) | 1004 | if (usblp->readbuf) |
1005 | usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, | 1005 | usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, |
1006 | usblp->readbuf, usblp->writeurb->transfer_dma); | 1006 | usblp->readbuf, usblp->readurb->transfer_dma); |
1007 | kfree(usblp->statusbuf); | 1007 | kfree(usblp->statusbuf); |
1008 | kfree(usblp->device_id_string); | 1008 | kfree(usblp->device_id_string); |
1009 | usb_free_urb(usblp->writeurb); | 1009 | usb_free_urb(usblp->writeurb); |
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index bfb3731d42db..2d4fd530e5e4 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -185,10 +185,12 @@ static int usb_parse_interface(struct device *ddev, int cfgno, | |||
185 | num_ep = USB_MAXENDPOINTS; | 185 | num_ep = USB_MAXENDPOINTS; |
186 | } | 186 | } |
187 | 187 | ||
188 | len = sizeof(struct usb_host_endpoint) * num_ep; | 188 | if (num_ep > 0) { /* Can't allocate 0 bytes */ |
189 | alt->endpoint = kzalloc(len, GFP_KERNEL); | 189 | len = sizeof(struct usb_host_endpoint) * num_ep; |
190 | if (!alt->endpoint) | 190 | alt->endpoint = kzalloc(len, GFP_KERNEL); |
191 | return -ENOMEM; | 191 | if (!alt->endpoint) |
192 | return -ENOMEM; | ||
193 | } | ||
192 | 194 | ||
193 | /* Parse all the endpoint descriptors */ | 195 | /* Parse all the endpoint descriptors */ |
194 | n = 0; | 196 | n = 0; |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index b9f7f90aef82..2619986e5300 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -983,7 +983,10 @@ static int autosuspend_check(struct usb_device *udev) | |||
983 | 983 | ||
984 | #else | 984 | #else |
985 | 985 | ||
986 | #define autosuspend_check(udev) 0 | 986 | static inline int autosuspend_check(struct usb_device *udev) |
987 | { | ||
988 | return 0; | ||
989 | } | ||
987 | 990 | ||
988 | #endif /* CONFIG_USB_SUSPEND */ | 991 | #endif /* CONFIG_USB_SUSPEND */ |
989 | 992 | ||
@@ -1041,7 +1044,6 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1041 | if (status < 0) | 1044 | if (status < 0) |
1042 | goto done; | 1045 | goto done; |
1043 | } | 1046 | } |
1044 | cancel_delayed_work(&udev->autosuspend); | ||
1045 | 1047 | ||
1046 | /* Suspend all the interfaces and then udev itself */ | 1048 | /* Suspend all the interfaces and then udev itself */ |
1047 | if (udev->actconfig) { | 1049 | if (udev->actconfig) { |
@@ -1062,9 +1064,16 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1062 | usb_resume_interface(intf); | 1064 | usb_resume_interface(intf); |
1063 | } | 1065 | } |
1064 | 1066 | ||
1067 | /* Try another autosuspend when the interfaces aren't busy */ | ||
1068 | if (udev->auto_pm) | ||
1069 | autosuspend_check(udev); | ||
1070 | |||
1065 | /* If the suspend succeeded, propagate it up the tree */ | 1071 | /* If the suspend succeeded, propagate it up the tree */ |
1066 | } else if (parent) | 1072 | } else { |
1067 | usb_autosuspend_device(parent); | 1073 | cancel_delayed_work(&udev->autosuspend); |
1074 | if (parent) | ||
1075 | usb_autosuspend_device(parent); | ||
1076 | } | ||
1068 | 1077 | ||
1069 | done: | 1078 | done: |
1070 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); | 1079 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); |
@@ -1475,6 +1484,7 @@ int usb_external_resume_device(struct usb_device *udev) | |||
1475 | usb_pm_lock(udev); | 1484 | usb_pm_lock(udev); |
1476 | udev->auto_pm = 0; | 1485 | udev->auto_pm = 0; |
1477 | status = usb_resume_both(udev); | 1486 | status = usb_resume_both(udev); |
1487 | udev->last_busy = jiffies; | ||
1478 | usb_pm_unlock(udev); | 1488 | usb_pm_unlock(udev); |
1479 | 1489 | ||
1480 | /* Now that the device is awake, we can start trying to autosuspend | 1490 | /* Now that the device is awake, we can start trying to autosuspend |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 40cf882293e6..e277258df382 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1018,8 +1018,8 @@ done: | |||
1018 | atomic_dec (&urb->use_count); | 1018 | atomic_dec (&urb->use_count); |
1019 | if (urb->reject) | 1019 | if (urb->reject) |
1020 | wake_up (&usb_kill_urb_queue); | 1020 | wake_up (&usb_kill_urb_queue); |
1021 | usb_put_urb (urb); | ||
1022 | usbmon_urb_submit_error(&hcd->self, urb, status); | 1021 | usbmon_urb_submit_error(&hcd->self, urb, status); |
1022 | usb_put_urb (urb); | ||
1023 | } | 1023 | } |
1024 | return status; | 1024 | return status; |
1025 | } | 1025 | } |
@@ -1175,10 +1175,6 @@ void usb_hcd_endpoint_disable (struct usb_device *udev, | |||
1175 | struct urb *urb; | 1175 | struct urb *urb; |
1176 | 1176 | ||
1177 | hcd = bus_to_hcd(udev->bus); | 1177 | hcd = bus_to_hcd(udev->bus); |
1178 | |||
1179 | WARN_ON (!HC_IS_RUNNING (hcd->state) && hcd->state != HC_STATE_HALT && | ||
1180 | udev->state != USB_STATE_NOTATTACHED); | ||
1181 | |||
1182 | local_irq_disable (); | 1178 | local_irq_disable (); |
1183 | 1179 | ||
1184 | /* ep is already gone from udev->ep_{in,out}[]; no more submits */ | 1180 | /* ep is already gone from udev->ep_{in,out}[]; no more submits */ |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f6b74a678de5..caaa46f2dec7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2201,14 +2201,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2201 | continue; | 2201 | continue; |
2202 | } | 2202 | } |
2203 | 2203 | ||
2204 | /* Use a short timeout the first time through, | 2204 | /* Retry on all errors; some devices are flakey. |
2205 | * so that recalcitrant full-speed devices with | 2205 | * 255 is for WUSB devices, we actually need to use |
2206 | * 8- or 16-byte ep0-maxpackets won't slow things | 2206 | * 512 (WUSB1.0[4.8.1]). |
2207 | * down tremendously by NAKing the unexpectedly | ||
2208 | * early status stage. Also, retry on all errors; | ||
2209 | * some devices are flakey. | ||
2210 | * 255 is for WUSB devices, we actually need to use 512. | ||
2211 | * WUSB1.0[4.8.1]. | ||
2212 | */ | 2207 | */ |
2213 | for (j = 0; j < 3; ++j) { | 2208 | for (j = 0; j < 3; ++j) { |
2214 | buf->bMaxPacketSize0 = 0; | 2209 | buf->bMaxPacketSize0 = 0; |
@@ -2216,7 +2211,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2216 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, | 2211 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, |
2217 | USB_DT_DEVICE << 8, 0, | 2212 | USB_DT_DEVICE << 8, 0, |
2218 | buf, GET_DESCRIPTOR_BUFSIZE, | 2213 | buf, GET_DESCRIPTOR_BUFSIZE, |
2219 | (i ? USB_CTRL_GET_TIMEOUT : 1000)); | 2214 | USB_CTRL_GET_TIMEOUT); |
2220 | switch (buf->bMaxPacketSize0) { | 2215 | switch (buf->bMaxPacketSize0) { |
2221 | case 8: case 16: case 32: case 64: case 255: | 2216 | case 8: case 16: case 32: case 64: case 255: |
2222 | if (buf->bDescriptorType == | 2217 | if (buf->bDescriptorType == |
@@ -2426,10 +2421,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
2426 | 2421 | ||
2427 | if (portchange & USB_PORT_STAT_C_CONNECTION) { | 2422 | if (portchange & USB_PORT_STAT_C_CONNECTION) { |
2428 | status = hub_port_debounce(hub, port1); | 2423 | status = hub_port_debounce(hub, port1); |
2429 | if (status < 0 && printk_ratelimit()) { | 2424 | if (status < 0) { |
2430 | dev_err (hub_dev, | 2425 | if (printk_ratelimit()) |
2431 | "connect-debounce failed, port %d disabled\n", | 2426 | dev_err (hub_dev, "connect-debounce failed, " |
2432 | port1); | 2427 | "port %d disabled\n", port1); |
2433 | goto done; | 2428 | goto done; |
2434 | } | 2429 | } |
2435 | portstatus = status; | 2430 | portstatus = status; |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b7434787db5f..f9fed34bf7d8 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -221,15 +221,10 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | |||
221 | 221 | ||
222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
223 | USB_ENDPOINT_XFER_INT) { | 223 | USB_ENDPOINT_XFER_INT) { |
224 | int interval; | ||
225 | |||
226 | if (usb_dev->speed == USB_SPEED_HIGH) | ||
227 | interval = 1 << min(15, ep->desc.bInterval - 1); | ||
228 | else | ||
229 | interval = ep->desc.bInterval; | ||
230 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); | 224 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); |
231 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, | 225 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, |
232 | usb_api_blocking_completion, NULL, interval); | 226 | usb_api_blocking_completion, NULL, |
227 | ep->desc.bInterval); | ||
233 | } else | 228 | } else |
234 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, | 229 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, |
235 | usb_api_blocking_completion, NULL); | 230 | usb_api_blocking_completion, NULL); |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index e7c982377488..be37c863fdfb 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -232,12 +232,15 @@ set_level(struct device *dev, struct device_attribute *attr, | |||
232 | int len = count; | 232 | int len = count; |
233 | char *cp; | 233 | char *cp; |
234 | int rc = 0; | 234 | int rc = 0; |
235 | int old_autosuspend_disabled, old_autoresume_disabled; | ||
235 | 236 | ||
236 | cp = memchr(buf, '\n', count); | 237 | cp = memchr(buf, '\n', count); |
237 | if (cp) | 238 | if (cp) |
238 | len = cp - buf; | 239 | len = cp - buf; |
239 | 240 | ||
240 | usb_lock_device(udev); | 241 | usb_lock_device(udev); |
242 | old_autosuspend_disabled = udev->autosuspend_disabled; | ||
243 | old_autoresume_disabled = udev->autoresume_disabled; | ||
241 | 244 | ||
242 | /* Setting the flags without calling usb_pm_lock is a subject to | 245 | /* Setting the flags without calling usb_pm_lock is a subject to |
243 | * races, but who cares... | 246 | * races, but who cares... |
@@ -263,6 +266,10 @@ set_level(struct device *dev, struct device_attribute *attr, | |||
263 | } else | 266 | } else |
264 | rc = -EINVAL; | 267 | rc = -EINVAL; |
265 | 268 | ||
269 | if (rc) { | ||
270 | udev->autosuspend_disabled = old_autosuspend_disabled; | ||
271 | udev->autoresume_disabled = old_autoresume_disabled; | ||
272 | } | ||
266 | usb_unlock_device(udev); | 273 | usb_unlock_device(udev); |
267 | return (rc < 0 ? rc : count); | 274 | return (rc < 0 ? rc : count); |
268 | } | 275 | } |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 18ddc5e67e39..80627b6a2bf9 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -205,7 +205,11 @@ struct device_type usb_device_type = { | |||
205 | 205 | ||
206 | static int ksuspend_usb_init(void) | 206 | static int ksuspend_usb_init(void) |
207 | { | 207 | { |
208 | ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd"); | 208 | /* This workqueue is supposed to be both freezable and |
209 | * singlethreaded. Its job doesn't justify running on more | ||
210 | * than one CPU. | ||
211 | */ | ||
212 | ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd"); | ||
209 | if (!ksuspend_usb_wq) | 213 | if (!ksuspend_usb_wq) |
210 | return -ENOMEM; | 214 | return -ENOMEM; |
211 | return 0; | 215 | return 0; |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c index 157054ea3978..3ca2b3159f00 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.c +++ b/drivers/usb/gadget/fsl_usb2_udc.c | |||
@@ -228,13 +228,15 @@ static int dr_controller_setup(struct fsl_udc *udc) | |||
228 | 228 | ||
229 | /* Config PHY interface */ | 229 | /* Config PHY interface */ |
230 | portctrl = fsl_readl(&dr_regs->portsc1); | 230 | portctrl = fsl_readl(&dr_regs->portsc1); |
231 | portctrl &= ~PORTSCX_PHY_TYPE_SEL; | 231 | portctrl &= ~(PORTSCX_PHY_TYPE_SEL & PORTSCX_PORT_WIDTH); |
232 | switch (udc->phy_mode) { | 232 | switch (udc->phy_mode) { |
233 | case FSL_USB2_PHY_ULPI: | 233 | case FSL_USB2_PHY_ULPI: |
234 | portctrl |= PORTSCX_PTS_ULPI; | 234 | portctrl |= PORTSCX_PTS_ULPI; |
235 | break; | 235 | break; |
236 | case FSL_USB2_PHY_UTMI: | ||
237 | case FSL_USB2_PHY_UTMI_WIDE: | 236 | case FSL_USB2_PHY_UTMI_WIDE: |
237 | portctrl |= PORTSCX_PTW_16BIT; | ||
238 | /* fall through */ | ||
239 | case FSL_USB2_PHY_UTMI: | ||
238 | portctrl |= PORTSCX_PTS_UTMI; | 240 | portctrl |= PORTSCX_PTS_UTMI; |
239 | break; | 241 | break; |
240 | case FSL_USB2_PHY_SERIAL: | 242 | case FSL_USB2_PHY_SERIAL: |
@@ -625,7 +627,7 @@ static void fsl_free_buffer(struct usb_ep *_ep, void *buf, | |||
625 | struct fsl_ep *ep; | 627 | struct fsl_ep *ep; |
626 | 628 | ||
627 | if (!_ep) | 629 | if (!_ep) |
628 | return NULL; | 630 | return; |
629 | 631 | ||
630 | ep = container_of(_ep, struct fsl_ep, ep); | 632 | ep = container_of(_ep, struct fsl_ep, ep); |
631 | 633 | ||
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 79705609fd0c..ca62cb583221 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -137,7 +137,7 @@ static const struct pci_device_id ohci_pci_quirks[] = { | |||
137 | /* Toshiba portege 4000 */ | 137 | /* Toshiba portege 4000 */ |
138 | .vendor = PCI_VENDOR_ID_AL, | 138 | .vendor = PCI_VENDOR_ID_AL, |
139 | .device = 0x5237, | 139 | .device = 0x5237, |
140 | .subvendor = PCI_VENDOR_ID_TOSHIBA_2, | 140 | .subvendor = PCI_VENDOR_ID_TOSHIBA, |
141 | .subdevice = 0x0004, | 141 | .subdevice = 0x0004, |
142 | .driver_data = (unsigned long) broken_suspend, | 142 | .driver_data = (unsigned long) broken_suspend, |
143 | }, | 143 | }, |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 20861650905e..c225159ca3d3 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #define EHCI_USBSTS 4 /* status register */ | 44 | #define EHCI_USBSTS 4 /* status register */ |
45 | #define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */ | 45 | #define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */ |
46 | #define EHCI_USBINTR 8 /* interrupt register */ | 46 | #define EHCI_USBINTR 8 /* interrupt register */ |
47 | #define EHCI_CONFIGFLAG 0x40 /* configured flag register */ | ||
47 | #define EHCI_USBLEGSUP 0 /* legacy support register */ | 48 | #define EHCI_USBLEGSUP 0 /* legacy support register */ |
48 | #define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */ | 49 | #define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */ |
49 | #define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */ | 50 | #define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */ |
@@ -216,6 +217,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) | |||
216 | u32 hcc_params, val; | 217 | u32 hcc_params, val; |
217 | u8 offset, cap_length; | 218 | u8 offset, cap_length; |
218 | int count = 256/4; | 219 | int count = 256/4; |
220 | int tried_handoff = 0; | ||
219 | 221 | ||
220 | if (!mmio_resource_enabled(pdev, 0)) | 222 | if (!mmio_resource_enabled(pdev, 0)) |
221 | return; | 223 | return; |
@@ -273,6 +275,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) | |||
273 | */ | 275 | */ |
274 | msec = 5000; | 276 | msec = 5000; |
275 | while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) { | 277 | while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) { |
278 | tried_handoff = 1; | ||
276 | msleep(10); | 279 | msleep(10); |
277 | msec -= 10; | 280 | msec -= 10; |
278 | pci_read_config_dword(pdev, offset, &cap); | 281 | pci_read_config_dword(pdev, offset, &cap); |
@@ -292,6 +295,12 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) | |||
292 | pci_write_config_dword(pdev, | 295 | pci_write_config_dword(pdev, |
293 | offset + EHCI_USBLEGCTLSTS, | 296 | offset + EHCI_USBLEGCTLSTS, |
294 | 0); | 297 | 0); |
298 | |||
299 | /* If the BIOS ever owned the controller then we | ||
300 | * can't expect any power sessions to remain intact. | ||
301 | */ | ||
302 | if (tried_handoff) | ||
303 | writel(0, op_reg_base + EHCI_CONFIGFLAG); | ||
295 | break; | 304 | break; |
296 | case 0: /* illegal reserved capability */ | 305 | case 0: /* illegal reserved capability */ |
297 | cap = 0; | 306 | cap = 0; |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index ff0dba01f1c7..e98df2ee9901 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -57,6 +57,13 @@ | |||
57 | #include <asm/system.h> | 57 | #include <asm/system.h> |
58 | #include <asm/byteorder.h> | 58 | #include <asm/byteorder.h> |
59 | #include "../core/hcd.h" | 59 | #include "../core/hcd.h" |
60 | |||
61 | /* FIXME ohci.h is ONLY for internal use by the OHCI driver. | ||
62 | * If you're going to try stuff like this, you need to split | ||
63 | * out shareable stuff (register declarations?) into its own | ||
64 | * file, maybe name <linux/usb/ohci.h> | ||
65 | */ | ||
66 | |||
60 | #include "ohci.h" | 67 | #include "ohci.h" |
61 | #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR | 68 | #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR |
62 | #define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ | 69 | #define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ |
@@ -173,11 +180,6 @@ struct u132_ring { | |||
173 | struct u132_endp *curr_endp; | 180 | struct u132_endp *curr_endp; |
174 | struct delayed_work scheduler; | 181 | struct delayed_work scheduler; |
175 | }; | 182 | }; |
176 | #define OHCI_QUIRK_AMD756 0x01 | ||
177 | #define OHCI_QUIRK_SUPERIO 0x02 | ||
178 | #define OHCI_QUIRK_INITRESET 0x04 | ||
179 | #define OHCI_BIG_ENDIAN 0x08 | ||
180 | #define OHCI_QUIRK_ZFMICRO 0x10 | ||
181 | struct u132 { | 183 | struct u132 { |
182 | struct kref kref; | 184 | struct kref kref; |
183 | struct list_head u132_list; | 185 | struct list_head u132_list; |
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c index 88fb56d5db8f..cac1500cba62 100644 --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c | |||
@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file) | |||
1822 | pauerswald_t cp; | 1822 | pauerswald_t cp; |
1823 | dbg("release"); | 1823 | dbg("release"); |
1824 | 1824 | ||
1825 | /* get the mutexes */ | 1825 | down(&ccp->mutex); |
1826 | if (down_interruptible (&ccp->mutex)) { | ||
1827 | return -ERESTARTSYS; | ||
1828 | } | ||
1829 | cp = ccp->auerdev; | 1826 | cp = ccp->auerdev; |
1830 | if (cp) { | 1827 | if (cp) { |
1831 | if (down_interruptible (&cp->mutex)) { | 1828 | down(&cp->mutex); |
1832 | up (&ccp->mutex); | ||
1833 | return -ERESTARTSYS; | ||
1834 | } | ||
1835 | /* remove an open service */ | 1829 | /* remove an open service */ |
1836 | auerswald_removeservice (cp, &ccp->scontext); | 1830 | auerswald_removeservice (cp, &ccp->scontext); |
1837 | /* detach from device */ | 1831 | /* detach from device */ |
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index e2172e5cf152..e0f122e131d7 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c | |||
@@ -73,6 +73,13 @@ static struct list_head ftdi_static_list; | |||
73 | #include "usb_u132.h" | 73 | #include "usb_u132.h" |
74 | #include <asm/io.h> | 74 | #include <asm/io.h> |
75 | #include "../core/hcd.h" | 75 | #include "../core/hcd.h" |
76 | |||
77 | /* FIXME ohci.h is ONLY for internal use by the OHCI driver. | ||
78 | * If you're going to try stuff like this, you need to split | ||
79 | * out shareable stuff (register declarations?) into its own | ||
80 | * file, maybe name <linux/usb/ohci.h> | ||
81 | */ | ||
82 | |||
76 | #include "../host/ohci.h" | 83 | #include "../host/ohci.h" |
77 | /* Define these values to match your devices*/ | 84 | /* Define these values to match your devices*/ |
78 | #define USB_FTDI_ELAN_VENDOR_ID 0x0403 | 85 | #define USB_FTDI_ELAN_VENDOR_ID 0x0403 |
@@ -2300,10 +2307,7 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi) | |||
2300 | offsetof(struct ohci_regs, member), 0, data); | 2307 | offsetof(struct ohci_regs, member), 0, data); |
2301 | #define ftdi_write_pcimem(ftdi, member, data) ftdi_elan_write_pcimem(ftdi, \ | 2308 | #define ftdi_write_pcimem(ftdi, member, data) ftdi_elan_write_pcimem(ftdi, \ |
2302 | offsetof(struct ohci_regs, member), 0, data); | 2309 | offsetof(struct ohci_regs, member), 0, data); |
2303 | #define OHCI_QUIRK_AMD756 0x01 | 2310 | |
2304 | #define OHCI_QUIRK_SUPERIO 0x02 | ||
2305 | #define OHCI_QUIRK_INITRESET 0x04 | ||
2306 | #define OHCI_BIG_ENDIAN 0x08 | ||
2307 | #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR | 2311 | #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR |
2308 | #define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ | 2312 | #define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ |
2309 | OHCI_INTR_WDH) | 2313 | OHCI_INTR_WDH) |
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 11555bde655b..7bad49404762 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c | |||
@@ -165,6 +165,8 @@ struct ld_usb { | |||
165 | size_t interrupt_in_endpoint_size; | 165 | size_t interrupt_in_endpoint_size; |
166 | int interrupt_in_running; | 166 | int interrupt_in_running; |
167 | int interrupt_in_done; | 167 | int interrupt_in_done; |
168 | int buffer_overflow; | ||
169 | spinlock_t rbsl; | ||
168 | 170 | ||
169 | char* interrupt_out_buffer; | 171 | char* interrupt_out_buffer; |
170 | struct usb_endpoint_descriptor* interrupt_out_endpoint; | 172 | struct usb_endpoint_descriptor* interrupt_out_endpoint; |
@@ -230,10 +232,12 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) | |||
230 | } else { | 232 | } else { |
231 | dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n", | 233 | dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n", |
232 | __FUNCTION__, urb->status); | 234 | __FUNCTION__, urb->status); |
235 | spin_lock(&dev->rbsl); | ||
233 | goto resubmit; /* maybe we can recover */ | 236 | goto resubmit; /* maybe we can recover */ |
234 | } | 237 | } |
235 | } | 238 | } |
236 | 239 | ||
240 | spin_lock(&dev->rbsl); | ||
237 | if (urb->actual_length > 0) { | 241 | if (urb->actual_length > 0) { |
238 | next_ring_head = (dev->ring_head+1) % ring_buffer_size; | 242 | next_ring_head = (dev->ring_head+1) % ring_buffer_size; |
239 | if (next_ring_head != dev->ring_tail) { | 243 | if (next_ring_head != dev->ring_tail) { |
@@ -244,21 +248,25 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) | |||
244 | dev->ring_head = next_ring_head; | 248 | dev->ring_head = next_ring_head; |
245 | dbg_info(&dev->intf->dev, "%s: received %d bytes\n", | 249 | dbg_info(&dev->intf->dev, "%s: received %d bytes\n", |
246 | __FUNCTION__, urb->actual_length); | 250 | __FUNCTION__, urb->actual_length); |
247 | } else | 251 | } else { |
248 | dev_warn(&dev->intf->dev, | 252 | dev_warn(&dev->intf->dev, |
249 | "Ring buffer overflow, %d bytes dropped\n", | 253 | "Ring buffer overflow, %d bytes dropped\n", |
250 | urb->actual_length); | 254 | urb->actual_length); |
255 | dev->buffer_overflow = 1; | ||
256 | } | ||
251 | } | 257 | } |
252 | 258 | ||
253 | resubmit: | 259 | resubmit: |
254 | /* resubmit if we're still running */ | 260 | /* resubmit if we're still running */ |
255 | if (dev->interrupt_in_running && dev->intf) { | 261 | if (dev->interrupt_in_running && !dev->buffer_overflow && dev->intf) { |
256 | retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC); | 262 | retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC); |
257 | if (retval) | 263 | if (retval) { |
258 | dev_err(&dev->intf->dev, | 264 | dev_err(&dev->intf->dev, |
259 | "usb_submit_urb failed (%d)\n", retval); | 265 | "usb_submit_urb failed (%d)\n", retval); |
266 | dev->buffer_overflow = 1; | ||
267 | } | ||
260 | } | 268 | } |
261 | 269 | spin_unlock(&dev->rbsl); | |
262 | exit: | 270 | exit: |
263 | dev->interrupt_in_done = 1; | 271 | dev->interrupt_in_done = 1; |
264 | wake_up_interruptible(&dev->read_wait); | 272 | wake_up_interruptible(&dev->read_wait); |
@@ -330,6 +338,7 @@ static int ld_usb_open(struct inode *inode, struct file *file) | |||
330 | /* initialize in direction */ | 338 | /* initialize in direction */ |
331 | dev->ring_head = 0; | 339 | dev->ring_head = 0; |
332 | dev->ring_tail = 0; | 340 | dev->ring_tail = 0; |
341 | dev->buffer_overflow = 0; | ||
333 | usb_fill_int_urb(dev->interrupt_in_urb, | 342 | usb_fill_int_urb(dev->interrupt_in_urb, |
334 | interface_to_usbdev(interface), | 343 | interface_to_usbdev(interface), |
335 | usb_rcvintpipe(interface_to_usbdev(interface), | 344 | usb_rcvintpipe(interface_to_usbdev(interface), |
@@ -439,6 +448,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, | |||
439 | size_t *actual_buffer; | 448 | size_t *actual_buffer; |
440 | size_t bytes_to_read; | 449 | size_t bytes_to_read; |
441 | int retval = 0; | 450 | int retval = 0; |
451 | int rv; | ||
442 | 452 | ||
443 | dev = file->private_data; | 453 | dev = file->private_data; |
444 | 454 | ||
@@ -460,7 +470,10 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, | |||
460 | } | 470 | } |
461 | 471 | ||
462 | /* wait for data */ | 472 | /* wait for data */ |
473 | spin_lock_irq(&dev->rbsl); | ||
463 | if (dev->ring_head == dev->ring_tail) { | 474 | if (dev->ring_head == dev->ring_tail) { |
475 | dev->interrupt_in_done = 0; | ||
476 | spin_unlock_irq(&dev->rbsl); | ||
464 | if (file->f_flags & O_NONBLOCK) { | 477 | if (file->f_flags & O_NONBLOCK) { |
465 | retval = -EAGAIN; | 478 | retval = -EAGAIN; |
466 | goto unlock_exit; | 479 | goto unlock_exit; |
@@ -468,6 +481,8 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, | |||
468 | retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done); | 481 | retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done); |
469 | if (retval < 0) | 482 | if (retval < 0) |
470 | goto unlock_exit; | 483 | goto unlock_exit; |
484 | } else { | ||
485 | spin_unlock_irq(&dev->rbsl); | ||
471 | } | 486 | } |
472 | 487 | ||
473 | /* actual_buffer contains actual_length + interrupt_in_buffer */ | 488 | /* actual_buffer contains actual_length + interrupt_in_buffer */ |
@@ -486,6 +501,17 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, | |||
486 | 501 | ||
487 | retval = bytes_to_read; | 502 | retval = bytes_to_read; |
488 | 503 | ||
504 | spin_lock_irq(&dev->rbsl); | ||
505 | if (dev->buffer_overflow) { | ||
506 | dev->buffer_overflow = 0; | ||
507 | spin_unlock_irq(&dev->rbsl); | ||
508 | rv = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL); | ||
509 | if (rv < 0) | ||
510 | dev->buffer_overflow = 1; | ||
511 | } else { | ||
512 | spin_unlock_irq(&dev->rbsl); | ||
513 | } | ||
514 | |||
489 | unlock_exit: | 515 | unlock_exit: |
490 | /* unlock the device */ | 516 | /* unlock the device */ |
491 | up(&dev->sem); | 517 | up(&dev->sem); |
@@ -635,6 +661,7 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id * | |||
635 | goto exit; | 661 | goto exit; |
636 | } | 662 | } |
637 | init_MUTEX(&dev->sem); | 663 | init_MUTEX(&dev->sem); |
664 | spin_lock_init(&dev->rbsl); | ||
638 | dev->intf = intf; | 665 | dev->intf = intf; |
639 | init_waitqueue_head(&dev->read_wait); | 666 | init_waitqueue_head(&dev->read_wait); |
640 | init_waitqueue_head(&dev->write_wait); | 667 | init_waitqueue_head(&dev->write_wait); |
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index ea2175bb2274..fe437125f14b 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
@@ -63,7 +63,8 @@ static inline void ARK3116_RCV(struct usb_serial *serial, int seq, | |||
63 | request, requesttype, value, index, | 63 | request, requesttype, value, index, |
64 | buf, 0x0000001, 1000); | 64 | buf, 0x0000001, 1000); |
65 | if (result) | 65 | if (result) |
66 | dbg("%03d < %d bytes [0x%02X]", seq, result, buf[0]); | 66 | dbg("%03d < %d bytes [0x%02X]", seq, result, |
67 | ((unsigned char *)buf)[0]); | ||
67 | else | 68 | else |
68 | dbg("%03d < 0 bytes", seq); | 69 | dbg("%03d < 0 bytes", seq); |
69 | } | 70 | } |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 95a1805b064f..2353679f601e 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -273,12 +273,18 @@ static __u16 product; | |||
273 | 273 | ||
274 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ | 274 | /* struct ftdi_sio_quirk is used by devices requiring special attention. */ |
275 | struct ftdi_sio_quirk { | 275 | struct ftdi_sio_quirk { |
276 | int (*probe)(struct usb_serial *); | ||
276 | void (*setup)(struct usb_serial *); /* Special settings during startup. */ | 277 | void (*setup)(struct usb_serial *); /* Special settings during startup. */ |
277 | }; | 278 | }; |
278 | 279 | ||
280 | static int ftdi_olimex_probe (struct usb_serial *serial); | ||
279 | static void ftdi_USB_UIRT_setup (struct usb_serial *serial); | 281 | static void ftdi_USB_UIRT_setup (struct usb_serial *serial); |
280 | static void ftdi_HE_TIRA1_setup (struct usb_serial *serial); | 282 | static void ftdi_HE_TIRA1_setup (struct usb_serial *serial); |
281 | 283 | ||
284 | static struct ftdi_sio_quirk ftdi_olimex_quirk = { | ||
285 | .probe = ftdi_olimex_probe, | ||
286 | }; | ||
287 | |||
282 | static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { | 288 | static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { |
283 | .setup = ftdi_USB_UIRT_setup, | 289 | .setup = ftdi_USB_UIRT_setup, |
284 | }; | 290 | }; |
@@ -319,6 +325,7 @@ static struct usb_device_id id_table_combined [] = { | |||
319 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, | 325 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, |
320 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, | 326 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, |
321 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, | 327 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, |
328 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, | ||
322 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, | 329 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, |
323 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, | 330 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, |
324 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, | 331 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, |
@@ -525,6 +532,9 @@ static struct usb_device_id id_table_combined [] = { | |||
525 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, | 532 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, |
526 | { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, | 533 | { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, |
527 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 534 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
535 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | ||
536 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), | ||
537 | .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk }, | ||
528 | { }, /* Optional parameter entry */ | 538 | { }, /* Optional parameter entry */ |
529 | { } /* Terminating entry */ | 539 | { } /* Terminating entry */ |
530 | }; | 540 | }; |
@@ -669,7 +679,7 @@ static struct usb_serial_driver ftdi_sio_device = { | |||
669 | 679 | ||
670 | /* | 680 | /* |
671 | * *************************************************************************** | 681 | * *************************************************************************** |
672 | * Utlity functions | 682 | * Utility functions |
673 | * *************************************************************************** | 683 | * *************************************************************************** |
674 | */ | 684 | */ |
675 | 685 | ||
@@ -1171,9 +1181,17 @@ static void remove_sysfs_attrs(struct usb_serial_port *port) | |||
1171 | /* Probe function to check for special devices */ | 1181 | /* Probe function to check for special devices */ |
1172 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id) | 1182 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id) |
1173 | { | 1183 | { |
1184 | struct ftdi_sio_quirk *quirk = (struct ftdi_sio_quirk *)id->driver_info; | ||
1185 | |||
1186 | if (quirk && quirk->probe) { | ||
1187 | int ret = quirk->probe(serial); | ||
1188 | if (ret != 0) | ||
1189 | return ret; | ||
1190 | } | ||
1191 | |||
1174 | usb_set_serial_data(serial, (void *)id->driver_info); | 1192 | usb_set_serial_data(serial, (void *)id->driver_info); |
1175 | 1193 | ||
1176 | return (0); | 1194 | return 0; |
1177 | } | 1195 | } |
1178 | 1196 | ||
1179 | static int ftdi_sio_port_probe(struct usb_serial_port *port) | 1197 | static int ftdi_sio_port_probe(struct usb_serial_port *port) |
@@ -1268,6 +1286,24 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial) | |||
1268 | priv->force_rtscts = 1; | 1286 | priv->force_rtscts = 1; |
1269 | } /* ftdi_HE_TIRA1_setup */ | 1287 | } /* ftdi_HE_TIRA1_setup */ |
1270 | 1288 | ||
1289 | /* | ||
1290 | * First port on Olimex arm-usb-ocd is reserved for JTAG interface | ||
1291 | * and can be accessed from userspace using openocd. | ||
1292 | */ | ||
1293 | static int ftdi_olimex_probe(struct usb_serial *serial) | ||
1294 | { | ||
1295 | struct usb_device *udev = serial->dev; | ||
1296 | struct usb_interface *interface = serial->interface; | ||
1297 | |||
1298 | dbg("%s",__FUNCTION__); | ||
1299 | |||
1300 | if (interface == udev->actconfig->interface[0]) { | ||
1301 | info("Ignoring reserved serial port on Olimex arm-usb-ocd\n"); | ||
1302 | return -ENODEV; | ||
1303 | } | ||
1304 | |||
1305 | return 0; | ||
1306 | } | ||
1271 | 1307 | ||
1272 | /* ftdi_shutdown is called from usbserial:usb_serial_disconnect | 1308 | /* ftdi_shutdown is called from usbserial:usb_serial_disconnect |
1273 | * it is called when the usb device is disconnected | 1309 | * it is called when the usb device is disconnected |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 77ad0a09b384..33aee9047242 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -60,6 +60,9 @@ | |||
60 | /* DMX4ALL DMX Interfaces */ | 60 | /* DMX4ALL DMX Interfaces */ |
61 | #define FTDI_DMX4ALL 0xC850 | 61 | #define FTDI_DMX4ALL 0xC850 |
62 | 62 | ||
63 | /* OpenDCC (www.opendcc.de) product id */ | ||
64 | #define FTDI_OPENDCC_PID 0xBFD8 | ||
65 | |||
63 | /* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ | 66 | /* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ |
64 | /* they use the ftdi chipset for the USB interface and the vendor id is the same */ | 67 | /* they use the ftdi chipset for the USB interface and the vendor id is the same */ |
65 | #define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ | 68 | #define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ |
@@ -518,6 +521,15 @@ | |||
518 | #define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */ | 521 | #define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */ |
519 | #define FTDI_IBS_PROD_PID 0xff3f /* future device */ | 522 | #define FTDI_IBS_PROD_PID 0xff3f /* future device */ |
520 | 523 | ||
524 | /* | ||
525 | * MaxStream devices www.maxstream.net | ||
526 | */ | ||
527 | #define FTDI_MAXSTREAM_PID 0xEE18 /* Xbee PKG-U Module */ | ||
528 | |||
529 | /* Olimex */ | ||
530 | #define OLIMEX_VID 0x15BA | ||
531 | #define OLIMEX_ARM_USB_OCD_PID 0x0003 | ||
532 | |||
521 | /* Commands */ | 533 | /* Commands */ |
522 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 534 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
523 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 535 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 2366e7b63ece..36620c651079 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -769,11 +769,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) | |||
769 | return; | 769 | return; |
770 | } | 770 | } |
771 | 771 | ||
772 | if (!mos7840_port) { | ||
773 | dbg("%s", "NULL mos7840_port pointer \n"); | ||
774 | return; | ||
775 | } | ||
776 | |||
777 | if (mos7840_port_paranoia_check(mos7840_port->port, __FUNCTION__)) { | 772 | if (mos7840_port_paranoia_check(mos7840_port->port, __FUNCTION__)) { |
778 | dbg("%s", "Port Paranoia failed \n"); | 773 | dbg("%s", "Port Paranoia failed \n"); |
779 | return; | 774 | return; |
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 4adfab988e86..00afc1712c39 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -165,12 +165,10 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) | |||
165 | { | 165 | { |
166 | struct usb_serial *serial = port->serial; | 166 | struct usb_serial *serial = port->serial; |
167 | struct usb_serial_port *wport; | 167 | struct usb_serial_port *wport; |
168 | struct omninet_data *od = usb_get_serial_port_data(port); | ||
169 | int result = 0; | 168 | int result = 0; |
170 | 169 | ||
171 | dbg("%s - port %d", __FUNCTION__, port->number); | 170 | dbg("%s - port %d", __FUNCTION__, port->number); |
172 | 171 | ||
173 | od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL ); | ||
174 | wport = serial->port[1]; | 172 | wport = serial->port[1]; |
175 | wport->tty = port->tty; | 173 | wport->tty = port->tty; |
176 | 174 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 8c3f55b080b4..89f067d95076 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -165,7 +165,6 @@ static struct usb_device_id option_ids[] = { | |||
165 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ | 165 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ |
166 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ | 166 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ |
167 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | 167 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ |
168 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */ | ||
169 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ | 168 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ |
170 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ | 169 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ |
171 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ | 170 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 644607de4c11..ac1829c6e8f0 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -35,6 +35,7 @@ static struct usb_device_id id_table [] = { | |||
35 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ | 35 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ |
36 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ | 36 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ |
37 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ | 37 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ |
38 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */ | ||
38 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 39 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
39 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ | 40 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ |
40 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ | 41 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ |
@@ -60,6 +61,7 @@ static struct usb_device_id id_table_3port [] = { | |||
60 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ | 61 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ |
61 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ | 62 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ |
62 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ | 63 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ |
64 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */ | ||
63 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 65 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
64 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ | 66 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ |
65 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ | 67 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ |
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 6d3dad3d1dae..d35369392fed 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c | |||
@@ -84,7 +84,7 @@ resubmit: | |||
84 | 84 | ||
85 | static int usb_onetouch_open(struct input_dev *dev) | 85 | static int usb_onetouch_open(struct input_dev *dev) |
86 | { | 86 | { |
87 | struct usb_onetouch *onetouch = dev->private; | 87 | struct usb_onetouch *onetouch = input_get_drvdata(dev); |
88 | 88 | ||
89 | onetouch->is_open = 1; | 89 | onetouch->is_open = 1; |
90 | onetouch->irq->dev = onetouch->udev; | 90 | onetouch->irq->dev = onetouch->udev; |
@@ -98,7 +98,7 @@ static int usb_onetouch_open(struct input_dev *dev) | |||
98 | 98 | ||
99 | static void usb_onetouch_close(struct input_dev *dev) | 99 | static void usb_onetouch_close(struct input_dev *dev) |
100 | { | 100 | { |
101 | struct usb_onetouch *onetouch = dev->private; | 101 | struct usb_onetouch *onetouch = input_get_drvdata(dev); |
102 | 102 | ||
103 | usb_kill_urb(onetouch->irq); | 103 | usb_kill_urb(onetouch->irq); |
104 | onetouch->is_open = 0; | 104 | onetouch->is_open = 0; |
@@ -185,13 +185,14 @@ int onetouch_connect_input(struct us_data *ss) | |||
185 | input_dev->name = onetouch->name; | 185 | input_dev->name = onetouch->name; |
186 | input_dev->phys = onetouch->phys; | 186 | input_dev->phys = onetouch->phys; |
187 | usb_to_input_id(udev, &input_dev->id); | 187 | usb_to_input_id(udev, &input_dev->id); |
188 | input_dev->cdev.dev = &udev->dev; | 188 | input_dev->dev.parent = &udev->dev; |
189 | 189 | ||
190 | set_bit(EV_KEY, input_dev->evbit); | 190 | set_bit(EV_KEY, input_dev->evbit); |
191 | set_bit(ONETOUCH_BUTTON, input_dev->keybit); | 191 | set_bit(ONETOUCH_BUTTON, input_dev->keybit); |
192 | clear_bit(0, input_dev->keybit); | 192 | clear_bit(0, input_dev->keybit); |
193 | 193 | ||
194 | input_dev->private = onetouch; | 194 | input_set_drvdata(input_dev, onetouch); |
195 | |||
195 | input_dev->open = usb_onetouch_open; | 196 | input_dev->open = usb_onetouch_open; |
196 | input_dev->close = usb_onetouch_close; | 197 | input_dev->close = usb_onetouch_close; |
197 | 198 | ||
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 8b3145ab7757..d230ee72f9cd 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1179,14 +1179,20 @@ 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 | /* This is a virtual windows driver CD, which the zd1211rw driver automatically | 1182 | /* These are virtual windows driver CDs, which the zd1211rw driver automatically |
1183 | * converts into a WLAN device. */ | 1183 | * converts into a WLAN devices. */ |
1184 | UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, | 1184 | UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, |
1185 | "ZyXEL", | 1185 | "ZyXEL", |
1186 | "G-220F USB-WLAN Install", | 1186 | "G-220F USB-WLAN Install", |
1187 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1187 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1188 | US_FL_IGNORE_DEVICE ), | 1188 | US_FL_IGNORE_DEVICE ), |
1189 | 1189 | ||
1190 | UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0101, | ||
1191 | "SiteCom", | ||
1192 | "WL-117 USB-WLAN Install", | ||
1193 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1194 | US_FL_IGNORE_DEVICE ), | ||
1195 | |||
1190 | #ifdef CONFIG_USB_STORAGE_ISD200 | 1196 | #ifdef CONFIG_USB_STORAGE_ISD200 |
1191 | UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, | 1197 | UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, |
1192 | "ATI", | 1198 | "ATI", |