From f353aabd90538617298ebff9a4e49c8aaaa8e1c3 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Wed, 24 Aug 2016 18:15:51 +0800 Subject: qcacld-2.0: Stop SAP and indicate event more earlier after SSR DUT is SAP + STA SBSC mode, it takes very long time to recover after SSR. There are two problems: 1. It clear STA session and create new after SSR, but just clear SAP session. With sessionId in SAP context, it wrongly use new STA session to close SAP when terminate hostapd. This is the reason why host wait stop_bss_event for 10 seconds in cfg80211 stop ap. Set sessionId to invalid if adapter is SAP mode. 2. In dual-wifi mode, it will start second WLAN if SSR and WLAN_SVC_FW_CRASHED_IND late. Send this event more earlier. Change-Id: I10a3f300ac5621463fcce4d0a5e18b2cf1cb8491 CRs-Fixed: 1054612 --- CORE/HDD/src/wlan_hdd_early_suspend.c | 6 +++--- CORE/HDD/src/wlan_hdd_main.c | 12 ++++++++++++ CORE/SAP/inc/sapApi.h | 2 ++ CORE/SAP/src/sapModule.c | 25 +++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index 1e720d4a2b05..14c5f3648b45 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -2316,6 +2316,9 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) /* Pass FW version to HIF layer */ hif_set_fw_info(hif_sc, pHddCtx->target_fw_version); + wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index, + WLAN_SVC_FW_CRASHED_IND, NULL, 0); + /* Restart all adapters */ hdd_start_all_adapters(pHddCtx); @@ -2362,9 +2365,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) pHddCtx->btCoexModeSet = false; hdd_register_mcast_bcast_filter(pHddCtx); - wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index, - WLAN_SVC_FW_CRASHED_IND, NULL, 0); - /* Allow the phone to go to sleep */ hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); /* register for riva power on lock */ diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index d2ba037d80db..e8878a5274d7 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -11723,6 +11723,18 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ) clear_bit(WMM_INIT_DONE, &pAdapter->event_flags); } + /* + * If adapter is SAP, set session ID to invalid since SAP + * session will be cleanup during SSR. + */ + if (pAdapter->device_mode == WLAN_HDD_SOFTAP) + wlansap_set_invalid_session( +#ifdef WLAN_FEATURE_MBSSID + WLAN_HDD_GET_SAP_CTX_PTR(pAdapter)); +#else + (WLAN_HDD_GET_CTX(pAdapter))->pvosContext); +#endif + status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index a3cbbd68d7ba..9801f896d094 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -2407,6 +2407,8 @@ VOS_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal, VOS_STATUS wlansap_get_chan_width(void *pvosctx, uint32_t *pchanwidth); +VOS_STATUS wlansap_set_invalid_session(v_PVOID_t pctx); + #ifdef __cplusplus } #endif diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index 01185e9a327d..64a33006e6c5 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -3917,3 +3917,28 @@ wlansap_get_chan_width(void *pvosctx, uint32_t *pchanwidth) return VOS_STATUS_SUCCESS; } +/* + * wlansap_set_invalid_session() - set session ID to invalid + * @pctx: pointer of global context + * + * This function sets session ID to invalid + * + * Return: VOS_STATUS + */ +VOS_STATUS +wlansap_set_invalid_session(v_PVOID_t pctx) +{ + ptSapContext psapctx; + psapctx = VOS_GET_SAP_CB(pctx); + if ( NULL == psapctx) { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + FL("Invalid SAP pointer from pctx")); + return VOS_STATUS_E_FAILURE; + } + + psapctx->sessionId = CSR_SESSION_ID_INVALID; + psapctx->isSapSessionOpen = eSAP_FALSE; + + return VOS_STATUS_SUCCESS; +} + -- cgit v1.2.3