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

Commit f6c09502 authored by Hemant Kumar's avatar Hemant Kumar Committed by Sriharsha Allenki
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 c3b28f9a
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
 * f_qdss.c -- QDSS function Driver
 *
 * Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved.

 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
@@ -423,11 +422,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 */
@@ -438,12 +439,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))