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 59 would issue more ioctls to the device to communicate to it using 60 60 control, bulk, or other kinds of USB transfers. The IOCTLs are 61 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 62 + source code (linux/drivers/usb/core/devio.c) is the primary reference 63 63 for how to access devices through those files. 64 64 65 65 Note that since by default these BBB/DDD files are writable only by
+1 -2
Documentation/usb/usb-help.txt
··· 5 5 Documentation/usb/*, see the following: 6 6 7 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/ 8 + mirrors at http://usb.in.tum.de/linux-usb/ 10 9 and http://it.linux-usb.org 11 10 Linux USB Guide: http://linux-usb.sourceforge.net 12 11 Linux-USB device overview (working devices and drivers):
+1 -1
drivers/usb/Kconfig
··· 24 24 default y if ARCH_S3C2410 25 25 default y if PXA27x 26 26 default y if ARCH_EP93XX 27 - default y if ARCH_AT91RM9200 27 + default y if (ARCH_AT91RM9200 || ARCH_AT91SAM9261) 28 28 # PPC: 29 29 default y if STB03xxx 30 30 default y if PPC_MPC52xx
+10 -10
drivers/usb/core/devio.c
··· 517 517 518 518 static struct usb_device *usbdev_lookup_minor(int minor) 519 519 { 520 - struct device *device; 521 - struct usb_device *udev = NULL; 520 + struct class_device *class_dev; 521 + struct usb_device *dev = NULL; 522 522 523 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; 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 527 break; 528 528 } 529 529 } 530 530 up(&usb_device_class->sem); 531 531 532 - return udev; 532 + return dev; 533 533 }; 534 534 535 535 /* ··· 1580 1580 { 1581 1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); 1582 1582 1583 - dev->usbfs_dev = device_create(usb_device_class, &dev->dev, 1584 - MKDEV(USB_DEVICE_MAJOR, minor), 1583 + dev->class_dev = class_device_create(usb_device_class, NULL, 1584 + MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev, 1585 1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum); 1586 1586 1587 - dev->usbfs_dev->platform_data = dev; 1587 + dev->class_dev->class_data = dev; 1588 1588 } 1589 1589 1590 1590 static void usbdev_remove(struct usb_device *dev) 1591 1591 { 1592 - device_unregister(dev->usbfs_dev); 1592 + class_device_unregister(dev->class_dev); 1593 1593 } 1594 1594 1595 1595 static int usbdev_notify(struct notifier_block *self, unsigned long action,
+7 -6
drivers/usb/core/file.c
··· 194 194 ++temp; 195 195 else 196 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)) { 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)) { 200 201 spin_lock (&minor_lock); 201 202 usb_minors[intf->minor] = NULL; 202 203 spin_unlock (&minor_lock); 203 - retval = PTR_ERR(intf->usb_dev); 204 + retval = PTR_ERR(intf->class_dev); 204 205 } 205 206 exit: 206 207 return retval; ··· 242 241 spin_unlock (&minor_lock); 243 242 244 243 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; 244 + class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 245 + intf->class_dev = NULL; 247 246 intf->minor = -1; 248 247 destroy_usb_class(); 249 248 }
+1 -1
drivers/usb/gadget/Kconfig
··· 207 207 208 208 config USB_GADGET_DUMMY_HCD 209 209 boolean "Dummy HCD (DEVELOPMENT)" 210 - depends on USB && EXPERIMENTAL 210 + depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL 211 211 select USB_GADGET_DUALSPEED 212 212 help 213 213 This host controller driver emulates USB, looping all data transfer
+112 -64
drivers/usb/gadget/at91_udc.c
··· 57 57 58 58 /* 59 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. 60 + * full speed USB controllers, including the at91rm9200 (arm920T, with MMU), 61 + * at91sam926x (arm926ejs, with MMU), and several no-mmu versions. 62 62 * 63 63 * This driver expects the board has been wired with two GPIOs suppporting 64 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 65 + * testing hasn't covered such cases.) 66 + * 67 + * The pullup is most important (so it's integrated on sam926x parts). It 66 68 * provides software control over whether the host enumerates the device. 69 + * 67 70 * The VBUS sensing helps during enumeration, and allows both USB clocks 68 71 * (and the transceiver) to stay gated off until they're necessary, saving 69 - * power. During USB suspend, the 48 MHz clock is gated off. 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. 70 74 */ 71 75 72 - #define DRIVER_VERSION "8 March 2005" 76 + #define DRIVER_VERSION "3 May 2006" 73 77 74 78 static const char driver_name [] = "at91_udc"; 75 79 static const char ep0name[] = "ep0"; ··· 320 316 * 321 317 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE 322 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. 323 324 */ 324 325 #define SET_FX (AT91_UDP_TXPKTRDY) 325 - #define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP) 326 + #define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP \ 327 + | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP) 326 328 327 329 /* pull OUT packet data from the endpoint's fifo */ 328 330 static int read_fifo (struct at91_ep *ep, struct at91_request *req) ··· 482 472 483 473 /*-------------------------------------------------------------------------*/ 484 474 485 - static int at91_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) 475 + static int at91_ep_enable(struct usb_ep *_ep, 476 + const struct usb_endpoint_descriptor *desc) 486 477 { 487 478 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); 488 479 struct at91_udc *dev = ep->udc; ··· 593 582 * interesting for request or buffer allocation. 594 583 */ 595 584 596 - static struct usb_request *at91_ep_alloc_request (struct usb_ep *_ep, unsigned int gfp_flags) 585 + static struct usb_request * 586 + at91_ep_alloc_request(struct usb_ep *_ep, unsigned int gfp_flags) 597 587 { 598 588 struct at91_request *req; 599 589 600 - req = kcalloc(1, sizeof (struct at91_request), SLAB_KERNEL); 590 + req = kcalloc(1, sizeof (struct at91_request), gfp_flags); 601 591 if (!req) 602 592 return NULL; 603 593 ··· 874 862 if (udc->gadget.speed == USB_SPEED_UNKNOWN) 875 863 driver = NULL; 876 864 udc->gadget.speed = USB_SPEED_UNKNOWN; 865 + udc->suspended = 0; 877 866 878 867 for (i = 0; i < NUM_ENDPOINTS; i++) { 879 868 struct at91_ep *ep = &udc->ep[i]; ··· 902 889 return; 903 890 udc->clocked = 0; 904 891 udc->gadget.speed = USB_SPEED_UNKNOWN; 905 - clk_disable(udc->iclk); 906 892 clk_disable(udc->fclk); 893 + clk_disable(udc->iclk); 907 894 } 908 895 909 896 /* ··· 924 911 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 925 912 at91_set_gpio_value(udc->board.pullup_pin, 0); 926 913 clk_off(udc); 927 - 928 - // REVISIT: with transceiver disabled, will D- float 929 - // so that a host would falsely detect a device? 930 914 } 931 915 } 932 916 ··· 1300 1290 if (udc->wait_for_addr_ack) { 1301 1291 u32 tmp; 1302 1292 1303 - at91_udp_write(AT91_UDP_FADDR, AT91_UDP_FEN | udc->addr); 1293 + at91_udp_write(AT91_UDP_FADDR, 1294 + AT91_UDP_FEN | udc->addr); 1304 1295 tmp = at91_udp_read(AT91_UDP_GLB_STAT); 1305 1296 tmp &= ~AT91_UDP_FADDEN; 1306 1297 if (udc->addr) ··· 1372 1361 u32 rescans = 5; 1373 1362 1374 1363 while (rescans--) { 1375 - u32 status = at91_udp_read(AT91_UDP_ISR); 1364 + u32 status; 1376 1365 1377 - status &= at91_udp_read(AT91_UDP_IMR); 1366 + status = at91_udp_read(AT91_UDP_ISR) 1367 + & at91_udp_read(AT91_UDP_IMR); 1378 1368 if (!status) 1379 1369 break; 1380 1370 ··· 1391 1379 stop_activity(udc); 1392 1380 1393 1381 /* enable ep0 */ 1394 - at91_udp_write(AT91_UDP_CSR(0), AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL); 1382 + at91_udp_write(AT91_UDP_CSR(0), 1383 + AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL); 1395 1384 udc->gadget.speed = USB_SPEED_FULL; 1396 1385 udc->suspended = 0; 1397 1386 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0)); 1398 1387 1399 1388 /* 1400 1389 * 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... 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. 1406 1393 */ 1407 1394 1408 1395 /* host initiated suspend (3+ms bus idle) */ ··· 1463 1452 1464 1453 /*-------------------------------------------------------------------------*/ 1465 1454 1455 + static void nop_release(struct device *dev) 1456 + { 1457 + /* nothing to free */ 1458 + } 1459 + 1466 1460 static struct at91_udc controller = { 1467 1461 .gadget = { 1468 - .ops = &at91_udc_ops, 1469 - .ep0 = &controller.ep[0].ep, 1470 - .name = driver_name, 1471 - .dev = { 1472 - .bus_id = "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, 1473 1468 } 1474 1469 }, 1475 1470 .ep[0] = { ··· 1485 1468 }, 1486 1469 .udc = &controller, 1487 1470 .maxpacket = 8, 1488 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(0)), 1471 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1472 + + AT91_UDP_CSR(0)), 1489 1473 .int_mask = 1 << 0, 1490 1474 }, 1491 1475 .ep[1] = { ··· 1497 1479 .udc = &controller, 1498 1480 .is_pingpong = 1, 1499 1481 .maxpacket = 64, 1500 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(1)), 1482 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1483 + + AT91_UDP_CSR(1)), 1501 1484 .int_mask = 1 << 1, 1502 1485 }, 1503 1486 .ep[2] = { ··· 1509 1490 .udc = &controller, 1510 1491 .is_pingpong = 1, 1511 1492 .maxpacket = 64, 1512 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(2)), 1493 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1494 + + AT91_UDP_CSR(2)), 1513 1495 .int_mask = 1 << 2, 1514 1496 }, 1515 1497 .ep[3] = { ··· 1521 1501 }, 1522 1502 .udc = &controller, 1523 1503 .maxpacket = 8, 1524 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(3)), 1504 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1505 + + AT91_UDP_CSR(3)), 1525 1506 .int_mask = 1 << 3, 1526 1507 }, 1527 1508 .ep[4] = { ··· 1533 1512 .udc = &controller, 1534 1513 .is_pingpong = 1, 1535 1514 .maxpacket = 256, 1536 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(4)), 1515 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1516 + + AT91_UDP_CSR(4)), 1537 1517 .int_mask = 1 << 4, 1538 1518 }, 1539 1519 .ep[5] = { ··· 1545 1523 .udc = &controller, 1546 1524 .is_pingpong = 1, 1547 1525 .maxpacket = 256, 1548 - .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(5)), 1526 + .creg = (void __iomem *)(AT91_VA_BASE_UDP 1527 + + AT91_UDP_CSR(5)), 1549 1528 .int_mask = 1 << 5, 1550 1529 }, 1551 - /* ep6 and ep7 are also reserved */ 1530 + /* ep6 and ep7 are also reserved (custom silicon might use them) */ 1552 1531 }; 1553 1532 1554 1533 static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r) ··· 1616 1593 1617 1594 local_irq_disable(); 1618 1595 udc->enabled = 0; 1596 + at91_udp_write(AT91_UDP_IDR, ~0); 1619 1597 pullup(udc, 0); 1620 1598 local_irq_enable(); 1621 1599 ··· 1648 1624 return -ENODEV; 1649 1625 } 1650 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 + 1651 1637 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) { 1652 1638 DBG("someone's using UDC memory\n"); 1653 1639 return -EBUSY; ··· 1683 1649 if (retval < 0) 1684 1650 goto fail0; 1685 1651 1686 - /* disable everything until there's a gadget driver and vbus */ 1687 - pullup(udc, 0); 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); 1688 1657 1689 1658 /* 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); 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); 1692 1663 retval = -EBUSY; 1693 1664 goto fail1; 1694 1665 } 1695 1666 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); 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); 1699 1672 retval = -EBUSY; 1700 1673 goto fail1; 1701 1674 } ··· 1711 1670 udc->vbus = 1; 1712 1671 } 1713 1672 dev_set_drvdata(dev, udc); 1673 + device_init_wakeup(dev, 1); 1714 1674 create_debug_file(udc); 1715 1675 1716 1676 INFO("%s version %s\n", driver_name, DRIVER_VERSION); ··· 1720 1678 fail1: 1721 1679 device_unregister(&udc->gadget.dev); 1722 1680 fail0: 1723 - release_mem_region(AT91_VA_BASE_UDP, SZ_16K); 1681 + release_mem_region(AT91_BASE_UDP, SZ_16K); 1724 1682 DBG("%s probe failed, %d\n", driver_name, retval); 1725 1683 return retval; 1726 1684 } 1727 1685 1728 - static int __devexit at91udc_remove(struct platform_device *dev) 1686 + static int __devexit at91udc_remove(struct platform_device *pdev) 1729 1687 { 1730 - struct at91_udc *udc = platform_get_drvdata(dev); 1688 + struct at91_udc *udc = platform_get_drvdata(pdev); 1731 1689 1732 1690 DBG("remove\n"); 1733 1691 ··· 1736 1694 if (udc->driver != 0) 1737 1695 usb_gadget_unregister_driver(udc->driver); 1738 1696 1697 + device_init_wakeup(&pdev->dev, 0); 1739 1698 remove_debug_file(udc); 1740 1699 if (udc->board.vbus_pin > 0) 1741 1700 free_irq(udc->board.vbus_pin, udc); 1742 - free_irq(AT91_ID_UDP, udc); 1701 + free_irq(udc->udp_irq, udc); 1743 1702 device_unregister(&udc->gadget.dev); 1744 1703 release_mem_region(AT91_BASE_UDP, SZ_16K); 1745 1704 ··· 1751 1708 } 1752 1709 1753 1710 #ifdef CONFIG_PM 1754 - static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg) 1711 + static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) 1755 1712 { 1756 - struct at91_udc *udc = platform_get_drvdata(dev); 1713 + struct at91_udc *udc = platform_get_drvdata(pdev); 1714 + int wake = udc->driver && device_may_wakeup(&pdev->dev); 1757 1715 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. 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). 1770 1720 */ 1771 - if (udc->vbus && !udc->suspended) 1721 + if ((!udc->suspended && udc->addr) 1722 + || !wake 1723 + || at91_suspend_entering_slow_clock()) { 1772 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 + } 1773 1735 return 0; 1774 1736 } 1775 1737 1776 - static int at91udc_resume(struct platform_device *dev) 1738 + static int at91udc_resume(struct platform_device *pdev) 1777 1739 { 1778 - struct at91_udc *udc = platform_get_drvdata(dev); 1740 + struct at91_udc *udc = platform_get_drvdata(pdev); 1779 1741 1780 1742 /* maybe reconnect to host; if so, clocks on */ 1781 1743 pullup(udc, 1); ··· 1796 1748 .remove = __devexit_p(at91udc_remove), 1797 1749 .shutdown = at91udc_shutdown, 1798 1750 .suspend = at91udc_suspend, 1799 - .resume = at91udc_resume, 1751 + .resume = at91udc_resume, 1800 1752 .driver = { 1801 1753 .name = (char *) driver_name, 1802 1754 .owner = THIS_MODULE, ··· 1815 1767 } 1816 1768 module_exit(udc_exit_module); 1817 1769 1818 - MODULE_DESCRIPTION("AT91RM9200 udc driver"); 1770 + MODULE_DESCRIPTION("AT91 udc driver"); 1819 1771 MODULE_AUTHOR("Thomas Rathbone, David Brownell"); 1820 1772 MODULE_LICENSE("GPL");
+1
drivers/usb/gadget/at91_udc.h
··· 141 141 struct clk *iclk, *fclk; 142 142 struct platform_device *pdev; 143 143 struct proc_dir_entry *pde; 144 + int udp_irq; 144 145 }; 145 146 146 147 static inline struct at91_udc *to_udc(struct usb_gadget *g)
+4 -2
drivers/usb/gadget/dummy_hcd.c
··· 609 609 if (!dum->driver) 610 610 return -ESHUTDOWN; 611 611 612 - spin_lock_irqsave (&dum->lock, flags); 612 + local_irq_save (flags); 613 + spin_lock (&dum->lock); 613 614 list_for_each_entry (req, &ep->queue, queue) { 614 615 if (&req->req == _req) { 615 616 list_del_init (&req->queue); ··· 619 618 break; 620 619 } 621 620 } 622 - spin_unlock_irqrestore (&dum->lock, flags); 621 + spin_unlock (&dum->lock); 623 622 624 623 if (retval == 0) { 625 624 dev_dbg (udc_dev(dum), ··· 627 626 req, _ep->name, _req->length, _req->buf); 628 627 _req->complete (_ep, _req); 629 628 } 629 + local_irq_restore (flags); 630 630 return retval; 631 631 } 632 632
+1 -1
drivers/usb/host/ehci-hcd.c
··· 892 892 #define PCI_DRIVER ehci_pci_driver 893 893 #endif 894 894 895 - #ifdef CONFIG_PPC_83xx 895 + #ifdef CONFIG_MPC834x 896 896 #include "ehci-fsl.c" 897 897 #define PLATFORM_DRIVER ehci_fsl_driver 898 898 #endif
+59 -29
drivers/usb/host/ohci-at91.c
··· 4 4 * Copyright (C) 2004 SAN People (Pty) Ltd. 5 5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> 6 6 * 7 - * AT91RM9200 Bus Glue 7 + * AT91 Bus Glue 8 8 * 9 9 * Based on fragments of 2.4 driver by Rick Bronson. 10 10 * Based on ohci-omap.c ··· 19 19 #include <asm/hardware.h> 20 20 #include <asm/arch/board.h> 21 21 22 - #ifndef CONFIG_ARCH_AT91RM9200 23 - #error "CONFIG_ARCH_AT91RM9200 must be defined." 22 + #ifndef CONFIG_ARCH_AT91 23 + #error "CONFIG_ARCH_AT91 must be defined." 24 24 #endif 25 25 26 26 /* interface and function clocks */ 27 27 static struct clk *iclk, *fclk; 28 + static int clocked; 28 29 29 30 extern int usb_disabled(void); 30 31 ··· 36 35 struct usb_hcd *hcd = platform_get_drvdata(pdev); 37 36 struct ohci_regs __iomem *regs = hcd->regs; 38 37 39 - dev_dbg(&pdev->dev, "starting AT91RM9200 OHCI USB Controller\n"); 38 + dev_dbg(&pdev->dev, "start\n"); 40 39 41 40 /* 42 41 * Start the USB clocks. 43 42 */ 44 43 clk_enable(iclk); 45 44 clk_enable(fclk); 45 + clocked = 1; 46 46 47 47 /* 48 48 * The USB host controller must remain in reset. ··· 56 54 struct usb_hcd *hcd = platform_get_drvdata(pdev); 57 55 struct ohci_regs __iomem *regs = hcd->regs; 58 56 59 - dev_dbg(&pdev->dev, "stopping AT91RM9200 OHCI USB Controller\n"); 57 + dev_dbg(&pdev->dev, "stop\n"); 60 58 61 59 /* 62 60 * Put the USB host controller into reset. ··· 68 66 */ 69 67 clk_disable(fclk); 70 68 clk_disable(iclk); 69 + clocked = 0; 71 70 } 72 71 73 72 ··· 81 78 82 79 83 80 /** 84 - * usb_hcd_at91_probe - initialize AT91RM9200-based HCDs 81 + * usb_hcd_at91_probe - initialize AT91-based HCDs 85 82 * Context: !in_interrupt() 86 83 * 87 84 * Allocates basic resources for this USB host controller, and 88 85 * then invokes the start() method for the HCD associated with it 89 86 * through the hotplug entry's driver_data. 90 87 */ 91 - int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) 88 + static int usb_hcd_at91_probe(const struct hc_driver *driver, 89 + struct platform_device *pdev) 92 90 { 93 91 int retval; 94 92 struct usb_hcd *hcd = NULL; ··· 99 95 return -ENODEV; 100 96 } 101 97 102 - if ((pdev->resource[0].flags != IORESOURCE_MEM) || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 98 + if ((pdev->resource[0].flags != IORESOURCE_MEM) 99 + || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 103 100 pr_debug("hcd probe: invalid resource type\n"); 104 101 return -ENODEV; 105 102 } 106 103 107 - hcd = usb_create_hcd(driver, &pdev->dev, "at91rm9200"); 104 + hcd = usb_create_hcd(driver, &pdev->dev, "at91"); 108 105 if (!hcd) 109 106 return -ENOMEM; 110 107 hcd->rsrc_start = pdev->resource[0].start; ··· 154 149 /* may be called with controller, bus, and devices active */ 155 150 156 151 /** 157 - * usb_hcd_at91_remove - shutdown processing for AT91RM9200-based HCDs 152 + * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs 158 153 * @dev: USB Host Controller being removed 159 154 * Context: !in_interrupt() 160 155 * 161 156 * Reverses the effect of usb_hcd_at91_probe(), first invoking 162 157 * the HCD's stop() method. It is always called from a thread 163 - * context, normally "rmmod", "apmd", or something similar. 158 + * context, "rmmod" or something similar. 164 159 * 165 160 */ 166 - static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pdev) 161 + static int usb_hcd_at91_remove(struct usb_hcd *hcd, 162 + struct platform_device *pdev) 167 163 { 168 164 usb_remove_hcd(hcd); 169 165 at91_stop_hc(pdev); 170 166 iounmap(hcd->regs); 171 167 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 168 + disable_irq_wake(hcd->irq); 172 169 173 170 clk_put(fclk); 174 171 clk_put(iclk); ··· 185 178 static int __devinit 186 179 ohci_at91_start (struct usb_hcd *hcd) 187 180 { 188 - // struct at91_ohci_data *board = hcd->self.controller->platform_data; 181 + struct at91_usbh_data *board = hcd->self.controller->platform_data; 189 182 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 183 + struct usb_device *root = hcd->self.root_hub; 190 184 int ret; 191 185 192 186 if ((ret = ohci_init(ohci)) < 0) 193 187 return ret; 188 + 189 + root->maxchild = board->ports; 194 190 195 191 if ((ret = ohci_run(ohci)) < 0) { 196 192 err("can't start %s", hcd->self.bus_name); 197 193 ohci_stop(hcd); 198 194 return ret; 199 195 } 200 - // hcd->self.root_hub->maxchild = board->ports; 201 196 return 0; 202 197 } 203 198 ··· 207 198 208 199 static const struct hc_driver ohci_at91_hc_driver = { 209 200 .description = hcd_name, 210 - .product_desc = "AT91RM9200 OHCI", 201 + .product_desc = "AT91 OHCI", 211 202 .hcd_priv_size = sizeof(struct ohci_hcd), 212 203 213 204 /* ··· 249 240 250 241 /*-------------------------------------------------------------------------*/ 251 242 252 - static int ohci_hcd_at91_drv_probe(struct platform_device *dev) 243 + static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) 253 244 { 254 - return usb_hcd_at91_probe(&ohci_at91_hc_driver, dev); 245 + device_init_wakeup(&pdev->dev, 1); 246 + return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); 255 247 } 256 248 257 - static int ohci_hcd_at91_drv_remove(struct platform_device *dev) 249 + static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) 258 250 { 259 - return usb_hcd_at91_remove(platform_get_drvdata(dev), dev); 251 + device_init_wakeup(&pdev->dev, 0); 252 + return usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev); 260 253 } 261 254 262 255 #ifdef CONFIG_PM 263 256 264 - /* REVISIT suspend/resume look "too" simple here */ 265 - 266 257 static int 267 - ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg) 258 + ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) 268 259 { 269 - clk_disable(fclk); 270 - clk_disable(iclk); 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 + } 271 281 272 282 return 0; 273 283 } 274 284 275 - static int ohci_hcd_at91_drv_resume(struct platform_device *dev) 285 + static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) 276 286 { 277 - clk_enable(iclk); 278 - clk_enable(fclk); 287 + if (!clocked) { 288 + clk_enable(iclk); 289 + clk_enable(fclk); 290 + } 279 291 280 292 return 0; 281 293 } ··· 305 275 #define ohci_hcd_at91_drv_resume NULL 306 276 #endif 307 277 308 - MODULE_ALIAS("at91rm9200-ohci"); 278 + MODULE_ALIAS("at91_ohci"); 309 279 310 280 static struct platform_driver ohci_hcd_at91_driver = { 311 281 .probe = ohci_hcd_at91_drv_probe, ··· 313 283 .suspend = ohci_hcd_at91_drv_suspend, 314 284 .resume = ohci_hcd_at91_drv_resume, 315 285 .driver = { 316 - .name = "at91rm9200-ohci", 286 + .name = "at91_ohci", 317 287 .owner = THIS_MODULE, 318 288 }, 319 289 };
+2 -1
drivers/usb/host/ohci-hcd.c
··· 913 913 #include "ohci-ppc-soc.c" 914 914 #endif 915 915 916 - #ifdef CONFIG_ARCH_AT91RM9200 916 + #if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261) 917 917 #include "ohci-at91.c" 918 918 #endif 919 919 ··· 927 927 || defined (CONFIG_SOC_AU1X00) \ 928 928 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ 929 929 || defined (CONFIG_ARCH_AT91RM9200) \ 930 + || defined (CONFIG_ARCH_AT91SAM9261) \ 930 931 ) 931 932 #error "missing bus glue for ohci-hcd" 932 933 #endif
+3 -1
drivers/usb/host/uhci-q.c
··· 943 943 /* We received a short packet */ 944 944 if (urb->transfer_flags & URB_SHORT_NOT_OK) 945 945 ret = -EREMOTEIO; 946 - else if (ctrlstat & TD_CTRL_SPD) 946 + 947 + /* Fixup needed only if this isn't the URB's last TD */ 948 + else if (&td->list != urbp->td_list.prev) 947 949 ret = 1; 948 950 } 949 951
+2 -3
drivers/usb/input/ati_remote.c
··· 152 152 * events. The hardware generates 5 events for the first keypress 153 153 * and we have to take this into account for an accurate repeat 154 154 * behaviour. 155 - * (HZ / 20) == 50 ms and works well for me. 156 155 */ 157 - #define FILTER_TIME (HZ / 20) 156 + #define FILTER_TIME 60 /* msec */ 158 157 159 158 struct ati_remote { 160 159 struct input_dev *idev; ··· 466 467 /* Filter duplicate events which happen "too close" together. */ 467 468 if ((ati_remote->old_data[0] == data[1]) && 468 469 (ati_remote->old_data[1] == data[2]) && 469 - time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) { 470 + time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(FILTER_TIME))) { 470 471 ati_remote->repeat_count++; 471 472 } else { 472 473 ati_remote->repeat_count = 0;
+7 -2
drivers/usb/misc/cypress_cy7c63.c
··· 12 12 * the single I/O ports of the device. 13 13 * 14 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...) 15 + * (Firmware "Port-Chip") 16 + * 17 + * Supported devices: CY7C63001A-PC 18 + * CY7C63001C-PXC 19 + * CY7C63001C-SXC 20 + * 21 + * Supported functions: Read/Write Ports 17 22 * 18 23 * 19 24 * This program is free software; you can redistribute it and/or
+71 -12
drivers/usb/net/rtl8150.c
··· 175 175 static void rtl8150_disconnect(struct usb_interface *intf); 176 176 static int rtl8150_probe(struct usb_interface *intf, 177 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); 178 180 179 181 static const char driver_name [] = "rtl8150"; 180 182 ··· 185 183 .probe = rtl8150_probe, 186 184 .disconnect = rtl8150_disconnect, 187 185 .id_table = rtl8150_table, 186 + .suspend = rtl8150_suspend, 187 + .resume = rtl8150_resume 188 188 }; 189 189 190 190 /* ··· 242 238 usb_fill_control_urb(dev->ctrl_urb, dev->udev, 243 239 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 244 240 &dev->rx_creg, size, ctrl_callback, dev); 245 - if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) 241 + if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) { 242 + if (ret == -ENODEV) 243 + netif_device_detach(dev->netdev); 246 244 err("control request submission failed: %d", ret); 247 - else 245 + } else 248 246 set_bit(RX_REG_SET, &dev->flags); 249 247 250 248 return ret; ··· 422 416 struct sk_buff *skb; 423 417 struct net_device *netdev; 424 418 u16 rx_stat; 419 + int status; 425 420 426 421 dev = urb->context; 427 422 if (!dev) ··· 472 465 goon: 473 466 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 474 467 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 475 - if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 468 + status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); 469 + if (status == -ENODEV) 470 + netif_device_detach(dev->netdev); 471 + else if (status) { 476 472 set_bit(RX_URB_FAIL, &dev->flags); 477 473 goto resched; 478 474 } else { ··· 491 481 { 492 482 rtl8150_t *dev; 493 483 struct sk_buff *skb; 484 + int status; 494 485 495 486 dev = (rtl8150_t *)data; 496 487 ··· 510 499 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 511 500 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 512 501 try_again: 513 - if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 502 + status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); 503 + if (status == -ENODEV) { 504 + netif_device_detach(dev->netdev); 505 + } else if (status) { 514 506 set_bit(RX_URB_FAIL, &dev->flags); 515 507 goto tlsched; 516 - } else { 508 + } else { 517 509 clear_bit(RX_URB_FAIL, &dev->flags); 518 510 } 519 511 ··· 588 574 589 575 resubmit: 590 576 status = usb_submit_urb (urb, SLAB_ATOMIC); 591 - if (status) 577 + if (status == -ENODEV) 578 + netif_device_detach(dev->netdev); 579 + else if (status) 592 580 err ("can't resubmit intr, %s-%s/input0, status %d", 593 581 dev->udev->bus->bus_name, 594 582 dev->udev->devpath, status); 595 583 } 596 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 + } 597 614 598 615 /* 599 616 ** ··· 735 690 usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), 736 691 skb->data, count, write_bulk_callback, dev); 737 692 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); 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 + } 741 701 } else { 742 702 dev->stats.tx_packets++; 743 703 dev->stats.tx_bytes += skb->len; ··· 779 729 780 730 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 781 731 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 782 - if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) 732 + if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) { 733 + if (res == -ENODEV) 734 + netif_device_detach(dev->netdev); 783 735 warn("%s: rx_urb submit failed: %d", __FUNCTION__, res); 736 + return res; 737 + } 784 738 usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3), 785 739 dev->intr_buff, INTBUFSIZE, intr_callback, 786 740 dev, dev->intr_interval); 787 - if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) 741 + if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) { 742 + if (res == -ENODEV) 743 + netif_device_detach(dev->netdev); 788 744 warn("%s: intr_urb submit failed: %d", __FUNCTION__, res); 789 - netif_start_queue(netdev); 745 + usb_kill_urb(dev->rx_urb); 746 + return res; 747 + } 790 748 enable_net_traffic(dev); 791 749 set_carrier(netdev); 750 + netif_start_queue(netdev); 792 751 793 752 return res; 794 753 }
+9 -15
drivers/usb/serial/Kconfig
··· 62 62 To compile this driver as a module, choose M here: the 63 63 module will be called airprime. 64 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 65 config USB_SERIAL_ARK3116 75 66 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" 76 67 depends on USB_SERIAL && EXPERIMENTAL ··· 493 502 module will be called keyspan_pda. 494 503 495 504 config USB_SERIAL_OPTION 496 - tristate "USB driver for GSM modems" 505 + tristate "USB driver for GSM and CDMA modems" 497 506 depends on USB_SERIAL 498 507 help 499 - Say Y here if you have an "Option" GSM PCMCIA card 500 - (or an OEM version: branded Huawei, Audiovox, or Novatel). 508 + Say Y here if you have a GSM or CDMA modem that's connected to USB. 501 509 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. 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. 505 517 506 518 To compile this driver as a module, choose M here: the 507 519 module will be called option.
-1
drivers/usb/serial/Makefile
··· 12 12 usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) 13 13 14 14 obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 15 - obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o 16 15 obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o 17 16 obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 18 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 337 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 338 338 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 339 339 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 340 + { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 340 341 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 341 342 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 342 343 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) },
+4
drivers/usb/serial/ftdi_sio.h
··· 182 182 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ 183 183 #define FTDI_USB_UIRT_PID 0xF850 /* Product Id */ 184 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 + 185 189 /* 186 190 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). 187 191 * All of these devices use FTDI's vendor ID (0x0403).
+1
drivers/usb/serial/ipaq.c
··· 250 250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 251 251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 252 252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 253 + { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */ 253 254 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */ 254 255 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */ 255 256 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
+7 -69
drivers/usb/serial/option.c
··· 9 9 10 10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> 11 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 12 + History: see the git log. 39 13 40 14 Work sponsored by: Sigos GmbH, Germany <info@sigos.de> 41 15 42 16 This driver exists because the "normal" serial driver doesn't work too well 43 17 with GSM modems. Issues: 44 18 - data loss -- one single Receive URB is not nearly enough 45 - - nonstandard flow (Option devices) and multiplex (Sierra) control 19 + - nonstandard flow (Option devices) control 46 20 - controlling the baud rate doesn't make sense 47 21 48 22 This driver is named "option" because the most common device it's ··· 70 96 #define OPTION_VENDOR_ID 0x0AF0 71 97 #define HUAWEI_VENDOR_ID 0x12D1 72 98 #define AUDIOVOX_VENDOR_ID 0x0F3D 73 - #define SIERRAWIRELESS_VENDOR_ID 0x1199 74 99 #define NOVATELWIRELESS_VENDOR_ID 0x1410 100 + #define ANYDATA_VENDOR_ID 0x16d5 75 101 76 102 #define OPTION_PRODUCT_OLD 0x5000 77 103 #define OPTION_PRODUCT_FUSION 0x6000 ··· 80 106 #define OPTION_PRODUCT_COBRA2 0x6600 81 107 #define HUAWEI_PRODUCT_E600 0x1001 82 108 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 83 - #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 84 109 #define NOVATELWIRELESS_PRODUCT_U740 0x1400 110 + #define ANYDATA_PRODUCT_ID 0x6501 85 111 86 112 static struct usb_device_id option_ids[] = { 87 113 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, ··· 91 117 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 92 118 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 93 119 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 94 - { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, 95 120 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 121 + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 96 122 { } /* Terminating entry */ 97 123 }; 98 124 ··· 105 131 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 106 132 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 107 133 { 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) }, 134 + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 112 135 { } /* Terminating entry */ 113 136 }; 114 137 ··· 122 151 /* The card has three separate interfaces, which the serial driver 123 152 * recognizes separately, thus num_port=1. 124 153 */ 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 154 152 155 static struct usb_serial_driver option_1port_device = { 153 156 .driver = { 154 157 .owner = THIS_MODULE, 155 - .name = "option", 158 + .name = "option1", 156 159 }, 157 160 .description = "GSM modem (1-port)", 158 161 .id_table = option_ids1, ··· 190 245 retval = usb_serial_register(&option_1port_device); 191 246 if (retval) 192 247 goto failed_1port_device_register; 193 - retval = usb_serial_register(&option_3port_device); 194 - if (retval) 195 - goto failed_3port_device_register; 196 248 retval = usb_register(&option_driver); 197 249 if (retval) 198 250 goto failed_driver_register; ··· 199 257 return 0; 200 258 201 259 failed_driver_register: 202 - usb_serial_deregister (&option_3port_device); 203 - failed_3port_device_register: 204 260 usb_serial_deregister (&option_1port_device); 205 261 failed_1port_device_register: 206 262 return retval; ··· 207 267 static void __exit option_exit(void) 208 268 { 209 269 usb_deregister (&option_driver); 210 - usb_serial_deregister (&option_3port_device); 211 270 usb_serial_deregister (&option_1port_device); 212 271 } 213 272 ··· 594 655 struct option_port_private *portdata; 595 656 596 657 dbg("%s", __FUNCTION__); 597 - 598 658 599 659 for (i = 0; i < serial->num_ports; i++) { 600 660 port = serial->port[i];
+1
drivers/usb/serial/pl2303.c
··· 81 81 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, 82 82 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, 83 83 { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, 84 + { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) }, 84 85 { } /* Terminating entry */ 85 86 }; 86 87
+4
drivers/usb/serial/pl2303.h
··· 89 89 /* DATAPILOT Universal-2 Phone Cable */ 90 90 #define DATAPILOT_U2_VENDOR_ID 0x0731 91 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 145 US_SC_DEVICE, US_PR_DEVICE, NULL, 146 146 US_FL_IGNORE_RESIDUE ), 147 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 + 148 155 /* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and 149 156 * Einar Th. Einarsson <einarthered@gmail.com> */ 150 157 UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100, ··· 634 627 "Digital Camera EX-20 DSC", 635 628 US_SC_8070, US_PR_DEVICE, NULL, 0 ), 636 629 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 630 /* Submitted by Joel Bourquard <numlock@freesurf.ch> 650 631 * Some versions of this device need the SubClass and Protocol overrides 651 632 * while others don't. ··· 1101 1106 "Optio S/S4", 1102 1107 US_SC_DEVICE, US_PR_DEVICE, NULL, 1103 1108 US_FL_FIX_INQUIRY ), 1104 - 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 + 1105 1118 #ifdef CONFIG_USB_STORAGE_ISD200 1106 1119 UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1107 1120 "ATI",
+11 -2
drivers/usb/storage/usb.c
··· 483 483 } 484 484 485 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) 486 + static int get_device_info(struct us_data *us, const struct usb_device_id *id) 487 487 { 488 488 struct usb_device *dev = us->pusb_dev; 489 489 struct usb_interface_descriptor *idesc = ··· 499 499 idesc->bInterfaceProtocol : 500 500 unusual_dev->useTransport; 501 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 + } 502 507 503 508 /* 504 509 * This flag is only needed when we're in high-speed, so let's ··· 546 541 msgs[msg], 547 542 UTS_RELEASE); 548 543 } 544 + 545 + return 0; 549 546 } 550 547 551 548 /* Get the transport settings */ ··· 976 969 * of the match from the usb_device_id table, so we can find the 977 970 * corresponding entry in the private table. 978 971 */ 979 - get_device_info(us, id); 972 + result = get_device_info(us, id); 973 + if (result) 974 + goto BadDevice; 980 975 981 976 /* Get the transport, protocol, and pipe settings */ 982 977 result = get_transport(us);
+3 -4
include/linux/usb.h
··· 103 103 * @condition: binding state of the interface: not bound, binding 104 104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 105 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. 106 + * @class_dev: driver model's class view of this device. 108 107 * 109 108 * USB device drivers attach to interfaces on a physical device. Each 110 109 * interface encapsulates a single high level function, such as feeding ··· 143 144 * bound to */ 144 145 enum usb_interface_condition condition; /* state of binding */ 145 146 struct device dev; /* interface specific device info */ 146 - struct device *usb_dev; /* pointer to the usb class's device, if any */ 147 + struct class_device *class_dev; 147 148 }; 148 149 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149 150 #define interface_to_usbdev(intf) \ ··· 360 361 char *serial; /* iSerialNumber string, if present */ 361 362 362 363 struct list_head filelist; 363 - struct device *usbfs_dev; 364 + struct class_device *class_dev; 364 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 366 366 367 /*
+3 -1
include/linux/usb_usual.h
··· 44 44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 45 45 /* Don't check for write-protect */ \ 46 46 US_FLAG(MAX_SECTORS_64, 0x00000400) \ 47 - /* Sets max_sectors to 64 */ 47 + /* Sets max_sectors to 64 */ \ 48 + US_FLAG(IGNORE_DEVICE, 0x00000800) \ 49 + /* Don't claim device */ 48 50 49 51 #define US_FLAG(name, value) US_FL_##name = value , 50 52 enum { US_DO_ALL_FLAGS };