diff options
author | Devdutt Patnaik <dpatnaik@codeaurora.org> | 2016-02-12 19:23:36 -0800 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:02:51 -0700 |
commit | 64e4a14d1fbaee52c17d6dc34d3264453068381d (patch) | |
tree | 8401665db279a0227e511f6d04237ddf2d2b633a /drivers | |
parent | bcb441b2e2ab723fc0cede2aa8a6751677a32271 (diff) |
usb: f_gsi: Fix IP address assigment failure on RNDIS enable/disable
IP address re-assignment fails when we disable and
enable RNDIS adaptor from device manager. This is
observed only in composite functions such as ADB + RNDIS.
In "RNDIS only" compositions the issue is not observed
as host typically sends a RESET when we re-enable the RNDIS
adaptor. Add support in the GSI state machine to connect channels
to IPA and enable GSI data path in response to PACKET FILTER
message with FLOW CONTROL DISABLE option when we are in the
INITIALIZED state. Previously we only treated the PACKET FILTER
message as a valid input when in the CONNECT_IN_PROGRESS state.
CRs-Fixed: 975930
Change-Id: I97471f128958a915001a5b49c98036076fb8c18c
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/function/f_gsi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index 5b9ebf983e39..f6aaf658bffc 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -551,6 +551,22 @@ 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. + */ + 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: |