• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/usb/gadget/

Lines Matching refs:mEp

1190 		struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
1193 i, (u32)mEp->qh[RX].dma, (u32)mEp->qh[TX].dma);
1197 *((u32 *)mEp->qh[RX].ptr + j),
1198 *((u32 *)mEp->qh[TX].ptr + j));
1409 * @mEp: endpoint
1413 static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
1417 trace("%p, %p", mEp, mReq);
1423 if (hw_ep_is_primed(mEp->num, mEp->dir))
1430 dma_map_single(mEp->device, mReq->req.buf,
1431 mReq->req.length, mEp->dir ?
1459 mEp->qh[mEp->dir].ptr->td.next = mReq->dma; /* TERMINATE = 0 */
1460 mEp->qh[mEp->dir].ptr->td.token &= ~TD_STATUS; /* clear status */
1462 mEp->qh[mEp->dir].ptr->cap |= QH_ZLT;
1464 mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT;
1468 return hw_ep_prime(mEp->num, mEp->dir,
1469 mEp->type == USB_ENDPOINT_XFER_CONTROL);
1475 * @mEp: endpoint
1479 static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
1481 trace("%p, %p", mEp, mReq);
1486 if (hw_ep_is_primed(mEp->num, mEp->dir))
1487 hw_ep_flush(mEp->num, mEp->dir);
1492 dma_unmap_single(mEp->device, mReq->req.dma, mReq->req.length,
1493 mEp->dir ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
1518 * @mEp: endpoint
1523 static int _ep_nuke(struct ci13xxx_ep *mEp)
1524 __releases(mEp->lock)
1525 __acquires(mEp->lock)
1527 trace("%p", mEp);
1529 if (mEp == NULL)
1532 hw_ep_flush(mEp->num, mEp->dir);
1534 while (!list_empty(&mEp->qh[mEp->dir].queue)) {
1538 list_entry(mEp->qh[mEp->dir].queue.next,
1544 spin_unlock(mEp->lock);
1545 mReq->req.complete(&mEp->ep, &mReq->req);
1546 spin_lock(mEp->lock);
1565 struct ci13xxx_ep *mEp = container_of(gadget->ep0,
1589 if (mEp->status != NULL) {
1590 usb_ep_free_request(gadget->ep0, mEp->status);
1591 mEp->status = NULL;
1612 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[0];
1633 retval = usb_ep_enable(&mEp->ep, &ctrl_endpt_desc);
1635 mEp->status = usb_ep_alloc_request(&mEp->ep, GFP_KERNEL);
1636 if (mEp->status == NULL) {
1637 usb_ep_disable(&mEp->ep);
1675 static int isr_get_status_response(struct ci13xxx_ep *mEp,
1677 __releases(mEp->lock)
1678 __acquires(mEp->lock)
1684 trace("%p, %p", mEp, setup);
1686 if (mEp == NULL || setup == NULL)
1689 spin_unlock(mEp->lock);
1690 req = usb_ep_alloc_request(&mEp->ep, gfp_flags);
1691 spin_lock(mEp->lock);
1715 spin_unlock(mEp->lock);
1716 retval = usb_ep_queue(&mEp->ep, req, gfp_flags);
1717 spin_lock(mEp->lock);
1726 spin_unlock(mEp->lock);
1727 usb_ep_free_request(&mEp->ep, req);
1728 spin_lock(mEp->lock);
1734 * @mEp: endpoint
1738 static int isr_setup_status_phase(struct ci13xxx_ep *mEp)
1739 __releases(mEp->lock)
1740 __acquires(mEp->lock)
1744 trace("%p", mEp);
1746 /* mEp is always valid & configured */
1748 if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
1749 mEp->dir = (mEp->dir == TX) ? RX : TX;
1751 mEp->status->no_interrupt = 1;
1753 spin_unlock(mEp->lock);
1754 retval = usb_ep_queue(&mEp->ep, mEp->status, GFP_ATOMIC);
1755 spin_lock(mEp->lock);
1762 * @mEp: endpoint
1767 static int isr_tr_complete_low(struct ci13xxx_ep *mEp)
1768 __releases(mEp->lock)
1769 __acquires(mEp->lock)
1774 trace("%p", mEp);
1776 if (list_empty(&mEp->qh[mEp->dir].queue))
1780 mReq = list_entry(mEp->qh[mEp->dir].queue.next,
1784 retval = _hardware_dequeue(mEp, mReq);
1786 dbg_event(_usb_addr(mEp), "DONE", retval);
1790 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval);
1793 spin_unlock(mEp->lock);
1794 mReq->req.complete(&mEp->ep, &mReq->req);
1795 spin_lock(mEp->lock);
1798 if (!list_empty(&mEp->qh[mEp->dir].queue)) {
1799 mReq = list_entry(mEp->qh[mEp->dir].queue.next,
1801 _hardware_enqueue(mEp, mReq);
1828 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
1833 if (mEp->desc == NULL)
1836 if ((mEp->dir == RX && hw_test_and_clear_complete(i)) ||
1837 (mEp->dir == TX && hw_test_and_clear_complete(i + 16))) {
1838 err = isr_tr_complete_low(mEp);
1839 if (mEp->type == USB_ENDPOINT_XFER_CONTROL) {
1841 err = isr_setup_status_phase(mEp);
1843 dbg_event(_usb_addr(mEp),
1846 if (usb_ep_set_halt(&mEp->ep))
1853 if (mEp->type != USB_ENDPOINT_XFER_CONTROL ||
1865 memcpy(&req, &mEp->qh[RX].ptr->setup, sizeof(req));
1870 mEp->dir = (type & USB_DIR_IN) ? TX : RX;
1872 dbg_setup(_usb_addr(mEp), &req);
1891 err = isr_setup_status_phase(mEp);
1901 err = isr_get_status_response(mEp, &req);
1912 err = isr_setup_status_phase(mEp);
1928 err = isr_setup_status_phase(mEp);
1933 mEp->dir = TX;
1942 dbg_event(_usb_addr(mEp), "ERROR", err);
1945 if (usb_ep_set_halt(&mEp->ep))
1963 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
1972 spin_lock_irqsave(mEp->lock, flags);
1976 mEp->desc = desc;
1978 if (!list_empty(&mEp->qh[mEp->dir].queue))
1981 mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX;
1982 mEp->num = usb_endpoint_num(desc);
1983 mEp->type = usb_endpoint_type(desc);
1985 mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize);
1987 direction = mEp->dir;
1989 dbg_event(_usb_addr(mEp), "ENABLE", 0);
1991 mEp->qh[mEp->dir].ptr->cap = 0;
1993 if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
1994 mEp->qh[mEp->dir].ptr->cap |= QH_IOS;
1995 else if (mEp->type == USB_ENDPOINT_XFER_ISOC)
1996 mEp->qh[mEp->dir].ptr->cap &= ~QH_MULT;
1998 mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT;
2000 mEp->qh[mEp->dir].ptr->cap |=
2001 (mEp->ep.maxpacket << ffs_nr(QH_MAX_PKT)) & QH_MAX_PKT;
2002 mEp->qh[mEp->dir].ptr->td.next |= TD_TERMINATE; /* needed? */
2004 retval |= hw_ep_enable(mEp->num, mEp->dir, mEp->type);
2006 if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
2007 mEp->dir = (mEp->dir == TX) ? RX : TX;
2009 } while (mEp->dir != direction);
2011 spin_unlock_irqrestore(mEp->lock, flags);
2022 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2030 else if (mEp->desc == NULL)
2033 spin_lock_irqsave(mEp->lock, flags);
2037 direction = mEp->dir;
2039 dbg_event(_usb_addr(mEp), "DISABLE", 0);
2041 retval |= _ep_nuke(mEp);
2042 retval |= hw_ep_disable(mEp->num, mEp->dir);
2044 if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
2045 mEp->dir = (mEp->dir == TX) ? RX : TX;
2047 } while (mEp->dir != direction);
2049 mEp->desc = NULL;
2051 spin_unlock_irqrestore(mEp->lock, flags);
2062 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2073 spin_lock_irqsave(mEp->lock, flags);
2079 mReq->ptr = dma_pool_alloc(mEp->td_pool, gfp_flags,
2087 dbg_event(_usb_addr(mEp), "ALLOC", mReq == NULL);
2089 spin_unlock_irqrestore(mEp->lock, flags);
2101 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2115 spin_lock_irqsave(mEp->lock, flags);
2118 dma_pool_free(mEp->td_pool, mReq->ptr, mReq->dma);
2121 dbg_event(_usb_addr(mEp), "FREE", 0);
2123 spin_unlock_irqrestore(mEp->lock, flags);
2134 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2141 if (ep == NULL || req == NULL || mEp->desc == NULL)
2144 spin_lock_irqsave(mEp->lock, flags);
2146 if (mEp->type == USB_ENDPOINT_XFER_CONTROL &&
2147 !list_empty(&mEp->qh[mEp->dir].queue)) {
2148 _ep_nuke(mEp);
2150 warn("endpoint ctrl %X nuked", _usb_addr(mEp));
2166 dbg_queue(_usb_addr(mEp), req, retval);
2171 list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue);
2173 retval = _hardware_enqueue(mEp, mReq);
2175 dbg_event(_usb_addr(mEp), "QUEUE", retval);
2180 spin_unlock_irqrestore(mEp->lock, flags);
2191 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2197 if (ep == NULL || req == NULL || mEp->desc == NULL ||
2198 list_empty(&mReq->queue) || list_empty(&mEp->qh[mEp->dir].queue))
2201 spin_lock_irqsave(mEp->lock, flags);
2203 dbg_event(_usb_addr(mEp), "DEQUEUE", 0);
2206 _hardware_dequeue(mEp, mReq);
2213 spin_unlock(mEp->lock);
2214 mReq->req.complete(&mEp->ep, &mReq->req);
2215 spin_lock(mEp->lock);
2218 spin_unlock_irqrestore(mEp->lock, flags);
2229 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2235 if (ep == NULL || mEp->desc == NULL)
2238 spin_lock_irqsave(mEp->lock, flags);
2242 if (value && mEp->type == USB_ENDPOINT_XFER_BULK && mEp->dir == TX &&
2243 !list_empty(&mEp->qh[mEp->dir].queue)) {
2244 spin_unlock_irqrestore(mEp->lock, flags);
2249 direction = mEp->dir;
2251 dbg_event(_usb_addr(mEp), "HALT", value);
2252 retval |= hw_ep_set_halt(mEp->num, mEp->dir, value);
2255 mEp->wedge = 0;
2257 if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
2258 mEp->dir = (mEp->dir == TX) ? RX : TX;
2260 } while (mEp->dir != direction);
2262 spin_unlock_irqrestore(mEp->lock, flags);
2273 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2278 if (ep == NULL || mEp->desc == NULL)
2281 spin_lock_irqsave(mEp->lock, flags);
2283 dbg_event(_usb_addr(mEp), "WEDGE", 0);
2284 mEp->wedge = 1;
2286 spin_unlock_irqrestore(mEp->lock, flags);
2298 struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
2304 err("%02X: -EINVAL", _usb_addr(mEp));
2308 spin_lock_irqsave(mEp->lock, flags);
2310 dbg_event(_usb_addr(mEp), "FFLUSH", 0);
2311 hw_ep_flush(mEp->num, mEp->dir);
2313 spin_unlock_irqrestore(mEp->lock, flags);
2395 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
2397 scnprintf(mEp->name, sizeof(mEp->name), "ep%i", (int)i);
2399 mEp->lock = udc->lock;
2400 mEp->device = &udc->gadget.dev;
2401 mEp->td_pool = udc->td_pool;
2403 mEp->ep.name = mEp->name;
2404 mEp->ep.ops = &usb_ep_ops;
2405 mEp->ep.maxpacket = CTRL_PAYLOAD_MAX;
2409 INIT_LIST_HEAD(&mEp->qh[k].queue);
2410 mEp->qh[k].ptr = dma_pool_alloc(udc->qh_pool,
2412 &mEp->qh[k].dma);
2413 if (mEp->qh[k].ptr == NULL)
2416 memset(mEp->qh[k].ptr, 0,
2417 sizeof(*mEp->qh[k].ptr));
2420 udc->gadget.ep0 = &mEp->ep;
2422 list_add_tail(&mEp->ep.ep_list, &udc->gadget.ep_list);
2492 struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
2496 else if (!list_empty(&mEp->ep.ep_list))
2497 list_del_init(&mEp->ep.ep_list);
2500 if (mEp->qh[k].ptr != NULL)
2502 mEp->qh[k].ptr, mEp->qh[k].dma);