vserver 2.0 rc7
[linux-2.6.git] / drivers / usb / host / ehci-q.c
index b284c4c..7df9b9a 100644 (file)
@@ -198,7 +198,7 @@ static void qtd_copy_status (
                                && urb->dev->tt && !usb_pipeint (urb->pipe)
                                && ((token & QTD_STS_MMF) != 0
                                        || QTD_CERR(token) == 0)
-                               && (!ehci_is_ARC(ehci)
+                               && (!ehci_is_TDI(ehci)
                                        || urb->dev->tt->hub !=
                                           ehci_to_hcd(ehci)->self.root_hub)) {
 #ifdef DEBUG
@@ -338,23 +338,24 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
                        if ((token & QTD_STS_HALT) != 0) {
                                stopped = 1;
 
-                       /* magic dummy for some short reads; qh won't advance */
+                       /* magic dummy for some short reads; qh won't advance.
+                        * that silicon quirk can kick in with this dummy too.
+                        */
                        } else if (IS_SHORT_READ (token)
-                                       && (qh->hw_alt_next & QTD_MASK)
-                                               == ehci->async->hw_alt_next) {
+                                       && !(qtd->hw_alt_next & EHCI_LIST_END)) {
                                stopped = 1;
                                goto halt;
                        }
 
                /* stop scanning when we reach qtds the hc is using */
                } else if (likely (!stopped
-                               && HCD_IS_RUNNING (ehci_to_hcd(ehci)->state))) {
+                               && HC_IS_RUNNING (ehci_to_hcd(ehci)->state))) {
                        break;
 
                } else {
                        stopped = 1;
 
-                       if (unlikely (!HCD_IS_RUNNING (ehci_to_hcd(ehci)->state)))
+                       if (unlikely (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)))
                                urb->status = -ESHUTDOWN;
 
                        /* ignore active urbs unless some previous qtd
@@ -522,7 +523,7 @@ qh_urb_transaction (
        else
                buf = 0;
 
-       // FIXME this 'buf' check break some zlps...
+       /* for zero length DATA stages, STATUS is always IN */
        if (!buf || is_input)
                token |= (1 /* "in" */ << 8);
        /* else it's already initted to "out" pid (0 << 8) */
@@ -714,10 +715,10 @@ qh_make (
                info2 |= (EHCI_TUNE_MULT_TT << 30);
                info2 |= urb->dev->ttport << 23;
 
-               /* set the address of the TT; for ARC's integrated
+               /* set the address of the TT; for TDI's integrated
                 * root hub tt, leave it zeroed.
                 */
-               if (!ehci_is_ARC(ehci)
+               if (!ehci_is_TDI(ehci)
                                || urb->dev->tt->hub !=
                                        ehci_to_hcd(ehci)->self.root_hub)
                        info2 |= urb->dev->tt->hub->devnum << 16;
@@ -780,7 +781,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
                        (void) handshake (&ehci->regs->status, STS_ASS, 0, 150);
                        cmd |= CMD_ASE | CMD_RUN;
                        writel (cmd, &ehci->regs->command);
-                       ehci_to_hcd(ehci)->state = USB_STATE_RUNNING;
+                       ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;
                        /* posted write need not be known to HC yet ... */
                }
        }
@@ -959,7 +960,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
        qh_completions (ehci, qh, regs);
 
        if (!list_empty (&qh->qtd_list)
-                       && HCD_IS_RUNNING (ehci_to_hcd(ehci)->state))
+                       && HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
                qh_link_async (ehci, qh);
        else {
                qh_put (qh);            // refcount from async list
@@ -967,7 +968,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
                /* it's not free to turn the async schedule on/off; leave it
                 * active but idle for a while once it empties.
                 */
-               if (HCD_IS_RUNNING (ehci_to_hcd(ehci)->state)
+               if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state)
                                && ehci->async->qh_next.qh == NULL)
                        timer_action (ehci, TIMER_ASYNC_OFF);
        }
@@ -998,7 +999,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
        /* stop async schedule right now? */
        if (unlikely (qh == ehci->async)) {
                /* can't get here without STS_ASS set */
-               if (ehci_to_hcd(ehci)->state != USB_STATE_HALT) {
+               if (ehci_to_hcd(ehci)->state != HC_STATE_HALT) {
                        writel (cmd & ~CMD_ASE, &ehci->regs->command);
                        wmb ();
                        // handshake later, if we need to
@@ -1018,7 +1019,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
        prev->qh_next = qh->qh_next;
        wmb ();
 
-       if (unlikely (ehci_to_hcd(ehci)->state == USB_STATE_HALT)) {
+       if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) {
                /* if (unlikely (qh->reclaim != 0))
                 *      this will recurse, probably not much
                 */