From 312f71a503e45cad22e62ed105fd0dc3ca524eff Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 8 Dec 2015 10:22:42 -0800 Subject: [PATCH] qcacld-3.0: send CLIENT_CONNECT message to IPA after enable WDI pipes qcacld-2.0 to qcacld-3.0 propagation Since CLIENT_CONNECT message is sent to IPA before enabling WDI pipes, CLIENT_CONNECT message count could be more than CLIENT_DISCONNECT count, and this could cause an abnormal behavior in the IPACM. Change-Id: I03d30c7f82aadf83979084b7e65b8ed14565588d CRs-fixed: 941894 --- core/hdd/src/wlan_hdd_ipa.c | 39 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index ba20b1f4d07b..cfdffe8889d5 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -3795,6 +3795,24 @@ int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, cdf_mutex_release(&hdd_ipa->event_lock); return 0; } + + /* Enable IPA UC Data PIPEs when first STA connected */ + if ((0 == hdd_ipa->sap_num_connected_sta) && + (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) || + !hdd_ipa->sta_connected)) { + ret = hdd_ipa_uc_handle_first_con(hdd_ipa); + if (ret) { + cdf_mutex_release(&hdd_ipa->event_lock); + HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, + "%s: handle 1st con ret %d", + adapter->dev->name, ret); + return ret; + } + } + + hdd_ipa->sap_num_connected_sta++; + hdd_ipa->pending_cons_req = false; + cdf_mutex_release(&hdd_ipa->event_lock); meta.msg_type = type; @@ -3830,27 +3848,6 @@ int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, return ret; } hdd_ipa->stats.num_send_msg++; - - cdf_mutex_acquire(&hdd_ipa->event_lock); - /* Enable IPA UC Data PIPEs when first STA connected */ - if ((0 == hdd_ipa->sap_num_connected_sta) - && (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) - || !hdd_ipa->sta_connected)) { - ret = hdd_ipa_uc_handle_first_con(hdd_ipa); - if (ret) { - cdf_mutex_release(&hdd_ipa->event_lock); - HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, - "%s: handle 1st con ret %d", - adapter->dev->name, ret); - return ret; - } - } - - hdd_ipa->sap_num_connected_sta++; - hdd_ipa->pending_cons_req = false; - - cdf_mutex_release(&hdd_ipa->event_lock); - return ret; case WLAN_CLIENT_DISCONNECT: