Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * This file lim ProcessMessageQueue.cc contains the code |
| 30 | * for processing LIM message Queue. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 02/11/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * |
| 37 | */ |
| 38 | #include "cds_api.h" |
| 39 | #include "wni_api.h" |
| 40 | #include "wma_types.h" |
| 41 | |
| 42 | #include "wni_cfg.h" |
| 43 | #include "cfg_api.h" |
| 44 | #include "sir_common.h" |
| 45 | #include "utils_api.h" |
| 46 | #include "lim_types.h" |
| 47 | #include "lim_utils.h" |
| 48 | #include "lim_assoc_utils.h" |
| 49 | #include "lim_prop_exts_utils.h" |
| 50 | |
| 51 | #include "lim_admit_control.h" |
| 52 | #include "lim_ibss_peer_mgmt.h" |
| 53 | #include "sch_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | #include "lim_ft_defs.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | #include "lim_session.h" |
| 56 | #include "lim_send_messages.h" |
| 57 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | #include "rrm_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 59 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 60 | #include "lim_ft.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 61 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 62 | #include "qdf_types.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | #include "cds_packet.h" |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 64 | #include "qdf_mem.h" |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 65 | #include "cds_concurrency.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 66 | |
| 67 | void lim_log_session_states(tpAniSirGlobal pMac); |
| 68 | static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, |
| 69 | struct sSirMsgQ *msg, uint8_t rsp_reqd); |
| 70 | |
| 71 | /** |
| 72 | * lim_process_dual_mac_cfg_resp() - Process set dual mac config response |
| 73 | * @mac: Global MAC pointer |
| 74 | * @body: Set dual mac config response in sir_dual_mac_config_resp format |
| 75 | * |
| 76 | * Process the set dual mac config response and post the message |
| 77 | * to SME to process this further and release the active |
| 78 | * command list |
| 79 | * |
| 80 | * Return: None |
| 81 | */ |
| 82 | static void lim_process_dual_mac_cfg_resp(tpAniSirGlobal mac, void *body) |
| 83 | { |
| 84 | struct sir_dual_mac_config_resp *resp, *param; |
| 85 | uint32_t len, fail_resp = 0; |
| 86 | tSirMsgQ msg; |
| 87 | |
| 88 | resp = (struct sir_dual_mac_config_resp *)body; |
| 89 | if (!resp) { |
| 90 | lim_log(mac, LOGE, FL("Set dual mac cfg param is NULL")); |
| 91 | fail_resp = 1; |
| 92 | /* Not returning here. If possible, let us proceed |
| 93 | * and send fail response to SME |
| 94 | */ |
| 95 | } |
| 96 | |
| 97 | len = sizeof(*param); |
| 98 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 99 | param = qdf_mem_malloc(len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 100 | if (!param) { |
| 101 | lim_log(mac, LOGE, FL("Fail to allocate memory")); |
| 102 | /* Memory allocation for param failed. |
| 103 | * Cannot send fail status back to SME |
| 104 | */ |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | if (fail_resp) { |
| 109 | lim_log(mac, LOGE, FL("Send fail status to SME")); |
| 110 | param->status = SET_HW_MODE_STATUS_ECANCELED; |
| 111 | } else { |
| 112 | param->status = resp->status; |
| 113 | /* |
| 114 | * TODO: Update this HW mode info in any UMAC params, if needed |
| 115 | */ |
| 116 | } |
| 117 | |
| 118 | msg.type = eWNI_SME_SET_DUAL_MAC_CFG_RESP; |
| 119 | msg.bodyptr = param; |
| 120 | msg.bodyval = 0; |
| 121 | lim_log(mac, LOG1, FL("Send eWNI_SME_SET_DUAL_MAC_CFG_RESP to SME")); |
| 122 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 123 | return; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * lim_process_set_hw_mode_resp() - Process set HW mode response |
| 128 | * @mac: Global MAC pointer |
| 129 | * @body: Set HW mode response in sir_set_hw_mode_resp format |
| 130 | * |
| 131 | * Process the set HW mode response and post the message |
| 132 | * to SME to process this further and release the active |
| 133 | * command list |
| 134 | * |
| 135 | * Return: None |
| 136 | */ |
| 137 | static void lim_process_set_hw_mode_resp(tpAniSirGlobal mac, void *body) |
| 138 | { |
| 139 | struct sir_set_hw_mode_resp *resp, *param; |
| 140 | uint32_t len, i, fail_resp = 0; |
| 141 | tSirMsgQ msg; |
| 142 | |
| 143 | resp = (struct sir_set_hw_mode_resp *)body; |
| 144 | if (!resp) { |
| 145 | lim_log(mac, LOGE, FL("Set HW mode param is NULL")); |
| 146 | fail_resp = 1; |
| 147 | /* Not returning here. If possible, let us proceed |
| 148 | * and send fail response to SME */ |
| 149 | } |
| 150 | |
| 151 | len = sizeof(*param); |
| 152 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 153 | param = qdf_mem_malloc(len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 154 | if (!param) { |
| 155 | lim_log(mac, LOGE, FL("Fail to allocate memory")); |
| 156 | /* Memory allocation for param failed. |
| 157 | * Cannot send fail status back to SME |
| 158 | */ |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | if (fail_resp) { |
| 163 | lim_log(mac, LOGE, FL("Send fail status to SME")); |
| 164 | param->status = SET_HW_MODE_STATUS_ECANCELED; |
| 165 | param->cfgd_hw_mode_index = 0; |
| 166 | param->num_vdev_mac_entries = 0; |
| 167 | } else { |
| 168 | param->status = resp->status; |
| 169 | param->cfgd_hw_mode_index = resp->cfgd_hw_mode_index; |
| 170 | param->num_vdev_mac_entries = resp->num_vdev_mac_entries; |
| 171 | |
| 172 | for (i = 0; i < resp->num_vdev_mac_entries; i++) { |
| 173 | param->vdev_mac_map[i].vdev_id = |
| 174 | resp->vdev_mac_map[i].vdev_id; |
| 175 | param->vdev_mac_map[i].mac_id = |
| 176 | resp->vdev_mac_map[i].mac_id; |
| 177 | } |
| 178 | /* |
| 179 | * TODO: Update this HW mode info in any UMAC params, if needed |
| 180 | */ |
| 181 | } |
| 182 | |
| 183 | msg.type = eWNI_SME_SET_HW_MODE_RESP; |
| 184 | msg.bodyptr = param; |
| 185 | msg.bodyval = 0; |
| 186 | lim_log(mac, LOGE, FL("Send eWNI_SME_SET_HW_MODE_RESP to SME")); |
| 187 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * lim_process_hw_mode_trans_ind() - Process set HW mode transition indication |
| 193 | * @mac: Global MAC pointer |
| 194 | * @body: Set HW mode response in sir_hw_mode_trans_ind format |
| 195 | * |
| 196 | * Process the set HW mode transition indication and post the message |
| 197 | * to SME to invoke the HDD callback |
| 198 | * command list |
| 199 | * |
| 200 | * Return: None |
| 201 | */ |
| 202 | static void lim_process_hw_mode_trans_ind(tpAniSirGlobal mac, void *body) |
| 203 | { |
| 204 | struct sir_hw_mode_trans_ind *ind, *param; |
| 205 | uint32_t len, i; |
| 206 | tSirMsgQ msg; |
| 207 | |
| 208 | ind = (struct sir_hw_mode_trans_ind *)body; |
| 209 | if (!ind) { |
| 210 | lim_log(mac, LOGE, FL("Set HW mode trans ind param is NULL")); |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | len = sizeof(*param); |
| 215 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 216 | param = qdf_mem_malloc(len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 217 | if (!param) { |
| 218 | lim_log(mac, LOGE, FL("Fail to allocate memory")); |
| 219 | return; |
| 220 | } |
| 221 | |
| 222 | param->old_hw_mode_index = ind->old_hw_mode_index; |
| 223 | param->new_hw_mode_index = ind->new_hw_mode_index; |
| 224 | param->num_vdev_mac_entries = ind->num_vdev_mac_entries; |
| 225 | |
| 226 | for (i = 0; i < ind->num_vdev_mac_entries; i++) { |
| 227 | param->vdev_mac_map[i].vdev_id = |
| 228 | ind->vdev_mac_map[i].vdev_id; |
| 229 | param->vdev_mac_map[i].mac_id = |
| 230 | ind->vdev_mac_map[i].mac_id; |
| 231 | } |
| 232 | |
| 233 | /* TODO: Update this HW mode info in any UMAC params, if needed */ |
| 234 | |
| 235 | msg.type = eWNI_SME_HW_MODE_TRANS_IND; |
| 236 | msg.bodyptr = param; |
| 237 | msg.bodyval = 0; |
| 238 | lim_log(mac, LOGE, FL("Send eWNI_SME_HW_MODE_TRANS_IND to SME")); |
| 239 | lim_sys_process_mmh_msg_api(mac, &msg, ePROT); |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | /** ------------------------------------------------------------- |
| 244 | \fn def_msg_decision |
| 245 | \brief The function decides whether to defer a message or not in limProcessMessage function |
| 246 | \param tpAniSirGlobal pMac |
| 247 | \param tSirMsgQ limMsg |
| 248 | \param tSirMacTspecIE *ppInfo |
| 249 | \return none |
| 250 | -------------------------------------------------------------*/ |
| 251 | |
| 252 | uint8_t static def_msg_decision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 253 | { |
| 254 | |
| 255 | /* this function should not changed */ |
| 256 | if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) { |
| 257 | /* Defer processsing this message */ |
| 258 | if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 259 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 260 | FL("Unable to Defer Msg")); |
| 261 | lim_log_session_states(pMac); |
| 262 | lim_handle_defer_msg_error(pMac, limMsg); |
| 263 | } |
| 264 | return true; |
| 265 | } |
| 266 | /* When defer is requested then defer all the messages except HAL responses. */ |
| 267 | if ((!lim_is_system_in_scan_state(pMac)) |
| 268 | && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 269 | && !pMac->lim.gLimSystemInScanLearnMode) { |
| 270 | if ((limMsg->type != WMA_ADD_BSS_RSP) |
| 271 | && (limMsg->type != WMA_DELETE_BSS_RSP) |
| 272 | && (limMsg->type != WMA_ADD_STA_RSP) |
| 273 | && (limMsg->type != WMA_DELETE_STA_RSP) |
| 274 | && (limMsg->type != WMA_SET_BSSKEY_RSP) |
| 275 | && (limMsg->type != WMA_SET_STAKEY_RSP) |
| 276 | && (limMsg->type != WMA_SET_STA_BCASTKEY_RSP) |
| 277 | && (limMsg->type != WMA_AGGR_QOS_RSP) |
| 278 | && (limMsg->type != WMA_SET_MIMOPS_RSP) |
| 279 | && (limMsg->type != WMA_SWITCH_CHANNEL_RSP) |
| 280 | && (limMsg->type != WMA_P2P_NOA_ATTR_IND) |
| 281 | && (limMsg->type != WMA_P2P_NOA_START_IND) && |
| 282 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 283 | (limMsg->type != WMA_START_OEM_DATA_RSP) && |
| 284 | #endif |
Hema Aparna Medicharla | 5e1f302 | 2015-08-24 11:22:29 +0530 | [diff] [blame] | 285 | (limMsg->type != WMA_ADD_TS_RSP) && |
Hanumantha Reddy Pothula | b834021 | 2016-01-12 11:16:06 +0530 | [diff] [blame] | 286 | /* |
| 287 | * LIM won't process any defer queue commands if gLimAddtsSent is |
| 288 | * set to TRUE. gLimAddtsSent will be set TRUE to while sending |
| 289 | * ADDTS REQ. Say, when deferring is enabled, if |
| 290 | * SIR_LIM_ADDTS_RSP_TIMEOUT is posted (because of not receiving ADDTS |
| 291 | * RSP) then this command will be added to defer queue and as |
| 292 | * gLimAddtsSent is set TRUE LIM will never process any commands from |
| 293 | * defer queue, including SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing |
| 294 | * SIR_LIM_ADDTS_RSP_TIMEOUT command to be processed with deferring |
| 295 | * enabled, so that this will be processed immediately and sets |
| 296 | * gLimAddtsSent to FALSE. |
| 297 | */ |
| 298 | (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) && |
Hema Aparna Medicharla | 5e1f302 | 2015-08-24 11:22:29 +0530 | [diff] [blame] | 299 | /* Allow processing of RX frames while awaiting reception |
| 300 | * of ADD TS response over the air. This logic particularly |
| 301 | * handles the case when host sends ADD BA request to FW |
| 302 | * after ADD TS request is sent over the air and |
| 303 | * ADD TS response received over the air */ |
| 304 | !(limMsg->type == SIR_BB_XPORT_MGMT_MSG && |
| 305 | pMac->lim.gLimAddtsSent)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 306 | PELOG1(lim_log |
| 307 | (pMac, LOG1, |
| 308 | FL |
| 309 | ("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"), |
| 310 | lim_msg_str(limMsg->type)); |
| 311 | ) |
| 312 | /* Defer processsing this message */ |
| 313 | if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 314 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 315 | FL("Unable to Defer Msg")); |
| 316 | lim_log_session_states(pMac); |
| 317 | lim_handle_defer_msg_error(pMac, limMsg); |
| 318 | |
| 319 | } |
| 320 | return true; |
| 321 | } |
| 322 | } |
| 323 | return false; |
| 324 | } |
| 325 | |
| 326 | #ifdef FEATURE_WLAN_EXTSCAN |
| 327 | static void |
| 328 | __lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, |
| 329 | tSirProbeRespBeacon *frame, uint32_t ie_len, |
| 330 | uint32_t msg_type) |
| 331 | { |
| 332 | struct pno_match_found *result; |
| 333 | uint8_t *body; |
| 334 | tSirMsgQ mmh_msg; |
| 335 | tpSirMacMgmtHdr hdr; |
| 336 | uint32_t num_results = 1, len, i; |
| 337 | |
| 338 | /* Upon receiving every matched beacon, bss info is forwarded to the |
| 339 | * the upper layer, hence num_results is set to 1 */ |
| 340 | len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) + |
| 341 | ie_len; |
| 342 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 343 | result = qdf_mem_malloc(len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 344 | if (NULL == result) { |
| 345 | lim_log(pmac, LOGE, FL("Memory allocation failed")); |
| 346 | return; |
| 347 | } |
| 348 | hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); |
| 349 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 350 | qdf_mem_zero(result, sizeof(*result) + ie_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 351 | |
| 352 | /* Received frame does not have request id, hence set 0 */ |
| 353 | result->request_id = 0; |
| 354 | result->more_data = 0; |
| 355 | result->num_results = num_results; |
| 356 | |
| 357 | for (i = 0; i < result->num_results; i++) { |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 358 | result->ap[i].ts = qdf_mc_timer_get_system_time(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 359 | result->ap[i].beaconPeriod = frame->beaconInterval; |
| 360 | result->ap[i].capability = |
| 361 | lim_get_u16((uint8_t *) &frame->capabilityInfo); |
| 362 | result->ap[i].channel = WMA_GET_RX_CH(rx_pkt_info); |
Deepak Dhamdhere | 68929ec | 2015-08-05 15:16:35 -0700 | [diff] [blame] | 363 | result->ap[i].rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 364 | result->ap[i].rtt = 0; |
| 365 | result->ap[i].rtt_sd = 0; |
| 366 | result->ap[i].ieLength = ie_len; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 367 | qdf_mem_copy((uint8_t *) &result->ap[i].ssid[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 368 | (uint8_t *) frame->ssId.ssId, frame->ssId.length); |
| 369 | result->ap[i].ssid[frame->ssId.length] = '\0'; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 370 | qdf_mem_copy((uint8_t *) &result->ap[i].bssid, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 371 | (uint8_t *) hdr->bssId, |
| 372 | sizeof(tSirMacAddr)); |
| 373 | /* Copy IE fields */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 374 | qdf_mem_copy((uint8_t *) &result->ap[i].ieData, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 375 | body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); |
| 376 | } |
| 377 | |
| 378 | mmh_msg.type = msg_type; |
| 379 | mmh_msg.bodyptr = result; |
| 380 | mmh_msg.bodyval = 0; |
| 381 | lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT); |
| 382 | } |
| 383 | |
| 384 | |
| 385 | static void |
| 386 | __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, |
| 387 | tSirProbeRespBeacon *frame, |
| 388 | uint32_t ie_len, |
| 389 | uint32_t msg_type) |
| 390 | { |
| 391 | tpSirWifiFullScanResultEvent result; |
| 392 | uint8_t *body; |
| 393 | tSirMsgQ mmh_msg; |
| 394 | tpSirMacMgmtHdr hdr; |
| 395 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 396 | result = qdf_mem_malloc(sizeof(*result) + ie_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 397 | if (NULL == result) { |
| 398 | lim_log(pmac, LOGE, FL("Memory allocation failed")); |
| 399 | return; |
| 400 | } |
| 401 | hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); |
| 402 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 403 | qdf_mem_zero(result, sizeof(*result) + ie_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 404 | |
| 405 | /* Received frame does not have request id, hence set 0 */ |
| 406 | result->requestId = 0; |
| 407 | |
| 408 | result->moreData = 0; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 409 | result->ap.ts = qdf_mc_timer_get_system_time(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 410 | result->ap.beaconPeriod = frame->beaconInterval; |
| 411 | result->ap.capability = |
| 412 | lim_get_u16((uint8_t *) &frame->capabilityInfo); |
| 413 | result->ap.channel = WMA_GET_RX_CH(rx_pkt_info); |
Deepak Dhamdhere | 68929ec | 2015-08-05 15:16:35 -0700 | [diff] [blame] | 414 | result->ap.rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 415 | result->ap.rtt = 0; |
| 416 | result->ap.rtt_sd = 0; |
| 417 | result->ap.ieLength = ie_len; |
| 418 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 419 | qdf_mem_copy((uint8_t *) &result->ap.ssid[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 420 | (uint8_t *) frame->ssId.ssId, frame->ssId.length); |
| 421 | result->ap.ssid[frame->ssId.length] = '\0'; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 422 | qdf_mem_copy((uint8_t *) &result->ap.bssid.bytes, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | (uint8_t *) hdr->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 424 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 425 | /* Copy IE fields */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 426 | qdf_mem_copy((uint8_t *) &result->ap.ieData, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 427 | body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); |
| 428 | |
| 429 | mmh_msg.type = msg_type; |
| 430 | mmh_msg.bodyptr = result; |
| 431 | mmh_msg.bodyval = 0; |
| 432 | lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT); |
| 433 | } |
| 434 | |
| 435 | static void |
| 436 | __lim_process_ext_scan_beacon_probe_rsp(tpAniSirGlobal pmac, |
| 437 | uint8_t *rx_pkt_info, |
| 438 | uint8_t sub_type) |
| 439 | { |
| 440 | tSirProbeRespBeacon *frame; |
| 441 | uint8_t *body; |
| 442 | uint32_t frm_len; |
| 443 | tSirRetStatus status; |
| 444 | |
| 445 | frm_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info); |
| 446 | if (frm_len <= SIR_MAC_B_PR_SSID_OFFSET) { |
| 447 | lim_log(pmac, LOGP, |
| 448 | FL("RX packet has invalid length %d"), frm_len); |
| 449 | return; |
| 450 | } |
| 451 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 452 | frame = qdf_mem_malloc(sizeof(*frame)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 453 | if (NULL == frame) { |
| 454 | lim_log(pmac, LOGE, FL("Memory allocation failed")); |
| 455 | return; |
| 456 | } |
| 457 | |
| 458 | if (sub_type == SIR_MAC_MGMT_BEACON) { |
| 459 | lim_log(pmac, LOG2, FL("Beacon due to ExtScan/epno")); |
| 460 | status = sir_convert_beacon_frame2_struct(pmac, |
| 461 | (uint8_t *)rx_pkt_info, |
| 462 | frame); |
| 463 | } else if (sub_type == SIR_MAC_MGMT_PROBE_RSP) { |
| 464 | lim_log(pmac, LOG2, FL("Probe Rsp due to ExtScan/epno")); |
| 465 | body = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
| 466 | status = sir_convert_probe_frame2_struct(pmac, body, |
| 467 | frm_len, frame); |
| 468 | } else { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 469 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 470 | return; |
| 471 | } |
| 472 | |
| 473 | if (status != eSIR_SUCCESS) { |
| 474 | lim_log(pmac, LOGE, FL("Frame parsing failed")); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 475 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 476 | return; |
| 477 | } |
| 478 | |
| 479 | if (WMA_IS_EXTSCAN_SCAN_SRC(rx_pkt_info)) |
| 480 | __lim_ext_scan_forward_bcn_probe_rsp(pmac, rx_pkt_info, frame, |
| 481 | (frm_len - SIR_MAC_B_PR_SSID_OFFSET), |
| 482 | eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND); |
| 483 | |
| 484 | if (WMA_IS_EPNO_SCAN_SRC(rx_pkt_info)) |
| 485 | __lim_pno_match_fwd_bcn_probepsp(pmac, rx_pkt_info, frame, |
| 486 | (frm_len - SIR_MAC_B_PR_SSID_OFFSET), |
| 487 | eWNI_SME_EPNO_NETWORK_FOUND_IND); |
| 488 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 489 | qdf_mem_free(frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 490 | } |
| 491 | #endif |
| 492 | |
| 493 | /* |
| 494 | * Beacon Handling Cases: |
| 495 | * during scanning, when no session is active: |
| 496 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 497 | * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null. |
| 498 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 499 | * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null. |
| 500 | * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked. |
| 501 | * Not scanning, no session: |
| 502 | * there should not be any beacon coming, if coming, should be dropped. |
| 503 | * Not Scanning, |
| 504 | */ |
| 505 | static void |
| 506 | __lim_handle_beacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, |
| 507 | tpPESession psessionEntry) |
| 508 | { |
| 509 | /* checking for global SME state... */ |
| 510 | uint8_t *pRxPacketInfo; |
| 511 | lim_get_b_dfrom_rx_packet(pMac, pMsg->bodyptr, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 512 | (uint32_t **) &pRxPacketInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 513 | |
| 514 | /* This function should not be called if beacon is received in scan state. */ |
| 515 | /* So not doing any checks for the global state. */ |
| 516 | |
| 517 | if (psessionEntry == NULL) { |
| 518 | sch_beacon_process(pMac, pRxPacketInfo, NULL); |
| 519 | } else if ((psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) || |
| 520 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) { |
| 521 | sch_beacon_process(pMac, pRxPacketInfo, psessionEntry); |
| 522 | } else |
| 523 | lim_process_beacon_frame(pMac, pRxPacketInfo, psessionEntry); |
| 524 | |
| 525 | return; |
| 526 | } |
| 527 | |
| 528 | /** |
| 529 | * lim_defer_msg() |
| 530 | * |
| 531 | ***FUNCTION: |
| 532 | * This function is called to defer the messages received |
| 533 | * during Learn mode |
| 534 | * |
| 535 | ***LOGIC: |
| 536 | * NA |
| 537 | * |
| 538 | ***ASSUMPTIONS: |
| 539 | * NA |
| 540 | * |
| 541 | ***NOTE: |
| 542 | * NA |
| 543 | * |
| 544 | * @param pMac - Pointer to Global MAC structure |
| 545 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 546 | * @return None |
| 547 | */ |
| 548 | |
| 549 | uint32_t lim_defer_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 550 | { |
| 551 | uint32_t retCode = TX_SUCCESS; |
| 552 | |
| 553 | retCode = lim_write_deferred_msg_q(pMac, pMsg); |
| 554 | |
| 555 | if (retCode == TX_SUCCESS) { |
| 556 | MTRACE(mac_trace_msg_rx |
| 557 | (pMac, NO_SESSION, |
| 558 | LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED)); |
| 559 | ) |
| 560 | } else { |
| 561 | lim_log(pMac, LOGE, FL("Dropped lim message (0x%X)"), |
| 562 | pMsg->type); |
| 563 | MTRACE(mac_trace_msg_rx |
| 564 | (pMac, NO_SESSION, |
| 565 | LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED)); |
| 566 | ) |
| 567 | } |
| 568 | |
| 569 | return retCode; |
| 570 | } /*** end lim_defer_msg() ***/ |
| 571 | |
| 572 | /** |
| 573 | * lim_handle_unknown_a2_index_frames() - This function handles Unknown Unicast |
| 574 | * (A2 Index) packets |
| 575 | * @mac_ctx: Pointer to the Global Mac Context. |
| 576 | * @rx_pkt_buffer: Pointer to the packet Buffer descriptor. |
| 577 | * @session_entry: Pointer to the PE Session Entry. |
| 578 | * |
| 579 | * This routine will handle public action frames. |
| 580 | * |
| 581 | * Return: None. |
| 582 | */ |
| 583 | static void lim_handle_unknown_a2_index_frames(tpAniSirGlobal mac_ctx, |
| 584 | void *rx_pkt_buffer, tpPESession session_entry) |
| 585 | { |
| 586 | #ifdef FEATURE_WLAN_TDLS |
| 587 | tpSirMacDataHdr3a mac_hdr; |
| 588 | #endif |
| 589 | if (LIM_IS_P2P_DEVICE_ROLE(session_entry)) |
| 590 | lim_process_action_frame_no_session(mac_ctx, |
| 591 | (uint8_t *) rx_pkt_buffer); |
| 592 | #ifdef FEATURE_WLAN_TDLS |
| 593 | mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer); |
| 594 | |
| 595 | if (lim_is_group_addr(mac_hdr->addr2)) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 596 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO_HIGH, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | FL("Ignoring A2 Invalid Packet received for MC/BC:")); |
| 598 | lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOG2); |
| 599 | return; |
| 600 | } |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 601 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 602 | FL("type=0x%x, subtype=0x%x"), |
| 603 | mac_hdr->fc.type, mac_hdr->fc.subType); |
| 604 | /* Currently only following type and subtype are handled. |
| 605 | * If there are more combinations, then add switch-case |
| 606 | * statements. |
| 607 | */ |
| 608 | if (LIM_IS_STA_ROLE(session_entry) && |
| 609 | (mac_hdr->fc.type == SIR_MAC_MGMT_FRAME) && |
| 610 | (mac_hdr->fc.subType == SIR_MAC_MGMT_ACTION)) |
| 611 | lim_process_action_frame(mac_ctx, rx_pkt_buffer, session_entry); |
| 612 | #endif |
| 613 | return; |
| 614 | } |
| 615 | |
| 616 | /** |
| 617 | * lim_check_mgmt_registered_frames() - This function handles registered |
| 618 | * management frames. |
| 619 | * |
| 620 | * @mac_ctx: Pointer to the Global Mac Context. |
| 621 | * @buff_desc: Pointer to the packet Buffer descriptor. |
| 622 | * @session_entry: Pointer to the PE Session Entry. |
| 623 | * |
| 624 | * This function is called to process to check if received frame match with |
| 625 | * any of the registered frame from HDD. If yes pass this frame to SME. |
| 626 | * |
| 627 | * Return: True or False for Match or Mismatch respectively. |
| 628 | */ |
| 629 | static bool |
| 630 | lim_check_mgmt_registered_frames(tpAniSirGlobal mac_ctx, uint8_t *buff_desc, |
| 631 | tpPESession session_entry) |
| 632 | { |
| 633 | tSirMacFrameCtl fc; |
| 634 | tpSirMacMgmtHdr hdr; |
| 635 | uint8_t *body; |
| 636 | struct mgmt_frm_reg_info *mgmt_frame = NULL; |
| 637 | struct mgmt_frm_reg_info *next_frm = NULL; |
| 638 | uint16_t frm_type; |
| 639 | uint16_t frm_len; |
| 640 | uint8_t type, sub_type; |
| 641 | bool match = false; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 642 | QDF_STATUS qdf_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 643 | |
| 644 | hdr = WMA_GET_RX_MAC_HEADER(buff_desc); |
| 645 | fc = hdr->fc; |
| 646 | frm_type = (fc.type << 2) | (fc.subType << 4); |
| 647 | body = WMA_GET_RX_MPDU_DATA(buff_desc); |
| 648 | frm_len = WMA_GET_RX_PAYLOAD_LEN(buff_desc); |
| 649 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 650 | qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock); |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 651 | qdf_list_peek_front(&mac_ctx->lim.gLimMgmtFrameRegistratinQueue, |
| 652 | (qdf_list_node_t **) &mgmt_frame); |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 653 | qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 654 | |
| 655 | while (mgmt_frame != NULL) { |
| 656 | type = (mgmt_frame->frameType >> 2) & 0x03; |
| 657 | sub_type = (mgmt_frame->frameType >> 4) & 0x0f; |
| 658 | if ((type == SIR_MAC_MGMT_FRAME) |
| 659 | && (fc.type == SIR_MAC_MGMT_FRAME) |
| 660 | && (sub_type == SIR_MAC_MGMT_RESERVED15)) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 661 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO_HIGH, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 662 | FL |
| 663 | ("rcvd frm match for SIR_MAC_MGMT_RESERVED15")); |
| 664 | match = true; |
| 665 | break; |
| 666 | } |
| 667 | if (mgmt_frame->frameType == frm_type) { |
| 668 | if (mgmt_frame->matchLen <= 0) { |
| 669 | match = true; |
| 670 | break; |
| 671 | } |
| 672 | if (mgmt_frame->matchLen <= frm_len && |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 673 | (!qdf_mem_cmp(mgmt_frame->matchData, body, |
| 674 | mgmt_frame->matchLen))) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 675 | /* found match! */ |
| 676 | match = true; |
| 677 | break; |
| 678 | } |
| 679 | } |
| 680 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 681 | qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock); |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 682 | qdf_status = |
| 683 | qdf_list_peek_next( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 684 | &mac_ctx->lim.gLimMgmtFrameRegistratinQueue, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 685 | (qdf_list_node_t *) mgmt_frame, |
| 686 | (qdf_list_node_t **) &next_frm); |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 687 | qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 688 | mgmt_frame = next_frm; |
| 689 | next_frm = NULL; |
| 690 | } |
| 691 | |
| 692 | if (match) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 693 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 694 | FL("rcvd frame match with registered frame params")); |
| 695 | /* Indicate this to SME */ |
| 696 | lim_send_sme_mgmt_frame_ind(mac_ctx, hdr->fc.subType, |
| 697 | (uint8_t *) hdr, |
| 698 | WMA_GET_RX_PAYLOAD_LEN(buff_desc) + |
| 699 | sizeof(tSirMacMgmtHdr), mgmt_frame->sessionId, |
| 700 | WMA_GET_RX_CH(buff_desc), session_entry, 0); |
| 701 | |
| 702 | if ((type == SIR_MAC_MGMT_FRAME) |
| 703 | && (fc.type == SIR_MAC_MGMT_FRAME) |
| 704 | && (sub_type == SIR_MAC_MGMT_RESERVED15)) |
| 705 | /* These packets needs to be processed by PE/SME |
| 706 | * as well as HDD.If it returns true here, |
| 707 | * the packet is forwarded to HDD only. |
| 708 | */ |
| 709 | match = false; |
| 710 | } |
| 711 | |
| 712 | return match; |
| 713 | } |
| 714 | |
| 715 | /** |
| 716 | * lim_handle80211_frames() |
| 717 | * |
| 718 | ***FUNCTION: |
| 719 | * This function is called to process 802.11 frames |
| 720 | * received by LIM. |
| 721 | * |
| 722 | ***LOGIC: |
| 723 | * NA |
| 724 | * |
| 725 | ***ASSUMPTIONS: |
| 726 | * NA |
| 727 | * |
| 728 | ***NOTE: |
| 729 | * NA |
| 730 | * |
| 731 | * @param pMac - Pointer to Global MAC structure |
| 732 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 733 | * @return None |
| 734 | */ |
| 735 | |
| 736 | static void |
| 737 | lim_handle80211_frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, uint8_t *pDeferMsg) |
| 738 | { |
| 739 | uint8_t *pRxPacketInfo = NULL; |
| 740 | tSirMacFrameCtl fc; |
| 741 | tpSirMacMgmtHdr pHdr = NULL; |
| 742 | tpPESession psessionEntry = NULL; |
| 743 | uint8_t sessionId; |
| 744 | tAniBool isFrmFt = false; |
| 745 | |
| 746 | *pDeferMsg = false; |
| 747 | lim_get_b_dfrom_rx_packet(pMac, limMsg->bodyptr, |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 748 | (uint32_t **) &pRxPacketInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 749 | |
| 750 | pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 751 | isFrmFt = WMA_GET_RX_FT_DONE(pRxPacketInfo); |
| 752 | fc = pHdr->fc; |
| 753 | |
| 754 | #ifdef WLAN_DUMP_MGMTFRAMES |
| 755 | lim_log(pMac, LOGE, |
| 756 | FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
| 757 | fc.protVer, fc.type, fc.subType, |
| 758 | WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 759 | 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] | 760 | WMA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo)); |
| 761 | #endif |
| 762 | if (pMac->fEnableDebugLog & 0x1) { |
| 763 | if ((fc.type == SIR_MAC_MGMT_FRAME) && |
| 764 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) && |
| 765 | (fc.subType != SIR_MAC_MGMT_PROBE_RSP) && |
| 766 | (fc.subType != SIR_MAC_MGMT_BEACON)) { |
| 767 | lim_log(pMac, LOGE, |
| 768 | FL("RX MGMT - Type %hu, SubType %hu, seq num[%d]"), |
| 769 | fc.type, |
| 770 | fc.subType, |
| 771 | ((pHdr->seqControl.seqNumHi << |
| 772 | HIGH_SEQ_NUM_OFFSET) | |
| 773 | pHdr->seqControl.seqNumLo)); |
| 774 | } |
| 775 | } |
| 776 | #ifdef FEATURE_WLAN_EXTSCAN |
| 777 | if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo) || |
| 778 | WMA_IS_EPNO_SCAN_SRC(pRxPacketInfo)) { |
| 779 | if (fc.subType == SIR_MAC_MGMT_BEACON || |
| 780 | fc.subType == SIR_MAC_MGMT_PROBE_RSP) { |
| 781 | __lim_process_ext_scan_beacon_probe_rsp(pMac, |
| 782 | pRxPacketInfo, |
| 783 | fc.subType); |
| 784 | } else { |
| 785 | lim_log(pMac, LOGE, |
| 786 | FL("Wrong frameType %d, Subtype %d for %d"), |
| 787 | fc.type, fc.subType, |
| 788 | WMA_GET_SCAN_SRC(pRxPacketInfo)); |
| 789 | } |
| 790 | goto end; |
| 791 | } |
| 792 | #endif |
| 793 | if (WMA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) { |
| 794 | if (fc.subType == SIR_MAC_MGMT_BEACON) { |
| 795 | lim_log(pMac, LOG2, FL("Learning scan beacon")); |
| 796 | __lim_handle_beacon(pMac, limMsg, NULL); |
| 797 | } else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) { |
| 798 | lim_log(pMac, LOG2, FL("Learning scan probe rsp")); |
| 799 | lim_process_probe_rsp_frame_no_session(pMac, pRxPacketInfo); |
| 800 | } else { |
| 801 | lim_log(pMac, LOGE, |
| 802 | FL("Wrong frame Type %d, Subtype %d for LFR"), |
| 803 | fc.type, fc.subType); |
| 804 | } |
| 805 | goto end; |
| 806 | } |
| 807 | /* Added For BT-AMP Support */ |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 808 | psessionEntry = pe_find_session_by_bssid(pMac, pHdr->bssId, |
| 809 | &sessionId); |
| 810 | if (psessionEntry == NULL) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 811 | if (fc.subType == SIR_MAC_MGMT_AUTH) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 812 | lim_log(pMac, LOG1, |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 813 | FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 814 | fc.protVer, fc.type, fc.subType, |
| 815 | WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
| 816 | lim_print_mac_addr(pMac, pHdr->bssId, LOG1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 817 | if (lim_process_auth_frame_no_session |
| 818 | (pMac, pRxPacketInfo, |
| 819 | limMsg->bodyptr) == eSIR_SUCCESS) { |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 820 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 821 | } |
| 822 | } |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 823 | /* Public action frame can be received from non-assoc stations*/ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 824 | if ((fc.subType != SIR_MAC_MGMT_PROBE_RSP) && |
| 825 | (fc.subType != SIR_MAC_MGMT_BEACON) && |
| 826 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 827 | && (fc.subType != SIR_MAC_MGMT_ACTION)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 828 | |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 829 | psessionEntry = pe_find_session_by_peer_sta(pMac, |
| 830 | pHdr->sa, &sessionId); |
| 831 | if (psessionEntry == NULL) { |
| 832 | lim_log(pMac, LOG3, |
| 833 | FL("session does not exist for bssId")); |
| 834 | lim_print_mac_addr(pMac, pHdr->sa, LOG3); |
| 835 | goto end; |
| 836 | } else { |
| 837 | lim_log(pMac, LOG3, |
| 838 | "SessionId:%d exists for given Bssid", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 839 | psessionEntry->peSessionId); |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 840 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 841 | } |
| 842 | /* For p2p resp frames search for valid session with DA as */ |
| 843 | /* BSSID will be SA and session will be present with DA only */ |
| 844 | if (fc.subType == SIR_MAC_MGMT_ACTION) { |
| 845 | psessionEntry = |
| 846 | pe_find_session_by_bssid(pMac, pHdr->da, &sessionId); |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | /* Check if frame is registered by HDD */ |
| 851 | if (lim_check_mgmt_registered_frames(pMac, pRxPacketInfo, psessionEntry)) { |
| 852 | lim_log(pMac, LOG1, FL("Received frame is passed to SME")); |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 853 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 854 | } |
| 855 | |
| 856 | if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) { /* Received Frame with non-zero Protocol Version */ |
| 857 | lim_log(pMac, LOGE, |
| 858 | FL("Unexpected frame with protVersion %d received"), |
| 859 | fc.protVer); |
| 860 | lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo, |
| 861 | (void *)limMsg->bodyptr); |
| 862 | #ifdef WLAN_DEBUG |
| 863 | pMac->lim.numProtErr++; |
| 864 | #endif |
Vidyullatha Kanchanapally | 3554e4e | 2015-08-12 12:43:18 -0700 | [diff] [blame] | 865 | goto end; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 866 | } |
| 867 | |
| 868 | /* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */ |
| 869 | |
| 870 | #ifdef WLAN_DEBUG |
| 871 | pMac->lim.numMAC[fc.type][fc.subType]++; |
| 872 | #endif |
| 873 | |
| 874 | switch (fc.type) { |
| 875 | case SIR_MAC_MGMT_FRAME: |
| 876 | { |
| 877 | /* Received Management frame */ |
| 878 | switch (fc.subType) { |
| 879 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 880 | /* Make sure the role supports Association */ |
| 881 | if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || |
| 882 | LIM_IS_AP_ROLE(psessionEntry)) |
| 883 | lim_process_assoc_req_frame(pMac, |
| 884 | pRxPacketInfo, |
| 885 | LIM_ASSOC, |
| 886 | psessionEntry); |
| 887 | else { |
| 888 | /* Unwanted messages - Log error */ |
| 889 | lim_log(pMac, LOGE, |
| 890 | FL |
| 891 | ("unexpected message received %X"), |
| 892 | limMsg->type); |
| 893 | lim_print_msg_name(pMac, LOGE, |
| 894 | limMsg->type); |
| 895 | } |
| 896 | break; |
| 897 | |
| 898 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 899 | lim_process_assoc_rsp_frame(pMac, pRxPacketInfo, |
| 900 | LIM_ASSOC, |
| 901 | psessionEntry); |
| 902 | break; |
| 903 | |
| 904 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 905 | /* Make sure the role supports Reassociation */ |
| 906 | if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || |
| 907 | LIM_IS_AP_ROLE(psessionEntry)) { |
| 908 | lim_process_assoc_req_frame(pMac, |
| 909 | pRxPacketInfo, |
| 910 | LIM_REASSOC, |
| 911 | psessionEntry); |
| 912 | } else { |
| 913 | /* Unwanted messages - Log error */ |
| 914 | lim_log(pMac, LOGE, |
| 915 | FL |
| 916 | ("unexpected message received %X"), |
| 917 | limMsg->type); |
| 918 | lim_print_msg_name(pMac, LOGE, |
| 919 | limMsg->type); |
| 920 | } |
| 921 | break; |
| 922 | |
| 923 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 924 | lim_process_assoc_rsp_frame(pMac, pRxPacketInfo, |
| 925 | LIM_REASSOC, |
| 926 | psessionEntry); |
| 927 | break; |
| 928 | |
| 929 | case SIR_MAC_MGMT_PROBE_REQ: |
| 930 | lim_process_probe_req_frame_multiple_bss(pMac, |
| 931 | pRxPacketInfo, |
| 932 | psessionEntry); |
| 933 | break; |
| 934 | |
| 935 | case SIR_MAC_MGMT_PROBE_RSP: |
| 936 | if (psessionEntry == NULL) |
| 937 | lim_process_probe_rsp_frame_no_session(pMac, |
| 938 | pRxPacketInfo); |
| 939 | else |
| 940 | lim_process_probe_rsp_frame(pMac, |
| 941 | pRxPacketInfo, |
| 942 | psessionEntry); |
| 943 | break; |
| 944 | |
| 945 | case SIR_MAC_MGMT_BEACON: |
| 946 | __lim_handle_beacon(pMac, limMsg, psessionEntry); |
| 947 | break; |
| 948 | |
| 949 | case SIR_MAC_MGMT_DISASSOC: |
| 950 | lim_process_disassoc_frame(pMac, pRxPacketInfo, |
| 951 | psessionEntry); |
| 952 | break; |
| 953 | |
| 954 | case SIR_MAC_MGMT_AUTH: |
| 955 | lim_process_auth_frame(pMac, pRxPacketInfo, |
| 956 | psessionEntry); |
| 957 | break; |
| 958 | |
| 959 | case SIR_MAC_MGMT_DEAUTH: |
| 960 | lim_process_deauth_frame(pMac, pRxPacketInfo, |
| 961 | psessionEntry); |
| 962 | break; |
| 963 | |
| 964 | case SIR_MAC_MGMT_ACTION: |
| 965 | if (psessionEntry == NULL) |
| 966 | lim_process_action_frame_no_session(pMac, |
| 967 | pRxPacketInfo); |
| 968 | else { |
| 969 | if (WMA_GET_RX_UNKNOWN_UCAST |
| 970 | (pRxPacketInfo)) |
| 971 | lim_handle_unknown_a2_index_frames |
| 972 | (pMac, pRxPacketInfo, |
| 973 | psessionEntry); |
| 974 | else |
| 975 | lim_process_action_frame(pMac, |
| 976 | pRxPacketInfo, |
| 977 | psessionEntry); |
| 978 | } |
| 979 | break; |
| 980 | default: |
| 981 | /* Received Management frame of 'reserved' subtype */ |
| 982 | break; |
| 983 | } /* switch (fc.subType) */ |
| 984 | |
| 985 | } |
| 986 | break; |
| 987 | case SIR_MAC_DATA_FRAME: |
| 988 | { |
| 989 | } |
| 990 | break; |
| 991 | default: |
| 992 | /* Received frame of type 'reserved' */ |
| 993 | break; |
| 994 | |
| 995 | } /* switch (fc.type) */ |
| 996 | |
| 997 | end: |
| 998 | lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo, |
| 999 | (void *)limMsg->bodyptr); |
| 1000 | return; |
| 1001 | } /*** end lim_handle80211_frames() ***/ |
| 1002 | |
| 1003 | /** |
| 1004 | * lim_send_stop_scan_offload_req() |
| 1005 | * |
| 1006 | ***FUNCTION: |
| 1007 | * This function will be called to abort the ongoing offloaded scan |
| 1008 | * request. |
| 1009 | * |
| 1010 | * |
| 1011 | ***NOTE: |
| 1012 | * |
| 1013 | * @param pMac Pointer to Global MAC structure |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1014 | * @return QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1015 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1016 | QDF_STATUS lim_send_stop_scan_offload_req(tpAniSirGlobal pMac, |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1017 | uint8_t SessionId, uint32_t scan_id, uint32_t scan_requestor_id) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1018 | { |
| 1019 | tSirMsgQ msg; |
| 1020 | tSirRetStatus rc = eSIR_SUCCESS; |
| 1021 | tAbortScanParams *pAbortScanParams; |
| 1022 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1023 | pAbortScanParams = qdf_mem_malloc(sizeof(tAbortScanParams)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1024 | if (NULL == pAbortScanParams) { |
| 1025 | lim_log(pMac, LOGP, |
| 1026 | FL("Memory allocation failed for AbortScanParams")); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1027 | return QDF_STATUS_E_NOMEM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1028 | } |
| 1029 | |
| 1030 | pAbortScanParams->SessionId = SessionId; |
| 1031 | pAbortScanParams->scan_id = scan_id; |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1032 | pAbortScanParams->scan_requestor_id = scan_requestor_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1033 | msg.type = WMA_STOP_SCAN_OFFLOAD_REQ; |
| 1034 | msg.bodyptr = pAbortScanParams; |
| 1035 | msg.bodyval = 0; |
| 1036 | |
| 1037 | rc = wma_post_ctrl_msg(pMac, &msg); |
| 1038 | if (rc != eSIR_SUCCESS) { |
| 1039 | lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure")); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1040 | qdf_mem_free(pAbortScanParams); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1041 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1042 | } |
| 1043 | |
| 1044 | lim_log(pMac, LOG1, FL("Abort ongoing offload scan.")); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1045 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1046 | |
| 1047 | } |
| 1048 | |
| 1049 | /** |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1050 | * lim_process_abort_scan_ind() - abort the scan which is presently being run |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1051 | * |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1052 | * @mac_ctx: Pointer to Global MAC structure |
| 1053 | * @session_id: PE session |
| 1054 | * @scan_id: Scan ID from the scan request |
| 1055 | * @scan_requesor_id: Entity requesting the scan |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1056 | * |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1057 | * @return: None |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1058 | */ |
| 1059 | void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx, |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1060 | uint8_t session_id, uint32_t scan_id, uint32_t scan_requestor_id) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1061 | { |
| 1062 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1063 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, |
| 1064 | NULL, 0, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1065 | #endif |
| 1066 | |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1067 | lim_log(mac_ctx, LOG2, FL("scan_id %d, scan_requestor_id 0x%x"), |
| 1068 | scan_id, scan_requestor_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1069 | |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1070 | /* send stop scan cmd to firmware */ |
| 1071 | lim_send_stop_scan_offload_req(mac_ctx, session_id, scan_id, |
| 1072 | scan_requestor_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1073 | return; |
| 1074 | } |
| 1075 | |
| 1076 | /** |
| 1077 | * lim_message_processor() - Process messages from LIM. |
| 1078 | * |
| 1079 | * @mac_ctx: Pointer to the Global Mac Context. |
| 1080 | * @msg: Received LIM message. |
| 1081 | * |
| 1082 | * Wrapper function for lim_process_messages when handling messages received by |
| 1083 | * LIM.Could either defer messages or process them. |
| 1084 | * |
| 1085 | * Return: None. |
| 1086 | */ |
| 1087 | void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) |
| 1088 | { |
| 1089 | if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { |
| 1090 | pe_free_msg(mac_ctx, msg); |
| 1091 | return; |
| 1092 | } |
| 1093 | |
| 1094 | if (!def_msg_decision(mac_ctx, msg)) { |
| 1095 | lim_process_messages(mac_ctx, msg); |
| 1096 | /* process deferred message queue if allowed */ |
| 1097 | if ((!(mac_ctx->lim.gLimAddtsSent)) && |
| 1098 | (!(lim_is_system_in_scan_state(mac_ctx))) && |
| 1099 | (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) |
| 1100 | lim_process_deferred_message_queue(mac_ctx); |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1105 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1106 | void lim_oem_data_rsp_handle_resume_link_rsp(tpAniSirGlobal pMac, QDF_STATUS status, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1107 | uint32_t *mlmOemDataRsp) |
| 1108 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1109 | if (status != QDF_STATUS_SUCCESS) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1110 | lim_log(pMac, LOGE, |
| 1111 | FL |
| 1112 | ("OEM Data Rsp failed to get the response for resume link")); |
| 1113 | } |
| 1114 | |
| 1115 | if (NULL != pMac->lim.gpLimMlmOemDataReq) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1116 | qdf_mem_free(pMac->lim.gpLimMlmOemDataReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1117 | pMac->lim.gpLimMlmOemDataReq = NULL; |
| 1118 | } |
| 1119 | /* "Failure" status doesn't mean that Oem Data Rsp did not happen */ |
| 1120 | /* and hence we need to respond to upper layers. Only Resume link is failed, but */ |
| 1121 | /* we got the oem data response already. */ |
| 1122 | /* Post the meessage to MLM */ |
| 1123 | lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF, |
| 1124 | (uint32_t *) (mlmOemDataRsp)); |
| 1125 | |
| 1126 | return; |
| 1127 | } |
| 1128 | |
| 1129 | void lim_process_oem_data_rsp(tpAniSirGlobal pMac, uint32_t *body) |
| 1130 | { |
| 1131 | tpLimMlmOemDataRsp mlmOemDataRsp = NULL; |
| 1132 | |
| 1133 | /* Process all the messages for the lim queue */ |
| 1134 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 1135 | |
| 1136 | mlmOemDataRsp = (tpLimMlmOemDataRsp) body; |
| 1137 | |
| 1138 | PELOG1(lim_log |
| 1139 | (pMac, LOG1, FL("%s: sending oem data response msg to sme"), |
| 1140 | __func__); |
| 1141 | ) |
| 1142 | lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF, |
| 1143 | (uint32_t *) (mlmOemDataRsp)); |
| 1144 | |
| 1145 | return; |
| 1146 | } |
| 1147 | |
| 1148 | #endif |
| 1149 | |
| 1150 | /** |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1151 | * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode |
| 1152 | * @mac_ctx: Global MAC context |
| 1153 | * @msg: Received message |
| 1154 | * |
| 1155 | * Checks if hw mode change is required for the new channel. |
| 1156 | * If MCC upgrade is required, this function will start the opportunistic |
| 1157 | * timer and the caller will invoke the other APIs to perform vdev restart on |
| 1158 | * the new channel. |
| 1159 | * |
| 1160 | * If DBS downgrade is required, this function will initiate the hw mode |
| 1161 | * change and vdev restart will happen on the new channel after getting hw |
| 1162 | * mode response |
| 1163 | * |
| 1164 | * Return: QDF_STATUS_SUCCESS if processing of csa params (and hence vdev |
| 1165 | * restart) needs to happen or if no hw mode change is required, |
| 1166 | * QDF_STATUS_E_FAILURE otherwise. |
| 1167 | */ |
| 1168 | static QDF_STATUS lim_handle_hw_mode_change_on_csa(tpAniSirGlobal mac_ctx, |
| 1169 | tpSirMsgQ msg) |
| 1170 | { |
| 1171 | tpPESession session_entry; |
| 1172 | struct csa_offload_params *csa_params = |
| 1173 | (struct csa_offload_params *) (msg->bodyptr); |
| 1174 | tpDphHashNode sta_ds = NULL; |
| 1175 | uint8_t session_id; |
| 1176 | uint16_t aid = 0; |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1177 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
| 1178 | |
| 1179 | lim_log(mac_ctx, LOG1, FL("handle hw mode change for csa")); |
| 1180 | |
| 1181 | if (!csa_params) { |
| 1182 | lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL")); |
| 1183 | /* qdf_mem_free() can handle NULL values */ |
| 1184 | goto err; |
| 1185 | } |
| 1186 | |
| 1187 | session_entry = pe_find_session_by_bssid(mac_ctx, |
| 1188 | csa_params->bssId, &session_id); |
| 1189 | if (!session_entry) { |
| 1190 | lim_log(mac_ctx, LOGE, FL("Session does not exist")); |
| 1191 | goto err; |
| 1192 | } |
| 1193 | |
| 1194 | sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid, |
| 1195 | &session_entry->dph.dphHashTable); |
| 1196 | |
| 1197 | if (!sta_ds) { |
| 1198 | lim_log(mac_ctx, LOGE, FL("sta_ds does not exist")); |
| 1199 | goto err; |
| 1200 | } |
| 1201 | |
Krunal Soni | ee57247 | 2016-02-11 11:48:53 -0800 | [diff] [blame^] | 1202 | status = cds_handle_hw_mode_change_on_csa(session_entry->smeSessionId, |
| 1203 | csa_params->channel, csa_params->bssId, |
| 1204 | &session_entry->saved_csa_params, csa_params, |
| 1205 | sizeof(session_entry->saved_csa_params)); |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1206 | |
Krunal Soni | ee57247 | 2016-02-11 11:48:53 -0800 | [diff] [blame^] | 1207 | if (QDF_IS_STATUS_SUCCESS(status)) |
| 1208 | return status; |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1209 | |
| 1210 | err: |
| 1211 | qdf_mem_free(csa_params); |
| 1212 | return status; |
| 1213 | } |
| 1214 | |
| 1215 | /** |
| 1216 | * lim_handle_hw_mode_change_on_csa_event() - Handle hw mode change on csa |
| 1217 | * @mac_ctx: Pointer to the Global Mac Context |
| 1218 | * @msg: Received message |
| 1219 | * |
| 1220 | * Checks if a hw mode change is required for the received csa event. Processes |
| 1221 | * csa params and do vdev restart immediately if the there is no need for a hw |
| 1222 | * mode change or if MCC upgrade is required |
| 1223 | * |
| 1224 | * Return: None |
| 1225 | */ |
| 1226 | static void lim_handle_hw_mode_change_on_csa_event(tpAniSirGlobal mac_ctx, |
| 1227 | tpSirMsgQ msg) |
| 1228 | { |
| 1229 | QDF_STATUS qdf_status; |
| 1230 | |
| 1231 | lim_log(mac_ctx, LOG1, FL("lim received csa offload event")); |
| 1232 | if (mac_ctx->policy_manager_enabled && |
| 1233 | wma_is_hw_dbs_capable() == true) { |
| 1234 | /* Check if a hw mode change is required */ |
| 1235 | qdf_status = lim_handle_hw_mode_change_on_csa(mac_ctx, |
| 1236 | msg); |
| 1237 | /* Process csa params and do vdev restart immediately if |
| 1238 | * there is no need for a hw mode change or if MCC upgrade is |
| 1239 | * required. |
| 1240 | */ |
| 1241 | if (QDF_IS_STATUS_SUCCESS(qdf_status)) |
| 1242 | lim_handle_csa_offload_msg(mac_ctx, msg); |
| 1243 | } else { |
| 1244 | lim_handle_csa_offload_msg(mac_ctx, msg); |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | /** |
| 1249 | * lim_handle_csa_event_post_dbs_downgrade() - Process csa event post dbs |
| 1250 | * downgrade |
| 1251 | * @mac_ctx: Pointer to the Global Mac Context |
| 1252 | * @msg: Received message |
| 1253 | * |
| 1254 | * Process the csa event to do vdev restart on the new channel after the dbs |
| 1255 | * downgrade. If there was a DBS downgrade as part of the event |
| 1256 | * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will be received after |
| 1257 | * receiving the set hw mode response, where this processing will happen. |
| 1258 | * |
| 1259 | * Return: None |
| 1260 | */ |
| 1261 | static void lim_handle_csa_event_post_dbs_downgrade(tpAniSirGlobal mac_ctx, |
| 1262 | tpSirMsgQ msg) |
| 1263 | { |
| 1264 | tSirMsgQ csa_msg; |
| 1265 | tpPESession session_entry; |
| 1266 | |
| 1267 | struct sir_saved_csa_params *buf = |
| 1268 | (struct sir_saved_csa_params *)msg->bodyptr; |
| 1269 | |
| 1270 | /* Null check for 'msg' already done before coming here in the caller */ |
| 1271 | |
| 1272 | session_entry = pe_find_session_by_sme_session_id(mac_ctx, |
| 1273 | buf->session_id); |
| 1274 | if (!session_entry) { |
| 1275 | lim_log(mac_ctx, LOGE, FL("Invalid session id:%d"), |
| 1276 | buf->session_id); |
| 1277 | return; |
| 1278 | } |
| 1279 | |
| 1280 | lim_log(mac_ctx, LOG1, |
| 1281 | FL("received csa offload event post hw change for %pM"), |
| 1282 | session_entry->saved_csa_params.bssId); |
| 1283 | |
| 1284 | csa_msg.bodyptr = qdf_mem_malloc( |
| 1285 | sizeof(struct csa_offload_params)); |
| 1286 | if (!csa_msg.bodyptr) { |
| 1287 | lim_log(mac_ctx, LOGE, FL("malloc failed for csa msg")); |
| 1288 | goto clean_msg_body; |
| 1289 | } |
| 1290 | |
| 1291 | qdf_mem_copy((void *)csa_msg.bodyptr, |
| 1292 | (void *)&session_entry->saved_csa_params, |
| 1293 | sizeof(struct csa_offload_params)); |
| 1294 | /* If there was a DBS downgrade as part of the event |
| 1295 | * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will |
| 1296 | * be received after receiving the set hw mode response. |
| 1297 | */ |
| 1298 | lim_handle_csa_offload_msg(mac_ctx, &csa_msg); |
| 1299 | clean_msg_body: |
| 1300 | if (msg->bodyptr) |
| 1301 | qdf_mem_free(msg->bodyptr); |
| 1302 | } |
| 1303 | |
| 1304 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1305 | * lim_process_messages() - Process messages from upper layers. |
| 1306 | * |
| 1307 | * @mac_ctx: Pointer to the Global Mac Context. |
| 1308 | * @msg: Received message. |
| 1309 | * |
| 1310 | * Return: None. |
| 1311 | */ |
| 1312 | void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) |
| 1313 | { |
| 1314 | #ifdef FEATURE_AP_MCC_CH_AVOIDANCE |
| 1315 | uint8_t vdev_id = 0; |
| 1316 | tUpdateBeaconParams beacon_params; |
| 1317 | #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ |
| 1318 | uint8_t i; |
| 1319 | uint8_t p2p_go_exists = 0; |
| 1320 | tpPESession session_entry = NULL; |
| 1321 | uint8_t defer_msg = false; |
| 1322 | tLinkStateParams *link_state_param; |
| 1323 | uint16_t pkt_len = 0; |
| 1324 | cds_pkt_t *body_ptr = NULL; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1325 | QDF_STATUS qdf_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1326 | tSirMsgQ new_msg; |
| 1327 | tSirSmeScanAbortReq *req_msg = NULL; |
| 1328 | uint8_t session_id; |
| 1329 | uint32_t scan_id; |
| 1330 | |
| 1331 | #ifdef FEATURE_WLAN_TDLS |
| 1332 | tSirTdlsInd *tdls_ind = NULL; |
| 1333 | tpDphHashNode sta_ds = NULL; |
| 1334 | tTdlsLinkEstablishParams *tdls_link_params = NULL; |
| 1335 | #endif |
| 1336 | tSirMbMsgP2p *p2p_msg = NULL; |
| 1337 | if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1338 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1339 | msg->bodyptr = NULL; |
| 1340 | return; |
| 1341 | } |
| 1342 | if (msg == NULL) { |
| 1343 | lim_log(mac_ctx, LOGE, FL("Message pointer is Null")); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1344 | QDF_ASSERT(0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1345 | return; |
| 1346 | } |
| 1347 | #ifdef WLAN_DEBUG |
| 1348 | mac_ctx->lim.numTot++; |
| 1349 | #endif |
| 1350 | MTRACE(mac_trace_msg_rx(mac_ctx, NO_SESSION, |
| 1351 | LIM_TRACE_MAKE_RXMSG(msg->type, LIM_MSG_PROCESSED));) |
| 1352 | |
| 1353 | switch (msg->type) { |
| 1354 | |
| 1355 | case SIR_LIM_UPDATE_BEACON: |
| 1356 | lim_update_beacon(mac_ctx); |
| 1357 | break; |
| 1358 | case SIR_CFG_PARAM_UPDATE_IND: |
| 1359 | if (!lim_is_system_in_scan_state(mac_ctx)) { |
| 1360 | lim_handle_cf_gparam_update(mac_ctx, msg->bodyval); |
| 1361 | break; |
| 1362 | } |
| 1363 | /* System is in DFS (Learn) mode. |
| 1364 | * Defer processsing this message |
| 1365 | */ |
| 1366 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
| 1367 | if (!(mac_ctx->lim.deferredMsgCnt & 0xF)) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1368 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1369 | FL("Unable to Defer Msg")); |
| 1370 | lim_log_session_states(mac_ctx); |
| 1371 | lim_print_msg_name(mac_ctx, LOGE, msg->type); |
| 1372 | } |
| 1373 | break; |
| 1374 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1375 | case WMA_START_OEM_DATA_RSP: |
| 1376 | lim_process_oem_data_rsp(mac_ctx, msg->bodyptr); |
| 1377 | msg->bodyptr = NULL; |
| 1378 | break; |
| 1379 | #endif |
| 1380 | case WMA_SWITCH_CHANNEL_RSP: |
| 1381 | lim_process_switch_channel_rsp(mac_ctx, msg->bodyptr); |
| 1382 | msg->bodyptr = NULL; |
| 1383 | break; |
| 1384 | #ifdef ANI_SIR_IBSS_PEER_CACHING |
| 1385 | case WMA_IBSS_STA_ADD: |
| 1386 | lim_ibss_sta_add(mac_ctx, msg->bodyptr); |
| 1387 | break; |
| 1388 | #endif |
| 1389 | case SIR_BB_XPORT_MGMT_MSG: |
| 1390 | /* These messages are from Peer MAC entity. */ |
| 1391 | #ifdef WLAN_DEBUG |
| 1392 | mac_ctx->lim.numBbt++; |
| 1393 | #endif |
| 1394 | /* The original msg which we were deferring have the |
| 1395 | * bodyPointer point to 'BD' instead of 'cds pkt'. If we |
| 1396 | * don't make a copy of msg, then overwrite the |
| 1397 | * msg->bodyPointer and next time when we try to |
| 1398 | * process the msg, we will try to use 'BD' as |
| 1399 | * 'cds Pkt' which will cause a crash |
| 1400 | */ |
| 1401 | if (msg->bodyptr == NULL) { |
| 1402 | lim_log(mac_ctx, LOGE, FL("Message bodyptr is Null")); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1403 | QDF_ASSERT(0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1404 | break; |
| 1405 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1406 | qdf_mem_copy((uint8_t *) &new_msg, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1407 | (uint8_t *) msg, sizeof(tSirMsgQ)); |
| 1408 | body_ptr = (cds_pkt_t *) new_msg.bodyptr; |
| 1409 | cds_pkt_get_packet_length(body_ptr, &pkt_len); |
| 1410 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1411 | qdf_status = wma_ds_peek_rx_packet_info(body_ptr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1412 | (void **) &new_msg.bodyptr, false); |
| 1413 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1414 | if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1415 | cds_pkt_return_packet(body_ptr); |
| 1416 | break; |
| 1417 | } |
| 1418 | |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1419 | if (WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr)) |
| 1420 | lim_log(mac_ctx, LOG1, FL("roamCandidateInd %d"), |
| 1421 | WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1422 | |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1423 | if (WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr)) |
| 1424 | lim_log(mac_ctx, LOG1, FL("offloadScanLearn %d"), |
| 1425 | WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1426 | |
| 1427 | lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg); |
| 1428 | |
| 1429 | if (defer_msg == true) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1430 | QDF_TRACE(QDF_MODULE_ID_PE, LOG1, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1431 | FL("Defer Msg type=%x"), msg->type); |
| 1432 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1433 | QDF_TRACE(QDF_MODULE_ID_PE, LOGE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1434 | FL("Unable to Defer Msg")); |
| 1435 | lim_log_session_states(mac_ctx); |
| 1436 | cds_pkt_return_packet(body_ptr); |
| 1437 | } |
| 1438 | } else |
| 1439 | /* PE is not deferring this 802.11 frame so we need to |
| 1440 | * call cds_pkt_return. Asumption here is when Rx mgmt |
| 1441 | * frame processing is done, cds packet could be |
| 1442 | * freed here. |
| 1443 | */ |
| 1444 | cds_pkt_return_packet(body_ptr); |
| 1445 | break; |
| 1446 | case eWNI_SME_SCAN_REQ: |
| 1447 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
| 1448 | case eWNI_SME_DISASSOC_REQ: |
| 1449 | case eWNI_SME_DEAUTH_REQ: |
| 1450 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1451 | case eWNI_SME_OEM_DATA_REQ: |
| 1452 | #endif |
| 1453 | #ifdef FEATURE_WLAN_TDLS |
| 1454 | case eWNI_SME_TDLS_SEND_MGMT_REQ: |
| 1455 | case eWNI_SME_TDLS_ADD_STA_REQ: |
| 1456 | case eWNI_SME_TDLS_DEL_STA_REQ: |
| 1457 | case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: |
| 1458 | #endif |
| 1459 | case eWNI_SME_RESET_AP_CAPS_CHANGED: |
| 1460 | case eWNI_SME_SET_HW_MODE_REQ: |
| 1461 | case eWNI_SME_SET_DUAL_MAC_CFG_REQ: |
| 1462 | /* These messages are from HDD. Need to respond to HDD */ |
| 1463 | lim_process_normal_hdd_msg(mac_ctx, msg, true); |
| 1464 | break; |
| 1465 | |
| 1466 | case eWNI_SME_SCAN_ABORT_IND: |
| 1467 | req_msg = msg->bodyptr; |
| 1468 | if (req_msg) { |
| 1469 | session_id = req_msg->sessionId; |
| 1470 | scan_id = req_msg->scan_id; |
| 1471 | lim_process_abort_scan_ind(mac_ctx, session_id, |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1472 | scan_id, USER_SCAN_REQUESTOR_ID); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1473 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1474 | msg->bodyptr = NULL; |
| 1475 | } |
| 1476 | break; |
| 1477 | case eWNI_SME_SYS_READY_IND: |
| 1478 | case eWNI_SME_JOIN_REQ: |
| 1479 | case eWNI_SME_REASSOC_REQ: |
| 1480 | case eWNI_SME_START_BSS_REQ: |
| 1481 | case eWNI_SME_STOP_BSS_REQ: |
| 1482 | case eWNI_SME_SWITCH_CHL_IND: |
| 1483 | case eWNI_SME_SETCONTEXT_REQ: |
| 1484 | case eWNI_SME_DISASSOC_CNF: |
| 1485 | case eWNI_SME_DEAUTH_CNF: |
| 1486 | case eWNI_SME_ASSOC_CNF: |
| 1487 | case eWNI_SME_ADDTS_REQ: |
| 1488 | case eWNI_SME_DELTS_REQ: |
| 1489 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
| 1490 | case eWNI_SME_TKIP_CNTR_MEAS_REQ: |
| 1491 | case eWNI_SME_UPDATE_APWPSIE_REQ: |
| 1492 | case eWNI_SME_HIDE_SSID_REQ: |
| 1493 | case eWNI_SME_GET_WPSPBC_SESSION_REQ: |
| 1494 | case eWNI_SME_SET_APWPARSNIEs_REQ: |
| 1495 | case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1496 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 1497 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1498 | #if defined FEATURE_WLAN_ESE |
| 1499 | case eWNI_SME_ESE_ADJACENT_AP_REPORT: |
| 1500 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1501 | case eWNI_SME_FT_UPDATE_KEY: |
| 1502 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 1503 | case eWNI_SME_FT_AGGR_QOS_REQ: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1504 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
| 1505 | case eWNI_SME_UPDATE_NOA: |
| 1506 | case eWNI_SME_CLEAR_DFS_CHANNEL_LIST: |
| 1507 | case eWNI_SME_GET_STATISTICS_REQ: |
| 1508 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
| 1509 | case eWNI_SME_GET_TSM_STATS_REQ: |
| 1510 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 1511 | case eWNI_SME_REGISTER_MGMT_FRAME_CB: |
Abhishek Singh | 518323d | 2015-10-19 17:42:01 +0530 | [diff] [blame] | 1512 | case eWNI_SME_EXT_CHANGE_CHANNEL: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1513 | /* These messages are from HDD.No need to respond to HDD */ |
| 1514 | lim_process_normal_hdd_msg(mac_ctx, msg, false); |
| 1515 | break; |
| 1516 | |
| 1517 | case eWNI_PMC_SMPS_STATE_IND: |
| 1518 | if (msg->bodyptr) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1519 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1520 | msg->bodyptr = NULL; |
| 1521 | } |
| 1522 | break; |
| 1523 | case eWNI_SME_SEND_ACTION_FRAME_IND: |
| 1524 | lim_send_p2p_action_frame(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1525 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1526 | msg->bodyptr = NULL; |
| 1527 | break; |
| 1528 | case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND: |
| 1529 | p2p_msg = (tSirMbMsgP2p *) msg->bodyptr; |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 1530 | lim_process_abort_scan_ind(mac_ctx, p2p_msg->sessionId, |
| 1531 | p2p_msg->scan_id, ROC_SCAN_REQUESTOR_ID); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1532 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1533 | msg->bodyptr = NULL; |
| 1534 | break; |
| 1535 | case SIR_HAL_P2P_NOA_START_IND: |
| 1536 | session_entry = &mac_ctx->lim.gpSession[0]; |
| 1537 | lim_log(mac_ctx, LOG1, "LIM received NOA start %x", msg->type); |
| 1538 | |
| 1539 | /* Since insert NOA is done and NOA start msg received, |
| 1540 | * we should deactivate the Insert NOA timer |
| 1541 | */ |
| 1542 | lim_deactivate_and_change_timer(mac_ctx, |
| 1543 | eLIM_INSERT_SINGLESHOT_NOA_TIMER); |
| 1544 | |
| 1545 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 1546 | session_entry = &mac_ctx->lim.gpSession[i]; |
| 1547 | if ((session_entry != NULL) && (session_entry->valid) && |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1548 | (session_entry->pePersona == QDF_P2P_GO_MODE)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1549 | /* Save P2P NOA start attribute for Go persona*/ |
| 1550 | p2p_go_exists = 1; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1551 | qdf_mem_copy(&session_entry->p2pGoPsNoaStartInd, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1552 | msg->bodyptr, sizeof(tSirP2PNoaStart)); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1553 | qdf_status = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1554 | session_entry->p2pGoPsNoaStartInd.status; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1555 | if (qdf_status != QDF_STATUS_SUCCESS) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1556 | QDF_TRACE(QDF_MODULE_ID_PE, LOGW, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1557 | FL( |
| 1558 | "GO NOA start status %d by FW"), |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1559 | qdf_status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1560 | break; |
| 1561 | } |
| 1562 | } |
| 1563 | |
| 1564 | if (p2p_go_exists == 0) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1565 | QDF_TRACE(QDF_MODULE_ID_PE, LOGW, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1566 | FL( |
| 1567 | "GO is removed by the time NOA start recvd")); |
| 1568 | |
| 1569 | /* We received the NOA start indication. Now we can send down |
| 1570 | * the SME request which requires off-channel operation */ |
| 1571 | lim_process_regd_defd_sme_req_after_noa_start(mac_ctx); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1572 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1573 | msg->bodyptr = NULL; |
| 1574 | break; |
| 1575 | #ifdef FEATURE_WLAN_TDLS |
| 1576 | case SIR_HAL_TDLS_IND: |
| 1577 | tdls_ind = (tpSirTdlsInd) msg->bodyptr; |
| 1578 | session_entry = pe_find_session_by_sta_id(mac_ctx, |
| 1579 | tdls_ind->staIdx, &session_id); |
| 1580 | if (session_entry == NULL) { |
| 1581 | lim_log(mac_ctx, LOG1, |
| 1582 | FL("No session exist for given bssId")); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1583 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1584 | msg->bodyptr = NULL; |
| 1585 | return; |
| 1586 | } |
| 1587 | sta_ds = dph_get_hash_entry(mac_ctx, tdls_ind->assocId, |
| 1588 | &session_entry->dph.dphHashTable); |
| 1589 | if (sta_ds == NULL) { |
| 1590 | lim_log(mac_ctx, LOG1, |
| 1591 | FL("No sta_ds exist for given staId")); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1592 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1593 | msg->bodyptr = NULL; |
| 1594 | return; |
| 1595 | } |
| 1596 | |
| 1597 | if (STA_ENTRY_TDLS_PEER == sta_ds->staType) { |
| 1598 | lim_log(mac_ctx, LOGE, |
| 1599 | FL("rcvd TDLS IND from FW with RC %d "), |
| 1600 | tdls_ind->reasonCode); |
| 1601 | lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds, |
| 1602 | session_entry, tdls_ind->reasonCode); |
| 1603 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1604 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1605 | msg->bodyptr = NULL; |
| 1606 | break; |
| 1607 | #endif |
| 1608 | case SIR_HAL_P2P_NOA_ATTR_IND: |
| 1609 | session_entry = &mac_ctx->lim.gpSession[0]; |
| 1610 | lim_log(mac_ctx, LOG1, FL("Received message Noa_ATTR %x"), |
| 1611 | msg->type); |
| 1612 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 1613 | session_entry = &mac_ctx->lim.gpSession[i]; |
| 1614 | if ((session_entry != NULL) && (session_entry->valid) |
| 1615 | && (session_entry->pePersona == |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1616 | QDF_P2P_GO_MODE)) { /* Save P2P attr for Go */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1617 | qdf_mem_copy( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1618 | &session_entry->p2pGoPsUpdate, |
| 1619 | msg->bodyptr, |
| 1620 | sizeof(tSirP2PNoaAttr)); |
| 1621 | lim_log(mac_ctx, LOG2, |
| 1622 | FL("bssId" |
| 1623 | MAC_ADDRESS_STR |
| 1624 | " ctWin=%d oppPsFlag=%d"), |
| 1625 | MAC_ADDR_ARRAY( |
| 1626 | session_entry->bssId), |
| 1627 | session_entry->p2pGoPsUpdate.ctWin, |
| 1628 | session_entry->p2pGoPsUpdate.oppPsFlag); |
| 1629 | lim_log(mac_ctx, LOG2, |
| 1630 | FL |
| 1631 | (" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"), |
| 1632 | session_entry->p2pGoPsUpdate.uNoa1IntervalCnt, |
| 1633 | session_entry->p2pGoPsUpdate.uNoa1Duration, |
| 1634 | session_entry->p2pGoPsUpdate.uNoa1Interval, |
| 1635 | session_entry->p2pGoPsUpdate.uNoa1StartTime); |
| 1636 | break; |
| 1637 | } |
| 1638 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1639 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1640 | msg->bodyptr = NULL; |
| 1641 | break; |
| 1642 | case WMA_MISSED_BEACON_IND: |
| 1643 | lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1644 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1645 | msg->bodyptr = NULL; |
| 1646 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1647 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
| 1648 | lim_process_sme_req_messages(mac_ctx, msg); |
| 1649 | break; |
| 1650 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1651 | case WMA_TSM_STATS_RSP: |
| 1652 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
| 1653 | lim_send_sme_pe_ese_tsm_rsp(mac_ctx, |
| 1654 | (tAniGetTsmStatsRsp *) msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1655 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
| 1656 | break; |
| 1657 | #endif |
| 1658 | case WMA_ADD_TS_RSP: |
| 1659 | lim_process_hal_add_ts_rsp(mac_ctx, msg); |
| 1660 | break; |
| 1661 | case SIR_LIM_DEL_TS_IND: |
| 1662 | lim_process_del_ts_ind(mac_ctx, msg); |
| 1663 | break; |
| 1664 | case SIR_LIM_BEACON_GEN_IND: |
| 1665 | if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE) |
| 1666 | sch_process_pre_beacon_ind(mac_ctx, msg); |
| 1667 | break; |
| 1668 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 1669 | lim_delete_sta_context(mac_ctx, msg); |
| 1670 | break; |
| 1671 | case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT: |
| 1672 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
| 1673 | case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT: |
| 1674 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
| 1675 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
| 1676 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
| 1677 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1678 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1679 | case SIR_LIM_REMAIN_CHN_TIMEOUT: |
| 1680 | case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT: |
| 1681 | case SIR_LIM_DISASSOC_ACK_TIMEOUT: |
| 1682 | case SIR_LIM_DEAUTH_ACK_TIMEOUT: |
| 1683 | case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
| 1684 | /* These timeout messages are handled by MLM sub module */ |
| 1685 | lim_process_mlm_req_messages(mac_ctx, msg); |
| 1686 | break; |
| 1687 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
| 1688 | /** check if heart beat failed, even if one Beacon |
| 1689 | * is rcvd within the Heart Beat interval continue |
| 1690 | * normal processing |
| 1691 | */ |
| 1692 | if (NULL == msg->bodyptr) |
| 1693 | lim_log(mac_ctx, LOGE, |
| 1694 | FL("Can't Process HB TO - bodyptr is Null")); |
| 1695 | else { |
| 1696 | session_entry = (tpPESession) msg->bodyptr; |
| 1697 | lim_log(mac_ctx, LOGE, |
| 1698 | FL |
| 1699 | ("SIR_LIM_HEART_BEAT_TIMEOUT, Session %d"), |
| 1700 | ((tpPESession) msg->bodyptr)->peSessionId); |
| 1701 | limResetHBPktCount(session_entry); |
| 1702 | lim_handle_heart_beat_timeout_for_session(mac_ctx, |
| 1703 | session_entry); |
| 1704 | } |
| 1705 | break; |
| 1706 | case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT: |
| 1707 | lim_handle_heart_beat_failure_timeout(mac_ctx); |
| 1708 | break; |
| 1709 | case SIR_LIM_HASH_MISS_THRES_TIMEOUT: |
| 1710 | mac_ctx->lim.gLimDisassocFrameCredit = 0; |
| 1711 | break; |
| 1712 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
| 1713 | /* Does not receive CNF or dummy packet */ |
| 1714 | lim_handle_cnf_wait_timeout(mac_ctx, (uint16_t) msg->bodyval); |
| 1715 | break; |
| 1716 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
| 1717 | /* Message from ISR upon TFP's max retry limit interrupt */ |
| 1718 | break; |
| 1719 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
| 1720 | /* Message from ISR upon SP's Invalid session key interrupt */ |
| 1721 | break; |
| 1722 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
| 1723 | /* Message from ISR upon SP's Invalid key ID interrupt */ |
| 1724 | break; |
| 1725 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
| 1726 | /* Message from ISR upon SP's Replay threshold interrupt */ |
| 1727 | break; |
| 1728 | case SIR_LIM_CHANNEL_SWITCH_TIMEOUT: |
| 1729 | lim_process_channel_switch_timeout(mac_ctx); |
| 1730 | break; |
| 1731 | case SIR_LIM_QUIET_TIMEOUT: |
| 1732 | lim_process_quiet_timeout(mac_ctx); |
| 1733 | break; |
| 1734 | case SIR_LIM_QUIET_BSS_TIMEOUT: |
| 1735 | lim_process_quiet_bss_timeout(mac_ctx); |
| 1736 | break; |
| 1737 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
| 1738 | lim_handle_update_olbc_cache(mac_ctx); |
| 1739 | break; |
| 1740 | #ifdef FEATURE_WLAN_TDLS |
| 1741 | case SIR_HAL_TDLS_SHOULD_DISCOVER: |
| 1742 | case SIR_HAL_TDLS_SHOULD_TEARDOWN: |
| 1743 | case SIR_HAL_TDLS_PEER_DISCONNECTED: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 1744 | QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1745 | ("%s received tdls event: 0x%x"), __func__, msg->type); |
| 1746 | lim_send_sme_tdls_event_notify(mac_ctx, msg->type, |
| 1747 | (void *)msg->bodyptr); |
| 1748 | break; |
| 1749 | #endif |
| 1750 | case WMA_ADD_BSS_RSP: |
| 1751 | lim_process_mlm_add_bss_rsp(mac_ctx, msg); |
| 1752 | break; |
| 1753 | case WMA_ADD_STA_RSP: |
| 1754 | lim_process_add_sta_rsp(mac_ctx, msg); |
| 1755 | break; |
| 1756 | case WMA_DELETE_STA_RSP: |
| 1757 | lim_process_mlm_del_sta_rsp(mac_ctx, msg); |
| 1758 | break; |
| 1759 | case WMA_DELETE_BSS_RSP: |
| 1760 | lim_handle_delete_bss_rsp(mac_ctx, msg); |
| 1761 | break; |
| 1762 | case WMA_CSA_OFFLOAD_EVENT: |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1763 | lim_handle_hw_mode_change_on_csa_event(mac_ctx, msg); |
| 1764 | break; |
| 1765 | case SIR_LIM_CSA_POST_HW_MODE_CHANGE: |
| 1766 | lim_handle_csa_event_post_dbs_downgrade(mac_ctx, msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1767 | break; |
| 1768 | case WMA_SET_BSSKEY_RSP: |
| 1769 | case WMA_SET_STA_BCASTKEY_RSP: |
| 1770 | lim_process_mlm_set_bss_key_rsp(mac_ctx, msg); |
| 1771 | break; |
| 1772 | case WMA_SET_STAKEY_RSP: |
| 1773 | lim_process_mlm_set_sta_key_rsp(mac_ctx, msg); |
| 1774 | break; |
| 1775 | case WMA_GET_STATISTICS_RSP: |
| 1776 | lim_send_sme_pe_statistics_rsp(mac_ctx, msg->type, |
| 1777 | (void *)msg->bodyptr); |
| 1778 | break; |
| 1779 | case WMA_SET_MIMOPS_RSP: |
| 1780 | case WMA_SET_TX_POWER_RSP: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1781 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1782 | msg->bodyptr = NULL; |
| 1783 | break; |
| 1784 | case WMA_SET_MAX_TX_POWER_RSP: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1785 | rrm_set_max_tx_power_rsp(mac_ctx, msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1786 | if (msg->bodyptr != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1787 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1788 | msg->bodyptr = NULL; |
| 1789 | } |
| 1790 | break; |
| 1791 | case SIR_LIM_ADDR2_MISS_IND: |
| 1792 | lim_log(mac_ctx, LOGE, |
| 1793 | FL("Addr2 mismatch interrupt received %X"), msg->type); |
| 1794 | /* message from HAL indicating addr2 mismatch interrupt occurred |
| 1795 | * msg->bodyptr contains only pointer to 48-bit addr2 field |
| 1796 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1797 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1798 | msg->bodyptr = NULL; |
| 1799 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1800 | case WMA_AGGR_QOS_RSP: |
| 1801 | lim_process_ft_aggr_qo_s_rsp(mac_ctx, msg); |
| 1802 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1803 | case WMA_SET_LINK_STATE_RSP: |
| 1804 | link_state_param = (tLinkStateParams *) msg->bodyptr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1805 | session_entry = link_state_param->session; |
| 1806 | if (link_state_param->ft |
| 1807 | #if defined WLAN_FEATURE_ROAM_OFFLOAD |
| 1808 | && !session_entry->bRoamSynchInProgress |
| 1809 | #endif |
| 1810 | ) |
| 1811 | lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac_ctx, |
| 1812 | session_entry->pLimMlmReassocReq, |
| 1813 | session_entry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1814 | if (link_state_param->callback) |
| 1815 | link_state_param->callback(mac_ctx, |
| 1816 | link_state_param->callbackArg, |
| 1817 | link_state_param->status); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1818 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1819 | msg->bodyptr = NULL; |
| 1820 | break; |
| 1821 | case eWNI_SME_SET_BCN_FILTER_REQ: |
| 1822 | session_id = (uint8_t) msg->bodyval; |
| 1823 | session_entry = &mac_ctx->lim.gpSession[session_id]; |
| 1824 | if ((session_entry != NULL) && |
| 1825 | (lim_send_beacon_filter_info(mac_ctx, session_entry) != |
| 1826 | eSIR_SUCCESS)) |
| 1827 | lim_log(mac_ctx, LOGE, |
| 1828 | FL("Failied to send Beacon Filter Info ")); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1829 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1830 | msg->bodyptr = NULL; |
| 1831 | break; |
| 1832 | #ifdef FEATURE_WLAN_TDLS |
| 1833 | case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP: |
| 1834 | tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr; |
| 1835 | session_entry = pe_find_session_by_sta_id(mac_ctx, |
| 1836 | tdls_link_params->staIdx, &session_id); |
| 1837 | if (session_entry == NULL) { |
| 1838 | lim_log(mac_ctx, LOGE, |
| 1839 | FL("session %u does not exist"), session_id); |
| 1840 | /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP |
| 1841 | * message to SME with session id as zero and status |
| 1842 | * as FAILURE so, that message queued in SME queue |
| 1843 | * can be freed to prevent the SME cmd buffer leak |
| 1844 | */ |
| 1845 | lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0, |
| 1846 | NULL, NULL, eSIR_FAILURE); |
| 1847 | } else { |
| 1848 | lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, |
| 1849 | session_entry->smeSessionId, NULL, NULL, |
| 1850 | tdls_link_params->status); |
| 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; |
| 1855 | #endif |
| 1856 | case WMA_RX_SCAN_EVENT: |
| 1857 | lim_process_rx_scan_event(mac_ctx, msg->bodyptr); |
| 1858 | break; |
| 1859 | case WMA_IBSS_PEER_INACTIVITY_IND: |
| 1860 | lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1861 | qdf_mem_free((void *)(msg->bodyptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1862 | msg->bodyptr = NULL; |
| 1863 | break; |
| 1864 | case WMA_DFS_RADAR_IND: |
| 1865 | lim_send_sme_dfs_event_notify(mac_ctx, msg->type, |
| 1866 | (void *)msg->bodyptr); |
| 1867 | /* msg->bodyptr will be freed up by SME/CSR */ |
| 1868 | break; |
| 1869 | case WMA_DFS_BEACON_TX_SUCCESS_IND: |
| 1870 | lim_process_beacon_tx_success_ind(mac_ctx, msg->type, |
| 1871 | (void *)msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1872 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1873 | msg->bodyptr = NULL; |
| 1874 | break; |
| 1875 | case WMA_DISASSOC_TX_COMP: |
| 1876 | lim_disassoc_tx_complete_cnf(mac_ctx, msg->bodyval); |
| 1877 | break; |
| 1878 | case WMA_DEAUTH_TX_COMP: |
| 1879 | lim_deauth_tx_complete_cnf(mac_ctx, msg->bodyval); |
| 1880 | break; |
| 1881 | #ifdef FEATURE_AP_MCC_CH_AVOIDANCE |
| 1882 | case WMA_UPDATE_Q2Q_IE_IND: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1883 | qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1884 | beacon_params.paramChangeBitmap = 0; |
| 1885 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 1886 | vdev_id = ((uint8_t *)msg->bodyptr)[i]; |
| 1887 | session_entry = pe_find_session_by_sme_session_id( |
| 1888 | mac_ctx, vdev_id); |
| 1889 | if (session_entry == NULL) |
| 1890 | continue; |
| 1891 | session_entry->sap_advertise_avoid_ch_ie = |
| 1892 | (uint8_t)msg->bodyval; |
| 1893 | /* |
| 1894 | * if message comes for DFS channel, no need to update: |
| 1895 | * 1) We wont have MCC with DFS channels. so no need to |
| 1896 | * add Q2Q IE |
| 1897 | * 2) We cannot end up in DFS channel SCC by channel |
| 1898 | * switch from non DFS MCC scenario, so no need to |
| 1899 | * remove Q2Q IE |
| 1900 | * 3) There is however a case where device start MCC and |
| 1901 | * then user modifies hostapd.conf and does SAP |
| 1902 | * restart, in such a case, beacon params will be |
| 1903 | * reset and thus will not contain Q2Q IE, by default |
| 1904 | */ |
| 1905 | if (cds_get_channel_state( |
| 1906 | session_entry->currentOperChannel) |
| 1907 | != CHANNEL_STATE_DFS) { |
| 1908 | beacon_params.bssIdx = session_entry->bssIdx; |
| 1909 | beacon_params.beaconInterval = |
| 1910 | session_entry->beaconParams.beaconInterval; |
| 1911 | beacon_params.paramChangeBitmap |= |
| 1912 | PARAM_BCN_INTERVAL_CHANGED; |
| 1913 | sch_set_fixed_beacon_fields(mac_ctx, |
| 1914 | session_entry); |
| 1915 | lim_send_beacon_params(mac_ctx, &beacon_params, |
| 1916 | session_entry); |
| 1917 | } |
| 1918 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1919 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1920 | msg->bodyptr = NULL; |
| 1921 | break; |
| 1922 | #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ |
| 1923 | case eWNI_SME_NSS_UPDATE_REQ: |
| 1924 | case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ: |
| 1925 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1926 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1927 | msg->bodyptr = NULL; |
| 1928 | break; |
| 1929 | case eWNI_SME_CHANNEL_CHANGE_REQ: |
| 1930 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1931 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1932 | msg->bodyptr = NULL; |
| 1933 | break; |
| 1934 | case eWNI_SME_START_BEACON_REQ: |
| 1935 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1936 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1937 | msg->bodyptr = NULL; |
| 1938 | break; |
| 1939 | case eWNI_SME_UPDATE_ADDITIONAL_IES: |
| 1940 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1941 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1942 | msg->bodyptr = NULL; |
| 1943 | break; |
| 1944 | case eWNI_SME_MODIFY_ADDITIONAL_IES: |
| 1945 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1946 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1947 | msg->bodyptr = NULL; |
| 1948 | break; |
| 1949 | #ifdef QCA_HT_2040_COEX |
| 1950 | case eWNI_SME_SET_HT_2040_MODE: |
| 1951 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1952 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1953 | msg->bodyptr = NULL; |
| 1954 | break; |
| 1955 | #endif |
| 1956 | case SIR_HAL_SOC_SET_HW_MODE_RESP: |
| 1957 | lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr); |
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 SIR_HAL_SOC_HW_MODE_TRANS_IND: |
| 1962 | lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr); |
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 | case SIR_HAL_SOC_DUAL_MAC_CFG_RESP: |
| 1967 | lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1968 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1969 | msg->bodyptr = NULL; |
| 1970 | break; |
| 1971 | case eWNI_SME_SET_IE_REQ: |
| 1972 | lim_process_sme_req_messages(mac_ctx, msg); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1973 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1974 | msg->bodyptr = NULL; |
| 1975 | break; |
| 1976 | default: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1977 | qdf_mem_free((void *)msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1978 | msg->bodyptr = NULL; |
| 1979 | /* Unwanted messages */ |
| 1980 | /* Log error */ |
| 1981 | lim_log(mac_ctx, LOGE, |
| 1982 | FL("Discarding unexpected message received %X"), |
| 1983 | msg->type); |
| 1984 | lim_print_msg_name(mac_ctx, LOGE, msg->type); |
| 1985 | break; |
| 1986 | |
| 1987 | } /* switch (msg->type) */ |
| 1988 | } /*** end lim_process_messages() ***/ |
| 1989 | |
| 1990 | /** |
| 1991 | * lim_process_deferred_message_queue |
| 1992 | * |
| 1993 | ***FUNCTION: |
| 1994 | * This function is called by LIM while exiting from Learn |
| 1995 | * mode. This function fetches messages posted to the LIM |
| 1996 | * deferred message queue limDeferredMsgQ. |
| 1997 | * |
| 1998 | ***LOGIC: |
| 1999 | * |
| 2000 | ***ASSUMPTIONS: |
| 2001 | * NA |
| 2002 | * |
| 2003 | ***NOTE: |
| 2004 | * NA |
| 2005 | * |
| 2006 | * @param pMac - Pointer to Global MAC structure |
| 2007 | * @return None |
| 2008 | */ |
| 2009 | |
| 2010 | void lim_process_deferred_message_queue(tpAniSirGlobal pMac) |
| 2011 | { |
| 2012 | tSirMsgQ limMsg = { 0, 0, 0 }; |
| 2013 | |
| 2014 | tSirMsgQ *readMsg; |
| 2015 | uint16_t size; |
| 2016 | |
| 2017 | /* |
| 2018 | ** check any deferred messages need to be processed |
| 2019 | **/ |
| 2020 | size = pMac->lim.gLimDeferredMsgQ.size; |
| 2021 | if (size > 0) { |
| 2022 | while ((readMsg = lim_read_deferred_msg_q(pMac)) != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2023 | qdf_mem_copy((uint8_t *) &limMsg, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2024 | (uint8_t *) readMsg, sizeof(tSirMsgQ)); |
| 2025 | size--; |
| 2026 | lim_process_messages(pMac, &limMsg); |
| 2027 | |
| 2028 | if ((lim_is_system_in_scan_state(pMac)) |
| 2029 | || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
Hema Aparna Medicharla | 5e1f302 | 2015-08-24 11:22:29 +0530 | [diff] [blame] | 2030 | || (pMac->lim.gLimSystemInScanLearnMode) |
| 2031 | || pMac->lim.gLimAddtsSent) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2032 | break; |
| 2033 | } |
| 2034 | } |
| 2035 | } /*** end lim_process_deferred_message_queue() ***/ |
| 2036 | |
| 2037 | /** |
| 2038 | * lim_process_normal_hdd_msg() - Process the message and defer if needed |
| 2039 | * @mac_ctx : Pointer to Global MAC structure |
| 2040 | * @msg : The message need to be processed |
| 2041 | * @rsp_reqd: whether return result to hdd |
| 2042 | * |
| 2043 | * This function checks the current lim state and decide whether the message |
| 2044 | * passed will be deferred or not. |
| 2045 | * |
| 2046 | * Return: None |
| 2047 | */ |
| 2048 | static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, tSirMsgQ *msg, |
| 2049 | uint8_t rsp_reqd) |
| 2050 | { |
| 2051 | bool defer_msg = true; |
| 2052 | |
| 2053 | /* Added For BT-AMP Support */ |
| 2054 | if ((mac_ctx->lim.gLimSystemRole == eLIM_AP_ROLE) |
| 2055 | || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE) |
| 2056 | || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE) |
| 2057 | || (mac_ctx->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) { |
| 2058 | /* |
| 2059 | * This check is required only for the AP and in 2 cases. |
| 2060 | * 1. If we are in learn mode and we receive any of these |
| 2061 | * messages, you have to come out of scan and process the |
| 2062 | * message, hence dont defer the message here. In handler, |
| 2063 | * these message could be defered till we actually come out of |
| 2064 | * scan mode. |
| 2065 | * 2. If radar is detected, you might have to defer all of |
| 2066 | * these messages except Stop BSS request/ Switch channel |
| 2067 | * request. This decision is also made inside its handler. |
| 2068 | * |
| 2069 | * Please be careful while using the flag defer_msg. Possibly |
| 2070 | * you might end up in an infinite loop. |
| 2071 | */ |
| 2072 | if ((msg->type == eWNI_SME_START_BSS_REQ) || |
| 2073 | (msg->type == eWNI_SME_STOP_BSS_REQ) || |
| 2074 | (msg->type == eWNI_SME_SWITCH_CHL_IND)) |
| 2075 | defer_msg = false; |
| 2076 | } |
| 2077 | |
| 2078 | if (((mac_ctx->lim.gLimAddtsSent) || |
| 2079 | (lim_is_system_in_scan_state(mac_ctx))) && defer_msg) { |
| 2080 | /* |
| 2081 | * System is in DFS (Learn) mode or awaiting addts response or |
| 2082 | * if radar is detected, Defer processsing this message |
| 2083 | */ |
| 2084 | if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) { |
| 2085 | #ifdef WLAN_DEBUG |
| 2086 | mac_ctx->lim.numSme++; |
| 2087 | #endif |
| 2088 | lim_log_session_states(mac_ctx); |
| 2089 | /* Release body */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2090 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2091 | msg->bodyptr = NULL; |
| 2092 | } |
| 2093 | } else { |
| 2094 | /* |
| 2095 | * These messages are from HDD.Since these requests may also be |
| 2096 | * generated internally within LIM module, need to distinquish |
| 2097 | * and send response to host |
| 2098 | */ |
| 2099 | if (rsp_reqd) |
| 2100 | mac_ctx->lim.gLimRspReqd = true; |
| 2101 | #ifdef WLAN_DEBUG |
| 2102 | mac_ctx->lim.numSme++; |
| 2103 | #endif |
| 2104 | if (lim_process_sme_req_messages(mac_ctx, msg)) { |
| 2105 | /* |
| 2106 | * Release body. limProcessSmeReqMessage consumed the |
| 2107 | * buffer. We can free it. |
| 2108 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2109 | qdf_mem_free(msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2110 | msg->bodyptr = NULL; |
| 2111 | } |
| 2112 | } |
| 2113 | } |
| 2114 | |
| 2115 | void |
| 2116 | handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac, |
| 2117 | tpPESession psessionEntry) |
| 2118 | { |
| 2119 | tSirMacHTCapabilityInfo macHTCapabilityInfo; |
| 2120 | tSirMacHTParametersInfo macHTParametersInfo; |
| 2121 | tSirMacHTInfoField1 macHTInfoField1; |
| 2122 | tSirMacHTInfoField2 macHTInfoField2; |
| 2123 | tSirMacHTInfoField3 macHTInfoField3; |
| 2124 | uint32_t cfgValue; |
| 2125 | uint8_t *ptr; |
| 2126 | |
| 2127 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != |
| 2128 | eSIR_SUCCESS) { |
| 2129 | lim_log(pMac, LOGP, |
| 2130 | FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value")); |
| 2131 | return; |
| 2132 | } |
| 2133 | ptr = (uint8_t *) &macHTCapabilityInfo; |
| 2134 | *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff); |
| 2135 | pMac->lim.gHTLsigTXOPProtection = |
| 2136 | (uint8_t) macHTCapabilityInfo.lsigTXOPProtection; |
| 2137 | pMac->lim.gHTMIMOPSState = |
| 2138 | (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave; |
| 2139 | pMac->lim.gHTGreenfield = (uint8_t) macHTCapabilityInfo.greenField; |
| 2140 | pMac->lim.gHTMaxAmsduLength = |
| 2141 | (uint8_t) macHTCapabilityInfo.maximalAMSDUsize; |
| 2142 | pMac->lim.gHTShortGI20Mhz = (uint8_t) macHTCapabilityInfo.shortGI20MHz; |
| 2143 | pMac->lim.gHTShortGI40Mhz = (uint8_t) macHTCapabilityInfo.shortGI40MHz; |
| 2144 | pMac->lim.gHTPSMPSupport = (uint8_t) macHTCapabilityInfo.psmp; |
| 2145 | pMac->lim.gHTDsssCckRate40MHzSupport = |
| 2146 | (uint8_t) macHTCapabilityInfo.dsssCckMode40MHz; |
| 2147 | |
| 2148 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != |
| 2149 | eSIR_SUCCESS) { |
| 2150 | lim_log(pMac, LOGP, |
| 2151 | FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value")); |
| 2152 | return; |
| 2153 | } |
| 2154 | ptr = (uint8_t *) &macHTParametersInfo; |
| 2155 | *ptr = (uint8_t) (cfgValue & 0xff); |
| 2156 | pMac->lim.gHTAMpduDensity = (uint8_t) macHTParametersInfo.mpduDensity; |
| 2157 | pMac->lim.gHTMaxRxAMpduFactor = |
| 2158 | (uint8_t) macHTParametersInfo.maxRxAMPDUFactor; |
| 2159 | |
| 2160 | /* Get HT IE Info */ |
| 2161 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != |
| 2162 | eSIR_SUCCESS) { |
| 2163 | lim_log(pMac, LOGP, |
| 2164 | FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value")); |
| 2165 | return; |
| 2166 | } |
| 2167 | ptr = (uint8_t *) &macHTInfoField1; |
| 2168 | *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff); |
| 2169 | pMac->lim.gHTServiceIntervalGranularity = |
| 2170 | (uint8_t) macHTInfoField1.serviceIntervalGranularity; |
| 2171 | pMac->lim.gHTControlledAccessOnly = |
| 2172 | (uint8_t) macHTInfoField1.controlledAccessOnly; |
| 2173 | pMac->lim.gHTRifsMode = (uint8_t) macHTInfoField1.rifsMode; |
| 2174 | |
| 2175 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != |
| 2176 | eSIR_SUCCESS) { |
| 2177 | lim_log(pMac, LOGP, |
| 2178 | FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value")); |
| 2179 | return; |
| 2180 | } |
| 2181 | ptr = (uint8_t *) &macHTInfoField2; |
| 2182 | *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff); |
| 2183 | pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode; |
| 2184 | |
| 2185 | if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != |
| 2186 | eSIR_SUCCESS) { |
| 2187 | lim_log(pMac, LOGP, |
| 2188 | FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value")); |
| 2189 | return; |
| 2190 | } |
| 2191 | ptr = (uint8_t *) &macHTInfoField3; |
| 2192 | *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff); |
| 2193 | pMac->lim.gHTPCOActive = (uint8_t) macHTInfoField3.pcoActive; |
| 2194 | pMac->lim.gHTPCOPhase = (uint8_t) macHTInfoField3.pcoPhase; |
| 2195 | pMac->lim.gHTSecondaryBeacon = |
| 2196 | (uint8_t) macHTInfoField3.secondaryBeacon; |
| 2197 | pMac->lim.gHTDualCTSProtection = |
| 2198 | (uint8_t) macHTInfoField3.dualCTSProtection; |
| 2199 | pMac->lim.gHTSTBCBasicMCS = (uint8_t) macHTInfoField3.basicSTBCMCS; |
| 2200 | |
| 2201 | /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session; |
| 2202 | * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old); |
| 2203 | * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist |
| 2204 | * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below |
| 2205 | */ |
| 2206 | if (psessionEntry != NULL) { |
| 2207 | psessionEntry->htCapability = |
| 2208 | IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 2209 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2210 | (uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport; |
| 2211 | } |
| 2212 | } |
| 2213 | |
| 2214 | void lim_log_session_states(tpAniSirGlobal mac_ctx) |
| 2215 | { |
| 2216 | #ifdef WLAN_DEBUG |
| 2217 | int i; |
| 2218 | |
| 2219 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 2220 | if (mac_ctx->lim.gpSession[i].valid) { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 2221 | QDF_TRACE(QDF_MODULE_ID_PE, LOG1, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2222 | FL("sysRole(%d) Session (%d)"), |
| 2223 | mac_ctx->lim.gLimSystemRole, i); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 2224 | QDF_TRACE(QDF_MODULE_ID_PE, LOG1, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2225 | FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"), |
| 2226 | lim_sme_state_str( |
| 2227 | mac_ctx->lim.gpSession[i].limSmeState), |
| 2228 | lim_sme_state_str( |
| 2229 | mac_ctx->lim.gpSession[i].limPrevSmeState), |
| 2230 | lim_mlm_state_str( |
| 2231 | mac_ctx->lim.gpSession[i].limMlmState), |
| 2232 | lim_mlm_state_str( |
| 2233 | mac_ctx->lim.gpSession[i].limPrevMlmState)); |
| 2234 | } |
| 2235 | } |
| 2236 | #endif |
| 2237 | } |