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 15:04:12 -0700 |
commit | caf3827a65af476c71eaeb79636869a4ab128d48 (patch) | |
tree | 78ef5d5ec466e59d9ac626faf34fb1031ba4fd8e /drivers/usb/host/uhci-hcd.h | |
parent | 10b8e47d6b32bfba22874354c62770cb4e42aa6c (diff) | |
download | kernel_samsung_smdk4412-caf3827a65af476c71eaeb79636869a4ab128d48.zip kernel_samsung_smdk4412-caf3827a65af476c71eaeb79636869a4ab128d48.tar.gz kernel_samsung_smdk4412-caf3827a65af476c71eaeb79636869a4ab128d48.tar.bz2 |
[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 c87ceaa..eaac6dd 100644 --- a/drivers/usb/host/uhci-hcd.h +++ b/drivers/usb/host/uhci-hcd.h @@ -140,6 +140,8 @@ struct uhci_qh { unsigned long advance_jiffies; /* Time of last queue advance */ unsigned int unlink_frame; /* When the QH was unlinked */ + unsigned int period; /* For Interrupt and Isochronous QHs */ + int state; /* QH_STATE_xxx; see above */ int type; /* Queue type (control, bulk, etc) */ @@ -315,38 +317,8 @@ static inline u32 td_status(struct uhci_td *td) { #define skel_bulk_qh skelqh[12] #define skel_term_qh skelqh[13] -/* - * Search tree for determining where <interval> fits in the skelqh[] - * skeleton. - * - * An interrupt request should be placed into the slowest skelqh[] - * which meets the interval/period/frequency requirement. - * An interrupt request is allowed to be faster than <interval> but not slower. - * - * For a given <interval>, this function returns the appropriate/matching - * skelqh[] index value. - */ -static inline int __interval_to_skel(int interval) -{ - if (interval < 16) { - if (interval < 4) { - if (interval < 2) - return 9; /* int1 for 0-1 ms */ - return 8; /* int2 for 2-3 ms */ - } - if (interval < 8) - return 7; /* int4 for 4-7 ms */ - return 6; /* int8 for 8-15 ms */ - } - if (interval < 64) { - if (interval < 32) - return 5; /* int16 for 16-31 ms */ - return 4; /* int32 for 32-63 ms */ - } - if (interval < 128) - return 3; /* int64 for 64-127 ms */ - return 2; /* int128 for 128-255 ms (Max.) */ -} +/* Find the skelqh entry corresponding to an interval exponent */ +#define UHCI_SKEL_INDEX(exponent) (9 - exponent) /* |