From: Eddie Cai <eddie.cai.linux@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot PATCH V2 6/9] usb: ums: add do_extra_command
Date: Sun, 16 Apr 2017 23:54:11 +0800 [thread overview]
Message-ID: <20170416155414.14746-7-eddie.cai.linux@gmail.com> (raw)
In-Reply-To: <20170416155414.14746-1-eddie.cai.linux@gmail.com>
add do_extra_command to let people deal with customized command
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
---
drivers/usb/gadget/f_mass_storage.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 333f069..d431e53 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2168,6 +2168,10 @@ unknown_cmnd:
return 0;
}
+int __weak do_extra_command(struct fsg_common *common)
+{
+ return -EINVAL;
+}
/*-------------------------------------------------------------------------*/
static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
@@ -2540,8 +2544,10 @@ int fsg_main_thread(void *common_)
if (!exception_in_progress(common))
common->state = FSG_STATE_DATA_PHASE;
- if (do_scsi_command(common) || finish_reply(common))
+ if ((do_extra_command(common) && do_scsi_command(common)) ||
+ finish_reply(common)) {
continue;
+ }
if (!exception_in_progress(common))
common->state = FSG_STATE_STATUS_PHASE;
--
2.10.2
next prev parent reply other threads:[~2017-04-16 15:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-16 15:54 [U-Boot] [U-Boot PATCH V2 0/9] introduce Rockchip rockusb Eddie Cai
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 1/9] usb: ums: split macro and data struct in storage_common.c Eddie Cai
2017-04-19 15:19 ` Lukasz Majewski
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 2/9] usb: ums: split macro and data struct in f_mass_storage.c Eddie Cai
2017-04-19 15:20 ` Lukasz Majewski
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 3/9] usb: ums: merge storage_common.c into f_mass_storage.c Eddie Cai
2017-04-19 15:21 ` Lukasz Majewski
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 4/9] usb: ums: remove static declaration of some ums functions Eddie Cai
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 5/9] usb: ums: add functions to set and get usb interface descriptor Eddie Cai
2017-04-19 15:29 ` Lukasz Majewski
2017-04-20 0:55 ` Eddie Cai
2017-04-16 15:54 ` Eddie Cai [this message]
2017-04-19 22:14 ` [U-Boot] [U-Boot PATCH V2 6/9] usb: ums: add do_extra_command Lukasz Majewski
2017-04-20 1:03 ` Eddie Cai
2017-04-20 8:55 ` Lukasz Majewski
2017-04-20 9:14 ` Lukasz Majewski
2017-04-20 9:16 ` Eddie Cai
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 7/9] cmd: add rockusb command Eddie Cai
2017-04-19 22:27 ` Lukasz Majewski
2017-04-20 1:15 ` Eddie Cai
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 8/9] rockchip: config: enable rockusb support on rk3288 based board Eddie Cai
2017-04-19 22:29 ` Lukasz Majewski
2017-04-16 15:54 ` [U-Boot] [U-Boot PATCH V2 9/9] rockusb: add a simple readme Eddie Cai
2017-04-19 22:39 ` Lukasz Majewski
2017-04-20 1:43 ` Eddie Cai
2017-04-16 19:34 ` [U-Boot] [U-Boot PATCH V2 0/9] introduce Rockchip rockusb Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170416155414.14746-7-eddie.cai.linux@gmail.com \
--to=eddie.cai.linux@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox