]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/usb/host/ehci-q.c
USB: add flow control to usb-serial generic driver.
[mv-sheeva.git] / drivers / usb / host / ehci-q.c
index 46327272f6148b7c044bec6c8d5c4f0737546310..e7fbbd00e7cd78a95776264a7c12033d5fa2a3a9 100644 (file)
@@ -789,13 +789,14 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
        head = ehci->async;
        timer_action_done (ehci, TIMER_ASYNC_OFF);
        if (!head->qh_next.qh) {
-               u32     cmd = readl (&ehci->regs->command);
+               u32     cmd = ehci_readl(ehci, &ehci->regs->command);
 
                if (!(cmd & CMD_ASE)) {
                        /* in case a clear of CMD_ASE didn't take yet */
-                       (void) handshake (&ehci->regs->status, STS_ASS, 0, 150);
+                       (void)handshake(ehci, &ehci->regs->status,
+                                       STS_ASS, 0, 150);
                        cmd |= CMD_ASE | CMD_RUN;
-                       writel (cmd, &ehci->regs->command);
+                       ehci_writel(ehci, cmd, &ehci->regs->command);
                        ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;
                        /* posted write need not be known to HC yet ... */
                }
@@ -967,7 +968,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
        struct ehci_qh          *qh = ehci->reclaim;
        struct ehci_qh          *next;
 
-       iaa_watchdog_done (ehci);
+       timer_action_done (ehci, TIMER_IAA_WATCHDOG);
 
        // qh->hw_next = cpu_to_le32 (qh->qh_dma);
        qh->qh_state = QH_STATE_IDLE;
@@ -977,6 +978,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
        /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
        next = qh->reclaim;
        ehci->reclaim = next;
+       ehci->reclaim_ready = 0;
        qh->reclaim = NULL;
 
        qh_completions (ehci, qh);
@@ -1006,7 +1008,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
 
 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
-       int             cmd = readl (&ehci->regs->command);
+       int             cmd = ehci_readl(ehci, &ehci->regs->command);
        struct ehci_qh  *prev;
 
 #ifdef DEBUG
@@ -1024,7 +1026,8 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
                if (ehci_to_hcd(ehci)->state != HC_STATE_HALT
                                && !ehci->reclaim) {
                        /* ... and CMD_IAAD clear */
-                       writel (cmd & ~CMD_ASE, &ehci->regs->command);
+                       ehci_writel(ehci, cmd & ~CMD_ASE,
+                                   &ehci->regs->command);
                        wmb ();
                        // handshake later, if we need to
                        timer_action_done (ehci, TIMER_ASYNC_OFF);
@@ -1051,10 +1054,11 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
                return;
        }
 
+       ehci->reclaim_ready = 0;
        cmd |= CMD_IAAD;
-       writel (cmd, &ehci->regs->command);
-       (void) readl (&ehci->regs->command);
-       iaa_watchdog_start (ehci);
+       ehci_writel(ehci, cmd, &ehci->regs->command);
+       (void)ehci_readl(ehci, &ehci->regs->command);
+       timer_action (ehci, TIMER_IAA_WATCHDOG);
 }
 
 /*-------------------------------------------------------------------------*/