* published in the device descriptor, either numbers or strings or both.
* String parameters are in UTF-8 (superset of ASCII's 7 bit characters).
*/
-static char *iManufacturer;
-module_param(iManufacturer, charp, S_IRUGO);
-MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
-
static char *iProduct;
module_param(iProduct, charp, S_IRUGO);
MODULE_PARM_DESC(iProduct, "USB Product string");
* check if the string has not been overridden.
*/
if (cdev->manufacturer_override == id)
- str = iManufacturer ?: composite->iManufacturer ?:
- composite_manufacturer;
+ str = composite->iManufacturer ?: composite_manufacturer;
else if (cdev->product_override == id)
str = iProduct ?: composite->iProduct;
else if (cdev->serial_override == id)
__le16 idProduct;
__le16 bcdDevice;
u8 iSerialNumber;
+ u8 iManufacturer;
/*
* these variables may have been set in
idProduct = new->idProduct;
bcdDevice = new->bcdDevice;
iSerialNumber = new->iSerialNumber;
+ iManufacturer = new->iManufacturer;
*new = *old;
if (idVendor)
new->bcdDevice = bcdDevice;
if (iSerialNumber)
new->iSerialNumber = iSerialNumber;
+ if (iManufacturer)
+ new->iManufacturer = iManufacturer;
}
static struct usb_composite_driver *to_cdriver(struct usb_gadget_driver *gdrv)
update_unchanged_dev_desc(&cdev->desc, composite->dev);
/* string overrides */
- if (iManufacturer || !cdev->desc.iManufacturer) {
- if (!iManufacturer && !composite->iManufacturer &&
- !*composite_manufacturer)
+ if (!cdev->desc.iManufacturer) {
+ if (!composite->iManufacturer)
snprintf(composite_manufacturer,
sizeof composite_manufacturer,
"%s %s with %s",
desc->iSerialNumber = dev_str[USB_GADGET_SERIAL_IDX].id;
dev_str[USB_GADGET_SERIAL_IDX].s = covr->serial_number;
}
+ if (covr->manufacturer) {
+ desc->iManufacturer = dev_str[USB_GADGET_MANUFACTURER_IDX].id;
+ dev_str[USB_GADGET_MANUFACTURER_IDX].s = covr->manufacturer;
+ }
}
u16 idProduct;
u16 bcdDevice;
char *serial_number;
+ char *manufacturer;
};
#define USB_GADGET_COMPOSITE_OPTIONS() \
static struct usb_composite_overwrite coverwrite; \
\
module_param_named(iSerialNumber, coverwrite.serial_number, charp, \
S_IRUGO); \
- MODULE_PARM_DESC(iSerialNumber, "SerialNumber string")
+ MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); \
+ \
+ module_param_named(iManufacturer, coverwrite.manufacturer, charp, \
+ S_IRUGO); \
+ MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string")
void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
struct usb_composite_overwrite *covr);