diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-08-21 15:40:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:19 -0400 |
commit | eb23105462304fd35571fd0cab1de7aec79a9ec5 (patch) | |
tree | 3579e74b3f1a6e68d42de01c122d206447454d4b /drivers/usb/host/uhci-q.c | |
parent | b0d9efba3ec53468984aecef8eeaf079089f2e5a (diff) |
USB: add urb->unlinked field
This patch (as970) adds a new urb->unlinked field, which is used to
store the status of unlinked URBs since we can't use urb->status for
that purpose any more. To help simplify the HCDs, usbcore will check
urb->unlinked before calling the completion handler; if the value is
set it will automatically override the status reported by the HCD.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
CC: Olav Kongas <ok@artecdesign.ee>
CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
CC: Tony Olech <tony.olech@elandigitalsystems.com>
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.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index fbc3af392c2..bab56726655 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -1557,15 +1557,12 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) | |||
1557 | break; | 1557 | break; |
1558 | 1558 | ||
1559 | spin_lock(&urb->lock); | 1559 | spin_lock(&urb->lock); |
1560 | if (urb->status == -EINPROGRESS) /* Not dequeued */ | 1560 | urb->status = status; |
1561 | urb->status = status; | ||
1562 | else | ||
1563 | status = ECONNRESET; /* Not -ECONNRESET */ | ||
1564 | spin_unlock(&urb->lock); | 1561 | spin_unlock(&urb->lock); |
1565 | 1562 | ||
1566 | /* Dequeued but completed URBs can't be given back unless | 1563 | /* Dequeued but completed URBs can't be given back unless |
1567 | * the QH is stopped or has finished unlinking. */ | 1564 | * the QH is stopped or has finished unlinking. */ |
1568 | if (status == ECONNRESET) { | 1565 | if (urb->unlinked) { |
1569 | if (QH_FINISHED_UNLINKING(qh)) | 1566 | if (QH_FINISHED_UNLINKING(qh)) |
1570 | qh->is_stopped = 1; | 1567 | qh->is_stopped = 1; |
1571 | else if (!qh->is_stopped) | 1568 | else if (!qh->is_stopped) |
@@ -1588,7 +1585,7 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) | |||
1588 | restart: | 1585 | restart: |
1589 | list_for_each_entry(urbp, &qh->queue, node) { | 1586 | list_for_each_entry(urbp, &qh->queue, node) { |
1590 | urb = urbp->urb; | 1587 | urb = urbp->urb; |
1591 | if (urb->status != -EINPROGRESS) { | 1588 | if (urb->unlinked) { |
1592 | 1589 | ||
1593 | /* Fix up the TD links and save the toggles for | 1590 | /* Fix up the TD links and save the toggles for |
1594 | * non-Isochronous queues. For Isochronous queues, | 1591 | * non-Isochronous queues. For Isochronous queues, |