diff options
| author | Edhar, Mahesh Kumar <c_medhar@qti.qualcomm.com> | 2015-06-10 13:17:00 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-06-12 19:51:56 +0530 |
| commit | b0e76f6074ac8f43ecd2d9cfd574e11caa41d15c (patch) | |
| tree | 6d550e3ac1fd1f86cd3d9a8725569d3b4abedc34 | |
| parent | 5ad1f228a083704b255e402792f2618357fc1d52 (diff) | |
qcacld-2.0: Changes to reset global protection parameters
In MDM, Driver is not reloaded on killing hostapd and as per the
current driver design, we are not resetting the global protection
parameters on bringing down the sap interface.
In the above scenario if we restart hostapd then HtProtection is
not set for AP when legacy AP comes in the BSS since global
parameters are not proper.
Changes are made to reset global protection parameters once
current AP session is teardown and there are no active session
present.
Change-Id: I2a07d71578286425fa66ed5f6fd340ed9c8a3ec6
CRs-fixed: 851530
| -rw-r--r-- | CORE/MAC/src/pe/include/limSession.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSession.c | 25 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limUtils.c | 26 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limUtils.h | 1 |
4 files changed, 53 insertions, 0 deletions
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h index 5a62dfe24f62..a249c1b58708 100644 --- a/CORE/MAC/src/pe/include/limSession.h +++ b/CORE/MAC/src/pe/include/limSession.h @@ -635,4 +635,5 @@ tpPESession pe_find_session_by_sme_session_id(tpAniSirGlobal mac_ctx, uint8_t sme_session_id); #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ +int pe_get_active_session_count(tpAniSirGlobal mac_ctx); #endif //#if !defined( __LIM_SESSION_H ) diff --git a/CORE/MAC/src/pe/lim/limSession.c b/CORE/MAC/src/pe/lim/limSession.c index 59d4b3e72a9d..bd1d07a90c55 100644 --- a/CORE/MAC/src/pe/lim/limSession.c +++ b/CORE/MAC/src/pe/lim/limSession.c @@ -762,6 +762,10 @@ void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry) #endif psessionEntry->valid = FALSE; + + if (LIM_IS_AP_ROLE(psessionEntry)) + lim_check_and_reset_protection_params(pMac); + return; } @@ -805,3 +809,24 @@ tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U limPrintMacAddr(pMac, sa, LOG1); return NULL; } + +/** + * pe_get_active_session_count() - function to return active pe session count + * + * @mac_ctx: pointer to global mac structure + * + * returns number of active pe session count + * + * Return: 0 if there are no active sessions else return number of active + * sessions + */ +int pe_get_active_session_count(tpAniSirGlobal mac_ctx) +{ + int i, active_session_count = 0; + + for (i = 0; i < mac_ctx->lim.maxBssId; i++) + if (mac_ctx->lim.gpSession[i].valid) + active_session_count++; + + return active_session_count; +} diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index 6381d1107234..0170441fed90 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -8079,3 +8079,29 @@ void lim_set_stads_rtt_cap(tpDphHashNode sta_ds, struct s_ext_cap *ext_cap) ext_cap->timingMeas, ext_cap->fine_time_meas_initiator, ext_cap->fine_time_meas_responder);) } + +/** + * lim_check_and_reset_protection_params() - reset protection related parameters + * + * @mac_ctx: pointer to global mac structure + * + * resets protection related global parameters if the pe active session count + * is zero. + * + * Return: None + */ +void lim_check_and_reset_protection_params(tpAniSirGlobal mac_ctx) +{ + if (!pe_get_active_session_count(mac_ctx)) { + vos_mem_zero(&mac_ctx->lim.gLimOverlap11gParams, + sizeof(mac_ctx->lim.gLimOverlap11gParams)); + vos_mem_zero(&mac_ctx->lim.gLimOverlap11aParams, + sizeof(mac_ctx->lim.gLimOverlap11aParams)); + vos_mem_zero(&mac_ctx->lim.gLimOverlapHt20Params, + sizeof(mac_ctx->lim.gLimOverlapHt20Params)); + vos_mem_zero(&mac_ctx->lim.gLimOverlapNonGfParams, + sizeof(mac_ctx->lim.gLimOverlapNonGfParams)); + + mac_ctx->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; + } +} diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h index 34114a9e8a8c..d4b3cc97aadb 100644 --- a/CORE/MAC/src/pe/lim/limUtils.h +++ b/CORE/MAC/src/pe/lim/limUtils.h @@ -619,4 +619,5 @@ bool lim_validate_received_frame_a1_addr(tpAniSirGlobal mac_ctx, tSirMacAddr a1, tpPESession session); void lim_set_stads_rtt_cap(tpDphHashNode sta_ds, struct s_ext_cap *ext_cap); +void lim_check_and_reset_protection_params(tpAniSirGlobal mac_ctx); #endif /* __LIM_UTILS_H */ |
