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: (24 commits)
Revert "[PATCH] USB: move usb_device_class class devices to be real devices"
Revert "[PATCH] USB: convert usb class devices to real devices"
USB: UHCI: Don't test the Short Packet Detect bit
USB: unusual_devs entry for Nokia 3250
USB: dummy-hcd: disable interrupts during req->complete
USB: fix the USB_GADGET_DUMMY_HCD dependencies
USB: ati_remote.c: autorepeat fix
USB: doc: fixes devio.c location in proc_usb_info.txt.
USB: doc: usb-help.txt update.
USB: Patch for rtl8150 to fix unplug problems
USB: cypress driver comment updates
USB: unusual_devs device removal
usb-storage: Add US_FL_IGNORE_DEVICE flag; ignore ZyXEL G220F
USB: New USB ID for Belkin Serial Adapter
USB: Additional PID for the ftdi_sio driver
USB: adding support for SHARP WS003SH to ipaq.c
USB: Fix Freescale high-speed USB host dependency
USB: Removed 3-port device handler from Option driver
USB: Drop Sierra Wireless MC8755 from the Option driver
USB: Let option driver handle Anydata CDMA modems. Remove anydata driver.
...

+343 -364
+1 -1
Documentation/usb/proc_usb_info.txt
··· 59 would issue more ioctls to the device to communicate to it using 60 control, bulk, or other kinds of USB transfers. The IOCTLs are 61 listed in the <linux/usbdevice_fs.h> file, and at this writing the 62 - source code (linux/drivers/usb/devio.c) is the primary reference 63 for how to access devices through those files. 64 65 Note that since by default these BBB/DDD files are writable only by
··· 59 would issue more ioctls to the device to communicate to it using 60 control, bulk, or other kinds of USB transfers. The IOCTLs are 61 listed in the <linux/usbdevice_fs.h> file, and at this writing the 62 + source code (linux/drivers/usb/core/devio.c) is the primary reference 63 for how to access devices through those files. 64 65 Note that since by default these BBB/DDD files are writable only by
+1 -2
Documentation/usb/usb-help.txt
··· 5 Documentation/usb/*, see the following: 6 7 Linux-USB project: http://www.linux-usb.org 8 - mirrors at http://www.suse.cz/development/linux-usb/ 9 - and http://usb.in.tum.de/linux-usb/ 10 and http://it.linux-usb.org 11 Linux USB Guide: http://linux-usb.sourceforge.net 12 Linux-USB device overview (working devices and drivers):
··· 5 Documentation/usb/*, see the following: 6 7 Linux-USB project: http://www.linux-usb.org 8 + mirrors at http://usb.in.tum.de/linux-usb/ 9 and http://it.linux-usb.org 10 Linux USB Guide: http://linux-usb.sourceforge.net 11 Linux-USB device overview (working devices and drivers):
+1 -1
drivers/usb/Kconfig
··· 24 default y if ARCH_S3C2410 25 default y if PXA27x 26 default y if ARCH_EP93XX 27 - default y if ARCH_AT91RM9200 28 # PPC: 29 default y if STB03xxx 30 default y if PPC_MPC52xx
··· 24 default y if ARCH_S3C2410 25 default y if PXA27x 26 default y if ARCH_EP93XX 27 + default y if (ARCH_AT91RM9200 || ARCH_AT91SAM9261) 28 # PPC: 29 default y if STB03xxx 30 default y if PPC_MPC52xx
+10 -10
drivers/usb/core/devio.c
··· 517 518 static struct usb_device *usbdev_lookup_minor(int minor) 519 { 520 - struct device *device; 521 - struct usb_device *udev = NULL; 522 523 down(&usb_device_class->sem); 524 - list_for_each_entry(device, &usb_device_class->devices, node) { 525 - if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { 526 - udev = device->platform_data; 527 break; 528 } 529 } 530 up(&usb_device_class->sem); 531 532 - return udev; 533 }; 534 535 /* ··· 1580 { 1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); 1582 1583 - dev->usbfs_dev = device_create(usb_device_class, &dev->dev, 1584 - MKDEV(USB_DEVICE_MAJOR, minor), 1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum); 1586 1587 - dev->usbfs_dev->platform_data = dev; 1588 } 1589 1590 static void usbdev_remove(struct usb_device *dev) 1591 { 1592 - device_unregister(dev->usbfs_dev); 1593 } 1594 1595 static int usbdev_notify(struct notifier_block *self, unsigned long action,
··· 517 518 static struct usb_device *usbdev_lookup_minor(int minor) 519 { 520 + struct class_device *class_dev; 521 + struct usb_device *dev = NULL; 522 523 down(&usb_device_class->sem); 524 + list_for_each_entry(class_dev, &usb_device_class->children, node) { 525 + if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { 526 + dev = class_dev->class_data; 527 break; 528 } 529 } 530 up(&usb_device_class->sem); 531 532 + return dev; 533 }; 534 535 /* ··· 1580 { 1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); 1582 1583 + dev->class_dev = class_device_create(usb_device_class, NULL, 1584 + MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev, 1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum); 1586 1587 + dev->class_dev->class_data = dev; 1588 } 1589 1590 static void usbdev_remove(struct usb_device *dev) 1591 { 1592 + class_device_unregister(dev->class_dev); 1593 } 1594 1595 static int usbdev_notify(struct notifier_block *self, unsigned long action,
+7 -6
drivers/usb/core/file.c
··· 194 ++temp; 195 else 196 temp = name; 197 - intf->usb_dev = device_create(usb_class->class, &intf->dev, 198 - MKDEV(USB_MAJOR, minor), "%s", temp); 199 - if (IS_ERR(intf->usb_dev)) { 200 spin_lock (&minor_lock); 201 usb_minors[intf->minor] = NULL; 202 spin_unlock (&minor_lock); 203 - retval = PTR_ERR(intf->usb_dev); 204 } 205 exit: 206 return retval; ··· 242 spin_unlock (&minor_lock); 243 244 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 245 - device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 246 - intf->usb_dev = NULL; 247 intf->minor = -1; 248 destroy_usb_class(); 249 }
··· 194 ++temp; 195 else 196 temp = name; 197 + intf->class_dev = class_device_create(usb_class->class, NULL, 198 + MKDEV(USB_MAJOR, minor), 199 + &intf->dev, "%s", temp); 200 + if (IS_ERR(intf->class_dev)) { 201 spin_lock (&minor_lock); 202 usb_minors[intf->minor] = NULL; 203 spin_unlock (&minor_lock); 204 + retval = PTR_ERR(intf->class_dev); 205 } 206 exit: 207 return retval; ··· 241 spin_unlock (&minor_lock); 242 243 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 244 + class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 245 + intf->class_dev = NULL; 246 intf->minor = -1; 247 destroy_usb_class(); 248 }
+1 -1
drivers/usb/gadget/Kconfig
··· 207 208 config USB_GADGET_DUMMY_HCD 209 boolean "Dummy HCD (DEVELOPMENT)" 210 - depends on USB && EXPERIMENTAL 211 select USB_GADGET_DUALSPEED 212 help 213 This host controller driver emulates USB, looping all data transfer
··· 207 208 config USB_GADGET_DUMMY_HCD 209 boolean "Dummy HCD (DEVELOPMENT)" 210 + depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL 211 select USB_GADGET_DUALSPEED 212 help 213 This host controller driver emulates USB, looping all data transfer
+112 -64
drivers/usb/gadget/at91_udc.c
··· 57 58 /* 59 * This controller is simple and PIO-only. It's used in many AT91-series 60 - * ARMv4T controllers, including the at91rm9200 (arm920T, with MMU), 61 - * at91sam9261 (arm926ejs, with MMU), and several no-mmu versions. 62 * 63 * This driver expects the board has been wired with two GPIOs suppporting 64 * a VBUS sensing IRQ, and a D+ pullup. (They may be omitted, but the 65 - * testing hasn't covered such cases.) The pullup is most important; it 66 * provides software control over whether the host enumerates the device. 67 * The VBUS sensing helps during enumeration, and allows both USB clocks 68 * (and the transceiver) to stay gated off until they're necessary, saving 69 - * power. During USB suspend, the 48 MHz clock is gated off. 70 */ 71 72 - #define DRIVER_VERSION "8 March 2005" 73 74 static const char driver_name [] = "at91_udc"; 75 static const char ep0name[] = "ep0"; ··· 320 * 321 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE 322 * that shouldn't normally be changed. 323 */ 324 #define SET_FX (AT91_UDP_TXPKTRDY) 325 - #define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP) 326 327 /* pull OUT packet data from the endpoint's fifo */ 328 static int read_fifo (struct at91_ep *ep, struct at91_request *req) ··· 482 483 /*-------------------------------------------------------------------------*/ 484 485 - static int at91_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) 486 { 487 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); 488 struct at91_udc *dev = ep->udc; ··· 593 * interesting for request or buffer allocation. 594 */ 595 596 - static struct usb_request *at91_ep_alloc_request (struct usb_ep *_ep, unsigned int gfp_flags) 597 { 598 struct at91_request *req; 599 600 - req = kcalloc(1, sizeof (struct at91_request), SLAB_KERNEL); 601 if (!req) 602 return NULL; 603 ··· 874 if (udc->gadget.speed == USB_SPEED_UNKNOWN) 875 driver = NULL; 876 udc->gadget.speed = USB_SPEED_UNKNOWN; 877 878 for (i = 0; i < NUM_ENDPOINTS; i++) { 879 struct at91_ep *ep = &udc->ep[i]; ··· 902 return; 903 udc->clocked = 0; 904 udc->gadget.speed = USB_SPEED_UNKNOWN; 905 - clk_disable(udc->iclk); 906 clk_disable(udc->fclk); 907 } 908 909 /* ··· 924 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 925 at91_set_gpio_value(udc->board.pullup_pin, 0); 926 clk_off(udc); 927 - 928 - // REVISIT: with transceiver disabled, will D- float 929 - // so that a host would falsely detect a device? 930 } 931 } 932 ··· 1300 if (udc->wait_for_addr_ack) { 1301 u32 tmp; 1302 1303 - at91_udp_write(AT91_UDP_FADDR, AT91_UDP_FEN | udc->addr); 1304 tmp = at91_udp_read(AT91_UDP_GLB_STAT); 1305 tmp &= ~AT91_UDP_FADDEN; 1306 if (udc->addr) ··· 1372 u32 rescans = 5; 1373 1374 while (rescans--) { 1375 - u32 status = at91_udp_read(AT91_UDP_ISR); 1376 1377 - status &= at91_udp_read(AT91_UDP_IMR); 1378 if (!status) 1379 break; 1380 ··· 1391 stop_activity(udc); 1392 1393 /* enable ep0 */ 1394 - at91_udp_write(AT91_UDP_CSR(0), AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL); 1395 udc->gadget.speed = USB_SPEED_FULL; 1396 udc->suspended = 0; 1397 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0)); 1398 1399 /* 1400 * NOTE: this driver keeps clocks off unless the 1401 - * USB host is present. That saves power, and also 1402 - * eliminates IRQs (reset, resume, suspend) that can 1403 - * otherwise flood from the controller. If your 1404 - * board doesn't support VBUS detection, suspend and 1405 - * resume irq logic may need more attention... 1406 */ 1407 1408 /* host initiated suspend (3+ms bus idle) */ ··· 1463 1464 /*-------------------------------------------------------------------------*/ 1465 1466 static struct at91_udc controller = { 1467 .gadget = { 1468 - .ops = &at91_udc_ops, 1469 - .ep0 = &controller.ep[0].ep, 1470 - .name = driver_name, 1471 - .dev = { 1472 - .bus_id = "gadget" 1473 } 1474 }, 1475 .ep[0] = { ··· 1485 }, 1486 .udc = &controller, 1487 .maxpacket = 8, 1488 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(0)), 1489 .int_mask = 1 << 0, 1490 }, 1491 .ep[1] = { ··· 1497 .udc = &controller, 1498 .is_pingpong = 1, 1499 .maxpacket = 64, 1500 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(1)), 1501 .int_mask = 1 << 1, 1502 }, 1503 .ep[2] = { ··· 1509 .udc = &controller, 1510 .is_pingpong = 1, 1511 .maxpacket = 64, 1512 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(2)), 1513 .int_mask = 1 << 2, 1514 }, 1515 .ep[3] = { ··· 1521 }, 1522 .udc = &controller, 1523 .maxpacket = 8, 1524 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(3)), 1525 .int_mask = 1 << 3, 1526 }, 1527 .ep[4] = { ··· 1533 .udc = &controller, 1534 .is_pingpong = 1, 1535 .maxpacket = 256, 1536 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(4)), 1537 .int_mask = 1 << 4, 1538 }, 1539 .ep[5] = { ··· 1545 .udc = &controller, 1546 .is_pingpong = 1, 1547 .maxpacket = 256, 1548 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(5)), 1549 .int_mask = 1 << 5, 1550 }, 1551 - /* ep6 and ep7 are also reserved */ 1552 }; 1553 1554 static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r) ··· 1616 1617 local_irq_disable(); 1618 udc->enabled = 0; 1619 pullup(udc, 0); 1620 local_irq_enable(); 1621 ··· 1648 return -ENODEV; 1649 } 1650 1651 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) { 1652 DBG("someone's using UDC memory\n"); 1653 return -EBUSY; ··· 1683 if (retval < 0) 1684 goto fail0; 1685 1686 - /* disable everything until there's a gadget driver and vbus */ 1687 - pullup(udc, 0); 1688 1689 /* request UDC and maybe VBUS irqs */ 1690 - if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) { 1691 - DBG("request irq %d failed\n", AT91_ID_UDP); 1692 retval = -EBUSY; 1693 goto fail1; 1694 } 1695 if (udc->board.vbus_pin > 0) { 1696 - if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) { 1697 - DBG("request vbus irq %d failed\n", udc->board.vbus_pin); 1698 - free_irq(AT91_ID_UDP, udc); 1699 retval = -EBUSY; 1700 goto fail1; 1701 } ··· 1711 udc->vbus = 1; 1712 } 1713 dev_set_drvdata(dev, udc); 1714 create_debug_file(udc); 1715 1716 INFO("%s version %s\n", driver_name, DRIVER_VERSION); ··· 1720 fail1: 1721 device_unregister(&udc->gadget.dev); 1722 fail0: 1723 - release_mem_region(AT91_VA_BASE_UDP, SZ_16K); 1724 DBG("%s probe failed, %d\n", driver_name, retval); 1725 return retval; 1726 } 1727 1728 - static int __devexit at91udc_remove(struct platform_device *dev) 1729 { 1730 - struct at91_udc *udc = platform_get_drvdata(dev); 1731 1732 DBG("remove\n"); 1733 ··· 1736 if (udc->driver != 0) 1737 usb_gadget_unregister_driver(udc->driver); 1738 1739 remove_debug_file(udc); 1740 if (udc->board.vbus_pin > 0) 1741 free_irq(udc->board.vbus_pin, udc); 1742 - free_irq(AT91_ID_UDP, udc); 1743 device_unregister(&udc->gadget.dev); 1744 release_mem_region(AT91_BASE_UDP, SZ_16K); 1745 ··· 1751 } 1752 1753 #ifdef CONFIG_PM 1754 - static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg) 1755 { 1756 - struct at91_udc *udc = platform_get_drvdata(dev); 1757 1758 - /* 1759 - * The "safe" suspend transitions are opportunistic ... e.g. when 1760 - * the USB link is suspended (48MHz clock autogated off), or when 1761 - * it's disconnected (programmatically gated off, elsewhere). 1762 - * Then we can suspend, and the chip can enter slow clock mode. 1763 - * 1764 - * The problem case is some component (user mode?) suspending this 1765 - * device while it's active, with the 48 MHz clock in use. There 1766 - * are two basic approaches: (a) veto suspend levels involving slow 1767 - * clock mode, (b) disconnect, so 48 MHz will no longer be in use 1768 - * and we can enter slow clock mode. This uses (b) for now, since 1769 - * it's simplest until AT91 PM exists and supports the other option. 1770 */ 1771 - if (udc->vbus && !udc->suspended) 1772 pullup(udc, 0); 1773 return 0; 1774 } 1775 1776 - static int at91udc_resume(struct platform_device *dev) 1777 { 1778 - struct at91_udc *udc = platform_get_drvdata(dev); 1779 1780 /* maybe reconnect to host; if so, clocks on */ 1781 pullup(udc, 1); ··· 1796 .remove = __devexit_p(at91udc_remove), 1797 .shutdown = at91udc_shutdown, 1798 .suspend = at91udc_suspend, 1799 - .resume = at91udc_resume, 1800 .driver = { 1801 .name = (char *) driver_name, 1802 .owner = THIS_MODULE, ··· 1815 } 1816 module_exit(udc_exit_module); 1817 1818 - MODULE_DESCRIPTION("AT91RM9200 udc driver"); 1819 MODULE_AUTHOR("Thomas Rathbone, David Brownell"); 1820 MODULE_LICENSE("GPL");
··· 57 58 /* 59 * This controller is simple and PIO-only. It's used in many AT91-series 60 + * full speed USB controllers, including the at91rm9200 (arm920T, with MMU), 61 + * at91sam926x (arm926ejs, with MMU), and several no-mmu versions. 62 * 63 * This driver expects the board has been wired with two GPIOs suppporting 64 * a VBUS sensing IRQ, and a D+ pullup. (They may be omitted, but the 65 + * testing hasn't covered such cases.) 66 + * 67 + * The pullup is most important (so it's integrated on sam926x parts). It 68 * provides software control over whether the host enumerates the device. 69 + * 70 * The VBUS sensing helps during enumeration, and allows both USB clocks 71 * (and the transceiver) to stay gated off until they're necessary, saving 72 + * power. During USB suspend, the 48 MHz clock is gated off in hardware; 73 + * it may also be gated off by software during some Linux sleep states. 74 */ 75 76 + #define DRIVER_VERSION "3 May 2006" 77 78 static const char driver_name [] = "at91_udc"; 79 static const char ep0name[] = "ep0"; ··· 316 * 317 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE 318 * that shouldn't normally be changed. 319 + * 320 + * NOTE at91sam9260 docs mention synch between UDPCK and MCK clock domains, 321 + * implying a need to wait for one write to complete (test relevant bits) 322 + * before starting the next write. This shouldn't be an issue given how 323 + * infrequently we write, except maybe for write-then-read idioms. 324 */ 325 #define SET_FX (AT91_UDP_TXPKTRDY) 326 + #define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP \ 327 + | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP) 328 329 /* pull OUT packet data from the endpoint's fifo */ 330 static int read_fifo (struct at91_ep *ep, struct at91_request *req) ··· 472 473 /*-------------------------------------------------------------------------*/ 474 475 + static int at91_ep_enable(struct usb_ep *_ep, 476 + const struct usb_endpoint_descriptor *desc) 477 { 478 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); 479 struct at91_udc *dev = ep->udc; ··· 582 * interesting for request or buffer allocation. 583 */ 584 585 + static struct usb_request * 586 + at91_ep_alloc_request(struct usb_ep *_ep, unsigned int gfp_flags) 587 { 588 struct at91_request *req; 589 590 + req = kcalloc(1, sizeof (struct at91_request), gfp_flags); 591 if (!req) 592 return NULL; 593 ··· 862 if (udc->gadget.speed == USB_SPEED_UNKNOWN) 863 driver = NULL; 864 udc->gadget.speed = USB_SPEED_UNKNOWN; 865 + udc->suspended = 0; 866 867 for (i = 0; i < NUM_ENDPOINTS; i++) { 868 struct at91_ep *ep = &udc->ep[i]; ··· 889 return; 890 udc->clocked = 0; 891 udc->gadget.speed = USB_SPEED_UNKNOWN; 892 clk_disable(udc->fclk); 893 + clk_disable(udc->iclk); 894 } 895 896 /* ··· 911 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 912 at91_set_gpio_value(udc->board.pullup_pin, 0); 913 clk_off(udc); 914 } 915 } 916 ··· 1290 if (udc->wait_for_addr_ack) { 1291 u32 tmp; 1292 1293 + at91_udp_write(AT91_UDP_FADDR, 1294 + AT91_UDP_FEN | udc->addr); 1295 tmp = at91_udp_read(AT91_UDP_GLB_STAT); 1296 tmp &= ~AT91_UDP_FADDEN; 1297 if (udc->addr) ··· 1361 u32 rescans = 5; 1362 1363 while (rescans--) { 1364 + u32 status; 1365 1366 + status = at91_udp_read(AT91_UDP_ISR) 1367 + & at91_udp_read(AT91_UDP_IMR); 1368 if (!status) 1369 break; 1370 ··· 1379 stop_activity(udc); 1380 1381 /* enable ep0 */ 1382 + at91_udp_write(AT91_UDP_CSR(0), 1383 + AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL); 1384 udc->gadget.speed = USB_SPEED_FULL; 1385 udc->suspended = 0; 1386 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0)); 1387 1388 /* 1389 * NOTE: this driver keeps clocks off unless the 1390 + * USB host is present. That saves power, but for 1391 + * boards that don't support VBUS detection, both 1392 + * clocks need to be active most of the time. 1393 */ 1394 1395 /* host initiated suspend (3+ms bus idle) */ ··· 1452 1453 /*-------------------------------------------------------------------------*/ 1454 1455 + static void nop_release(struct device *dev) 1456 + { 1457 + /* nothing to free */ 1458 + } 1459 + 1460 static struct at91_udc controller = { 1461 .gadget = { 1462 + .ops = &at91_udc_ops, 1463 + .ep0 = &controller.ep[0].ep, 1464 + .name = driver_name, 1465 + .dev = { 1466 + .bus_id = "gadget", 1467 + .release = nop_release, 1468 } 1469 }, 1470 .ep[0] = { ··· 1468 }, 1469 .udc = &controller, 1470 .maxpacket = 8, 1471 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1472 + + AT91_UDP_CSR(0)), 1473 .int_mask = 1 << 0, 1474 }, 1475 .ep[1] = { ··· 1479 .udc = &controller, 1480 .is_pingpong = 1, 1481 .maxpacket = 64, 1482 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1483 + + AT91_UDP_CSR(1)), 1484 .int_mask = 1 << 1, 1485 }, 1486 .ep[2] = { ··· 1490 .udc = &controller, 1491 .is_pingpong = 1, 1492 .maxpacket = 64, 1493 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1494 + + AT91_UDP_CSR(2)), 1495 .int_mask = 1 << 2, 1496 }, 1497 .ep[3] = { ··· 1501 }, 1502 .udc = &controller, 1503 .maxpacket = 8, 1504 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1505 + + AT91_UDP_CSR(3)), 1506 .int_mask = 1 << 3, 1507 }, 1508 .ep[4] = { ··· 1512 .udc = &controller, 1513 .is_pingpong = 1, 1514 .maxpacket = 256, 1515 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1516 + + AT91_UDP_CSR(4)), 1517 .int_mask = 1 << 4, 1518 }, 1519 .ep[5] = { ··· 1523 .udc = &controller, 1524 .is_pingpong = 1, 1525 .maxpacket = 256, 1526 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1527 + + AT91_UDP_CSR(5)), 1528 .int_mask = 1 << 5, 1529 }, 1530 + /* ep6 and ep7 are also reserved (custom silicon might use them) */ 1531 }; 1532 1533 static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r) ··· 1593 1594 local_irq_disable(); 1595 udc->enabled = 0; 1596 + at91_udp_write(AT91_UDP_IDR, ~0); 1597 pullup(udc, 0); 1598 local_irq_enable(); 1599 ··· 1624 return -ENODEV; 1625 } 1626 1627 + if (pdev->num_resources != 2) { 1628 + DBG("invalid num_resources"); 1629 + return -ENODEV; 1630 + } 1631 + if ((pdev->resource[0].flags != IORESOURCE_MEM) 1632 + || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 1633 + DBG("invalid resource type"); 1634 + return -ENODEV; 1635 + } 1636 + 1637 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) { 1638 DBG("someone's using UDC memory\n"); 1639 return -EBUSY; ··· 1649 if (retval < 0) 1650 goto fail0; 1651 1652 + /* don't do anything until we have both gadget driver and VBUS */ 1653 + clk_enable(udc->iclk); 1654 + at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 1655 + at91_udp_write(AT91_UDP_IDR, 0xffffffff); 1656 + clk_disable(udc->iclk); 1657 1658 /* request UDC and maybe VBUS irqs */ 1659 + udc->udp_irq = platform_get_irq(pdev, 0); 1660 + if (request_irq(udc->udp_irq, at91_udc_irq, 1661 + IRQF_DISABLED, driver_name, udc)) { 1662 + DBG("request irq %d failed\n", udc->udp_irq); 1663 retval = -EBUSY; 1664 goto fail1; 1665 } 1666 if (udc->board.vbus_pin > 0) { 1667 + if (request_irq(udc->board.vbus_pin, at91_vbus_irq, 1668 + IRQF_DISABLED, driver_name, udc)) { 1669 + DBG("request vbus irq %d failed\n", 1670 + udc->board.vbus_pin); 1671 + free_irq(udc->udp_irq, udc); 1672 retval = -EBUSY; 1673 goto fail1; 1674 } ··· 1670 udc->vbus = 1; 1671 } 1672 dev_set_drvdata(dev, udc); 1673 + device_init_wakeup(dev, 1); 1674 create_debug_file(udc); 1675 1676 INFO("%s version %s\n", driver_name, DRIVER_VERSION); ··· 1678 fail1: 1679 device_unregister(&udc->gadget.dev); 1680 fail0: 1681 + release_mem_region(AT91_BASE_UDP, SZ_16K); 1682 DBG("%s probe failed, %d\n", driver_name, retval); 1683 return retval; 1684 } 1685 1686 + static int __devexit at91udc_remove(struct platform_device *pdev) 1687 { 1688 + struct at91_udc *udc = platform_get_drvdata(pdev); 1689 1690 DBG("remove\n"); 1691 ··· 1694 if (udc->driver != 0) 1695 usb_gadget_unregister_driver(udc->driver); 1696 1697 + device_init_wakeup(&pdev->dev, 0); 1698 remove_debug_file(udc); 1699 if (udc->board.vbus_pin > 0) 1700 free_irq(udc->board.vbus_pin, udc); 1701 + free_irq(udc->udp_irq, udc); 1702 device_unregister(&udc->gadget.dev); 1703 release_mem_region(AT91_BASE_UDP, SZ_16K); 1704 ··· 1708 } 1709 1710 #ifdef CONFIG_PM 1711 + static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) 1712 { 1713 + struct at91_udc *udc = platform_get_drvdata(pdev); 1714 + int wake = udc->driver && device_may_wakeup(&pdev->dev); 1715 1716 + /* Unless we can act normally to the host (letting it wake us up 1717 + * whenever it has work for us) force disconnect. Wakeup requires 1718 + * PLLB for USB events (signaling for reset, wakeup, or incoming 1719 + * tokens) and VBUS irqs (on systems which support them). 1720 */ 1721 + if ((!udc->suspended && udc->addr) 1722 + || !wake 1723 + || at91_suspend_entering_slow_clock()) { 1724 pullup(udc, 0); 1725 + disable_irq_wake(udc->udp_irq); 1726 + } else 1727 + enable_irq_wake(udc->udp_irq); 1728 + 1729 + if (udc->board.vbus_pin > 0) { 1730 + if (wake) 1731 + enable_irq_wake(udc->board.vbus_pin); 1732 + else 1733 + disable_irq_wake(udc->board.vbus_pin); 1734 + } 1735 return 0; 1736 } 1737 1738 + static int at91udc_resume(struct platform_device *pdev) 1739 { 1740 + struct at91_udc *udc = platform_get_drvdata(pdev); 1741 1742 /* maybe reconnect to host; if so, clocks on */ 1743 pullup(udc, 1); ··· 1748 .remove = __devexit_p(at91udc_remove), 1749 .shutdown = at91udc_shutdown, 1750 .suspend = at91udc_suspend, 1751 + .resume = at91udc_resume, 1752 .driver = { 1753 .name = (char *) driver_name, 1754 .owner = THIS_MODULE, ··· 1767 } 1768 module_exit(udc_exit_module); 1769 1770 + MODULE_DESCRIPTION("AT91 udc driver"); 1771 MODULE_AUTHOR("Thomas Rathbone, David Brownell"); 1772 MODULE_LICENSE("GPL");
+1
drivers/usb/gadget/at91_udc.h
··· 141 struct clk *iclk, *fclk; 142 struct platform_device *pdev; 143 struct proc_dir_entry *pde; 144 }; 145 146 static inline struct at91_udc *to_udc(struct usb_gadget *g)
··· 141 struct clk *iclk, *fclk; 142 struct platform_device *pdev; 143 struct proc_dir_entry *pde; 144 + int udp_irq; 145 }; 146 147 static inline struct at91_udc *to_udc(struct usb_gadget *g)
+4 -2
drivers/usb/gadget/dummy_hcd.c
··· 609 if (!dum->driver) 610 return -ESHUTDOWN; 611 612 - spin_lock_irqsave (&dum->lock, flags); 613 list_for_each_entry (req, &ep->queue, queue) { 614 if (&req->req == _req) { 615 list_del_init (&req->queue); ··· 619 break; 620 } 621 } 622 - spin_unlock_irqrestore (&dum->lock, flags); 623 624 if (retval == 0) { 625 dev_dbg (udc_dev(dum), ··· 627 req, _ep->name, _req->length, _req->buf); 628 _req->complete (_ep, _req); 629 } 630 return retval; 631 } 632
··· 609 if (!dum->driver) 610 return -ESHUTDOWN; 611 612 + local_irq_save (flags); 613 + spin_lock (&dum->lock); 614 list_for_each_entry (req, &ep->queue, queue) { 615 if (&req->req == _req) { 616 list_del_init (&req->queue); ··· 618 break; 619 } 620 } 621 + spin_unlock (&dum->lock); 622 623 if (retval == 0) { 624 dev_dbg (udc_dev(dum), ··· 626 req, _ep->name, _req->length, _req->buf); 627 _req->complete (_ep, _req); 628 } 629 + local_irq_restore (flags); 630 return retval; 631 } 632
+1 -1
drivers/usb/host/ehci-hcd.c
··· 892 #define PCI_DRIVER ehci_pci_driver 893 #endif 894 895 - #ifdef CONFIG_PPC_83xx 896 #include "ehci-fsl.c" 897 #define PLATFORM_DRIVER ehci_fsl_driver 898 #endif
··· 892 #define PCI_DRIVER ehci_pci_driver 893 #endif 894 895 + #ifdef CONFIG_MPC834x 896 #include "ehci-fsl.c" 897 #define PLATFORM_DRIVER ehci_fsl_driver 898 #endif
+59 -29
drivers/usb/host/ohci-at91.c
··· 4 * Copyright (C) 2004 SAN People (Pty) Ltd. 5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> 6 * 7 - * AT91RM9200 Bus Glue 8 * 9 * Based on fragments of 2.4 driver by Rick Bronson. 10 * Based on ohci-omap.c ··· 19 #include <asm/hardware.h> 20 #include <asm/arch/board.h> 21 22 - #ifndef CONFIG_ARCH_AT91RM9200 23 - #error "CONFIG_ARCH_AT91RM9200 must be defined." 24 #endif 25 26 /* interface and function clocks */ 27 static struct clk *iclk, *fclk; 28 29 extern int usb_disabled(void); 30 ··· 36 struct usb_hcd *hcd = platform_get_drvdata(pdev); 37 struct ohci_regs __iomem *regs = hcd->regs; 38 39 - dev_dbg(&pdev->dev, "starting AT91RM9200 OHCI USB Controller\n"); 40 41 /* 42 * Start the USB clocks. 43 */ 44 clk_enable(iclk); 45 clk_enable(fclk); 46 47 /* 48 * The USB host controller must remain in reset. ··· 56 struct usb_hcd *hcd = platform_get_drvdata(pdev); 57 struct ohci_regs __iomem *regs = hcd->regs; 58 59 - dev_dbg(&pdev->dev, "stopping AT91RM9200 OHCI USB Controller\n"); 60 61 /* 62 * Put the USB host controller into reset. ··· 68 */ 69 clk_disable(fclk); 70 clk_disable(iclk); 71 } 72 73 ··· 81 82 83 /** 84 - * usb_hcd_at91_probe - initialize AT91RM9200-based HCDs 85 * Context: !in_interrupt() 86 * 87 * Allocates basic resources for this USB host controller, and 88 * then invokes the start() method for the HCD associated with it 89 * through the hotplug entry's driver_data. 90 */ 91 - int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) 92 { 93 int retval; 94 struct usb_hcd *hcd = NULL; ··· 99 return -ENODEV; 100 } 101 102 - if ((pdev->resource[0].flags != IORESOURCE_MEM) || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 103 pr_debug("hcd probe: invalid resource type\n"); 104 return -ENODEV; 105 } 106 107 - hcd = usb_create_hcd(driver, &pdev->dev, "at91rm9200"); 108 if (!hcd) 109 return -ENOMEM; 110 hcd->rsrc_start = pdev->resource[0].start; ··· 154 /* may be called with controller, bus, and devices active */ 155 156 /** 157 - * usb_hcd_at91_remove - shutdown processing for AT91RM9200-based HCDs 158 * @dev: USB Host Controller being removed 159 * Context: !in_interrupt() 160 * 161 * Reverses the effect of usb_hcd_at91_probe(), first invoking 162 * the HCD's stop() method. It is always called from a thread 163 - * context, normally "rmmod", "apmd", or something similar. 164 * 165 */ 166 - static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pdev) 167 { 168 usb_remove_hcd(hcd); 169 at91_stop_hc(pdev); 170 iounmap(hcd->regs); 171 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 172 173 clk_put(fclk); 174 clk_put(iclk); ··· 185 static int __devinit 186 ohci_at91_start (struct usb_hcd *hcd) 187 { 188 - // struct at91_ohci_data *board = hcd->self.controller->platform_data; 189 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 190 int ret; 191 192 if ((ret = ohci_init(ohci)) < 0) 193 return ret; 194 195 if ((ret = ohci_run(ohci)) < 0) { 196 err("can't start %s", hcd->self.bus_name); 197 ohci_stop(hcd); 198 return ret; 199 } 200 - // hcd->self.root_hub->maxchild = board->ports; 201 return 0; 202 } 203 ··· 207 208 static const struct hc_driver ohci_at91_hc_driver = { 209 .description = hcd_name, 210 - .product_desc = "AT91RM9200 OHCI", 211 .hcd_priv_size = sizeof(struct ohci_hcd), 212 213 /* ··· 249 250 /*-------------------------------------------------------------------------*/ 251 252 - static int ohci_hcd_at91_drv_probe(struct platform_device *dev) 253 { 254 - return usb_hcd_at91_probe(&ohci_at91_hc_driver, dev); 255 } 256 257 - static int ohci_hcd_at91_drv_remove(struct platform_device *dev) 258 { 259 - return usb_hcd_at91_remove(platform_get_drvdata(dev), dev); 260 } 261 262 #ifdef CONFIG_PM 263 264 - /* REVISIT suspend/resume look "too" simple here */ 265 - 266 static int 267 - ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg) 268 { 269 - clk_disable(fclk); 270 - clk_disable(iclk); 271 272 return 0; 273 } 274 275 - static int ohci_hcd_at91_drv_resume(struct platform_device *dev) 276 { 277 - clk_enable(iclk); 278 - clk_enable(fclk); 279 280 return 0; 281 } ··· 305 #define ohci_hcd_at91_drv_resume NULL 306 #endif 307 308 - MODULE_ALIAS("at91rm9200-ohci"); 309 310 static struct platform_driver ohci_hcd_at91_driver = { 311 .probe = ohci_hcd_at91_drv_probe, ··· 313 .suspend = ohci_hcd_at91_drv_suspend, 314 .resume = ohci_hcd_at91_drv_resume, 315 .driver = { 316 - .name = "at91rm9200-ohci", 317 .owner = THIS_MODULE, 318 }, 319 };
··· 4 * Copyright (C) 2004 SAN People (Pty) Ltd. 5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> 6 * 7 + * AT91 Bus Glue 8 * 9 * Based on fragments of 2.4 driver by Rick Bronson. 10 * Based on ohci-omap.c ··· 19 #include <asm/hardware.h> 20 #include <asm/arch/board.h> 21 22 + #ifndef CONFIG_ARCH_AT91 23 + #error "CONFIG_ARCH_AT91 must be defined." 24 #endif 25 26 /* interface and function clocks */ 27 static struct clk *iclk, *fclk; 28 + static int clocked; 29 30 extern int usb_disabled(void); 31 ··· 35 struct usb_hcd *hcd = platform_get_drvdata(pdev); 36 struct ohci_regs __iomem *regs = hcd->regs; 37 38 + dev_dbg(&pdev->dev, "start\n"); 39 40 /* 41 * Start the USB clocks. 42 */ 43 clk_enable(iclk); 44 clk_enable(fclk); 45 + clocked = 1; 46 47 /* 48 * The USB host controller must remain in reset. ··· 54 struct usb_hcd *hcd = platform_get_drvdata(pdev); 55 struct ohci_regs __iomem *regs = hcd->regs; 56 57 + dev_dbg(&pdev->dev, "stop\n"); 58 59 /* 60 * Put the USB host controller into reset. ··· 66 */ 67 clk_disable(fclk); 68 clk_disable(iclk); 69 + clocked = 0; 70 } 71 72 ··· 78 79 80 /** 81 + * usb_hcd_at91_probe - initialize AT91-based HCDs 82 * Context: !in_interrupt() 83 * 84 * Allocates basic resources for this USB host controller, and 85 * then invokes the start() method for the HCD associated with it 86 * through the hotplug entry's driver_data. 87 */ 88 + static int usb_hcd_at91_probe(const struct hc_driver *driver, 89 + struct platform_device *pdev) 90 { 91 int retval; 92 struct usb_hcd *hcd = NULL; ··· 95 return -ENODEV; 96 } 97 98 + if ((pdev->resource[0].flags != IORESOURCE_MEM) 99 + || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 100 pr_debug("hcd probe: invalid resource type\n"); 101 return -ENODEV; 102 } 103 104 + hcd = usb_create_hcd(driver, &pdev->dev, "at91"); 105 if (!hcd) 106 return -ENOMEM; 107 hcd->rsrc_start = pdev->resource[0].start; ··· 149 /* may be called with controller, bus, and devices active */ 150 151 /** 152 + * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs 153 * @dev: USB Host Controller being removed 154 * Context: !in_interrupt() 155 * 156 * Reverses the effect of usb_hcd_at91_probe(), first invoking 157 * the HCD's stop() method. It is always called from a thread 158 + * context, "rmmod" or something similar. 159 * 160 */ 161 + static int usb_hcd_at91_remove(struct usb_hcd *hcd, 162 + struct platform_device *pdev) 163 { 164 usb_remove_hcd(hcd); 165 at91_stop_hc(pdev); 166 iounmap(hcd->regs); 167 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 168 + disable_irq_wake(hcd->irq); 169 170 clk_put(fclk); 171 clk_put(iclk); ··· 178 static int __devinit 179 ohci_at91_start (struct usb_hcd *hcd) 180 { 181 + struct at91_usbh_data *board = hcd->self.controller->platform_data; 182 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 183 + struct usb_device *root = hcd->self.root_hub; 184 int ret; 185 186 if ((ret = ohci_init(ohci)) < 0) 187 return ret; 188 + 189 + root->maxchild = board->ports; 190 191 if ((ret = ohci_run(ohci)) < 0) { 192 err("can't start %s", hcd->self.bus_name); 193 ohci_stop(hcd); 194 return ret; 195 } 196 return 0; 197 } 198 ··· 198 199 static const struct hc_driver ohci_at91_hc_driver = { 200 .description = hcd_name, 201 + .product_desc = "AT91 OHCI", 202 .hcd_priv_size = sizeof(struct ohci_hcd), 203 204 /* ··· 240 241 /*-------------------------------------------------------------------------*/ 242 243 + static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) 244 { 245 + device_init_wakeup(&pdev->dev, 1); 246 + return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); 247 } 248 249 + static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) 250 { 251 + device_init_wakeup(&pdev->dev, 0); 252 + return usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev); 253 } 254 255 #ifdef CONFIG_PM 256 257 static int 258 + ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) 259 { 260 + struct usb_hcd *hcd = platform_get_drvdata(pdev); 261 + struct ohci_hcd *ohci = hcd_to_ohci(hcd); 262 + 263 + if (device_may_wakeup(&pdev->dev)) 264 + enable_irq_wake(hcd->irq); 265 + else 266 + disable_irq_wake(hcd->irq); 267 + 268 + /* 269 + * The integrated transceivers seem unable to notice disconnect, 270 + * reconnect, or wakeup without the 48 MHz clock active. so for 271 + * correctness, always discard connection state (using reset). 272 + * 273 + * REVISIT: some boards will be able to turn VBUS off... 274 + */ 275 + if (at91_suspend_entering_slow_clock()) { 276 + ohci_usb_reset (ohci); 277 + clk_disable(fclk); 278 + clk_disable(iclk); 279 + clocked = 0; 280 + } 281 282 return 0; 283 } 284 285 + static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) 286 { 287 + if (!clocked) { 288 + clk_enable(iclk); 289 + clk_enable(fclk); 290 + } 291 292 return 0; 293 } ··· 275 #define ohci_hcd_at91_drv_resume NULL 276 #endif 277 278 + MODULE_ALIAS("at91_ohci"); 279 280 static struct platform_driver ohci_hcd_at91_driver = { 281 .probe = ohci_hcd_at91_drv_probe, ··· 283 .suspend = ohci_hcd_at91_drv_suspend, 284 .resume = ohci_hcd_at91_drv_resume, 285 .driver = { 286 + .name = "at91_ohci", 287 .owner = THIS_MODULE, 288 }, 289 };
+2 -1
drivers/usb/host/ohci-hcd.c
··· 913 #include "ohci-ppc-soc.c" 914 #endif 915 916 - #ifdef CONFIG_ARCH_AT91RM9200 917 #include "ohci-at91.c" 918 #endif 919 ··· 927 || defined (CONFIG_SOC_AU1X00) \ 928 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ 929 || defined (CONFIG_ARCH_AT91RM9200) \ 930 ) 931 #error "missing bus glue for ohci-hcd" 932 #endif
··· 913 #include "ohci-ppc-soc.c" 914 #endif 915 916 + #if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261) 917 #include "ohci-at91.c" 918 #endif 919 ··· 927 || defined (CONFIG_SOC_AU1X00) \ 928 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ 929 || defined (CONFIG_ARCH_AT91RM9200) \ 930 + || defined (CONFIG_ARCH_AT91SAM9261) \ 931 ) 932 #error "missing bus glue for ohci-hcd" 933 #endif
+3 -1
drivers/usb/host/uhci-q.c
··· 943 /* We received a short packet */ 944 if (urb->transfer_flags & URB_SHORT_NOT_OK) 945 ret = -EREMOTEIO; 946 - else if (ctrlstat & TD_CTRL_SPD) 947 ret = 1; 948 } 949
··· 943 /* We received a short packet */ 944 if (urb->transfer_flags & URB_SHORT_NOT_OK) 945 ret = -EREMOTEIO; 946 + 947 + /* Fixup needed only if this isn't the URB's last TD */ 948 + else if (&td->list != urbp->td_list.prev) 949 ret = 1; 950 } 951
+2 -3
drivers/usb/input/ati_remote.c
··· 152 * events. The hardware generates 5 events for the first keypress 153 * and we have to take this into account for an accurate repeat 154 * behaviour. 155 - * (HZ / 20) == 50 ms and works well for me. 156 */ 157 - #define FILTER_TIME (HZ / 20) 158 159 struct ati_remote { 160 struct input_dev *idev; ··· 466 /* Filter duplicate events which happen "too close" together. */ 467 if ((ati_remote->old_data[0] == data[1]) && 468 (ati_remote->old_data[1] == data[2]) && 469 - time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) { 470 ati_remote->repeat_count++; 471 } else { 472 ati_remote->repeat_count = 0;
··· 152 * events. The hardware generates 5 events for the first keypress 153 * and we have to take this into account for an accurate repeat 154 * behaviour. 155 */ 156 + #define FILTER_TIME 60 /* msec */ 157 158 struct ati_remote { 159 struct input_dev *idev; ··· 467 /* Filter duplicate events which happen "too close" together. */ 468 if ((ati_remote->old_data[0] == data[1]) && 469 (ati_remote->old_data[1] == data[2]) && 470 + time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(FILTER_TIME))) { 471 ati_remote->repeat_count++; 472 } else { 473 ati_remote->repeat_count = 0;
+7 -2
drivers/usb/misc/cypress_cy7c63.c
··· 12 * the single I/O ports of the device. 13 * 14 * Supported vendors: AK Modul-Bus Computer GmbH 15 - * Supported devices: CY7C63001A-PC (to be continued...) 16 - * Supported functions: Read/Write Ports (to be continued...) 17 * 18 * 19 * This program is free software; you can redistribute it and/or
··· 12 * the single I/O ports of the device. 13 * 14 * Supported vendors: AK Modul-Bus Computer GmbH 15 + * (Firmware "Port-Chip") 16 + * 17 + * Supported devices: CY7C63001A-PC 18 + * CY7C63001C-PXC 19 + * CY7C63001C-SXC 20 + * 21 + * Supported functions: Read/Write Ports 22 * 23 * 24 * This program is free software; you can redistribute it and/or
+71 -12
drivers/usb/net/rtl8150.c
··· 175 static void rtl8150_disconnect(struct usb_interface *intf); 176 static int rtl8150_probe(struct usb_interface *intf, 177 const struct usb_device_id *id); 178 179 static const char driver_name [] = "rtl8150"; 180 ··· 185 .probe = rtl8150_probe, 186 .disconnect = rtl8150_disconnect, 187 .id_table = rtl8150_table, 188 }; 189 190 /* ··· 242 usb_fill_control_urb(dev->ctrl_urb, dev->udev, 243 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 244 &dev->rx_creg, size, ctrl_callback, dev); 245 - if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) 246 err("control request submission failed: %d", ret); 247 - else 248 set_bit(RX_REG_SET, &dev->flags); 249 250 return ret; ··· 422 struct sk_buff *skb; 423 struct net_device *netdev; 424 u16 rx_stat; 425 426 dev = urb->context; 427 if (!dev) ··· 472 goon: 473 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 474 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 475 - if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 476 set_bit(RX_URB_FAIL, &dev->flags); 477 goto resched; 478 } else { ··· 491 { 492 rtl8150_t *dev; 493 struct sk_buff *skb; 494 495 dev = (rtl8150_t *)data; 496 ··· 510 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 511 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 512 try_again: 513 - if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 514 set_bit(RX_URB_FAIL, &dev->flags); 515 goto tlsched; 516 - } else { 517 clear_bit(RX_URB_FAIL, &dev->flags); 518 } 519 ··· 588 589 resubmit: 590 status = usb_submit_urb (urb, SLAB_ATOMIC); 591 - if (status) 592 err ("can't resubmit intr, %s-%s/input0, status %d", 593 dev->udev->bus->bus_name, 594 dev->udev->devpath, status); 595 } 596 597 598 /* 599 ** ··· 735 usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), 736 skb->data, count, write_bulk_callback, dev); 737 if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) { 738 - warn("failed tx_urb %d\n", res); 739 - dev->stats.tx_errors++; 740 - netif_start_queue(netdev); 741 } else { 742 dev->stats.tx_packets++; 743 dev->stats.tx_bytes += skb->len; ··· 779 780 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 781 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 782 - if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) 783 warn("%s: rx_urb submit failed: %d", __FUNCTION__, res); 784 usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3), 785 dev->intr_buff, INTBUFSIZE, intr_callback, 786 dev, dev->intr_interval); 787 - if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) 788 warn("%s: intr_urb submit failed: %d", __FUNCTION__, res); 789 - netif_start_queue(netdev); 790 enable_net_traffic(dev); 791 set_carrier(netdev); 792 793 return res; 794 }
··· 175 static void rtl8150_disconnect(struct usb_interface *intf); 176 static int rtl8150_probe(struct usb_interface *intf, 177 const struct usb_device_id *id); 178 + static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message); 179 + static int rtl8150_resume(struct usb_interface *intf); 180 181 static const char driver_name [] = "rtl8150"; 182 ··· 183 .probe = rtl8150_probe, 184 .disconnect = rtl8150_disconnect, 185 .id_table = rtl8150_table, 186 + .suspend = rtl8150_suspend, 187 + .resume = rtl8150_resume 188 }; 189 190 /* ··· 238 usb_fill_control_urb(dev->ctrl_urb, dev->udev, 239 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 240 &dev->rx_creg, size, ctrl_callback, dev); 241 + if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) { 242 + if (ret == -ENODEV) 243 + netif_device_detach(dev->netdev); 244 err("control request submission failed: %d", ret); 245 + } else 246 set_bit(RX_REG_SET, &dev->flags); 247 248 return ret; ··· 416 struct sk_buff *skb; 417 struct net_device *netdev; 418 u16 rx_stat; 419 + int status; 420 421 dev = urb->context; 422 if (!dev) ··· 465 goon: 466 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 467 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 468 + status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); 469 + if (status == -ENODEV) 470 + netif_device_detach(dev->netdev); 471 + else if (status) { 472 set_bit(RX_URB_FAIL, &dev->flags); 473 goto resched; 474 } else { ··· 481 { 482 rtl8150_t *dev; 483 struct sk_buff *skb; 484 + int status; 485 486 dev = (rtl8150_t *)data; 487 ··· 499 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 500 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 501 try_again: 502 + status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); 503 + if (status == -ENODEV) { 504 + netif_device_detach(dev->netdev); 505 + } else if (status) { 506 set_bit(RX_URB_FAIL, &dev->flags); 507 goto tlsched; 508 + } else { 509 clear_bit(RX_URB_FAIL, &dev->flags); 510 } 511 ··· 574 575 resubmit: 576 status = usb_submit_urb (urb, SLAB_ATOMIC); 577 + if (status == -ENODEV) 578 + netif_device_detach(dev->netdev); 579 + else if (status) 580 err ("can't resubmit intr, %s-%s/input0, status %d", 581 dev->udev->bus->bus_name, 582 dev->udev->devpath, status); 583 } 584 585 + static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message) 586 + { 587 + rtl8150_t *dev = usb_get_intfdata(intf); 588 + 589 + netif_device_detach(dev->netdev); 590 + 591 + if (netif_running(dev->netdev)) { 592 + usb_kill_urb(dev->rx_urb); 593 + usb_kill_urb(dev->intr_urb); 594 + } 595 + return 0; 596 + } 597 + 598 + static int rtl8150_resume(struct usb_interface *intf) 599 + { 600 + rtl8150_t *dev = usb_get_intfdata(intf); 601 + 602 + netif_device_attach(dev->netdev); 603 + if (netif_running(dev->netdev)) { 604 + dev->rx_urb->status = 0; 605 + dev->rx_urb->actual_length = 0; 606 + read_bulk_callback(dev->rx_urb, NULL); 607 + 608 + dev->intr_urb->status = 0; 609 + dev->intr_urb->actual_length = 0; 610 + intr_callback(dev->intr_urb, NULL); 611 + } 612 + return 0; 613 + } 614 615 /* 616 ** ··· 690 usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), 691 skb->data, count, write_bulk_callback, dev); 692 if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) { 693 + /* Can we get/handle EPIPE here? */ 694 + if (res == -ENODEV) 695 + netif_device_detach(dev->netdev); 696 + else { 697 + warn("failed tx_urb %d\n", res); 698 + dev->stats.tx_errors++; 699 + netif_start_queue(netdev); 700 + } 701 } else { 702 dev->stats.tx_packets++; 703 dev->stats.tx_bytes += skb->len; ··· 729 730 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 731 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 732 + if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) { 733 + if (res == -ENODEV) 734 + netif_device_detach(dev->netdev); 735 warn("%s: rx_urb submit failed: %d", __FUNCTION__, res); 736 + return res; 737 + } 738 usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3), 739 dev->intr_buff, INTBUFSIZE, intr_callback, 740 dev, dev->intr_interval); 741 + if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) { 742 + if (res == -ENODEV) 743 + netif_device_detach(dev->netdev); 744 warn("%s: intr_urb submit failed: %d", __FUNCTION__, res); 745 + usb_kill_urb(dev->rx_urb); 746 + return res; 747 + } 748 enable_net_traffic(dev); 749 set_carrier(netdev); 750 + netif_start_queue(netdev); 751 752 return res; 753 }
+9 -15
drivers/usb/serial/Kconfig
··· 62 To compile this driver as a module, choose M here: the 63 module will be called airprime. 64 65 - config USB_SERIAL_ANYDATA 66 - tristate "USB AnyData CDMA Wireless Driver" 67 - depends on USB_SERIAL 68 - help 69 - Say Y here if you want to use a AnyData CDMA device. 70 - 71 - To compile this driver as a module, choose M here: the 72 - module will be called anydata. 73 - 74 config USB_SERIAL_ARK3116 75 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" 76 depends on USB_SERIAL && EXPERIMENTAL ··· 493 module will be called keyspan_pda. 494 495 config USB_SERIAL_OPTION 496 - tristate "USB driver for GSM modems" 497 depends on USB_SERIAL 498 help 499 - Say Y here if you have an "Option" GSM PCMCIA card 500 - (or an OEM version: branded Huawei, Audiovox, or Novatel). 501 502 - These cards feature a built-in OHCI-USB adapter and an 503 - internally-connected GSM modem. The USB bus is not 504 - accessible externally. 505 506 To compile this driver as a module, choose M here: the 507 module will be called option.
··· 62 To compile this driver as a module, choose M here: the 63 module will be called airprime. 64 65 config USB_SERIAL_ARK3116 66 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" 67 depends on USB_SERIAL && EXPERIMENTAL ··· 502 module will be called keyspan_pda. 503 504 config USB_SERIAL_OPTION 505 + tristate "USB driver for GSM and CDMA modems" 506 depends on USB_SERIAL 507 help 508 + Say Y here if you have a GSM or CDMA modem that's connected to USB. 509 510 + This driver also supports several PCMCIA cards which have a 511 + built-in OHCI-USB adapter and an internally-connected GSM modem. 512 + The USB bus on these cards is not accessible externally. 513 + 514 + Supported devices include (some of?) those made by: 515 + Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or 516 + Anydata. 517 518 To compile this driver as a module, choose M here: the 519 module will be called option.
-1
drivers/usb/serial/Makefile
··· 12 usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) 13 14 obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 15 - obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o 16 obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o 17 obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 18 obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
··· 12 usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) 13 14 obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 15 obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o 16 obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 17 obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
-123
drivers/usb/serial/anydata.c
··· 1 - /* 2 - * AnyData CDMA Serial USB driver 3 - * 4 - * Copyright (C) 2005 Greg Kroah-Hartman <gregkh@suse.de> 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License version 8 - * 2 as published by the Free Software Foundation. 9 - */ 10 - 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/tty.h> 14 - #include <linux/module.h> 15 - #include <linux/usb.h> 16 - #include <linux/usb/serial.h> 17 - 18 - static struct usb_device_id id_table [] = { 19 - { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */ 20 - { }, 21 - }; 22 - MODULE_DEVICE_TABLE(usb, id_table); 23 - 24 - /* if overridden by the user, then use their value for the size of the 25 - * read and write urbs */ 26 - static int buffer_size; 27 - static int debug; 28 - 29 - static struct usb_driver anydata_driver = { 30 - .name = "anydata", 31 - .probe = usb_serial_probe, 32 - .disconnect = usb_serial_disconnect, 33 - .id_table = id_table, 34 - .no_dynamic_id = 1, 35 - }; 36 - 37 - static int anydata_open(struct usb_serial_port *port, struct file *filp) 38 - { 39 - char *buffer; 40 - int result = 0; 41 - 42 - dbg("%s - port %d", __FUNCTION__, port->number); 43 - 44 - if (buffer_size) { 45 - /* override the default buffer sizes */ 46 - buffer = kmalloc(buffer_size, GFP_KERNEL); 47 - if (!buffer) { 48 - dev_err(&port->dev, "%s - out of memory.\n", 49 - __FUNCTION__); 50 - return -ENOMEM; 51 - } 52 - kfree (port->read_urb->transfer_buffer); 53 - port->read_urb->transfer_buffer = buffer; 54 - port->read_urb->transfer_buffer_length = buffer_size; 55 - 56 - buffer = kmalloc(buffer_size, GFP_KERNEL); 57 - if (!buffer) { 58 - dev_err(&port->dev, "%s - out of memory.\n", 59 - __FUNCTION__); 60 - return -ENOMEM; 61 - } 62 - kfree (port->write_urb->transfer_buffer); 63 - port->write_urb->transfer_buffer = buffer; 64 - port->write_urb->transfer_buffer_length = buffer_size; 65 - port->bulk_out_size = buffer_size; 66 - } 67 - 68 - /* Start reading from the device */ 69 - usb_fill_bulk_urb(port->read_urb, port->serial->dev, 70 - usb_rcvbulkpipe(port->serial->dev, 71 - port->bulk_in_endpointAddress), 72 - port->read_urb->transfer_buffer, 73 - port->read_urb->transfer_buffer_length, 74 - usb_serial_generic_read_bulk_callback, port); 75 - result = usb_submit_urb(port->read_urb, GFP_KERNEL); 76 - if (result) 77 - dev_err(&port->dev, 78 - "%s - failed submitting read urb, error %d\n", 79 - __FUNCTION__, result); 80 - 81 - return result; 82 - } 83 - 84 - static struct usb_serial_driver anydata_device = { 85 - .driver = { 86 - .owner = THIS_MODULE, 87 - .name = "anydata", 88 - }, 89 - .id_table = id_table, 90 - .num_interrupt_in = NUM_DONT_CARE, 91 - .num_bulk_in = NUM_DONT_CARE, 92 - .num_bulk_out = NUM_DONT_CARE, 93 - .num_ports = 1, 94 - .open = anydata_open, 95 - }; 96 - 97 - static int __init anydata_init(void) 98 - { 99 - int retval; 100 - 101 - retval = usb_serial_register(&anydata_device); 102 - if (retval) 103 - return retval; 104 - retval = usb_register(&anydata_driver); 105 - if (retval) 106 - usb_serial_deregister(&anydata_device); 107 - return retval; 108 - } 109 - 110 - static void __exit anydata_exit(void) 111 - { 112 - usb_deregister(&anydata_driver); 113 - usb_serial_deregister(&anydata_device); 114 - } 115 - 116 - module_init(anydata_init); 117 - module_exit(anydata_exit); 118 - MODULE_LICENSE("GPL"); 119 - 120 - module_param(debug, bool, S_IRUGO | S_IWUSR); 121 - MODULE_PARM_DESC(debug, "Debug enabled or not"); 122 - module_param(buffer_size, int, 0); 123 - MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");
···
+1
drivers/usb/serial/ftdi_sio.c
··· 337 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 338 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 339 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 340 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 341 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 342 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) },
··· 337 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 338 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 339 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 340 + { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 341 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 342 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 343 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) },
+4
drivers/usb/serial/ftdi_sio.h
··· 182 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ 183 #define FTDI_USB_UIRT_PID 0xF850 /* Product Id */ 184 185 /* 186 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). 187 * All of these devices use FTDI's vendor ID (0x0403).
··· 182 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ 183 #define FTDI_USB_UIRT_PID 0xF850 /* Product Id */ 184 185 + /* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */ 186 + 187 + #define FTDI_TNC_X_PID 0xEBE0 188 + 189 /* 190 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). 191 * All of these devices use FTDI's vendor ID (0x0403).
+1
drivers/usb/serial/ipaq.c
··· 250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 253 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */ 254 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */ 255 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
··· 250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 253 + { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */ 254 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */ 255 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */ 256 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
+7 -69
drivers/usb/serial/option.c
··· 9 10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> 11 12 - History: 13 - 14 - 2005-05-19 v0.1 Initial version, based on incomplete docs 15 - and analysis of misbehavior with the standard driver 16 - 2005-05-20 v0.2 Extended the input buffer to avoid losing 17 - random 64-byte chunks of data 18 - 2005-05-21 v0.3 implemented chars_in_buffer() 19 - turned on low_latency 20 - simplified the code somewhat 21 - 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load 22 - removed some dead code 23 - added sponsor notice 24 - coding style clean-up 25 - 2005-06-20 v0.4.1 add missing braces :-/ 26 - killed end-of-line whitespace 27 - 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2 28 - 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard 29 - 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes 30 - wants to send >2000 bytes. 31 - 2006-04-10 v0.5 fixed two array overrun errors :-/ 32 - 2006-04-21 v0.5.1 added support for Sierra Wireless MC8755 33 - 2006-05-15 v0.6 re-enable multi-port support 34 - 2006-06-01 v0.6.1 add COBRA 35 - 2006-06-01 v0.6.2 add backwards-compatibility stuff 36 - 2006-06-01 v0.6.3 add Novatel Wireless 37 - 2006-06-01 v0.7 Option => GSM 38 - 2006-06-01 v0.7.1 add COBRA2 39 40 Work sponsored by: Sigos GmbH, Germany <info@sigos.de> 41 42 This driver exists because the "normal" serial driver doesn't work too well 43 with GSM modems. Issues: 44 - data loss -- one single Receive URB is not nearly enough 45 - - nonstandard flow (Option devices) and multiplex (Sierra) control 46 - controlling the baud rate doesn't make sense 47 48 This driver is named "option" because the most common device it's ··· 70 #define OPTION_VENDOR_ID 0x0AF0 71 #define HUAWEI_VENDOR_ID 0x12D1 72 #define AUDIOVOX_VENDOR_ID 0x0F3D 73 - #define SIERRAWIRELESS_VENDOR_ID 0x1199 74 #define NOVATELWIRELESS_VENDOR_ID 0x1410 75 76 #define OPTION_PRODUCT_OLD 0x5000 77 #define OPTION_PRODUCT_FUSION 0x6000 ··· 80 #define OPTION_PRODUCT_COBRA2 0x6600 81 #define HUAWEI_PRODUCT_E600 0x1001 82 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 83 - #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 84 #define NOVATELWIRELESS_PRODUCT_U740 0x1400 85 86 static struct usb_device_id option_ids[] = { 87 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, ··· 91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 92 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 93 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 94 - { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, 95 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 96 { } /* Terminating entry */ 97 }; 98 ··· 105 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 106 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 107 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 108 - { } /* Terminating entry */ 109 - }; 110 - static struct usb_device_id option_ids3[] = { 111 - { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, 112 { } /* Terminating entry */ 113 }; 114 ··· 122 /* The card has three separate interfaces, which the serial driver 123 * recognizes separately, thus num_port=1. 124 */ 125 - static struct usb_serial_driver option_3port_device = { 126 - .driver = { 127 - .owner = THIS_MODULE, 128 - .name = "option", 129 - }, 130 - .description = "GSM modem (3-port)", 131 - .id_table = option_ids3, 132 - .num_interrupt_in = NUM_DONT_CARE, 133 - .num_bulk_in = NUM_DONT_CARE, 134 - .num_bulk_out = NUM_DONT_CARE, 135 - .num_ports = 3, 136 - .open = option_open, 137 - .close = option_close, 138 - .write = option_write, 139 - .write_room = option_write_room, 140 - .chars_in_buffer = option_chars_in_buffer, 141 - .throttle = option_rx_throttle, 142 - .unthrottle = option_rx_unthrottle, 143 - .set_termios = option_set_termios, 144 - .break_ctl = option_break_ctl, 145 - .tiocmget = option_tiocmget, 146 - .tiocmset = option_tiocmset, 147 - .attach = option_startup, 148 - .shutdown = option_shutdown, 149 - .read_int_callback = option_instat_callback, 150 - }; 151 152 static struct usb_serial_driver option_1port_device = { 153 .driver = { 154 .owner = THIS_MODULE, 155 - .name = "option", 156 }, 157 .description = "GSM modem (1-port)", 158 .id_table = option_ids1, ··· 190 retval = usb_serial_register(&option_1port_device); 191 if (retval) 192 goto failed_1port_device_register; 193 - retval = usb_serial_register(&option_3port_device); 194 - if (retval) 195 - goto failed_3port_device_register; 196 retval = usb_register(&option_driver); 197 if (retval) 198 goto failed_driver_register; ··· 199 return 0; 200 201 failed_driver_register: 202 - usb_serial_deregister (&option_3port_device); 203 - failed_3port_device_register: 204 usb_serial_deregister (&option_1port_device); 205 failed_1port_device_register: 206 return retval; ··· 207 static void __exit option_exit(void) 208 { 209 usb_deregister (&option_driver); 210 - usb_serial_deregister (&option_3port_device); 211 usb_serial_deregister (&option_1port_device); 212 } 213 ··· 594 struct option_port_private *portdata; 595 596 dbg("%s", __FUNCTION__); 597 - 598 599 for (i = 0; i < serial->num_ports; i++) { 600 port = serial->port[i];
··· 9 10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> 11 12 + History: see the git log. 13 14 Work sponsored by: Sigos GmbH, Germany <info@sigos.de> 15 16 This driver exists because the "normal" serial driver doesn't work too well 17 with GSM modems. Issues: 18 - data loss -- one single Receive URB is not nearly enough 19 + - nonstandard flow (Option devices) control 20 - controlling the baud rate doesn't make sense 21 22 This driver is named "option" because the most common device it's ··· 96 #define OPTION_VENDOR_ID 0x0AF0 97 #define HUAWEI_VENDOR_ID 0x12D1 98 #define AUDIOVOX_VENDOR_ID 0x0F3D 99 #define NOVATELWIRELESS_VENDOR_ID 0x1410 100 + #define ANYDATA_VENDOR_ID 0x16d5 101 102 #define OPTION_PRODUCT_OLD 0x5000 103 #define OPTION_PRODUCT_FUSION 0x6000 ··· 106 #define OPTION_PRODUCT_COBRA2 0x6600 107 #define HUAWEI_PRODUCT_E600 0x1001 108 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 109 #define NOVATELWIRELESS_PRODUCT_U740 0x1400 110 + #define ANYDATA_PRODUCT_ID 0x6501 111 112 static struct usb_device_id option_ids[] = { 113 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, ··· 117 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 118 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 119 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 120 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 121 + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 122 { } /* Terminating entry */ 123 }; 124 ··· 131 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 132 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 133 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 134 + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 135 { } /* Terminating entry */ 136 }; 137 ··· 151 /* The card has three separate interfaces, which the serial driver 152 * recognizes separately, thus num_port=1. 153 */ 154 155 static struct usb_serial_driver option_1port_device = { 156 .driver = { 157 .owner = THIS_MODULE, 158 + .name = "option1", 159 }, 160 .description = "GSM modem (1-port)", 161 .id_table = option_ids1, ··· 245 retval = usb_serial_register(&option_1port_device); 246 if (retval) 247 goto failed_1port_device_register; 248 retval = usb_register(&option_driver); 249 if (retval) 250 goto failed_driver_register; ··· 257 return 0; 258 259 failed_driver_register: 260 usb_serial_deregister (&option_1port_device); 261 failed_1port_device_register: 262 return retval; ··· 267 static void __exit option_exit(void) 268 { 269 usb_deregister (&option_driver); 270 usb_serial_deregister (&option_1port_device); 271 } 272 ··· 655 struct option_port_private *portdata; 656 657 dbg("%s", __FUNCTION__); 658 659 for (i = 0; i < serial->num_ports; i++) { 660 port = serial->port[i];
+1
drivers/usb/serial/pl2303.c
··· 81 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, 82 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, 83 { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, 84 { } /* Terminating entry */ 85 }; 86
··· 81 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, 82 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, 83 { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, 84 + { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) }, 85 { } /* Terminating entry */ 86 }; 87
+4
drivers/usb/serial/pl2303.h
··· 89 /* DATAPILOT Universal-2 Phone Cable */ 90 #define DATAPILOT_U2_VENDOR_ID 0x0731 91 #define DATAPILOT_U2_PRODUCT_ID 0x2003
··· 89 /* DATAPILOT Universal-2 Phone Cable */ 90 #define DATAPILOT_U2_VENDOR_ID 0x0731 91 #define DATAPILOT_U2_PRODUCT_ID 0x2003 92 + 93 + /* Belkin "F5U257" Serial Adapter */ 94 + #define BELKIN_VENDOR_ID 0x050d 95 + #define BELKIN_PRODUCT_ID 0x0257
+16 -13
drivers/usb/storage/unusual_devs.h
··· 145 US_SC_DEVICE, US_PR_DEVICE, NULL, 146 US_FL_IGNORE_RESIDUE ), 147 148 /* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and 149 * Einar Th. Einarsson <einarthered@gmail.com> */ 150 UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100, ··· 634 "Digital Camera EX-20 DSC", 635 US_SC_8070, US_PR_DEVICE, NULL, 0 ), 636 637 - /* The entry was here before I took over, and had US_SC_RBC. It turns 638 - * out that isn't needed. Additionally, Torsten Eriksson 639 - * <Torsten.Eriksson@bergianska.se> is able to use his device fine 640 - * without this entry at all - but I don't suspect that will be true 641 - * for all users (the protocol is likely needed), so is staying at 642 - * this time. - Phil Dibowitz <phil@ipom.com> 643 - */ 644 - UNUSUAL_DEV( 0x059f, 0xa601, 0x0200, 0x0200, 645 - "LaCie", 646 - "USB Hard Disk", 647 - US_SC_DEVICE, US_PR_CB, NULL, 0 ), 648 - 649 /* Submitted by Joel Bourquard <numlock@freesurf.ch> 650 * Some versions of this device need the SubClass and Protocol overrides 651 * while others don't. ··· 1101 "Optio S/S4", 1102 US_SC_DEVICE, US_PR_DEVICE, NULL, 1103 US_FL_FIX_INQUIRY ), 1104 - 1105 #ifdef CONFIG_USB_STORAGE_ISD200 1106 UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1107 "ATI",
··· 145 US_SC_DEVICE, US_PR_DEVICE, NULL, 146 US_FL_IGNORE_RESIDUE ), 147 148 + /* Reported by Mario Rettig <mariorettig@web.de> */ 149 + UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, 150 + "Nokia", 151 + "Nokia 3250", 152 + US_SC_DEVICE, US_PR_DEVICE, NULL, 153 + US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), 154 + 155 /* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and 156 * Einar Th. Einarsson <einarthered@gmail.com> */ 157 UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100, ··· 627 "Digital Camera EX-20 DSC", 628 US_SC_8070, US_PR_DEVICE, NULL, 0 ), 629 630 /* Submitted by Joel Bourquard <numlock@freesurf.ch> 631 * Some versions of this device need the SubClass and Protocol overrides 632 * while others don't. ··· 1106 "Optio S/S4", 1107 US_SC_DEVICE, US_PR_DEVICE, NULL, 1108 US_FL_FIX_INQUIRY ), 1109 + 1110 + /* This is a virtual windows driver CD, which the zd1211rw driver automatically 1111 + * converts into a WLAN device. */ 1112 + UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, 1113 + "ZyXEL", 1114 + "G-220F USB-WLAN Install", 1115 + US_SC_DEVICE, US_PR_DEVICE, NULL, 1116 + US_FL_IGNORE_DEVICE ), 1117 + 1118 #ifdef CONFIG_USB_STORAGE_ISD200 1119 UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1120 "ATI",
+11 -2
drivers/usb/storage/usb.c
··· 483 } 484 485 /* Get the unusual_devs entries and the string descriptors */ 486 - static void get_device_info(struct us_data *us, const struct usb_device_id *id) 487 { 488 struct usb_device *dev = us->pusb_dev; 489 struct usb_interface_descriptor *idesc = ··· 499 idesc->bInterfaceProtocol : 500 unusual_dev->useTransport; 501 us->flags = USB_US_ORIG_FLAGS(id->driver_info); 502 503 /* 504 * This flag is only needed when we're in high-speed, so let's ··· 546 msgs[msg], 547 UTS_RELEASE); 548 } 549 } 550 551 /* Get the transport settings */ ··· 976 * of the match from the usb_device_id table, so we can find the 977 * corresponding entry in the private table. 978 */ 979 - get_device_info(us, id); 980 981 /* Get the transport, protocol, and pipe settings */ 982 result = get_transport(us);
··· 483 } 484 485 /* Get the unusual_devs entries and the string descriptors */ 486 + static int get_device_info(struct us_data *us, const struct usb_device_id *id) 487 { 488 struct usb_device *dev = us->pusb_dev; 489 struct usb_interface_descriptor *idesc = ··· 499 idesc->bInterfaceProtocol : 500 unusual_dev->useTransport; 501 us->flags = USB_US_ORIG_FLAGS(id->driver_info); 502 + 503 + if (us->flags & US_FL_IGNORE_DEVICE) { 504 + printk(KERN_INFO USB_STORAGE "device ignored\n"); 505 + return -ENODEV; 506 + } 507 508 /* 509 * This flag is only needed when we're in high-speed, so let's ··· 541 msgs[msg], 542 UTS_RELEASE); 543 } 544 + 545 + return 0; 546 } 547 548 /* Get the transport settings */ ··· 969 * of the match from the usb_device_id table, so we can find the 970 * corresponding entry in the private table. 971 */ 972 + result = get_device_info(us, id); 973 + if (result) 974 + goto BadDevice; 975 976 /* Get the transport, protocol, and pipe settings */ 977 result = get_transport(us);
+3 -4
include/linux/usb.h
··· 103 * @condition: binding state of the interface: not bound, binding 104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 105 * @dev: driver model's view of this device 106 - * @usb_dev: if an interface is bound to the USB major, this will point 107 - * to the sysfs representation for that device. 108 * 109 * USB device drivers attach to interfaces on a physical device. Each 110 * interface encapsulates a single high level function, such as feeding ··· 143 * bound to */ 144 enum usb_interface_condition condition; /* state of binding */ 145 struct device dev; /* interface specific device info */ 146 - struct device *usb_dev; /* pointer to the usb class's device, if any */ 147 }; 148 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149 #define interface_to_usbdev(intf) \ ··· 360 char *serial; /* iSerialNumber string, if present */ 361 362 struct list_head filelist; 363 - struct device *usbfs_dev; 364 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 366 /*
··· 103 * @condition: binding state of the interface: not bound, binding 104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 105 * @dev: driver model's view of this device 106 + * @class_dev: driver model's class view of this device. 107 * 108 * USB device drivers attach to interfaces on a physical device. Each 109 * interface encapsulates a single high level function, such as feeding ··· 144 * bound to */ 145 enum usb_interface_condition condition; /* state of binding */ 146 struct device dev; /* interface specific device info */ 147 + struct class_device *class_dev; 148 }; 149 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 150 #define interface_to_usbdev(intf) \ ··· 361 char *serial; /* iSerialNumber string, if present */ 362 363 struct list_head filelist; 364 + struct class_device *class_dev; 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 366 367 /*
+3 -1
include/linux/usb_usual.h
··· 44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 45 /* Don't check for write-protect */ \ 46 US_FLAG(MAX_SECTORS_64, 0x00000400) \ 47 - /* Sets max_sectors to 64 */ 48 49 #define US_FLAG(name, value) US_FL_##name = value , 50 enum { US_DO_ALL_FLAGS };
··· 44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 45 /* Don't check for write-protect */ \ 46 US_FLAG(MAX_SECTORS_64, 0x00000400) \ 47 + /* Sets max_sectors to 64 */ \ 48 + US_FLAG(IGNORE_DEVICE, 0x00000800) \ 49 + /* Don't claim device */ 50 51 #define US_FLAG(name, value) US_FL_##name = value , 52 enum { US_DO_ALL_FLAGS };