musb_host.c (22a0d6f1383c85a7a9759cb805fd06c848c9c4d3) musb_host.c (81ec4e4a5116c2bccec2dd1d350ceb4372846ba8)
1/*
2 * MUSB OTG driver host support
3 *
4 * Copyright 2005 Mentor Graphics Corporation
5 * Copyright (C) 2005-2006 by Texas Instruments
6 * Copyright (C) 2006-2007 Nokia Corporation
7 * Copyright (C) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
8 *

--- 2015 unchanged lines hidden (view full) ---

2024}
2025
2026
2027/*
2028 * abort a transfer that's at the head of a hardware queue.
2029 * called with controller locked, irqs blocked
2030 * that hardware queue advances to the next transfer, unless prevented
2031 */
1/*
2 * MUSB OTG driver host support
3 *
4 * Copyright 2005 Mentor Graphics Corporation
5 * Copyright (C) 2005-2006 by Texas Instruments
6 * Copyright (C) 2006-2007 Nokia Corporation
7 * Copyright (C) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
8 *

--- 2015 unchanged lines hidden (view full) ---

2024}
2025
2026
2027/*
2028 * abort a transfer that's at the head of a hardware queue.
2029 * called with controller locked, irqs blocked
2030 * that hardware queue advances to the next transfer, unless prevented
2031 */
2032static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in)
2032static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh)
2033{
2034 struct musb_hw_ep *ep = qh->hw_ep;
2035 void __iomem *epio = ep->regs;
2036 unsigned hw_end = ep->epnum;
2037 void __iomem *regs = ep->musb->mregs;
2033{
2034 struct musb_hw_ep *ep = qh->hw_ep;
2035 void __iomem *epio = ep->regs;
2036 unsigned hw_end = ep->epnum;
2037 void __iomem *regs = ep->musb->mregs;
2038 u16 csr;
2038 int is_in = usb_pipein(urb->pipe);
2039 int status = 0;
2039 int status = 0;
2040 u16 csr;
2040
2041 musb_ep_select(regs, hw_end);
2042
2043 if (is_dma_capable()) {
2044 struct dma_channel *dma;
2045
2046 dma = is_in ? ep->rx_channel : ep->tx_channel;
2047 if (dma) {

--- 84 unchanged lines hidden (view full) ---

2132 * and its URB list has emptied, recycle this qh.
2133 */
2134 if (ready && list_empty(&qh->hep->urb_list)) {
2135 qh->hep->hcpriv = NULL;
2136 list_del(&qh->ring);
2137 kfree(qh);
2138 }
2139 } else
2041
2042 musb_ep_select(regs, hw_end);
2043
2044 if (is_dma_capable()) {
2045 struct dma_channel *dma;
2046
2047 dma = is_in ? ep->rx_channel : ep->tx_channel;
2048 if (dma) {

--- 84 unchanged lines hidden (view full) ---

2133 * and its URB list has emptied, recycle this qh.
2134 */
2135 if (ready && list_empty(&qh->hep->urb_list)) {
2136 qh->hep->hcpriv = NULL;
2137 list_del(&qh->ring);
2138 kfree(qh);
2139 }
2140 } else
2140 ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
2141 ret = musb_cleanup_urb(urb, qh);
2141done:
2142 spin_unlock_irqrestore(&musb->lock, flags);
2143 return ret;
2144}
2145
2146/* disable an endpoint */
2147static void
2148musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)

--- 17 unchanged lines hidden (view full) ---

2166 if (musb_ep_get_qh(qh->hw_ep, is_in) == qh) {
2167 urb = next_urb(qh);
2168
2169 /* make software (then hardware) stop ASAP */
2170 if (!urb->unlinked)
2171 urb->status = -ESHUTDOWN;
2172
2173 /* cleanup */
2142done:
2143 spin_unlock_irqrestore(&musb->lock, flags);
2144 return ret;
2145}
2146
2147/* disable an endpoint */
2148static void
2149musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)

--- 17 unchanged lines hidden (view full) ---

2167 if (musb_ep_get_qh(qh->hw_ep, is_in) == qh) {
2168 urb = next_urb(qh);
2169
2170 /* make software (then hardware) stop ASAP */
2171 if (!urb->unlinked)
2172 urb->status = -ESHUTDOWN;
2173
2174 /* cleanup */
2174 musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
2175 musb_cleanup_urb(urb, qh);
2175
2176 /* Then nuke all the others ... and advance the
2177 * queue on hw_ep (e.g. bulk ring) when we're done.
2178 */
2179 while (!list_empty(&hep->urb_list)) {
2180 urb = next_urb(qh);
2181 urb->status = -ESHUTDOWN;
2182 musb_advance_schedule(musb, urb, qh->hw_ep, is_in);

--- 89 unchanged lines hidden ---
2176
2177 /* Then nuke all the others ... and advance the
2178 * queue on hw_ep (e.g. bulk ring) when we're done.
2179 */
2180 while (!list_empty(&hep->urb_list)) {
2181 urb = next_urb(qh);
2182 urb->status = -ESHUTDOWN;
2183 musb_advance_schedule(musb, urb, qh->hw_ep, is_in);

--- 89 unchanged lines hidden ---