aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-10 00:57:46 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-10 00:57:46 -0500
commit2695cf412f07f394587e7901cb3b4e9b66d25051 (patch)
tree603855ce8c359c3bcd979f4038c80058ddfc9cdd
parent63e34ca93a62f472144db60fa3b81111c0d15721 (diff)
parentee17b289732e04fdcdd8ce2ce19b18d3e8b08e20 (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: (23 commits) USB Elan FTDI: check for workqueue creation USB: fix spinlock recursion in cdc-acm.c USB: fix Unaligned access in EHCI driver USB: Product ID for FT232RL in ftdi_sio USBNET: DM9501: Add Corega FEther USB-TXC support. USB: ipaq.c: Additional devices USB: further fix for usb-serial USB: fix usb-serial device naming bug USB: RTS/DTR signal patch for airprime driver USB: ftdi_sio: use port_probe / port_remove thereby fixing access to the latency_timer usb-serial: fix shutdown / device_unregister order USB: add Additional PIDs in ftdi_sio USB: add QL355P power supply ids to fdti_sio USB: New device IDs for cp2101 driver USB: kill dead code from hub.c USB: ratelimit debounce error messages USB: pxa2xx_udc: fix hardcoded irq number UHCI: fix port resume problem USB: set the correct interval for interrupt URBs USB: goku_udc: Remove crude cache coherency code ...
-rw-r--r--drivers/usb/class/cdc-acm.c8
-rw-r--r--drivers/usb/core/devio.c13
-rw-r--r--drivers/usb/core/hub.c9
-rw-r--r--drivers/usb/core/message.c9
-rw-r--r--drivers/usb/gadget/at91_udc.c6
-rw-r--r--drivers/usb/gadget/goku_udc.c29
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c2
-rw-r--r--drivers/usb/host/ehci-hub.c3
-rw-r--r--drivers/usb/host/uhci-hub.c11
-rw-r--r--drivers/usb/misc/ftdi-elan.c18
-rw-r--r--drivers/usb/net/dm9601.c4
-rw-r--r--drivers/usb/serial/airprime.c47
-rw-r--r--drivers/usb/serial/cp2101.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c90
-rw-r--r--drivers/usb/serial/ftdi_sio.h21
-rw-r--r--drivers/usb/serial/ipaq.c2
-rw-r--r--drivers/usb/serial/usb-serial.c22
-rw-r--r--drivers/usb/storage/unusual_devs.h17
18 files changed, 186 insertions, 127 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index d38a25f36ea5..31ae661e586a 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -332,9 +332,9 @@ static void acm_rx_tasklet(unsigned long _acm)
332 if (!ACM_READY(acm)) 332 if (!ACM_READY(acm))
333 return; 333 return;
334 334
335 spin_lock(&acm->throttle_lock); 335 spin_lock_irqsave(&acm->throttle_lock, flags);
336 throttled = acm->throttle; 336 throttled = acm->throttle;
337 spin_unlock(&acm->throttle_lock); 337 spin_unlock_irqrestore(&acm->throttle_lock, flags);
338 if (throttled) 338 if (throttled)
339 return; 339 return;
340 340
@@ -352,9 +352,9 @@ next_buffer:
352 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); 352 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
353 353
354 tty_buffer_request_room(tty, buf->size); 354 tty_buffer_request_room(tty, buf->size);
355 spin_lock(&acm->throttle_lock); 355 spin_lock_irqsave(&acm->throttle_lock, flags);
356 throttled = acm->throttle; 356 throttled = acm->throttle;
357 spin_unlock(&acm->throttle_lock); 357 spin_unlock_irqrestore(&acm->throttle_lock, flags);
358 if (!throttled) 358 if (!throttled)
359 tty_insert_flip_string(tty, buf->base, buf->size); 359 tty_insert_flip_string(tty, buf->base, buf->size);
360 tty_flip_buffer_push(tty); 360 tty_flip_buffer_push(tty);
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 274f14f1633e..36e7a843bf91 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -912,7 +912,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
912 struct async *as; 912 struct async *as;
913 struct usb_ctrlrequest *dr = NULL; 913 struct usb_ctrlrequest *dr = NULL;
914 unsigned int u, totlen, isofrmlen; 914 unsigned int u, totlen, isofrmlen;
915 int ret, interval = 0, ifnum = -1; 915 int ret, ifnum = -1;
916 916
917 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK| 917 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK|
918 URB_NO_FSBR|URB_ZERO_PACKET)) 918 URB_NO_FSBR|URB_ZERO_PACKET))
@@ -992,7 +992,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
992 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 992 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
993 != USB_ENDPOINT_XFER_ISOC) 993 != USB_ENDPOINT_XFER_ISOC)
994 return -EINVAL; 994 return -EINVAL;
995 interval = 1 << min (15, ep->desc.bInterval - 1);
996 isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets; 995 isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets;
997 if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL))) 996 if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL)))
998 return -ENOMEM; 997 return -ENOMEM;
@@ -1021,10 +1020,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1021 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 1020 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
1022 != USB_ENDPOINT_XFER_INT) 1021 != USB_ENDPOINT_XFER_INT)
1023 return -EINVAL; 1022 return -EINVAL;
1024 if (ps->dev->speed == USB_SPEED_HIGH)
1025 interval = 1 << min (15, ep->desc.bInterval - 1);
1026 else
1027 interval = ep->desc.bInterval;
1028 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1023 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1029 return -EINVAL; 1024 return -EINVAL;
1030 if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length)) 1025 if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length))
@@ -1053,7 +1048,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1053 as->urb->setup_packet = (unsigned char*)dr; 1048 as->urb->setup_packet = (unsigned char*)dr;
1054 as->urb->start_frame = uurb->start_frame; 1049 as->urb->start_frame = uurb->start_frame;
1055 as->urb->number_of_packets = uurb->number_of_packets; 1050 as->urb->number_of_packets = uurb->number_of_packets;
1056 as->urb->interval = interval; 1051 if (uurb->type == USBDEVFS_URB_TYPE_ISO ||
1052 ps->dev->speed == USB_SPEED_HIGH)
1053 as->urb->interval = 1 << min(15, ep->desc.bInterval - 1);
1054 else
1055 as->urb->interval = ep->desc.bInterval;
1057 as->urb->context = as; 1056 as->urb->context = as;
1058 as->urb->complete = async_completed; 1057 as->urb->complete = async_completed;
1059 for (totlen = u = 0; u < uurb->number_of_packets; u++) { 1058 for (totlen = u = 0; u < uurb->number_of_packets; u++) {
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 41400743ce2c..b89a98e61323 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1281,12 +1281,6 @@ int usb_new_device(struct usb_device *udev)
1281{ 1281{
1282 int err; 1282 int err;
1283 1283
1284 /* Lock ourself into memory in order to keep a probe sequence
1285 * sleeping in a new thread from allowing us to be unloaded.
1286 */
1287 if (!try_module_get(THIS_MODULE))
1288 return -EINVAL;
1289
1290 /* Determine quirks */ 1284 /* Determine quirks */
1291 usb_detect_quirks(udev); 1285 usb_detect_quirks(udev);
1292 1286
@@ -1390,7 +1384,6 @@ int usb_new_device(struct usb_device *udev)
1390 usb_autoresume_device(udev->parent); 1384 usb_autoresume_device(udev->parent);
1391 1385
1392exit: 1386exit:
1393 module_put(THIS_MODULE);
1394 return err; 1387 return err;
1395 1388
1396fail: 1389fail:
@@ -2443,7 +2436,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
2443 2436
2444 if (portchange & USB_PORT_STAT_C_CONNECTION) { 2437 if (portchange & USB_PORT_STAT_C_CONNECTION) {
2445 status = hub_port_debounce(hub, port1); 2438 status = hub_port_debounce(hub, port1);
2446 if (status < 0) { 2439 if (status < 0 && printk_ratelimit()) {
2447 dev_err (hub_dev, 2440 dev_err (hub_dev,
2448 "connect-debounce failed, port %d disabled\n", 2441 "connect-debounce failed, port %d disabled\n",
2449 port1); 2442 port1);
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 2f17468b5c1e..217a3d6d0a06 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -221,10 +221,15 @@ 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;
224 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); 230 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30);
225 usb_fill_int_urb(urb, usb_dev, pipe, data, len, 231 usb_fill_int_urb(urb, usb_dev, pipe, data, len,
226 usb_api_blocking_completion, NULL, 232 usb_api_blocking_completion, NULL, interval);
227 ep->desc.bInterval);
228 } else 233 } else
229 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, 234 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len,
230 usb_api_blocking_completion, NULL); 235 usb_api_blocking_completion, NULL);
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index a4677802fb20..2a6e3163d944 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1835,7 +1835,7 @@ static int at91udc_resume(struct platform_device *pdev)
1835#define at91udc_resume NULL 1835#define at91udc_resume NULL
1836#endif 1836#endif
1837 1837
1838static struct platform_driver at91_udc = { 1838static struct platform_driver at91_udc_driver = {
1839 .remove = __exit_p(at91udc_remove), 1839 .remove = __exit_p(at91udc_remove),
1840 .shutdown = at91udc_shutdown, 1840 .shutdown = at91udc_shutdown,
1841 .suspend = at91udc_suspend, 1841 .suspend = at91udc_suspend,
@@ -1848,13 +1848,13 @@ static struct platform_driver at91_udc = {
1848 1848
1849static int __init udc_init_module(void) 1849static int __init udc_init_module(void)
1850{ 1850{
1851 return platform_driver_probe(&at91_udc, at91udc_probe); 1851 return platform_driver_probe(&at91_udc_driver, at91udc_probe);
1852} 1852}
1853module_init(udc_init_module); 1853module_init(udc_init_module);
1854 1854
1855static void __exit udc_exit_module(void) 1855static void __exit udc_exit_module(void)
1856{ 1856{
1857 platform_driver_unregister(&at91_udc); 1857 platform_driver_unregister(&at91_udc_driver);
1858} 1858}
1859module_exit(udc_exit_module); 1859module_exit(udc_exit_module);
1860 1860
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 7b3a326b57ab..65c91d3735de 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -297,27 +297,6 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
297 297
298/*-------------------------------------------------------------------------*/ 298/*-------------------------------------------------------------------------*/
299 299
300#undef USE_KMALLOC
301
302/* many common platforms have dma-coherent caches, which means that it's
303 * safe to use kmalloc() memory for all i/o buffers without using any
304 * cache flushing calls. (unless you're trying to share cache lines
305 * between dma and non-dma activities, which is a slow idea in any case.)
306 *
307 * other platforms need more care, with 2.6 having a moderately general
308 * solution except for the common "buffer is smaller than a page" case.
309 */
310#if defined(CONFIG_X86)
311#define USE_KMALLOC
312
313#elif defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT)
314#define USE_KMALLOC
315
316#elif defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
317#define USE_KMALLOC
318
319#endif
320
321/* allocating buffers this way eliminates dma mapping overhead, which 300/* allocating buffers this way eliminates dma mapping overhead, which
322 * on some platforms will mean eliminating a per-io buffer copy. with 301 * on some platforms will mean eliminating a per-io buffer copy. with
323 * some kinds of system caches, further tweaks may still be needed. 302 * some kinds of system caches, further tweaks may still be needed.
@@ -334,11 +313,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
334 return NULL; 313 return NULL;
335 *dma = DMA_ADDR_INVALID; 314 *dma = DMA_ADDR_INVALID;
336 315
337#if defined(USE_KMALLOC)
338 retval = kmalloc(bytes, gfp_flags);
339 if (retval)
340 *dma = virt_to_phys(retval);
341#else
342 if (ep->dma) { 316 if (ep->dma) {
343 /* the main problem with this call is that it wastes memory 317 /* the main problem with this call is that it wastes memory
344 * on typical 1/N page allocations: it allocates 1-N pages. 318 * on typical 1/N page allocations: it allocates 1-N pages.
@@ -348,7 +322,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
348 bytes, dma, gfp_flags); 322 bytes, dma, gfp_flags);
349 } else 323 } else
350 retval = kmalloc(bytes, gfp_flags); 324 retval = kmalloc(bytes, gfp_flags);
351#endif
352 return retval; 325 return retval;
353} 326}
354 327
@@ -356,7 +329,6 @@ static void
356goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) 329goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
357{ 330{
358 /* free memory into the right allocator */ 331 /* free memory into the right allocator */
359#ifndef USE_KMALLOC
360 if (dma != DMA_ADDR_INVALID) { 332 if (dma != DMA_ADDR_INVALID) {
361 struct goku_ep *ep; 333 struct goku_ep *ep;
362 334
@@ -365,7 +337,6 @@ goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
365 return; 337 return;
366 dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); 338 dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma);
367 } else 339 } else
368#endif
369 kfree (buf); 340 kfree (buf);
370} 341}
371 342
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index f01890dc8751..571f3ebb70ab 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -2616,7 +2616,7 @@ lubbock_fail0:
2616 if (retval != 0) { 2616 if (retval != 0) {
2617 printk(KERN_ERR "%s: can't get irq %i, err %d\n", 2617 printk(KERN_ERR "%s: can't get irq %i, err %d\n",
2618 driver_name, vbus_irq, retval); 2618 driver_name, vbus_irq, retval);
2619 free_irq(IRQ_USB, dev); 2619 free_irq(irq, dev);
2620 return -EBUSY; 2620 return -EBUSY;
2621 } 2621 }
2622 } 2622 }
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 9af529d22b3e..1813b7cac294 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -653,8 +653,7 @@ static int ehci_hub_control (
653 if (status & ~0xffff) /* only if wPortChange is interesting */ 653 if (status & ~0xffff) /* only if wPortChange is interesting */
654#endif 654#endif
655 dbg_port (ehci, "GetStatus", wIndex + 1, temp); 655 dbg_port (ehci, "GetStatus", wIndex + 1, temp);
656 // we "know" this alignment is good, caller used kmalloc()... 656 put_unaligned(cpu_to_le32 (status), (__le32 *) buf);
657 *((__le32 *) buf) = cpu_to_le32 (status);
658 break; 657 break;
659 case SetHubFeature: 658 case SetHubFeature:
660 switch (wValue) { 659 switch (wValue) {
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index bacc25c53ba3..8e4427aebb14 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -33,6 +33,9 @@ static __u8 root_hub_hub_des[] =
33/* status change bits: nonzero writes will clear */ 33/* status change bits: nonzero writes will clear */
34#define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) 34#define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC)
35 35
36/* suspend/resume bits: port suspended or port resuming */
37#define SUSPEND_BITS (USBPORTSC_SUSP | USBPORTSC_RD)
38
36/* A port that either is connected or has a changed-bit set will prevent 39/* A port that either is connected or has a changed-bit set will prevent
37 * us from AUTO_STOPPING. 40 * us from AUTO_STOPPING.
38 */ 41 */
@@ -96,8 +99,8 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
96 int status; 99 int status;
97 int i; 100 int i;
98 101
99 if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) { 102 if (inw(port_addr) & SUSPEND_BITS) {
100 CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); 103 CLR_RH_PORTSTAT(SUSPEND_BITS);
101 if (test_bit(port, &uhci->resuming_ports)) 104 if (test_bit(port, &uhci->resuming_ports))
102 set_bit(port, &uhci->port_c_suspend); 105 set_bit(port, &uhci->port_c_suspend);
103 106
@@ -107,7 +110,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
107 * Experiments show that some controllers take longer, so 110 * Experiments show that some controllers take longer, so
108 * we'll poll for completion. */ 111 * we'll poll for completion. */
109 for (i = 0; i < 10; ++i) { 112 for (i = 0; i < 10; ++i) {
110 if (!(inw(port_addr) & USBPORTSC_RD)) 113 if (!(inw(port_addr) & SUSPEND_BITS))
111 break; 114 break;
112 udelay(1); 115 udelay(1);
113 } 116 }
@@ -289,7 +292,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
289 wPortStatus |= USB_PORT_STAT_CONNECTION; 292 wPortStatus |= USB_PORT_STAT_CONNECTION;
290 if (status & USBPORTSC_PE) { 293 if (status & USBPORTSC_PE) {
291 wPortStatus |= USB_PORT_STAT_ENABLE; 294 wPortStatus |= USB_PORT_STAT_ENABLE;
292 if (status & (USBPORTSC_SUSP | USBPORTSC_RD)) 295 if (status & SUSPEND_BITS)
293 wPortStatus |= USB_PORT_STAT_SUSPEND; 296 wPortStatus |= USB_PORT_STAT_SUSPEND;
294 } 297 }
295 if (status & USBPORTSC_OC) 298 if (status & USBPORTSC_OC)
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 0c1d66ddb812..bc3327e3dd78 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -2905,17 +2905,31 @@ static int __init ftdi_elan_init(void)
2905{ 2905{
2906 int result; 2906 int result;
2907 printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name, 2907 printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name,
2908 __TIME__, __DATE__); 2908 __TIME__, __DATE__);
2909 init_MUTEX(&ftdi_module_lock); 2909 init_MUTEX(&ftdi_module_lock);
2910 INIT_LIST_HEAD(&ftdi_static_list); 2910 INIT_LIST_HEAD(&ftdi_static_list);
2911 status_queue = create_singlethread_workqueue("ftdi-status-control"); 2911 status_queue = create_singlethread_workqueue("ftdi-status-control");
2912 if (!status_queue)
2913 goto err1;
2912 command_queue = create_singlethread_workqueue("ftdi-command-engine"); 2914 command_queue = create_singlethread_workqueue("ftdi-command-engine");
2915 if (!command_queue)
2916 goto err2;
2913 respond_queue = create_singlethread_workqueue("ftdi-respond-engine"); 2917 respond_queue = create_singlethread_workqueue("ftdi-respond-engine");
2918 if (!respond_queue)
2919 goto err3;
2914 result = usb_register(&ftdi_elan_driver); 2920 result = usb_register(&ftdi_elan_driver);
2915 if (result) 2921 if (result)
2916 printk(KERN_ERR "usb_register failed. Error number %d\n", 2922 printk(KERN_ERR "usb_register failed. Error number %d\n",
2917 result); 2923 result);
2918 return result; 2924 return result;
2925
2926 err3:
2927 destroy_workqueue(command_queue);
2928 err2:
2929 destroy_workqueue(status_queue);
2930 err1:
2931 printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name);
2932 return -ENOMEM;
2919} 2933}
2920 2934
2921static void __exit ftdi_elan_exit(void) 2935static void __exit ftdi_elan_exit(void)
diff --git a/drivers/usb/net/dm9601.c b/drivers/usb/net/dm9601.c
index 4a932e1cd93b..c0bc52be5e10 100644
--- a/drivers/usb/net/dm9601.c
+++ b/drivers/usb/net/dm9601.c
@@ -571,6 +571,10 @@ static const struct driver_info dm9601_info = {
571 571
572static const struct usb_device_id products[] = { 572static const struct usb_device_id products[] = {
573 { 573 {
574 USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
575 .driver_info = (unsigned long)&dm9601_info,
576 },
577 {
574 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ 578 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
575 .driver_info = (unsigned long)&dm9601_info, 579 .driver_info = (unsigned long)&dm9601_info,
576 }, 580 },
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 18816bf96a4d..310a8b5f5906 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -44,8 +44,43 @@ struct airprime_private {
44 int outstanding_urbs; 44 int outstanding_urbs;
45 int throttled; 45 int throttled;
46 struct urb *read_urbp[NUM_READ_URBS]; 46 struct urb *read_urbp[NUM_READ_URBS];
47
48 /* Settings for the port */
49 int rts_state; /* Handshaking pins (outputs) */
50 int dtr_state;
51 int cts_state; /* Handshaking pins (inputs) */
52 int dsr_state;
53 int dcd_state;
54 int ri_state;
47}; 55};
48 56
57static int airprime_send_setup(struct usb_serial_port *port)
58{
59 struct usb_serial *serial = port->serial;
60 struct airprime_private *priv;
61
62 dbg("%s", __FUNCTION__);
63
64 if (port->number != 0)
65 return 0;
66
67 priv = usb_get_serial_port_data(port);
68
69 if (port->tty) {
70 int val = 0;
71 if (priv->dtr_state)
72 val |= 0x01;
73 if (priv->rts_state)
74 val |= 0x02;
75
76 return usb_control_msg(serial->dev,
77 usb_rcvctrlpipe(serial->dev, 0),
78 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
79 }
80
81 return 0;
82}
83
49static void airprime_read_bulk_callback(struct urb *urb) 84static void airprime_read_bulk_callback(struct urb *urb)
50{ 85{
51 struct usb_serial_port *port = urb->context; 86 struct usb_serial_port *port = urb->context;
@@ -118,6 +153,10 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
118 usb_set_serial_port_data(port, priv); 153 usb_set_serial_port_data(port, priv);
119 } 154 }
120 155
156 /* Set some sane defaults */
157 priv->rts_state = 1;
158 priv->dtr_state = 1;
159
121 for (i = 0; i < NUM_READ_URBS; ++i) { 160 for (i = 0; i < NUM_READ_URBS; ++i) {
122 buffer = kmalloc(buffer_size, GFP_KERNEL); 161 buffer = kmalloc(buffer_size, GFP_KERNEL);
123 if (!buffer) { 162 if (!buffer) {
@@ -151,6 +190,9 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
151 /* remember this urb so we can kill it when the port is closed */ 190 /* remember this urb so we can kill it when the port is closed */
152 priv->read_urbp[i] = urb; 191 priv->read_urbp[i] = urb;
153 } 192 }
193
194 airprime_send_setup(port);
195
154 goto out; 196 goto out;
155 197
156 errout: 198 errout:
@@ -176,6 +218,11 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp)
176 218
177 dbg("%s - port %d", __FUNCTION__, port->number); 219 dbg("%s - port %d", __FUNCTION__, port->number);
178 220
221 priv->rts_state = 0;
222 priv->dtr_state = 0;
223
224 airprime_send_setup(port);
225
179 for (i = 0; i < NUM_READ_URBS; ++i) { 226 for (i = 0; i < NUM_READ_URBS; ++i) {
180 usb_kill_urb (priv->read_urbp[i]); 227 usb_kill_urb (priv->read_urbp[i]);
181 kfree (priv->read_urbp[i]->transfer_buffer); 228 kfree (priv->read_urbp[i]->transfer_buffer);
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index db623e754899..d7d0ba986a80 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -63,6 +63,8 @@ static struct usb_device_id id_table [] = {
63 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ 63 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
64 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ 64 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
65 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 65 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
66 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
67 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
66 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 68 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
67 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ 69 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
68 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ 70 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c525b42dadde..1633a0fd48e8 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -315,6 +315,7 @@ static struct usb_device_id id_table_combined [] = {
315 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 315 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
317 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 317 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
318 { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) },
318 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, 319 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
319 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 320 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
320 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 321 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
@@ -420,6 +421,14 @@ static struct usb_device_id id_table_combined [] = {
420 { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 421 { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) },
421 { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 422 { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) },
422 { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 423 { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) },
424 { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) },
425 { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) },
426 { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) },
427 { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) },
428 { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) },
429 { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) },
430 { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
431 { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
423 /* 432 /*
424 * These will probably use user-space drivers. Uncomment them if 433 * These will probably use user-space drivers. Uncomment them if
425 * you need them or use the user-specified vendor/product module 434 * you need them or use the user-specified vendor/product module
@@ -459,6 +468,7 @@ static struct usb_device_id id_table_combined [] = {
459 { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 468 { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) },
460 { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 469 { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) },
461 { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 470 { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) },
471 { USB_DEVICE(TTI_VID, TTI_QL355P_PID) },
462 { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 472 { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
463 { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 473 { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
464 { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 474 { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
@@ -533,6 +543,7 @@ static const char *ftdi_chip_name[] = {
533 [FT8U232AM] = "FT8U232AM", 543 [FT8U232AM] = "FT8U232AM",
534 [FT232BM] = "FT232BM", 544 [FT232BM] = "FT232BM",
535 [FT2232C] = "FT2232C", 545 [FT2232C] = "FT2232C",
546 [FT232RL] = "FT232RL",
536}; 547};
537 548
538 549
@@ -588,6 +599,8 @@ struct ftdi_private {
588static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); 599static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id);
589static int ftdi_sio_attach (struct usb_serial *serial); 600static int ftdi_sio_attach (struct usb_serial *serial);
590static void ftdi_shutdown (struct usb_serial *serial); 601static void ftdi_shutdown (struct usb_serial *serial);
602static int ftdi_sio_port_probe (struct usb_serial_port *port);
603static int ftdi_sio_port_remove (struct usb_serial_port *port);
591static int ftdi_open (struct usb_serial_port *port, struct file *filp); 604static int ftdi_open (struct usb_serial_port *port, struct file *filp);
592static void ftdi_close (struct usb_serial_port *port, struct file *filp); 605static void ftdi_close (struct usb_serial_port *port, struct file *filp);
593static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); 606static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count);
@@ -622,6 +635,8 @@ static struct usb_serial_driver ftdi_sio_device = {
622 .num_bulk_out = 1, 635 .num_bulk_out = 1,
623 .num_ports = 1, 636 .num_ports = 1,
624 .probe = ftdi_sio_probe, 637 .probe = ftdi_sio_probe,
638 .port_probe = ftdi_sio_port_probe,
639 .port_remove = ftdi_sio_port_remove,
625 .open = ftdi_open, 640 .open = ftdi_open,
626 .close = ftdi_close, 641 .close = ftdi_close,
627 .throttle = ftdi_throttle, 642 .throttle = ftdi_throttle,
@@ -1024,11 +1039,10 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a
1024{ 1039{
1025 struct usb_serial_port *port = to_usb_serial_port(dev); 1040 struct usb_serial_port *port = to_usb_serial_port(dev);
1026 struct ftdi_private *priv = usb_get_serial_port_data(port); 1041 struct ftdi_private *priv = usb_get_serial_port_data(port);
1027 struct usb_device *udev; 1042 struct usb_device *udev = port->serial->dev;
1028 unsigned short latency = 0; 1043 unsigned short latency = 0;
1029 int rv = 0; 1044 int rv = 0;
1030 1045
1031 udev = to_usb_device(dev);
1032 1046
1033 dbg("%s",__FUNCTION__); 1047 dbg("%s",__FUNCTION__);
1034 1048
@@ -1052,13 +1066,11 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute *
1052{ 1066{
1053 struct usb_serial_port *port = to_usb_serial_port(dev); 1067 struct usb_serial_port *port = to_usb_serial_port(dev);
1054 struct ftdi_private *priv = usb_get_serial_port_data(port); 1068 struct ftdi_private *priv = usb_get_serial_port_data(port);
1055 struct usb_device *udev; 1069 struct usb_device *udev = port->serial->dev;
1056 char buf[1]; 1070 char buf[1];
1057 int v = simple_strtoul(valbuf, NULL, 10); 1071 int v = simple_strtoul(valbuf, NULL, 10);
1058 int rv = 0; 1072 int rv = 0;
1059 1073
1060 udev = to_usb_device(dev);
1061
1062 dbg("%s: setting latency timer = %i", __FUNCTION__, v); 1074 dbg("%s: setting latency timer = %i", __FUNCTION__, v);
1063 1075
1064 rv = usb_control_msg(udev, 1076 rv = usb_control_msg(udev,
@@ -1083,13 +1095,11 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
1083{ 1095{
1084 struct usb_serial_port *port = to_usb_serial_port(dev); 1096 struct usb_serial_port *port = to_usb_serial_port(dev);
1085 struct ftdi_private *priv = usb_get_serial_port_data(port); 1097 struct ftdi_private *priv = usb_get_serial_port_data(port);
1086 struct usb_device *udev; 1098 struct usb_device *udev = port->serial->dev;
1087 char buf[1]; 1099 char buf[1];
1088 int v = simple_strtoul(valbuf, NULL, 10); 1100 int v = simple_strtoul(valbuf, NULL, 10);
1089 int rv = 0; 1101 int rv = 0;
1090 1102
1091 udev = to_usb_device(dev);
1092
1093 dbg("%s: setting event char = %i", __FUNCTION__, v); 1103 dbg("%s: setting event char = %i", __FUNCTION__, v);
1094 1104
1095 rv = usb_control_msg(udev, 1105 rv = usb_control_msg(udev,
@@ -1110,46 +1120,38 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
1110static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); 1120static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer);
1111static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 1121static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char);
1112 1122
1113static int create_sysfs_attrs(struct usb_serial *serial) 1123static int create_sysfs_attrs(struct usb_serial_port *port)
1114{ 1124{
1115 struct ftdi_private *priv; 1125 struct ftdi_private *priv = usb_get_serial_port_data(port);
1116 struct usb_device *udev;
1117 int retval = 0; 1126 int retval = 0;
1118 1127
1119 dbg("%s",__FUNCTION__); 1128 dbg("%s",__FUNCTION__);
1120 1129
1121 priv = usb_get_serial_port_data(serial->port[0]);
1122 udev = serial->dev;
1123
1124 /* XXX I've no idea if the original SIO supports the event_char 1130 /* XXX I've no idea if the original SIO supports the event_char
1125 * sysfs parameter, so I'm playing it safe. */ 1131 * sysfs parameter, so I'm playing it safe. */
1126 if (priv->chip_type != SIO) { 1132 if (priv->chip_type != SIO) {
1127 dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); 1133 dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]);
1128 retval = device_create_file(&udev->dev, &dev_attr_event_char); 1134 retval = device_create_file(&port->dev, &dev_attr_event_char);
1129 if ((!retval) && 1135 if ((!retval) &&
1130 (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { 1136 (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) {
1131 retval = device_create_file(&udev->dev, 1137 retval = device_create_file(&port->dev,
1132 &dev_attr_latency_timer); 1138 &dev_attr_latency_timer);
1133 } 1139 }
1134 } 1140 }
1135 return retval; 1141 return retval;
1136} 1142}
1137 1143
1138static void remove_sysfs_attrs(struct usb_serial *serial) 1144static void remove_sysfs_attrs(struct usb_serial_port *port)
1139{ 1145{
1140 struct ftdi_private *priv; 1146 struct ftdi_private *priv = usb_get_serial_port_data(port);
1141 struct usb_device *udev;
1142 1147
1143 dbg("%s",__FUNCTION__); 1148 dbg("%s",__FUNCTION__);
1144 1149
1145 priv = usb_get_serial_port_data(serial->port[0]);
1146 udev = serial->dev;
1147
1148 /* XXX see create_sysfs_attrs */ 1150 /* XXX see create_sysfs_attrs */
1149 if (priv->chip_type != SIO) { 1151 if (priv->chip_type != SIO) {
1150 device_remove_file(&udev->dev, &dev_attr_event_char); 1152 device_remove_file(&port->dev, &dev_attr_event_char);
1151 if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { 1153 if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) {
1152 device_remove_file(&udev->dev, &dev_attr_latency_timer); 1154 device_remove_file(&port->dev, &dev_attr_latency_timer);
1153 } 1155 }
1154 } 1156 }
1155 1157
@@ -1169,13 +1171,9 @@ static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id
1169 return (0); 1171 return (0);
1170} 1172}
1171 1173
1172/* attach subroutine */ 1174static int ftdi_sio_port_probe(struct usb_serial_port *port)
1173static int ftdi_sio_attach (struct usb_serial *serial)
1174{ 1175{
1175 struct usb_serial_port *port = serial->port[0];
1176 struct ftdi_private *priv; 1176 struct ftdi_private *priv;
1177 struct ftdi_sio_quirk *quirk;
1178 int retval;
1179 1177
1180 dbg("%s",__FUNCTION__); 1178 dbg("%s",__FUNCTION__);
1181 1179
@@ -1215,19 +1213,21 @@ static int ftdi_sio_attach (struct usb_serial *serial)
1215 kfree(port->bulk_out_buffer); 1213 kfree(port->bulk_out_buffer);
1216 port->bulk_out_buffer = NULL; 1214 port->bulk_out_buffer = NULL;
1217 1215
1218 usb_set_serial_port_data(serial->port[0], priv); 1216 usb_set_serial_port_data(port, priv);
1219 1217
1220 ftdi_determine_type (serial->port[0]); 1218 ftdi_determine_type (port);
1221 retval = create_sysfs_attrs(serial); 1219 create_sysfs_attrs(port);
1222 if (retval) 1220 return 0;
1223 dev_err(&serial->dev->dev, "Error creating sysfs files, " 1221}
1224 "continuing\n");
1225 1222
1223/* attach subroutine */
1224static int ftdi_sio_attach (struct usb_serial *serial)
1225{
1226 /* Check for device requiring special set up. */ 1226 /* Check for device requiring special set up. */
1227 quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); 1227 struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial);
1228 if (quirk && quirk->setup) { 1228
1229 if (quirk && quirk->setup)
1229 quirk->setup(serial); 1230 quirk->setup(serial);
1230 }
1231 1231
1232 return 0; 1232 return 0;
1233} /* ftdi_sio_attach */ 1233} /* ftdi_sio_attach */
@@ -1271,17 +1271,18 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
1271 * calls __serial_close for each open of the port 1271 * calls __serial_close for each open of the port
1272 * shutdown is called then (ie ftdi_shutdown) 1272 * shutdown is called then (ie ftdi_shutdown)
1273 */ 1273 */
1274
1275
1276static void ftdi_shutdown (struct usb_serial *serial) 1274static void ftdi_shutdown (struct usb_serial *serial)
1277{ /* ftdi_shutdown */ 1275{
1276 dbg("%s", __FUNCTION__);
1277}
1278 1278
1279 struct usb_serial_port *port = serial->port[0]; 1279static int ftdi_sio_port_remove(struct usb_serial_port *port)
1280{
1280 struct ftdi_private *priv = usb_get_serial_port_data(port); 1281 struct ftdi_private *priv = usb_get_serial_port_data(port);
1281 1282
1282 dbg("%s", __FUNCTION__); 1283 dbg("%s", __FUNCTION__);
1283 1284
1284 remove_sysfs_attrs(serial); 1285 remove_sysfs_attrs(port);
1285 1286
1286 /* all open ports are closed at this point 1287 /* all open ports are closed at this point
1287 * (by usbserial.c:__serial_close, which calls ftdi_close) 1288 * (by usbserial.c:__serial_close, which calls ftdi_close)
@@ -1291,8 +1292,9 @@ static void ftdi_shutdown (struct usb_serial *serial)
1291 usb_set_serial_port_data(port, NULL); 1292 usb_set_serial_port_data(port, NULL);
1292 kfree(priv); 1293 kfree(priv);
1293 } 1294 }
1294} /* ftdi_shutdown */
1295 1295
1296 return 0;
1297}
1296 1298
1297static int ftdi_open (struct usb_serial_port *port, struct file *filp) 1299static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1298{ /* ftdi_open */ 1300{ /* ftdi_open */
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 1bdda935f7d9..513cfe1b768b 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -27,6 +27,7 @@
27#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ 27#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
28#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ 28#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
29#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ 29#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
30#define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */
30#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ 31#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */
31#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ 32#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */
32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */ 33#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
@@ -339,6 +340,12 @@
339#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ 340#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */
340 341
341/* 342/*
343 * TTi (Thurlby Thandar Instruments)
344 */
345#define TTI_VID 0x103E /* Vendor Id */
346#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
347
348/*
342 * Definitions for B&B Electronics products. 349 * Definitions for B&B Electronics products.
343 */ 350 */
344#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ 351#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */
@@ -497,6 +504,19 @@
497#define TELLDUS_VID 0x1781 /* Vendor ID */ 504#define TELLDUS_VID 0x1781 /* Vendor ID */
498#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ 505#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */
499 506
507/*
508 * IBS elektronik product ids
509 * Submitted by Thomas Schleusener
510 */
511#define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */
512#define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */
513#define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */
514#define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */
515#define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */
516#define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */
517#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */
518#define FTDI_IBS_PROD_PID 0xff3f /* future device */
519
500/* Commands */ 520/* Commands */
501#define FTDI_SIO_RESET 0 /* Reset the port */ 521#define FTDI_SIO_RESET 0 /* Reset the port */
502#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 522#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
@@ -620,6 +640,7 @@ typedef enum {
620 FT8U232AM = 2, 640 FT8U232AM = 2,
621 FT232BM = 3, 641 FT232BM = 3,
622 FT2232C = 4, 642 FT2232C = 4,
643 FT232RL = 5,
623} ftdi_chip_type_t; 644} ftdi_chip_type_t;
624 645
625typedef enum { 646typedef enum {
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index a408184334ea..d16e2e1764ad 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -247,6 +247,8 @@ static struct usb_device_id ipaq_id_table [] = {
247 { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ 247 { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */
248 { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ 248 { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */
249 { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ 249 { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */
250 { USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */
251 { USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */
250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 252 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 253 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 254 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 6bf22a28adb8..8511352251f3 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po
99 continue; 99 continue;
100 100
101 *minor = i; 101 *minor = i;
102 j = 0;
102 dbg("%s - minor base = %d", __FUNCTION__, *minor); 103 dbg("%s - minor base = %d", __FUNCTION__, *minor);
103 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) 104 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) {
104 serial_table[i] = serial; 105 serial_table[i] = serial;
106 serial->port[j++]->number = i;
107 }
105 spin_unlock(&table_lock); 108 spin_unlock(&table_lock);
106 return serial; 109 return serial;
107 } 110 }
@@ -135,11 +138,6 @@ static void destroy_serial(struct kref *kref)
135 138
136 dbg("%s - %s", __FUNCTION__, serial->type->description); 139 dbg("%s - %s", __FUNCTION__, serial->type->description);
137 140
138 serial->type->shutdown(serial);
139
140 /* return the minor range that this device had */
141 return_serial(serial);
142
143 for (i = 0; i < serial->num_ports; ++i) 141 for (i = 0; i < serial->num_ports; ++i)
144 serial->port[i]->open_count = 0; 142 serial->port[i]->open_count = 0;
145 143
@@ -150,6 +148,12 @@ static void destroy_serial(struct kref *kref)
150 serial->port[i] = NULL; 148 serial->port[i] = NULL;
151 } 149 }
152 150
151 if (serial->type->shutdown)
152 serial->type->shutdown(serial);
153
154 /* return the minor range that this device had */
155 return_serial(serial);
156
153 /* If this is a "fake" port, we have to clean it up here, as it will 157 /* If this is a "fake" port, we have to clean it up here, as it will
154 * not get cleaned up in port_release() as it was never registered with 158 * not get cleaned up in port_release() as it was never registered with
155 * the driver core */ 159 * the driver core */
@@ -826,7 +830,6 @@ int usb_serial_probe(struct usb_interface *interface,
826 num_ports = type->num_ports; 830 num_ports = type->num_ports;
827 } 831 }
828 832
829 serial->minor = minor;
830 serial->num_ports = num_ports; 833 serial->num_ports = num_ports;
831 serial->num_bulk_in = num_bulk_in; 834 serial->num_bulk_in = num_bulk_in;
832 serial->num_bulk_out = num_bulk_out; 835 serial->num_bulk_out = num_bulk_out;
@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface,
847 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); 850 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL);
848 if (!port) 851 if (!port)
849 goto probe_error; 852 goto probe_error;
850 port->number = i + serial->minor;
851 port->serial = serial; 853 port->serial = serial;
852 spin_lock_init(&port->lock); 854 spin_lock_init(&port->lock);
853 mutex_init(&port->mutex); 855 mutex_init(&port->mutex);
@@ -980,6 +982,7 @@ int usb_serial_probe(struct usb_interface *interface,
980 dev_err(&interface->dev, "No more free serial devices\n"); 982 dev_err(&interface->dev, "No more free serial devices\n");
981 goto probe_error; 983 goto probe_error;
982 } 984 }
985 serial->minor = minor;
983 986
984 /* register all of the individual ports with the driver core */ 987 /* register all of the individual ports with the driver core */
985 for (i = 0; i < num_ports; ++i) { 988 for (i = 0; i < num_ports; ++i) {
@@ -1034,9 +1037,6 @@ probe_error:
1034 kfree(port->interrupt_out_buffer); 1037 kfree(port->interrupt_out_buffer);
1035 } 1038 }
1036 1039
1037 /* return the minor range that this device had */
1038 return_serial (serial);
1039
1040 /* free up any memory that we allocated */ 1040 /* free up any memory that we allocated */
1041 for (i = 0; i < serial->num_port_pointers; ++i) 1041 for (i = 0; i < serial->num_port_pointers; ++i)
1042 kfree(serial->port[i]); 1042 kfree(serial->port[i]);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 9644a8ea4aa7..2dd31e3f5107 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -146,6 +146,13 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100,
146 US_SC_DEVICE, US_PR_DEVICE, NULL, 146 US_SC_DEVICE, US_PR_DEVICE, NULL,
147 US_FL_IGNORE_RESIDUE ), 147 US_FL_IGNORE_RESIDUE ),
148 148
149/* Reported by Andrew Nayenko <relan@bk.ru> */
150UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0592,
151 "Nokia",
152 "Nokia 6288",
153 US_SC_DEVICE, US_PR_DEVICE, NULL,
154 US_FL_MAX_SECTORS_64 ),
155
149/* Reported by Mario Rettig <mariorettig@web.de> */ 156/* Reported by Mario Rettig <mariorettig@web.de> */
150UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, 157UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
151 "Nokia", 158 "Nokia",
@@ -1395,16 +1402,6 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1395 US_SC_DEVICE, US_PR_DEVICE, NULL, 1402 US_SC_DEVICE, US_PR_DEVICE, NULL,
1396 US_FL_IGNORE_RESIDUE ), 1403 US_FL_IGNORE_RESIDUE ),
1397 1404
1398/* Reported by Thomas Baechler <thomas@archlinux.org>
1399 * Fixes I/O errors with Teac HD-35PU devices
1400 */
1401
1402UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1403 "Super Top",
1404 "USB 2.0 IDE DEVICE",
1405 US_SC_DEVICE, US_PR_DEVICE, NULL,
1406 US_FL_IGNORE_RESIDUE),
1407
1408/* patch submitted by Davide Perini <perini.davide@dpsoftware.org> 1405/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
1409 * and Renato Perini <rperini@email.it> 1406 * and Renato Perini <rperini@email.it>
1410 */ 1407 */