diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-05-19 16:44:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 18:04:12 -0400 |
commit | caf3827a65af476c71eaeb79636869a4ab128d48 (patch) | |
tree | 78ef5d5ec466e59d9ac626faf34fb1031ba4fd8e /drivers/usb/host/uhci-hcd.h | |
parent | 10b8e47d6b32bfba22874354c62770cb4e42aa6c (diff) |
[PATCH] UHCI: store the period in the queue header
This patch (as689) stores the period for periodic transfers (interrupt
and ISO) in the queue header. This is necessary for proper bandwidth
tracking (not yet implemented). It also makes the scheduling of ISO
transfers a bit more rigorous, with checks for out-of-bounds frame
numbers.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-hcd.h')
-rw-r--r-- | drivers/usb/host/uhci-hcd.h | 36 |
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 | */ | ||
329 | static 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 | /* |