public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] usb: gadget: f_dfu: set serial number if serial# is valid
Date: Wed, 22 Feb 2017 13:08:10 +0100	[thread overview]
Message-ID: <20170222130810.7f24db63@jawa> (raw)
In-Reply-To: <20170222092238.1436-2-felipe.balbi@linux.intel.com>

On Wed, 22 Feb 2017 11:22:38 +0200
Felipe Balbi <felipe.balbi@linux.intel.com> wrote:

> With this patch, USB Command Verifier is happy with our DFU
> implementation on Chapter 9 tests.
> 
> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> ---
>  drivers/usb/gadget/f_dfu.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index 64cdfa7c98ec..52a6a79ceefc 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -691,6 +691,7 @@ static int dfu_bind(struct usb_configuration *c,
> struct usb_function *f) {
>  	struct usb_composite_dev *cdev = c->cdev;
>  	struct f_dfu *f_dfu = func_to_dfu(f);
> +	const char *s;
>  	int alt_num = dfu_get_alt_number();
>  	int rv, id, i;
>  
> @@ -724,6 +725,10 @@ static int dfu_bind(struct usb_configuration *c,
> struct usb_function *f) 
>  	cdev->req->context = f_dfu;
>  
> +	s = getenv("serial#");
> +	if (s)
> +		g_dnl_set_serialnumber((char *)s);
> +
>  error:
>  	return rv;
>  }

Acked-by: Lukasz Majewski <lukma@denx.de>

Tested-by: Lukasz Majewski <lukma@denx.de>

Test HW: BBB (am335x) - with tests/py/dfu
Test SW: test/py/dfu

I've applied it to u-boot-dfu tree.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

  reply	other threads:[~2017-02-22 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22  9:22 [U-Boot] [PATCH 1/2] usb: gadget: g_dnl: fix g_dnl_set_serialnumber() Felipe Balbi
2017-02-22  9:22 ` [U-Boot] [PATCH 2/2] usb: gadget: f_dfu: set serial number if serial# is valid Felipe Balbi
2017-02-22 12:08   ` Lukasz Majewski [this message]
2017-02-22 12:07 ` [U-Boot] [PATCH 1/2] usb: gadget: g_dnl: fix g_dnl_set_serialnumber() Lukasz Majewski

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=20170222130810.7f24db63@jawa \
    --to=lukma@denx.de \
    --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