<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Greg KH &lt;greg@kroah.com&gt;
To: marcelo@conectiva.com.br
Cc: linux-usb-devel@lists.sourceforge.net
Subject: [PATCH 10 of 14] USB uhci driver update

Hi,

Here's a patch against 2.4.19-pre2 that upgrades the speed of the uhci
driver.  This patch was done by Johannes Erdfelt.

thanks,

greg k-h



diff -Nru a/drivers/usb/uhci.c b/drivers/usb/uhci.c
--- a/drivers/usb/uhci.c	Mon Mar  4 08:48:59 2002
+++ b/drivers/usb/uhci.c	Mon Mar  4 08:48:59 2002
@@ -57,7 +57,6 @@
 
 #include &lt;linux/pm.h&gt;
 
-
 /*
  * Version Information
  */
@@ -65,7 +64,6 @@
 #define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber"
 #define DRIVER_DESC "USB Universal Host Controller Interface driver"
 
-
 /*
  * debug = 0, no debugging messages
  * debug = 1, dump failed URB's except for stalls
@@ -100,6 +98,7 @@
 
 /* If a transfer is still active after this much time, turn off FSBR */
 #define IDLE_TIMEOUT	(HZ / 20)	/* 50 ms */
+#define FSBR_DELAY	(HZ / 20)	/* 50 ms */
 
 #define MAX_URB_LOOP	2048		/* Maximum number of linked URB's */
 
@@ -766,7 +765,7 @@
 	if ((!(urb-&gt;transfer_flags &amp; USB_NO_FSBR)) &amp;&amp; urbp-&gt;fsbr) {
 		urbp-&gt;fsbr = 0;
 		if (!--uhci-&gt;fsbr)
-			uhci-&gt;skel_term_qh-&gt;link = UHCI_PTR_TERM;
+			uhci-&gt;fsbrtimeout = jiffies + FSBR_DELAY;
 	}
 
 	spin_unlock_irqrestore(&amp;uhci-&gt;frame_list_lock, flags);
@@ -2021,6 +2020,12 @@
 
 		u-&gt;transfer_flags |= USB_ASYNC_UNLINK | USB_TIMEOUT_KILLED;
 		uhci_unlink_urb(u);
+	}
+
+	/* Really disable FSBR */
+	if (!uhci-&gt;fsbr &amp;&amp; uhci-&gt;fsbrtimeout &amp;&amp; time_after_eq(jiffies, uhci-&gt;fsbrtimeout)) {
+		uhci-&gt;fsbrtimeout = 0;
+		uhci-&gt;skel_term_qh-&gt;link = UHCI_PTR_TERM;
 	}
 
 	/* enter global suspend if nothing connected */
diff -Nru a/drivers/usb/uhci.h b/drivers/usb/uhci.h
--- a/drivers/usb/uhci.h	Mon Mar  4 08:48:58 2002
+++ b/drivers/usb/uhci.h	Mon Mar  4 08:48:58 2002
@@ -309,6 +309,7 @@
 	spinlock_t frame_list_lock;
 	struct uhci_frame_list *fl;		/* P: uhci-&gt;frame_list_lock */
 	int fsbr;				/* Full speed bandwidth reclamation */
+	unsigned long fsbrtimeout;		/* FSBR delay */
 	int is_suspended;
 
 	/* Main list of URB's currently controlled by this HC */

</pre></body></html>