Re: [PATCH] USB and Driver Core patches for 2.6.10

From: Greg KH
Date: Sat Jan 08 2005 - 06:25:38 EST


ChangeSet 1.1938.446.26, 2004/12/15 16:37:38-08:00, david-b@xxxxxxxxxxx

[PATCH] USB: UHCI and HCD API change (14/15)

UHCI changes to match the updated HCD glue calls. Since it's handed the
relevant endpoint queue on a silver platter, the driver no longer needs
to search anything to find the queue entries.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/usb/host/uhci-hcd.c | 39 +++++----------------------------------
1 files changed, 5 insertions(+), 34 deletions(-)


diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c 2005-01-07 15:48:04 -08:00
+++ b/drivers/usb/host/uhci-hcd.c 2005-01-07 15:48:04 -08:00
@@ -1255,7 +1255,9 @@
return NULL;
}

-static int uhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, int mem_flags)
+static int uhci_urb_enqueue(struct usb_hcd *hcd,
+ struct usb_host_endpoint *ep,
+ struct urb *urb, int mem_flags)
{
int ret;
struct uhci_hcd *uhci = hcd_to_uhci(hcd);
@@ -2293,44 +2295,13 @@
return &uhci->hcd;
}

-/* Are there any URBs for a particular device/endpoint on a given list? */
-static int urbs_for_ep_list(struct list_head *head,
- struct hcd_dev *hdev, int ep)
-{
- struct urb_priv *urbp;
-
- list_for_each_entry(urbp, head, urb_list) {
- struct urb *urb = urbp->urb;
-
- if (hdev == urb->dev->hcpriv && ep ==
- (usb_pipeendpoint(urb->pipe) |
- usb_pipein(urb->pipe)))
- return 1;
- }
- return 0;
-}
-
-/* Are there any URBs for a particular device/endpoint? */
-static int urbs_for_ep(struct uhci_hcd *uhci, struct hcd_dev *hdev, int ep)
-{
- int rc;
-
- spin_lock_irq(&uhci->schedule_lock);
- rc = (urbs_for_ep_list(&uhci->urb_list, hdev, ep) ||
- urbs_for_ep_list(&uhci->complete_list, hdev, ep) ||
- urbs_for_ep_list(&uhci->urb_remove_list, hdev, ep));
- spin_unlock_irq(&uhci->schedule_lock);
- return rc;
-}
-
/* Wait until all the URBs for a particular device/endpoint are gone */
static void uhci_hcd_endpoint_disable(struct usb_hcd *hcd,
- struct hcd_dev *hdev, int endpoint)
+ struct usb_host_endpoint *ep)
{
struct uhci_hcd *uhci = hcd_to_uhci(hcd);

- wait_event_interruptible(uhci->waitqh,
- !urbs_for_ep(uhci, hdev, endpoint));
+ wait_event_interruptible(uhci->waitqh, list_empty(&ep->urb_list));
}

static int uhci_hcd_get_frame_number(struct usb_hcd *hcd)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/