aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/file_storage.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-02 11:03:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-02 11:03:08 -0700
commit1be1d6b7f3f6e3a87f872dd5e7a867d03d8a6851 (patch)
tree102ef63f93d7d6d8400fc88158cc859a92a2b44f /drivers/usb/gadget/file_storage.c
parent37b6a04fd9fc887bbcc1a27d9354a5e7a5a4cdd8 (diff)
parent62fd2cac5bf5cf9e6fcb2fc40b32e7271e605c53 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (32 commits) USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance, clear-feature ignore USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance usb_serial: some coding style fixes USB: Remove redundant dependencies on USB_ATM. USB: UHCI: disable remote wakeup when it's not needed USB: OHCI: work around bogus compiler warning USB: add Cypress c67x00 OTG controller HCD driver USB: add Cypress c67x00 OTG controller core driver USB: add Cypress c67x00 low level interface code USB: airprime: unlock mutex instead of trying to lock it again USB: storage: Update mailling list address USB: storage: UNUSUAL_DEVS() for PanDigital Picture frame. USB: Add the USB 2.0 extension descriptor. USB: add more FTDI device ids USB: fix cannot work usb storage when using ohci-sm501 usb: gadget zero timer init fix usb: gadget zero style fixups (mostly whitespace) usb serial gadget: CDC ACM fixes usb: pxa27x_udc driver USB: INTOVA Pixtreme camera mass storage device ...
Diffstat (limited to 'drivers/usb/gadget/file_storage.c')
-rw-r--r--drivers/usb/gadget/file_storage.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index bf3f946fd45..47bb9f09a1a 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -2307,6 +2307,29 @@ static int halt_bulk_in_endpoint(struct fsg_dev *fsg)
return rc;
}
+static int wedge_bulk_in_endpoint(struct fsg_dev *fsg)
+{
+ int rc;
+
+ DBG(fsg, "bulk-in set wedge\n");
+ rc = usb_ep_set_wedge(fsg->bulk_in);
+ if (rc == -EAGAIN)
+ VDBG(fsg, "delayed bulk-in endpoint wedge\n");
+ while (rc != 0) {
+ if (rc != -EAGAIN) {
+ WARN(fsg, "usb_ep_set_wedge -> %d\n", rc);
+ rc = 0;
+ break;
+ }
+
+ /* Wait for a short time and then try again */
+ if (msleep_interruptible(100) != 0)
+ return -EINTR;
+ rc = usb_ep_set_wedge(fsg->bulk_in);
+ }
+ return rc;
+}
+
static int pad_with_zeros(struct fsg_dev *fsg)
{
struct fsg_buffhd *bh = fsg->next_buffhd_to_fill;
@@ -2957,7 +2980,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
* We aren't required to halt the OUT endpoint; instead
* we can simply accept and discard any data received
* until the next reset. */
- halt_bulk_in_endpoint(fsg);
+ wedge_bulk_in_endpoint(fsg);
set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
return -EINVAL;
}