diff options
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r-- | drivers/usb/host/ehci.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 951d69fec513..bf92d209a1a9 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -74,7 +74,6 @@ struct ehci_hcd { /* one per controller */ | |||
74 | /* async schedule support */ | 74 | /* async schedule support */ |
75 | struct ehci_qh *async; | 75 | struct ehci_qh *async; |
76 | struct ehci_qh *reclaim; | 76 | struct ehci_qh *reclaim; |
77 | unsigned reclaim_ready : 1; | ||
78 | unsigned scanning : 1; | 77 | unsigned scanning : 1; |
79 | 78 | ||
80 | /* periodic schedule support */ | 79 | /* periodic schedule support */ |
@@ -105,6 +104,7 @@ struct ehci_hcd { /* one per controller */ | |||
105 | struct dma_pool *itd_pool; /* itd per iso urb */ | 104 | struct dma_pool *itd_pool; /* itd per iso urb */ |
106 | struct dma_pool *sitd_pool; /* sitd per split iso urb */ | 105 | struct dma_pool *sitd_pool; /* sitd per split iso urb */ |
107 | 106 | ||
107 | struct timer_list iaa_watchdog; | ||
108 | struct timer_list watchdog; | 108 | struct timer_list watchdog; |
109 | unsigned long actions; | 109 | unsigned long actions; |
110 | unsigned stamp; | 110 | unsigned stamp; |
@@ -127,6 +127,14 @@ struct ehci_hcd { /* one per controller */ | |||
127 | #else | 127 | #else |
128 | # define COUNT(x) do {} while (0) | 128 | # define COUNT(x) do {} while (0) |
129 | #endif | 129 | #endif |
130 | |||
131 | /* debug files */ | ||
132 | #ifdef DEBUG | ||
133 | struct dentry *debug_dir; | ||
134 | struct dentry *debug_async; | ||
135 | struct dentry *debug_periodic; | ||
136 | struct dentry *debug_registers; | ||
137 | #endif | ||
130 | }; | 138 | }; |
131 | 139 | ||
132 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ | 140 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ |
@@ -140,9 +148,21 @@ static inline struct usb_hcd *ehci_to_hcd (struct ehci_hcd *ehci) | |||
140 | } | 148 | } |
141 | 149 | ||
142 | 150 | ||
151 | static inline void | ||
152 | iaa_watchdog_start(struct ehci_hcd *ehci) | ||
153 | { | ||
154 | WARN_ON(timer_pending(&ehci->iaa_watchdog)); | ||
155 | mod_timer(&ehci->iaa_watchdog, | ||
156 | jiffies + msecs_to_jiffies(EHCI_IAA_MSECS)); | ||
157 | } | ||
158 | |||
159 | static inline void iaa_watchdog_done(struct ehci_hcd *ehci) | ||
160 | { | ||
161 | del_timer(&ehci->iaa_watchdog); | ||
162 | } | ||
163 | |||
143 | enum ehci_timer_action { | 164 | enum ehci_timer_action { |
144 | TIMER_IO_WATCHDOG, | 165 | TIMER_IO_WATCHDOG, |
145 | TIMER_IAA_WATCHDOG, | ||
146 | TIMER_ASYNC_SHRINK, | 166 | TIMER_ASYNC_SHRINK, |
147 | TIMER_ASYNC_OFF, | 167 | TIMER_ASYNC_OFF, |
148 | }; | 168 | }; |
@@ -160,9 +180,6 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
160 | unsigned long t; | 180 | unsigned long t; |
161 | 181 | ||
162 | switch (action) { | 182 | switch (action) { |
163 | case TIMER_IAA_WATCHDOG: | ||
164 | t = EHCI_IAA_JIFFIES; | ||
165 | break; | ||
166 | case TIMER_IO_WATCHDOG: | 183 | case TIMER_IO_WATCHDOG: |
167 | t = EHCI_IO_JIFFIES; | 184 | t = EHCI_IO_JIFFIES; |
168 | break; | 185 | break; |
@@ -179,8 +196,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
179 | // async queue SHRINK often precedes IAA. while it's ready | 196 | // async queue SHRINK often precedes IAA. while it's ready |
180 | // to go OFF neither can matter, and afterwards the IO | 197 | // to go OFF neither can matter, and afterwards the IO |
181 | // watchdog stops unless there's still periodic traffic. | 198 | // watchdog stops unless there's still periodic traffic. |
182 | if (action != TIMER_IAA_WATCHDOG | 199 | if (time_before_eq(t, ehci->watchdog.expires) |
183 | && t > ehci->watchdog.expires | ||
184 | && timer_pending (&ehci->watchdog)) | 200 | && timer_pending (&ehci->watchdog)) |
185 | return; | 201 | return; |
186 | mod_timer (&ehci->watchdog, t); | 202 | mod_timer (&ehci->watchdog, t); |
@@ -534,8 +550,8 @@ struct ehci_iso_stream { | |||
534 | * trusting urb->interval == f(epdesc->bInterval) and | 550 | * trusting urb->interval == f(epdesc->bInterval) and |
535 | * including the extra info for hw_bufp[0..2] | 551 | * including the extra info for hw_bufp[0..2] |
536 | */ | 552 | */ |
537 | u8 interval; | ||
538 | u8 usecs, c_usecs; | 553 | u8 usecs, c_usecs; |
554 | u16 interval; | ||
539 | u16 tt_usecs; | 555 | u16 tt_usecs; |
540 | u16 maxp; | 556 | u16 maxp; |
541 | u16 raw_mask; | 557 | u16 raw_mask; |
@@ -586,7 +602,6 @@ struct ehci_itd { | |||
586 | unsigned frame; /* where scheduled */ | 602 | unsigned frame; /* where scheduled */ |
587 | unsigned pg; | 603 | unsigned pg; |
588 | unsigned index[8]; /* in urb->iso_frame_desc */ | 604 | unsigned index[8]; /* in urb->iso_frame_desc */ |
589 | u8 usecs[8]; | ||
590 | } __attribute__ ((aligned (32))); | 605 | } __attribute__ ((aligned (32))); |
591 | 606 | ||
592 | /*-------------------------------------------------------------------------*/ | 607 | /*-------------------------------------------------------------------------*/ |
@@ -725,11 +740,16 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) | |||
725 | * definition below can die once the 4xx support is | 740 | * definition below can die once the 4xx support is |
726 | * finally ported over. | 741 | * finally ported over. |
727 | */ | 742 | */ |
728 | #if defined(CONFIG_PPC) | 743 | #if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE) |
729 | #define readl_be(addr) in_be32((__force unsigned *)addr) | 744 | #define readl_be(addr) in_be32((__force unsigned *)addr) |
730 | #define writel_be(val, addr) out_be32((__force unsigned *)addr, val) | 745 | #define writel_be(val, addr) out_be32((__force unsigned *)addr, val) |
731 | #endif | 746 | #endif |
732 | 747 | ||
748 | #if defined(CONFIG_ARM) && defined(CONFIG_ARCH_IXP4XX) | ||
749 | #define readl_be(addr) __raw_readl((__force unsigned *)addr) | ||
750 | #define writel_be(val, addr) __raw_writel(val, (__force unsigned *)addr) | ||
751 | #endif | ||
752 | |||
733 | static inline unsigned int ehci_readl(const struct ehci_hcd *ehci, | 753 | static inline unsigned int ehci_readl(const struct ehci_hcd *ehci, |
734 | __u32 __iomem * regs) | 754 | __u32 __iomem * regs) |
735 | { | 755 | { |