summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-26 14:48:37 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-26 14:48:37 -0700
commitf11f09118e370228bd55cfa32e864362d268bde2 (patch)
tree400b1c1d5095904714d4d85289e1efa332e310d4
parentc59ad8da426e53ab8e2efc3ae26088acfe329970 (diff)
parent9765c216c7c7e9672e3b9c997850b68e514fefce (diff)
Merge "usb: gadget: gsi: Handle EVT_HOST_READY event in STATE_INITIALIZED state"
-rw-r--r--drivers/usb/gadget/function/f_gsi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c
index a629723d19cb..b953c6489999 100644
--- a/drivers/usb/gadget/function/f_gsi.c
+++ b/drivers/usb/gadget/function/f_gsi.c
@@ -593,6 +593,31 @@ static void ipa_work_handler(struct work_struct *w)
d_port->sm_state = STATE_CONNECT_IN_PROGRESS;
log_event_dbg("%s: ST_INIT_EVT_CONN_IN_PROG",
__func__);
+ } else if (event == EVT_HOST_READY) {
+ /*
+ * When in a composition such as RNDIS + ADB,
+ * RNDIS host sends a GEN_CURRENT_PACKET_FILTER msg
+ * to enable/disable flow control eg. during RNDIS
+ * adaptor disable/enable from device manager.
+ * In the case of the msg to disable flow control,
+ * connect IPA channels and enable data path.
+ * EVT_HOST_READY is posted to the state machine
+ * in the handler for this msg.
+ */
+ usb_gadget_autopm_get(d_port->gadget);
+ log_event_dbg("%s: get = %d", __func__,
+ atomic_read(&gad_dev->power.usage_count));
+ /* allocate buffers used with each TRB */
+ ret = gsi_alloc_trb_buffer(gsi);
+ if (ret) {
+ log_event_err("%s: gsi_alloc_trb_failed\n",
+ __func__);
+ break;
+ }
+ ipa_connect_channels(d_port);
+ ipa_data_path_enable(d_port);
+ d_port->sm_state = STATE_CONNECTED;
+ log_event_dbg("%s: ST_INIT_EVT_HOST_READY", __func__);
}
break;
case STATE_CONNECT_IN_PROGRESS: