On Tue, Aug 18, 2015 at 11:06:32AM -0400, Alan Stern wrote: > 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.
we should actually set it to 0x0210 so we get to send BOS descriptors :-) -- balbi
signature.asc
Description: Digital signature