diff options
author | David Lopo <lopo.david@gmail.com> | 2008-04-29 05:14:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 13:25:58 -0400 |
commit | 62fd2cac5bf5cf9e6fcb2fc40b32e7271e605c53 (patch) | |
tree | 8e46c093b1c3191a57a14acb78f58a18773483ab /drivers/usb | |
parent | a5e54b0dbb6a099793caf508b1d6c7d82f965ec3 (diff) |
USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance, clear-feature ignore
Gadget tells controller driver to ignore Clear-Feature(HALT_ENDPOINT)
Signed-off-by: David Lopo <lopo.david@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index bf3f946fd455..47bb9f09a1aa 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) | |||
2307 | return rc; | 2307 | return rc; |
2308 | } | 2308 | } |
2309 | 2309 | ||
2310 | static int wedge_bulk_in_endpoint(struct fsg_dev *fsg) | ||
2311 | { | ||
2312 | int rc; | ||
2313 | |||
2314 | DBG(fsg, "bulk-in set wedge\n"); | ||
2315 | rc = usb_ep_set_wedge(fsg->bulk_in); | ||
2316 | if (rc == -EAGAIN) | ||
2317 | VDBG(fsg, "delayed bulk-in endpoint wedge\n"); | ||
2318 | while (rc != 0) { | ||
2319 | if (rc != -EAGAIN) { | ||
2320 | WARN(fsg, "usb_ep_set_wedge -> %d\n", rc); | ||
2321 | rc = 0; | ||
2322 | break; | ||
2323 | } | ||
2324 | |||
2325 | /* Wait for a short time and then try again */ | ||
2326 | if (msleep_interruptible(100) != 0) | ||
2327 | return -EINTR; | ||
2328 | rc = usb_ep_set_wedge(fsg->bulk_in); | ||
2329 | } | ||
2330 | return rc; | ||
2331 | } | ||
2332 | |||
2310 | static int pad_with_zeros(struct fsg_dev *fsg) | 2333 | static int pad_with_zeros(struct fsg_dev *fsg) |
2311 | { | 2334 | { |
2312 | struct fsg_buffhd *bh = fsg->next_buffhd_to_fill; | 2335 | 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) | |||
2957 | * We aren't required to halt the OUT endpoint; instead | 2980 | * We aren't required to halt the OUT endpoint; instead |
2958 | * we can simply accept and discard any data received | 2981 | * we can simply accept and discard any data received |
2959 | * until the next reset. */ | 2982 | * until the next reset. */ |
2960 | halt_bulk_in_endpoint(fsg); | 2983 | wedge_bulk_in_endpoint(fsg); |
2961 | set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); | 2984 | set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); |
2962 | return -EINVAL; | 2985 | return -EINVAL; |
2963 | } | 2986 | } |