usb host tests expect configuration string to have
a predefined value. As on 3.10 kernel we cannot use
ConfigFS to achieve this let's add a module parameter
which allows us to set it.
Change-Id: I7556ef87fb4da7ae1f86fa4f110f78ffd5d2b854
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
{ .s = "FunctionFS + ECM" },
#endif
#ifdef CONFIG_USB_FUNCTIONFS_GENERIC
{ .s = "FunctionFS + ECM" },
#endif
#ifdef CONFIG_USB_FUNCTIONFS_GENERIC
+ { }, /* set dynamically based on module param */
#endif
{ } /* end of list */
};
#endif
{ } /* end of list */
};
+#ifdef CONFIG_USB_FUNCTIONFS_GENERIC
+static char *generic_ffs_config_str = "FunctionFS";
+module_param_named(generic_ffs_config_str,
+ generic_ffs_config_str,
+ charp, S_IRUGO);
+MODULE_PARM_DESC(generic_ffs_config_str,
+ "Configuration string of generic FFS config");
+#endif
static struct usb_gadget_strings *gfs_dev_strings[] = {
&(struct usb_gadget_strings) {
.language = 0x0409, /* en-us */
static struct usb_gadget_strings *gfs_dev_strings[] = {
&(struct usb_gadget_strings) {
.language = 0x0409, /* en-us */
+#ifdef CONFIG_USB_FUNCTIONFS_GENERIC
+ /* Find first (but not last) config with a NULL str */
+ for (i = 0; i < ARRAY_SIZE(gfs_strings) - 1 ; ++i)
+ if (!gfs_strings[i].s) {
+ gfs_strings[i].s = generic_ffs_config_str;
+ break;
+ }
+#endif
if (!func_num) {
gfs_single_func = true;
func_num = 1;
if (!func_num) {
gfs_single_func = true;
func_num = 1;