aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/uhci-hcd.h')
-rw-r--r--drivers/usb/host/uhci-hcd.h36
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index c87ceaa178b6..eaac6ddf03a0 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -140,6 +140,8 @@ struct uhci_qh {
140 140
141 unsigned long advance_jiffies; /* Time of last queue advance */ 141 unsigned long advance_jiffies; /* Time of last queue advance */
142 unsigned int unlink_frame; /* When the QH was unlinked */ 142 unsigned int unlink_frame; /* When the QH was unlinked */
143 unsigned int period; /* For Interrupt and Isochronous QHs */
144
143 int state; /* QH_STATE_xxx; see above */ 145 int state; /* QH_STATE_xxx; see above */
144 int type; /* Queue type (control, bulk, etc) */ 146 int type; /* Queue type (control, bulk, etc) */
145 147
@@ -315,38 +317,8 @@ static inline u32 td_status(struct uhci_td *td) {
315#define skel_bulk_qh skelqh[12] 317#define skel_bulk_qh skelqh[12]
316#define skel_term_qh skelqh[13] 318#define skel_term_qh skelqh[13]
317 319
318/* 320/* Find the skelqh entry corresponding to an interval exponent */
319 * Search tree for determining where <interval> fits in the skelqh[] 321#define UHCI_SKEL_INDEX(exponent) (9 - exponent)
320 * skeleton.
321 *
322 * An interrupt request should be placed into the slowest skelqh[]
323 * which meets the interval/period/frequency requirement.
324 * An interrupt request is allowed to be faster than <interval> but not slower.
325 *
326 * For a given <interval>, this function returns the appropriate/matching
327 * skelqh[] index value.
328 */
329static inline int __interval_to_skel(int interval)
330{
331 if (interval < 16) {
332 if (interval < 4) {
333 if (interval < 2)
334 return 9; /* int1 for 0-1 ms */
335 return 8; /* int2 for 2-3 ms */
336 }
337 if (interval < 8)
338 return 7; /* int4 for 4-7 ms */
339 return 6; /* int8 for 8-15 ms */
340 }
341 if (interval < 64) {
342 if (interval < 32)
343 return 5; /* int16 for 16-31 ms */
344 return 4; /* int32 for 32-63 ms */
345 }
346 if (interval < 128)
347 return 3; /* int64 for 64-127 ms */
348 return 2; /* int128 for 128-255 ms (Max.) */
349}
350 322
351 323
352/* 324/*