This adds the field tt_usecs to ehci_qh and ehci_iso_stream, and sets it 
appropriately when setting up a ehci_qh or ehci_iso_stream.  It is set to 
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 the qh or iso stream, as calculated by usb_calc_bus_time.

Signed-off-by: Dan Streetman <[EMAIL PROTECTED]>


diff -urpN a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
--- a/drivers/usb/host/ehci-q.c 2005-08-03 13:09:41.000000000 -0400
+++ b/drivers/usb/host/ehci-q.c 2005-08-03 13:14:22.000000000 -0400
@@ -679,6 +679,9 @@ qh_make (
                        /* gap is f(FS/LS transfer times) */
                        qh->gap_uf = 1 + usb_calc_bus_time (urb->dev->speed,
                                        is_input, 0, maxp) / (125 * 1000);
+                       int think_time = urb->dev->tt
+                                       ? urb->dev->tt->think_time
+                                       : 0;
 
                        /* FIXME this just approximates SPLIT/CSPLIT times */
                        if (is_input) {         // SPLIT, gap, CSPLIT+DATA
@@ -689,6 +692,9 @@ qh_make (
                                qh->c_usecs = HS_USECS (0);
                        }
 
+                       qh->tt_usecs = NS_TO_US (think_time +
+                                       usb_calc_bus_time (urb->dev->speed,
+                                       is_input, 0, max_packet (maxp)));
                        qh->period = urb->interval;
                }
        }
diff -urpN a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
--- a/drivers/usb/host/ehci-sched.c     2005-08-03 13:09:41.000000000 -0400
+++ b/drivers/usb/host/ehci-sched.c     2005-08-03 13:14:22.000000000 -0400
@@ -699,6 +699,7 @@ iso_stream_init (
 
        } else {
                u32             addr;
+               int think_time = dev->tt ? dev->tt->think_time : 0;
 
                addr = dev->ttport << 24;
                if (!ehci_is_TDI(ehci)
@@ -708,6 +709,8 @@ iso_stream_init (
                addr |= epnum << 8;
                addr |= dev->devnum;
                stream->usecs = HS_USECS_ISO (maxp);
+               stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time (
+                               dev->speed, is_input, 1, maxp));
                if (is_input) {
                        u32     tmp;
 
diff -urpN a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
--- a/drivers/usb/host/ehci.h   2005-08-03 13:09:41.000000000 -0400
+++ b/drivers/usb/host/ehci.h   2005-08-03 13:14:22.000000000 -0400
@@ -416,6 +416,7 @@ struct ehci_qh {
        u8                      usecs;          /* intr bandwidth */
        u8                      gap_uf;         /* uframes split/csplit gap */
        u8                      c_usecs;        /* ... split completion bw */
+       u16                     tt_usecs;       /* tt downstream bandwidth */
        unsigned short          period;         /* polling interval */
        unsigned short          start;          /* where polling starts */
 #define NO_FRAME ((unsigned short)~0)                  /* pick new start */
@@ -474,6 +475,7 @@ struct ehci_iso_stream {
         */
        u8                      interval;
        u8                      usecs, c_usecs;
+       u16                     tt_usecs;
        u16                     maxp;
        u16                     raw_mask;
        unsigned                bandwidth;


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to