All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dfu, usb: set usb descriptor to values defined in dfu spec 1.1
Date: Fri, 5 Sep 2014 00:42:24 +0200	[thread overview]
Message-ID: <201409050042.24680.marex@denx.de> (raw)
In-Reply-To: <1409826100-24834-1-git-send-email-hs@denx.de>

On Thursday, September 04, 2014 at 12:21:40 PM, Heiko Schocher wrote:

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

> set bDeviceClass, bDeviceSubClass and bcdUSB to the values
> defined in dfu spec 1.1 chapter 4.2.1 found here:
> 
> http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Roger Meier <r.meier@siemens.com>
> 
> ---
> 
> before this patch, "dfu-util -l" showed:
> 
> Bus 002 Device 114: ID 0908:02c5 Siemens AG
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            2 Communications
>   bDeviceSubClass         2 Abstract (modem)
>   bDeviceProtocol         0 None
>   bMaxPacketSize0        64
>   idVendor           0x0908 Siemens AG
>   idProduct          0x02c5
>   bcdDevice            0.00
>   iManufacturer           1 Siemens AG
> 
> with this patch:
> 
> Bus 002 Device 089: ID 0908:02c5 Siemens AG
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x0908 Siemens AG
>   idProduct          0x02c5
>   bcdDevice            0.00
>   iManufacturer           1 Siemens AG
>   iProduct                2 USB download gadget
> 
> which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with
> the DFU spezifikation.

This patch doesn't seem fully right, let me explain below please.

> ---
>  drivers/usb/gadget/f_dfu.c | 5 +++--
>  drivers/usb/gadget/g_dnl.c | 6 +++---
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index 9128add..9429e50 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -83,8 +83,9 @@ static struct usb_descriptor_header *dfu_runtime_descs[]
> = { static const struct usb_qualifier_descriptor dev_qualifier = {
>  	.bLength =		sizeof dev_qualifier,
>  	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
> -	.bcdUSB =		__constant_cpu_to_le16(0x0200),
> -	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
> +	.bcdUSB =		__constant_cpu_to_le16(0x0110),

See [1] and look for first and second instance of 'bcdUsb' there please. Quote 
of the second one:

'
The bcdUSB field reports the highest version of USB the device supports. The 
value is in binary coded decimal with a format of 0xJJMN where JJ is the major 
version number, M is the minor version number and N is the sub minor version 
number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 
0x0100.
'

So this should be configured dynamically based on what the highest mode the 
controller supports is, no?

> +	.bDeviceClass =		USB_CLASS_PER_INTERFACE,

This might be OK.

> +	.bDeviceSubClass =	0x00,

But this is not, the device definitelly isn't CDC-serial.

[...]

[1] http://www.beyondlogic.org/usbnutshell/usb5.shtml

  reply	other threads:[~2014-09-04 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 10:21 [U-Boot] [PATCH] dfu, usb: set usb descriptor to values defined in dfu spec 1.1 Heiko Schocher
2014-09-04 22:42 ` Marek Vasut [this message]
2014-09-05  4:28   ` Heiko Schocher
2014-09-05  7:53     ` Lukasz Majewski
2014-09-05  8:11       ` Heiko Schocher
2014-09-05 10:37         ` Marek Vasut
2014-09-09  8:45   ` Heiko Schocher
2014-09-09 12:19     ` Marek Vasut

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=201409050042.24680.marex@denx.de \
    --to=marex@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.