aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-08-21 15:40:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:19 -0400
commiteb23105462304fd35571fd0cab1de7aec79a9ec5 (patch)
tree3579e74b3f1a6e68d42de01c122d206447454d4b /drivers/usb/gadget
parentb0d9efba3ec53468984aecef8eeaf079089f2e5a (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/gadget')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 0cb032526ca2..f2b124cf3206 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1029,8 +1029,7 @@ static int dummy_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
1029static void maybe_set_status (struct urb *urb, int status) 1029static void maybe_set_status (struct urb *urb, int status)
1030{ 1030{
1031 spin_lock (&urb->lock); 1031 spin_lock (&urb->lock);
1032 if (urb->status == -EINPROGRESS) 1032 urb->status = status;
1033 urb->status = status;
1034 spin_unlock (&urb->lock); 1033 spin_unlock (&urb->lock);
1035} 1034}
1036 1035
@@ -1257,10 +1256,9 @@ restart:
1257 int type; 1256 int type;
1258 1257
1259 urb = urbp->urb; 1258 urb = urbp->urb;
1260 if (urb->status != -EINPROGRESS) { 1259 if (urb->unlinked)
1261 /* likely it was just unlinked */
1262 goto return_urb; 1260 goto return_urb;
1263 } else if (dum->rh_state != DUMMY_RH_RUNNING) 1261 else if (dum->rh_state != DUMMY_RH_RUNNING)
1264 continue; 1262 continue;
1265 type = usb_pipetype (urb->pipe); 1263 type = usb_pipetype (urb->pipe);
1266 1264