Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Arif Hussain | ee10f90 | 2017-12-27 16:30:17 -0800 | [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 ProcessMessageQueue.cc contains the code |
| 21 | * for processing LIM message Queue. |
| 22 | * Author: Chandra Modumudi |
| 23 | * Date: 02/11/02 |
| 24 | * History:- |
| 25 | * Date Modified by Modification Information |
| 26 | * -------------------------------------------------------------------- |
| 27 | * |
| 28 | */ |
| 29 | #include "cds_api.h" |
| 30 | #include "wni_api.h" |
| 31 | #include "wma_types.h" |
| 32 | |
| 33 | #include "wni_cfg.h" |
| 34 | #include "cfg_api.h" |
| 35 | #include "sir_common.h" |
| 36 | #include "utils_api.h" |
| 37 | #include "lim_types.h" |
| 38 | #include "lim_utils.h" |
| 39 | #include "lim_assoc_utils.h" |
| 40 | #include "lim_prop_exts_utils.h" |
| 41 | |
| 42 | #include "lim_admit_control.h" |
| 43 | #include "lim_ibss_peer_mgmt.h" |
| 44 | #include "sch_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 45 | #include "lim_ft_defs.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 46 | #include "lim_session.h" |
| 47 | #include "lim_send_messages.h" |
| 48 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 49 | #include "rrm_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 50 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 51 | #include "lim_ft.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 52 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 53 | #include "qdf_types.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | #include "cds_packet.h" |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 55 | #include "qdf_mem.h" |
Tushnim Bhattacharyya | 66348bd | 2017-03-09 15:02:10 -0800 | [diff] [blame] | 56 | #include "wlan_policy_mgr_api.h" |
Deepak Dhamdhere | 0f076bd | 2016-06-02 11:29:21 -0700 | [diff] [blame] | 57 | #include "nan_datapath.h" |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 58 | #include "wlan_reg_services_api.h" |
Padma, Santhosh Kumar | dd3f485 | 2018-01-16 18:51:51 +0530 | [diff] [blame] | 59 | #include "lim_security_utils.h" |
| 60 | #include "cds_ieee80211_common.h" |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 61 | #include <wlan_scan_ucfg_api.h> |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 62 | #include "wlan_mlme_public_struct.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 64 | void lim_log_session_states(tpAniSirGlobal mac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 65 | static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 66 | struct scheduler_msg *msg, uint8_t rsp_reqd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 67 | |
Padma, Santhosh Kumar | dd3f485 | 2018-01-16 18:51:51 +0530 | [diff] [blame] | 68 | #ifdef WLAN_FEATURE_SAE |
| 69 | /** |
| 70 | * lim_process_sae_msg() - Process SAE message |
| 71 | * @mac: Global MAC pointer |
| 72 | * @body: Buffer pointer |
| 73 | * |
| 74 | * Return: None |
| 75 | */ |
| 76 | static void lim_process_sae_msg(tpAniSirGlobal mac, struct sir_sae_msg *body) |
| 77 | { |
| 78 | struct sir_sae_msg *sae_msg = body; |
| 79 | tpPESession session; |
| 80 | |
| 81 | if (!sae_msg) { |
| 82 | pe_err("SAE msg is NULL"); |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | session = pe_find_session_by_sme_session_id(mac, |
| 87 | sae_msg->session_id); |
| 88 | if (session == NULL) { |
| 89 | pe_err("SAE:Unable to find session"); |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | if (session->pePersona != QDF_STA_MODE) { |
| 94 | pe_err("SAE:Not supported in this mode %d", |
| 95 | session->pePersona); |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | pe_debug("SAE:status %d limMlmState %d pePersona %d", |
| 100 | sae_msg->sae_status, session->limMlmState, |
| 101 | session->pePersona); |
| 102 | switch (session->limMlmState) { |
| 103 | case eLIM_MLM_WT_SAE_AUTH_STATE: |
| 104 | /* SAE authentication is completed. Restore from auth state */ |
| 105 | if (tx_timer_running(&mac->lim.limTimers.sae_auth_timer)) |
| 106 | lim_deactivate_and_change_timer(mac, |
| 107 | eLIM_AUTH_SAE_TIMER); |
| 108 | /* success */ |
| 109 | if (sae_msg->sae_status == IEEE80211_STATUS_SUCCESS) |
| 110 | lim_restore_from_auth_state(mac, |
| 111 | eSIR_SME_SUCCESS, |
| 112 | eSIR_MAC_SUCCESS_STATUS, |
| 113 | session); |
| 114 | else |
| 115 | lim_restore_from_auth_state(mac, |
| 116 | eSIR_SME_AUTH_REFUSED, |
| 117 | eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 118 | session); |
| 119 | break; |
| 120 | default: |
| 121 | /* SAE msg is received in unexpected state */ |
| 122 | pe_err("received SAE msg in state %X", |
| 123 | session->limMlmState); |
| 124 | lim_print_mlm_state(mac, LOGE, session->limMlmState); |
| 125 | break; |
| 126 | } |
| 127 | } |
| 128 | #else |
| 129 | static inline void lim_process_sae_msg(tpAniSirGlobal mac, void *body) |
| 130 | {} |
| 131 | #endif |
| 132 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 133 | /** |
| 134 | * lim_process_dual_mac_cfg_resp() - Process set dual mac config response |
| 135 | * @mac: Global MAC pointer |
| 136 | * @body: Set dual mac config response in sir_dual_mac_config_resp format |
| 137 | * |
| 138 | * Process the set dual mac config response and post the message |
| 139 | * to SME to process this further and release the active |
| 140 | * command list |
| 141 | * |
| 142 | * Return: None |
| 143 | */ |
| 144 | static void lim_process_dual_mac_cfg_resp(tpAniSirGlobal mac, void *body) |
| 145 | { |
| 146 | struct sir_dual_mac_config_resp *resp, *param; |
| 147 | uint32_t len, fail_resp = 0; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 148 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 149 | |
| 150 | resp = (struct sir_dual_mac_config_resp *)body; |
| 151 | if (!resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 152 | pe_err("Set dual mac cfg param is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 153 | fail_resp = 1; |
| 154 | /* Not returning here. If possible, let us proceed |
| 155 | * and send fail response to SME |
| 156 | */ |
| 157 | } |
| 158 | |
| 159 | len = sizeof(*param); |
| 160 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 161 | param = qdf_mem_malloc(len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 162 | if (!param) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 163 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 164 | |
| 165 | if (fail_resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 166 | pe_err("Send fail status to SME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 167 | param->status = SET_HW_MODE_STATUS_ECANCELED; |
| 168 | } else { |
| 169 | param->status = resp->status; |
| 170 | /* |
| 171 | * TODO: Update this HW mode info in any UMAC params, if needed |
| 172 | */ |
| 173 | } |
| 174 | |
| 175 | msg.type = eWNI_SME_SET_DUAL_MAC_CFG_RESP; |
| 176 | msg.bodyptr = param; |
| 177 | msg.bodyval = 0; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 178 | pe_debug("Send eWNI_SME_SET_DUAL_MAC_CFG_RESP to SME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 179 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * lim_process_set_hw_mode_resp() - Process set HW mode response |
| 185 | * @mac: Global MAC pointer |
| 186 | * @body: Set HW mode response in sir_set_hw_mode_resp format |
| 187 | * |
| 188 | * Process the set HW mode response and post the message |
| 189 | * to SME to process this further and release the active |
| 190 | * command list |
| 191 | * |
| 192 | * Return: None |
| 193 | */ |
| 194 | static void lim_process_set_hw_mode_resp(tpAniSirGlobal mac, void *body) |
| 195 | { |
| 196 | struct sir_set_hw_mode_resp *resp, *param; |
| 197 | uint32_t len, i, fail_resp = 0; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 198 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | |
| 200 | resp = (struct sir_set_hw_mode_resp *)body; |
| 201 | if (!resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 202 | pe_err("Set HW mode param is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 203 | fail_resp = 1; |
| 204 | /* Not returning here. If possible, let us proceed |
| 205 | * and send fail response to SME */ |
| 206 | } |
| 207 | |
| 208 | len = sizeof(*param); |
| 209 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 210 | param = qdf_mem_malloc(len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 211 | if (!param) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 212 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 213 | |
| 214 | if (fail_resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 215 | pe_err("Send fail status to SME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 216 | param->status = SET_HW_MODE_STATUS_ECANCELED; |
| 217 | param->cfgd_hw_mode_index = 0; |
| 218 | param->num_vdev_mac_entries = 0; |
| 219 | } else { |
| 220 | param->status = resp->status; |
| 221 | param->cfgd_hw_mode_index = resp->cfgd_hw_mode_index; |
| 222 | param->num_vdev_mac_entries = resp->num_vdev_mac_entries; |
| 223 | |
| 224 | for (i = 0; i < resp->num_vdev_mac_entries; i++) { |
| 225 | param->vdev_mac_map[i].vdev_id = |
| 226 | resp->vdev_mac_map[i].vdev_id; |
| 227 | param->vdev_mac_map[i].mac_id = |
| 228 | resp->vdev_mac_map[i].mac_id; |
| 229 | } |
| 230 | /* |
| 231 | * TODO: Update this HW mode info in any UMAC params, if needed |
| 232 | */ |
| 233 | } |
| 234 | |
| 235 | msg.type = eWNI_SME_SET_HW_MODE_RESP; |
| 236 | msg.bodyptr = param; |
| 237 | msg.bodyval = 0; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 238 | pe_err("Send eWNI_SME_SET_HW_MODE_RESP to SME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 239 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | /** |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 244 | * lim_process_antenna_mode_resp() - Process set antenna mode |
| 245 | * response |
| 246 | * @mac: Global MAC pointer |
| 247 | * @body: Set antenna mode response in sir_antenna_mode_resp |
| 248 | * format |
| 249 | * |
| 250 | * Process the set antenna mode response and post the message |
| 251 | * to SME to process this further and release the active |
| 252 | * command list |
| 253 | * |
| 254 | * Return: None |
| 255 | */ |
| 256 | static void lim_process_set_antenna_resp(tpAniSirGlobal mac, void *body) |
| 257 | { |
| 258 | struct sir_antenna_mode_resp *resp, *param; |
| 259 | bool fail_resp = false; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 260 | struct scheduler_msg msg = {0}; |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 261 | |
| 262 | resp = (struct sir_antenna_mode_resp *)body; |
| 263 | if (!resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 264 | pe_err("Set antenna mode resp is NULL"); |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 265 | fail_resp = true; |
| 266 | /* Not returning here. If possible, let us proceed |
| 267 | * and send fail response to SME |
| 268 | */ |
| 269 | } |
| 270 | |
| 271 | param = qdf_mem_malloc(sizeof(*param)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 272 | if (!param) |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 273 | return; |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 274 | |
| 275 | if (fail_resp) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 276 | pe_err("Send fail status to SME"); |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 277 | param->status = SET_ANTENNA_MODE_STATUS_ECANCELED; |
| 278 | } else { |
| 279 | param->status = resp->status; |
| 280 | } |
| 281 | |
| 282 | msg.type = eWNI_SME_SET_ANTENNA_MODE_RESP; |
| 283 | msg.bodyptr = param; |
| 284 | msg.bodyval = 0; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 285 | pe_debug("Send eWNI_SME_SET_ANTENNA_MODE_RESP to SME"); |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 286 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 287 | return; |
| 288 | } |
| 289 | |
| 290 | /** |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 291 | * lim_process_set_default_scan_ie_request() - Process the Set default |
| 292 | * Scan IE request from HDD. |
| 293 | * @mac_ctx: Pointer to Global MAC structure |
| 294 | * @msg_buf: Pointer to incoming data |
| 295 | * |
| 296 | * This function receives the default scan IEs and updates the ext cap IE |
| 297 | * (if present) with FTM capabilities and pass the Scan IEs to WMA. |
| 298 | * |
| 299 | * Return: None |
| 300 | */ |
| 301 | static void lim_process_set_default_scan_ie_request(tpAniSirGlobal mac_ctx, |
| 302 | uint32_t *msg_buf) |
| 303 | { |
| 304 | struct hdd_default_scan_ie *set_ie_params; |
| 305 | struct vdev_ie_info *wma_ie_params; |
| 306 | uint8_t *local_ie_buf; |
| 307 | uint16_t local_ie_len; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 308 | struct scheduler_msg msg_q = {0}; |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 309 | QDF_STATUS ret_code; |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 310 | |
| 311 | if (!msg_buf) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 312 | pe_err("msg_buf is NULL"); |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 313 | return; |
| 314 | } |
| 315 | |
| 316 | set_ie_params = (struct hdd_default_scan_ie *) msg_buf; |
| 317 | local_ie_len = set_ie_params->ie_len; |
| 318 | |
| 319 | local_ie_buf = qdf_mem_malloc(MAX_DEFAULT_SCAN_IE_LEN); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 320 | if (!local_ie_buf) |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 321 | return; |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 322 | |
Selvaraj, Sridhar | 0174182 | 2016-08-30 18:26:19 +0530 | [diff] [blame] | 323 | if (lim_update_ext_cap_ie(mac_ctx, |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 324 | (uint8_t *)set_ie_params->ie_data, |
| 325 | local_ie_buf, &local_ie_len)) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 326 | pe_err("Update ext cap IEs fails"); |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 327 | goto scan_ie_send_fail; |
| 328 | } |
| 329 | |
| 330 | wma_ie_params = qdf_mem_malloc(sizeof(*wma_ie_params) + local_ie_len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 331 | if (!wma_ie_params) |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 332 | goto scan_ie_send_fail; |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 333 | |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 334 | wma_ie_params->vdev_id = set_ie_params->session_id; |
| 335 | wma_ie_params->ie_id = DEFAULT_SCAN_IE_ID; |
| 336 | wma_ie_params->length = local_ie_len; |
| 337 | wma_ie_params->data = (uint8_t *)(wma_ie_params) |
| 338 | + sizeof(*wma_ie_params); |
| 339 | qdf_mem_copy(wma_ie_params->data, local_ie_buf, local_ie_len); |
| 340 | |
| 341 | msg_q.type = WMA_SET_IE_INFO; |
| 342 | msg_q.bodyptr = wma_ie_params; |
| 343 | msg_q.bodyval = 0; |
| 344 | ret_code = wma_post_ctrl_msg(mac_ctx, &msg_q); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 345 | if (QDF_STATUS_SUCCESS != ret_code) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 346 | pe_err("fail to send WMA_SET_IE_INFO"); |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 347 | qdf_mem_free(wma_ie_params); |
| 348 | } |
| 349 | scan_ie_send_fail: |
| 350 | qdf_mem_free(local_ie_buf); |
| 351 | } |
| 352 | |
| 353 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 354 | * lim_process_hw_mode_trans_ind() - Process set HW mode transition indication |
| 355 | * @mac: Global MAC pointer |
| 356 | * @body: Set HW mode response in sir_hw_mode_trans_ind format |
| 357 | * |
| 358 | * Process the set HW mode transition indication and post the message |
| 359 | * to SME to invoke the HDD callback |
| 360 | * command list |
| 361 | * |
| 362 | * Return: None |
| 363 | */ |
| 364 | static void lim_process_hw_mode_trans_ind(tpAniSirGlobal mac, void *body) |
| 365 | { |
| 366 | struct sir_hw_mode_trans_ind *ind, *param; |
| 367 | uint32_t len, i; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 368 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 369 | |
| 370 | ind = (struct sir_hw_mode_trans_ind *)body; |
| 371 | if (!ind) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 372 | pe_err("Set HW mode trans ind param is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 373 | return; |
| 374 | } |
| 375 | |
| 376 | len = sizeof(*param); |
| 377 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 378 | param = qdf_mem_malloc(len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 379 | if (!param) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 380 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 381 | |
| 382 | param->old_hw_mode_index = ind->old_hw_mode_index; |
| 383 | param->new_hw_mode_index = ind->new_hw_mode_index; |
| 384 | param->num_vdev_mac_entries = ind->num_vdev_mac_entries; |
| 385 | |
| 386 | for (i = 0; i < ind->num_vdev_mac_entries; i++) { |
| 387 | param->vdev_mac_map[i].vdev_id = |
| 388 | ind->vdev_mac_map[i].vdev_id; |
| 389 | param->vdev_mac_map[i].mac_id = |
| 390 | ind->vdev_mac_map[i].mac_id; |
| 391 | } |
| 392 | |
| 393 | /* TODO: Update this HW mode info in any UMAC params, if needed */ |
| 394 | |
| 395 | msg.type = eWNI_SME_HW_MODE_TRANS_IND; |
| 396 | msg.bodyptr = param; |
| 397 | msg.bodyval = 0; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 398 | pe_err("Send eWNI_SME_HW_MODE_TRANS_IND to SME"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 399 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 400 | return; |
| 401 | } |
| 402 | |
| 403 | /** ------------------------------------------------------------- |
| 404 | \fn def_msg_decision |
| 405 | \brief The function decides whether to defer a message or not in limProcessMessage function |
| 406 | \param tpAniSirGlobal pMac |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 407 | \param struct scheduler_msg limMsg |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | \param tSirMacTspecIE *ppInfo |
| 409 | \return none |
| 410 | -------------------------------------------------------------*/ |
| 411 | |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 412 | static uint8_t def_msg_decision(tpAniSirGlobal mac_ctx, |
| 413 | struct scheduler_msg *lim_msg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 414 | { |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 415 | uint8_t type, subtype; |
| 416 | QDF_STATUS status; |
| 417 | bool mgmt_pkt_defer = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 418 | |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 419 | /* this function should not changed */ |
| 420 | if (mac_ctx->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) { |
Jeff Johnson | 47d7524 | 2018-05-12 15:58:53 -0700 | [diff] [blame] | 421 | /* Defer processing this message */ |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 422 | if (lim_defer_msg(mac_ctx, lim_msg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 423 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 424 | FL("Unable to Defer Msg")); |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 425 | lim_log_session_states(mac_ctx); |
| 426 | lim_handle_defer_msg_error(mac_ctx, lim_msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 427 | } |
| 428 | return true; |
| 429 | } |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 430 | |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 431 | /* |
| 432 | * When defer is requested then defer all the messages except |
| 433 | * HAL responses. |
| 434 | */ |
| 435 | if (!lim_is_system_in_scan_state(mac_ctx) && |
| 436 | !GET_LIM_PROCESS_DEFD_MESGS(mac_ctx)) { |
| 437 | if (lim_msg->type == SIR_BB_XPORT_MGMT_MSG) { |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 438 | /* |
| 439 | * Dont defer beacon and probe response |
| 440 | * because it will fill the differ queue quickly |
| 441 | */ |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 442 | status = lim_util_get_type_subtype(lim_msg->bodyptr, |
| 443 | &type, &subtype); |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 444 | if (QDF_IS_STATUS_SUCCESS(status) && |
| 445 | (type == SIR_MAC_MGMT_FRAME) && |
| 446 | ((subtype == SIR_MAC_MGMT_BEACON) || |
| 447 | (subtype == SIR_MAC_MGMT_PROBE_RSP))) |
| 448 | mgmt_pkt_defer = false; |
| 449 | } |
| 450 | |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 451 | if ((lim_msg->type != WMA_ADD_BSS_RSP) && |
| 452 | (lim_msg->type != WMA_DELETE_BSS_RSP) && |
| 453 | (lim_msg->type != WMA_DELETE_BSS_HO_FAIL_RSP) && |
| 454 | (lim_msg->type != WMA_ADD_STA_RSP) && |
| 455 | (lim_msg->type != WMA_DELETE_STA_RSP) && |
| 456 | (lim_msg->type != WMA_SET_BSSKEY_RSP) && |
| 457 | (lim_msg->type != WMA_SET_STAKEY_RSP) && |
| 458 | (lim_msg->type != WMA_SET_STA_BCASTKEY_RSP) && |
| 459 | (lim_msg->type != WMA_AGGR_QOS_RSP) && |
| 460 | (lim_msg->type != WMA_SET_MIMOPS_RSP) && |
| 461 | (lim_msg->type != WMA_SWITCH_CHANNEL_RSP) && |
| 462 | (lim_msg->type != WMA_P2P_NOA_ATTR_IND) && |
| 463 | (lim_msg->type != WMA_ADD_TS_RSP) && |
Hanumantha Reddy Pothula | b834021 | 2016-01-12 11:16:06 +0530 | [diff] [blame] | 464 | /* |
| 465 | * LIM won't process any defer queue commands if gLimAddtsSent is |
| 466 | * set to TRUE. gLimAddtsSent will be set TRUE to while sending |
| 467 | * ADDTS REQ. Say, when deferring is enabled, if |
| 468 | * SIR_LIM_ADDTS_RSP_TIMEOUT is posted (because of not receiving ADDTS |
| 469 | * RSP) then this command will be added to defer queue and as |
| 470 | * gLimAddtsSent is set TRUE LIM will never process any commands from |
| 471 | * defer queue, including SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing |
| 472 | * SIR_LIM_ADDTS_RSP_TIMEOUT command to be processed with deferring |
| 473 | * enabled, so that this will be processed immediately and sets |
| 474 | * gLimAddtsSent to FALSE. |
| 475 | */ |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 476 | (lim_msg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) && |
Hema Aparna Medicharla | 5e1f302 | 2015-08-24 11:22:29 +0530 | [diff] [blame] | 477 | /* Allow processing of RX frames while awaiting reception |
| 478 | * of ADD TS response over the air. This logic particularly |
| 479 | * handles the case when host sends ADD BA request to FW |
| 480 | * after ADD TS request is sent over the air and |
| 481 | * ADD TS response received over the air */ |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 482 | !(lim_msg->type == SIR_BB_XPORT_MGMT_MSG && |
| 483 | mac_ctx->lim.gLimAddtsSent) && |
| 484 | (mgmt_pkt_defer)) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 485 | pe_debug("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode", |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 486 | lim_msg_str(lim_msg->type)); |
Jeff Johnson | 47d7524 | 2018-05-12 15:58:53 -0700 | [diff] [blame] | 487 | /* Defer processing this message */ |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 488 | if (lim_defer_msg(mac_ctx, lim_msg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 489 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Naveen Rawat | b2fcd47 | 2018-06-10 22:24:24 -0700 | [diff] [blame] | 490 | FL("Unable to Defer Msg")); |
| 491 | lim_log_session_states(mac_ctx); |
| 492 | lim_handle_defer_msg_error(mac_ctx, lim_msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 493 | } |
| 494 | return true; |
| 495 | } |
| 496 | } |
| 497 | return false; |
| 498 | } |
| 499 | |
| 500 | #ifdef FEATURE_WLAN_EXTSCAN |
| 501 | static void |
| 502 | __lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, |
| 503 | tSirProbeRespBeacon *frame, uint32_t ie_len, |
| 504 | uint32_t msg_type) |
| 505 | { |
| 506 | struct pno_match_found *result; |
| 507 | uint8_t *body; |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 508 | struct scheduler_msg mmh_msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 509 | tpSirMacMgmtHdr hdr; |
| 510 | uint32_t num_results = 1, len, i; |
| 511 | |
| 512 | /* Upon receiving every matched beacon, bss info is forwarded to the |
| 513 | * the upper layer, hence num_results is set to 1 */ |
| 514 | len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) + |
| 515 | ie_len; |
| 516 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 517 | result = qdf_mem_malloc(len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 518 | if (!result) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 519 | return; |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 520 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 521 | hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); |
| 522 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 523 | |
| 524 | /* Received frame does not have request id, hence set 0 */ |
| 525 | result->request_id = 0; |
| 526 | result->more_data = 0; |
| 527 | result->num_results = num_results; |
| 528 | |
| 529 | for (i = 0; i < result->num_results; i++) { |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 530 | result->ap[i].ts = qdf_mc_timer_get_system_time(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 531 | result->ap[i].beaconPeriod = frame->beaconInterval; |
| 532 | result->ap[i].capability = |
| 533 | lim_get_u16((uint8_t *) &frame->capabilityInfo); |
| 534 | result->ap[i].channel = WMA_GET_RX_CH(rx_pkt_info); |
Deepak Dhamdhere | 68929ec | 2015-08-05 15:16:35 -0700 | [diff] [blame] | 535 | result->ap[i].rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 536 | result->ap[i].rtt = 0; |
| 537 | result->ap[i].rtt_sd = 0; |
| 538 | result->ap[i].ieLength = ie_len; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 539 | qdf_mem_copy((uint8_t *) &result->ap[i].ssid[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 540 | (uint8_t *) frame->ssId.ssId, frame->ssId.length); |
| 541 | result->ap[i].ssid[frame->ssId.length] = '\0'; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 542 | qdf_mem_copy((uint8_t *) &result->ap[i].bssid, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 543 | (uint8_t *) hdr->bssId, |
| 544 | sizeof(tSirMacAddr)); |
| 545 | /* Copy IE fields */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 546 | qdf_mem_copy((uint8_t *) &result->ap[i].ieData, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 547 | body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); |
| 548 | } |
| 549 | |
| 550 | mmh_msg.type = msg_type; |
| 551 | mmh_msg.bodyptr = result; |
| 552 | mmh_msg.bodyval = 0; |
| 553 | lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT); |
| 554 | } |
| 555 | |
| 556 | |
| 557 | static void |
| 558 | __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, |
| 559 | tSirProbeRespBeacon *frame, |
| 560 | uint32_t ie_len, |
| 561 | uint32_t msg_type) |
| 562 | { |
| 563 | tpSirWifiFullScanResultEvent result; |
| 564 | uint8_t *body; |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 565 | struct scheduler_msg mmh_msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 566 | tpSirMacMgmtHdr hdr; |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 567 | uint32_t frame_len; |
| 568 | tSirBssDescription *bssdescr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 569 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 570 | result = qdf_mem_malloc(sizeof(*result) + ie_len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 571 | if (!result) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 572 | return; |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 573 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 574 | hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); |
| 575 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 576 | |
| 577 | /* Received frame does not have request id, hence set 0 */ |
| 578 | result->requestId = 0; |
| 579 | |
| 580 | result->moreData = 0; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 581 | result->ap.ts = qdf_mc_timer_get_system_time(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 582 | result->ap.beaconPeriod = frame->beaconInterval; |
| 583 | result->ap.capability = |
| 584 | lim_get_u16((uint8_t *) &frame->capabilityInfo); |
| 585 | result->ap.channel = WMA_GET_RX_CH(rx_pkt_info); |
Deepak Dhamdhere | 68929ec | 2015-08-05 15:16:35 -0700 | [diff] [blame] | 586 | result->ap.rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 587 | result->ap.rtt = 0; |
| 588 | result->ap.rtt_sd = 0; |
| 589 | result->ap.ieLength = ie_len; |
| 590 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 591 | qdf_mem_copy((uint8_t *) &result->ap.ssid[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 592 | (uint8_t *) frame->ssId.ssId, frame->ssId.length); |
| 593 | result->ap.ssid[frame->ssId.length] = '\0'; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 594 | qdf_mem_copy((uint8_t *) &result->ap.bssid.bytes, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 595 | (uint8_t *) hdr->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 596 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | /* Copy IE fields */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 598 | qdf_mem_copy((uint8_t *) &result->ap.ieData, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 599 | body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); |
| 600 | |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 601 | frame_len = sizeof(*bssdescr) + ie_len - sizeof(bssdescr->ieFields[1]); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 602 | bssdescr = qdf_mem_malloc(frame_len); |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 603 | |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 604 | if (!bssdescr) |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 605 | return; |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 606 | |
| 607 | qdf_mem_zero(bssdescr, frame_len); |
| 608 | |
| 609 | lim_collect_bss_description(pmac, bssdescr, frame, rx_pkt_info, false); |
Abhinav Kumar | f998958 | 2018-02-06 17:42:22 +0530 | [diff] [blame] | 610 | |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 611 | qdf_mem_free(bssdescr); |
| 612 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 613 | mmh_msg.type = msg_type; |
| 614 | mmh_msg.bodyptr = result; |
| 615 | mmh_msg.bodyval = 0; |
| 616 | lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT); |
| 617 | } |
| 618 | |
| 619 | static void |
| 620 | __lim_process_ext_scan_beacon_probe_rsp(tpAniSirGlobal pmac, |
| 621 | uint8_t *rx_pkt_info, |
| 622 | uint8_t sub_type) |
| 623 | { |
| 624 | tSirProbeRespBeacon *frame; |
| 625 | uint8_t *body; |
| 626 | uint32_t frm_len; |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 627 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 628 | |
| 629 | frm_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info); |
| 630 | if (frm_len <= SIR_MAC_B_PR_SSID_OFFSET) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 631 | pe_err("RX packet has invalid length %d", frm_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 632 | return; |
| 633 | } |
| 634 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 635 | frame = qdf_mem_malloc(sizeof(*frame)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 636 | if (!frame) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 637 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 638 | |
| 639 | if (sub_type == SIR_MAC_MGMT_BEACON) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 640 | pe_debug("Beacon due to ExtScan/epno"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 641 | status = sir_convert_beacon_frame2_struct(pmac, |
| 642 | (uint8_t *)rx_pkt_info, |
| 643 | frame); |
| 644 | } else if (sub_type == SIR_MAC_MGMT_PROBE_RSP) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 645 | pe_debug("Probe Rsp due to ExtScan/epno"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 646 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
| 647 | status = sir_convert_probe_frame2_struct(pmac, body, |
| 648 | frm_len, frame); |
| 649 | } else { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 650 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 651 | return; |
| 652 | } |
| 653 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 654 | if (status != QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 655 | pe_err("Frame parsing failed"); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 656 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 657 | return; |
| 658 | } |
| 659 | |
| 660 | if (WMA_IS_EXTSCAN_SCAN_SRC(rx_pkt_info)) |
| 661 | __lim_ext_scan_forward_bcn_probe_rsp(pmac, rx_pkt_info, frame, |
| 662 | (frm_len - SIR_MAC_B_PR_SSID_OFFSET), |
| 663 | eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND); |
| 664 | |
| 665 | if (WMA_IS_EPNO_SCAN_SRC(rx_pkt_info)) |
| 666 | __lim_pno_match_fwd_bcn_probepsp(pmac, rx_pkt_info, frame, |
| 667 | (frm_len - SIR_MAC_B_PR_SSID_OFFSET), |
| 668 | eWNI_SME_EPNO_NETWORK_FOUND_IND); |
| 669 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 670 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 671 | } |
| 672 | #endif |
| 673 | |
| 674 | /* |
| 675 | * Beacon Handling Cases: |
| 676 | * during scanning, when no session is active: |
| 677 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 678 | * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null. |
| 679 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 680 | * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null. |
| 681 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 682 | * Not scanning, no session: |
| 683 | * there should not be any beacon coming, if coming, should be dropped. |
| 684 | * Not Scanning, |
| 685 | */ |
| 686 | static void |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 687 | __lim_handle_beacon(tpAniSirGlobal mac, struct scheduler_msg *pMsg, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 688 | tpPESession psessionEntry) |
| 689 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 690 | uint8_t *pRxPacketInfo; |
Srinivas Girigowda | 4d65ebe | 2017-10-13 21:41:42 -0700 | [diff] [blame] | 691 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 692 | lim_get_b_dfrom_rx_packet(mac, pMsg->bodyptr, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 693 | (uint32_t **) &pRxPacketInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 694 | |
| 695 | /* This function should not be called if beacon is received in scan state. */ |
| 696 | /* So not doing any checks for the global state. */ |
| 697 | |
| 698 | if (psessionEntry == NULL) { |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 699 | sch_beacon_process(mac, pRxPacketInfo, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 700 | } else if ((psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) || |
| 701 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) { |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 702 | sch_beacon_process(mac, pRxPacketInfo, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 703 | } else |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 704 | lim_process_beacon_frame(mac, pRxPacketInfo, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 705 | |
| 706 | return; |
| 707 | } |
| 708 | |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 709 | /* |
| 710 | * lim_fill_sap_bcn_pkt_meta(): Fills essential fields in Rx Pkt Meta |
| 711 | * @scan_entry: pointer to the scan cache entry of the beacon |
| 712 | * @rx_pkt: pointer to the cds pkt allocated |
| 713 | * |
Jeff Johnson | 60ed45a | 2018-05-06 15:28:49 -0700 | [diff] [blame] | 714 | * This API fills only the essential parameters in the Rx Pkt Meta which are |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 715 | * required while converting the beacon frame to struct and while handling |
| 716 | * the beacon for implementation of SAP protection mechanisms. |
| 717 | * |
| 718 | * Return: None |
| 719 | */ |
| 720 | static void lim_fill_sap_bcn_pkt_meta(struct scan_cache_entry *scan_entry, |
| 721 | cds_pkt_t *rx_pkt) |
| 722 | { |
| 723 | rx_pkt->pkt_meta.channel = scan_entry->channel.chan_idx; |
| 724 | |
| 725 | rx_pkt->pkt_meta.mpdu_hdr_len = sizeof(struct ieee80211_frame); |
| 726 | rx_pkt->pkt_meta.mpdu_len = scan_entry->raw_frame.len; |
| 727 | rx_pkt->pkt_meta.mpdu_data_len = rx_pkt->pkt_meta.mpdu_len - |
| 728 | rx_pkt->pkt_meta.mpdu_hdr_len; |
| 729 | |
| 730 | rx_pkt->pkt_meta.mpdu_hdr_ptr = scan_entry->raw_frame.ptr; |
| 731 | rx_pkt->pkt_meta.mpdu_data_ptr = rx_pkt->pkt_meta.mpdu_hdr_ptr + |
| 732 | rx_pkt->pkt_meta.mpdu_hdr_len; |
| 733 | |
| 734 | /* |
| 735 | * The scan_entry->raw_frame contains the qdf_nbuf->data from the SKB |
| 736 | * of the beacon. We set the rx_pkt->pkt_meta.mpdu_hdr_ptr to point |
| 737 | * to this memory directly. However we do not have the pointer to |
| 738 | * the SKB itself here which is usually is pointed by rx_pkt->pkt_buf. |
| 739 | * Also, we always get the pkt data using WMA_GET_RX_MPDU_DATA and |
| 740 | * dont actually use the pkt_buf. So setting this to NULL. |
| 741 | */ |
| 742 | rx_pkt->pkt_buf = NULL; |
| 743 | } |
| 744 | |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 745 | /* |
| 746 | * lim_allocate_and_get_bcn() - Allocate and get the bcn frame pkt and structure |
| 747 | * @mac_ctx: pointer to global mac_ctx |
| 748 | * @pkt: pointer to the pkt to be allocated |
| 749 | * @rx_pkt_info: pointer to the allocated pkt meta |
| 750 | * @bcn: pointer to the beacon struct |
| 751 | * @scan_entry: pointer to the scan cache entry from scan module |
| 752 | * |
| 753 | * Allocates a cds_pkt for beacon frame in scan cache entry, |
| 754 | * fills the essential pkt_meta elements and converts the |
| 755 | * pkt to beacon strcut. |
| 756 | * |
| 757 | * Return: QDF_STATUS |
| 758 | */ |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 759 | static QDF_STATUS lim_allocate_and_get_bcn( |
| 760 | tpAniSirGlobal mac_ctx, |
| 761 | cds_pkt_t **pkt, |
| 762 | uint8_t **rx_pkt_info, |
| 763 | tSchBeaconStruct **bcn, |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 764 | struct scan_cache_entry *scan_entry) |
| 765 | { |
| 766 | QDF_STATUS status; |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 767 | uint8_t *rx_pkt_info_l = NULL; |
| 768 | tSchBeaconStruct *bcn_l = NULL; |
| 769 | cds_pkt_t *pkt_l = NULL; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 770 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 771 | pkt_l = qdf_mem_malloc(sizeof(cds_pkt_t)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 772 | if (!pkt_l) |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 773 | return QDF_STATUS_E_FAILURE; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 774 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 775 | status = wma_ds_peek_rx_packet_info( |
| 776 | pkt_l, (void *)&rx_pkt_info_l, false); |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 777 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 778 | pe_err("Failed to get Rx Pkt meta"); |
| 779 | goto free; |
| 780 | } |
| 781 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 782 | bcn_l = qdf_mem_malloc(sizeof(tSchBeaconStruct)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 783 | if (!bcn_l) |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 784 | goto free; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 785 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 786 | lim_fill_sap_bcn_pkt_meta(scan_entry, pkt_l); |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 787 | |
| 788 | /* Convert the beacon frame into a structure */ |
| 789 | if (sir_convert_beacon_frame2_struct(mac_ctx, |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 790 | (uint8_t *)rx_pkt_info_l, |
| 791 | bcn_l) != QDF_STATUS_SUCCESS) { |
| 792 | pe_err("beacon parsing failed"); |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 793 | goto free; |
| 794 | } |
| 795 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 796 | *pkt = pkt_l; |
| 797 | *bcn = bcn_l; |
| 798 | *rx_pkt_info = rx_pkt_info_l; |
| 799 | |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 800 | return QDF_STATUS_SUCCESS; |
| 801 | |
| 802 | free: |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 803 | if (pkt_l) { |
| 804 | qdf_mem_free(pkt_l); |
| 805 | pkt_l = NULL; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 806 | } |
| 807 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 808 | if (bcn_l) { |
| 809 | qdf_mem_free(bcn_l); |
| 810 | bcn_l = NULL; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | return QDF_STATUS_E_FAILURE; |
| 814 | } |
| 815 | |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 816 | void lim_handle_sap_beacon(struct wlan_objmgr_pdev *pdev, |
| 817 | struct scan_cache_entry *scan_entry) |
| 818 | { |
| 819 | tpAniSirGlobal mac_ctx; |
| 820 | cds_pkt_t *pkt = NULL; |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 821 | tSchBeaconStruct *bcn = NULL; |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 822 | struct mgmt_beacon_probe_filter *filter; |
| 823 | QDF_STATUS status; |
| 824 | uint8_t *rx_pkt_info = NULL; |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 825 | int session_id; |
| 826 | |
| 827 | if (!scan_entry) { |
| 828 | pe_err("scan_entry is NULL"); |
| 829 | return; |
| 830 | } |
| 831 | |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 832 | if (scan_entry->frm_subtype != MGMT_SUBTYPE_BEACON) |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 833 | return; |
| 834 | |
| 835 | mac_ctx = cds_get_context(QDF_MODULE_ID_PE); |
| 836 | if (!mac_ctx) { |
| 837 | pe_err("Failed to get mac_ctx"); |
| 838 | return; |
| 839 | } |
| 840 | |
| 841 | filter = &mac_ctx->bcn_filter; |
| 842 | |
| 843 | if (!filter->num_sap_sessions) { |
| 844 | return; |
| 845 | } |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 846 | for (session_id = 0; session_id < mac_ctx->lim.maxBssId; session_id++) { |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 847 | if (filter->sap_channel[session_id] && |
| 848 | (filter->sap_channel[session_id] == |
| 849 | scan_entry->channel.chan_idx)) { |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 850 | if (!pkt) { |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 851 | status = lim_allocate_and_get_bcn( |
| 852 | mac_ctx, &pkt, &rx_pkt_info, |
| 853 | &bcn, scan_entry); |
| 854 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 855 | pe_debug("lim_allocate_and_get_bcn fail!"); |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 856 | return; |
Liangwei Dong | 4bfffb4 | 2018-07-27 03:34:27 -0400 | [diff] [blame] | 857 | } |
Vignesh Viswanathan | 5ce817e | 2018-04-16 20:09:11 +0530 | [diff] [blame] | 858 | } |
| 859 | sch_beacon_process_for_ap(mac_ctx, session_id, |
| 860 | rx_pkt_info, bcn); |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 861 | } |
| 862 | } |
| 863 | |
Vignesh Viswanathan | 153ae93 | 2018-04-11 14:24:13 +0530 | [diff] [blame] | 864 | /* |
| 865 | * Free only the pkt memory we allocated and not the pkt->pkt_buf. |
| 866 | * The actual SKB buffer is freed in the scan module from where |
| 867 | * this API is invoked via callback |
| 868 | */ |
| 869 | if (bcn) |
| 870 | qdf_mem_free(bcn); |
| 871 | if (pkt) |
| 872 | qdf_mem_free(pkt); |
| 873 | } |
| 874 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 875 | /** |
| 876 | * lim_defer_msg() |
| 877 | * |
| 878 | ***FUNCTION: |
| 879 | * This function is called to defer the messages received |
| 880 | * during Learn mode |
| 881 | * |
| 882 | ***LOGIC: |
| 883 | * NA |
| 884 | * |
| 885 | ***ASSUMPTIONS: |
| 886 | * NA |
| 887 | * |
| 888 | ***NOTE: |
| 889 | * NA |
| 890 | * |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 891 | * @param mac - Pointer to Global MAC structure |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 892 | * @param pMsg of type struct scheduler_msg - Pointer to the message structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 893 | * @return None |
| 894 | */ |
| 895 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 896 | uint32_t lim_defer_msg(tpAniSirGlobal mac, struct scheduler_msg *pMsg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 897 | { |
| 898 | uint32_t retCode = TX_SUCCESS; |
| 899 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 900 | retCode = lim_write_deferred_msg_q(mac, pMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 901 | |
| 902 | if (retCode == TX_SUCCESS) { |
| 903 | MTRACE(mac_trace_msg_rx |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 904 | (mac, NO_SESSION, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 905 | LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED))); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 906 | } else { |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 907 | pe_err("Dropped lim message (0x%X) Message %s", pMsg->type, lim_msg_str(pMsg->type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 908 | MTRACE(mac_trace_msg_rx |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 909 | (mac, NO_SESSION, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 910 | LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED))); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 911 | } |
| 912 | |
| 913 | return retCode; |
| 914 | } /*** end lim_defer_msg() ***/ |
| 915 | |
| 916 | /** |
| 917 | * lim_handle_unknown_a2_index_frames() - This function handles Unknown Unicast |
| 918 | * (A2 Index) packets |
| 919 | * @mac_ctx: Pointer to the Global Mac Context. |
| 920 | * @rx_pkt_buffer: Pointer to the packet Buffer descriptor. |
| 921 | * @session_entry: Pointer to the PE Session Entry. |
| 922 | * |
| 923 | * This routine will handle public action frames. |
| 924 | * |
| 925 | * Return: None. |
| 926 | */ |
| 927 | static void lim_handle_unknown_a2_index_frames(tpAniSirGlobal mac_ctx, |
| 928 | void *rx_pkt_buffer, tpPESession session_entry) |
| 929 | { |
| 930 | #ifdef FEATURE_WLAN_TDLS |
| 931 | tpSirMacDataHdr3a mac_hdr; |
| 932 | #endif |
| 933 | if (LIM_IS_P2P_DEVICE_ROLE(session_entry)) |
| 934 | lim_process_action_frame_no_session(mac_ctx, |
| 935 | (uint8_t *) rx_pkt_buffer); |
| 936 | #ifdef FEATURE_WLAN_TDLS |
| 937 | mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer); |
| 938 | |
| 939 | if (lim_is_group_addr(mac_hdr->addr2)) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 940 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 941 | FL("Ignoring A2 Invalid Packet received for MC/BC:")); |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 942 | lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 943 | return; |
| 944 | } |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 945 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 946 | FL("type=0x%x, subtype=0x%x"), |
| 947 | mac_hdr->fc.type, mac_hdr->fc.subType); |
| 948 | /* Currently only following type and subtype are handled. |
| 949 | * If there are more combinations, then add switch-case |
| 950 | * statements. |
| 951 | */ |
| 952 | if (LIM_IS_STA_ROLE(session_entry) && |
| 953 | (mac_hdr->fc.type == SIR_MAC_MGMT_FRAME) && |
| 954 | (mac_hdr->fc.subType == SIR_MAC_MGMT_ACTION)) |
| 955 | lim_process_action_frame(mac_ctx, rx_pkt_buffer, session_entry); |
| 956 | #endif |
| 957 | return; |
| 958 | } |
| 959 | |
| 960 | /** |
| 961 | * lim_check_mgmt_registered_frames() - This function handles registered |
| 962 | * management frames. |
| 963 | * |
| 964 | * @mac_ctx: Pointer to the Global Mac Context. |
| 965 | * @buff_desc: Pointer to the packet Buffer descriptor. |
| 966 | * @session_entry: Pointer to the PE Session Entry. |
| 967 | * |
| 968 | * This function is called to process to check if received frame match with |
| 969 | * any of the registered frame from HDD. If yes pass this frame to SME. |
| 970 | * |
| 971 | * Return: True or False for Match or Mismatch respectively. |
| 972 | */ |
| 973 | static bool |
| 974 | lim_check_mgmt_registered_frames(tpAniSirGlobal mac_ctx, uint8_t *buff_desc, |
| 975 | tpPESession session_entry) |
| 976 | { |
| 977 | tSirMacFrameCtl fc; |
| 978 | tpSirMacMgmtHdr hdr; |
| 979 | uint8_t *body; |
| 980 | struct mgmt_frm_reg_info *mgmt_frame = NULL; |
| 981 | struct mgmt_frm_reg_info *next_frm = NULL; |
| 982 | uint16_t frm_type; |
| 983 | uint16_t frm_len; |
| 984 | uint8_t type, sub_type; |
| 985 | bool match = false; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 986 | QDF_STATUS qdf_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 987 | |
| 988 | hdr = WMA_GET_RX_MAC_HEADER(buff_desc); |
| 989 | fc = hdr->fc; |
| 990 | frm_type = (fc.type << 2) | (fc.subType << 4); |
| 991 | body = WMA_GET_RX_MPDU_DATA(buff_desc); |
| 992 | frm_len = WMA_GET_RX_PAYLOAD_LEN(buff_desc); |
| 993 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 994 | qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock); |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 995 | qdf_list_peek_front(&mac_ctx->lim.gLimMgmtFrameRegistratinQueue, |
| 996 | (qdf_list_node_t **) &mgmt_frame); |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 997 | qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 998 | |
| 999 | while (mgmt_frame != NULL) { |
| 1000 | type = (mgmt_frame->frameType >> 2) & 0x03; |
| 1001 | sub_type = (mgmt_frame->frameType >> 4) & 0x0f; |
| 1002 | if ((type == SIR_MAC_MGMT_FRAME) |
| 1003 | && (fc.type == SIR_MAC_MGMT_FRAME) |
| 1004 | && (sub_type == SIR_MAC_MGMT_RESERVED15)) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1005 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1006 | FL |
| 1007 | ("rcvd frm match for SIR_MAC_MGMT_RESERVED15")); |
| 1008 | match = true; |
| 1009 | break; |
| 1010 | } |
| 1011 | if (mgmt_frame->frameType == frm_type) { |
| 1012 | if (mgmt_frame->matchLen <= 0) { |
| 1013 | match = true; |
| 1014 | break; |
| 1015 | } |
| 1016 | if (mgmt_frame->matchLen <= frm_len && |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1017 | (!qdf_mem_cmp(mgmt_frame->matchData, body, |
| 1018 | mgmt_frame->matchLen))) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1019 | /* found match! */ |
| 1020 | match = true; |
| 1021 | break; |
| 1022 | } |
| 1023 | } |
| 1024 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1025 | qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock); |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1026 | qdf_status = |
| 1027 | qdf_list_peek_next( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1028 | &mac_ctx->lim.gLimMgmtFrameRegistratinQueue, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1029 | (qdf_list_node_t *) mgmt_frame, |
| 1030 | (qdf_list_node_t **) &next_frm); |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1031 | qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1032 | mgmt_frame = next_frm; |
| 1033 | next_frm = NULL; |
| 1034 | } |
| 1035 | |
| 1036 | if (match) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1037 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1038 | FL("rcvd frame match with registered frame params")); |
| 1039 | /* Indicate this to SME */ |
| 1040 | lim_send_sme_mgmt_frame_ind(mac_ctx, hdr->fc.subType, |
| 1041 | (uint8_t *) hdr, |
| 1042 | WMA_GET_RX_PAYLOAD_LEN(buff_desc) + |
| 1043 | sizeof(tSirMacMgmtHdr), mgmt_frame->sessionId, |
yeshwanth sriram guntuka | 2bc1435 | 2017-04-26 13:07:32 +0530 | [diff] [blame] | 1044 | WMA_GET_RX_CH(buff_desc), session_entry, |
| 1045 | WMA_GET_RX_RSSI_NORMALIZED(buff_desc)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1046 | |
| 1047 | if ((type == SIR_MAC_MGMT_FRAME) |
| 1048 | && (fc.type == SIR_MAC_MGMT_FRAME) |
| 1049 | && (sub_type == SIR_MAC_MGMT_RESERVED15)) |
| 1050 | /* These packets needs to be processed by PE/SME |
| 1051 | * as well as HDD.If it returns true here, |
| 1052 | * the packet is forwarded to HDD only. |
| 1053 | */ |
| 1054 | match = false; |
| 1055 | } |
| 1056 | |
| 1057 | return match; |
| 1058 | } |
| 1059 | |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 1060 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 1061 | /** |
| 1062 | * lim_is_mgmt_frame_loggable() - to log non-excessive mgmt frames |
| 1063 | * @type: type of frames i.e. mgmt, control, data |
| 1064 | * @subtype: subtype of frames i.e. beacon, probe rsp, probe req and etc |
| 1065 | * |
| 1066 | * This API tells if given mgmt frame is expected to come excessive in |
| 1067 | * amount or not. |
| 1068 | * |
| 1069 | * Return: true if mgmt is expected to come not that often, so makes it |
| 1070 | * loggable. false if mgmt is expected to come too often, so makes |
| 1071 | * it not loggable |
| 1072 | */ |
| 1073 | static bool |
| 1074 | lim_is_mgmt_frame_loggable(uint8_t type, uint8_t subtype) |
| 1075 | { |
| 1076 | if (type != SIR_MAC_MGMT_FRAME) |
| 1077 | return false; |
| 1078 | |
| 1079 | switch (subtype) { |
| 1080 | case SIR_MAC_MGMT_BEACON: |
| 1081 | case SIR_MAC_MGMT_PROBE_REQ: |
| 1082 | case SIR_MAC_MGMT_PROBE_RSP: |
| 1083 | return false; |
| 1084 | default: |
| 1085 | return true; |
| 1086 | } |
| 1087 | } |
| 1088 | #else |
| 1089 | static bool |
| 1090 | lim_is_mgmt_frame_loggable(uint8_t type, uint8_t subtype) |
| 1091 | { |
| 1092 | return false; |
| 1093 | } |
| 1094 | #endif |
| 1095 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1096 | /** |
| 1097 | * lim_handle80211_frames() |
| 1098 | * |
| 1099 | ***FUNCTION: |
| 1100 | * This function is called to process 802.11 frames |
| 1101 | * received by LIM. |
| 1102 | * |
| 1103 | ***LOGIC: |
| 1104 | * NA |
| 1105 | * |
| 1106 | ***ASSUMPTIONS: |
| 1107 | * NA |
| 1108 | * |
| 1109 | ***NOTE: |
| 1110 | * NA |
| 1111 | * |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1112 | * @param mac - Pointer to Global MAC structure |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 1113 | * @param pMsg of type struct scheduler_msg - Pointer to the message structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1114 | * @return None |
| 1115 | */ |
| 1116 | |
| 1117 | static void |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1118 | lim_handle80211_frames(tpAniSirGlobal mac, struct scheduler_msg *limMsg, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 1119 | uint8_t *pDeferMsg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1120 | { |
| 1121 | uint8_t *pRxPacketInfo = NULL; |
| 1122 | tSirMacFrameCtl fc; |
| 1123 | tpSirMacMgmtHdr pHdr = NULL; |
| 1124 | tpPESession psessionEntry = NULL; |
| 1125 | uint8_t sessionId; |
Srinivas Girigowda | 74a66d6 | 2017-06-21 23:28:25 -0700 | [diff] [blame] | 1126 | bool isFrmFt = false; |
Jingxiang Ge | 6c9352f | 2017-10-26 11:27:36 +0800 | [diff] [blame] | 1127 | uint8_t channel; |
| 1128 | bool is_hw_sbs_capable = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1129 | |
| 1130 | *pDeferMsg = false; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1131 | lim_get_b_dfrom_rx_packet(mac, limMsg->bodyptr, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1132 | (uint32_t **) &pRxPacketInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1133 | |
| 1134 | pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1135 | isFrmFt = WMA_GET_RX_FT_DONE(pRxPacketInfo); |
Jingxiang Ge | 6c9352f | 2017-10-26 11:27:36 +0800 | [diff] [blame] | 1136 | channel = WMA_GET_RX_CH(pRxPacketInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1137 | fc = pHdr->fc; |
| 1138 | |
Jingxiang Ge | 6c9352f | 2017-10-26 11:27:36 +0800 | [diff] [blame] | 1139 | is_hw_sbs_capable = |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1140 | policy_mgr_is_hw_sbs_capable(mac->psoc); |
Jingxiang Ge | 6c9352f | 2017-10-26 11:27:36 +0800 | [diff] [blame] | 1141 | if (IS_5G_CH(channel) && |
| 1142 | (!is_hw_sbs_capable || |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1143 | (is_hw_sbs_capable && wlan_reg_is_dfs_ch(mac->pdev, channel))) && |
| 1144 | mac->sap.SapDfsInfo.is_dfs_cac_timer_running) { |
| 1145 | psessionEntry = pe_find_session_by_bssid(mac, |
Krishna Kumaar Natarajan | b7f9a35 | 2016-03-18 11:40:07 -0700 | [diff] [blame] | 1146 | pHdr->bssId, &sessionId); |
| 1147 | if (psessionEntry && |
| 1148 | (QDF_SAP_MODE == psessionEntry->pePersona)) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1149 | pe_debug("CAC timer running - drop the frame"); |
Krishna Kumaar Natarajan | b7f9a35 | 2016-03-18 11:40:07 -0700 | [diff] [blame] | 1150 | goto end; |
| 1151 | } |
| 1152 | } |
| 1153 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1154 | #ifdef WLAN_DUMP_MGMTFRAMES |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1155 | pe_debug("ProtVersion %d, Type %d, Subtype %d rateIndex=%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1156 | fc.protVer, fc.type, fc.subType, |
| 1157 | WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1158 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, pHdr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | WMA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo)); |
| 1160 | #endif |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1161 | if (mac->mlme_cfg->gen.debug_packet_log & 0x1) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1162 | if ((fc.type == SIR_MAC_MGMT_FRAME) && |
| 1163 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) && |
| 1164 | (fc.subType != SIR_MAC_MGMT_PROBE_RSP) && |
| 1165 | (fc.subType != SIR_MAC_MGMT_BEACON)) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1166 | pe_debug("RX MGMT - Type %hu, SubType %hu, seq num[%d]", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1167 | fc.type, |
| 1168 | fc.subType, |
| 1169 | ((pHdr->seqControl.seqNumHi << |
| 1170 | HIGH_SEQ_NUM_OFFSET) | |
| 1171 | pHdr->seqControl.seqNumLo)); |
| 1172 | } |
| 1173 | } |
| 1174 | #ifdef FEATURE_WLAN_EXTSCAN |
| 1175 | if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo) || |
| 1176 | WMA_IS_EPNO_SCAN_SRC(pRxPacketInfo)) { |
| 1177 | if (fc.subType == SIR_MAC_MGMT_BEACON || |
| 1178 | fc.subType == SIR_MAC_MGMT_PROBE_RSP) { |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1179 | __lim_process_ext_scan_beacon_probe_rsp(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1180 | pRxPacketInfo, |
| 1181 | fc.subType); |
| 1182 | } else { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1183 | pe_err("Wrong frameType %d, Subtype %d for %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1184 | fc.type, fc.subType, |
| 1185 | WMA_GET_SCAN_SRC(pRxPacketInfo)); |
| 1186 | } |
| 1187 | goto end; |
| 1188 | } |
| 1189 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1190 | /* Added For BT-AMP Support */ |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1191 | psessionEntry = pe_find_session_by_bssid(mac, pHdr->bssId, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1192 | &sessionId); |
| 1193 | if (psessionEntry == NULL) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1194 | if (fc.subType == SIR_MAC_MGMT_AUTH) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1195 | pe_debug("ProtVersion %d, Type %d, Subtype %d rateIndex=%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1196 | fc.protVer, fc.type, fc.subType, |
| 1197 | WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1198 | lim_print_mac_addr(mac, pHdr->bssId, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1199 | if (lim_process_auth_frame_no_session |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1200 | (mac, pRxPacketInfo, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1201 | limMsg->bodyptr) == QDF_STATUS_SUCCESS) { |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1202 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1203 | } |
| 1204 | } |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1205 | /* Public action frame can be received from non-assoc stations*/ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1206 | if ((fc.subType != SIR_MAC_MGMT_PROBE_RSP) && |
| 1207 | (fc.subType != SIR_MAC_MGMT_BEACON) && |
| 1208 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1209 | && (fc.subType != SIR_MAC_MGMT_ACTION)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1210 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1211 | psessionEntry = pe_find_session_by_peer_sta(mac, |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1212 | pHdr->sa, &sessionId); |
| 1213 | if (psessionEntry == NULL) { |
Abhishek Singh | 154637a | 2017-06-19 18:02:11 +0530 | [diff] [blame] | 1214 | pe_debug("session does not exist for bssId"); |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1215 | lim_print_mac_addr(mac, pHdr->sa, LOGD); |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1216 | goto end; |
| 1217 | } else { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1218 | pe_debug("SessionId:%d exists for given Bssid", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1219 | psessionEntry->peSessionId); |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1220 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1221 | } |
| 1222 | /* For p2p resp frames search for valid session with DA as */ |
| 1223 | /* BSSID will be SA and session will be present with DA only */ |
| 1224 | if (fc.subType == SIR_MAC_MGMT_ACTION) { |
| 1225 | psessionEntry = |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1226 | pe_find_session_by_bssid(mac, pHdr->da, &sessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | /* Check if frame is registered by HDD */ |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1231 | if (lim_check_mgmt_registered_frames(mac, pRxPacketInfo, psessionEntry)) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1232 | pe_debug("Received frame is passed to SME"); |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1233 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1234 | } |
| 1235 | |
| 1236 | if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) { /* Received Frame with non-zero Protocol Version */ |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1237 | pe_err("Unexpected frame with protVersion %d received", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1238 | fc.protVer); |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1239 | lim_pkt_free(mac, TXRX_FRM_802_11_MGMT, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1240 | (void *)limMsg->bodyptr); |
| 1241 | #ifdef WLAN_DEBUG |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1242 | mac->lim.numProtErr++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1243 | #endif |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 1244 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1245 | } |
| 1246 | |
| 1247 | /* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */ |
| 1248 | |
| 1249 | #ifdef WLAN_DEBUG |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1250 | mac->lim.numMAC[fc.type][fc.subType]++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1251 | #endif |
| 1252 | |
| 1253 | switch (fc.type) { |
| 1254 | case SIR_MAC_MGMT_FRAME: |
| 1255 | { |
| 1256 | /* Received Management frame */ |
| 1257 | switch (fc.subType) { |
| 1258 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 1259 | /* Make sure the role supports Association */ |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 1260 | if (LIM_IS_AP_ROLE(psessionEntry)) |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1261 | lim_process_assoc_req_frame(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1262 | pRxPacketInfo, |
| 1263 | LIM_ASSOC, |
| 1264 | psessionEntry); |
| 1265 | else { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1266 | pe_err("unexpected message received %X", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1267 | limMsg->type); |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1268 | lim_print_msg_name(mac, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1269 | limMsg->type); |
| 1270 | } |
| 1271 | break; |
| 1272 | |
| 1273 | case SIR_MAC_MGMT_ASSOC_RSP: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1274 | lim_process_assoc_rsp_frame(mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1275 | LIM_ASSOC, |
| 1276 | psessionEntry); |
| 1277 | break; |
| 1278 | |
| 1279 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 1280 | /* Make sure the role supports Reassociation */ |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 1281 | if (LIM_IS_AP_ROLE(psessionEntry)) { |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1282 | lim_process_assoc_req_frame(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1283 | pRxPacketInfo, |
| 1284 | LIM_REASSOC, |
| 1285 | psessionEntry); |
| 1286 | } else { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1287 | pe_err("unexpected message received %X", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1288 | limMsg->type); |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1289 | lim_print_msg_name(mac, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1290 | limMsg->type); |
| 1291 | } |
| 1292 | break; |
| 1293 | |
| 1294 | case SIR_MAC_MGMT_REASSOC_RSP: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1295 | lim_process_assoc_rsp_frame(mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1296 | LIM_REASSOC, |
| 1297 | psessionEntry); |
| 1298 | break; |
| 1299 | |
| 1300 | case SIR_MAC_MGMT_PROBE_REQ: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1301 | lim_process_probe_req_frame_multiple_bss(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1302 | pRxPacketInfo, |
| 1303 | psessionEntry); |
| 1304 | break; |
| 1305 | |
| 1306 | case SIR_MAC_MGMT_PROBE_RSP: |
Abhishek Singh | 6f56d21 | 2017-04-12 14:31:57 +0530 | [diff] [blame] | 1307 | if (psessionEntry) |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1308 | lim_process_probe_rsp_frame(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1309 | pRxPacketInfo, |
| 1310 | psessionEntry); |
| 1311 | break; |
| 1312 | |
| 1313 | case SIR_MAC_MGMT_BEACON: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1314 | __lim_handle_beacon(mac, limMsg, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1315 | break; |
| 1316 | |
| 1317 | case SIR_MAC_MGMT_DISASSOC: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1318 | lim_process_disassoc_frame(mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1319 | psessionEntry); |
| 1320 | break; |
| 1321 | |
| 1322 | case SIR_MAC_MGMT_AUTH: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1323 | lim_process_auth_frame(mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1324 | psessionEntry); |
| 1325 | break; |
| 1326 | |
| 1327 | case SIR_MAC_MGMT_DEAUTH: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1328 | lim_process_deauth_frame(mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1329 | psessionEntry); |
| 1330 | break; |
| 1331 | |
| 1332 | case SIR_MAC_MGMT_ACTION: |
| 1333 | if (psessionEntry == NULL) |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1334 | lim_process_action_frame_no_session(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1335 | pRxPacketInfo); |
| 1336 | else { |
| 1337 | if (WMA_GET_RX_UNKNOWN_UCAST |
| 1338 | (pRxPacketInfo)) |
| 1339 | lim_handle_unknown_a2_index_frames |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1340 | (mac, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1341 | psessionEntry); |
| 1342 | else |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1343 | lim_process_action_frame(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1344 | pRxPacketInfo, |
| 1345 | psessionEntry); |
| 1346 | } |
| 1347 | break; |
| 1348 | default: |
| 1349 | /* Received Management frame of 'reserved' subtype */ |
| 1350 | break; |
| 1351 | } /* switch (fc.subType) */ |
| 1352 | |
| 1353 | } |
| 1354 | break; |
| 1355 | case SIR_MAC_DATA_FRAME: |
| 1356 | { |
| 1357 | } |
| 1358 | break; |
| 1359 | default: |
| 1360 | /* Received frame of type 'reserved' */ |
| 1361 | break; |
| 1362 | |
| 1363 | } /* switch (fc.type) */ |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 1364 | if (lim_is_mgmt_frame_loggable(fc.type, fc.subType)) |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1365 | lim_diag_mgmt_rx_event_report(mac, pHdr, |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 1366 | psessionEntry, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1367 | QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1368 | end: |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 1369 | lim_pkt_free(mac, TXRX_FRM_802_11_MGMT, pRxPacketInfo, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1370 | (void *)limMsg->bodyptr); |
| 1371 | return; |
| 1372 | } /*** end lim_handle80211_frames() ***/ |
| 1373 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1374 | void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx, |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1375 | uint8_t vdev_id, uint32_t scan_id, uint32_t scan_requestor_id) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1376 | { |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1377 | QDF_STATUS status; |
| 1378 | struct scan_cancel_request *req; |
| 1379 | struct wlan_objmgr_vdev *vdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1380 | |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1381 | pe_debug("scan_id %d, scan_requestor_id 0x%x", |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1382 | scan_id, scan_requestor_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1383 | |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1384 | vdev = wlan_objmgr_get_vdev_by_id_from_psoc( |
| 1385 | mac_ctx->psoc, vdev_id, |
| 1386 | WLAN_LEGACY_MAC_ID); |
| 1387 | if (!vdev) { |
| 1388 | pe_debug("vdev is NULL"); |
| 1389 | return; |
| 1390 | } |
| 1391 | |
| 1392 | req = qdf_mem_malloc(sizeof(*req)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1393 | if (!req) |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1394 | goto fail; |
Abhishek Singh | 9fabbbb | 2018-01-29 17:38:36 +0530 | [diff] [blame] | 1395 | |
| 1396 | req->vdev = vdev; |
| 1397 | req->cancel_req.requester = scan_requestor_id; |
| 1398 | req->cancel_req.scan_id = scan_id; |
| 1399 | req->cancel_req.vdev_id = vdev_id; |
| 1400 | req->cancel_req.req_type = WLAN_SCAN_CANCEL_SINGLE; |
| 1401 | |
| 1402 | status = ucfg_scan_cancel(req); |
| 1403 | if (QDF_IS_STATUS_ERROR(status)) |
| 1404 | pe_err("Cancel scan request failed"); |
| 1405 | |
| 1406 | fail: |
| 1407 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1408 | } |
| 1409 | |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1410 | static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 1411 | struct scheduler_msg *msg) |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1412 | { |
Jeff Johnson | 0f99bd8 | 2018-11-18 18:42:12 -0800 | [diff] [blame] | 1413 | struct pe_session *session; |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1414 | uint8_t session_id; |
| 1415 | struct sme_obss_ht40_scanind_msg *ht40_scanind; |
| 1416 | |
| 1417 | ht40_scanind = (struct sme_obss_ht40_scanind_msg *)msg->bodyptr; |
| 1418 | session = pe_find_session_by_bssid(mac_ctx, |
| 1419 | ht40_scanind->mac_addr.bytes, &session_id); |
| 1420 | if (session == NULL) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1421 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1422 | "OBSS Scan not started: session id is NULL"); |
| 1423 | return; |
| 1424 | } |
| 1425 | if (session->htSupportedChannelWidthSet == |
| 1426 | WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1427 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1428 | "OBSS Scan Start Req: session id %d" |
| 1429 | "htSupportedChannelWidthSet %d", |
| 1430 | session->peSessionId, |
| 1431 | session->htSupportedChannelWidthSet); |
| 1432 | lim_send_ht40_obss_scanind(mac_ctx, session); |
| 1433 | } else { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1434 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1435 | "OBSS Scan not started: channel width - %d session %d", |
| 1436 | session->htSupportedChannelWidthSet, |
| 1437 | session->peSessionId); |
| 1438 | } |
| 1439 | return; |
| 1440 | } |
| 1441 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1442 | /** |
| 1443 | * lim_process_messages() - Process messages from upper layers. |
| 1444 | * |
Ankit Gupta | fef4c02 | 2016-09-26 12:11:30 -0700 | [diff] [blame] | 1445 | * @mac_ctx: Pointer to the Global Mac Context. |
| 1446 | * @msg: Received message. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1447 | * |
| 1448 | * Return: None. |
| 1449 | */ |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 1450 | static void lim_process_messages(tpAniSirGlobal mac_ctx, |
| 1451 | struct scheduler_msg *msg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1452 | { |
| 1453 | #ifdef FEATURE_AP_MCC_CH_AVOIDANCE |
| 1454 | uint8_t vdev_id = 0; |
| 1455 | tUpdateBeaconParams beacon_params; |
| 1456 | #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ |
| 1457 | uint8_t i; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1458 | tpPESession session_entry = NULL; |
| 1459 | uint8_t defer_msg = false; |
| 1460 | tLinkStateParams *link_state_param; |
| 1461 | uint16_t pkt_len = 0; |
| 1462 | cds_pkt_t *body_ptr = NULL; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1463 | QDF_STATUS qdf_status; |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 1464 | struct scheduler_msg new_msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1465 | uint8_t session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1466 | |
| 1467 | #ifdef FEATURE_WLAN_TDLS |
| 1468 | tSirTdlsInd *tdls_ind = NULL; |
| 1469 | tpDphHashNode sta_ds = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1470 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1471 | if (msg == NULL) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1472 | pe_err("Message pointer is Null"); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1473 | QDF_ASSERT(0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1474 | return; |
| 1475 | } |
Pragaspathi Thilagaraj | b4b7aae | 2018-05-22 18:28:17 +0530 | [diff] [blame] | 1476 | |
| 1477 | if (ANI_DRIVER_TYPE(mac_ctx) == QDF_DRIVER_TYPE_MFG) { |
| 1478 | qdf_mem_free(msg->bodyptr); |
| 1479 | msg->bodyptr = NULL; |
| 1480 | return; |
| 1481 | } |
| 1482 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1483 | #ifdef WLAN_DEBUG |
| 1484 | mac_ctx->lim.numTot++; |
| 1485 | #endif |
Sreelakshmi Konamki | 544e33b | 2016-08-17 15:08:48 +0530 | [diff] [blame] | 1486 | /* |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1487 | * MTRACE logs not captured for events received from SME |
| 1488 | * SME enums (eWNI_SME_START_REQ) starts with 0x16xx. |
| 1489 | * Compare received SME events with SIR_SME_MODULE_ID |
Sreelakshmi Konamki | 544e33b | 2016-08-17 15:08:48 +0530 | [diff] [blame] | 1490 | */ |
Sreelakshmi Konamki | 075431a | 2017-03-16 15:23:30 +0530 | [diff] [blame] | 1491 | if ((SIR_SME_MODULE_ID == |
| 1492 | (uint8_t)MAC_TRACE_GET_MODULE_ID(msg->type)) && |
| 1493 | (msg->type != eWNI_SME_REGISTER_MGMT_FRAME_REQ)) { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1494 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_RX_SME_MSG, |
| 1495 | NO_SESSION, msg->type)); |
| 1496 | } else { |
| 1497 | /* |
| 1498 | * Omitting below message types as these are too frequent |
| 1499 | * and when crash happens we loose critical trace logs |
| 1500 | * if these are also logged |
| 1501 | */ |
| 1502 | if (msg->type != SIR_CFG_PARAM_UPDATE_IND && |
Sreelakshmi Konamki | 075431a | 2017-03-16 15:23:30 +0530 | [diff] [blame] | 1503 | msg->type != SIR_BB_XPORT_MGMT_MSG && |
| 1504 | msg->type != WMA_RX_SCAN_EVENT) |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1505 | MTRACE(mac_trace_msg_rx(mac_ctx, NO_SESSION, |
| 1506 | LIM_TRACE_MAKE_RXMSG(msg->type, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 1507 | LIM_MSG_PROCESSED))); |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1508 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1509 | |
| 1510 | switch (msg->type) { |
| 1511 | |
| 1512 | case SIR_LIM_UPDATE_BEACON: |
| 1513 | lim_update_beacon(mac_ctx); |
| 1514 | break; |
| 1515 | case SIR_CFG_PARAM_UPDATE_IND: |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 1516 | if (!lim_is_system_in_scan_state(mac_ctx)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1517 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1518 | /* System is in DFS (Learn) mode. |
Jeff Johnson | 47d7524 | 2018-05-12 15:58:53 -0700 | [diff] [blame] | 1519 | * Defer processing this message |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1520 | */ |
| 1521 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
| 1522 | if (!(mac_ctx->lim.deferredMsgCnt & 0xF)) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1523 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1524 | FL("Unable to Defer Msg")); |
| 1525 | lim_log_session_states(mac_ctx); |
| 1526 | lim_print_msg_name(mac_ctx, LOGE, msg->type); |
| 1527 | } |
| 1528 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1529 | case WMA_SWITCH_CHANNEL_RSP: |
| 1530 | lim_process_switch_channel_rsp(mac_ctx, msg->bodyptr); |
| 1531 | msg->bodyptr = NULL; |
| 1532 | break; |
| 1533 | #ifdef ANI_SIR_IBSS_PEER_CACHING |
| 1534 | case WMA_IBSS_STA_ADD: |
| 1535 | lim_ibss_sta_add(mac_ctx, msg->bodyptr); |
| 1536 | break; |
| 1537 | #endif |
| 1538 | case SIR_BB_XPORT_MGMT_MSG: |
| 1539 | /* These messages are from Peer MAC entity. */ |
| 1540 | #ifdef WLAN_DEBUG |
| 1541 | mac_ctx->lim.numBbt++; |
| 1542 | #endif |
| 1543 | /* The original msg which we were deferring have the |
| 1544 | * bodyPointer point to 'BD' instead of 'cds pkt'. If we |
| 1545 | * don't make a copy of msg, then overwrite the |
| 1546 | * msg->bodyPointer and next time when we try to |
| 1547 | * process the msg, we will try to use 'BD' as |
| 1548 | * 'cds Pkt' which will cause a crash |
| 1549 | */ |
| 1550 | if (msg->bodyptr == NULL) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1551 | pe_err("Message bodyptr is Null"); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1552 | QDF_ASSERT(0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1553 | break; |
| 1554 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1555 | qdf_mem_copy((uint8_t *) &new_msg, |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 1556 | (uint8_t *) msg, sizeof(struct scheduler_msg)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1557 | body_ptr = (cds_pkt_t *) new_msg.bodyptr; |
| 1558 | cds_pkt_get_packet_length(body_ptr, &pkt_len); |
| 1559 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1560 | qdf_status = wma_ds_peek_rx_packet_info(body_ptr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1561 | (void **) &new_msg.bodyptr, false); |
| 1562 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1563 | if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1564 | lim_decrement_pending_mgmt_count(mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1565 | cds_pkt_return_packet(body_ptr); |
| 1566 | break; |
| 1567 | } |
Abhinav Kumar | 5670d36 | 2018-01-16 17:31:54 +0530 | [diff] [blame] | 1568 | if (WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr)) |
| 1569 | pe_debug("roamCandidateInd: %d", |
| 1570 | WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr)); |
| 1571 | if (WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr)) |
| 1572 | pe_debug("offloadScanLearn: %d", |
| 1573 | WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1574 | |
| 1575 | lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg); |
| 1576 | |
| 1577 | if (defer_msg == true) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1578 | QDF_TRACE(QDF_MODULE_ID_PE, LOGD, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1579 | FL("Defer Msg type=%x"), msg->type); |
| 1580 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1581 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1582 | FL("Unable to Defer Msg")); |
| 1583 | lim_log_session_states(mac_ctx); |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1584 | lim_decrement_pending_mgmt_count(mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1585 | cds_pkt_return_packet(body_ptr); |
| 1586 | } |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1587 | } else { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1588 | /* PE is not deferring this 802.11 frame so we need to |
| 1589 | * call cds_pkt_return. Asumption here is when Rx mgmt |
| 1590 | * frame processing is done, cds packet could be |
| 1591 | * freed here. |
| 1592 | */ |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1593 | lim_decrement_pending_mgmt_count(mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1594 | cds_pkt_return_packet(body_ptr); |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1595 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1596 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1597 | case eWNI_SME_DISASSOC_REQ: |
| 1598 | case eWNI_SME_DEAUTH_REQ: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1599 | #ifdef FEATURE_WLAN_TDLS |
| 1600 | case eWNI_SME_TDLS_SEND_MGMT_REQ: |
| 1601 | case eWNI_SME_TDLS_ADD_STA_REQ: |
| 1602 | case eWNI_SME_TDLS_DEL_STA_REQ: |
| 1603 | case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: |
| 1604 | #endif |
| 1605 | case eWNI_SME_RESET_AP_CAPS_CHANGED: |
| 1606 | case eWNI_SME_SET_HW_MODE_REQ: |
| 1607 | case eWNI_SME_SET_DUAL_MAC_CFG_REQ: |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 1608 | case eWNI_SME_SET_ANTENNA_MODE_REQ: |
Kondabattini, Ganesh | e4f18e0 | 2016-09-13 13:01:22 +0530 | [diff] [blame] | 1609 | case eWNI_SME_UPDATE_ACCESS_POLICY_VENDOR_IE: |
Naveen Rawat | 8029a40 | 2017-06-01 10:54:19 -0700 | [diff] [blame] | 1610 | case eWNI_SME_UPDATE_CONFIG: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1611 | /* These messages are from HDD. Need to respond to HDD */ |
| 1612 | lim_process_normal_hdd_msg(mac_ctx, msg, true); |
| 1613 | break; |
Kondabattini, Ganesh | 3f2d02c | 2016-09-13 12:23:47 +0530 | [diff] [blame] | 1614 | case eWNI_SME_SEND_DISASSOC_FRAME: |
| 1615 | /* Need to response to hdd */ |
| 1616 | lim_process_normal_hdd_msg(mac_ctx, msg, true); |
| 1617 | break; |
Kiran Kumar Lokere | 666bf85 | 2016-05-02 12:23:02 -0700 | [diff] [blame] | 1618 | case eWNI_SME_PDEV_SET_HT_VHT_IE: |
Naveen Rawat | a410c5a | 2016-09-19 14:22:33 -0700 | [diff] [blame] | 1619 | case eWNI_SME_SET_VDEV_IES_PER_BAND: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1620 | case eWNI_SME_SYS_READY_IND: |
| 1621 | case eWNI_SME_JOIN_REQ: |
| 1622 | case eWNI_SME_REASSOC_REQ: |
| 1623 | case eWNI_SME_START_BSS_REQ: |
| 1624 | case eWNI_SME_STOP_BSS_REQ: |
| 1625 | case eWNI_SME_SWITCH_CHL_IND: |
| 1626 | case eWNI_SME_SETCONTEXT_REQ: |
| 1627 | case eWNI_SME_DISASSOC_CNF: |
| 1628 | case eWNI_SME_DEAUTH_CNF: |
| 1629 | case eWNI_SME_ASSOC_CNF: |
| 1630 | case eWNI_SME_ADDTS_REQ: |
| 1631 | case eWNI_SME_DELTS_REQ: |
| 1632 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
Selvaraj, Sridhar | 7231c5f | 2016-09-28 12:42:33 +0530 | [diff] [blame] | 1633 | case eWNI_SME_SESSION_UPDATE_PARAM: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1634 | case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1635 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 1636 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1637 | #if defined FEATURE_WLAN_ESE |
| 1638 | case eWNI_SME_ESE_ADJACENT_AP_REPORT: |
| 1639 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1640 | case eWNI_SME_FT_UPDATE_KEY: |
| 1641 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 1642 | case eWNI_SME_FT_AGGR_QOS_REQ: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1643 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1644 | case eWNI_SME_CLEAR_DFS_CHANNEL_LIST: |
| 1645 | case eWNI_SME_GET_STATISTICS_REQ: |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1646 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1647 | case eWNI_SME_GET_TSM_STATS_REQ: |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1648 | #endif /* FEATURE_WLAN_ESE */ |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 1649 | case eWNI_SME_REGISTER_MGMT_FRAME_CB: |
Abhishek Singh | 518323d | 2015-10-19 17:42:01 +0530 | [diff] [blame] | 1650 | case eWNI_SME_EXT_CHANGE_CHANNEL: |
Paul Zhang | 624f88d | 2018-11-07 15:29:45 +0800 | [diff] [blame] | 1651 | case eWNI_SME_ROAM_INVOKE: |
| 1652 | /* fall through */ |
Selvaraj, Sridhar | 0174182 | 2016-08-30 18:26:19 +0530 | [diff] [blame] | 1653 | case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ: |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 1654 | case eWNI_SME_SET_ADDBA_ACCEPT: |
Arif Hussain | eb8ba36 | 2018-03-07 19:15:13 -0800 | [diff] [blame] | 1655 | case eWNI_SME_UPDATE_EDCA_PROFILE: |
Kiran Kumar Lokere | 1dbf722 | 2018-09-20 19:46:56 -0700 | [diff] [blame] | 1656 | case WNI_SME_UPDATE_MU_EDCA_PARAMS: |
Kiran Kumar Lokere | ee20577 | 2018-09-27 00:27:27 -0700 | [diff] [blame] | 1657 | case WNI_SME_CFG_ACTION_FRM_HE_TB_PPDU: |
Deepak Dhamdhere | 0f076bd | 2016-06-02 11:29:21 -0700 | [diff] [blame] | 1658 | /* These messages are from HDD.No need to respond to HDD */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1659 | lim_process_normal_hdd_msg(mac_ctx, msg, false); |
| 1660 | break; |
Padma, Santhosh Kumar | 22c462c | 2018-01-16 17:56:44 +0530 | [diff] [blame] | 1661 | case eWNI_SME_SEND_MGMT_FRAME_TX: |
| 1662 | lim_send_mgmt_frame_tx(mac_ctx, msg); |
| 1663 | qdf_mem_free(msg->bodyptr); |
| 1664 | msg->bodyptr = NULL; |
| 1665 | break; |
Manjunathappa Prakash | 0e6e6b5 | 2016-04-21 11:48:48 -0700 | [diff] [blame] | 1666 | case eWNI_SME_MON_INIT_SESSION: |
| 1667 | lim_mon_init_session(mac_ctx, msg->bodyptr); |
| 1668 | qdf_mem_free(msg->bodyptr); |
| 1669 | msg->bodyptr = NULL; |
| 1670 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1671 | #ifdef FEATURE_WLAN_TDLS |
| 1672 | case SIR_HAL_TDLS_IND: |
| 1673 | tdls_ind = (tpSirTdlsInd) msg->bodyptr; |
| 1674 | session_entry = pe_find_session_by_sta_id(mac_ctx, |
| 1675 | tdls_ind->staIdx, &session_id); |
| 1676 | if (session_entry == NULL) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 1677 | pe_debug("No session exist for given bssId"); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1678 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1679 | msg->bodyptr = NULL; |
| 1680 | return; |
| 1681 | } |
| 1682 | sta_ds = dph_get_hash_entry(mac_ctx, tdls_ind->assocId, |
| 1683 | &session_entry->dph.dphHashTable); |
| 1684 | if (sta_ds == NULL) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1685 | pe_debug("No sta_ds exist for given staId"); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1686 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1687 | msg->bodyptr = NULL; |
| 1688 | return; |
| 1689 | } |
| 1690 | |
| 1691 | if (STA_ENTRY_TDLS_PEER == sta_ds->staType) { |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1692 | pe_err("rcvd TDLS IND from FW with RC %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1693 | tdls_ind->reasonCode); |
| 1694 | lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds, |
| 1695 | session_entry, tdls_ind->reasonCode); |
| 1696 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1697 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1698 | msg->bodyptr = NULL; |
| 1699 | break; |
| 1700 | #endif |
| 1701 | case SIR_HAL_P2P_NOA_ATTR_IND: |
| 1702 | session_entry = &mac_ctx->lim.gpSession[0]; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1703 | pe_debug("Received message Noa_ATTR %x", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1704 | msg->type); |
| 1705 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 1706 | session_entry = &mac_ctx->lim.gpSession[i]; |
| 1707 | if ((session_entry != NULL) && (session_entry->valid) |
| 1708 | && (session_entry->pePersona == |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1709 | QDF_P2P_GO_MODE)) { /* Save P2P attr for Go */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1710 | qdf_mem_copy( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1711 | &session_entry->p2pGoPsUpdate, |
| 1712 | msg->bodyptr, |
| 1713 | sizeof(tSirP2PNoaAttr)); |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1714 | pe_debug("bssId" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1715 | MAC_ADDRESS_STR |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1716 | " ctWin=%d oppPsFlag=%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1717 | MAC_ADDR_ARRAY( |
| 1718 | session_entry->bssId), |
| 1719 | session_entry->p2pGoPsUpdate.ctWin, |
| 1720 | session_entry->p2pGoPsUpdate.oppPsFlag); |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1721 | pe_debug("uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1722 | session_entry->p2pGoPsUpdate.uNoa1IntervalCnt, |
| 1723 | session_entry->p2pGoPsUpdate.uNoa1Duration, |
| 1724 | session_entry->p2pGoPsUpdate.uNoa1Interval, |
| 1725 | session_entry->p2pGoPsUpdate.uNoa1StartTime); |
| 1726 | break; |
| 1727 | } |
| 1728 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1729 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1730 | msg->bodyptr = NULL; |
| 1731 | break; |
| 1732 | case WMA_MISSED_BEACON_IND: |
| 1733 | lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1734 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1735 | msg->bodyptr = NULL; |
| 1736 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1737 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
| 1738 | lim_process_sme_req_messages(mac_ctx, msg); |
| 1739 | break; |
| 1740 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1741 | case WMA_TSM_STATS_RSP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1742 | lim_send_sme_pe_ese_tsm_rsp(mac_ctx, |
| 1743 | (tAniGetTsmStatsRsp *) msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1744 | break; |
| 1745 | #endif |
| 1746 | case WMA_ADD_TS_RSP: |
| 1747 | lim_process_hal_add_ts_rsp(mac_ctx, msg); |
| 1748 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1749 | case SIR_LIM_BEACON_GEN_IND: |
| 1750 | if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE) |
Abhishek Singh | fc740be | 2018-10-12 11:34:26 +0530 | [diff] [blame] | 1751 | sch_process_pre_beacon_ind(mac_ctx, |
| 1752 | msg, REASON_DEFAULT); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1753 | break; |
| 1754 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 1755 | lim_delete_sta_context(mac_ctx, msg); |
| 1756 | break; |
Jinwei Chen | 1850d9c | 2018-08-20 15:59:06 +0800 | [diff] [blame] | 1757 | case SIR_LIM_RX_INVALID_PEER: |
| 1758 | lim_rx_invalid_peer_process(mac_ctx, msg); |
| 1759 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1760 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
| 1761 | case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT: |
| 1762 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
| 1763 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
| 1764 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
| 1765 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1766 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1767 | case SIR_LIM_DISASSOC_ACK_TIMEOUT: |
| 1768 | case SIR_LIM_DEAUTH_ACK_TIMEOUT: |
| 1769 | case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
Abhishek Singh | 7d3bc3e | 2016-02-03 17:45:01 +0530 | [diff] [blame] | 1770 | case SIR_LIM_AUTH_RETRY_TIMEOUT: |
Padma, Santhosh Kumar | c56735f | 2017-09-13 18:14:26 +0530 | [diff] [blame] | 1771 | case SIR_LIM_AUTH_SAE_TIMEOUT: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1772 | /* These timeout messages are handled by MLM sub module */ |
| 1773 | lim_process_mlm_req_messages(mac_ctx, msg); |
| 1774 | break; |
| 1775 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
| 1776 | /** check if heart beat failed, even if one Beacon |
| 1777 | * is rcvd within the Heart Beat interval continue |
| 1778 | * normal processing |
| 1779 | */ |
| 1780 | if (NULL == msg->bodyptr) |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1781 | pe_err("Can't Process HB TO - bodyptr is Null"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1782 | else { |
| 1783 | session_entry = (tpPESession) msg->bodyptr; |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1784 | pe_err("SIR_LIM_HEART_BEAT_TIMEOUT, Session %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1785 | ((tpPESession) msg->bodyptr)->peSessionId); |
| 1786 | limResetHBPktCount(session_entry); |
| 1787 | lim_handle_heart_beat_timeout_for_session(mac_ctx, |
| 1788 | session_entry); |
| 1789 | } |
| 1790 | break; |
| 1791 | case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT: |
| 1792 | lim_handle_heart_beat_failure_timeout(mac_ctx); |
| 1793 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1794 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
| 1795 | /* Does not receive CNF or dummy packet */ |
| 1796 | lim_handle_cnf_wait_timeout(mac_ctx, (uint16_t) msg->bodyval); |
| 1797 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1798 | case SIR_LIM_CHANNEL_SWITCH_TIMEOUT: |
| 1799 | lim_process_channel_switch_timeout(mac_ctx); |
| 1800 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1801 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
| 1802 | lim_handle_update_olbc_cache(mac_ctx); |
| 1803 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1804 | case WMA_ADD_BSS_RSP: |
| 1805 | lim_process_mlm_add_bss_rsp(mac_ctx, msg); |
| 1806 | break; |
Kiran Kumar Lokere | 5798bfa | 2017-04-27 20:49:39 -0700 | [diff] [blame] | 1807 | case WMA_HIDDEN_SSID_RESTART_RSP: |
| 1808 | lim_process_mlm_update_hidden_ssid_rsp(mac_ctx, msg); |
| 1809 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1810 | case WMA_ADD_STA_RSP: |
| 1811 | lim_process_add_sta_rsp(mac_ctx, msg); |
| 1812 | break; |
| 1813 | case WMA_DELETE_STA_RSP: |
| 1814 | lim_process_mlm_del_sta_rsp(mac_ctx, msg); |
| 1815 | break; |
| 1816 | case WMA_DELETE_BSS_RSP: |
Deepak Dhamdhere | 2dae1bd | 2016-10-27 10:58:29 -0700 | [diff] [blame] | 1817 | case WMA_DELETE_BSS_HO_FAIL_RSP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1818 | lim_handle_delete_bss_rsp(mac_ctx, msg); |
| 1819 | break; |
| 1820 | case WMA_CSA_OFFLOAD_EVENT: |
Manishekar Chandrasekaran | cb05217 | 2016-04-22 12:19:04 +0530 | [diff] [blame] | 1821 | lim_handle_csa_offload_msg(mac_ctx, msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1822 | break; |
| 1823 | case WMA_SET_BSSKEY_RSP: |
| 1824 | case WMA_SET_STA_BCASTKEY_RSP: |
| 1825 | lim_process_mlm_set_bss_key_rsp(mac_ctx, msg); |
| 1826 | break; |
| 1827 | case WMA_SET_STAKEY_RSP: |
| 1828 | lim_process_mlm_set_sta_key_rsp(mac_ctx, msg); |
| 1829 | break; |
| 1830 | case WMA_GET_STATISTICS_RSP: |
| 1831 | lim_send_sme_pe_statistics_rsp(mac_ctx, msg->type, |
| 1832 | (void *)msg->bodyptr); |
| 1833 | break; |
| 1834 | case WMA_SET_MIMOPS_RSP: |
| 1835 | case WMA_SET_TX_POWER_RSP: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1836 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1837 | msg->bodyptr = NULL; |
| 1838 | break; |
| 1839 | case WMA_SET_MAX_TX_POWER_RSP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1840 | rrm_set_max_tx_power_rsp(mac_ctx, msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1841 | if (msg->bodyptr != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1842 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1843 | msg->bodyptr = NULL; |
| 1844 | } |
| 1845 | break; |
| 1846 | case SIR_LIM_ADDR2_MISS_IND: |
Srinivas Girigowda | 9ab3bbd | 2017-03-26 13:57:56 -0700 | [diff] [blame] | 1847 | pe_err( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1848 | FL("Addr2 mismatch interrupt received %X"), msg->type); |
| 1849 | /* message from HAL indicating addr2 mismatch interrupt occurred |
| 1850 | * msg->bodyptr contains only pointer to 48-bit addr2 field |
| 1851 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1852 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1853 | msg->bodyptr = NULL; |
| 1854 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1855 | case WMA_AGGR_QOS_RSP: |
| 1856 | lim_process_ft_aggr_qo_s_rsp(mac_ctx, msg); |
| 1857 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1858 | case WMA_SET_LINK_STATE_RSP: |
| 1859 | link_state_param = (tLinkStateParams *) msg->bodyptr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1860 | session_entry = link_state_param->session; |
| 1861 | if (link_state_param->ft |
| 1862 | #if defined WLAN_FEATURE_ROAM_OFFLOAD |
| 1863 | && !session_entry->bRoamSynchInProgress |
| 1864 | #endif |
| 1865 | ) |
| 1866 | lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac_ctx, |
| 1867 | session_entry->pLimMlmReassocReq, |
| 1868 | session_entry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1869 | if (link_state_param->callback) |
| 1870 | link_state_param->callback(mac_ctx, |
| 1871 | link_state_param->callbackArg, |
| 1872 | link_state_param->status); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1873 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1874 | msg->bodyptr = NULL; |
| 1875 | break; |
gaolez | e510894 | 2017-03-31 16:56:42 +0800 | [diff] [blame] | 1876 | case WMA_RX_CHN_STATUS_EVENT: |
| 1877 | lim_process_rx_channel_status_event(mac_ctx, msg->bodyptr); |
| 1878 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1879 | case WMA_IBSS_PEER_INACTIVITY_IND: |
| 1880 | lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1881 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1882 | msg->bodyptr = NULL; |
| 1883 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1884 | case WMA_DFS_BEACON_TX_SUCCESS_IND: |
| 1885 | lim_process_beacon_tx_success_ind(mac_ctx, msg->type, |
| 1886 | (void *)msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1887 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1888 | msg->bodyptr = NULL; |
| 1889 | break; |
| 1890 | case WMA_DISASSOC_TX_COMP: |
Liangwei Dong | c0b2e33 | 2017-11-16 06:04:46 -0500 | [diff] [blame] | 1891 | lim_disassoc_tx_complete_cnf(mac_ctx, msg->bodyval, |
| 1892 | msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1893 | break; |
| 1894 | case WMA_DEAUTH_TX_COMP: |
Liangwei Dong | c0b2e33 | 2017-11-16 06:04:46 -0500 | [diff] [blame] | 1895 | lim_deauth_tx_complete_cnf(mac_ctx, msg->bodyval, |
| 1896 | msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1897 | break; |
| 1898 | #ifdef FEATURE_AP_MCC_CH_AVOIDANCE |
| 1899 | case WMA_UPDATE_Q2Q_IE_IND: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1900 | qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1901 | beacon_params.paramChangeBitmap = 0; |
| 1902 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 1903 | vdev_id = ((uint8_t *)msg->bodyptr)[i]; |
| 1904 | session_entry = pe_find_session_by_sme_session_id( |
| 1905 | mac_ctx, vdev_id); |
| 1906 | if (session_entry == NULL) |
| 1907 | continue; |
| 1908 | session_entry->sap_advertise_avoid_ch_ie = |
| 1909 | (uint8_t)msg->bodyval; |
| 1910 | /* |
| 1911 | * if message comes for DFS channel, no need to update: |
| 1912 | * 1) We wont have MCC with DFS channels. so no need to |
| 1913 | * add Q2Q IE |
| 1914 | * 2) We cannot end up in DFS channel SCC by channel |
| 1915 | * switch from non DFS MCC scenario, so no need to |
| 1916 | * remove Q2Q IE |
| 1917 | * 3) There is however a case where device start MCC and |
| 1918 | * then user modifies hostapd.conf and does SAP |
| 1919 | * restart, in such a case, beacon params will be |
| 1920 | * reset and thus will not contain Q2Q IE, by default |
| 1921 | */ |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1922 | if (wlan_reg_get_channel_state(mac_ctx->pdev, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1923 | session_entry->currentOperChannel) |
| 1924 | != CHANNEL_STATE_DFS) { |
| 1925 | beacon_params.bssIdx = session_entry->bssIdx; |
| 1926 | beacon_params.beaconInterval = |
| 1927 | session_entry->beaconParams.beaconInterval; |
| 1928 | beacon_params.paramChangeBitmap |= |
| 1929 | PARAM_BCN_INTERVAL_CHANGED; |
| 1930 | sch_set_fixed_beacon_fields(mac_ctx, |
| 1931 | session_entry); |
| 1932 | lim_send_beacon_params(mac_ctx, &beacon_params, |
| 1933 | session_entry); |
| 1934 | } |
| 1935 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1936 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1937 | msg->bodyptr = NULL; |
| 1938 | break; |
| 1939 | #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ |
| 1940 | case eWNI_SME_NSS_UPDATE_REQ: |
| 1941 | case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ: |
| 1942 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1943 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1944 | msg->bodyptr = NULL; |
| 1945 | break; |
| 1946 | case eWNI_SME_CHANNEL_CHANGE_REQ: |
| 1947 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1948 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1949 | msg->bodyptr = NULL; |
| 1950 | break; |
| 1951 | case eWNI_SME_START_BEACON_REQ: |
| 1952 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1953 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1954 | msg->bodyptr = NULL; |
| 1955 | break; |
| 1956 | case eWNI_SME_UPDATE_ADDITIONAL_IES: |
| 1957 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1958 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1959 | msg->bodyptr = NULL; |
| 1960 | break; |
| 1961 | case eWNI_SME_MODIFY_ADDITIONAL_IES: |
| 1962 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1963 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1964 | msg->bodyptr = NULL; |
| 1965 | break; |
| 1966 | #ifdef QCA_HT_2040_COEX |
| 1967 | case eWNI_SME_SET_HT_2040_MODE: |
| 1968 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1969 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1970 | msg->bodyptr = NULL; |
| 1971 | break; |
| 1972 | #endif |
Manishekar Chandrasekaran | d964034 | 2016-04-27 12:28:26 +0530 | [diff] [blame] | 1973 | case SIR_HAL_PDEV_SET_HW_MODE_RESP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1974 | lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1975 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1976 | msg->bodyptr = NULL; |
| 1977 | break; |
Manishekar Chandrasekaran | 05fd267 | 2016-04-27 12:59:20 +0530 | [diff] [blame] | 1978 | case SIR_HAL_PDEV_HW_MODE_TRANS_IND: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1979 | lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1980 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1981 | msg->bodyptr = NULL; |
| 1982 | break; |
Manishekar Chandrasekaran | 5d46f70 | 2016-04-27 12:50:52 +0530 | [diff] [blame] | 1983 | case SIR_HAL_PDEV_MAC_CFG_RESP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1984 | lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1985 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1986 | msg->bodyptr = NULL; |
| 1987 | break; |
| 1988 | case eWNI_SME_SET_IE_REQ: |
| 1989 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1990 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1991 | msg->bodyptr = NULL; |
| 1992 | break; |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 1993 | case eWNI_SME_HT40_OBSS_SCAN_IND: |
| 1994 | lim_process_sme_obss_scan_ind(mac_ctx, msg); |
| 1995 | qdf_mem_free(msg->bodyptr); |
Archana Ramachandran | a20ef81 | 2015-11-13 16:12:13 -0800 | [diff] [blame] | 1996 | break; |
| 1997 | case SIR_HAL_SOC_ANTENNA_MODE_RESP: |
| 1998 | lim_process_set_antenna_resp(mac_ctx, msg->bodyptr); |
| 1999 | qdf_mem_free((void *)msg->bodyptr); |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 2000 | msg->bodyptr = NULL; |
| 2001 | break; |
Deepak Dhamdhere | b106ae5 | 2016-08-10 20:55:30 +0530 | [diff] [blame] | 2002 | case eWNI_SME_DEFAULT_SCAN_IE: |
| 2003 | lim_process_set_default_scan_ie_request(mac_ctx, msg->bodyptr); |
| 2004 | qdf_mem_free((void *)msg->bodyptr); |
| 2005 | msg->bodyptr = NULL; |
| 2006 | break; |
Kiran Kumar Lokere | e6476b2 | 2017-10-16 23:40:32 -0700 | [diff] [blame] | 2007 | case eWNI_SME_SET_HE_BSS_COLOR: |
| 2008 | lim_process_set_he_bss_color(mac_ctx, msg->bodyptr); |
| 2009 | qdf_mem_free((void *)msg->bodyptr); |
| 2010 | msg->bodyptr = NULL; |
| 2011 | break; |
Nitesh Shah | 99dd955 | 2017-03-20 19:27:47 +0530 | [diff] [blame] | 2012 | case eWNI_SME_DEL_ALL_TDLS_PEERS: |
| 2013 | lim_process_sme_del_all_tdls_peers(mac_ctx, msg->bodyptr); |
| 2014 | qdf_mem_free((void *)msg->bodyptr); |
| 2015 | msg->bodyptr = NULL; |
| 2016 | break; |
Arif Hussain | ee10f90 | 2017-12-27 16:30:17 -0800 | [diff] [blame] | 2017 | case WMA_OBSS_DETECTION_INFO: |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 2018 | lim_process_obss_detection_ind(mac_ctx, msg->bodyptr); |
Arif Hussain | ee10f90 | 2017-12-27 16:30:17 -0800 | [diff] [blame] | 2019 | qdf_mem_free(msg->bodyptr); |
| 2020 | msg->bodyptr = NULL; |
| 2021 | break; |
Padma, Santhosh Kumar | dd3f485 | 2018-01-16 18:51:51 +0530 | [diff] [blame] | 2022 | case eWNI_SME_SEND_SAE_MSG: |
| 2023 | lim_process_sae_msg(mac_ctx, msg->bodyptr); |
| 2024 | qdf_mem_free((void *)msg->bodyptr); |
| 2025 | msg->bodyptr = NULL; |
| 2026 | break; |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2027 | case WMA_OBSS_COLOR_COLLISION_INFO: |
| 2028 | lim_process_obss_color_collision_info(mac_ctx, msg->bodyptr); |
| 2029 | qdf_mem_free((void *)msg->bodyptr); |
| 2030 | msg->bodyptr = NULL; |
| 2031 | break; |
Abhishek Singh | 20a8e44 | 2018-09-12 15:50:44 +0530 | [diff] [blame] | 2032 | #ifdef CONFIG_VDEV_SM |
| 2033 | case eWNI_SME_CSA_RESTART_REQ: |
| 2034 | lim_send_csa_restart_req(mac_ctx, msg->bodyval); |
| 2035 | break; |
| 2036 | #endif |
Abhishek Singh | fc740be | 2018-10-12 11:34:26 +0530 | [diff] [blame] | 2037 | case WMA_SEND_BCN_RSP: |
| 2038 | lim_send_bcn_rsp(mac_ctx, (tpSendbeaconParams)msg->bodyptr); |
| 2039 | qdf_mem_free((void *)msg->bodyptr); |
| 2040 | msg->bodyptr = NULL; |
| 2041 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2042 | default: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2043 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2044 | msg->bodyptr = NULL; |
Varun Reddy Yeturu | dd51e8d | 2017-05-14 14:51:13 -0700 | [diff] [blame] | 2045 | pe_debug("Discarding unexpected message received %X", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2046 | msg->type); |
| 2047 | lim_print_msg_name(mac_ctx, LOGE, msg->type); |
| 2048 | break; |
| 2049 | |
| 2050 | } /* switch (msg->type) */ |
| 2051 | } /*** end lim_process_messages() ***/ |
| 2052 | |
| 2053 | /** |
Ankit Gupta | fef4c02 | 2016-09-26 12:11:30 -0700 | [diff] [blame] | 2054 | * lim_process_deferred_message_queue() |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2055 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2056 | * This function is called by LIM while exiting from Learn |
| 2057 | * mode. This function fetches messages posted to the LIM |
| 2058 | * deferred message queue limDeferredMsgQ. |
| 2059 | * |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2060 | * @mac: Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2061 | * @return None |
| 2062 | */ |
| 2063 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2064 | static void lim_process_deferred_message_queue(tpAniSirGlobal mac) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2065 | { |
Rajeev Kumar | cf7bd80 | 2017-04-18 11:11:42 -0700 | [diff] [blame] | 2066 | struct scheduler_msg limMsg = {0}; |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 2067 | struct scheduler_msg *readMsg; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2068 | uint16_t size; |
| 2069 | |
| 2070 | /* |
| 2071 | ** check any deferred messages need to be processed |
| 2072 | **/ |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2073 | size = mac->lim.gLimDeferredMsgQ.size; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2074 | if (size > 0) { |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2075 | while ((readMsg = lim_read_deferred_msg_q(mac)) != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2076 | qdf_mem_copy((uint8_t *) &limMsg, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 2077 | (uint8_t *) readMsg, |
| 2078 | sizeof(struct scheduler_msg)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2079 | size--; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2080 | lim_process_messages(mac, &limMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2081 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2082 | if ((lim_is_system_in_scan_state(mac)) |
| 2083 | || (true != GET_LIM_PROCESS_DEFD_MESGS(mac)) |
| 2084 | || mac->lim.gLimAddtsSent) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2085 | break; |
| 2086 | } |
| 2087 | } |
| 2088 | } /*** end lim_process_deferred_message_queue() ***/ |
| 2089 | |
| 2090 | /** |
Ankit Gupta | fef4c02 | 2016-09-26 12:11:30 -0700 | [diff] [blame] | 2091 | * lim_message_processor() - Process messages from LIM. |
| 2092 | * @mac_ctx: Pointer to the Global Mac Context. |
| 2093 | * @msg: Received LIM message. |
| 2094 | * |
| 2095 | * Wrapper function for lim_process_messages when handling messages received by |
| 2096 | * LIM. Could either defer messages or process them. |
| 2097 | * |
| 2098 | * Return: None. |
| 2099 | */ |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 2100 | void lim_message_processor(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg) |
Ankit Gupta | fef4c02 | 2016-09-26 12:11:30 -0700 | [diff] [blame] | 2101 | { |
| 2102 | if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { |
| 2103 | pe_free_msg(mac_ctx, msg); |
| 2104 | return; |
| 2105 | } |
| 2106 | |
| 2107 | if (!def_msg_decision(mac_ctx, msg)) { |
| 2108 | lim_process_messages(mac_ctx, msg); |
| 2109 | /* process deferred message queue if allowed */ |
| 2110 | if ((!(mac_ctx->lim.gLimAddtsSent)) && |
| 2111 | (!(lim_is_system_in_scan_state(mac_ctx))) && |
| 2112 | (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) |
| 2113 | lim_process_deferred_message_queue(mac_ctx); |
| 2114 | } |
| 2115 | } |
| 2116 | |
| 2117 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2118 | * lim_process_normal_hdd_msg() - Process the message and defer if needed |
| 2119 | * @mac_ctx : Pointer to Global MAC structure |
| 2120 | * @msg : The message need to be processed |
| 2121 | * @rsp_reqd: whether return result to hdd |
| 2122 | * |
| 2123 | * This function checks the current lim state and decide whether the message |
| 2124 | * passed will be deferred or not. |
| 2125 | * |
| 2126 | * Return: None |
| 2127 | */ |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 2128 | static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, |
| 2129 | struct scheduler_msg *msg, |
| 2130 | uint8_t rsp_reqd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2131 | { |
| 2132 | bool defer_msg = true; |
| 2133 | |
| 2134 | /* Added For BT-AMP Support */ |
| 2135 | if ((mac_ctx->lim.gLimSystemRole == eLIM_AP_ROLE) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2136 | || (mac_ctx->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) { |
| 2137 | /* |
| 2138 | * This check is required only for the AP and in 2 cases. |
| 2139 | * 1. If we are in learn mode and we receive any of these |
| 2140 | * messages, you have to come out of scan and process the |
| 2141 | * message, hence dont defer the message here. In handler, |
| 2142 | * these message could be defered till we actually come out of |
| 2143 | * scan mode. |
| 2144 | * 2. If radar is detected, you might have to defer all of |
| 2145 | * these messages except Stop BSS request/ Switch channel |
| 2146 | * request. This decision is also made inside its handler. |
| 2147 | * |
| 2148 | * Please be careful while using the flag defer_msg. Possibly |
| 2149 | * you might end up in an infinite loop. |
| 2150 | */ |
| 2151 | if ((msg->type == eWNI_SME_START_BSS_REQ) || |
| 2152 | (msg->type == eWNI_SME_STOP_BSS_REQ) || |
| 2153 | (msg->type == eWNI_SME_SWITCH_CHL_IND)) |
| 2154 | defer_msg = false; |
| 2155 | } |
| 2156 | |
| 2157 | if (((mac_ctx->lim.gLimAddtsSent) || |
| 2158 | (lim_is_system_in_scan_state(mac_ctx))) && defer_msg) { |
| 2159 | /* |
| 2160 | * System is in DFS (Learn) mode or awaiting addts response or |
Jeff Johnson | 47d7524 | 2018-05-12 15:58:53 -0700 | [diff] [blame] | 2161 | * if radar is detected, Defer processing this message |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2162 | */ |
| 2163 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
| 2164 | #ifdef WLAN_DEBUG |
| 2165 | mac_ctx->lim.numSme++; |
| 2166 | #endif |
| 2167 | lim_log_session_states(mac_ctx); |
| 2168 | /* Release body */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2169 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2170 | msg->bodyptr = NULL; |
| 2171 | } |
| 2172 | } else { |
| 2173 | /* |
| 2174 | * These messages are from HDD.Since these requests may also be |
| 2175 | * generated internally within LIM module, need to distinquish |
| 2176 | * and send response to host |
| 2177 | */ |
| 2178 | if (rsp_reqd) |
| 2179 | mac_ctx->lim.gLimRspReqd = true; |
| 2180 | #ifdef WLAN_DEBUG |
| 2181 | mac_ctx->lim.numSme++; |
| 2182 | #endif |
| 2183 | if (lim_process_sme_req_messages(mac_ctx, msg)) { |
| 2184 | /* |
| 2185 | * Release body. limProcessSmeReqMessage consumed the |
| 2186 | * buffer. We can free it. |
| 2187 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2188 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2189 | msg->bodyptr = NULL; |
| 2190 | } |
| 2191 | } |
| 2192 | } |
| 2193 | |
| 2194 | void |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2195 | handle_ht_capabilityand_ht_info(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2196 | tpPESession psessionEntry) |
| 2197 | { |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 2198 | struct mlme_ht_capabilities_info *ht_cap_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2199 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2200 | ht_cap_info = &mac->mlme_cfg->ht_caps.ht_cap_info; |
| 2201 | mac->lim.gHTLsigTXOPProtection = |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 2202 | (uint8_t)ht_cap_info->l_sig_tx_op_protection; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2203 | mac->lim.gHTMIMOPSState = |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 2204 | (tSirMacHTMIMOPowerSaveState)ht_cap_info->mimo_power_save; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2205 | mac->lim.gHTGreenfield = (uint8_t)ht_cap_info->green_field; |
| 2206 | mac->lim.gHTMaxAmsduLength = |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 2207 | (uint8_t)ht_cap_info->maximal_amsdu_size; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2208 | mac->lim.gHTShortGI20Mhz = (uint8_t)ht_cap_info->short_gi_20_mhz; |
| 2209 | mac->lim.gHTShortGI40Mhz = (uint8_t)ht_cap_info->short_gi_40_mhz; |
| 2210 | mac->lim.gHTPSMPSupport = (uint8_t)ht_cap_info->psmp; |
| 2211 | mac->lim.gHTDsssCckRate40MHzSupport = |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 2212 | (uint8_t)ht_cap_info->dsss_cck_mode_40_mhz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2213 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2214 | mac->lim.gHTAMpduDensity = |
| 2215 | (uint8_t)mac->mlme_cfg->ht_caps.ampdu_params.mpdu_density; |
| 2216 | mac->lim.gHTMaxRxAMpduFactor = |
| 2217 | (uint8_t)mac->mlme_cfg->ht_caps.ampdu_params. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2218 | max_rx_ampdu_factor; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2219 | |
| 2220 | /* Get HT IE Info */ |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2221 | mac->lim.gHTServiceIntervalGranularity = |
| 2222 | (uint8_t)mac->mlme_cfg->ht_caps.info_field_1. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2223 | service_interval_granularity; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2224 | mac->lim.gHTControlledAccessOnly = |
| 2225 | (uint8_t)mac->mlme_cfg->ht_caps.info_field_1. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2226 | controlled_access_only; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2227 | mac->lim.gHTRifsMode = (uint8_t)mac->mlme_cfg->ht_caps.info_field_1. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2228 | rifs_mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2229 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2230 | mac->lim.gHTOperMode = (tSirMacHTOperatingMode)mac->mlme_cfg->ht_caps. |
Vignesh Viswanathan | fe1b5bd | 2018-11-08 00:30:05 +0530 | [diff] [blame] | 2231 | info_field_2.op_mode; |
| 2232 | |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2233 | mac->lim.gHTPCOActive = (uint8_t)mac->mlme_cfg->ht_caps.info_field_3. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2234 | pco_active; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2235 | mac->lim.gHTPCOPhase = (uint8_t)mac->mlme_cfg->ht_caps.info_field_3. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2236 | pco_phase; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2237 | mac->lim.gHTSecondaryBeacon = |
| 2238 | (uint8_t)mac->mlme_cfg->ht_caps.info_field_3.secondary_beacon; |
| 2239 | mac->lim.gHTDualCTSProtection = (uint8_t)mac->mlme_cfg->ht_caps. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2240 | info_field_3.dual_cts_protection; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2241 | mac->lim.gHTSTBCBasicMCS = (uint8_t)mac->mlme_cfg->ht_caps. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2242 | info_field_3.basic_stbc_mcs; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2243 | |
| 2244 | /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session; |
| 2245 | * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old); |
| 2246 | * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist |
| 2247 | * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below |
| 2248 | */ |
| 2249 | if (psessionEntry != NULL) { |
| 2250 | psessionEntry->htCapability = |
| 2251 | IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 2252 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2253 | (uint8_t)mac->mlme_cfg->ht_caps.info_field_3. |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 2254 | lsig_txop_protection_full_support; |
Jeff Johnson | 5cce7a0 | 2018-11-22 15:41:15 -0800 | [diff] [blame] | 2255 | lim_init_obss_params(mac, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2256 | } |
| 2257 | } |
| 2258 | |
| 2259 | void lim_log_session_states(tpAniSirGlobal mac_ctx) |
| 2260 | { |
| 2261 | #ifdef WLAN_DEBUG |
| 2262 | int i; |
| 2263 | |
| 2264 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 2265 | if (mac_ctx->lim.gpSession[i].valid) { |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 2266 | QDF_TRACE(QDF_MODULE_ID_PE, LOGD, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2267 | FL("sysRole(%d) Session (%d)"), |
| 2268 | mac_ctx->lim.gLimSystemRole, i); |
Abhishek Singh | 5d8d733 | 2017-08-10 15:15:24 +0530 | [diff] [blame] | 2269 | QDF_TRACE(QDF_MODULE_ID_PE, LOGD, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2270 | FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"), |
| 2271 | lim_sme_state_str( |
| 2272 | mac_ctx->lim.gpSession[i].limSmeState), |
| 2273 | lim_sme_state_str( |
| 2274 | mac_ctx->lim.gpSession[i].limPrevSmeState), |
| 2275 | lim_mlm_state_str( |
| 2276 | mac_ctx->lim.gpSession[i].limMlmState), |
| 2277 | lim_mlm_state_str( |
| 2278 | mac_ctx->lim.gpSession[i].limPrevMlmState)); |
| 2279 | } |
| 2280 | } |
| 2281 | #endif |
| 2282 | } |