summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryeshwanth sriram guntuka <ysriramg@codeaurora.org>2017-07-27 19:00:08 +0530
committersnandini <snandini@codeaurora.org>2017-08-09 14:36:59 -0700
commit1b569b83bc9e6abd4ab55dcb1354885455ecafca (patch)
tree60834b73416a16b7572181f317c9e2397fefe7c6
parent14cc1af4047e518955746fedad746aef1d67b57c (diff)
qcacld-3.0: Add pe shutdown notifier callback
On shutdown, there is a possibility of protection_fields_reset_timer expiring after mc thread is destroyed. This results in assert in cds_linux_timer_callback. Fix is to register pe shutdown notifier callback to stop lim timers before destroying mc thread. Change-Id: I6141b1f6fe93062cf96feb273e2ac943989f8df3 CRs-Fixed: 2083371
-rw-r--r--core/mac/src/pe/lim/lim_api.c31
-rw-r--r--core/mac/src/pe/lim/lim_utils.c136
-rw-r--r--core/mac/src/pe/lim/lim_utils.h9
3 files changed, 135 insertions, 41 deletions
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index 8303f35066aa..2018ed740544 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -718,6 +718,32 @@ static void lim_register_debug_callback(void)
qdf_register_debug_callback(QDF_MODULE_ID_PE, &lim_state_info_dump);
}
+/*
+ * pe_shutdown_notifier_cb - Shutdown notifier callback
+ * @ctx: Pointer to Global MAC structure
+ *
+ * Return: None
+ */
+static void pe_shutdown_notifier_cb(void *ctx)
+{
+ tpAniSirGlobal mac_ctx = (tpAniSirGlobal)ctx;
+ tpPESession session;
+ uint8_t i;
+
+ for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
+ session = &mac_ctx->lim.gpSession[i];
+ if (session->valid == true) {
+ if (LIM_IS_AP_ROLE(session))
+ qdf_mc_timer_stop(&session->
+ protection_fields_reset_timer);
+#ifdef WLAN_FEATURE_11W
+ qdf_mc_timer_stop(&session->pmfComebackTimer);
+#endif
+ lim_deactivate_timers(mac_ctx);
+ }
+ }
+}
+
/** -------------------------------------------------------------
\fn pe_open
\brief will be called in Open sequence from mac_open
@@ -779,6 +805,11 @@ tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg)
#endif
lim_register_debug_callback();
+ if (!QDF_IS_STATUS_SUCCESS(
+ cds_shutdown_notifier_register(pe_shutdown_notifier_cb, pMac))) {
+ pe_err("%s: Shutdown notifier register failed", __func__);
+ }
+
return status; /* status here will be eSIR_SUCCESS */
pe_open_lock_fail:
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 334440f8feb2..d77859bc6f68 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -614,6 +614,85 @@ static void lim_deactivate_del_sta(tpAniSirGlobal mac_ctx, uint32_t bss_entry,
}
#endif
+void lim_deactivate_timers(tpAniSirGlobal mac_ctx)
+{
+ uint32_t n;
+ tLimTimers *lim_timer = &mac_ctx->lim.limTimers;
+
+ /* Deactivate Reassociation failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimReassocFailureTimer);
+
+ /* Deactivate FT Preauth response timer */
+ tx_timer_deactivate(&lim_timer->gLimFTPreAuthRspTimer);
+
+ /* Deactivate Periodic Probe channel timers. */
+ tx_timer_deactivate(&lim_timer->gLimPeriodicProbeReqTimer);
+
+ /* Deactivate channel switch timer. */
+ tx_timer_deactivate(&lim_timer->gLimChannelSwitchTimer);
+
+ /* Deactivate addts response timer. */
+ tx_timer_deactivate(&lim_timer->gLimAddtsRspTimer);
+
+ /* Deactivate Join failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimJoinFailureTimer);
+
+ /* Deactivate Periodic Join Probe Request timer. */
+ tx_timer_deactivate(&lim_timer->gLimPeriodicJoinProbeReqTimer);
+
+ /* Deactivate Auth Retry timer. */
+ tx_timer_deactivate
+ (&lim_timer->g_lim_periodic_auth_retry_timer);
+
+ /* Deactivate Association failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimAssocFailureTimer);
+
+ /* Deactivate Open system auth timer. */
+ tx_timer_deactivate(&lim_timer->open_sys_auth_timer);
+
+ /* Deactivate Authentication failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimAuthFailureTimer);
+
+ /* Deactivate wait-for-probe-after-Heartbeat timer. */
+ tx_timer_deactivate(&lim_timer->gLimProbeAfterHBTimer);
+
+ /* Deactivate and delete Quiet timer. */
+ tx_timer_deactivate(&lim_timer->gLimQuietTimer);
+
+ /* Deactivate Quiet BSS timer. */
+ tx_timer_deactivate(&lim_timer->gLimQuietBssTimer);
+
+ /* Deactivate cnf wait timer */
+ for (n = 0; n < (mac_ctx->lim.maxStation + 1); n++)
+ tx_timer_deactivate(&lim_timer->gpLimCnfWaitTimer[n]);
+
+ /* Deactivate any Authentication response timers */
+ lim_delete_pre_auth_list(mac_ctx);
+
+ tx_timer_deactivate(&lim_timer->gLimUpdateOlbcCacheTimer);
+ tx_timer_deactivate(&lim_timer->gLimPreAuthClnupTimer);
+
+ /* Deactivate remain on channel timer */
+ tx_timer_deactivate(&lim_timer->gLimRemainOnChannelTimer);
+
+ tx_timer_deactivate(&lim_timer->gLimDisassocAckTimer);
+
+ tx_timer_deactivate(&lim_timer->gLimDeauthAckTimer);
+
+ /* Deactivate Reassociation failure timer. */
+ tx_timer_deactivate(&lim_timer->gLimReassocFailureTimer);
+
+ /* Deactivate FT Preauth response timer */
+ tx_timer_deactivate(&lim_timer->gLimFTPreAuthRspTimer);
+
+ tx_timer_deactivate(&lim_timer->
+ gLimP2pSingleShotNoaInsertTimer);
+
+ tx_timer_deactivate(&lim_timer->
+ gLimActiveToPassiveChannelTimer);
+}
+
+
/**
* lim_cleanup_mlm() - This function is called to cleanup
* @mac_ctx: Pointer to Global MAC structure
@@ -638,94 +717,69 @@ void lim_cleanup_mlm(tpAniSirGlobal mac_ctx)
lim_timer = &mac_ctx->lim.limTimers;
lim_delete_timers_host_roam(mac_ctx);
- /* Deactivate and delete Periodic Probe channel timers. */
- tx_timer_deactivate(&lim_timer->gLimPeriodicProbeReqTimer);
+
+ lim_deactivate_timers(mac_ctx);
+ /* Delete Periodic Probe channel timers. */
tx_timer_delete(&lim_timer->gLimPeriodicProbeReqTimer);
- /* Deactivate and delete channel switch timer. */
- tx_timer_deactivate(&lim_timer->gLimChannelSwitchTimer);
+ /* Delete channel switch timer. */
tx_timer_delete(&lim_timer->gLimChannelSwitchTimer);
- /* Deactivate and delete addts response timer. */
- tx_timer_deactivate(&lim_timer->gLimAddtsRspTimer);
+ /* Delete addts response timer. */
tx_timer_delete(&lim_timer->gLimAddtsRspTimer);
- /* Deactivate and delete Join failure timer. */
- tx_timer_deactivate(&lim_timer->gLimJoinFailureTimer);
+ /* Delete Join failure timer. */
tx_timer_delete(&lim_timer->gLimJoinFailureTimer);
- /* Deactivate and delete Periodic Join Probe Request timer. */
- tx_timer_deactivate(&lim_timer->gLimPeriodicJoinProbeReqTimer);
+ /* Delete Periodic Join Probe Request timer. */
tx_timer_delete(&lim_timer->gLimPeriodicJoinProbeReqTimer);
- /* Deactivate and delete Auth Retry timer. */
- tx_timer_deactivate
- (&lim_timer->g_lim_periodic_auth_retry_timer);
+ /* Delete Auth Retry timer. */
tx_timer_delete(&lim_timer->g_lim_periodic_auth_retry_timer);
- /* Deactivate and delete Association failure timer. */
- tx_timer_deactivate(&lim_timer->gLimAssocFailureTimer);
+ /* Delete Association failure timer. */
tx_timer_delete(&lim_timer->gLimAssocFailureTimer);
- /* Deactivate and delete Open system auth timer. */
- tx_timer_deactivate(&lim_timer->open_sys_auth_timer);
+ /* Delete Open system auth timer. */
tx_timer_delete(&lim_timer->open_sys_auth_timer);
- /* Deactivate and delete Authentication failure timer. */
- tx_timer_deactivate(&lim_timer->gLimAuthFailureTimer);
+ /* Delete Authentication failure timer. */
tx_timer_delete(&lim_timer->gLimAuthFailureTimer);
- /* Deactivate and delete wait-for-probe-after-Heartbeat timer. */
- tx_timer_deactivate(&lim_timer->gLimProbeAfterHBTimer);
+ /* Delete wait-for-probe-after-Heartbeat timer. */
tx_timer_delete(&lim_timer->gLimProbeAfterHBTimer);
- /* Deactivate and delete Quiet timer. */
- tx_timer_deactivate(&lim_timer->gLimQuietTimer);
+ /* Delete Quiet timer. */
tx_timer_delete(&lim_timer->gLimQuietTimer);
- /* Deactivate and delete Quiet BSS timer. */
- tx_timer_deactivate(&lim_timer->gLimQuietBssTimer);
+ /* Delete Quiet BSS timer. */
tx_timer_delete(&lim_timer->gLimQuietBssTimer);
- /* Deactivate and delete cnf wait timer */
+ /* Delete cnf wait timer */
for (n = 0; n < (mac_ctx->lim.maxStation + 1); n++) {
- tx_timer_deactivate(&lim_timer->gpLimCnfWaitTimer[n]);
tx_timer_delete(&lim_timer->gpLimCnfWaitTimer[n]);
}
pAuthNode = mac_ctx->lim.gLimPreAuthTimerTable.pTable;
- /* Deactivate any Authentication response timers */
- lim_delete_pre_auth_list(mac_ctx);
-
/* Delete any Auth rsp timers, which might have been started */
for (n = 0; n < mac_ctx->lim.gLimPreAuthTimerTable.numEntry;
n++)
tx_timer_delete(&pAuthNode[n]->timer);
- tx_timer_deactivate(&lim_timer->gLimUpdateOlbcCacheTimer);
tx_timer_delete(&lim_timer->gLimUpdateOlbcCacheTimer);
- tx_timer_deactivate(&lim_timer->gLimPreAuthClnupTimer);
tx_timer_delete(&lim_timer->gLimPreAuthClnupTimer);
- /* Deactivate and delete remain on channel timer */
- tx_timer_deactivate(&lim_timer->gLimRemainOnChannelTimer);
+ /* Delete remain on channel timer */
tx_timer_delete(&lim_timer->gLimRemainOnChannelTimer);
-
- tx_timer_deactivate(&lim_timer->gLimDisassocAckTimer);
tx_timer_delete(&lim_timer->gLimDisassocAckTimer);
- tx_timer_deactivate(&lim_timer->gLimDeauthAckTimer);
tx_timer_delete(&lim_timer->gLimDeauthAckTimer);
- tx_timer_deactivate(&lim_timer->
- gLimP2pSingleShotNoaInsertTimer);
tx_timer_delete(&lim_timer->
gLimP2pSingleShotNoaInsertTimer);
- tx_timer_deactivate(&lim_timer->
- gLimActiveToPassiveChannelTimer);
tx_timer_delete(&lim_timer->
gLimActiveToPassiveChannelTimer);
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 4a3cd163d8f4..65b08fc042d0 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -143,6 +143,15 @@ void lim_update_short_preamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
void lim_update_short_slot_time(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
tpUpdateBeaconParams pBeaconParams,
tpPESession psessionEntry);
+/*
+ * lim_deactivate_timers() - Function to deactivate lim timers
+ * @mac_ctx: Pointer to global mac structure
+ *
+ * This function is used to deactivate lim timers
+ *
+ * Return: None
+ */
+void lim_deactivate_timers(tpAniSirGlobal mac_ctx);
/*
* The below 'product' check tobe removed if 'Association' is