From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Rae Date: Thu, 29 Jan 2015 15:27:28 -0800 Subject: [U-Boot] [PATCH 1/2] fastboot: add "fastboot oem" command support In-Reply-To: <1422308941-23543-2-git-send-email-robh@kernel.org> References: <1422308941-23543-1-git-send-email-robh@kernel.org> <1422308941-23543-2-git-send-email-robh@kernel.org> Message-ID: <54CAC1E0.3030207@broadcom.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 15-01-26 01:49 PM, Rob Herring wrote: > From: Michael Scott > > Add code stub to handle "fastboot oem __" command. As unlock is a common > fastboot command, distinguish that it is not implemented. > > Signed-off-by: Michael Scott > Signed-off-by: Rob Herring > --- > drivers/usb/gadget/f_fastboot.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c > index 310175a..e2fda86 100644 > --- a/drivers/usb/gadget/f_fastboot.c > +++ b/drivers/usb/gadget/f_fastboot.c > @@ -513,6 +513,17 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) > } > #endif > > +static void cb_oem(struct usb_ep *ep, struct usb_request *req) > +{ > + char *cmd = req->buf; > + if (strncmp("unlock", cmd + 4, 8) == 0) { > + fastboot_tx_write_str("FAILnot implemented"); > + } > + else { > + fastboot_tx_write_str("FAILunknown oem command"); > + } > +} > + > struct cmd_dispatch_info { > char *cmd; > void (*cb)(struct usb_ep *ep, struct usb_request *req); > @@ -541,6 +552,10 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = { > .cb = cb_flash, > }, > #endif > + { > + .cmd = "oem", > + .cb = cb_oem, > + }, > }; > > static void rx_handler_command(struct usb_ep *ep, struct usb_request *req) > Tested-by: Steve Rae