Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6

* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (42 commits)
usb: gadget: composite: avoid access beyond array max length
USB: serial: handle Data Carrier Detect changes
USB: gadget: Fix endpoint representation in ci13xxx_udc
USB: gadget: Fix error path in ci13xxx_udc gadget probe function
usb: pch_udc: Fix the worning log issue at gadget driver remove
USB: serial: Updated support for ICOM devices
USB: ehci-mxc: add work-around for efika mx/sb bug
USB: unbreak ehci-mxc on otg port of i.MX27
drivers: update to pl2303 usb-serial to support Motorola cables
USB: adding USB support for Cinterion's HC2x, EU3 and PH8 products
USB serial: add missing .usb_driver field in serial drivers
USB: ehci-fsl: Fix 'have_sysif_regs' detection
USB: g_printer: fix bug in module parameter definitions
USB: g_printer: fix bug in unregistration
USB: uss720: remove duplicate USB device
MAINTAINERS: add ueagle-atm entry
USB: EHCI: fix DMA deallocation bug
USB: pch_udc: support new device ML7213 IOH
usb: pch_udc: Fixed issue which does not work with g_serial
usb: set ep_dev async suspend should be later than device_initialize
...

+567 -380
+6
MAINTAINERS
··· 3139 F: net/ieee802154/ 3140 F: drivers/ieee802154/ 3141 3142 INTEGRITY MEASUREMENT ARCHITECTURE (IMA) 3143 M: Mimi Zohar <zohar@us.ibm.com> 3144 S: Supported
··· 3139 F: net/ieee802154/ 3140 F: drivers/ieee802154/ 3141 3142 + IKANOS/ADI EAGLE ADSL USB DRIVER 3143 + M: Matthieu Castet <castet.matthieu@free.fr> 3144 + M: Stanislaw Gruszka <stf_xl@wp.pl> 3145 + S: Maintained 3146 + F: drivers/usb/atm/ueagle-atm.c 3147 + 3148 INTEGRITY MEASUREMENT ARCHITECTURE (IMA) 3149 M: Mimi Zohar <zohar@us.ibm.com> 3150 S: Supported
+1 -1
drivers/usb/class/cdc-wdm.c
··· 342 goto outnp; 343 } 344 345 - if (!file->f_flags && O_NONBLOCK) 346 r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, 347 &desc->flags)); 348 else
··· 342 goto outnp; 343 } 344 345 + if (!(file->f_flags & O_NONBLOCK)) 346 r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, 347 &desc->flags)); 348 else
+1 -1
drivers/usb/core/endpoint.c
··· 192 ep_dev->dev.parent = parent; 193 ep_dev->dev.release = ep_device_release; 194 dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); 195 - device_enable_async_suspend(&ep_dev->dev); 196 197 retval = device_register(&ep_dev->dev); 198 if (retval) 199 goto error_register; 200 201 endpoint->ep_dev = ep_dev; 202 return retval; 203
··· 192 ep_dev->dev.parent = parent; 193 ep_dev->dev.release = ep_device_release; 194 dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); 195 196 retval = device_register(&ep_dev->dev); 197 if (retval) 198 goto error_register; 199 200 + device_enable_async_suspend(&ep_dev->dev); 201 endpoint->ep_dev = ep_dev; 202 return retval; 203
+6 -1
drivers/usb/core/hcd-pci.c
··· 405 return retval; 406 } 407 408 - synchronize_irq(pci_dev->irq); 409 410 /* Downstream ports from this root hub should already be quiesced, so 411 * there will be no DMA activity. Now we can shut down the upstream
··· 405 return retval; 406 } 407 408 + /* If MSI-X is enabled, the driver will have synchronized all vectors 409 + * in pci_suspend(). If MSI or legacy PCI is enabled, that will be 410 + * synchronized here. 411 + */ 412 + if (!hcd->msix_enabled) 413 + synchronize_irq(pci_dev->irq); 414 415 /* Downstream ports from this root hub should already be quiesced, so 416 * there will be no DMA activity. Now we can shut down the upstream
+21
drivers/usb/core/hub.c
··· 676 static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) 677 { 678 struct usb_device *hdev = hub->hdev; 679 int port1; 680 int status; 681 bool need_debounce_delay = false; ··· 716 usb_autopm_get_interface_no_resume( 717 to_usb_interface(hub->intfdev)); 718 return; /* Continues at init2: below */ 719 } else { 720 hub_power_on(hub, true); 721 }
··· 676 static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) 677 { 678 struct usb_device *hdev = hub->hdev; 679 + struct usb_hcd *hcd; 680 + int ret; 681 int port1; 682 int status; 683 bool need_debounce_delay = false; ··· 714 usb_autopm_get_interface_no_resume( 715 to_usb_interface(hub->intfdev)); 716 return; /* Continues at init2: below */ 717 + } else if (type == HUB_RESET_RESUME) { 718 + /* The internal host controller state for the hub device 719 + * may be gone after a host power loss on system resume. 720 + * Update the device's info so the HW knows it's a hub. 721 + */ 722 + hcd = bus_to_hcd(hdev->bus); 723 + if (hcd->driver->update_hub_device) { 724 + ret = hcd->driver->update_hub_device(hcd, hdev, 725 + &hub->tt, GFP_NOIO); 726 + if (ret < 0) { 727 + dev_err(hub->intfdev, "Host not " 728 + "accepting hub info " 729 + "update.\n"); 730 + dev_err(hub->intfdev, "LS/FS devices " 731 + "and hubs may not work " 732 + "under this hub\n."); 733 + } 734 + } 735 + hub_power_on(hub, true); 736 } else { 737 hub_power_on(hub, true); 738 }
+6 -1
drivers/usb/gadget/Kconfig
··· 509 select USB_GADGET_SELECTED 510 511 config USB_GADGET_EG20T 512 - boolean "Intel EG20T(Topcliff) USB Device controller" 513 depends on PCI 514 select USB_GADGET_DUALSPEED 515 help ··· 524 This driver supports both control transfer and bulk transfer modes. 525 This driver dose not support interrupt transfer or isochronous 526 transfer modes. 527 528 config USB_EG20T 529 tristate
··· 509 select USB_GADGET_SELECTED 510 511 config USB_GADGET_EG20T 512 + boolean "Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH UDC" 513 depends on PCI 514 select USB_GADGET_DUALSPEED 515 help ··· 524 This driver supports both control transfer and bulk transfer modes. 525 This driver dose not support interrupt transfer or isochronous 526 transfer modes. 527 + 528 + This driver also can be used for OKI SEMICONDUCTOR's ML7213 which is 529 + for IVI(In-Vehicle Infotainment) use. 530 + ML7213 is companion chip for Intel Atom E6xx series. 531 + ML7213 is completely compatible for Intel EG20T PCH. 532 533 config USB_EG20T 534 tristate
+137 -131
drivers/usb/gadget/ci13xxx_udc.c
··· 76 77 /* control endpoint description */ 78 static const struct usb_endpoint_descriptor 79 - ctrl_endpt_desc = { 80 .bLength = USB_DT_ENDPOINT_SIZE, 81 .bDescriptorType = USB_DT_ENDPOINT, 82 83 .bmAttributes = USB_ENDPOINT_XFER_CONTROL, 84 .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), 85 }; ··· 276 hw_bank.size /= sizeof(u32); 277 278 reg = hw_aread(ABS_DCCPARAMS, DCCPARAMS_DEN) >> ffs_nr(DCCPARAMS_DEN); 279 - if (reg == 0 || reg > ENDPT_MAX) 280 - return -ENODEV; 281 282 - hw_ep_max = reg; /* cache hw ENDPT_MAX */ 283 284 /* setup lock mode ? */ 285 ··· 1208 } 1209 1210 spin_lock_irqsave(udc->lock, flags); 1211 - for (i = 0; i < hw_ep_max; i++) { 1212 - struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; 1213 n += scnprintf(buf + n, PAGE_SIZE - n, 1214 "EP=%02i: RX=%08X TX=%08X\n", 1215 - i, (u32)mEp->qh[RX].dma, (u32)mEp->qh[TX].dma); 1216 for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) { 1217 n += scnprintf(buf + n, PAGE_SIZE - n, 1218 " %04X: %08X %08X\n", j, 1219 - *((u32 *)mEp->qh[RX].ptr + j), 1220 - *((u32 *)mEp->qh[TX].ptr + j)); 1221 } 1222 } 1223 spin_unlock_irqrestore(udc->lock, flags); ··· 1305 unsigned long flags; 1306 struct list_head *ptr = NULL; 1307 struct ci13xxx_req *req = NULL; 1308 - unsigned i, j, k, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32); 1309 1310 dbg_trace("[%s] %p\n", __func__, buf); 1311 if (attr == NULL || buf == NULL) { ··· 1315 1316 spin_lock_irqsave(udc->lock, flags); 1317 for (i = 0; i < hw_ep_max; i++) 1318 - for (k = RX; k <= TX; k++) 1319 - list_for_each(ptr, &udc->ci13xxx_ep[i].qh[k].queue) 1320 - { 1321 - req = list_entry(ptr, 1322 - struct ci13xxx_req, queue); 1323 1324 n += scnprintf(buf + n, PAGE_SIZE - n, 1325 - "EP=%02i: TD=%08X %s\n", 1326 - i, (u32)req->dma, 1327 - ((k == RX) ? "RX" : "TX")); 1328 - 1329 - for (j = 0; j < qSize; j++) 1330 - n += scnprintf(buf + n, PAGE_SIZE - n, 1331 - " %04X: %08X\n", j, 1332 - *((u32 *)req->ptr + j)); 1333 - } 1334 spin_unlock_irqrestore(udc->lock, flags); 1335 1336 return n; ··· 1477 * At this point it's guaranteed exclusive access to qhead 1478 * (endpt is not primed) so it's no need to use tripwire 1479 */ 1480 - mEp->qh[mEp->dir].ptr->td.next = mReq->dma; /* TERMINATE = 0 */ 1481 - mEp->qh[mEp->dir].ptr->td.token &= ~TD_STATUS; /* clear status */ 1482 if (mReq->req.zero == 0) 1483 - mEp->qh[mEp->dir].ptr->cap |= QH_ZLT; 1484 else 1485 - mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT; 1486 1487 wmb(); /* synchronize before ep prime */ 1488 ··· 1552 1553 hw_ep_flush(mEp->num, mEp->dir); 1554 1555 - while (!list_empty(&mEp->qh[mEp->dir].queue)) { 1556 1557 /* pop oldest request */ 1558 struct ci13xxx_req *mReq = \ 1559 - list_entry(mEp->qh[mEp->dir].queue.next, 1560 struct ci13xxx_req, queue); 1561 list_del_init(&mReq->queue); 1562 mReq->req.status = -ESHUTDOWN; ··· 1581 { 1582 struct usb_ep *ep; 1583 struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget); 1584 - struct ci13xxx_ep *mEp = container_of(gadget->ep0, 1585 - struct ci13xxx_ep, ep); 1586 1587 trace("%p", gadget); 1588 ··· 1591 gadget_for_each_ep(ep, gadget) { 1592 usb_ep_fifo_flush(ep); 1593 } 1594 - usb_ep_fifo_flush(gadget->ep0); 1595 1596 udc->driver->disconnect(gadget); 1597 ··· 1600 gadget_for_each_ep(ep, gadget) { 1601 usb_ep_disable(ep); 1602 } 1603 - usb_ep_disable(gadget->ep0); 1604 1605 - if (mEp->status != NULL) { 1606 - usb_ep_free_request(gadget->ep0, mEp->status); 1607 - mEp->status = NULL; 1608 } 1609 1610 return 0; ··· 1624 __releases(udc->lock) 1625 __acquires(udc->lock) 1626 { 1627 - struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[0]; 1628 int retval; 1629 1630 trace("%p", udc); ··· 1644 if (retval) 1645 goto done; 1646 1647 - retval = usb_ep_enable(&mEp->ep, &ctrl_endpt_desc); 1648 if (!retval) { 1649 - mEp->status = usb_ep_alloc_request(&mEp->ep, GFP_ATOMIC); 1650 - if (mEp->status == NULL) { 1651 - usb_ep_disable(&mEp->ep); 1652 retval = -ENOMEM; 1653 } 1654 } ··· 1685 1686 /** 1687 * isr_get_status_response: get_status request response 1688 - * @ep: endpoint 1689 * @setup: setup request packet 1690 * 1691 * This function returns an error code 1692 */ 1693 - static int isr_get_status_response(struct ci13xxx_ep *mEp, 1694 struct usb_ctrlrequest *setup) 1695 __releases(mEp->lock) 1696 __acquires(mEp->lock) 1697 { 1698 struct usb_request *req = NULL; 1699 gfp_t gfp_flags = GFP_ATOMIC; 1700 int dir, num, retval; ··· 1750 1751 /** 1752 * isr_setup_status_phase: queues the status phase of a setup transation 1753 - * @mEp: endpoint 1754 * 1755 * This function returns an error code 1756 */ 1757 - static int isr_setup_status_phase(struct ci13xxx_ep *mEp) 1758 __releases(mEp->lock) 1759 __acquires(mEp->lock) 1760 { 1761 int retval; 1762 1763 - trace("%p", mEp); 1764 1765 - /* mEp is always valid & configured */ 1766 - 1767 - if (mEp->type == USB_ENDPOINT_XFER_CONTROL) 1768 - mEp->dir = (mEp->dir == TX) ? RX : TX; 1769 - 1770 - mEp->status->no_interrupt = 1; 1771 1772 spin_unlock(mEp->lock); 1773 - retval = usb_ep_queue(&mEp->ep, mEp->status, GFP_ATOMIC); 1774 spin_lock(mEp->lock); 1775 1776 return retval; ··· 1788 1789 trace("%p", mEp); 1790 1791 - if (list_empty(&mEp->qh[mEp->dir].queue)) 1792 return -EINVAL; 1793 1794 /* pop oldest request */ 1795 - mReq = list_entry(mEp->qh[mEp->dir].queue.next, 1796 struct ci13xxx_req, queue); 1797 list_del_init(&mReq->queue); 1798 ··· 1804 1805 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); 1806 1807 - if (!list_empty(&mEp->qh[mEp->dir].queue)) { 1808 struct ci13xxx_req* mReqEnq; 1809 1810 - mReqEnq = list_entry(mEp->qh[mEp->dir].queue.next, 1811 struct ci13xxx_req, queue); 1812 _hardware_enqueue(mEp, mReqEnq); 1813 } ··· 1846 int type, num, err = -EINVAL; 1847 struct usb_ctrlrequest req; 1848 1849 - 1850 if (mEp->desc == NULL) 1851 continue; /* not configured */ 1852 1853 - if ((mEp->dir == RX && hw_test_and_clear_complete(i)) || 1854 - (mEp->dir == TX && hw_test_and_clear_complete(i + 16))) { 1855 err = isr_tr_complete_low(mEp); 1856 if (mEp->type == USB_ENDPOINT_XFER_CONTROL) { 1857 if (err > 0) /* needs status phase */ 1858 - err = isr_setup_status_phase(mEp); 1859 if (err < 0) { 1860 dbg_event(_usb_addr(mEp), 1861 "ERROR", err); ··· 1874 continue; 1875 } 1876 1877 /* read_setup_packet */ 1878 do { 1879 hw_test_and_set_setup_guard(); 1880 - memcpy(&req, &mEp->qh[RX].ptr->setup, sizeof(req)); 1881 } while (!hw_test_and_clear_setup_guard()); 1882 1883 type = req.bRequestType; 1884 1885 - mEp->dir = (type & USB_DIR_IN) ? TX : RX; 1886 1887 dbg_setup(_usb_addr(mEp), &req); 1888 ··· 1910 if (err) 1911 break; 1912 } 1913 - err = isr_setup_status_phase(mEp); 1914 break; 1915 case USB_REQ_GET_STATUS: 1916 if (type != (USB_DIR_IN|USB_RECIP_DEVICE) && ··· 1920 if (le16_to_cpu(req.wLength) != 2 || 1921 le16_to_cpu(req.wValue) != 0) 1922 break; 1923 - err = isr_get_status_response(mEp, &req); 1924 break; 1925 case USB_REQ_SET_ADDRESS: 1926 if (type != (USB_DIR_OUT|USB_RECIP_DEVICE)) ··· 1931 err = hw_usb_set_address((u8)le16_to_cpu(req.wValue)); 1932 if (err) 1933 break; 1934 - err = isr_setup_status_phase(mEp); 1935 break; 1936 case USB_REQ_SET_FEATURE: 1937 if (type != (USB_DIR_OUT|USB_RECIP_ENDPOINT) && ··· 1947 spin_lock(udc->lock); 1948 if (err) 1949 break; 1950 - err = isr_setup_status_phase(mEp); 1951 break; 1952 default: 1953 delegate: 1954 if (req.wLength == 0) /* no data phase */ 1955 - mEp->dir = TX; 1956 1957 spin_unlock(udc->lock); 1958 err = udc->driver->setup(&udc->gadget, &req); ··· 1983 const struct usb_endpoint_descriptor *desc) 1984 { 1985 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); 1986 - int direction, retval = 0; 1987 unsigned long flags; 1988 1989 trace("%p, %p", ep, desc); ··· 1997 1998 mEp->desc = desc; 1999 2000 - if (!list_empty(&mEp->qh[mEp->dir].queue)) 2001 warn("enabling a non-empty endpoint!"); 2002 2003 mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX; ··· 2006 2007 mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize); 2008 2009 - direction = mEp->dir; 2010 - do { 2011 - dbg_event(_usb_addr(mEp), "ENABLE", 0); 2012 2013 - mEp->qh[mEp->dir].ptr->cap = 0; 2014 2015 - if (mEp->type == USB_ENDPOINT_XFER_CONTROL) 2016 - mEp->qh[mEp->dir].ptr->cap |= QH_IOS; 2017 - else if (mEp->type == USB_ENDPOINT_XFER_ISOC) 2018 - mEp->qh[mEp->dir].ptr->cap &= ~QH_MULT; 2019 - else 2020 - mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT; 2021 2022 - mEp->qh[mEp->dir].ptr->cap |= 2023 - (mEp->ep.maxpacket << ffs_nr(QH_MAX_PKT)) & QH_MAX_PKT; 2024 - mEp->qh[mEp->dir].ptr->td.next |= TD_TERMINATE; /* needed? */ 2025 2026 - retval |= hw_ep_enable(mEp->num, mEp->dir, mEp->type); 2027 - 2028 - if (mEp->type == USB_ENDPOINT_XFER_CONTROL) 2029 - mEp->dir = (mEp->dir == TX) ? RX : TX; 2030 - 2031 - } while (mEp->dir != direction); 2032 2033 spin_unlock_irqrestore(mEp->lock, flags); 2034 return retval; ··· 2154 spin_lock_irqsave(mEp->lock, flags); 2155 2156 if (mEp->type == USB_ENDPOINT_XFER_CONTROL && 2157 - !list_empty(&mEp->qh[mEp->dir].queue)) { 2158 _ep_nuke(mEp); 2159 retval = -EOVERFLOW; 2160 warn("endpoint ctrl %X nuked", _usb_addr(mEp)); ··· 2178 /* push request */ 2179 mReq->req.status = -EINPROGRESS; 2180 mReq->req.actual = 0; 2181 - list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue); 2182 2183 - if (list_is_singular(&mEp->qh[mEp->dir].queue)) 2184 retval = _hardware_enqueue(mEp, mReq); 2185 2186 if (retval == -EALREADY) { ··· 2207 trace("%p, %p", ep, req); 2208 2209 if (ep == NULL || req == NULL || mEp->desc == NULL || 2210 - list_empty(&mReq->queue) || list_empty(&mEp->qh[mEp->dir].queue)) 2211 return -EINVAL; 2212 2213 spin_lock_irqsave(mEp->lock, flags); ··· 2252 #ifndef STALL_IN 2253 /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */ 2254 if (value && mEp->type == USB_ENDPOINT_XFER_BULK && mEp->dir == TX && 2255 - !list_empty(&mEp->qh[mEp->dir].queue)) { 2256 spin_unlock_irqrestore(mEp->lock, flags); 2257 return -EAGAIN; 2258 } ··· 2363 if (is_active) { 2364 pm_runtime_get_sync(&_gadget->dev); 2365 hw_device_reset(udc); 2366 - hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma); 2367 } else { 2368 hw_device_state(0); 2369 if (udc->udc_driver->notify_event) ··· 2398 int (*bind)(struct usb_gadget *)) 2399 { 2400 struct ci13xxx *udc = _udc; 2401 - unsigned long i, k, flags; 2402 int retval = -ENOMEM; 2403 2404 trace("%p", driver); ··· 2436 2437 info("hw_ep_max = %d", hw_ep_max); 2438 2439 - udc->driver = driver; 2440 udc->gadget.dev.driver = NULL; 2441 2442 retval = 0; 2443 - for (i = 0; i < hw_ep_max; i++) { 2444 - struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; 2445 2446 - scnprintf(mEp->name, sizeof(mEp->name), "ep%i", (int)i); 2447 2448 - mEp->lock = udc->lock; 2449 - mEp->device = &udc->gadget.dev; 2450 - mEp->td_pool = udc->td_pool; 2451 2452 - mEp->ep.name = mEp->name; 2453 - mEp->ep.ops = &usb_ep_ops; 2454 - mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; 2455 2456 - /* this allocation cannot be random */ 2457 - for (k = RX; k <= TX; k++) { 2458 - INIT_LIST_HEAD(&mEp->qh[k].queue); 2459 spin_unlock_irqrestore(udc->lock, flags); 2460 - mEp->qh[k].ptr = dma_pool_alloc(udc->qh_pool, 2461 - GFP_KERNEL, 2462 - &mEp->qh[k].dma); 2463 spin_lock_irqsave(udc->lock, flags); 2464 - if (mEp->qh[k].ptr == NULL) 2465 retval = -ENOMEM; 2466 else 2467 - memset(mEp->qh[k].ptr, 0, 2468 - sizeof(*mEp->qh[k].ptr)); 2469 - } 2470 - if (i == 0) 2471 - udc->gadget.ep0 = &mEp->ep; 2472 - else 2473 list_add_tail(&mEp->ep.ep_list, &udc->gadget.ep_list); 2474 } 2475 if (retval) 2476 goto done; 2477 2478 /* bind gadget */ 2479 driver->driver.bus = NULL; 2480 udc->gadget.dev.driver = &driver->driver; ··· 2489 goto done; 2490 } 2491 2492 pm_runtime_get_sync(&udc->gadget.dev); 2493 if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) { 2494 if (udc->vbus_active) { ··· 2501 } 2502 } 2503 2504 - retval = hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma); 2505 if (retval) 2506 pm_runtime_put_sync(&udc->gadget.dev); 2507 2508 done: 2509 spin_unlock_irqrestore(udc->lock, flags); 2510 - if (retval) 2511 - usb_gadget_unregister_driver(driver); 2512 return retval; 2513 } 2514 EXPORT_SYMBOL(usb_gadget_probe_driver); ··· 2519 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) 2520 { 2521 struct ci13xxx *udc = _udc; 2522 - unsigned long i, k, flags; 2523 2524 trace("%p", driver); 2525 ··· 2555 for (i = 0; i < hw_ep_max; i++) { 2556 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; 2557 2558 - if (i == 0) 2559 - udc->gadget.ep0 = NULL; 2560 - else if (!list_empty(&mEp->ep.ep_list)) 2561 list_del_init(&mEp->ep.ep_list); 2562 2563 - for (k = RX; k <= TX; k++) 2564 - if (mEp->qh[k].ptr != NULL) 2565 - dma_pool_free(udc->qh_pool, 2566 - mEp->qh[k].ptr, mEp->qh[k].dma); 2567 } 2568 2569 udc->driver = NULL; 2570 2571 spin_unlock_irqrestore(udc->lock, flags);
··· 76 77 /* control endpoint description */ 78 static const struct usb_endpoint_descriptor 79 + ctrl_endpt_out_desc = { 80 .bLength = USB_DT_ENDPOINT_SIZE, 81 .bDescriptorType = USB_DT_ENDPOINT, 82 83 + .bEndpointAddress = USB_DIR_OUT, 84 + .bmAttributes = USB_ENDPOINT_XFER_CONTROL, 85 + .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), 86 + }; 87 + 88 + static const struct usb_endpoint_descriptor 89 + ctrl_endpt_in_desc = { 90 + .bLength = USB_DT_ENDPOINT_SIZE, 91 + .bDescriptorType = USB_DT_ENDPOINT, 92 + 93 + .bEndpointAddress = USB_DIR_IN, 94 .bmAttributes = USB_ENDPOINT_XFER_CONTROL, 95 .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), 96 }; ··· 265 hw_bank.size /= sizeof(u32); 266 267 reg = hw_aread(ABS_DCCPARAMS, DCCPARAMS_DEN) >> ffs_nr(DCCPARAMS_DEN); 268 + hw_ep_max = reg * 2; /* cache hw ENDPT_MAX */ 269 270 + if (hw_ep_max == 0 || hw_ep_max > ENDPT_MAX) 271 + return -ENODEV; 272 273 /* setup lock mode ? */ 274 ··· 1197 } 1198 1199 spin_lock_irqsave(udc->lock, flags); 1200 + for (i = 0; i < hw_ep_max/2; i++) { 1201 + struct ci13xxx_ep *mEpRx = &udc->ci13xxx_ep[i]; 1202 + struct ci13xxx_ep *mEpTx = &udc->ci13xxx_ep[i + hw_ep_max/2]; 1203 n += scnprintf(buf + n, PAGE_SIZE - n, 1204 "EP=%02i: RX=%08X TX=%08X\n", 1205 + i, (u32)mEpRx->qh.dma, (u32)mEpTx->qh.dma); 1206 for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) { 1207 n += scnprintf(buf + n, PAGE_SIZE - n, 1208 " %04X: %08X %08X\n", j, 1209 + *((u32 *)mEpRx->qh.ptr + j), 1210 + *((u32 *)mEpTx->qh.ptr + j)); 1211 } 1212 } 1213 spin_unlock_irqrestore(udc->lock, flags); ··· 1293 unsigned long flags; 1294 struct list_head *ptr = NULL; 1295 struct ci13xxx_req *req = NULL; 1296 + unsigned i, j, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32); 1297 1298 dbg_trace("[%s] %p\n", __func__, buf); 1299 if (attr == NULL || buf == NULL) { ··· 1303 1304 spin_lock_irqsave(udc->lock, flags); 1305 for (i = 0; i < hw_ep_max; i++) 1306 + list_for_each(ptr, &udc->ci13xxx_ep[i].qh.queue) 1307 + { 1308 + req = list_entry(ptr, struct ci13xxx_req, queue); 1309 1310 + n += scnprintf(buf + n, PAGE_SIZE - n, 1311 + "EP=%02i: TD=%08X %s\n", 1312 + i % hw_ep_max/2, (u32)req->dma, 1313 + ((i < hw_ep_max/2) ? "RX" : "TX")); 1314 + 1315 + for (j = 0; j < qSize; j++) 1316 n += scnprintf(buf + n, PAGE_SIZE - n, 1317 + " %04X: %08X\n", j, 1318 + *((u32 *)req->ptr + j)); 1319 + } 1320 spin_unlock_irqrestore(udc->lock, flags); 1321 1322 return n; ··· 1467 * At this point it's guaranteed exclusive access to qhead 1468 * (endpt is not primed) so it's no need to use tripwire 1469 */ 1470 + mEp->qh.ptr->td.next = mReq->dma; /* TERMINATE = 0 */ 1471 + mEp->qh.ptr->td.token &= ~TD_STATUS; /* clear status */ 1472 if (mReq->req.zero == 0) 1473 + mEp->qh.ptr->cap |= QH_ZLT; 1474 else 1475 + mEp->qh.ptr->cap &= ~QH_ZLT; 1476 1477 wmb(); /* synchronize before ep prime */ 1478 ··· 1542 1543 hw_ep_flush(mEp->num, mEp->dir); 1544 1545 + while (!list_empty(&mEp->qh.queue)) { 1546 1547 /* pop oldest request */ 1548 struct ci13xxx_req *mReq = \ 1549 + list_entry(mEp->qh.queue.next, 1550 struct ci13xxx_req, queue); 1551 list_del_init(&mReq->queue); 1552 mReq->req.status = -ESHUTDOWN; ··· 1571 { 1572 struct usb_ep *ep; 1573 struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget); 1574 1575 trace("%p", gadget); 1576 ··· 1583 gadget_for_each_ep(ep, gadget) { 1584 usb_ep_fifo_flush(ep); 1585 } 1586 + usb_ep_fifo_flush(&udc->ep0out.ep); 1587 + usb_ep_fifo_flush(&udc->ep0in.ep); 1588 1589 udc->driver->disconnect(gadget); 1590 ··· 1591 gadget_for_each_ep(ep, gadget) { 1592 usb_ep_disable(ep); 1593 } 1594 + usb_ep_disable(&udc->ep0out.ep); 1595 + usb_ep_disable(&udc->ep0in.ep); 1596 1597 + if (udc->status != NULL) { 1598 + usb_ep_free_request(&udc->ep0in.ep, udc->status); 1599 + udc->status = NULL; 1600 } 1601 1602 return 0; ··· 1614 __releases(udc->lock) 1615 __acquires(udc->lock) 1616 { 1617 int retval; 1618 1619 trace("%p", udc); ··· 1635 if (retval) 1636 goto done; 1637 1638 + retval = usb_ep_enable(&udc->ep0out.ep, &ctrl_endpt_out_desc); 1639 + if (retval) 1640 + goto done; 1641 + 1642 + retval = usb_ep_enable(&udc->ep0in.ep, &ctrl_endpt_in_desc); 1643 if (!retval) { 1644 + udc->status = usb_ep_alloc_request(&udc->ep0in.ep, GFP_ATOMIC); 1645 + if (udc->status == NULL) { 1646 + usb_ep_disable(&udc->ep0out.ep); 1647 retval = -ENOMEM; 1648 } 1649 } ··· 1672 1673 /** 1674 * isr_get_status_response: get_status request response 1675 + * @udc: udc struct 1676 * @setup: setup request packet 1677 * 1678 * This function returns an error code 1679 */ 1680 + static int isr_get_status_response(struct ci13xxx *udc, 1681 struct usb_ctrlrequest *setup) 1682 __releases(mEp->lock) 1683 __acquires(mEp->lock) 1684 { 1685 + struct ci13xxx_ep *mEp = &udc->ep0in; 1686 struct usb_request *req = NULL; 1687 gfp_t gfp_flags = GFP_ATOMIC; 1688 int dir, num, retval; ··· 1736 1737 /** 1738 * isr_setup_status_phase: queues the status phase of a setup transation 1739 + * @udc: udc struct 1740 * 1741 * This function returns an error code 1742 */ 1743 + static int isr_setup_status_phase(struct ci13xxx *udc) 1744 __releases(mEp->lock) 1745 __acquires(mEp->lock) 1746 { 1747 int retval; 1748 + struct ci13xxx_ep *mEp; 1749 1750 + trace("%p", udc); 1751 1752 + mEp = (udc->ep0_dir == TX) ? &udc->ep0out : &udc->ep0in; 1753 1754 spin_unlock(mEp->lock); 1755 + retval = usb_ep_queue(&mEp->ep, udc->status, GFP_ATOMIC); 1756 spin_lock(mEp->lock); 1757 1758 return retval; ··· 1778 1779 trace("%p", mEp); 1780 1781 + if (list_empty(&mEp->qh.queue)) 1782 return -EINVAL; 1783 1784 /* pop oldest request */ 1785 + mReq = list_entry(mEp->qh.queue.next, 1786 struct ci13xxx_req, queue); 1787 list_del_init(&mReq->queue); 1788 ··· 1794 1795 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); 1796 1797 + if (!list_empty(&mEp->qh.queue)) { 1798 struct ci13xxx_req* mReqEnq; 1799 1800 + mReqEnq = list_entry(mEp->qh.queue.next, 1801 struct ci13xxx_req, queue); 1802 _hardware_enqueue(mEp, mReqEnq); 1803 } ··· 1836 int type, num, err = -EINVAL; 1837 struct usb_ctrlrequest req; 1838 1839 if (mEp->desc == NULL) 1840 continue; /* not configured */ 1841 1842 + if (hw_test_and_clear_complete(i)) { 1843 err = isr_tr_complete_low(mEp); 1844 if (mEp->type == USB_ENDPOINT_XFER_CONTROL) { 1845 if (err > 0) /* needs status phase */ 1846 + err = isr_setup_status_phase(udc); 1847 if (err < 0) { 1848 dbg_event(_usb_addr(mEp), 1849 "ERROR", err); ··· 1866 continue; 1867 } 1868 1869 + /* 1870 + * Flush data and handshake transactions of previous 1871 + * setup packet. 1872 + */ 1873 + _ep_nuke(&udc->ep0out); 1874 + _ep_nuke(&udc->ep0in); 1875 + 1876 /* read_setup_packet */ 1877 do { 1878 hw_test_and_set_setup_guard(); 1879 + memcpy(&req, &mEp->qh.ptr->setup, sizeof(req)); 1880 } while (!hw_test_and_clear_setup_guard()); 1881 1882 type = req.bRequestType; 1883 1884 + udc->ep0_dir = (type & USB_DIR_IN) ? TX : RX; 1885 1886 dbg_setup(_usb_addr(mEp), &req); 1887 ··· 1895 if (err) 1896 break; 1897 } 1898 + err = isr_setup_status_phase(udc); 1899 break; 1900 case USB_REQ_GET_STATUS: 1901 if (type != (USB_DIR_IN|USB_RECIP_DEVICE) && ··· 1905 if (le16_to_cpu(req.wLength) != 2 || 1906 le16_to_cpu(req.wValue) != 0) 1907 break; 1908 + err = isr_get_status_response(udc, &req); 1909 break; 1910 case USB_REQ_SET_ADDRESS: 1911 if (type != (USB_DIR_OUT|USB_RECIP_DEVICE)) ··· 1916 err = hw_usb_set_address((u8)le16_to_cpu(req.wValue)); 1917 if (err) 1918 break; 1919 + err = isr_setup_status_phase(udc); 1920 break; 1921 case USB_REQ_SET_FEATURE: 1922 if (type != (USB_DIR_OUT|USB_RECIP_ENDPOINT) && ··· 1932 spin_lock(udc->lock); 1933 if (err) 1934 break; 1935 + err = isr_setup_status_phase(udc); 1936 break; 1937 default: 1938 delegate: 1939 if (req.wLength == 0) /* no data phase */ 1940 + udc->ep0_dir = TX; 1941 1942 spin_unlock(udc->lock); 1943 err = udc->driver->setup(&udc->gadget, &req); ··· 1968 const struct usb_endpoint_descriptor *desc) 1969 { 1970 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); 1971 + int retval = 0; 1972 unsigned long flags; 1973 1974 trace("%p, %p", ep, desc); ··· 1982 1983 mEp->desc = desc; 1984 1985 + if (!list_empty(&mEp->qh.queue)) 1986 warn("enabling a non-empty endpoint!"); 1987 1988 mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX; ··· 1991 1992 mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize); 1993 1994 + dbg_event(_usb_addr(mEp), "ENABLE", 0); 1995 1996 + mEp->qh.ptr->cap = 0; 1997 1998 + if (mEp->type == USB_ENDPOINT_XFER_CONTROL) 1999 + mEp->qh.ptr->cap |= QH_IOS; 2000 + else if (mEp->type == USB_ENDPOINT_XFER_ISOC) 2001 + mEp->qh.ptr->cap &= ~QH_MULT; 2002 + else 2003 + mEp->qh.ptr->cap &= ~QH_ZLT; 2004 2005 + mEp->qh.ptr->cap |= 2006 + (mEp->ep.maxpacket << ffs_nr(QH_MAX_PKT)) & QH_MAX_PKT; 2007 + mEp->qh.ptr->td.next |= TD_TERMINATE; /* needed? */ 2008 2009 + retval |= hw_ep_enable(mEp->num, mEp->dir, mEp->type); 2010 2011 spin_unlock_irqrestore(mEp->lock, flags); 2012 return retval; ··· 2146 spin_lock_irqsave(mEp->lock, flags); 2147 2148 if (mEp->type == USB_ENDPOINT_XFER_CONTROL && 2149 + !list_empty(&mEp->qh.queue)) { 2150 _ep_nuke(mEp); 2151 retval = -EOVERFLOW; 2152 warn("endpoint ctrl %X nuked", _usb_addr(mEp)); ··· 2170 /* push request */ 2171 mReq->req.status = -EINPROGRESS; 2172 mReq->req.actual = 0; 2173 + list_add_tail(&mReq->queue, &mEp->qh.queue); 2174 2175 + if (list_is_singular(&mEp->qh.queue)) 2176 retval = _hardware_enqueue(mEp, mReq); 2177 2178 if (retval == -EALREADY) { ··· 2199 trace("%p, %p", ep, req); 2200 2201 if (ep == NULL || req == NULL || mEp->desc == NULL || 2202 + list_empty(&mReq->queue) || list_empty(&mEp->qh.queue)) 2203 return -EINVAL; 2204 2205 spin_lock_irqsave(mEp->lock, flags); ··· 2244 #ifndef STALL_IN 2245 /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */ 2246 if (value && mEp->type == USB_ENDPOINT_XFER_BULK && mEp->dir == TX && 2247 + !list_empty(&mEp->qh.queue)) { 2248 spin_unlock_irqrestore(mEp->lock, flags); 2249 return -EAGAIN; 2250 } ··· 2355 if (is_active) { 2356 pm_runtime_get_sync(&_gadget->dev); 2357 hw_device_reset(udc); 2358 + hw_device_state(udc->ep0out.qh.dma); 2359 } else { 2360 hw_device_state(0); 2361 if (udc->udc_driver->notify_event) ··· 2390 int (*bind)(struct usb_gadget *)) 2391 { 2392 struct ci13xxx *udc = _udc; 2393 + unsigned long flags; 2394 + int i, j; 2395 int retval = -ENOMEM; 2396 2397 trace("%p", driver); ··· 2427 2428 info("hw_ep_max = %d", hw_ep_max); 2429 2430 udc->gadget.dev.driver = NULL; 2431 2432 retval = 0; 2433 + for (i = 0; i < hw_ep_max/2; i++) { 2434 + for (j = RX; j <= TX; j++) { 2435 + int k = i + j * hw_ep_max/2; 2436 + struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[k]; 2437 2438 + scnprintf(mEp->name, sizeof(mEp->name), "ep%i%s", i, 2439 + (j == TX) ? "in" : "out"); 2440 2441 + mEp->lock = udc->lock; 2442 + mEp->device = &udc->gadget.dev; 2443 + mEp->td_pool = udc->td_pool; 2444 2445 + mEp->ep.name = mEp->name; 2446 + mEp->ep.ops = &usb_ep_ops; 2447 + mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; 2448 2449 + INIT_LIST_HEAD(&mEp->qh.queue); 2450 spin_unlock_irqrestore(udc->lock, flags); 2451 + mEp->qh.ptr = dma_pool_alloc(udc->qh_pool, GFP_KERNEL, 2452 + &mEp->qh.dma); 2453 spin_lock_irqsave(udc->lock, flags); 2454 + if (mEp->qh.ptr == NULL) 2455 retval = -ENOMEM; 2456 else 2457 + memset(mEp->qh.ptr, 0, sizeof(*mEp->qh.ptr)); 2458 + 2459 + /* skip ep0 out and in endpoints */ 2460 + if (i == 0) 2461 + continue; 2462 + 2463 list_add_tail(&mEp->ep.ep_list, &udc->gadget.ep_list); 2464 + } 2465 } 2466 if (retval) 2467 goto done; 2468 2469 + udc->gadget.ep0 = &udc->ep0in.ep; 2470 /* bind gadget */ 2471 driver->driver.bus = NULL; 2472 udc->gadget.dev.driver = &driver->driver; ··· 2479 goto done; 2480 } 2481 2482 + udc->driver = driver; 2483 pm_runtime_get_sync(&udc->gadget.dev); 2484 if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) { 2485 if (udc->vbus_active) { ··· 2490 } 2491 } 2492 2493 + retval = hw_device_state(udc->ep0out.qh.dma); 2494 if (retval) 2495 pm_runtime_put_sync(&udc->gadget.dev); 2496 2497 done: 2498 spin_unlock_irqrestore(udc->lock, flags); 2499 return retval; 2500 } 2501 EXPORT_SYMBOL(usb_gadget_probe_driver); ··· 2510 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) 2511 { 2512 struct ci13xxx *udc = _udc; 2513 + unsigned long i, flags; 2514 2515 trace("%p", driver); 2516 ··· 2546 for (i = 0; i < hw_ep_max; i++) { 2547 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; 2548 2549 + if (!list_empty(&mEp->ep.ep_list)) 2550 list_del_init(&mEp->ep.ep_list); 2551 2552 + if (mEp->qh.ptr != NULL) 2553 + dma_pool_free(udc->qh_pool, mEp->qh.ptr, mEp->qh.dma); 2554 } 2555 2556 + udc->gadget.ep0 = NULL; 2557 udc->driver = NULL; 2558 2559 spin_unlock_irqrestore(udc->lock, flags);
+6 -3
drivers/usb/gadget/ci13xxx_udc.h
··· 20 * DEFINE 21 *****************************************************************************/ 22 #define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ 23 - #define ENDPT_MAX (16) 24 #define CTRL_PAYLOAD_MAX (64) 25 #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ 26 #define TX (1) /* similar to USB_DIR_IN but can be used as an index */ ··· 88 struct list_head queue; 89 struct ci13xxx_qh *ptr; 90 dma_addr_t dma; 91 - } qh[2]; 92 - struct usb_request *status; 93 int wedge; 94 95 /* global resources */ ··· 118 119 struct dma_pool *qh_pool; /* DMA pool for queue heads */ 120 struct dma_pool *td_pool; /* DMA pool for transfer descs */ 121 122 struct usb_gadget gadget; /* USB slave device */ 123 struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ 124 125 struct usb_gadget_driver *driver; /* 3rd party gadget driver */ 126 struct ci13xxx_udc_driver *udc_driver; /* device controller driver */
··· 20 * DEFINE 21 *****************************************************************************/ 22 #define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ 23 + #define ENDPT_MAX (32) 24 #define CTRL_PAYLOAD_MAX (64) 25 #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ 26 #define TX (1) /* similar to USB_DIR_IN but can be used as an index */ ··· 88 struct list_head queue; 89 struct ci13xxx_qh *ptr; 90 dma_addr_t dma; 91 + } qh; 92 int wedge; 93 94 /* global resources */ ··· 119 120 struct dma_pool *qh_pool; /* DMA pool for queue heads */ 121 struct dma_pool *td_pool; /* DMA pool for transfer descs */ 122 + struct usb_request *status; /* ep0 status request */ 123 124 struct usb_gadget gadget; /* USB slave device */ 125 struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ 126 + u32 ep0_dir; /* ep0 direction */ 127 + #define ep0out ci13xxx_ep[0] 128 + #define ep0in ci13xxx_ep[16] 129 130 struct usb_gadget_driver *driver; /* 3rd party gadget driver */ 131 struct ci13xxx_udc_driver *udc_driver; /* device controller driver */
+3 -2
drivers/usb/gadget/composite.c
··· 928 */ 929 switch (ctrl->bRequestType & USB_RECIP_MASK) { 930 case USB_RECIP_INTERFACE: 931 - if (cdev->config) 932 - f = cdev->config->interface[intf]; 933 break; 934 935 case USB_RECIP_ENDPOINT:
··· 928 */ 929 switch (ctrl->bRequestType & USB_RECIP_MASK) { 930 case USB_RECIP_INTERFACE: 931 + if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES) 932 + break; 933 + f = cdev->config->interface[intf]; 934 break; 935 936 case USB_RECIP_ENDPOINT:
+76 -51
drivers/usb/gadget/pch_udc.c
··· 198 #define PCH_UDC_BRLEN 0x0F /* Burst length */ 199 #define PCH_UDC_THLEN 0x1F /* Threshold length */ 200 /* Value of EP Buffer Size */ 201 - #define UDC_EP0IN_BUFF_SIZE 64 202 - #define UDC_EPIN_BUFF_SIZE 512 203 - #define UDC_EP0OUT_BUFF_SIZE 64 204 - #define UDC_EPOUT_BUFF_SIZE 512 205 /* Value of EP maximum packet size */ 206 #define UDC_EP0IN_MAX_PKT_SIZE 64 207 #define UDC_EP0OUT_MAX_PKT_SIZE 64 ··· 351 struct pci_pool *data_requests; 352 struct pci_pool *stp_requests; 353 dma_addr_t dma_addr; 354 - unsigned long ep0out_buf[64]; 355 struct usb_ctrlrequest setup_data; 356 unsigned long phys_addr; 357 void __iomem *base_addr; ··· 361 362 #define PCH_UDC_PCI_BAR 1 363 #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 364 365 static const char ep0_string[] = "ep0in"; 366 static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */ ··· 1221 dev = ep->dev; 1222 if (req->dma_mapped) { 1223 if (ep->in) 1224 - pci_unmap_single(dev->pdev, req->req.dma, 1225 - req->req.length, PCI_DMA_TODEVICE); 1226 else 1227 - pci_unmap_single(dev->pdev, req->req.dma, 1228 - req->req.length, PCI_DMA_FROMDEVICE); 1229 req->dma_mapped = 0; 1230 req->req.dma = DMA_ADDR_INVALID; 1231 } ··· 1416 1417 pch_udc_clear_dma(ep->dev, DMA_DIR_RX); 1418 td_data = req->td_data; 1419 - ep->td_data = req->td_data; 1420 /* Set the status bits for all descriptors */ 1421 while (1) { 1422 td_data->status = (td_data->status & ~PCH_UDC_BUFF_STS) | ··· 1614 if (usbreq->length && 1615 ((usbreq->dma == DMA_ADDR_INVALID) || !usbreq->dma)) { 1616 if (ep->in) 1617 - usbreq->dma = pci_map_single(dev->pdev, usbreq->buf, 1618 - usbreq->length, PCI_DMA_TODEVICE); 1619 else 1620 - usbreq->dma = pci_map_single(dev->pdev, usbreq->buf, 1621 - usbreq->length, PCI_DMA_FROMDEVICE); 1622 req->dma_mapped = 1; 1623 } 1624 if (usbreq->length > 0) { 1625 - retval = prepare_dma(ep, req, gfp); 1626 if (retval) 1627 goto probe_end; 1628 } ··· 1651 pch_udc_wait_ep_stall(ep); 1652 pch_udc_ep_clear_nak(ep); 1653 pch_udc_enable_ep_interrupts(ep->dev, (1 << ep->num)); 1654 - pch_udc_set_dma(dev, DMA_DIR_TX); 1655 } 1656 } 1657 /* Now add this request to the ep's pending requests */ ··· 1930 PCH_UDC_BS_DMA_DONE) 1931 return; 1932 pch_udc_clear_dma(ep->dev, DMA_DIR_RX); 1933 if ((req->td_data_last->status & PCH_UDC_RXTX_STS) != 1934 PCH_UDC_RTS_SUCC) { 1935 dev_err(&dev->pdev->dev, "Invalid RXTX status (0x%08x) " ··· 1968 u32 epsts; 1969 struct pch_udc_ep *ep; 1970 1971 - ep = &dev->ep[2*ep_num]; 1972 epsts = ep->epsts; 1973 ep->epsts = 0; 1974 ··· 2013 struct pch_udc_ep *ep; 2014 struct pch_udc_request *req = NULL; 2015 2016 - ep = &dev->ep[2*ep_num + 1]; 2017 epsts = ep->epsts; 2018 ep->epsts = 0; 2019 ··· 2030 } 2031 if (epsts & UDC_EPSTS_HE) 2032 return; 2033 - if (epsts & UDC_EPSTS_RSS) 2034 pch_udc_ep_set_stall(ep); 2035 pch_udc_enable_ep_interrupts(ep->dev, 2036 PCH_UDC_EPINT(ep->in, ep->num)); 2037 if (epsts & UDC_EPSTS_RCS) { 2038 if (!dev->prot_stall) { 2039 pch_udc_ep_clear_stall(ep); ··· 2066 { 2067 u32 epsts; 2068 struct pch_udc_ep *ep; 2069 2070 ep = &dev->ep[UDC_EP0IN_IDX]; 2071 epsts = ep->epsts; 2072 ep->epsts = 0; 2073 ··· 2081 return; 2082 if (epsts & UDC_EPSTS_HE) 2083 return; 2084 - if ((epsts & UDC_EPSTS_TDC) && (!dev->stall)) 2085 pch_udc_complete_transfer(ep); 2086 /* On IN interrupt, provide data if we have any */ 2087 if ((epsts & UDC_EPSTS_IN) && !(epsts & UDC_EPSTS_TDC) && 2088 !(epsts & UDC_EPSTS_TXEMPTY)) ··· 2118 dev->stall = 0; 2119 dev->ep[UDC_EP0IN_IDX].halted = 0; 2120 dev->ep[UDC_EP0OUT_IDX].halted = 0; 2121 - /* In data not ready */ 2122 - pch_udc_ep_set_nak(&(dev->ep[UDC_EP0IN_IDX])); 2123 dev->setup_data = ep->td_stp->request; 2124 pch_udc_init_setup_buff(ep->td_stp); 2125 - pch_udc_clear_dma(dev, DMA_DIR_TX); 2126 pch_udc_ep_fifo_flush(&(dev->ep[UDC_EP0IN_IDX]), 2127 dev->ep[UDC_EP0IN_IDX].in); 2128 if ((dev->setup_data.bRequestType & USB_DIR_IN)) ··· 2136 setup_supported = dev->driver->setup(&dev->gadget, 2137 &dev->setup_data); 2138 spin_lock(&dev->lock); 2139 /* ep0 in returns data on IN phase */ 2140 if (setup_supported >= 0 && setup_supported < 2141 UDC_EP0IN_MAX_PKT_SIZE) { 2142 pch_udc_ep_clear_nak(&(dev->ep[UDC_EP0IN_IDX])); 2143 /* Gadget would have queued a request when 2144 * we called the setup */ 2145 - pch_udc_set_dma(dev, DMA_DIR_RX); 2146 - pch_udc_ep_clear_nak(ep); 2147 } else if (setup_supported < 0) { 2148 /* if unsupported request, then stall */ 2149 pch_udc_ep_set_stall(&(dev->ep[UDC_EP0IN_IDX])); ··· 2165 } 2166 } else if ((((stat & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == 2167 UDC_EPSTS_OUT_DATA) && !dev->stall) { 2168 - if (list_empty(&ep->queue)) { 2169 - dev_err(&dev->pdev->dev, "%s: No request\n", __func__); 2170 - ep->td_data->status = (ep->td_data->status & 2171 - ~PCH_UDC_BUFF_STS) | 2172 - PCH_UDC_BS_HST_RDY; 2173 - pch_udc_set_dma(dev, DMA_DIR_RX); 2174 - } else { 2175 - /* control write */ 2176 - /* next function will pickuo an clear the status */ 2177 ep->epsts = stat; 2178 - 2179 - pch_udc_svc_data_out(dev, 0); 2180 - /* re-program desc. pointer for possible ZLPs */ 2181 - pch_udc_ep_set_ddptr(ep, ep->td_data_phys); 2182 - pch_udc_set_dma(dev, DMA_DIR_RX); 2183 } 2184 } 2185 pch_udc_ep_set_rrdy(ep); 2186 } ··· 2188 struct pch_udc_ep *ep; 2189 struct pch_udc_request *req; 2190 2191 - ep = &dev->ep[2*ep_num]; 2192 if (!list_empty(&ep->queue)) { 2193 req = list_entry(ep->queue.next, struct pch_udc_request, queue); 2194 pch_udc_enable_ep_interrupts(ep->dev, ··· 2210 for (i = 0; i < PCH_UDC_USED_EP_NUM; i++) { 2211 /* IN */ 2212 if (ep_intr & (0x1 << i)) { 2213 - ep = &dev->ep[2*i]; 2214 ep->epsts = pch_udc_read_ep_status(ep); 2215 pch_udc_clear_ep_status(ep, ep->epsts); 2216 } 2217 /* OUT */ 2218 if (ep_intr & (0x10000 << i)) { 2219 - ep = &dev->ep[2*i+1]; 2220 ep->epsts = pch_udc_read_ep_status(ep); 2221 pch_udc_clear_ep_status(ep, ep->epsts); 2222 } ··· 2577 dev->ep[UDC_EP0IN_IDX].ep.maxpacket = UDC_EP0IN_MAX_PKT_SIZE; 2578 dev->ep[UDC_EP0OUT_IDX].ep.maxpacket = UDC_EP0OUT_MAX_PKT_SIZE; 2579 2580 - dev->dma_addr = pci_map_single(dev->pdev, dev->ep0out_buf, 256, 2581 - PCI_DMA_FROMDEVICE); 2582 - 2583 /* remove ep0 in and out from the list. They have own pointer */ 2584 list_del_init(&dev->ep[UDC_EP0IN_IDX].ep.ep_list); 2585 list_del_init(&dev->ep[UDC_EP0OUT_IDX].ep.ep_list); ··· 2648 dev->ep[UDC_EP0IN_IDX].td_stp_phys = 0; 2649 dev->ep[UDC_EP0IN_IDX].td_data = NULL; 2650 dev->ep[UDC_EP0IN_IDX].td_data_phys = 0; 2651 return 0; 2652 } 2653 ··· 2718 2719 pch_udc_disable_interrupts(dev, UDC_DEVINT_MSK); 2720 2721 - /* Assues that there are no pending requets with this driver */ 2722 driver->unbind(&dev->gadget); 2723 dev->gadget.dev.driver = NULL; 2724 dev->driver = NULL; ··· 2769 pci_pool_destroy(dev->stp_requests); 2770 } 2771 2772 pch_udc_exit(dev); 2773 2774 if (dev->irq_registered) ··· 2816 int ret; 2817 2818 pci_set_power_state(pdev, PCI_D0); 2819 - ret = pci_restore_state(pdev); 2820 - if (ret) { 2821 - dev_err(&pdev->dev, "%s: pci_restore_state failed\n", __func__); 2822 - return ret; 2823 - } 2824 ret = pci_enable_device(pdev); 2825 if (ret) { 2826 dev_err(&pdev->dev, "%s: pci_enable_device failed\n", __func__); ··· 2931 static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = { 2932 { 2933 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), 2934 .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, 2935 .class_mask = 0xffffffff, 2936 },
··· 198 #define PCH_UDC_BRLEN 0x0F /* Burst length */ 199 #define PCH_UDC_THLEN 0x1F /* Threshold length */ 200 /* Value of EP Buffer Size */ 201 + #define UDC_EP0IN_BUFF_SIZE 16 202 + #define UDC_EPIN_BUFF_SIZE 256 203 + #define UDC_EP0OUT_BUFF_SIZE 16 204 + #define UDC_EPOUT_BUFF_SIZE 256 205 /* Value of EP maximum packet size */ 206 #define UDC_EP0IN_MAX_PKT_SIZE 64 207 #define UDC_EP0OUT_MAX_PKT_SIZE 64 ··· 351 struct pci_pool *data_requests; 352 struct pci_pool *stp_requests; 353 dma_addr_t dma_addr; 354 + void *ep0out_buf; 355 struct usb_ctrlrequest setup_data; 356 unsigned long phys_addr; 357 void __iomem *base_addr; ··· 361 362 #define PCH_UDC_PCI_BAR 1 363 #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 364 + #define PCI_VENDOR_ID_ROHM 0x10DB 365 + #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D 366 367 static const char ep0_string[] = "ep0in"; 368 static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */ ··· 1219 dev = ep->dev; 1220 if (req->dma_mapped) { 1221 if (ep->in) 1222 + dma_unmap_single(&dev->pdev->dev, req->req.dma, 1223 + req->req.length, DMA_TO_DEVICE); 1224 else 1225 + dma_unmap_single(&dev->pdev->dev, req->req.dma, 1226 + req->req.length, DMA_FROM_DEVICE); 1227 req->dma_mapped = 0; 1228 req->req.dma = DMA_ADDR_INVALID; 1229 } ··· 1414 1415 pch_udc_clear_dma(ep->dev, DMA_DIR_RX); 1416 td_data = req->td_data; 1417 /* Set the status bits for all descriptors */ 1418 while (1) { 1419 td_data->status = (td_data->status & ~PCH_UDC_BUFF_STS) | ··· 1613 if (usbreq->length && 1614 ((usbreq->dma == DMA_ADDR_INVALID) || !usbreq->dma)) { 1615 if (ep->in) 1616 + usbreq->dma = dma_map_single(&dev->pdev->dev, 1617 + usbreq->buf, 1618 + usbreq->length, 1619 + DMA_TO_DEVICE); 1620 else 1621 + usbreq->dma = dma_map_single(&dev->pdev->dev, 1622 + usbreq->buf, 1623 + usbreq->length, 1624 + DMA_FROM_DEVICE); 1625 req->dma_mapped = 1; 1626 } 1627 if (usbreq->length > 0) { 1628 + retval = prepare_dma(ep, req, GFP_ATOMIC); 1629 if (retval) 1630 goto probe_end; 1631 } ··· 1646 pch_udc_wait_ep_stall(ep); 1647 pch_udc_ep_clear_nak(ep); 1648 pch_udc_enable_ep_interrupts(ep->dev, (1 << ep->num)); 1649 } 1650 } 1651 /* Now add this request to the ep's pending requests */ ··· 1926 PCH_UDC_BS_DMA_DONE) 1927 return; 1928 pch_udc_clear_dma(ep->dev, DMA_DIR_RX); 1929 + pch_udc_ep_set_ddptr(ep, 0); 1930 if ((req->td_data_last->status & PCH_UDC_RXTX_STS) != 1931 PCH_UDC_RTS_SUCC) { 1932 dev_err(&dev->pdev->dev, "Invalid RXTX status (0x%08x) " ··· 1963 u32 epsts; 1964 struct pch_udc_ep *ep; 1965 1966 + ep = &dev->ep[UDC_EPIN_IDX(ep_num)]; 1967 epsts = ep->epsts; 1968 ep->epsts = 0; 1969 ··· 2008 struct pch_udc_ep *ep; 2009 struct pch_udc_request *req = NULL; 2010 2011 + ep = &dev->ep[UDC_EPOUT_IDX(ep_num)]; 2012 epsts = ep->epsts; 2013 ep->epsts = 0; 2014 ··· 2025 } 2026 if (epsts & UDC_EPSTS_HE) 2027 return; 2028 + if (epsts & UDC_EPSTS_RSS) { 2029 pch_udc_ep_set_stall(ep); 2030 pch_udc_enable_ep_interrupts(ep->dev, 2031 PCH_UDC_EPINT(ep->in, ep->num)); 2032 + } 2033 if (epsts & UDC_EPSTS_RCS) { 2034 if (!dev->prot_stall) { 2035 pch_udc_ep_clear_stall(ep); ··· 2060 { 2061 u32 epsts; 2062 struct pch_udc_ep *ep; 2063 + struct pch_udc_ep *ep_out; 2064 2065 ep = &dev->ep[UDC_EP0IN_IDX]; 2066 + ep_out = &dev->ep[UDC_EP0OUT_IDX]; 2067 epsts = ep->epsts; 2068 ep->epsts = 0; 2069 ··· 2073 return; 2074 if (epsts & UDC_EPSTS_HE) 2075 return; 2076 + if ((epsts & UDC_EPSTS_TDC) && (!dev->stall)) { 2077 pch_udc_complete_transfer(ep); 2078 + pch_udc_clear_dma(dev, DMA_DIR_RX); 2079 + ep_out->td_data->status = (ep_out->td_data->status & 2080 + ~PCH_UDC_BUFF_STS) | 2081 + PCH_UDC_BS_HST_RDY; 2082 + pch_udc_ep_clear_nak(ep_out); 2083 + pch_udc_set_dma(dev, DMA_DIR_RX); 2084 + pch_udc_ep_set_rrdy(ep_out); 2085 + } 2086 /* On IN interrupt, provide data if we have any */ 2087 if ((epsts & UDC_EPSTS_IN) && !(epsts & UDC_EPSTS_TDC) && 2088 !(epsts & UDC_EPSTS_TXEMPTY)) ··· 2102 dev->stall = 0; 2103 dev->ep[UDC_EP0IN_IDX].halted = 0; 2104 dev->ep[UDC_EP0OUT_IDX].halted = 0; 2105 dev->setup_data = ep->td_stp->request; 2106 pch_udc_init_setup_buff(ep->td_stp); 2107 + pch_udc_clear_dma(dev, DMA_DIR_RX); 2108 pch_udc_ep_fifo_flush(&(dev->ep[UDC_EP0IN_IDX]), 2109 dev->ep[UDC_EP0IN_IDX].in); 2110 if ((dev->setup_data.bRequestType & USB_DIR_IN)) ··· 2122 setup_supported = dev->driver->setup(&dev->gadget, 2123 &dev->setup_data); 2124 spin_lock(&dev->lock); 2125 + 2126 + if (dev->setup_data.bRequestType & USB_DIR_IN) { 2127 + ep->td_data->status = (ep->td_data->status & 2128 + ~PCH_UDC_BUFF_STS) | 2129 + PCH_UDC_BS_HST_RDY; 2130 + pch_udc_ep_set_ddptr(ep, ep->td_data_phys); 2131 + } 2132 /* ep0 in returns data on IN phase */ 2133 if (setup_supported >= 0 && setup_supported < 2134 UDC_EP0IN_MAX_PKT_SIZE) { 2135 pch_udc_ep_clear_nak(&(dev->ep[UDC_EP0IN_IDX])); 2136 /* Gadget would have queued a request when 2137 * we called the setup */ 2138 + if (!(dev->setup_data.bRequestType & USB_DIR_IN)) { 2139 + pch_udc_set_dma(dev, DMA_DIR_RX); 2140 + pch_udc_ep_clear_nak(ep); 2141 + } 2142 } else if (setup_supported < 0) { 2143 /* if unsupported request, then stall */ 2144 pch_udc_ep_set_stall(&(dev->ep[UDC_EP0IN_IDX])); ··· 2142 } 2143 } else if ((((stat & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == 2144 UDC_EPSTS_OUT_DATA) && !dev->stall) { 2145 + pch_udc_clear_dma(dev, DMA_DIR_RX); 2146 + pch_udc_ep_set_ddptr(ep, 0); 2147 + if (!list_empty(&ep->queue)) { 2148 ep->epsts = stat; 2149 + pch_udc_svc_data_out(dev, PCH_UDC_EP0); 2150 } 2151 + pch_udc_set_dma(dev, DMA_DIR_RX); 2152 } 2153 pch_udc_ep_set_rrdy(ep); 2154 } ··· 2174 struct pch_udc_ep *ep; 2175 struct pch_udc_request *req; 2176 2177 + ep = &dev->ep[UDC_EPIN_IDX(ep_num)]; 2178 if (!list_empty(&ep->queue)) { 2179 req = list_entry(ep->queue.next, struct pch_udc_request, queue); 2180 pch_udc_enable_ep_interrupts(ep->dev, ··· 2196 for (i = 0; i < PCH_UDC_USED_EP_NUM; i++) { 2197 /* IN */ 2198 if (ep_intr & (0x1 << i)) { 2199 + ep = &dev->ep[UDC_EPIN_IDX(i)]; 2200 ep->epsts = pch_udc_read_ep_status(ep); 2201 pch_udc_clear_ep_status(ep, ep->epsts); 2202 } 2203 /* OUT */ 2204 if (ep_intr & (0x10000 << i)) { 2205 + ep = &dev->ep[UDC_EPOUT_IDX(i)]; 2206 ep->epsts = pch_udc_read_ep_status(ep); 2207 pch_udc_clear_ep_status(ep, ep->epsts); 2208 } ··· 2563 dev->ep[UDC_EP0IN_IDX].ep.maxpacket = UDC_EP0IN_MAX_PKT_SIZE; 2564 dev->ep[UDC_EP0OUT_IDX].ep.maxpacket = UDC_EP0OUT_MAX_PKT_SIZE; 2565 2566 /* remove ep0 in and out from the list. They have own pointer */ 2567 list_del_init(&dev->ep[UDC_EP0IN_IDX].ep.ep_list); 2568 list_del_init(&dev->ep[UDC_EP0OUT_IDX].ep.ep_list); ··· 2637 dev->ep[UDC_EP0IN_IDX].td_stp_phys = 0; 2638 dev->ep[UDC_EP0IN_IDX].td_data = NULL; 2639 dev->ep[UDC_EP0IN_IDX].td_data_phys = 0; 2640 + 2641 + dev->ep0out_buf = kzalloc(UDC_EP0OUT_BUFF_SIZE * 4, GFP_KERNEL); 2642 + if (!dev->ep0out_buf) 2643 + return -ENOMEM; 2644 + dev->dma_addr = dma_map_single(&dev->pdev->dev, dev->ep0out_buf, 2645 + UDC_EP0OUT_BUFF_SIZE * 4, 2646 + DMA_FROM_DEVICE); 2647 return 0; 2648 } 2649 ··· 2700 2701 pch_udc_disable_interrupts(dev, UDC_DEVINT_MSK); 2702 2703 + /* Assures that there are no pending requests with this driver */ 2704 + driver->disconnect(&dev->gadget); 2705 driver->unbind(&dev->gadget); 2706 dev->gadget.dev.driver = NULL; 2707 dev->driver = NULL; ··· 2750 pci_pool_destroy(dev->stp_requests); 2751 } 2752 2753 + if (dev->dma_addr) 2754 + dma_unmap_single(&dev->pdev->dev, dev->dma_addr, 2755 + UDC_EP0OUT_BUFF_SIZE * 4, DMA_FROM_DEVICE); 2756 + kfree(dev->ep0out_buf); 2757 + 2758 pch_udc_exit(dev); 2759 2760 if (dev->irq_registered) ··· 2792 int ret; 2793 2794 pci_set_power_state(pdev, PCI_D0); 2795 + pci_restore_state(pdev); 2796 ret = pci_enable_device(pdev); 2797 if (ret) { 2798 dev_err(&pdev->dev, "%s: pci_enable_device failed\n", __func__); ··· 2911 static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = { 2912 { 2913 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), 2914 + .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, 2915 + .class_mask = 0xffffffff, 2916 + }, 2917 + { 2918 + PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7213_IOH_UDC), 2919 .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, 2920 .class_mask = 0xffffffff, 2921 },
+9 -10
drivers/usb/gadget/printer.c
··· 131 * parameters are in UTF-8 (superset of ASCII's 7 bit characters). 132 */ 133 134 - static ushort __initdata idVendor; 135 module_param(idVendor, ushort, S_IRUGO); 136 MODULE_PARM_DESC(idVendor, "USB Vendor ID"); 137 138 - static ushort __initdata idProduct; 139 module_param(idProduct, ushort, S_IRUGO); 140 MODULE_PARM_DESC(idProduct, "USB Product ID"); 141 142 - static ushort __initdata bcdDevice; 143 module_param(bcdDevice, ushort, S_IRUGO); 144 MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); 145 146 - static char *__initdata iManufacturer; 147 module_param(iManufacturer, charp, S_IRUGO); 148 MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); 149 150 - static char *__initdata iProduct; 151 module_param(iProduct, charp, S_IRUGO); 152 MODULE_PARM_DESC(iProduct, "USB Product string"); 153 154 - static char *__initdata iSerialNum; 155 module_param(iSerialNum, charp, S_IRUGO); 156 MODULE_PARM_DESC(iSerialNum, "1"); 157 158 - static char *__initdata iPNPstring; 159 module_param(iPNPstring, charp, S_IRUGO); 160 MODULE_PARM_DESC(iPNPstring, "MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;"); 161 ··· 1596 int status; 1597 1598 mutex_lock(&usb_printer_gadget.lock_printer_io); 1599 - class_destroy(usb_gadget_class); 1600 - unregister_chrdev_region(g_printer_devno, 2); 1601 - 1602 status = usb_gadget_unregister_driver(&printer_driver); 1603 if (status) 1604 ERROR(dev, "usb_gadget_unregister_driver %x\n", status); 1605 1606 mutex_unlock(&usb_printer_gadget.lock_printer_io); 1607 } 1608 module_exit(cleanup);
··· 131 * parameters are in UTF-8 (superset of ASCII's 7 bit characters). 132 */ 133 134 + static ushort idVendor; 135 module_param(idVendor, ushort, S_IRUGO); 136 MODULE_PARM_DESC(idVendor, "USB Vendor ID"); 137 138 + static ushort idProduct; 139 module_param(idProduct, ushort, S_IRUGO); 140 MODULE_PARM_DESC(idProduct, "USB Product ID"); 141 142 + static ushort bcdDevice; 143 module_param(bcdDevice, ushort, S_IRUGO); 144 MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); 145 146 + static char *iManufacturer; 147 module_param(iManufacturer, charp, S_IRUGO); 148 MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); 149 150 + static char *iProduct; 151 module_param(iProduct, charp, S_IRUGO); 152 MODULE_PARM_DESC(iProduct, "USB Product string"); 153 154 + static char *iSerialNum; 155 module_param(iSerialNum, charp, S_IRUGO); 156 MODULE_PARM_DESC(iSerialNum, "1"); 157 158 + static char *iPNPstring; 159 module_param(iPNPstring, charp, S_IRUGO); 160 MODULE_PARM_DESC(iPNPstring, "MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;"); 161 ··· 1596 int status; 1597 1598 mutex_lock(&usb_printer_gadget.lock_printer_io); 1599 status = usb_gadget_unregister_driver(&printer_driver); 1600 if (status) 1601 ERROR(dev, "usb_gadget_unregister_driver %x\n", status); 1602 1603 + unregister_chrdev_region(g_printer_devno, 2); 1604 + class_destroy(usb_gadget_class); 1605 mutex_unlock(&usb_printer_gadget.lock_printer_io); 1606 } 1607 module_exit(cleanup);
-13
drivers/usb/host/ehci-fsl.c
··· 52 struct resource *res; 53 int irq; 54 int retval; 55 - unsigned int temp; 56 57 pr_debug("initializing FSL-SOC USB Controller\n"); 58 ··· 124 retval = -ENODEV; 125 goto err3; 126 } 127 - 128 - /* 129 - * Check if it is MPC5121 SoC, otherwise set pdata->have_sysif_regs 130 - * flag for 83xx or 8536 system interface registers. 131 - */ 132 - if (pdata->big_endian_mmio) 133 - temp = in_be32(hcd->regs + FSL_SOC_USB_ID); 134 - else 135 - temp = in_le32(hcd->regs + FSL_SOC_USB_ID); 136 - 137 - if ((temp & ID_MSK) != (~((temp & NID_MSK) >> 8) & ID_MSK)) 138 - pdata->have_sysif_regs = 1; 139 140 /* Enable USB controller, 83xx or 8536 */ 141 if (pdata->have_sysif_regs)
··· 52 struct resource *res; 53 int irq; 54 int retval; 55 56 pr_debug("initializing FSL-SOC USB Controller\n"); 57 ··· 125 retval = -ENODEV; 126 goto err3; 127 } 128 129 /* Enable USB controller, 83xx or 8536 */ 130 if (pdata->have_sysif_regs)
-3
drivers/usb/host/ehci-fsl.h
··· 19 #define _EHCI_FSL_H 20 21 /* offsets for the non-ehci registers in the FSL SOC USB controller */ 22 - #define FSL_SOC_USB_ID 0x0 23 - #define ID_MSK 0x3f 24 - #define NID_MSK 0x3f00 25 #define FSL_SOC_USB_ULPIVP 0x170 26 #define FSL_SOC_USB_PORTSC1 0x184 27 #define PORT_PTS_MSK (3<<30)
··· 19 #define _EHCI_FSL_H 20 21 /* offsets for the non-ehci registers in the FSL SOC USB controller */ 22 #define FSL_SOC_USB_ULPIVP 0x170 23 #define FSL_SOC_USB_PORTSC1 0x184 24 #define PORT_PTS_MSK (3<<30)
+12 -7
drivers/usb/host/ehci-hcd.c
··· 572 ehci->iaa_watchdog.function = ehci_iaa_watchdog; 573 ehci->iaa_watchdog.data = (unsigned long) ehci; 574 575 /* 576 * hw default: 1K periodic list heads, one per frame. 577 * periodic_size can shrink by USBCMD update if hcc_params allows. ··· 581 ehci->periodic_size = DEFAULT_I_TDPS; 582 INIT_LIST_HEAD(&ehci->cached_itd_list); 583 INIT_LIST_HEAD(&ehci->cached_sitd_list); 584 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) 585 return retval; 586 587 /* controllers may cache some of the periodic schedule ... */ 588 - hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); 589 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache 590 ehci->i_thresh = 2 + 8; 591 else // N microframes cached ··· 648 /* periodic schedule size can be smaller than default */ 649 temp &= ~(3 << 2); 650 temp |= (EHCI_TUNE_FLS << 2); 651 - switch (EHCI_TUNE_FLS) { 652 - case 0: ehci->periodic_size = 1024; break; 653 - case 1: ehci->periodic_size = 512; break; 654 - case 2: ehci->periodic_size = 256; break; 655 - default: BUG(); 656 - } 657 } 658 if (HCC_LPM(hcc_params)) { 659 /* support link power management EHCI 1.1 addendum */
··· 572 ehci->iaa_watchdog.function = ehci_iaa_watchdog; 573 ehci->iaa_watchdog.data = (unsigned long) ehci; 574 575 + hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); 576 + 577 /* 578 * hw default: 1K periodic list heads, one per frame. 579 * periodic_size can shrink by USBCMD update if hcc_params allows. ··· 579 ehci->periodic_size = DEFAULT_I_TDPS; 580 INIT_LIST_HEAD(&ehci->cached_itd_list); 581 INIT_LIST_HEAD(&ehci->cached_sitd_list); 582 + 583 + if (HCC_PGM_FRAMELISTLEN(hcc_params)) { 584 + /* periodic schedule size can be smaller than default */ 585 + switch (EHCI_TUNE_FLS) { 586 + case 0: ehci->periodic_size = 1024; break; 587 + case 1: ehci->periodic_size = 512; break; 588 + case 2: ehci->periodic_size = 256; break; 589 + default: BUG(); 590 + } 591 + } 592 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) 593 return retval; 594 595 /* controllers may cache some of the periodic schedule ... */ 596 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache 597 ehci->i_thresh = 2 + 8; 598 else // N microframes cached ··· 637 /* periodic schedule size can be smaller than default */ 638 temp &= ~(3 << 2); 639 temp |= (EHCI_TUNE_FLS << 2); 640 } 641 if (HCC_LPM(hcc_params)) { 642 /* support link power management EHCI 1.1 addendum */
+23 -2
drivers/usb/host/ehci-mxc.c
··· 21 #include <linux/clk.h> 22 #include <linux/delay.h> 23 #include <linux/usb/otg.h> 24 #include <linux/slab.h> 25 26 #include <mach/mxc_ehci.h> 27 28 #define ULPI_VIEWPORT_OFFSET 0x170 29 ··· 117 struct usb_hcd *hcd; 118 struct resource *res; 119 int irq, ret; 120 struct ehci_mxc_priv *priv; 121 struct device *dev = &pdev->dev; 122 struct ehci_hcd *ehci; ··· 181 clk_enable(priv->ahbclk); 182 } 183 184 - /* "dr" device has its own clock */ 185 - if (pdev->id == 0) { 186 priv->phy1clk = clk_get(dev, "usb_phy1"); 187 if (IS_ERR(priv->phy1clk)) { 188 ret = PTR_ERR(priv->phy1clk); ··· 243 ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); 244 if (ret) 245 goto err_add; 246 247 return 0; 248
··· 21 #include <linux/clk.h> 22 #include <linux/delay.h> 23 #include <linux/usb/otg.h> 24 + #include <linux/usb/ulpi.h> 25 #include <linux/slab.h> 26 27 #include <mach/mxc_ehci.h> 28 + 29 + #include <asm/mach-types.h> 30 31 #define ULPI_VIEWPORT_OFFSET 0x170 32 ··· 114 struct usb_hcd *hcd; 115 struct resource *res; 116 int irq, ret; 117 + unsigned int flags; 118 struct ehci_mxc_priv *priv; 119 struct device *dev = &pdev->dev; 120 struct ehci_hcd *ehci; ··· 177 clk_enable(priv->ahbclk); 178 } 179 180 + /* "dr" device has its own clock on i.MX51 */ 181 + if (cpu_is_mx51() && (pdev->id == 0)) { 182 priv->phy1clk = clk_get(dev, "usb_phy1"); 183 if (IS_ERR(priv->phy1clk)) { 184 ret = PTR_ERR(priv->phy1clk); ··· 239 ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); 240 if (ret) 241 goto err_add; 242 + 243 + if (pdata->otg) { 244 + /* 245 + * efikamx and efikasb have some hardware bug which is 246 + * preventing usb to work unless CHRGVBUS is set. 247 + * It's in violation of USB specs 248 + */ 249 + if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) { 250 + flags = otg_io_read(pdata->otg, ULPI_OTG_CTRL); 251 + flags |= ULPI_OTG_CTRL_CHRGVBUS; 252 + ret = otg_io_write(pdata->otg, flags, ULPI_OTG_CTRL); 253 + if (ret) { 254 + dev_err(dev, "unable to set CHRVBUS\n"); 255 + goto err_add; 256 + } 257 + } 258 + } 259 260 return 0; 261
+20 -13
drivers/usb/host/ehci-pci.c
··· 44 return 0; 45 } 46 47 - static int ehci_quirk_amd_SB800(struct ehci_hcd *ehci) 48 { 49 struct pci_dev *amd_smbus_dev; 50 u8 rev = 0; 51 52 amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL); 53 - if (!amd_smbus_dev) 54 - return 0; 55 - 56 - pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); 57 - if (rev < 0x40) { 58 - pci_dev_put(amd_smbus_dev); 59 - amd_smbus_dev = NULL; 60 - return 0; 61 } 62 63 if (!amd_nb_dev) 64 amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL); 65 - if (!amd_nb_dev) 66 - ehci_err(ehci, "QUIRK: unable to get AMD NB device\n"); 67 68 - ehci_info(ehci, "QUIRK: Enable AMD SB800 L1 fix\n"); 69 70 pci_dev_put(amd_smbus_dev); 71 amd_smbus_dev = NULL; ··· 138 /* cache this readonly data; minimize chip reads */ 139 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 140 141 - if (ehci_quirk_amd_SB800(ehci)) 142 ehci->amd_l1_fix = 1; 143 144 retval = ehci_halt(ehci);
··· 44 return 0; 45 } 46 47 + static int ehci_quirk_amd_hudson(struct ehci_hcd *ehci) 48 { 49 struct pci_dev *amd_smbus_dev; 50 u8 rev = 0; 51 52 amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL); 53 + if (amd_smbus_dev) { 54 + pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); 55 + if (rev < 0x40) { 56 + pci_dev_put(amd_smbus_dev); 57 + amd_smbus_dev = NULL; 58 + return 0; 59 + } 60 + } else { 61 + amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x780b, NULL); 62 + if (!amd_smbus_dev) 63 + return 0; 64 + pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); 65 + if (rev < 0x11 || rev > 0x18) { 66 + pci_dev_put(amd_smbus_dev); 67 + amd_smbus_dev = NULL; 68 + return 0; 69 + } 70 } 71 72 if (!amd_nb_dev) 73 amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL); 74 75 + ehci_info(ehci, "QUIRK: Enable exception for AMD Hudson ASPM\n"); 76 77 pci_dev_put(amd_smbus_dev); 78 amd_smbus_dev = NULL; ··· 131 /* cache this readonly data; minimize chip reads */ 132 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 133 134 + if (ehci_quirk_amd_hudson(ehci)) 135 ehci->amd_l1_fix = 1; 136 137 retval = ehci_halt(ehci);
+8 -3
drivers/usb/host/fsl-mph-dr-of.c
··· 262 } 263 } 264 265 - struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = { 266 .big_endian_desc = 1, 267 .big_endian_mmio = 1, 268 .es = 1, 269 .le_setup_buf = 1, 270 .init = fsl_usb2_mpc5121_init, 271 .exit = fsl_usb2_mpc5121_exit, 272 }; 273 #endif /* CONFIG_PPC_MPC512x */ 274 275 static const struct of_device_id fsl_usb2_mph_dr_of_match[] = { 276 - { .compatible = "fsl-usb2-mph", }, 277 - { .compatible = "fsl-usb2-dr", }, 278 #ifdef CONFIG_PPC_MPC512x 279 { .compatible = "fsl,mpc5121-usb2-dr", .data = &fsl_usb2_mpc5121_pd, }, 280 #endif
··· 262 } 263 } 264 265 + static struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = { 266 .big_endian_desc = 1, 267 .big_endian_mmio = 1, 268 .es = 1, 269 + .have_sysif_regs = 0, 270 .le_setup_buf = 1, 271 .init = fsl_usb2_mpc5121_init, 272 .exit = fsl_usb2_mpc5121_exit, 273 }; 274 #endif /* CONFIG_PPC_MPC512x */ 275 276 + static struct fsl_usb2_platform_data fsl_usb2_mpc8xxx_pd = { 277 + .have_sysif_regs = 1, 278 + }; 279 + 280 static const struct of_device_id fsl_usb2_mph_dr_of_match[] = { 281 + { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, }, 282 + { .compatible = "fsl-usb2-dr", .data = &fsl_usb2_mpc8xxx_pd, }, 283 #ifdef CONFIG_PPC_MPC512x 284 { .compatible = "fsl,mpc5121-usb2-dr", .data = &fsl_usb2_mpc5121_pd, }, 285 #endif
+51 -40
drivers/usb/host/xhci-ring.c
··· 308 /* Ring the host controller doorbell after placing a command on the ring */ 309 void xhci_ring_cmd_db(struct xhci_hcd *xhci) 310 { 311 - u32 temp; 312 - 313 xhci_dbg(xhci, "// Ding dong!\n"); 314 - temp = xhci_readl(xhci, &xhci->dba->doorbell[0]) & DB_MASK; 315 - xhci_writel(xhci, temp | DB_TARGET_HOST, &xhci->dba->doorbell[0]); 316 /* Flush PCI posted writes */ 317 xhci_readl(xhci, &xhci->dba->doorbell[0]); 318 } ··· 319 unsigned int ep_index, 320 unsigned int stream_id) 321 { 322 - struct xhci_virt_ep *ep; 323 - unsigned int ep_state; 324 - u32 field; 325 __u32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; 326 327 - ep = &xhci->devs[slot_id]->eps[ep_index]; 328 - ep_state = ep->ep_state; 329 /* Don't ring the doorbell for this endpoint if there are pending 330 - * cancellations because the we don't want to interrupt processing. 331 * We don't want to restart any stream rings if there's a set dequeue 332 * pointer command pending because the device can choose to start any 333 * stream once the endpoint is on the HW schedule. 334 * FIXME - check all the stream rings for pending cancellations. 335 */ 336 - if (!(ep_state & EP_HALT_PENDING) && !(ep_state & SET_DEQ_PENDING) 337 - && !(ep_state & EP_HALTED)) { 338 - field = xhci_readl(xhci, db_addr) & DB_MASK; 339 - field |= EPI_TO_DB(ep_index) | STREAM_ID_TO_DB(stream_id); 340 - xhci_writel(xhci, field, db_addr); 341 - } 342 } 343 344 /* Ring the doorbell for any rings with pending URBs */ ··· 1183 1184 addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1); 1185 temp = xhci_readl(xhci, addr); 1186 - if ((temp & PORT_CONNECT) && (hcd->state == HC_STATE_SUSPENDED)) { 1187 xhci_dbg(xhci, "resume root hub\n"); 1188 usb_hcd_resume_root_hub(hcd); 1189 } ··· 1705 /* Others already handled above */ 1706 break; 1707 } 1708 - dev_dbg(&td->urb->dev->dev, 1709 - "ep %#x - asked for %d bytes, " 1710 "%d bytes untransferred\n", 1711 td->urb->ep->desc.bEndpointAddress, 1712 td->urb->transfer_buffer_length, ··· 2383 } 2384 xhci_dbg(xhci, "\n"); 2385 if (!in_interrupt()) 2386 - dev_dbg(&urb->dev->dev, "ep %#x - urb len = %d, sglist used, num_trbs = %d\n", 2387 urb->ep->desc.bEndpointAddress, 2388 urb->transfer_buffer_length, 2389 num_trbs); ··· 2409 2410 static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, 2411 unsigned int ep_index, unsigned int stream_id, int start_cycle, 2412 - struct xhci_generic_trb *start_trb, struct xhci_td *td) 2413 { 2414 /* 2415 * Pass all the TRBs to the hardware at once and make sure this write 2416 * isn't reordered. 2417 */ 2418 wmb(); 2419 - start_trb->field[3] |= start_cycle; 2420 xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); 2421 } 2422 ··· 2447 * to set the polling interval (once the API is added). 2448 */ 2449 if (xhci_interval != ep_interval) { 2450 - if (!printk_ratelimit()) 2451 dev_dbg(&urb->dev->dev, "Driver uses different interval" 2452 " (%d microframe%s) than xHCI " 2453 "(%d microframe%s)\n", ··· 2549 u32 remainder = 0; 2550 2551 /* Don't change the cycle bit of the first TRB until later */ 2552 - if (first_trb) 2553 first_trb = false; 2554 - else 2555 field |= ep_ring->cycle_state; 2556 2557 /* Chain all the TRBs together; clear the chain bit in the last ··· 2625 2626 check_trb_math(urb, num_trbs, running_total); 2627 giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, 2628 - start_cycle, start_trb, td); 2629 return 0; 2630 } 2631 ··· 2671 /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ 2672 2673 if (!in_interrupt()) 2674 - dev_dbg(&urb->dev->dev, "ep %#x - urb len = %#x (%d), addr = %#llx, num_trbs = %d\n", 2675 urb->ep->desc.bEndpointAddress, 2676 urb->transfer_buffer_length, 2677 urb->transfer_buffer_length, ··· 2712 field = 0; 2713 2714 /* Don't change the cycle bit of the first TRB until later */ 2715 - if (first_trb) 2716 first_trb = false; 2717 - else 2718 field |= ep_ring->cycle_state; 2719 2720 /* Chain all the TRBs together; clear the chain bit in the last ··· 2760 2761 check_trb_math(urb, num_trbs, running_total); 2762 giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, 2763 - start_cycle, start_trb, td); 2764 return 0; 2765 } 2766 ··· 2821 /* Queue setup TRB - see section 6.4.1.2.1 */ 2822 /* FIXME better way to translate setup_packet into two u32 fields? */ 2823 setup = (struct usb_ctrlrequest *) urb->setup_packet; 2824 queue_trb(xhci, ep_ring, false, true, 2825 /* FIXME endianness is probably going to bite my ass here. */ 2826 setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, 2827 setup->wIndex | setup->wLength << 16, 2828 TRB_LEN(8) | TRB_INTR_TARGET(0), 2829 /* Immediate data in pointer */ 2830 - TRB_IDT | TRB_TYPE(TRB_SETUP)); 2831 2832 /* If there's data, queue data TRBs */ 2833 field = 0; ··· 2866 field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); 2867 2868 giveback_first_trb(xhci, slot_id, ep_index, 0, 2869 - start_cycle, start_trb, td); 2870 return 0; 2871 } 2872 ··· 2907 int running_total, trb_buff_len, td_len, td_remain_len, ret; 2908 u64 start_addr, addr; 2909 int i, j; 2910 2911 ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; 2912 ··· 2918 } 2919 2920 if (!in_interrupt()) 2921 - dev_dbg(&urb->dev->dev, "ep %#x - urb len = %#x (%d)," 2922 " addr = %#llx, num_tds = %d\n", 2923 urb->ep->desc.bEndpointAddress, 2924 urb->transfer_buffer_length, ··· 2958 field |= TRB_TYPE(TRB_ISOC); 2959 /* Assume URB_ISO_ASAP is set */ 2960 field |= TRB_SIA; 2961 - if (i > 0) 2962 field |= ep_ring->cycle_state; 2963 first_trb = false; 2964 } else { ··· 2976 */ 2977 if (j < trbs_per_td - 1) { 2978 field |= TRB_CHAIN; 2979 } else { 2980 td->last_trb = ep_ring->enqueue; 2981 field |= TRB_IOC; 2982 } 2983 2984 /* Calculate TRB length */ ··· 2993 length_field = TRB_LEN(trb_buff_len) | 2994 remainder | 2995 TRB_INTR_TARGET(0); 2996 - queue_trb(xhci, ep_ring, false, false, 2997 lower_32_bits(addr), 2998 upper_32_bits(addr), 2999 length_field, ··· 3016 } 3017 } 3018 3019 - wmb(); 3020 - start_trb->field[3] |= start_cycle; 3021 - 3022 - xhci_ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id); 3023 return 0; 3024 } 3025 ··· 3075 * to set the polling interval (once the API is added). 3076 */ 3077 if (xhci_interval != ep_interval) { 3078 - if (!printk_ratelimit()) 3079 dev_dbg(&urb->dev->dev, "Driver uses different interval" 3080 " (%d microframe%s) than xHCI " 3081 "(%d microframe%s)\n",
··· 308 /* Ring the host controller doorbell after placing a command on the ring */ 309 void xhci_ring_cmd_db(struct xhci_hcd *xhci) 310 { 311 xhci_dbg(xhci, "// Ding dong!\n"); 312 + xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]); 313 /* Flush PCI posted writes */ 314 xhci_readl(xhci, &xhci->dba->doorbell[0]); 315 } ··· 322 unsigned int ep_index, 323 unsigned int stream_id) 324 { 325 __u32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; 326 + struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; 327 + unsigned int ep_state = ep->ep_state; 328 329 /* Don't ring the doorbell for this endpoint if there are pending 330 + * cancellations because we don't want to interrupt processing. 331 * We don't want to restart any stream rings if there's a set dequeue 332 * pointer command pending because the device can choose to start any 333 * stream once the endpoint is on the HW schedule. 334 * FIXME - check all the stream rings for pending cancellations. 335 */ 336 + if ((ep_state & EP_HALT_PENDING) || (ep_state & SET_DEQ_PENDING) || 337 + (ep_state & EP_HALTED)) 338 + return; 339 + xhci_writel(xhci, DB_VALUE(ep_index, stream_id), db_addr); 340 + /* The CPU has better things to do at this point than wait for a 341 + * write-posting flush. It'll get there soon enough. 342 + */ 343 } 344 345 /* Ring the doorbell for any rings with pending URBs */ ··· 1188 1189 addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1); 1190 temp = xhci_readl(xhci, addr); 1191 + if (hcd->state == HC_STATE_SUSPENDED) { 1192 xhci_dbg(xhci, "resume root hub\n"); 1193 usb_hcd_resume_root_hub(hcd); 1194 } ··· 1710 /* Others already handled above */ 1711 break; 1712 } 1713 + xhci_dbg(xhci, "ep %#x - asked for %d bytes, " 1714 "%d bytes untransferred\n", 1715 td->urb->ep->desc.bEndpointAddress, 1716 td->urb->transfer_buffer_length, ··· 2389 } 2390 xhci_dbg(xhci, "\n"); 2391 if (!in_interrupt()) 2392 + xhci_dbg(xhci, "ep %#x - urb len = %d, sglist used, " 2393 + "num_trbs = %d\n", 2394 urb->ep->desc.bEndpointAddress, 2395 urb->transfer_buffer_length, 2396 num_trbs); ··· 2414 2415 static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, 2416 unsigned int ep_index, unsigned int stream_id, int start_cycle, 2417 + struct xhci_generic_trb *start_trb) 2418 { 2419 /* 2420 * Pass all the TRBs to the hardware at once and make sure this write 2421 * isn't reordered. 2422 */ 2423 wmb(); 2424 + if (start_cycle) 2425 + start_trb->field[3] |= start_cycle; 2426 + else 2427 + start_trb->field[3] &= ~0x1; 2428 xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); 2429 } 2430 ··· 2449 * to set the polling interval (once the API is added). 2450 */ 2451 if (xhci_interval != ep_interval) { 2452 + if (printk_ratelimit()) 2453 dev_dbg(&urb->dev->dev, "Driver uses different interval" 2454 " (%d microframe%s) than xHCI " 2455 "(%d microframe%s)\n", ··· 2551 u32 remainder = 0; 2552 2553 /* Don't change the cycle bit of the first TRB until later */ 2554 + if (first_trb) { 2555 first_trb = false; 2556 + if (start_cycle == 0) 2557 + field |= 0x1; 2558 + } else 2559 field |= ep_ring->cycle_state; 2560 2561 /* Chain all the TRBs together; clear the chain bit in the last ··· 2625 2626 check_trb_math(urb, num_trbs, running_total); 2627 giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, 2628 + start_cycle, start_trb); 2629 return 0; 2630 } 2631 ··· 2671 /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ 2672 2673 if (!in_interrupt()) 2674 + xhci_dbg(xhci, "ep %#x - urb len = %#x (%d), " 2675 + "addr = %#llx, num_trbs = %d\n", 2676 urb->ep->desc.bEndpointAddress, 2677 urb->transfer_buffer_length, 2678 urb->transfer_buffer_length, ··· 2711 field = 0; 2712 2713 /* Don't change the cycle bit of the first TRB until later */ 2714 + if (first_trb) { 2715 first_trb = false; 2716 + if (start_cycle == 0) 2717 + field |= 0x1; 2718 + } else 2719 field |= ep_ring->cycle_state; 2720 2721 /* Chain all the TRBs together; clear the chain bit in the last ··· 2757 2758 check_trb_math(urb, num_trbs, running_total); 2759 giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, 2760 + start_cycle, start_trb); 2761 return 0; 2762 } 2763 ··· 2818 /* Queue setup TRB - see section 6.4.1.2.1 */ 2819 /* FIXME better way to translate setup_packet into two u32 fields? */ 2820 setup = (struct usb_ctrlrequest *) urb->setup_packet; 2821 + field = 0; 2822 + field |= TRB_IDT | TRB_TYPE(TRB_SETUP); 2823 + if (start_cycle == 0) 2824 + field |= 0x1; 2825 queue_trb(xhci, ep_ring, false, true, 2826 /* FIXME endianness is probably going to bite my ass here. */ 2827 setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, 2828 setup->wIndex | setup->wLength << 16, 2829 TRB_LEN(8) | TRB_INTR_TARGET(0), 2830 /* Immediate data in pointer */ 2831 + field); 2832 2833 /* If there's data, queue data TRBs */ 2834 field = 0; ··· 2859 field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); 2860 2861 giveback_first_trb(xhci, slot_id, ep_index, 0, 2862 + start_cycle, start_trb); 2863 return 0; 2864 } 2865 ··· 2900 int running_total, trb_buff_len, td_len, td_remain_len, ret; 2901 u64 start_addr, addr; 2902 int i, j; 2903 + bool more_trbs_coming; 2904 2905 ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; 2906 ··· 2910 } 2911 2912 if (!in_interrupt()) 2913 + xhci_dbg(xhci, "ep %#x - urb len = %#x (%d)," 2914 " addr = %#llx, num_tds = %d\n", 2915 urb->ep->desc.bEndpointAddress, 2916 urb->transfer_buffer_length, ··· 2950 field |= TRB_TYPE(TRB_ISOC); 2951 /* Assume URB_ISO_ASAP is set */ 2952 field |= TRB_SIA; 2953 + if (i == 0) { 2954 + if (start_cycle == 0) 2955 + field |= 0x1; 2956 + } else 2957 field |= ep_ring->cycle_state; 2958 first_trb = false; 2959 } else { ··· 2965 */ 2966 if (j < trbs_per_td - 1) { 2967 field |= TRB_CHAIN; 2968 + more_trbs_coming = true; 2969 } else { 2970 td->last_trb = ep_ring->enqueue; 2971 field |= TRB_IOC; 2972 + more_trbs_coming = false; 2973 } 2974 2975 /* Calculate TRB length */ ··· 2980 length_field = TRB_LEN(trb_buff_len) | 2981 remainder | 2982 TRB_INTR_TARGET(0); 2983 + queue_trb(xhci, ep_ring, false, more_trbs_coming, 2984 lower_32_bits(addr), 2985 upper_32_bits(addr), 2986 length_field, ··· 3003 } 3004 } 3005 3006 + giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, 3007 + start_cycle, start_trb); 3008 return 0; 3009 } 3010 ··· 3064 * to set the polling interval (once the API is added). 3065 */ 3066 if (xhci_interval != ep_interval) { 3067 + if (printk_ratelimit()) 3068 dev_dbg(&urb->dev->dev, "Driver uses different interval" 3069 " (%d microframe%s) than xHCI " 3070 "(%d microframe%s)\n",
+25 -35
drivers/usb/host/xhci.c
··· 226 static int xhci_setup_msix(struct xhci_hcd *xhci) 227 { 228 int i, ret = 0; 229 - struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); 230 231 /* 232 * calculate number of msi-x vectors supported. ··· 266 goto disable_msix; 267 } 268 269 return ret; 270 271 disable_msix: ··· 282 /* Free any IRQs and disable MSI-X */ 283 static void xhci_cleanup_msix(struct xhci_hcd *xhci) 284 { 285 - struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); 286 287 xhci_free_irq(xhci); 288 ··· 295 pci_disable_msi(pdev); 296 } 297 298 return; 299 } 300 ··· 512 spin_lock_irq(&xhci->lock); 513 xhci_halt(xhci); 514 xhci_reset(xhci); 515 - xhci_cleanup_msix(xhci); 516 spin_unlock_irq(&xhci->lock); 517 518 #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING 519 /* Tell the event ring poll function not to reschedule */ ··· 549 550 spin_lock_irq(&xhci->lock); 551 xhci_halt(xhci); 552 - xhci_cleanup_msix(xhci); 553 spin_unlock_irq(&xhci->lock); 554 555 xhci_dbg(xhci, "xhci_shutdown completed - status = %x\n", 556 xhci_readl(xhci, &xhci->op_regs->status)); ··· 653 int rc = 0; 654 struct usb_hcd *hcd = xhci_to_hcd(xhci); 655 u32 command; 656 657 spin_lock_irq(&xhci->lock); 658 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); ··· 684 spin_unlock_irq(&xhci->lock); 685 return -ETIMEDOUT; 686 } 687 - /* step 5: remove core well power */ 688 - xhci_cleanup_msix(xhci); 689 spin_unlock_irq(&xhci->lock); 690 691 return rc; 692 } ··· 706 { 707 u32 command, temp = 0; 708 struct usb_hcd *hcd = xhci_to_hcd(xhci); 709 - struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 710 int old_state, retval; 711 712 old_state = hcd->state; ··· 740 xhci_dbg(xhci, "Stop HCD\n"); 741 xhci_halt(xhci); 742 xhci_reset(xhci); 743 - if (hibernated) 744 - xhci_cleanup_msix(xhci); 745 spin_unlock_irq(&xhci->lock); 746 747 #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING 748 /* Tell the event ring poll function not to reschedule */ ··· 775 return retval; 776 } 777 778 - spin_unlock_irq(&xhci->lock); 779 - /* Re-setup MSI-X */ 780 - if (hcd->irq) 781 - free_irq(hcd->irq, hcd); 782 - hcd->irq = -1; 783 - 784 - retval = xhci_setup_msix(xhci); 785 - if (retval) 786 - /* fall back to msi*/ 787 - retval = xhci_setup_msi(xhci); 788 - 789 - if (retval) { 790 - /* fall back to legacy interrupt*/ 791 - retval = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, 792 - hcd->irq_descr, hcd); 793 - if (retval) { 794 - xhci_err(xhci, "request interrupt %d failed\n", 795 - pdev->irq); 796 - return retval; 797 - } 798 - hcd->irq = pdev->irq; 799 - } 800 - 801 - spin_lock_irq(&xhci->lock); 802 /* step 4: set Run/Stop bit */ 803 command = xhci_readl(xhci, &xhci->op_regs->command); 804 command |= CMD_RUN; ··· 2431 xhci_err(xhci, "Error while assigning device slot ID\n"); 2432 return 0; 2433 } 2434 - /* xhci_alloc_virt_device() does not touch rings; no need to lock */ 2435 - if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_KERNEL)) { 2436 /* Disable slot, if we can do it without mem alloc */ 2437 xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); 2438 spin_lock_irqsave(&xhci->lock, flags);
··· 226 static int xhci_setup_msix(struct xhci_hcd *xhci) 227 { 228 int i, ret = 0; 229 + struct usb_hcd *hcd = xhci_to_hcd(xhci); 230 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 231 232 /* 233 * calculate number of msi-x vectors supported. ··· 265 goto disable_msix; 266 } 267 268 + hcd->msix_enabled = 1; 269 return ret; 270 271 disable_msix: ··· 280 /* Free any IRQs and disable MSI-X */ 281 static void xhci_cleanup_msix(struct xhci_hcd *xhci) 282 { 283 + struct usb_hcd *hcd = xhci_to_hcd(xhci); 284 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 285 286 xhci_free_irq(xhci); 287 ··· 292 pci_disable_msi(pdev); 293 } 294 295 + hcd->msix_enabled = 0; 296 return; 297 } 298 ··· 508 spin_lock_irq(&xhci->lock); 509 xhci_halt(xhci); 510 xhci_reset(xhci); 511 spin_unlock_irq(&xhci->lock); 512 + 513 + xhci_cleanup_msix(xhci); 514 515 #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING 516 /* Tell the event ring poll function not to reschedule */ ··· 544 545 spin_lock_irq(&xhci->lock); 546 xhci_halt(xhci); 547 spin_unlock_irq(&xhci->lock); 548 + 549 + xhci_cleanup_msix(xhci); 550 551 xhci_dbg(xhci, "xhci_shutdown completed - status = %x\n", 552 xhci_readl(xhci, &xhci->op_regs->status)); ··· 647 int rc = 0; 648 struct usb_hcd *hcd = xhci_to_hcd(xhci); 649 u32 command; 650 + int i; 651 652 spin_lock_irq(&xhci->lock); 653 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); ··· 677 spin_unlock_irq(&xhci->lock); 678 return -ETIMEDOUT; 679 } 680 spin_unlock_irq(&xhci->lock); 681 + 682 + /* step 5: remove core well power */ 683 + /* synchronize irq when using MSI-X */ 684 + if (xhci->msix_entries) { 685 + for (i = 0; i < xhci->msix_count; i++) 686 + synchronize_irq(xhci->msix_entries[i].vector); 687 + } 688 689 return rc; 690 } ··· 694 { 695 u32 command, temp = 0; 696 struct usb_hcd *hcd = xhci_to_hcd(xhci); 697 int old_state, retval; 698 699 old_state = hcd->state; ··· 729 xhci_dbg(xhci, "Stop HCD\n"); 730 xhci_halt(xhci); 731 xhci_reset(xhci); 732 spin_unlock_irq(&xhci->lock); 733 + xhci_cleanup_msix(xhci); 734 735 #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING 736 /* Tell the event ring poll function not to reschedule */ ··· 765 return retval; 766 } 767 768 /* step 4: set Run/Stop bit */ 769 command = xhci_readl(xhci, &xhci->op_regs->command); 770 command |= CMD_RUN; ··· 2445 xhci_err(xhci, "Error while assigning device slot ID\n"); 2446 return 0; 2447 } 2448 + /* xhci_alloc_virt_device() does not touch rings; no need to lock. 2449 + * Use GFP_NOIO, since this function can be called from 2450 + * xhci_discover_or_reset_device(), which may be called as part of 2451 + * mass storage driver error handling. 2452 + */ 2453 + if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_NOIO)) { 2454 /* Disable slot, if we can do it without mem alloc */ 2455 xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); 2456 spin_lock_irqsave(&xhci->lock, flags);
+6 -10
drivers/usb/host/xhci.h
··· 436 /** 437 * struct doorbell_array 438 * 439 * Section 5.6 440 */ 441 struct xhci_doorbell_array { 442 u32 doorbell[256]; 443 }; 444 445 - #define DB_TARGET_MASK 0xFFFFFF00 446 - #define DB_STREAM_ID_MASK 0x0000FFFF 447 - #define DB_TARGET_HOST 0x0 448 - #define DB_STREAM_ID_HOST 0x0 449 - #define DB_MASK (0xff << 8) 450 - 451 - /* Endpoint Target - bits 0:7 */ 452 - #define EPI_TO_DB(p) (((p) + 1) & 0xff) 453 - #define STREAM_ID_TO_DB(p) (((p) & 0xffff) << 16) 454 - 455 456 /** 457 * struct xhci_protocol_caps
··· 436 /** 437 * struct doorbell_array 438 * 439 + * Bits 0 - 7: Endpoint target 440 + * Bits 8 - 15: RsvdZ 441 + * Bits 16 - 31: Stream ID 442 + * 443 * Section 5.6 444 */ 445 struct xhci_doorbell_array { 446 u32 doorbell[256]; 447 }; 448 449 + #define DB_VALUE(ep, stream) ((((ep) + 1) & 0xff) | ((stream) << 16)) 450 + #define DB_VALUE_HOST 0x00000000 451 452 /** 453 * struct xhci_protocol_caps
+1 -1
drivers/usb/misc/usbled.c
··· 45 46 static void change_color(struct usb_led *led) 47 { 48 - int retval; 49 unsigned char *buffer; 50 51 buffer = kmalloc(8, GFP_KERNEL);
··· 45 46 static void change_color(struct usb_led *led) 47 { 48 + int retval = 0; 49 unsigned char *buffer; 50 51 buffer = kmalloc(8, GFP_KERNEL);
-1
drivers/usb/misc/uss720.c
··· 776 { USB_DEVICE(0x0557, 0x2001) }, 777 { USB_DEVICE(0x0729, 0x1284) }, 778 { USB_DEVICE(0x1293, 0x0002) }, 779 - { USB_DEVICE(0x1293, 0x0002) }, 780 { USB_DEVICE(0x050d, 0x0002) }, 781 { } /* Terminating entry */ 782 };
··· 776 { USB_DEVICE(0x0557, 0x2001) }, 777 { USB_DEVICE(0x0729, 0x1284) }, 778 { USB_DEVICE(0x1293, 0x0002) }, 779 { USB_DEVICE(0x050d, 0x0002) }, 780 { } /* Terminating entry */ 781 };
+2
drivers/usb/otg/nop-usb-xceiv.c
··· 132 133 platform_set_drvdata(pdev, nop); 134 135 return 0; 136 exit: 137 kfree(nop);
··· 132 133 platform_set_drvdata(pdev, nop); 134 135 + BLOCKING_INIT_NOTIFIER_HEAD(&nop->otg.notifier); 136 + 137 return 0; 138 exit: 139 kfree(nop);
+1 -1
drivers/usb/otg/ulpi.c
··· 45 /* ULPI hardcoded IDs, used for probing */ 46 static struct ulpi_info ulpi_ids[] = { 47 ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"), 48 - ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB3319"), 49 }; 50 51 static int ulpi_set_otg_flags(struct otg_transceiver *otg)
··· 45 /* ULPI hardcoded IDs, used for probing */ 46 static struct ulpi_info ulpi_ids[] = { 47 ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"), 48 + ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB331x"), 49 }; 50 51 static int ulpi_set_otg_flags(struct otg_transceiver *otg)
+10
drivers/usb/serial/ch341.c
··· 486 if (actual_length >= 4) { 487 struct ch341_private *priv = usb_get_serial_port_data(port); 488 unsigned long flags; 489 490 spin_lock_irqsave(&priv->lock, flags); 491 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; 492 if ((data[1] & CH341_MULT_STAT)) 493 priv->multi_status_change = 1; 494 spin_unlock_irqrestore(&priv->lock, flags); 495 wake_up_interruptible(&priv->delta_msr_wait); 496 } 497
··· 486 if (actual_length >= 4) { 487 struct ch341_private *priv = usb_get_serial_port_data(port); 488 unsigned long flags; 489 + u8 prev_line_status = priv->line_status; 490 491 spin_lock_irqsave(&priv->lock, flags); 492 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; 493 if ((data[1] & CH341_MULT_STAT)) 494 priv->multi_status_change = 1; 495 spin_unlock_irqrestore(&priv->lock, flags); 496 + 497 + if ((priv->line_status ^ prev_line_status) & CH341_BIT_DCD) { 498 + struct tty_struct *tty = tty_port_tty_get(&port->port); 499 + if (tty) 500 + usb_serial_handle_dcd_change(port, tty, 501 + priv->line_status & CH341_BIT_DCD); 502 + tty_kref_put(tty); 503 + } 504 + 505 wake_up_interruptible(&priv->delta_msr_wait); 506 } 507
+3 -13
drivers/usb/serial/cp210x.c
··· 49 static void cp210x_break_ctl(struct tty_struct *, int); 50 static int cp210x_startup(struct usb_serial *); 51 static void cp210x_dtr_rts(struct usb_serial_port *p, int on); 52 - static int cp210x_carrier_raised(struct usb_serial_port *p); 53 54 static int debug; 55 ··· 86 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ 87 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 88 { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */ 89 - { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */ 90 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 91 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 92 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ ··· 108 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ 109 { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ 110 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ 111 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ 112 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ 113 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ 114 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ ··· 165 .tiocmget = cp210x_tiocmget, 166 .tiocmset = cp210x_tiocmset, 167 .attach = cp210x_startup, 168 - .dtr_rts = cp210x_dtr_rts, 169 - .carrier_raised = cp210x_carrier_raised 170 }; 171 172 /* Config request types */ ··· 762 dbg("%s - control = 0x%.2x", __func__, control); 763 764 return result; 765 - } 766 - 767 - static int cp210x_carrier_raised(struct usb_serial_port *p) 768 - { 769 - unsigned int control; 770 - cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1); 771 - if (control & CONTROL_DCD) 772 - return 1; 773 - return 0; 774 } 775 776 static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
··· 49 static void cp210x_break_ctl(struct tty_struct *, int); 50 static int cp210x_startup(struct usb_serial *); 51 static void cp210x_dtr_rts(struct usb_serial_port *p, int on); 52 53 static int debug; 54 ··· 87 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ 88 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 89 { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */ 90 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 91 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 92 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ ··· 110 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ 111 { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ 112 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ 113 + { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */ 114 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ 115 + { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */ 116 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ 117 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ 118 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ ··· 165 .tiocmget = cp210x_tiocmget, 166 .tiocmset = cp210x_tiocmset, 167 .attach = cp210x_startup, 168 + .dtr_rts = cp210x_dtr_rts 169 }; 170 171 /* Config request types */ ··· 763 dbg("%s - control = 0x%.2x", __func__, control); 764 765 return result; 766 } 767 768 static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
-10
drivers/usb/serial/digi_acceleport.c
··· 455 static int digi_chars_in_buffer(struct tty_struct *tty); 456 static int digi_open(struct tty_struct *tty, struct usb_serial_port *port); 457 static void digi_close(struct usb_serial_port *port); 458 - static int digi_carrier_raised(struct usb_serial_port *port); 459 static void digi_dtr_rts(struct usb_serial_port *port, int on); 460 static int digi_startup_device(struct usb_serial *serial); 461 static int digi_startup(struct usb_serial *serial); ··· 510 .open = digi_open, 511 .close = digi_close, 512 .dtr_rts = digi_dtr_rts, 513 - .carrier_raised = digi_carrier_raised, 514 .write = digi_write, 515 .write_room = digi_write_room, 516 .write_bulk_callback = digi_write_bulk_callback, ··· 1335 { 1336 /* Adjust DTR and RTS */ 1337 digi_set_modem_signals(port, on * (TIOCM_DTR|TIOCM_RTS), 1); 1338 - } 1339 - 1340 - static int digi_carrier_raised(struct usb_serial_port *port) 1341 - { 1342 - struct digi_port *priv = usb_get_serial_port_data(port); 1343 - if (priv->dp_modem_signals & TIOCM_CD) 1344 - return 1; 1345 - return 0; 1346 } 1347 1348 static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
··· 455 static int digi_chars_in_buffer(struct tty_struct *tty); 456 static int digi_open(struct tty_struct *tty, struct usb_serial_port *port); 457 static void digi_close(struct usb_serial_port *port); 458 static void digi_dtr_rts(struct usb_serial_port *port, int on); 459 static int digi_startup_device(struct usb_serial *serial); 460 static int digi_startup(struct usb_serial *serial); ··· 511 .open = digi_open, 512 .close = digi_close, 513 .dtr_rts = digi_dtr_rts, 514 .write = digi_write, 515 .write_room = digi_write_room, 516 .write_bulk_callback = digi_write_bulk_callback, ··· 1337 { 1338 /* Adjust DTR and RTS */ 1339 digi_set_modem_signals(port, on * (TIOCM_DTR|TIOCM_RTS), 1); 1340 } 1341 1342 static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
+11 -1
drivers/usb/serial/ftdi_sio.c
··· 676 { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 677 { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 678 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 679 - { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, 680 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 681 { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 682 { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
··· 676 { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 677 { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 678 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 679 + { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 680 + { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 681 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 682 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 683 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 684 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 685 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 686 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 687 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 688 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 689 + { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 690 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 691 { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 692 { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
+16 -4
drivers/usb/serial/ftdi_sio_ids.h
··· 569 #define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */ 570 571 /* 572 - * Icom ID-1 digital transceiver 573 */ 574 - 575 - #define ICOM_ID1_VID 0x0C26 576 - #define ICOM_ID1_PID 0x0004 577 578 /* 579 * GN Otometrics (http://www.otometrics.com)
··· 569 #define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */ 570 571 /* 572 + * Definitions for Icom Inc. devices 573 */ 574 + #define ICOM_VID 0x0C26 /* Icom vendor ID */ 575 + /* Note: ID-1 is a communications tranceiver for HAM-radio operators */ 576 + #define ICOM_ID_1_PID 0x0004 /* ID-1 USB to RS-232 */ 577 + /* Note: OPC is an Optional cable to connect an Icom Tranceiver */ 578 + #define ICOM_OPC_U_UC_PID 0x0018 /* OPC-478UC, OPC-1122U cloning cable */ 579 + /* Note: ID-RP* devices are Icom Repeater Devices for HAM-radio */ 580 + #define ICOM_ID_RP2C1_PID 0x0009 /* ID-RP2C Asset 1 to RS-232 */ 581 + #define ICOM_ID_RP2C2_PID 0x000A /* ID-RP2C Asset 2 to RS-232 */ 582 + #define ICOM_ID_RP2D_PID 0x000B /* ID-RP2D configuration port*/ 583 + #define ICOM_ID_RP2VT_PID 0x000C /* ID-RP2V Transmit config port */ 584 + #define ICOM_ID_RP2VR_PID 0x000D /* ID-RP2V Receive config port */ 585 + #define ICOM_ID_RP4KVT_PID 0x0010 /* ID-RP4000V Transmit config port */ 586 + #define ICOM_ID_RP4KVR_PID 0x0011 /* ID-RP4000V Receive config port */ 587 + #define ICOM_ID_RP2KVT_PID 0x0012 /* ID-RP2000V Transmit config port */ 588 + #define ICOM_ID_RP2KVR_PID 0x0013 /* ID-RP2000V Receive config port */ 589 590 /* 591 * GN Otometrics (http://www.otometrics.com)
+20
drivers/usb/serial/generic.c
··· 479 } 480 EXPORT_SYMBOL_GPL(usb_serial_handle_break); 481 482 int usb_serial_generic_resume(struct usb_serial *serial) 483 { 484 struct usb_serial_port *port;
··· 479 } 480 EXPORT_SYMBOL_GPL(usb_serial_handle_break); 481 482 + /** 483 + * usb_serial_handle_dcd_change - handle a change of carrier detect state 484 + * @port: usb_serial_port structure for the open port 485 + * @tty: tty_struct structure for the port 486 + * @status: new carrier detect status, nonzero if active 487 + */ 488 + void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, 489 + struct tty_struct *tty, unsigned int status) 490 + { 491 + struct tty_port *port = &usb_port->port; 492 + 493 + dbg("%s - port %d, status %d", __func__, usb_port->number, status); 494 + 495 + if (status) 496 + wake_up_interruptible(&port->open_wait); 497 + else if (tty && !C_CLOCAL(tty)) 498 + tty_hangup(tty); 499 + } 500 + EXPORT_SYMBOL_GPL(usb_serial_handle_dcd_change); 501 + 502 int usb_serial_generic_resume(struct usb_serial *serial) 503 { 504 struct usb_serial_port *port;
+1
drivers/usb/serial/io_tables.h
··· 199 .name = "epic", 200 }, 201 .description = "EPiC device", 202 .id_table = Epic_port_id_table, 203 .num_ports = 1, 204 .open = edge_open,
··· 199 .name = "epic", 200 }, 201 .description = "EPiC device", 202 + .usb_driver = &io_driver, 203 .id_table = Epic_port_id_table, 204 .num_ports = 1, 205 .open = edge_open,
+1
drivers/usb/serial/iuu_phoenix.c
··· 1275 .name = "iuu_phoenix", 1276 }, 1277 .id_table = id_table, 1278 .num_ports = 1, 1279 .bulk_in_size = 512, 1280 .bulk_out_size = 512,
··· 1275 .name = "iuu_phoenix", 1276 }, 1277 .id_table = id_table, 1278 + .usb_driver = &iuu_driver, 1279 .num_ports = 1, 1280 .bulk_in_size = 512, 1281 .bulk_out_size = 512,
+4
drivers/usb/serial/keyspan.h
··· 546 .name = "keyspan_no_firm", 547 }, 548 .description = "Keyspan - (without firmware)", 549 .id_table = keyspan_pre_ids, 550 .num_ports = 1, 551 .attach = keyspan_fake_startup, ··· 558 .name = "keyspan_1", 559 }, 560 .description = "Keyspan 1 port adapter", 561 .id_table = keyspan_1port_ids, 562 .num_ports = 1, 563 .open = keyspan_open, ··· 581 .name = "keyspan_2", 582 }, 583 .description = "Keyspan 2 port adapter", 584 .id_table = keyspan_2port_ids, 585 .num_ports = 2, 586 .open = keyspan_open, ··· 604 .name = "keyspan_4", 605 }, 606 .description = "Keyspan 4 port adapter", 607 .id_table = keyspan_4port_ids, 608 .num_ports = 4, 609 .open = keyspan_open,
··· 546 .name = "keyspan_no_firm", 547 }, 548 .description = "Keyspan - (without firmware)", 549 + .usb_driver = &keyspan_driver, 550 .id_table = keyspan_pre_ids, 551 .num_ports = 1, 552 .attach = keyspan_fake_startup, ··· 557 .name = "keyspan_1", 558 }, 559 .description = "Keyspan 1 port adapter", 560 + .usb_driver = &keyspan_driver, 561 .id_table = keyspan_1port_ids, 562 .num_ports = 1, 563 .open = keyspan_open, ··· 579 .name = "keyspan_2", 580 }, 581 .description = "Keyspan 2 port adapter", 582 + .usb_driver = &keyspan_driver, 583 .id_table = keyspan_2port_ids, 584 .num_ports = 2, 585 .open = keyspan_open, ··· 601 .name = "keyspan_4", 602 }, 603 .description = "Keyspan 4 port adapter", 604 + .usb_driver = &keyspan_driver, 605 .id_table = keyspan_4port_ids, 606 .num_ports = 4, 607 .open = keyspan_open,
-17
drivers/usb/serial/keyspan_pda.c
··· 679 } 680 } 681 682 - static int keyspan_pda_carrier_raised(struct usb_serial_port *port) 683 - { 684 - struct usb_serial *serial = port->serial; 685 - unsigned char modembits; 686 - 687 - /* If we can read the modem status and the DCD is low then 688 - carrier is not raised yet */ 689 - if (keyspan_pda_get_modem_info(serial, &modembits) >= 0) { 690 - if (!(modembits & (1>>6))) 691 - return 0; 692 - } 693 - /* Carrier raised, or we failed (eg disconnected) so 694 - progress accordingly */ 695 - return 1; 696 - } 697 - 698 699 static int keyspan_pda_open(struct tty_struct *tty, 700 struct usb_serial_port *port) ··· 865 .id_table = id_table_std, 866 .num_ports = 1, 867 .dtr_rts = keyspan_pda_dtr_rts, 868 - .carrier_raised = keyspan_pda_carrier_raised, 869 .open = keyspan_pda_open, 870 .close = keyspan_pda_close, 871 .write = keyspan_pda_write,
··· 679 } 680 } 681 682 683 static int keyspan_pda_open(struct tty_struct *tty, 684 struct usb_serial_port *port) ··· 881 .id_table = id_table_std, 882 .num_ports = 1, 883 .dtr_rts = keyspan_pda_dtr_rts, 884 .open = keyspan_pda_open, 885 .close = keyspan_pda_close, 886 .write = keyspan_pda_write,
+1
drivers/usb/serial/moto_modem.c
··· 44 .name = "moto-modem", 45 }, 46 .id_table = id_table, 47 .num_ports = 1, 48 }; 49
··· 44 .name = "moto-modem", 45 }, 46 .id_table = id_table, 47 + .usb_driver = &moto_driver, 48 .num_ports = 1, 49 }; 50
+21 -2
drivers/usb/serial/option.c
··· 382 #define HAIER_VENDOR_ID 0x201e 383 #define HAIER_PRODUCT_CE100 0x2009 384 385 - #define CINTERION_VENDOR_ID 0x0681 386 387 /* Olivetti products */ 388 #define OLIVETTI_VENDOR_ID 0x0b3c ··· 953 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, 954 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, 955 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, 956 - { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, 957 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, 958 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ 959 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */
··· 382 #define HAIER_VENDOR_ID 0x201e 383 #define HAIER_PRODUCT_CE100 0x2009 384 385 + /* Cinterion (formerly Siemens) products */ 386 + #define SIEMENS_VENDOR_ID 0x0681 387 + #define CINTERION_VENDOR_ID 0x1e2d 388 + #define CINTERION_PRODUCT_HC25_MDM 0x0047 389 + #define CINTERION_PRODUCT_HC25_MDMNET 0x0040 390 + #define CINTERION_PRODUCT_HC28_MDM 0x004C 391 + #define CINTERION_PRODUCT_HC28_MDMNET 0x004A /* same for HC28J */ 392 + #define CINTERION_PRODUCT_EU3_E 0x0051 393 + #define CINTERION_PRODUCT_EU3_P 0x0052 394 + #define CINTERION_PRODUCT_PH8 0x0053 395 396 /* Olivetti products */ 397 #define OLIVETTI_VENDOR_ID 0x0b3c ··· 944 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, 945 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, 946 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, 947 + /* Cinterion */ 948 + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, 949 + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, 950 + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, 951 + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, 952 + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, 953 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, 954 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, 955 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ 956 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, 957 + 958 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, 959 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ 960 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */
+1
drivers/usb/serial/oti6858.c
··· 157 .name = "oti6858", 158 }, 159 .id_table = id_table, 160 .num_ports = 1, 161 .open = oti6858_open, 162 .close = oti6858_close,
··· 157 .name = "oti6858", 158 }, 159 .id_table = id_table, 160 + .usb_driver = &oti6858_driver, 161 .num_ports = 1, 162 .open = oti6858_open, 163 .close = oti6858_close,
+12
drivers/usb/serial/pl2303.c
··· 50 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, 51 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, 52 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, 53 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, 54 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, 55 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ··· 678 { 679 680 struct pl2303_private *priv = usb_get_serial_port_data(port); 681 unsigned long flags; 682 u8 status_idx = UART_STATE; 683 u8 length = UART_STATE + 1; 684 u16 idv, idp; 685 686 idv = le16_to_cpu(port->serial->dev->descriptor.idVendor); ··· 704 705 /* Save off the uart status for others to look at */ 706 spin_lock_irqsave(&priv->lock, flags); 707 priv->line_status = data[status_idx]; 708 spin_unlock_irqrestore(&priv->lock, flags); 709 if (priv->line_status & UART_BREAK_ERROR) 710 usb_serial_handle_break(port); 711 wake_up_interruptible(&priv->delta_msr_wait); 712 } 713 714 static void pl2303_read_int_callback(struct urb *urb)
··· 50 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, 51 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, 52 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, 53 + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) }, 54 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, 55 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, 56 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ··· 677 { 678 679 struct pl2303_private *priv = usb_get_serial_port_data(port); 680 + struct tty_struct *tty; 681 unsigned long flags; 682 u8 status_idx = UART_STATE; 683 u8 length = UART_STATE + 1; 684 + u8 prev_line_status; 685 u16 idv, idp; 686 687 idv = le16_to_cpu(port->serial->dev->descriptor.idVendor); ··· 701 702 /* Save off the uart status for others to look at */ 703 spin_lock_irqsave(&priv->lock, flags); 704 + prev_line_status = priv->line_status; 705 priv->line_status = data[status_idx]; 706 spin_unlock_irqrestore(&priv->lock, flags); 707 if (priv->line_status & UART_BREAK_ERROR) 708 usb_serial_handle_break(port); 709 wake_up_interruptible(&priv->delta_msr_wait); 710 + 711 + tty = tty_port_tty_get(&port->port); 712 + if (!tty) 713 + return; 714 + if ((priv->line_status ^ prev_line_status) & UART_DCD) 715 + usb_serial_handle_dcd_change(port, tty, 716 + priv->line_status & UART_DCD); 717 + tty_kref_put(tty); 718 } 719 720 static void pl2303_read_int_callback(struct urb *urb)
+1
drivers/usb/serial/pl2303.h
··· 21 #define PL2303_PRODUCT_ID_MMX 0x0612 22 #define PL2303_PRODUCT_ID_GPRS 0x0609 23 #define PL2303_PRODUCT_ID_HCR331 0x331a 24 25 #define ATEN_VENDOR_ID 0x0557 26 #define ATEN_VENDOR_ID2 0x0547
··· 21 #define PL2303_PRODUCT_ID_MMX 0x0612 22 #define PL2303_PRODUCT_ID_GPRS 0x0609 23 #define PL2303_PRODUCT_ID_HCR331 0x331a 24 + #define PL2303_PRODUCT_ID_MOTOROLA 0x0307 25 26 #define ATEN_VENDOR_ID 0x0557 27 #define ATEN_VENDOR_ID2 0x0547
+3
drivers/usb/serial/qcaux.c
··· 36 #define UTSTARCOM_PRODUCT_UM175_V1 0x3712 37 #define UTSTARCOM_PRODUCT_UM175_V2 0x3714 38 #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 39 40 /* CMOTECH devices */ 41 #define CMOTECH_VENDOR_ID 0x16d8 ··· 67 { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, 68 { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, 69 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, 70 { }, 71 }; 72 MODULE_DEVICE_TABLE(usb, id_table); ··· 86 .name = "qcaux", 87 }, 88 .id_table = id_table, 89 .num_ports = 1, 90 }; 91
··· 36 #define UTSTARCOM_PRODUCT_UM175_V1 0x3712 37 #define UTSTARCOM_PRODUCT_UM175_V2 0x3714 38 #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 39 + #define PANTECH_PRODUCT_UML290_VZW 0x3718 40 41 /* CMOTECH devices */ 42 #define CMOTECH_VENDOR_ID 0x16d8 ··· 66 { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, 67 { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, 68 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, 69 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, 70 { }, 71 }; 72 MODULE_DEVICE_TABLE(usb, id_table); ··· 84 .name = "qcaux", 85 }, 86 .id_table = id_table, 87 + .usb_driver = &qcaux_driver, 88 .num_ports = 1, 89 }; 90
+1
drivers/usb/serial/siemens_mpi.c
··· 42 .name = "siemens_mpi", 43 }, 44 .id_table = id_table, 45 .num_ports = 1, 46 }; 47
··· 42 .name = "siemens_mpi", 43 }, 44 .id_table = id_table, 45 + .usb_driver = &siemens_usb_mpi_driver, 46 .num_ports = 1, 47 }; 48
+6 -1
drivers/usb/serial/spcp8x5.c
··· 133 134 /* how come ??? */ 135 #define UART_STATE 0x08 136 - #define UART_STATE_TRANSIENT_MASK 0x74 137 #define UART_DCD 0x01 138 #define UART_DSR 0x02 139 #define UART_BREAK_ERROR 0x04 ··· 525 /* overrun is special, not associated with a char */ 526 if (status & UART_OVERRUN_ERROR) 527 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 528 } 529 530 tty_insert_flip_string_fixed_flag(tty, data, tty_flag, ··· 649 .name = "SPCP8x5", 650 }, 651 .id_table = id_table, 652 .num_ports = 1, 653 .open = spcp8x5_open, 654 .dtr_rts = spcp8x5_dtr_rts,
··· 133 134 /* how come ??? */ 135 #define UART_STATE 0x08 136 + #define UART_STATE_TRANSIENT_MASK 0x75 137 #define UART_DCD 0x01 138 #define UART_DSR 0x02 139 #define UART_BREAK_ERROR 0x04 ··· 525 /* overrun is special, not associated with a char */ 526 if (status & UART_OVERRUN_ERROR) 527 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 528 + 529 + if (status & UART_DCD) 530 + usb_serial_handle_dcd_change(port, tty, 531 + priv->line_status & MSR_STATUS_LINE_DCD); 532 } 533 534 tty_insert_flip_string_fixed_flag(tty, data, tty_flag, ··· 645 .name = "SPCP8x5", 646 }, 647 .id_table = id_table, 648 + .usb_driver = &spcp8x5_driver, 649 .num_ports = 1, 650 .open = spcp8x5_open, 651 .dtr_rts = spcp8x5_dtr_rts,
+6 -2
drivers/usb/serial/usb-serial.c
··· 1344 return -ENODEV; 1345 1346 fixup_generic(driver); 1347 - if (driver->usb_driver) 1348 - driver->usb_driver->supports_autosuspend = 1; 1349 1350 if (!driver->description) 1351 driver->description = driver->driver.name; 1352 1353 /* Add this device to our list of devices */ 1354 mutex_lock(&table_lock);
··· 1344 return -ENODEV; 1345 1346 fixup_generic(driver); 1347 1348 if (!driver->description) 1349 driver->description = driver->driver.name; 1350 + if (!driver->usb_driver) { 1351 + WARN(1, "Serial driver %s has no usb_driver\n", 1352 + driver->description); 1353 + return -EINVAL; 1354 + } 1355 + driver->usb_driver->supports_autosuspend = 1; 1356 1357 /* Add this device to our list of devices */ 1358 mutex_lock(&table_lock);
+1
drivers/usb/serial/usb_debug.c
··· 75 .name = "debug", 76 }, 77 .id_table = id_table, 78 .num_ports = 1, 79 .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, 80 .break_ctl = usb_debug_break_ctl,
··· 75 .name = "debug", 76 }, 77 .id_table = id_table, 78 + .usb_driver = &debug_driver, 79 .num_ports = 1, 80 .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, 81 .break_ctl = usb_debug_break_ctl,
+5
drivers/usb/storage/unusual_cypress.h
··· 31 "Cypress ISD-300LP", 32 USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), 33 34 #endif /* defined(CONFIG_USB_STORAGE_CYPRESS_ATACB) || ... */
··· 31 "Cypress ISD-300LP", 32 USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), 33 34 + UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999, 35 + "Super Top", 36 + "USB 2.0 SATA BRIDGE", 37 + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), 38 + 39 #endif /* defined(CONFIG_USB_STORAGE_CYPRESS_ATACB) || ... */
+18
drivers/usb/storage/unusual_devs.h
··· 1044 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1045 US_FL_BULK32), 1046 1047 /* Andrew Lunn <andrew@lunn.ch> 1048 * PanDigital Digital Picture Frame. Does not like ALLOW_MEDIUM_REMOVAL 1049 * on LUN 4. ··· 1880 "Photo Frame", 1881 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1882 US_FL_NO_READ_DISC_INFO ), 1883 1884 UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, 1885 "ST",
··· 1044 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1045 US_FL_BULK32), 1046 1047 + /* Reported by <ttkspam@free.fr> 1048 + * The device reports a vendor-specific device class, requiring an 1049 + * explicit vendor/product match. 1050 + */ 1051 + UNUSUAL_DEV( 0x0851, 0x1542, 0x0002, 0x0002, 1052 + "MagicPixel", 1053 + "FW_Omega2", 1054 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 0), 1055 + 1056 /* Andrew Lunn <andrew@lunn.ch> 1057 * PanDigital Digital Picture Frame. Does not like ALLOW_MEDIUM_REMOVAL 1058 * on LUN 4. ··· 1871 "Photo Frame", 1872 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1873 US_FL_NO_READ_DISC_INFO ), 1874 + 1875 + /* Patch by Richard Sch�tz <r.schtz@t-online.de> 1876 + * This external hard drive enclosure uses a JMicron chip which 1877 + * needs the US_FL_IGNORE_RESIDUE flag to work properly. */ 1878 + UNUSUAL_DEV( 0x1e68, 0x001b, 0x0000, 0x0000, 1879 + "TrekStor GmbH & Co. KG", 1880 + "DataStation maxi g.u", 1881 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1882 + US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), 1883 1884 UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, 1885 "ST",
+1
include/linux/usb/hcd.h
··· 112 /* Flags that get set only during HCD registration or removal. */ 113 unsigned rh_registered:1;/* is root hub registered? */ 114 unsigned rh_pollable:1; /* may we poll the root hub? */ 115 116 /* The next flag is a stopgap, to be removed when all the HCDs 117 * support the new root-hub polling mechanism. */
··· 112 /* Flags that get set only during HCD registration or removal. */ 113 unsigned rh_registered:1;/* is root hub registered? */ 114 unsigned rh_pollable:1; /* may we poll the root hub? */ 115 + unsigned msix_enabled:1; /* driver has MSI-X enabled? */ 116 117 /* The next flag is a stopgap, to be removed when all the HCDs 118 * support the new root-hub polling mechanism. */
+3
include/linux/usb/serial.h
··· 347 extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, 348 unsigned int ch); 349 extern int usb_serial_handle_break(struct usb_serial_port *port); 350 351 352 extern int usb_serial_bus_register(struct usb_serial_driver *device);
··· 347 extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, 348 unsigned int ch); 349 extern int usb_serial_handle_break(struct usb_serial_port *port); 350 + extern void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, 351 + struct tty_struct *tty, 352 + unsigned int status); 353 354 355 extern int usb_serial_bus_register(struct usb_serial_driver *device);