diff options
| author | Naveen Rawat <nrawat@qca.qualcomm.com> | 2016-03-21 17:44:53 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-05 13:22:18 +0530 |
| commit | f871667eaaa128b89f725f7f84fbf1c4917c759a (patch) | |
| tree | 4cc09afda588c714bc91d2f3eb1628d5ed542d6e | |
| parent | 0cd3838c4912929b674b7485e395776cdb4134b6 (diff) | |
qcacld-2.0: Destroy sap_dfs_cac_timer at properly
Destroy sap_dfs_cac_timer at callback function based on check if timer
is still valid.
Change-Id: Ib8b92ac11444b63a0d8002edff35cd9238bb2573
CRs-Fixed: 967907
| -rw-r--r-- | CORE/SAP/src/sapApiLinkCntl.c | 3 | ||||
| -rw-r--r-- | CORE/SAP/src/sapFsm.c | 18 |
2 files changed, 14 insertions, 7 deletions
diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c index c7275547cd46..0f258668e840 100644 --- a/CORE/SAP/src/sapApiLinkCntl.c +++ b/CORE/SAP/src/sapApiLinkCntl.c @@ -1074,6 +1074,7 @@ WLANSAP_RoamCallback */ vos_timer_stop(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); vos_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); + pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false; /* * User space is already indicated the CAC start and if @@ -1091,8 +1092,6 @@ WLANSAP_RoamCallback */ } - pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0; - sapEvent.event = eSAP_DFS_CHANNEL_CAC_RADAR_FOUND; sapEvent.params = 0; sapEvent.u1 = 0; diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 6f3f93bfc800..44581cd13ef3 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -4720,13 +4720,18 @@ void sapDfsCacTimerCallback(void *data) return; } + /* + * SAP may not be in CAC wait state, when the timer runs out. + * if following flag is set, then timer is in initialized state, + * destroy timer here. + */ + if (pMac->sap.SapDfsInfo.is_dfs_cac_timer_running == true) { + vos_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); + pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false; + } /* Check to ensure that SAP is in DFS WAIT state*/ if (sapContext->sapsMachine == eSAP_DFS_CAC_WAIT) { - vos_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); - pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = VOS_FALSE; - - /* * CAC Complete, post eSAP_DFS_CHANNEL_CAC_END to sapFsm */ @@ -4771,6 +4776,7 @@ static int sapStopDfsCacTimer(ptSapContext sapContext) vos_timer_stop(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0; + vos_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); return 0; } @@ -4852,11 +4858,13 @@ int sapStartDfsCacTimer(ptSapContext sapContext) status = vos_timer_start(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer, cacTimeOut); if (status == VOS_STATUS_SUCCESS) { - pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = VOS_TRUE; + pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = true; return 1; } else { + pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false; + vos_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer); return 0; } } |
