From a9d0c112989e871baaf64e8e63270a4a8d3bfe5e Mon Sep 17 00:00:00 2001 From: Yun Park Date: Wed, 7 Mar 2018 14:11:27 -0800 Subject: [PATCH] qcacld-3.0: Send AP_DISCONNECT event after all clients disconnected There could be an abnormal situation occurs in IPA pipes suspend process if HDD_IPA_AP_DISCONNECT event sent while WDI pipes are still active. Fix to send HDD_IPA_AP_DISCONNECT after all clients disconnected. Change-Id: I7ad757834ec22384d07236363d135009a9710bee CRs-Fixed: 2192239 --- core/hdd/src/wlan_hdd_hostapd.c | 29 +++------------------------- core/hdd/src/wlan_hdd_softap_tx_rx.c | 23 +++++++++++++++------- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 4256393acaff..73eacdd36a7b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1701,17 +1701,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, adapter->session_id, WLAN_IPA_AP_CONNECT, adapter->dev->dev_addr); - if (status) { - hdd_err("WLAN_AP_CONNECT event failed!!"); - /* - * Make sure to set the event before proceeding - * for error handling otherwise caller thread - * will wait till 10 secs and no other - * connection will go through before that. - */ - qdf_event_set(&hostapd_state->qdf_event); - goto stopbss; - } + if (status) + hdd_err("WLAN_AP_CONNECT event failed"); } #ifdef FEATURE_WLAN_AUTO_SHUTDOWN @@ -1820,18 +1811,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, /* Invalidate the channel info. */ ap_ctx->operating_channel = 0; - if (ucfg_ipa_is_enabled()) { - status = ucfg_ipa_wlan_evt(hdd_ctx->hdd_pdev, - adapter->dev, adapter->device_mode, - ap_ctx->broadcast_sta_id, - adapter->session_id, - WLAN_IPA_AP_DISCONNECT, - adapter->dev->dev_addr); - if (status) { - hdd_err("WLAN_AP_DISCONNECT event failed!!"); - goto stopbss; - } - } /* reset the dfs_cac_status and dfs_cac_block_tx flag only when * the last BSS is stopped @@ -2085,10 +2064,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, adapter->session_id, WLAN_IPA_CLIENT_CONNECT_EX, event->staMac.bytes); - if (status) { + if (status) hdd_err("WLAN_CLIENT_CONNECT_EX event failed"); - goto stopbss; - } } DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD, diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 8d13e4f37226..2d6b7489bdf1 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -1023,13 +1023,14 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter, if (adapter->sta_info[staId].in_use) { if (ucfg_ipa_is_enabled()) { - ucfg_ipa_wlan_evt(hdd_ctx->hdd_pdev, adapter->dev, + if (ucfg_ipa_wlan_evt(hdd_ctx->hdd_pdev, adapter->dev, adapter->device_mode, adapter->sta_info[staId].sta_id, adapter->session_id, WLAN_IPA_CLIENT_DISCONNECT, adapter->sta_info[staId].sta_mac. - bytes); + bytes) != QDF_STATUS_SUCCESS) + hdd_err("WLAN_CLIENT_DISCONNECT event failed"); } spin_lock_bh(&adapter->sta_info_lock); qdf_mem_zero(&adapter->sta_info[staId], @@ -1189,8 +1190,10 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter) QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; uint8_t staId = 0; struct hdd_context *hdd_ctx; + struct hdd_ap_ctx *ap_ctx; hdd_ctx = WLAN_HDD_GET_CTX(adapter); + ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter); /* This is stop bss callback running in scheduler thread so do not * driver unload in progress check otherwise it can lead to peer @@ -1198,13 +1201,9 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter) */ qdf_status = hdd_softap_deregister_bc_sta(adapter); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - struct hdd_ap_ctx *ap_ctx; - - ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) hdd_err("Failed to deregister BC sta Id %d", ap_ctx->broadcast_sta_id); - } for (staId = 0; staId < WLAN_MAX_STA_COUNT; staId++) { /* This excludes BC sta as it is already deregistered */ @@ -1223,6 +1222,16 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter) sme_update_channel_list(hdd_ctx->hHal); } + if (ucfg_ipa_is_enabled()) { + if (ucfg_ipa_wlan_evt(hdd_ctx->hdd_pdev, + adapter->dev, adapter->device_mode, + ap_ctx->broadcast_sta_id, + adapter->session_id, + WLAN_IPA_AP_DISCONNECT, + adapter->dev->dev_addr) != QDF_STATUS_SUCCESS) + hdd_err("WLAN_AP_DISCONNECT event failed"); + } + return qdf_status; }