* with the relevant device-wide data.
*/
-/* Some systems will need runtime overrides for the product identifiers
- * 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 *iProduct;
-module_param(iProduct, charp, S_IRUGO);
-MODULE_PARM_DESC(iProduct, "USB Product string");
-
static char composite_manufacturer[50];
/*-------------------------------------------------------------------------*/
if (cdev->manufacturer_override == id)
str = composite->iManufacturer ?: composite_manufacturer;
else if (cdev->product_override == id)
- str = iProduct ?: composite->iProduct;
+ str = composite->iProduct;
else if (cdev->serial_override == id)
str = composite->iSerialNumber;
else
__le16 bcdDevice;
u8 iSerialNumber;
u8 iManufacturer;
+ u8 iProduct;
/*
* these variables may have been set in
bcdDevice = new->bcdDevice;
iSerialNumber = new->iSerialNumber;
iManufacturer = new->iManufacturer;
+ iProduct = new->iProduct;
*new = *old;
if (idVendor)
new->iSerialNumber = iSerialNumber;
if (iManufacturer)
new->iManufacturer = iManufacturer;
+ if (iProduct)
+ new->iProduct = iProduct;
}
static struct usb_composite_driver *to_cdriver(struct usb_gadget_driver *gdrv)
override_id(cdev, &cdev->desc.iManufacturer);
}
- if (iProduct || (!cdev->desc.iProduct && composite->iProduct))
+ if (!cdev->desc.iProduct && composite->iProduct)
cdev->product_override =
override_id(cdev, &cdev->desc.iProduct);
desc->iManufacturer = dev_str[USB_GADGET_MANUFACTURER_IDX].id;
dev_str[USB_GADGET_MANUFACTURER_IDX].s = covr->manufacturer;
}
+
+ if (covr->product) {
+ desc->iProduct = dev_str[USB_GADGET_PRODUCT_IDX].id;
+ dev_str[USB_GADGET_PRODUCT_IDX].s = covr->product;
+ }
}
u16 bcdDevice;
char *serial_number;
char *manufacturer;
+ char *product;
};
#define USB_GADGET_COMPOSITE_OPTIONS() \
static struct usb_composite_overwrite coverwrite; \
\
module_param_named(iManufacturer, coverwrite.manufacturer, charp, \
S_IRUGO); \
- MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string")
+ MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); \
+ \
+ module_param_named(iProduct, coverwrite.product, charp, S_IRUGO); \
+ MODULE_PARM_DESC(iProduct, "USB Product string")
void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
struct usb_composite_overwrite *covr);