This changes the driver to use the new tt_available function.  In the 
sitd_slot_ok function this is a simple change.  The change to 
check_intr_schedule changes the scheduling of the csplits, no longer is 
gap_uf used, instead the csplits are scheduled according to the USB 2.0 
spec section 11.18.4 requirement 3b, that is, a csplit in each of the 
uframes folling the downstream transfer (which is 1 uframe after the 
ssplit), except for transfers in uframe 5 and 6, since those would need 
FSTN which isn't supported yet.


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



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 12:45:45.000000000 -0400
+++ b/drivers/usb/host/ehci-sched.c     2005-08-03 12:55:35.000000000 -0400
@@ -670,7 +670,6 @@ static int check_intr_schedule (
 )
 {
        int             retval = -ENOSPC;
-       u8              mask;
 
        if (qh->c_usecs && uframe >= 6)         /* FSTN territory? */
                goto done;
@@ -690,18 +690,37 @@ static int check_intr_schedule (
         * NOTE:  both SPLIT and CSPLIT could be checked in just
         * one smart pass...
         */
-       mask = 0x03 << (uframe + qh->gap_uf);
-       *c_maskp = cpu_to_le32 (mask << 8);
+       if (tt_available (ehci, qh->period, qh->dev,
+                       frame, uframe + 1, qh->tt_usecs)) {
+               u32 mask;
 
-       mask |= 1 << uframe;
-       if (tt_no_collision (ehci, qh->period, qh->dev, frame, mask)) {
-               if (!check_period (ehci, frame, uframe + qh->gap_uf + 1,
-                                       qh->period, qh->c_usecs))
+               if (!check_period (ehci, frame, uframe + 2,
+                               qh->period, qh->c_usecs))
                        goto done;
-               if (!check_period (ehci, frame, uframe + qh->gap_uf,
+               mask = 1 << (uframe + 2 + 8);
+
+               /* FIXME : ssplit in uframe 5 will currently
+                * only have 1 csplit in uframe 7, it needs FSTN (1 FSTN 
csplit).
+                * ssplit in uframe 4 will only have 2 csplits in
+                * uframes 6 and 7, which also needs FSTN (1 FSTN csplit).
+                */
+               if (uframe < 5) {
+                       if (!check_period (ehci, frame, uframe + 3,
                                        qh->period, qh->c_usecs))
-                       goto done;
+                               goto done;
+                       mask |= 1 << (uframe + 3 + 8);
+               }
+
+               if (uframe < 4) {
+                       if (!check_period (ehci, frame, uframe + 4,
+                                       qh->period, qh->c_usecs))
+                               goto done;
+                       mask |= 1 << (uframe + 4 + 8);
+               }
+
                retval = 0;
+
+               *c_maskp = cpu_to_le32 (mask);
        }
 done:
        return retval;
@@ -1229,11 +1248,11 @@ sitd_slot_ok (
                frame = uframe >> 3;
                uf = uframe & 7;
 
-               /* tt must be idle for start(s), any gap, and csplit.
-                * assume scheduling slop leaves 10+% for control/bulk.
+               /* The tt's fullspeed bus bandwidth must be available.
+                * tt_available scheduling guarantees 10+% for control/bulk.
                 */
-               if (!tt_no_collision (ehci, period_uframes << 3,
-                               stream->udev, frame, mask))
+               if (!tt_available (ehci, period_uframes << 3,
+                               stream->udev, frame, uf + 1, stream->tt_usecs))
                        return 0;
 
                /* check starts (OUT uses more than one) */


-------------------------------------------------------
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