Re: [PATCHv3 1/3] USB: gadget: mass/file storage: set serial number

David Brownell
2010-07-19T14:44:57Z

> In that case, should all the composite gadgets stop
> setting
> the iManufacturer, iProduct

Certainly not. Those are interface constants
that don't relate to device instances. Every
instance of those gadgets should appear the same
(except for instance-specific state like serial#).

and iSerialNumber?

... that's an instance-specific thing which should
be managed properly. The kernel can't do that, but
userspace can (ensuring the USB host always sees
unique serial IDs for devices).

>  My understanding
> is that the composite module parameters are only meant as a way
> to override what the module uses as default.

They're meant as a way to specify values that may
not otherwise have been specified, or which need
to be overridden. Standard module param behavior.

>
> >> As a matter of fact, without this patch, the
> >> iSerialNumber module parameter won't work
>
> > So submit a bugfix for that alone, making it
> > work everywhere...
>
> iSerialNumber not working is not the main issue.  The
> main issue
> is that the serial number is not set by default
> which makes Windows sad (Windows uses serial
> number to distinguish different
> devices with the same vendor and product ID).  The
> serial number
> has to be set by default without the need for user to give

Bullcrap.

Do you understand the basic concept of "managed
identifiers"?? Like serial numbers. They need
to be explicitly managed to be unique.

So for example two Linux-USB peripherals must never
re-use the same ID. The way to do that is just not
commit the user error of forgetting to assign one
(or assigning a duplicate).

>
> As you see, the iSerialNumber module parameter
> is ignored unless the
> gadget driver sets the iSerialNumber field of
> the device descriptor.
>
So make that gadget code do that ... as I said,
fix such bugs, don't add more breakage.