diff mbox

[U-Boot,v1,3/3] usb: gadget: fastboot: Set the Serial Number for Fastboot Gadget

Message ID 1423809223-24219-3-git-send-email-dileep.katta@linaro.org
State Accepted
Delegated to: Łukasz Majewski
Headers show

Commit Message

Dileep Katta Feb. 13, 2015, 6:33 a.m. UTC
Configure the serial number using the serial# environment variable
during the fastboot bind.

This enables "fastboot devices" to return the serial number for
the attached devices.

Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
---
 drivers/usb/gadget/f_fastboot.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Steve Rae Feb. 13, 2015, 7:32 p.m. UTC | #1
On 15-02-12 10:33 PM, Dileep Katta wrote:
> Configure the serial number using the serial# environment variable
> during the fastboot bind.
>
> This enables "fastboot devices" to return the serial number for
> the attached devices.
>
> Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
> ---
>   drivers/usb/gadget/f_fastboot.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index 0d53a61..d114c07 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -136,6 +136,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
>   	int id;
>   	struct usb_gadget *gadget = c->cdev->gadget;
>   	struct f_fastboot *f_fb = func_to_fastboot(f);
> +	const char *s;
>
>   	/* DYNAMIC interface numbers assignments */
>   	id = usb_interface_id(c, f);
> @@ -161,6 +162,10 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
>
>   	hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
>
> +	s = getenv("serial#");
> +	if (s)
> +		g_dnl_set_serialnumber((char *)s);
> +
>   	return 0;
>   }
>
>

Acked-by: Steve Rae <srae@broadcom.com>
Łukasz Majewski Feb. 24, 2015, 10:28 a.m. UTC | #2
Hi Dileep,

> Configure the serial number using the serial# environment variable
> during the fastboot bind.
> 
> This enables "fastboot devices" to return the serial number for
> the attached devices.
> 
> Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
> ---
>  drivers/usb/gadget/f_fastboot.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_fastboot.c
> b/drivers/usb/gadget/f_fastboot.c index 0d53a61..d114c07 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -136,6 +136,7 @@ static int fastboot_bind(struct usb_configuration
> *c, struct usb_function *f) int id;
>  	struct usb_gadget *gadget = c->cdev->gadget;
>  	struct f_fastboot *f_fb = func_to_fastboot(f);
> +	const char *s;
>  
>  	/* DYNAMIC interface numbers assignments */
>  	id = usb_interface_id(c, f);
> @@ -161,6 +162,10 @@ static int fastboot_bind(struct
> usb_configuration *c, struct usb_function *f) 
>  	hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
>  
> +	s = getenv("serial#");
> +	if (s)
> +		g_dnl_set_serialnumber((char *)s);
> +
>  	return 0;
>  }
>  

Applied to u-boot-dfu branch.

Thanks for the patch!
diff mbox

Patch

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 0d53a61..d114c07 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -136,6 +136,7 @@  static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 	int id;
 	struct usb_gadget *gadget = c->cdev->gadget;
 	struct f_fastboot *f_fb = func_to_fastboot(f);
+	const char *s;
 
 	/* DYNAMIC interface numbers assignments */
 	id = usb_interface_id(c, f);
@@ -161,6 +162,10 @@  static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 
 	hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
 
+	s = getenv("serial#");
+	if (s)
+		g_dnl_set_serialnumber((char *)s);
+
 	return 0;
 }