diff options
author | david-b@pacbell.net <david-b@pacbell.net> | 2005-08-13 21:41:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 19:28:35 -0400 |
commit | e09711aef4180002241c7f2eab37390ddf40d6a0 (patch) | |
tree | 9a537e417df8b8ab0d8e121f6a3e596898ec8ec0 /drivers/usb/core/hub.c | |
parent | 090ffa9d0e904e1ed0f86c84dcf20684a8ac1a5a (diff) |
[PATCH] ehci: add think_time
This adds think_time to the usb_tt struct and sets it appropriately
(measured in ns); this can help us implement better split transaction
scheduling.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9f54e8330f78..758c7f0ed159 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -627,19 +627,33 @@ static int hub_configure(struct usb_hub *hub, | |||
627 | break; | 627 | break; |
628 | } | 628 | } |
629 | 629 | ||
630 | /* Note 8 FS bit times == (8 bits / 12000000 bps) ~= 666ns */ | ||
630 | switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) { | 631 | switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) { |
631 | case 0x00: | 632 | case HUB_TTTT_8_BITS: |
632 | if (hdev->descriptor.bDeviceProtocol != 0) | 633 | if (hdev->descriptor.bDeviceProtocol != 0) { |
633 | dev_dbg(hub_dev, "TT requires at most 8 FS bit times\n"); | 634 | hub->tt.think_time = 666; |
635 | dev_dbg(hub_dev, "TT requires at most %d " | ||
636 | "FS bit times (%d ns)\n", | ||
637 | 8, hub->tt.think_time); | ||
638 | } | ||
634 | break; | 639 | break; |
635 | case 0x20: | 640 | case HUB_TTTT_16_BITS: |
636 | dev_dbg(hub_dev, "TT requires at most 16 FS bit times\n"); | 641 | hub->tt.think_time = 666 * 2; |
642 | dev_dbg(hub_dev, "TT requires at most %d " | ||
643 | "FS bit times (%d ns)\n", | ||
644 | 16, hub->tt.think_time); | ||
637 | break; | 645 | break; |
638 | case 0x40: | 646 | case HUB_TTTT_24_BITS: |
639 | dev_dbg(hub_dev, "TT requires at most 24 FS bit times\n"); | 647 | hub->tt.think_time = 666 * 3; |
648 | dev_dbg(hub_dev, "TT requires at most %d " | ||
649 | "FS bit times (%d ns)\n", | ||
650 | 24, hub->tt.think_time); | ||
640 | break; | 651 | break; |
641 | case 0x60: | 652 | case HUB_TTTT_32_BITS: |
642 | dev_dbg(hub_dev, "TT requires at most 32 FS bit times\n"); | 653 | hub->tt.think_time = 666 * 4; |
654 | dev_dbg(hub_dev, "TT requires at most %d " | ||
655 | "FS bit times (%d ns)\n", | ||
656 | 32, hub->tt.think_time); | ||
643 | break; | 657 | break; |
644 | } | 658 | } |
645 | 659 | ||