Re: fsg_strings struct question

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

 



On Fri, 22 Oct 2010, Praveen G K wrote:

> Hello all,
> 
> What is the significance of this struct?
> 
> 
> /* Static strings, in UTF-8 (for simplicity we use only ASCII characters) */
> static struct usb_string        fsg_strings[] = {
> #ifndef FSG_NO_DEVICE_STRINGS
>     {FSG_STRING_MANUFACTURER,    fsg_string_manufacturer},
>     {FSG_STRING_PRODUCT,        fsg_string_product},
>     {FSG_STRING_SERIAL,        fsg_string_serial},
>     {FSG_STRING_CONFIG,        fsg_string_config},
> #endif
>     {FSG_STRING_INTERFACE,        fsg_string_interface},
>     {}
> };

It contains the list of string descriptors that will be in the gadget.

> In the file header, I see the following info,
> 
> /*
>  * This file requires the following identifiers used in USB strings to
>  * be defined (each of type pointer to char):
>  *  - fsg_string_manufacturer -- name of the manufacturer
>  *  - fsg_string_product      -- name of the product
>  *  - fsg_string_serial       -- product's serial
>  *  - fsg_string_config       -- name of the configuration
>  *  - fsg_string_interface    -- name of the interface
>  * The first four are only needed when FSG_DESCRIPTORS_DEVICE_STRINGS
>  * macro is defined prior to including this file.
>  */

In fact the comment is slightly wrong; it should say that the first 
four are needed only when FSG_NO_DEVICE_STRINGS is undefined.

> But in file_storage.c file, I see that fsg_string_product is a static
> const char array.  So, how will I be able to set a custom product name
> overwriting the default settings?  What is the best way to set the
> product string so that my file storage gadget would take the product
> name that I specify?

Edit the source file and set the static array to whatever you want.

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