diff options
author | Michal Nazarewicz <m.nazarewicz@samsung.com> | 2010-01-27 05:14:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:54:50 -0500 |
commit | b00ce11f00c9e86442de000e8bd3dd42f089c8e1 (patch) | |
tree | 437cb34e5041d9fe97c62ce33a90ce011af92149 | |
parent | 7f1ee82695654faf0a93fc0abf3b08eb354ef1f6 (diff) |
USB: g_mass_storage: superfluous and missing packets fixed
The mass storage function responded needlessly to a set
configuration packet. This was a leftover from converting
gadget (file storage gadget) into a composite function.
Moreover, it has failed to respond to get max LUN request.
Adding request queueing made the function work better.
Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 0a18d446e9dd..3c835503ffb1 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
@@ -618,7 +618,12 @@ static int fsg_setup(struct usb_function *f, | |||
618 | return -EDOM; | 618 | return -EDOM; |
619 | VDBG(fsg, "get max LUN\n"); | 619 | VDBG(fsg, "get max LUN\n"); |
620 | *(u8 *) req->buf = fsg->common->nluns - 1; | 620 | *(u8 *) req->buf = fsg->common->nluns - 1; |
621 | return 1; | 621 | |
622 | /* Respond with data/status */ | ||
623 | req->length = min(1, w_length); | ||
624 | fsg->common->ep0req_name = | ||
625 | ctrl->bRequestType & USB_DIR_IN ? "ep0-in" : "ep0-out"; | ||
626 | return ep0_queue(fsg->common); | ||
622 | } | 627 | } |
623 | 628 | ||
624 | VDBG(fsg, | 629 | VDBG(fsg, |
@@ -2528,14 +2533,6 @@ static void handle_exception(struct fsg_common *common) | |||
2528 | 2533 | ||
2529 | case FSG_STATE_CONFIG_CHANGE: | 2534 | case FSG_STATE_CONFIG_CHANGE: |
2530 | rc = do_set_config(common, new_config); | 2535 | rc = do_set_config(common, new_config); |
2531 | if (common->ep0_req_tag != exception_req_tag) | ||
2532 | break; | ||
2533 | if (rc != 0) { /* STALL on errors */ | ||
2534 | DBG(common, "ep0 set halt\n"); | ||
2535 | usb_ep_set_halt(common->ep0); | ||
2536 | } else { /* Complete the status stage */ | ||
2537 | ep0_queue(common); | ||
2538 | } | ||
2539 | break; | 2536 | break; |
2540 | 2537 | ||
2541 | case FSG_STATE_EXIT: | 2538 | case FSG_STATE_EXIT: |