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

Commit 742a9757 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: f_gsi: Set alt to 1 for rndis, rmnet and dpl unconditionally



Driver only sets alt to 1 if ep driver_data is NULL upon cable
connect for rndis, rmnet and dpl protocols. Since these protocols
only support single alt setting, there is no need to update alt
value based upon ep driver_data. It is possible for any protocol
to set driver_data upon connect and retain it upon disconnect. In
that case upon next connect data endpoints remain disabled.

Change-Id: I205b539be6625c9ca792d1731a4eeda5b48a2ccb
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent b639b04b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2081,13 +2081,8 @@ static int gsi_set_alt(struct usb_function *f, unsigned int intf,
		/* for rndis and rmnet alt is always 0 update alt accordingly */
		if (gsi->prot_id == IPA_USB_RNDIS ||
				gsi->prot_id == IPA_USB_RMNET ||
				gsi->prot_id == IPA_USB_DIAG) {
			if (gsi->d_port.in_ep &&
				!gsi->d_port.in_ep->driver_data)
				gsi->prot_id == IPA_USB_DIAG)
				alt = 1;
			else
				alt = 0;
		}

		if (alt > 1)
			goto notify_ep_disable;