On Tue, 18 Aug 2015, Igor Kotrasinski wrote:

> When handling device GET_DESCRIPTOR, composite gadget driver fills
> the bcdUSB field only if the gadget supports USB 3.0. Otherwise
> the field is left unfilled.
> 
> Make behaviour consistent by filling bcdUSB for the other two cases of
> USB 2.0 and USB 1.1 capable gadgets.
> 
> Given that legacy gadget drivers set bcdUSB manually, it makes sense to
> place the entire logic in the composite gadget driver.
> 
> Signed-off-by: Igor Kotrasinski <i.kotrasi...@samsung.com>
> ---
>  drivers/usb/gadget/composite.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 58b4657..6eac055 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1499,6 +1499,10 @@ composite_setup(struct usb_gadget *gadget, const 
> struct usb_ctrlrequest *ctrl)
>                               } else {
>                                       cdev->desc.bcdUSB = cpu_to_le16(0x0210);
>                               }
> +                     } else if (gadget_is_dualspeed(gadget)) {
> +                             cdev->desc.bcdUSB = cpu_to_le16(0x0200);
> +                     } else {
> +                             cdev->desc.bcdUSB = cpu_to_le16(0x0110);
>                       }

I would argue that there's no need to check gadget_is_dualspeed();
bcdUSB should always be set to 0x0200.  After all, the spec explicitly
permits USB-2.0 devices to run only at full speed.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to