Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 703211f0 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: gadget: f_qdss: Allocate one string ID for all instances



In case multi instance of driver exist in same composition, id
of the string gets overridden due to multiple bind() calls. This
results in STALL on GET_DESCRIPTOR (string type) on interface
string descriptor index which got overridden. Fix this issue by
assigning one string ID to all interface string desc index of
the driver.

Change-Id: If61455e9786175a1dd435320bfb54f2949e4ffa4
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent d8d1bc74
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * f_qdss.c -- QDSS function Driver
 *
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -415,11 +415,13 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
	qdss_data_intf_desc.bInterfaceNumber = iface;
	qdss->data_iface_id = iface;

	if (!qdss_string_defs[QDSS_DATA_IDX].id) {
		id = usb_string_id(c->cdev);
		if (id < 0)
			return id;
		qdss_string_defs[QDSS_DATA_IDX].id = id;
		qdss_data_intf_desc.iInterface = id;
	}

	if (qdss->debug_inface_enabled) {
		/* Allocate ctrl I/F */
@@ -430,12 +432,15 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
		}
		qdss_ctrl_intf_desc.bInterfaceNumber = iface;
		qdss->ctrl_iface_id = iface;

		if (!qdss_string_defs[QDSS_CTRL_IDX].id) {
			id = usb_string_id(c->cdev);
			if (id < 0)
				return id;
			qdss_string_defs[QDSS_CTRL_IDX].id = id;
			qdss_ctrl_intf_desc.iInterface = id;
		}
	}

	/* for non-accelerated path keep tx fifo size 1k */
	if (!strcmp(qdss->ch.name, USB_QDSS_CH_MDM))