diff options
author | david-b@pacbell.net <david-b@pacbell.net> | 2005-08-13 21:44:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 19:28:36 -0400 |
commit | d0384200f6b608e77fb5ddf7dfae1bf0e42c1c6e (patch) | |
tree | 4ab0d9bcf70a42a2c75b7a4aca7a757e7085ee94 /drivers | |
parent | e09711aef4180002241c7f2eab37390ddf40d6a0 (diff) |
[PATCH] ehci: add tt_usecs
This adds the field tt_usecs to ehci_qh and ehci_iso_stream, and sets it
appropriately when setting them up as periodic endpoints. It records
the transation translator's think_time (added in last patch) plus the
downstream (i.e. low or full speed) bustime of the transfer associated
with each interrupt or iso frame, as calculated by usb_calc_bus_time.
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')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 20df01a79b2e..940d38ca7d91 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -677,6 +677,9 @@ qh_make ( | |||
677 | goto done; | 677 | goto done; |
678 | } | 678 | } |
679 | } else { | 679 | } else { |
680 | struct usb_tt *tt = urb->dev->tt; | ||
681 | int think_time; | ||
682 | |||
680 | /* gap is f(FS/LS transfer times) */ | 683 | /* gap is f(FS/LS transfer times) */ |
681 | qh->gap_uf = 1 + usb_calc_bus_time (urb->dev->speed, | 684 | qh->gap_uf = 1 + usb_calc_bus_time (urb->dev->speed, |
682 | is_input, 0, maxp) / (125 * 1000); | 685 | is_input, 0, maxp) / (125 * 1000); |
@@ -690,6 +693,10 @@ qh_make ( | |||
690 | qh->c_usecs = HS_USECS (0); | 693 | qh->c_usecs = HS_USECS (0); |
691 | } | 694 | } |
692 | 695 | ||
696 | think_time = tt ? tt->think_time : 0; | ||
697 | qh->tt_usecs = NS_TO_US (think_time + | ||
698 | usb_calc_bus_time (urb->dev->speed, | ||
699 | is_input, 0, max_packet (maxp))); | ||
693 | qh->period = urb->interval; | 700 | qh->period = urb->interval; |
694 | } | 701 | } |
695 | } | 702 | } |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 4c972b57c7c3..ccc7300baa6d 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -700,6 +700,7 @@ iso_stream_init ( | |||
700 | 700 | ||
701 | } else { | 701 | } else { |
702 | u32 addr; | 702 | u32 addr; |
703 | int think_time; | ||
703 | 704 | ||
704 | addr = dev->ttport << 24; | 705 | addr = dev->ttport << 24; |
705 | if (!ehci_is_TDI(ehci) | 706 | if (!ehci_is_TDI(ehci) |
@@ -709,6 +710,9 @@ iso_stream_init ( | |||
709 | addr |= epnum << 8; | 710 | addr |= epnum << 8; |
710 | addr |= dev->devnum; | 711 | addr |= dev->devnum; |
711 | stream->usecs = HS_USECS_ISO (maxp); | 712 | stream->usecs = HS_USECS_ISO (maxp); |
713 | think_time = dev->tt ? dev->tt->think_time : 0; | ||
714 | stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time ( | ||
715 | dev->speed, is_input, 1, maxp)); | ||
712 | if (is_input) { | 716 | if (is_input) { |
713 | u32 tmp; | 717 | u32 tmp; |
714 | 718 | ||
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index a7542157534c..20c9b550097d 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -421,6 +421,7 @@ struct ehci_qh { | |||
421 | u8 usecs; /* intr bandwidth */ | 421 | u8 usecs; /* intr bandwidth */ |
422 | u8 gap_uf; /* uframes split/csplit gap */ | 422 | u8 gap_uf; /* uframes split/csplit gap */ |
423 | u8 c_usecs; /* ... split completion bw */ | 423 | u8 c_usecs; /* ... split completion bw */ |
424 | u16 tt_usecs; /* tt downstream bandwidth */ | ||
424 | unsigned short period; /* polling interval */ | 425 | unsigned short period; /* polling interval */ |
425 | unsigned short start; /* where polling starts */ | 426 | unsigned short start; /* where polling starts */ |
426 | #define NO_FRAME ((unsigned short)~0) /* pick new start */ | 427 | #define NO_FRAME ((unsigned short)~0) /* pick new start */ |
@@ -479,6 +480,7 @@ struct ehci_iso_stream { | |||
479 | */ | 480 | */ |
480 | u8 interval; | 481 | u8 interval; |
481 | u8 usecs, c_usecs; | 482 | u8 usecs, c_usecs; |
483 | u16 tt_usecs; | ||
482 | u16 maxp; | 484 | u16 maxp; |
483 | u16 raw_mask; | 485 | u16 raw_mask; |
484 | unsigned bandwidth; | 486 | unsigned bandwidth; |