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 <cchiluve@codeaurora.org>
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
This commit is contained in:
Chandana Kishori Chiluveru 2018-05-23 11:49:43 +05:30 • committed by Elson Roy Serrao
commit fe957e2fb8

View file

@ -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));