Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /* |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 20 | * This file lim_timer_utils.cc contains the utility functions |
| 21 | * LIM uses for handling various timers. |
| 22 | * Author: Chandra Modumudi |
| 23 | * Date: 02/13/02 |
| 24 | * History:- |
| 25 | * Date Modified by Modification Information |
| 26 | * -------------------------------------------------------------------- |
| 27 | */ |
| 28 | |
| 29 | #include "lim_types.h" |
| 30 | #include "lim_utils.h" |
| 31 | #include "lim_assoc_utils.h" |
| 32 | #include "lim_security_utils.h" |
Arif Hussain | 9f93a64 | 2018-09-10 18:32:25 -0700 | [diff] [blame] | 33 | #include "wlan_mlme_public_struct.h" |
Padma, Santhosh Kumar | 9509135 | 2016-08-16 15:23:31 +0530 | [diff] [blame] | 34 | #include <lim_api.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | |
| 36 | /* channel Switch Timer in ticks */ |
| 37 | #define LIM_CHANNEL_SWITCH_TIMER_TICKS 1 |
| 38 | /* Lim Quite timer in ticks */ |
| 39 | #define LIM_QUIET_TIMER_TICKS 100 |
| 40 | /* Lim Quite BSS timer interval in ticks */ |
| 41 | #define LIM_QUIET_BSS_TIMER_TICK 100 |
| 42 | /* Lim KeepAlive timer default (3000)ms */ |
| 43 | #define LIM_KEEPALIVE_TIMER_MS 3000 |
| 44 | /* Lim JoinProbeRequest Retry timer default (200)ms */ |
| 45 | #define LIM_JOIN_PROBE_REQ_TIMER_MS 200 |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 46 | /* Lim Periodic Auth Retry timer default 60 ms */ |
| 47 | #define LIM_AUTH_RETRY_TIMER_MS 60 |
| 48 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 49 | /* |
| 50 | * SAE auth timer of 5secs. This is required for duration of entire SAE |
| 51 | * authentication. |
| 52 | */ |
| 53 | #define LIM_AUTH_SAE_TIMER_MS 5000 |
| 54 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | |
| 56 | /* This timer is a periodic timer which expires at every 1 sec to |
| 57 | convert ACTIVE DFS channel to DFS channels */ |
| 58 | #define ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT 1000 |
| 59 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 60 | static bool lim_create_non_ap_timers(struct mac_context *mac) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 61 | { |
| 62 | uint32_t cfgValue; |
| 63 | /* Create Channel Switch Timer */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 64 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimChannelSwitchTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 65 | "CHANNEL SWITCH TIMER", |
| 66 | lim_channel_switch_timer_handler, 0, |
| 67 | LIM_CHANNEL_SWITCH_TIMER_TICKS, |
| 68 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 69 | pe_err("failed to create Ch Switch timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 70 | return false; |
| 71 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 72 | |
Arif Hussain | 9f93a64 | 2018-09-10 18:32:25 -0700 | [diff] [blame] | 73 | cfgValue = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 74 | mac->mlme_cfg->timeouts.join_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 75 | /* Create Join failure timer and activate it later */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 76 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimJoinFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 77 | "JOIN FAILURE TIMEOUT", |
| 78 | lim_timer_handler, SIR_LIM_JOIN_FAIL_TIMEOUT, |
| 79 | cfgValue, 0, |
| 80 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
| 81 | /* / Could not create Join failure timer. */ |
| 82 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 83 | pe_err("could not create Join failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | return false; |
| 85 | } |
| 86 | /* Send unicast probe req frame every 200 ms */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 87 | if (tx_timer_create(mac, |
| 88 | &mac->lim.limTimers.gLimPeriodicJoinProbeReqTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | "Periodic Join Probe Request Timer", |
| 90 | lim_timer_handler, |
| 91 | SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT, |
| 92 | SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0, |
| 93 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 94 | pe_err("could not create Periodic Join Probe Request tmr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 95 | return false; |
| 96 | } |
| 97 | |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 98 | /* Send Auth frame every 60 ms */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 99 | if ((tx_timer_create(mac, |
| 100 | &mac->lim.limTimers.g_lim_periodic_auth_retry_timer, |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 101 | "Periodic AUTH Timer", |
| 102 | lim_timer_handler, SIR_LIM_AUTH_RETRY_TIMEOUT, |
| 103 | SYS_MS_TO_TICKS(LIM_AUTH_RETRY_TIMER_MS), 0, |
| 104 | TX_NO_ACTIVATE)) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 105 | pe_err("could not create Periodic AUTH Timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 106 | return false; |
| 107 | } |
| 108 | |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 109 | cfgValue = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 110 | mac->mlme_cfg->timeouts.assoc_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 111 | /* Create Association failure timer and activate it later */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 112 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimAssocFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 113 | "ASSOC FAILURE TIMEOUT", |
| 114 | lim_assoc_failure_timer_handler, LIM_ASSOC, |
| 115 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 116 | pe_err("could not create Association failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 117 | return false; |
| 118 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 119 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 120 | cfgValue = SYS_MS_TO_TICKS(mac->mlme_cfg->timeouts.addts_rsp_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 121 | |
| 122 | /* Create Addts response timer and activate it later */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 123 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimAddtsRspTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 124 | "ADDTS RSP TIMEOUT", |
| 125 | lim_addts_response_timer_handler, |
| 126 | SIR_LIM_ADDTS_RSP_TIMEOUT, |
| 127 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 128 | pe_err("could not create Addts response timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 129 | return false; |
| 130 | } |
| 131 | |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 132 | cfgValue = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 133 | mac->mlme_cfg->timeouts.auth_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 134 | /* Create Auth failure timer and activate it later */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 135 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimAuthFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 136 | "AUTH FAILURE TIMEOUT", |
| 137 | lim_timer_handler, |
| 138 | SIR_LIM_AUTH_FAIL_TIMEOUT, |
| 139 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 140 | pe_err("could not create Auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 141 | return false; |
| 142 | } |
| 143 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 144 | /* Change timer to reactivate it in future */ |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 145 | cfgValue = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 146 | mac->mlme_cfg->timeouts.probe_after_hb_fail_timeout); |
| 147 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimProbeAfterHBTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | "Probe after Heartbeat TIMEOUT", |
| 149 | lim_timer_handler, |
| 150 | SIR_LIM_PROBE_HB_FAILURE_TIMEOUT, |
| 151 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 152 | pe_err("unable to create ProbeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 153 | return false; |
| 154 | } |
| 155 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 156 | /* |
| 157 | * SAE auth timer of 5secs. This is required for duration of entire SAE |
| 158 | * authentication. |
| 159 | */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 160 | if ((tx_timer_create(mac, |
| 161 | &mac->lim.limTimers.sae_auth_timer, |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 162 | "SAE AUTH Timer", |
| 163 | lim_timer_handler, SIR_LIM_AUTH_SAE_TIMEOUT, |
| 164 | SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS), 0, |
| 165 | TX_NO_ACTIVATE)) != TX_SUCCESS) { |
| 166 | pe_err("could not create SAE AUTH Timer"); |
| 167 | return false; |
| 168 | } |
| 169 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 170 | return true; |
| 171 | } |
| 172 | /** |
| 173 | * lim_create_timers() |
| 174 | * |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 175 | * @mac : Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 176 | * |
| 177 | * This function is called upon receiving |
| 178 | * 1. SME_START_REQ for STA in ESS role |
| 179 | * 2. SME_START_BSS_REQ for AP role & STA in IBSS role |
| 180 | * |
| 181 | * @return : status of operation |
| 182 | */ |
| 183 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 184 | uint32_t lim_create_timers(struct mac_context *mac) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | { |
| 186 | uint32_t cfgValue, i = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 187 | |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 188 | pe_debug("Creating Timers used by LIM module in Role: %d", |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 189 | mac->lim.gLimSystemRole); |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 190 | /* Create timers required for host roaming feature */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 191 | if (TX_SUCCESS != lim_create_timers_host_roam(mac)) |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 192 | return TX_TIMER_ERROR; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 193 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 194 | if (mac->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 195 | if (false == lim_create_non_ap_timers(mac)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 196 | goto err_timer; |
| 197 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 198 | cfgValue = mac->mlme_cfg->sta.wait_cnf_timeout; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 200 | for (i = 0; i < (mac->lim.maxStation + 1); i++) { |
| 201 | if (tx_timer_create(mac, |
| 202 | &mac->lim.limTimers.gpLimCnfWaitTimer[i], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 203 | "CNF_MISS_TIMEOUT", |
| 204 | lim_cnf_wait_tmer_handler, |
| 205 | (uint32_t) i, cfgValue, |
| 206 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 207 | pe_err("Cannot create CNF wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | goto err_timer; |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | /* Alloc and init table for the preAuth timer list */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 213 | cfgValue = mac->mlme_cfg->lfr.max_num_pre_auth; |
| 214 | mac->lim.gLimPreAuthTimerTable.numEntry = cfgValue; |
| 215 | mac->lim.gLimPreAuthTimerTable.pTable = |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 216 | qdf_mem_malloc(cfgValue * sizeof(tLimPreAuthNode *)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 217 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 218 | if (!mac->lim.gLimPreAuthTimerTable.pTable) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 219 | goto err_timer; |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 220 | |
| 221 | for (i = 0; i < cfgValue; i++) { |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 222 | mac->lim.gLimPreAuthTimerTable.pTable[i] = |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 223 | qdf_mem_malloc(sizeof(tLimPreAuthNode)); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 224 | if (mac->lim.gLimPreAuthTimerTable.pTable[i] == NULL) { |
| 225 | mac->lim.gLimPreAuthTimerTable.numEntry = 0; |
Naveen Rawat | e6ddcaa | 2016-02-05 16:50:18 -0800 | [diff] [blame] | 226 | goto err_timer; |
| 227 | } |
| 228 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 229 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 230 | lim_init_pre_auth_timer_table(mac, &mac->lim.gLimPreAuthTimerTable); |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 231 | pe_debug("alloc and init table for preAuth timers"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 232 | |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 233 | cfgValue = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 234 | mac->mlme_cfg->timeouts.olbc_detect_timeout); |
| 235 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimUpdateOlbcCacheTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 236 | "OLBC UPDATE CACHE TIMEOUT", |
| 237 | lim_update_olbc_cache_timer_handler, |
| 238 | SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT, cfgValue, |
| 239 | cfgValue, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 240 | pe_err("Cannot create update OLBC cache tmr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 241 | goto err_timer; |
| 242 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 243 | |
| 244 | cfgValue = 1000; |
| 245 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 246 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimDisassocAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 247 | "DISASSOC ACK TIMEOUT", |
| 248 | lim_timer_handler, SIR_LIM_DISASSOC_ACK_TIMEOUT, |
| 249 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 250 | pe_err("could not DISASSOC ACK TIMEOUT timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 251 | goto err_timer; |
| 252 | } |
| 253 | |
| 254 | cfgValue = 1000; |
| 255 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 256 | if (tx_timer_create(mac, &mac->lim.limTimers.gLimDeauthAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 257 | "DISASSOC ACK TIMEOUT", |
| 258 | lim_timer_handler, SIR_LIM_DEAUTH_ACK_TIMEOUT, |
| 259 | cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 260 | pe_err("could not create DEAUTH ACK TIMEOUT timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 261 | goto err_timer; |
| 262 | } |
| 263 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 264 | cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT; |
| 265 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 266 | if (tx_timer_create(mac, |
| 267 | &mac->lim.limTimers.gLimActiveToPassiveChannelTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 268 | "ACTIVE TO PASSIVE CHANNEL", lim_timer_handler, |
| 269 | SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0, |
| 270 | TX_NO_ACTIVATE) != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 271 | pe_warn("could not create timer for passive channel to active channel"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 272 | goto err_timer; |
| 273 | } |
| 274 | |
| 275 | return TX_SUCCESS; |
| 276 | |
| 277 | err_timer: |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 278 | lim_delete_timers_host_roam(mac); |
| 279 | tx_timer_delete(&mac->lim.limTimers.gLimDeauthAckTimer); |
| 280 | tx_timer_delete(&mac->lim.limTimers.gLimDisassocAckTimer); |
| 281 | tx_timer_delete(&mac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 282 | while (((int32_t)-- i) >= 0) { |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 283 | tx_timer_delete(&mac->lim.limTimers.gpLimCnfWaitTimer[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 284 | } |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 285 | tx_timer_delete(&mac->lim.limTimers.gLimProbeAfterHBTimer); |
| 286 | tx_timer_delete(&mac->lim.limTimers.gLimAuthFailureTimer); |
| 287 | tx_timer_delete(&mac->lim.limTimers.gLimAddtsRspTimer); |
| 288 | tx_timer_delete(&mac->lim.limTimers.gLimAssocFailureTimer); |
| 289 | tx_timer_delete(&mac->lim.limTimers.gLimJoinFailureTimer); |
| 290 | tx_timer_delete(&mac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
| 291 | tx_timer_delete(&mac->lim.limTimers.g_lim_periodic_auth_retry_timer); |
| 292 | tx_timer_delete(&mac->lim.limTimers.gLimChannelSwitchTimer); |
| 293 | tx_timer_delete(&mac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
| 294 | tx_timer_delete(&mac->lim.limTimers.sae_auth_timer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 295 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 296 | if (NULL != mac->lim.gLimPreAuthTimerTable.pTable) { |
| 297 | for (i = 0; i < mac->lim.gLimPreAuthTimerTable.numEntry; i++) |
| 298 | qdf_mem_free(mac->lim.gLimPreAuthTimerTable.pTable[i]); |
| 299 | qdf_mem_free(mac->lim.gLimPreAuthTimerTable.pTable); |
| 300 | mac->lim.gLimPreAuthTimerTable.pTable = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 301 | } |
| 302 | return TX_TIMER_ERROR; |
| 303 | } /****** end lim_create_timers() ******/ |
| 304 | |
| 305 | /** |
| 306 | * lim_timer_handler() |
| 307 | * |
| 308 | ***FUNCTION: |
| 309 | * This function is called upon |
| 310 | * 1. MIN_CHANNEL, MAX_CHANNEL timer expiration during scanning |
| 311 | * 2. JOIN_FAILURE timer expiration while joining a BSS |
| 312 | * 3. AUTH_FAILURE timer expiration while authenticating with a peer |
| 313 | * 4. Heartbeat timer expiration on STA |
| 314 | * 5. Background scan timer expiration on STA |
| 315 | * 6. AID release, Pre-auth cleanup and Link monitoring timer |
| 316 | * expiration on AP |
| 317 | * |
| 318 | ***LOGIC: |
| 319 | * |
| 320 | ***ASSUMPTIONS: |
| 321 | * NA |
| 322 | * |
| 323 | ***NOTE: |
| 324 | * NA |
| 325 | * |
| 326 | * @param param - Message corresponding to the timer that expired |
| 327 | * |
| 328 | * @return None |
| 329 | */ |
| 330 | |
| 331 | void lim_timer_handler(void *pMacGlobal, uint32_t param) |
| 332 | { |
Jeff Johnson | c9f4462 | 2018-06-29 14:18:53 -0700 | [diff] [blame] | 333 | QDF_STATUS status; |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 334 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 335 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | |
| 337 | /* Prepare and post message to LIM Message Queue */ |
| 338 | |
| 339 | msg.type = (uint16_t) param; |
| 340 | msg.bodyptr = NULL; |
| 341 | msg.bodyval = 0; |
| 342 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 343 | status = lim_post_msg_high_priority(mac, &msg); |
Jeff Johnson | c9f4462 | 2018-06-29 14:18:53 -0700 | [diff] [blame] | 344 | if (status != QDF_STATUS_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 345 | pe_err("posting message: %X to LIM failed, reason: %d", |
Jeff Johnson | c9f4462 | 2018-06-29 14:18:53 -0700 | [diff] [blame] | 346 | msg.type, status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 347 | } /****** end lim_timer_handler() ******/ |
| 348 | |
| 349 | /** |
| 350 | * lim_addts_response_timer_handler() |
| 351 | * |
| 352 | ***FUNCTION: |
| 353 | * This function is called upon Addts response timer expiration on sta |
| 354 | * |
| 355 | ***LOGIC: |
| 356 | * Message SIR_LIM_ADDTS_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 357 | * when this function is executed. |
| 358 | * |
| 359 | ***ASSUMPTIONS: |
| 360 | * NA |
| 361 | * |
| 362 | ***NOTE: |
| 363 | * NA |
| 364 | * |
| 365 | * @param param - pointer to pre-auth node |
| 366 | * |
| 367 | * @return None |
| 368 | */ |
| 369 | |
| 370 | void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param) |
| 371 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 372 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 373 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 374 | |
| 375 | /* Prepare and post message to LIM Message Queue */ |
| 376 | |
| 377 | msg.type = SIR_LIM_ADDTS_RSP_TIMEOUT; |
| 378 | msg.bodyval = param; |
| 379 | msg.bodyptr = NULL; |
| 380 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 381 | lim_post_msg_api(mac, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 382 | } /****** end lim_auth_response_timer_handler() ******/ |
| 383 | |
| 384 | /** |
| 385 | * lim_auth_response_timer_handler() |
| 386 | * |
| 387 | ***FUNCTION: |
| 388 | * This function is called upon Auth response timer expiration on AP |
| 389 | * |
| 390 | ***LOGIC: |
| 391 | * Message SIR_LIM_AUTH_RSP_TIMEOUT is posted to gSirLimMsgQ |
| 392 | * when this function is executed. |
| 393 | * |
| 394 | ***ASSUMPTIONS: |
| 395 | * NA |
| 396 | * |
| 397 | ***NOTE: |
| 398 | * NA |
| 399 | * |
| 400 | * @param param - pointer to pre-auth node |
| 401 | * |
| 402 | * @return None |
| 403 | */ |
| 404 | |
| 405 | void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param) |
| 406 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 407 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 408 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 409 | |
| 410 | /* Prepare and post message to LIM Message Queue */ |
| 411 | |
| 412 | msg.type = SIR_LIM_AUTH_RSP_TIMEOUT; |
| 413 | msg.bodyptr = NULL; |
| 414 | msg.bodyval = (uint32_t) param; |
| 415 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 416 | lim_post_msg_api(mac, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | } /****** end lim_auth_response_timer_handler() ******/ |
| 418 | |
| 419 | /** |
| 420 | * lim_assoc_failure_timer_handler() |
| 421 | * |
| 422 | * @mac_global : Pointer to Global MAC structure |
| 423 | * @param : Indicates whether this is assoc or reassoc failure timeout |
| 424 | * |
| 425 | * This function is called upon Re/Assoc failure timer expiration on STA. |
| 426 | * Message SIR_LIM_ASSOC_FAIL_TIMEOUT is posted to gSirLimMsgQ when this |
| 427 | * function is executed. |
| 428 | * |
| 429 | * Return void |
| 430 | */ |
| 431 | void lim_assoc_failure_timer_handler(void *mac_global, uint32_t param) |
| 432 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 433 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 434 | struct mac_context *mac_ctx = (struct mac_context *) mac_global; |
Jeff Johnson | 396299a | 2018-11-18 22:13:58 -0800 | [diff] [blame] | 435 | struct pe_session *session = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 436 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 437 | session = mac_ctx->lim.pe_session; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 438 | if (LIM_REASSOC == param && NULL != session |
| 439 | && session->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 440 | pe_err("Reassoc timeout happened"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 441 | if (mac_ctx->lim.reAssocRetryAttempt < |
| 442 | LIM_MAX_REASSOC_RETRY_LIMIT) { |
| 443 | lim_send_retry_reassoc_req_frame(mac_ctx, |
| 444 | session->pLimMlmReassocRetryReq, session); |
| 445 | mac_ctx->lim.reAssocRetryAttempt++; |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 446 | pe_warn("Reassoc request retry is sent %d times", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 447 | mac_ctx->lim.reAssocRetryAttempt); |
| 448 | return; |
| 449 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 450 | pe_warn("Reassoc request retry MAX: %d reached", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 451 | LIM_MAX_REASSOC_RETRY_LIMIT); |
| 452 | if (NULL != session->pLimMlmReassocRetryReq) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 453 | qdf_mem_free(session->pLimMlmReassocRetryReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 454 | session->pLimMlmReassocRetryReq = NULL; |
| 455 | } |
| 456 | } |
| 457 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 458 | /* Prepare and post message to LIM Message Queue */ |
| 459 | msg.type = SIR_LIM_ASSOC_FAIL_TIMEOUT; |
| 460 | msg.bodyval = (uint32_t) param; |
| 461 | msg.bodyptr = NULL; |
| 462 | lim_post_msg_api(mac_ctx, &msg); |
| 463 | } /****** end lim_assoc_failure_timer_handler() ******/ |
| 464 | |
| 465 | /** |
| 466 | * lim_update_olbc_cache_timer_handler() |
| 467 | * |
| 468 | ***FUNCTION: |
| 469 | * This function is called upon update olbc cache timer expiration |
| 470 | * on STA |
| 471 | * |
| 472 | ***LOGIC: |
| 473 | * Message SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT is posted to gSirLimMsgQ |
| 474 | * when this function is executed. |
| 475 | * |
| 476 | ***ASSUMPTIONS: |
| 477 | * NA |
| 478 | * |
| 479 | ***NOTE: |
| 480 | * NA |
| 481 | * |
| 482 | * @param |
| 483 | * |
| 484 | * @return None |
| 485 | */ |
| 486 | void lim_update_olbc_cache_timer_handler(void *pMacGlobal, uint32_t param) |
| 487 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 488 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 489 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 490 | |
| 491 | /* Prepare and post message to LIM Message Queue */ |
| 492 | |
| 493 | msg.type = SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT; |
| 494 | msg.bodyval = 0; |
| 495 | msg.bodyptr = NULL; |
| 496 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 497 | lim_post_msg_api(mac, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 498 | } /****** end lim_update_olbc_cache_timer_handler() ******/ |
| 499 | |
| 500 | /** |
| 501 | * lim_deactivate_and_change_timer() |
| 502 | * |
| 503 | ***FUNCTION: |
| 504 | * This function is called to deactivate and change a timer |
| 505 | * for future re-activation |
| 506 | * |
| 507 | ***LOGIC: |
| 508 | * |
| 509 | ***ASSUMPTIONS: |
| 510 | * NA |
| 511 | * |
| 512 | ***NOTE: |
| 513 | * NA |
| 514 | * |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 515 | * @param mac - Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 516 | * @param timerId - enum of timer to be deactivated and changed |
| 517 | * This enum is defined in lim_utils.h file |
| 518 | * |
| 519 | * @return None |
| 520 | */ |
| 521 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 522 | void lim_deactivate_and_change_timer(struct mac_context *mac, uint32_t timerId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 523 | { |
| 524 | uint32_t val = 0; |
Jeff Johnson | 396299a | 2018-11-18 22:13:58 -0800 | [diff] [blame] | 525 | struct pe_session * session_entry; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 526 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 527 | switch (timerId) { |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 528 | case eLIM_REASSOC_FAIL_TIMER: |
| 529 | case eLIM_FT_PREAUTH_RSP_TIMER: |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 530 | lim_deactivate_and_change_timer_host_roam(mac, timerId); |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 531 | break; |
| 532 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 533 | case eLIM_ADDTS_RSP_TIMER: |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 534 | mac->lim.gLimAddtsRspTimerCount++; |
| 535 | if (tx_timer_deactivate(&mac->lim.limTimers.gLimAddtsRspTimer) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 536 | != TX_SUCCESS) { |
| 537 | /* Could not deactivate AddtsRsp Timer */ |
| 538 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 539 | pe_err("Unable to deactivate AddtsRsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 540 | } |
| 541 | break; |
| 542 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 543 | case eLIM_JOIN_FAIL_TIMER: |
| 544 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 545 | (&mac->lim.limTimers.gLimJoinFailureTimer) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 546 | != TX_SUCCESS) { |
| 547 | /** |
| 548 | * Could not deactivate Join Failure |
| 549 | * timer. Log error. |
| 550 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 551 | pe_err("Unable to deactivate Join Failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 552 | } |
| 553 | |
Arif Hussain | 9f93a64 | 2018-09-10 18:32:25 -0700 | [diff] [blame] | 554 | val = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 555 | mac->mlme_cfg->timeouts.join_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 557 | if (tx_timer_change(&mac->lim.limTimers.gLimJoinFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 558 | val, 0) != TX_SUCCESS) { |
| 559 | /** |
| 560 | * Could not change Join Failure |
| 561 | * timer. Log error. |
| 562 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 563 | pe_err("Unable to change Join Failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 564 | } |
| 565 | |
| 566 | break; |
| 567 | |
| 568 | case eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER: |
| 569 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 570 | (&mac->lim.limTimers.gLimPeriodicJoinProbeReqTimer) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 571 | != TX_SUCCESS) { |
| 572 | /* Could not deactivate periodic join req Times. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 573 | pe_err("Unable to deactivate periodic join request timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS); |
| 577 | if (tx_timer_change |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 578 | (&mac->lim.limTimers.gLimPeriodicJoinProbeReqTimer, val, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 579 | 0) != TX_SUCCESS) { |
| 580 | /* Could not change periodic join req times. */ |
| 581 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 582 | pe_err("Unable to change periodic join request timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 583 | } |
| 584 | |
| 585 | break; |
| 586 | |
| 587 | case eLIM_AUTH_FAIL_TIMER: |
| 588 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 589 | (&mac->lim.limTimers.gLimAuthFailureTimer) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 590 | != TX_SUCCESS) { |
| 591 | /* Could not deactivate Auth failure timer. */ |
| 592 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 593 | pe_err("Unable to deactivate auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 594 | } |
| 595 | /* Change timer to reactivate it in future */ |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 596 | val = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 597 | mac->mlme_cfg->timeouts.auth_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 598 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 599 | if (tx_timer_change(&mac->lim.limTimers.gLimAuthFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 600 | val, 0) != TX_SUCCESS) { |
| 601 | /* Could not change Authentication failure timer. */ |
| 602 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 603 | pe_err("unable to change Auth failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 604 | } |
| 605 | |
| 606 | break; |
| 607 | |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 608 | case eLIM_AUTH_RETRY_TIMER: |
| 609 | |
| 610 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 611 | (&mac->lim.limTimers.g_lim_periodic_auth_retry_timer) |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 612 | != TX_SUCCESS) { |
| 613 | /* Could not deactivate Auth Retry Timer. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 614 | pe_err("Unable to deactivate Auth Retry timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 615 | } |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 616 | session_entry = pe_find_session_by_session_id(mac, |
| 617 | mac->lim.limTimers. |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 618 | g_lim_periodic_auth_retry_timer.sessionId); |
| 619 | if (NULL == session_entry) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 620 | pe_err("session does not exist for given SessionId : %d", |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 621 | mac->lim.limTimers. |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 622 | g_lim_periodic_auth_retry_timer.sessionId); |
| 623 | break; |
| 624 | } |
| 625 | /* 3/5 of the beacon interval */ |
| 626 | val = (session_entry->beaconParams.beaconInterval * 3) / 5; |
| 627 | val = SYS_MS_TO_TICKS(val); |
| 628 | if (tx_timer_change |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 629 | (&mac->lim.limTimers.g_lim_periodic_auth_retry_timer, |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 630 | val, 0) != TX_SUCCESS) { |
| 631 | /* Could not change Auth Retry timer. */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 632 | pe_err("Unable to change Auth Retry timer"); |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 633 | } |
| 634 | break; |
| 635 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 636 | case eLIM_ASSOC_FAIL_TIMER: |
| 637 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 638 | (&mac->lim.limTimers.gLimAssocFailureTimer) != |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 639 | TX_SUCCESS) { |
| 640 | /* Could not deactivate Association failure timer. */ |
| 641 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 642 | pe_err("unable to deactivate Association failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 643 | } |
| 644 | /* Change timer to reactivate it in future */ |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 645 | val = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 646 | mac->mlme_cfg->timeouts.assoc_failure_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 647 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 648 | if (tx_timer_change(&mac->lim.limTimers.gLimAssocFailureTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 649 | val, 0) != TX_SUCCESS) { |
| 650 | /* Could not change Association failure timer. */ |
| 651 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 652 | pe_err("unable to change Assoc failure timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 653 | } |
| 654 | |
| 655 | break; |
| 656 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 657 | case eLIM_PROBE_AFTER_HB_TIMER: |
| 658 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 659 | (&mac->lim.limTimers.gLimProbeAfterHBTimer) != |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 660 | TX_SUCCESS) { |
| 661 | /* Could not deactivate Heartbeat timer. */ |
| 662 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 663 | pe_err("unable to deactivate probeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 664 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 665 | pe_debug("Deactivated probe after hb timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 666 | } |
| 667 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 668 | /* Change timer to reactivate it in future */ |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 669 | val = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 670 | mac->mlme_cfg->timeouts.probe_after_hb_fail_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 671 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 672 | if (tx_timer_change(&mac->lim.limTimers.gLimProbeAfterHBTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 673 | val, 0) != TX_SUCCESS) { |
| 674 | /* Could not change HeartBeat timer. */ |
| 675 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 676 | pe_err("unable to change ProbeAfterHBTimer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 677 | } else { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 678 | pe_debug("Probe after HB timer value is changed: %u", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 679 | val); |
| 680 | } |
| 681 | |
| 682 | break; |
| 683 | |
| 684 | case eLIM_LEARN_DURATION_TIMER: |
| 685 | break; |
| 686 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 687 | case eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
| 688 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 689 | (&mac->lim.limTimers.gLimActiveToPassiveChannelTimer) != |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 690 | TX_SUCCESS) { |
| 691 | /** |
| 692 | ** Could not deactivate Active to passive channel timer. |
| 693 | ** Log error. |
| 694 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 695 | pe_err("Unable to Deactivate Active to passive channel timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 696 | return; |
| 697 | } |
| 698 | val = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT; |
| 699 | val = SYS_MS_TO_TICKS(val); |
| 700 | if (tx_timer_change |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 701 | (&mac->lim.limTimers.gLimActiveToPassiveChannelTimer, val, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 702 | 0) != TX_SUCCESS) { |
| 703 | /** |
| 704 | * Could not change timer to check scan type for passive channel. |
| 705 | * timer. Log error. |
| 706 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 707 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 708 | return; |
| 709 | } |
| 710 | break; |
| 711 | |
| 712 | case eLIM_DISASSOC_ACK_TIMER: |
| 713 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 714 | (&mac->lim.limTimers.gLimDisassocAckTimer) != TX_SUCCESS) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 715 | /** |
| 716 | ** Could not deactivate Join Failure |
| 717 | ** timer. Log error. |
| 718 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 719 | pe_err("Unable to deactivate Disassoc ack timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 720 | return; |
| 721 | } |
| 722 | val = 1000; |
| 723 | val = SYS_MS_TO_TICKS(val); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 724 | if (tx_timer_change(&mac->lim.limTimers.gLimDisassocAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 725 | val, 0) != TX_SUCCESS) { |
| 726 | /** |
| 727 | * Could not change Join Failure |
| 728 | * timer. Log error. |
| 729 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 730 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 731 | return; |
| 732 | } |
| 733 | break; |
| 734 | |
| 735 | case eLIM_DEAUTH_ACK_TIMER: |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 736 | if (tx_timer_deactivate(&mac->lim.limTimers.gLimDeauthAckTimer) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 737 | != TX_SUCCESS) { |
| 738 | /** |
| 739 | ** Could not deactivate Join Failure |
| 740 | ** timer. Log error. |
| 741 | **/ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 742 | pe_err("Unable to deactivate Deauth ack timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 743 | return; |
| 744 | } |
| 745 | val = 1000; |
| 746 | val = SYS_MS_TO_TICKS(val); |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 747 | if (tx_timer_change(&mac->lim.limTimers.gLimDeauthAckTimer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 748 | val, 0) != TX_SUCCESS) { |
| 749 | /** |
| 750 | * Could not change Join Failure |
| 751 | * timer. Log error. |
| 752 | */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 753 | pe_err("Unable to change timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 754 | return; |
| 755 | } |
| 756 | break; |
| 757 | |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 758 | case eLIM_AUTH_SAE_TIMER: |
| 759 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 760 | (&mac->lim.limTimers.sae_auth_timer) |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 761 | != TX_SUCCESS) |
| 762 | pe_err("Unable to deactivate SAE auth timer"); |
| 763 | |
| 764 | /* Change timer to reactivate it in future */ |
| 765 | val = SYS_MS_TO_TICKS(LIM_AUTH_SAE_TIMER_MS); |
| 766 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 767 | if (tx_timer_change(&mac->lim.limTimers.sae_auth_timer, |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 768 | val, 0) != TX_SUCCESS) |
| 769 | pe_err("unable to change SAE auth timer"); |
| 770 | |
| 771 | break; |
| 772 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 773 | default: |
| 774 | /* Invalid timerId. Log error */ |
| 775 | break; |
| 776 | } |
| 777 | } /****** end lim_deactivate_and_change_timer() ******/ |
| 778 | |
| 779 | /** |
| 780 | * lim_deactivate_and_change_per_sta_id_timer() |
| 781 | * |
| 782 | * |
| 783 | * @brief: This function is called to deactivate and change a per STA timer |
| 784 | * for future re-activation |
| 785 | * |
| 786 | ***LOGIC: |
| 787 | * |
| 788 | ***ASSUMPTIONS: |
| 789 | * NA |
| 790 | * |
| 791 | * @note staId for eLIM_AUTH_RSP_TIMER is auth Node Index. |
| 792 | * |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 793 | * @param mac - Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 794 | * @param timerId - enum of timer to be deactivated and changed |
| 795 | * This enum is defined in lim_utils.h file |
| 796 | * @param staId - staId |
| 797 | * |
| 798 | * @return None |
| 799 | */ |
| 800 | |
| 801 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 802 | lim_deactivate_and_change_per_sta_id_timer(struct mac_context *mac, uint32_t timerId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 803 | uint16_t staId) |
| 804 | { |
| 805 | uint32_t val; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 806 | |
| 807 | switch (timerId) { |
| 808 | case eLIM_CNF_WAIT_TIMER: |
| 809 | |
| 810 | if (tx_timer_deactivate |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 811 | (&mac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 812 | != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 813 | pe_err("unable to deactivate CNF wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 814 | } |
| 815 | /* Change timer to reactivate it in future */ |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 816 | val = mac->mlme_cfg->sta.wait_cnf_timeout; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 817 | val = SYS_MS_TO_TICKS(val); |
| 818 | |
| 819 | if (tx_timer_change |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 820 | (&mac->lim.limTimers.gpLimCnfWaitTimer[staId], val, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 821 | val) != TX_SUCCESS) { |
| 822 | /* Could not change cnf timer. */ |
| 823 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 824 | pe_err("unable to change cnf wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 825 | } |
| 826 | |
| 827 | break; |
| 828 | |
| 829 | case eLIM_AUTH_RSP_TIMER: |
| 830 | { |
| 831 | tLimPreAuthNode *pAuthNode; |
| 832 | |
| 833 | pAuthNode = |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 834 | lim_get_pre_auth_node_from_index(mac, |
| 835 | &mac->lim. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 836 | gLimPreAuthTimerTable, |
| 837 | staId); |
| 838 | |
| 839 | if (pAuthNode == NULL) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 840 | pe_err("Invalid Pre Auth Index passed :%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 841 | staId); |
| 842 | break; |
| 843 | } |
| 844 | |
| 845 | if (tx_timer_deactivate(&pAuthNode->timer) != |
| 846 | TX_SUCCESS) { |
| 847 | /* Could not deactivate auth response timer. */ |
| 848 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 849 | pe_err("unable to deactivate auth response timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 850 | } |
| 851 | /* Change timer to reactivate it in future */ |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 852 | val = SYS_MS_TO_TICKS( |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 853 | mac->mlme_cfg->timeouts.auth_rsp_timeout); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 854 | |
| 855 | if (tx_timer_change(&pAuthNode->timer, val, 0) != |
| 856 | TX_SUCCESS) { |
| 857 | /* Could not change auth rsp timer. */ |
| 858 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 859 | pe_err("unable to change auth rsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 860 | } |
| 861 | } |
| 862 | break; |
| 863 | |
| 864 | default: |
| 865 | /* Invalid timerId. Log error */ |
| 866 | break; |
| 867 | |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | /** |
| 872 | * lim_activate_cnf_timer() |
| 873 | * |
| 874 | ***FUNCTION: |
| 875 | * This function is called to activate a per STA timer |
| 876 | * |
| 877 | ***LOGIC: |
| 878 | * |
| 879 | ***ASSUMPTIONS: |
| 880 | * NA |
| 881 | * |
| 882 | ***NOTE: |
| 883 | * NA |
| 884 | * |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 885 | * @param mac - Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 886 | * @param StaId - staId |
| 887 | * |
| 888 | * @return None |
| 889 | */ |
| 890 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 891 | void lim_activate_cnf_timer(struct mac_context *mac, uint16_t staId, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 892 | struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 893 | { |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 894 | mac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 895 | pe_session->peSessionId; |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 896 | if (tx_timer_activate(&mac->lim.limTimers.gpLimCnfWaitTimer[staId]) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 897 | != TX_SUCCESS) { |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 898 | pe_err("could not activate cnf wait timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 899 | } |
| 900 | } |
| 901 | |
| 902 | /** |
| 903 | * lim_activate_auth_rsp_timer() |
| 904 | * |
| 905 | ***FUNCTION: |
| 906 | * This function is called to activate a per STA timer |
| 907 | * |
| 908 | ***LOGIC: |
| 909 | * |
| 910 | ***ASSUMPTIONS: |
| 911 | * NA |
| 912 | * |
| 913 | ***NOTE: |
| 914 | * NA |
| 915 | * |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 916 | * @param mac - Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 917 | * @param id - id |
| 918 | * |
| 919 | * @return None |
| 920 | */ |
| 921 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 922 | void lim_activate_auth_rsp_timer(struct mac_context *mac, tLimPreAuthNode *pAuthNode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 923 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | if (tx_timer_activate(&pAuthNode->timer) != TX_SUCCESS) { |
| 925 | /* / Could not activate auth rsp timer. */ |
| 926 | /* Log error */ |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 927 | pe_err("could not activate auth rsp timer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 928 | } |
| 929 | } |
| 930 | |
| 931 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 932 | * limAssocCnfWaitTmerHandler() |
| 933 | * |
| 934 | ***FUNCTION: |
| 935 | * This function post a message to send a disassociate frame out. |
| 936 | * |
| 937 | ***LOGIC: |
| 938 | * |
| 939 | ***ASSUMPTIONS: |
| 940 | * |
| 941 | ***NOTE: |
| 942 | * NA |
| 943 | * |
| 944 | * @param |
| 945 | * |
| 946 | * @return None |
| 947 | */ |
| 948 | |
| 949 | void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param) |
| 950 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 951 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 952 | uint32_t statusCode; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 953 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 954 | |
| 955 | msg.type = SIR_LIM_CNF_WAIT_TIMEOUT; |
| 956 | msg.bodyval = (uint32_t) param; |
| 957 | msg.bodyptr = NULL; |
| 958 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 959 | statusCode = lim_post_msg_api(mac, &msg); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 960 | if (statusCode != QDF_STATUS_SUCCESS) |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 961 | pe_err("posting to LIM failed, reason: %d", statusCode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 962 | |
| 963 | } |
| 964 | |
| 965 | void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param) |
| 966 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 967 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame^] | 968 | struct mac_context *mac = (struct mac_context *) pMacGlobal; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 969 | |
Nishank Aggarwal | f0e344b | 2017-03-23 16:39:13 +0530 | [diff] [blame] | 970 | pe_debug("ChannelSwitch Timer expired. Posting msg to LIM"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 971 | |
| 972 | msg.type = SIR_LIM_CHANNEL_SWITCH_TIMEOUT; |
| 973 | msg.bodyval = (uint32_t) param; |
| 974 | msg.bodyptr = NULL; |
| 975 | |
Jeff Johnson | 1e5de5a | 2018-11-22 15:37:32 -0800 | [diff] [blame] | 976 | lim_post_msg_api(mac, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 977 | } |