summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
authorAlan Stern2005-04-09 23:26:00 +0200
committerGreg Kroah-Hartman2005-06-27 23:43:43 +0200
commitf5946f8220a866dcdb8edc6abe23c1443e252425 (patch)
tree3984d5eb8382d3bc694168e90957206d97fd7d1c /drivers/usb/host/uhci-q.c
parent[PATCH] USB UHCI: subroutine reordering (diff)
downloadkernel-qcow2-linux-f5946f8220a866dcdb8edc6abe23c1443e252425.tar.gz
kernel-qcow2-linux-f5946f8220a866dcdb8edc6abe23c1443e252425.tar.xz
kernel-qcow2-linux-f5946f8220a866dcdb8edc6abe23c1443e252425.zip
[PATCH] USB UHCI: Minor improvements
This patch makes a few small improvements in the UHCI driver. Some code is moved between different source files and a more useful pointer is passed to a callback routine. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r--drivers/usb/host/uhci-q.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 2a7c19501f24..f5c75885f7be 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -1537,3 +1537,26 @@ static void uhci_scan_schedule(struct uhci_hcd *uhci, struct pt_regs *regs)
/* Wake up anyone waiting for an URB to complete */
wake_up_all(&uhci->waitqh);
}
+
+static void check_fsbr(struct uhci_hcd *uhci)
+{
+ struct urb_priv *up;
+
+ list_for_each_entry(up, &uhci->urb_list, urb_list) {
+ struct urb *u = up->urb;
+
+ spin_lock(&u->lock);
+
+ /* Check if the FSBR timed out */
+ if (up->fsbr && !up->fsbr_timeout && time_after_eq(jiffies, up->fsbrtime + IDLE_TIMEOUT))
+ uhci_fsbr_timeout(uhci, u);
+
+ spin_unlock(&u->lock);
+ }
+
+ /* Really disable FSBR */
+ if (!uhci->fsbr && uhci->fsbrtimeout && time_after_eq(jiffies, uhci->fsbrtimeout)) {
+ uhci->fsbrtimeout = 0;
+ uhci->skel_term_qh->link = UHCI_PTR_TERM;
+ }
+}