Re: gadget serial driver - configuration value

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

 



Hi All,

Can you please help me understand the assignment of
bConfigurationValue in gadget serial driver.
As I had mentioned in my previous mail,

I agree that no two configurations can have same bConfigurationValue,
but in this case, the implementation is (drivers/usb/gadget/serial.c)

247         if (use_acm) {
248                 serial_config_driver.label = "CDC ACM config";
249                 serial_config_driver.bConfigurationValue = 2;
250                 ...
253         } else if (use_obex) {
254                 serial_config_driver.label = "CDC OBEX config";
255                 serial_config_driver.bConfigurationValue = 3;
256                 ...
259         } else {
260                 serial_config_driver.label = "Generic Serial config";
261                 serial_config_driver.bConfigurationValue = 1;
262                ...
265         }

In this case we cannot have the three configurations together.
Hence I wanted to confirm if there was any other reason as to why
different numbers were assigned.

Can you please help me on the same.

Thanks and Regards
Anjana

On Fri, Sep 5, 2014 at 6:30 PM, Anjana V Kumar <anjanavk12@xxxxxxxxx> wrote:
> On Thu, Sep 4, 2014 at 7:38 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>> On Thu, 4 Sep 2014, Anjana V Kumar wrote:
>>
>>> >> We see that, the three configurations listed in serial driver (CDC
>>> >> ACM, CDC OBEX, generic serial) cannot be present together as per the
>>> >> current implementation. Is there a specific reason why the
>>> >> configuration values were set as 1, 2 and 3 instead of setting all to
>>> >> 1?
>>> >
>>> > well, setting configuration 0 means that you're not selecting any
>>> > configuration. Basically you go back to "Addressed" state, so you can't
>>> > use configuration 0 for anything, really.
>>> >
>>>
>>> Sorry for not being clear, I am not setting the configuration to 0.
>>> The question was, can we set all the three configuration values of CDC
>>> ACM, CDC OBEX, and generic serial to 1?
>>> Was there any specific reason as to why the configuration values were
>>> set as 1,2 and 3. We cannot have all three at the same time according
>>> to the current "if, elseif, else" implementation,
>>
>> No two configurations can have the same bConfigurationValue.  If the
>> gadget has three different configs then it must have three different
>> config values.
>>
> I agree that no two configurations can have same bConfigurationValue,
> but in this case, the implementation is (drivers/usb/gadget/serial.c)
>
> 247         if (use_acm) {
> 248                 serial_config_driver.label = "CDC ACM config";
> 249                 serial_config_driver.bConfigurationValue = 2;
> 250                 ...
> 253         } else if (use_obex) {
> 254                 serial_config_driver.label = "CDC OBEX config";
> 255                 serial_config_driver.bConfigurationValue = 3;
> 256                 ...
> 259         } else {
> 260                 serial_config_driver.label = "Generic Serial config";
> 261                 serial_config_driver.bConfigurationValue = 1;
> 262                ...
> 265         }
>
> In this case we cannot have the three configurations together.
> Hence I wanted to confirm if there was any other reason as to why
> different numbers were assigned.
>
>> Alan Stern
>>
>
>
>
> --
> Anjana



-- 
Anjana
--
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