usb: function: f_gsi: Allow line state ioctl query

As part of gsi_disable we send zero length packet to the
user space daemons(i.e. QTI/QBI). These daemons when they
receive a ZLP, query for line state to manage the open/close
of their DPM ports. Allow the line state ioctl query irrespective
of gsi connected state.

Change-Id: I4cd50c2b9273ffdeff561dbb1e4cd248cea2139b
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
This commit is contained in:
Elson Roy Serrao 2021-02-19 16:30:32 -08:00
commit e20b7664ee

View file

@ -1519,8 +1519,10 @@ static long gsi_ctrl_dev_ioctl(struct file *fp, unsigned int cmd,
gsi = inst_cur->opts->gsi;
c_port = &gsi->c_port;
if (!atomic_read(&gsi->connected)) {
log_event_err("USB cable not connected\n");
if (!atomic_read(&gsi->connected) && cmd != QTI_CTRL_GET_LINE_STATE
&& cmd != GSI_MBIM_GPS_USB_STATUS) {
log_event_err("%s:cmd %u failed, USB not connected\n",
__func__, cmd);
return -ECONNRESET;
}
@ -1569,12 +1571,6 @@ static long gsi_ctrl_dev_ioctl(struct file *fp, unsigned int cmd,
case GSI_MBIM_EP_LOOKUP:
log_event_dbg("%s: EP_LOOKUP for prot id:%d", __func__,
gsi->prot_id);
if (!atomic_read(&gsi->connected)) {
log_event_dbg("EP_LOOKUP failed: not connected");
ret = -EAGAIN;
break;
}
if (gsi->prot_id == IPA_USB_DIAG &&
(gsi->d_port.in_channel_handle == -EINVAL)) {
ret = -EAGAIN;