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 08/19/2015 03:56 PM, Alan Stern wrote:
> On Wed, 19 Aug 2015, Igor Kotrasinski wrote:
>
>>>> 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
>>> :-)
>>>
>> If I understand it correctly then, gadget->max_speed isn't any indicator of
>> supported standard?
> That's right.  There's almost no connection between the USB standard 
> and the supported speeds.  All you can depend on is this:
>
> 	If bcdUSB < 0x0200 then the device must run at low speed or
> 	full speed (it can't use high speed or SuperSpeed).
>
> 	If bcdUSB >= 0x0200 then the device must be able to connect at
> 	low speed or full speed (although it may not be able to do 
> 	anything useful).  It may also be able to run at high speed.
>
> 	If bcdUSB < 0x0300 then the device must run at low, full, or
> 	high speed (it can't use SuperSpeed).
>
> 	If bcdUSB >= 0x0300 then the device must run at SuperSpeed.
>
> Nothing else is guaranteed.
>
>> Either way, some else block definitely should be there. I don't follow why 0x0210
>> is appropriate for all other gadget speeds; could you please, if possible, elaborate?
> As you can see from the above, devices with bcdUSB = 0x0210 are allowed 
> to run at low, full, or high speed.  Therefore it is an appropriate 
> value.
>
> The extra meaning expressed by bcdUSB has to do with the set of
> descriptors provided by the device.  With 0x0210, the device is obliged
> to provide BOS descriptors (as Felipe mentioned).  With 0x0200, the
> device is obliged to provide an other-speed descriptor.
>
> Alan Stern
>
>
I see now - it's the gadget layer that handles all relevant setup requests, and the controller
is only concerned with an appropriate speed, so bcdUSB is only a matter of what descriptors
the gadget layer supports.

Many thanks to you and Balbi for explaining it, fixed patch is on the way.

Igor Kotrasinski
--
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