From fe957e2fb855fad45f92fd8ca04b03fbc666156f Mon Sep 17 00:00:00 2001 From: Chandana Kishori Chiluveru Date: Wed, 23 May 2018 11:49:43 +0530 Subject: [PATCH] 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 daemon will use this info and update the response in DPM_OPEN_QMI Request for QMI communication. Change-Id: I45f640d952bdb513eb45c69711e61b2c2708f541 Signed-off-by: Chandana Kishori Chiluveru Signed-off-by: Elson Roy Serrao --- drivers/usb/gadget/function/f_gsi.c | 37 ++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index b7ee8994f7ec..fda01d234681 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -1565,26 +1565,35 @@ static long gsi_ctrl_dev_ioctl(struct file *fp, unsigned int cmd, break; } - if (gsi->d_port.in_channel_handle == -EINVAL && - gsi->d_port.out_channel_handle == -EINVAL) { - ret = -EAGAIN; - break; + if (gsi->prot_id != IPA_USB_GPS) { + 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; } - info.ph_ep_info.ep_type = GSI_MBIM_DATA_EP_TYPE_HSUSB; - info.ph_ep_info.peripheral_iface_id = gsi->data_id; - info.ipa_ep_pair.cons_pipe_num = - (gsi->prot_id == IPA_USB_DIAG) ? -1 : - gsi->d_port.out_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); + if (gsi->prot_id != IPA_USB_GPS) { + info.ipa_ep_pair.cons_pipe_num = + (gsi->prot_id == IPA_USB_DIAG) ? -1 : + gsi->d_port.out_channel_handle; + info.ipa_ep_pair.prod_pipe_num = + gsi->d_port.in_channel_handle; - log_event_dbg("%s: ipa_cons_idx:%d ipa_prod_idx:%d", - __func__, info.ipa_ep_pair.cons_pipe_num, - info.ipa_ep_pair.prod_pipe_num); + + log_event_dbg("%s: ipa_cons_idx:%d ipa_prod_idx:%d", + __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));