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

Commit efd6cf62 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Mayank Rana
Browse files

usb: f_gsi: Add EP_LOOKUP for USB_PROT_GPS_CTRL



Add EP_LOOKUP for gps control channel and update the ep_type
as USB and interface id used for GPS function so that user space
Qmuxbridge process will use this info and update the response in
DPM_OPEN_QMI Request for QMI communication.

Change-Id: I45f640d952bdb513eb45c69711e61b2c2708f541
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 5a83d02c
Loading
Loading
Loading
Loading
+25 −16
Original line number Diff line number Diff line
@@ -1466,27 +1466,36 @@ static long gsi_ctrl_dev_ioctl(struct file *fp, unsigned int cmd,
			break;
		}

		if (gsi->prot_id != USB_PROT_GPS_CTRL) {
			if (gsi->d_port.in_channel_handle == -EINVAL &&
				gsi->d_port.out_channel_handle == -EINVAL) {
				ret = -EAGAIN;
				break;
			}

			info.ph_ep_info.ep_type = GSI_MBIM_DATA_EP_TYPE_HSUSB;
			info.ph_ep_info.peripheral_iface_id = gsi->data_id;
		} else {
			info.ph_ep_info.ep_type = GSI_MBIM_DATA_EP_TYPE_HSUSB;
			info.ph_ep_info.peripheral_iface_id = gsi->ctrl_id;
		}

		log_event_dbg("%s: prot id :%d ep_type:%d intf:%d",
				__func__, gsi->prot_id, info.ph_ep_info.ep_type,
				info.ph_ep_info.peripheral_iface_id);
		if (gsi->prot_id != USB_PROT_GPS_CTRL) {
			info.ipa_ep_pair.cons_pipe_num =
			(gsi->prot_id == USB_PROT_DIAG_IPA ||
				gsi->prot_id == USB_PROT_DPL_ETHER) ? -1 :
					gsi->d_port.out_channel_handle;
		info.ipa_ep_pair.prod_pipe_num = gsi->d_port.in_channel_handle;
			info.ipa_ep_pair.prod_pipe_num =
					gsi->d_port.in_channel_handle;

		log_event_dbg("%s: prot id :%d ep_type:%d intf:%d",
				__func__, gsi->prot_id, info.ph_ep_info.ep_type,
				info.ph_ep_info.peripheral_iface_id);

			log_event_dbg("%s: ipa_cons_idx:%d ipa_prod_idx:%d",
				__func__, info.ipa_ep_pair.cons_pipe_num,
					__func__,
					info.ipa_ep_pair.cons_pipe_num,
					info.ipa_ep_pair.prod_pipe_num);
		}

		ret = copy_to_user((void __user *)arg, &info,
			sizeof(info));