Re: [PATCH] usb: gadget: composite: fill bcdUSB for any gadget max speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.kotrasinsk@xxxxxxxxxxx>
> ---
>  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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux