Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Kiran Kumar Lokere | 4712748 | 2017-12-20 18:09:55 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 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_send_sme_rspMessages.cc contains the functions |
| 30 | * for sending SME response/notification messages to applications |
| 31 | * above MAC software. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 02/13/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | */ |
| 38 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 39 | #include "qdf_types.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 40 | #include "wni_api.h" |
| 41 | #include "sir_common.h" |
| 42 | #include "ani_global.h" |
| 43 | |
| 44 | #include "wni_cfg.h" |
| 45 | #include "sys_def.h" |
| 46 | #include "cfg_api.h" |
| 47 | |
| 48 | #include "sch_api.h" |
| 49 | #include "utils_api.h" |
| 50 | #include "lim_utils.h" |
| 51 | #include "lim_security_utils.h" |
| 52 | #include "lim_ser_des_utils.h" |
| 53 | #include "lim_send_sme_rsp_messages.h" |
| 54 | #include "lim_ibss_peer_mgmt.h" |
| 55 | #include "lim_session_utils.h" |
| 56 | #include "lim_types.h" |
| 57 | #include "sir_api.h" |
Naveen Rawat | 3b6068c | 2016-04-14 19:01:06 -0700 | [diff] [blame] | 58 | #include "cds_regdomain.h" |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 59 | #include "lim_send_messages.h" |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 60 | #include "nan_datapath.h" |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 61 | #include "lim_assoc_utils.h" |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 62 | #include "wlan_reg_services_api.h" |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 63 | #include "wlan_utility.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 64 | |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 65 | #include "wlan_tdls_tgt_api.h" |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 66 | #include "lim_process_fils.h" |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 67 | #include "wma.h" |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 68 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx, |
| 70 | tpPESession session_entry, tSirResultCodes result_code, |
| 71 | tpSirSmeJoinRsp sme_join_rsp); |
| 72 | |
| 73 | /** |
| 74 | * lim_send_sme_rsp() - Send Response to upper layers |
| 75 | * @mac_ctx: Pointer to Global MAC structure |
| 76 | * @msg_type: Indicates message type |
| 77 | * @result_code: Indicates the result of previously issued |
| 78 | * eWNI_SME_msg_type_REQ message |
| 79 | * |
| 80 | * This function is called by lim_process_sme_req_messages() to send |
| 81 | * eWNI_SME_START_RSP, eWNI_SME_STOP_BSS_RSP |
| 82 | * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC |
| 83 | * Software. |
| 84 | * |
| 85 | * Return: None |
| 86 | */ |
| 87 | |
| 88 | void |
| 89 | lim_send_sme_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type, |
| 90 | tSirResultCodes result_code, uint8_t sme_session_id, |
| 91 | uint16_t sme_transaction_id) |
| 92 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 93 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 94 | tSirSmeRsp *sme_rsp; |
| 95 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 96 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | lim_msg_str(msg_type), lim_result_code_str(result_code)); |
| 98 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 99 | sme_rsp = qdf_mem_malloc(sizeof(tSirSmeRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 100 | if (NULL == sme_rsp) { |
| 101 | /* Buffer not available. Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 102 | pe_err("call to AllocateMemory failed for eWNI_SME_*_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 103 | return; |
| 104 | } |
| 105 | |
| 106 | sme_rsp->messageType = msg_type; |
| 107 | sme_rsp->length = sizeof(tSirSmeRsp); |
| 108 | sme_rsp->statusCode = result_code; |
| 109 | |
| 110 | sme_rsp->sessionId = sme_session_id; |
| 111 | sme_rsp->transactionId = sme_transaction_id; |
| 112 | |
| 113 | msg.type = msg_type; |
| 114 | msg.bodyptr = sme_rsp; |
| 115 | msg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 116 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, |
| 117 | sme_session_id, msg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 118 | |
| 119 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 120 | switch (msg_type) { |
| 121 | case eWNI_SME_STOP_BSS_RSP: |
| 122 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, |
| 123 | NULL, (uint16_t) result_code, 0); |
| 124 | break; |
| 125 | } |
| 126 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 127 | lim_sys_process_mmh_msg_api(mac_ctx, &msg, ePROT); |
| 128 | } |
| 129 | |
| 130 | |
| 131 | |
| 132 | /** |
| 133 | * lim_send_sme_roc_rsp() - Send Response to SME |
| 134 | * @mac_ctx: Pointer to Global MAC structure |
| 135 | * @status: Resume link status |
| 136 | * @result_code: Result of the ROC request |
| 137 | * @sme_session_id: SME sesson Id |
| 138 | * @scan_id: Scan Identifier |
| 139 | * |
| 140 | * This function is called to send ROC rsp |
| 141 | * message to SME. |
| 142 | * |
| 143 | * Return: None |
| 144 | */ |
| 145 | void |
| 146 | lim_send_sme_roc_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type, |
| 147 | tSirResultCodes result_code, uint8_t sme_session_id, |
| 148 | uint32_t scan_id) |
| 149 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 150 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 151 | struct sir_roc_rsp *sme_rsp; |
| 152 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 153 | pe_debug("Sending message: %s with reasonCode: %s scanId: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 154 | lim_msg_str(msg_type), lim_result_code_str(result_code), |
| 155 | scan_id); |
| 156 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 157 | sme_rsp = qdf_mem_malloc(sizeof(struct sir_roc_rsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 158 | if (NULL == sme_rsp) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 159 | pe_err("call to AllocateMemory failed for eWNI_SME_*_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 160 | return; |
| 161 | } |
| 162 | |
| 163 | sme_rsp->message_type = msg_type; |
| 164 | sme_rsp->length = sizeof(struct sir_roc_rsp); |
| 165 | sme_rsp->status = result_code; |
| 166 | |
| 167 | sme_rsp->session_id = sme_session_id; |
| 168 | sme_rsp->scan_id = scan_id; |
| 169 | |
| 170 | msg.type = msg_type; |
| 171 | msg.bodyptr = sme_rsp; |
| 172 | msg.bodyval = 0; |
| 173 | MTRACE(mac_trace_msg_tx(mac_ctx, sme_session_id, msg.type)); |
| 174 | lim_sys_process_mmh_msg_api(mac_ctx, &msg, ePROT); |
| 175 | } |
| 176 | |
| 177 | |
| 178 | /** |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 179 | * lim_get_max_rate_flags() - Get rate flags |
| 180 | * @mac_ctx: Pointer to global MAC structure |
| 181 | * @sta_ds: Pointer to station ds structure |
| 182 | * |
| 183 | * This function is called to get the rate flags for a connection |
| 184 | * from the station ds structure depending on the ht and the vht |
| 185 | * channel width supported. |
| 186 | * |
| 187 | * Return: Returns the populated rate_flags |
| 188 | */ |
| 189 | uint32_t lim_get_max_rate_flags(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds) |
| 190 | { |
| 191 | uint32_t rate_flags = 0; |
| 192 | |
| 193 | if (sta_ds == NULL) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 194 | pe_err("sta_ds is NULL"); |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 195 | return rate_flags; |
| 196 | } |
| 197 | |
| 198 | if (!sta_ds->mlmStaContext.htCapability && |
| 199 | !sta_ds->mlmStaContext.vhtCapability) { |
| 200 | rate_flags |= eHAL_TX_RATE_LEGACY; |
| 201 | } else { |
| 202 | if (sta_ds->mlmStaContext.vhtCapability) { |
| 203 | if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ == |
| 204 | sta_ds->vhtSupportedChannelWidthSet) { |
| 205 | rate_flags |= eHAL_TX_RATE_VHT80; |
| 206 | } else if (WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ == |
| 207 | sta_ds->vhtSupportedChannelWidthSet) { |
| 208 | if (sta_ds->htSupportedChannelWidthSet) |
| 209 | rate_flags |= eHAL_TX_RATE_VHT40; |
| 210 | else |
| 211 | rate_flags |= eHAL_TX_RATE_VHT20; |
| 212 | } |
| 213 | } else if (sta_ds->mlmStaContext.htCapability) { |
| 214 | if (sta_ds->htSupportedChannelWidthSet) |
| 215 | rate_flags |= eHAL_TX_RATE_HT40; |
| 216 | else |
| 217 | rate_flags |= eHAL_TX_RATE_HT20; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | if (sta_ds->htShortGI20Mhz || sta_ds->htShortGI40Mhz) |
| 222 | rate_flags |= eHAL_TX_RATE_SGI; |
| 223 | |
| 224 | return rate_flags; |
| 225 | } |
| 226 | |
| 227 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 228 | * lim_send_sme_join_reassoc_rsp_after_resume() - Send Response to SME |
| 229 | * @mac_ctx Pointer to Global MAC structure |
| 230 | * @status Resume link status |
| 231 | * @ctx context passed while calling resmune link. |
| 232 | * (join response to be sent) |
| 233 | * |
| 234 | * This function is called to send Join/Reassoc rsp |
| 235 | * message to SME after the resume link. |
| 236 | * |
| 237 | * Return: None |
| 238 | */ |
| 239 | static void lim_send_sme_join_reassoc_rsp_after_resume(tpAniSirGlobal mac_ctx, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 240 | QDF_STATUS status, uint32_t *ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 241 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 242 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 243 | tpSirSmeJoinRsp sme_join_rsp = (tpSirSmeJoinRsp) ctx; |
| 244 | |
| 245 | msg.type = sme_join_rsp->messageType; |
| 246 | msg.bodyptr = sme_join_rsp; |
| 247 | msg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 248 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, NO_SESSION, msg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 249 | lim_sys_process_mmh_msg_api(mac_ctx, &msg, ePROT); |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * lim_handle_join_rsp_status() - Handle the response. |
| 254 | * @mac_ctx: Pointer to Global MAC structure |
| 255 | * @session_entry: PE Session Info |
| 256 | * @result_code: Indicates the result of previously issued |
| 257 | * eWNI_SME_msgType_REQ message |
| 258 | * @sme_join_rsp The received response. |
| 259 | * |
| 260 | * This function will handle both the success and failure status |
| 261 | * of the received response. |
| 262 | * |
| 263 | * Return: None |
| 264 | */ |
| 265 | static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx, |
| 266 | tpPESession session_entry, tSirResultCodes result_code, |
| 267 | tpSirSmeJoinRsp sme_join_rsp) |
| 268 | { |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 269 | uint16_t bss_ie_len; |
| 270 | void *bss_ies; |
| 271 | bool is_vendor_ap_1_present; |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 272 | tpSirSmeJoinReq join_reassoc_req = NULL; |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 273 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 274 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 275 | tSirSmeHTProfile *ht_profile; |
| 276 | #endif |
| 277 | if (result_code == eSIR_SME_SUCCESS) { |
| 278 | if (session_entry->beacon != NULL) { |
| 279 | sme_join_rsp->beaconLength = session_entry->bcnLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 280 | qdf_mem_copy(sme_join_rsp->frames, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 281 | session_entry->beacon, |
| 282 | sme_join_rsp->beaconLength); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 283 | qdf_mem_free(session_entry->beacon); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 284 | session_entry->beacon = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 285 | session_entry->bcnLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 286 | pe_debug("Beacon: %d", |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 287 | sme_join_rsp->beaconLength); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 288 | } |
| 289 | if (session_entry->assocReq != NULL) { |
| 290 | sme_join_rsp->assocReqLength = |
| 291 | session_entry->assocReqLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 292 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 293 | sme_join_rsp->beaconLength, |
| 294 | session_entry->assocReq, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 295 | sme_join_rsp->assocReqLength); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 296 | qdf_mem_free(session_entry->assocReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 297 | session_entry->assocReq = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 298 | session_entry->assocReqLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 299 | pe_debug("AssocReq: %d", |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 300 | sme_join_rsp->assocReqLength); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 301 | } |
| 302 | if (session_entry->assocRsp != NULL) { |
| 303 | sme_join_rsp->assocRspLength = |
| 304 | session_entry->assocRspLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 305 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 306 | sme_join_rsp->beaconLength + |
| 307 | sme_join_rsp->assocReqLength, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 308 | session_entry->assocRsp, |
| 309 | sme_join_rsp->assocRspLength); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 310 | qdf_mem_free(session_entry->assocRsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 311 | session_entry->assocRsp = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 312 | session_entry->assocRspLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 313 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 314 | if (session_entry->ricData != NULL) { |
| 315 | sme_join_rsp->parsedRicRspLen = |
| 316 | session_entry->RICDataLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 317 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 318 | sme_join_rsp->beaconLength + |
| 319 | sme_join_rsp->assocReqLength + |
| 320 | sme_join_rsp->assocRspLength, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 321 | session_entry->ricData, |
| 322 | sme_join_rsp->parsedRicRspLen); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 323 | qdf_mem_free(session_entry->ricData); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 324 | session_entry->ricData = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 325 | session_entry->RICDataLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 326 | pe_debug("RicLength: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 327 | sme_join_rsp->parsedRicRspLen); |
| 328 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 329 | #ifdef FEATURE_WLAN_ESE |
| 330 | if (session_entry->tspecIes != NULL) { |
| 331 | sme_join_rsp->tspecIeLen = |
| 332 | session_entry->tspecLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 333 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 334 | sme_join_rsp->beaconLength + |
| 335 | sme_join_rsp->assocReqLength + |
| 336 | sme_join_rsp->assocRspLength + |
| 337 | sme_join_rsp->parsedRicRspLen, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 338 | session_entry->tspecIes, |
| 339 | sme_join_rsp->tspecIeLen); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 340 | qdf_mem_free(session_entry->tspecIes); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 341 | session_entry->tspecIes = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 342 | session_entry->tspecLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 343 | pe_debug("ESE-TspecLen: %d", |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 344 | sme_join_rsp->tspecIeLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 345 | } |
| 346 | #endif |
| 347 | sme_join_rsp->aid = session_entry->limAID; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 348 | pe_debug("AssocRsp: %d", |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 349 | sme_join_rsp->assocRspLength); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 350 | sme_join_rsp->vht_channel_width = |
| 351 | session_entry->ch_width; |
| 352 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 353 | if (session_entry->cc_switch_mode != |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 354 | QDF_MCC_TO_SCC_SWITCH_DISABLE) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 355 | ht_profile = &sme_join_rsp->HTProfile; |
| 356 | ht_profile->htSupportedChannelWidthSet = |
| 357 | session_entry->htSupportedChannelWidthSet; |
| 358 | ht_profile->htRecommendedTxWidthSet = |
| 359 | session_entry->htRecommendedTxWidthSet; |
| 360 | ht_profile->htSecondaryChannelOffset = |
| 361 | session_entry->htSecondaryChannelOffset; |
| 362 | ht_profile->dot11mode = session_entry->dot11mode; |
| 363 | ht_profile->htCapability = session_entry->htCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 364 | ht_profile->vhtCapability = |
| 365 | session_entry->vhtCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 366 | ht_profile->apCenterChan = session_entry->ch_center_freq_seg0; |
| 367 | ht_profile->apChanWidth = session_entry->ch_width; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 368 | } |
| 369 | #endif |
Jeff Johnson | 11bd4f3 | 2017-09-18 08:15:17 -0700 | [diff] [blame] | 370 | pe_debug("pLimJoinReq:%pK, pLimReAssocReq:%pK", |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 371 | session_entry->pLimJoinReq, |
| 372 | session_entry->pLimReAssocReq); |
| 373 | |
| 374 | if (session_entry->pLimJoinReq) |
| 375 | join_reassoc_req = session_entry->pLimJoinReq; |
| 376 | |
| 377 | if (session_entry->pLimReAssocReq) |
| 378 | join_reassoc_req = session_entry->pLimReAssocReq; |
| 379 | |
| 380 | if (!join_reassoc_req) { |
| 381 | pe_err("both pLimJoinReq and pLimReAssocReq NULL"); |
| 382 | return; |
| 383 | } |
| 384 | |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 385 | bss_ie_len = lim_get_ielen_from_bss_description( |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 386 | &join_reassoc_req->bssDescription); |
| 387 | bss_ies = &join_reassoc_req->bssDescription.ieFields; |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 388 | is_vendor_ap_1_present = (wlan_get_vendor_ie_ptr_from_oui( |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 389 | SIR_MAC_VENDOR_AP_1_OUI, SIR_MAC_VENDOR_AP_1_OUI_LEN, |
| 390 | bss_ies, bss_ie_len) != NULL); |
| 391 | |
| 392 | if (mac_ctx->roam.configParam.is_force_1x1 && |
Krunal Soni | e6a1cda | 2017-09-27 15:23:02 -0700 | [diff] [blame] | 393 | is_vendor_ap_1_present && (session_entry->nss == 2) && |
| 394 | (mac_ctx->lteCoexAntShare == 0 || |
| 395 | IS_5G_CH(session_entry->currentOperChannel))) { |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 396 | /* SET vdev param */ |
| 397 | pe_debug("sending SMPS intolrent vdev_param"); |
| 398 | wma_cli_set_command(session_entry->smeSessionId, |
| 399 | (int)WMI_VDEV_PARAM_SMPS_INTOLERANT, |
| 400 | 1, VDEV_CMD); |
| 401 | |
| 402 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 403 | } else { |
| 404 | if (session_entry->beacon != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 405 | qdf_mem_free(session_entry->beacon); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 406 | session_entry->beacon = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 407 | session_entry->bcnLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | } |
| 409 | if (session_entry->assocReq != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 410 | qdf_mem_free(session_entry->assocReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 411 | session_entry->assocReq = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 412 | session_entry->assocReqLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 413 | } |
| 414 | if (session_entry->assocRsp != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 415 | qdf_mem_free(session_entry->assocRsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 416 | session_entry->assocRsp = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 417 | session_entry->assocRspLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 418 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 419 | if (session_entry->ricData != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 420 | qdf_mem_free(session_entry->ricData); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 421 | session_entry->ricData = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 422 | session_entry->RICDataLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 424 | #ifdef FEATURE_WLAN_ESE |
| 425 | if (session_entry->tspecIes != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 426 | qdf_mem_free(session_entry->tspecIes); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 427 | session_entry->tspecIes = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 428 | session_entry->tspecLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 429 | } |
| 430 | #endif |
| 431 | } |
| 432 | } |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 433 | |
| 434 | /** |
| 435 | * lim_add_bss_info() - copy data from session entry to join rsp |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 436 | * @sta_ds: Station dph entry |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 437 | * @sme_join_rsp: Join response buffer to be filled up |
| 438 | * |
| 439 | * Return: None |
| 440 | */ |
Jeff Johnson | 6db011e | 2016-10-07 07:31:39 -0700 | [diff] [blame] | 441 | static void lim_add_bss_info(tpDphHashNode sta_ds, tpSirSmeJoinRsp sme_join_rsp) |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 442 | { |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 443 | struct parsed_ies *parsed_ies = &sta_ds->parsed_ies; |
| 444 | |
| 445 | if (parsed_ies->hs20vendor_ie.present) |
| 446 | sme_join_rsp->hs20vendor_ie = parsed_ies->hs20vendor_ie; |
| 447 | if (parsed_ies->vht_caps.present) |
| 448 | sme_join_rsp->vht_caps = parsed_ies->vht_caps; |
| 449 | if (parsed_ies->ht_caps.present) |
| 450 | sme_join_rsp->ht_caps = parsed_ies->ht_caps; |
| 451 | if (parsed_ies->ht_operation.present) |
| 452 | sme_join_rsp->ht_operation = parsed_ies->ht_operation; |
| 453 | if (parsed_ies->vht_operation.present) |
| 454 | sme_join_rsp->vht_operation = parsed_ies->vht_operation; |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 455 | } |
| 456 | |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 457 | #ifdef WLAN_FEATURE_FILS_SK |
| 458 | static void lim_update_fils_seq_num(tpSirSmeJoinRsp sme_join_rsp, |
| 459 | tpPESession session_entry) |
| 460 | { |
| 461 | sme_join_rsp->fils_seq_num = |
| 462 | session_entry->fils_info->sequence_number; |
| 463 | } |
| 464 | #else |
| 465 | static inline void lim_update_fils_seq_num(tpSirSmeJoinRsp sme_join_rsp, |
| 466 | tpPESession session_entry) |
| 467 | {} |
| 468 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 469 | /** |
| 470 | * lim_send_sme_join_reassoc_rsp() - Send Response to Upper Layers |
| 471 | * @mac_ctx: Pointer to Global MAC structure |
| 472 | * @msg_type: Indicates message type |
| 473 | * @result_code: Indicates the result of previously issued |
| 474 | * eWNI_SME_msgType_REQ message |
| 475 | * @prot_status_code: Protocol Status Code |
| 476 | * @session_entry: PE Session Info |
| 477 | * @sme_session_id: SME Session ID |
| 478 | * @sme_transaction_id: SME Transaction ID |
| 479 | * |
| 480 | * This function is called by lim_process_sme_req_messages() to send |
| 481 | * eWNI_SME_JOIN_RSP or eWNI_SME_REASSOC_RSP messages to applications |
| 482 | * above MAC Software. |
| 483 | * |
| 484 | * Return: None |
| 485 | */ |
| 486 | |
| 487 | void |
| 488 | lim_send_sme_join_reassoc_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type, |
| 489 | tSirResultCodes result_code, uint16_t prot_status_code, |
| 490 | tpPESession session_entry, uint8_t sme_session_id, |
| 491 | uint16_t sme_transaction_id) |
| 492 | { |
| 493 | tpSirSmeJoinRsp sme_join_rsp; |
| 494 | uint32_t rsp_len; |
| 495 | tpDphHashNode sta_ds = NULL; |
| 496 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 497 | if (msg_type == eWNI_SME_REASSOC_RSP) |
| 498 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_REASSOC_RSP_EVENT, |
| 499 | session_entry, (uint16_t) result_code, 0); |
| 500 | else |
| 501 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_JOIN_RSP_EVENT, |
| 502 | session_entry, (uint16_t) result_code, 0); |
| 503 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 504 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 505 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 506 | lim_msg_str(msg_type), lim_result_code_str(result_code)); |
| 507 | |
| 508 | if (session_entry == NULL) { |
| 509 | rsp_len = sizeof(tSirSmeJoinRsp); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 510 | sme_join_rsp = qdf_mem_malloc(rsp_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 511 | if (NULL == sme_join_rsp) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 512 | pe_err("Mem Alloc fail - JOIN/REASSOC_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 513 | return; |
| 514 | } |
| 515 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 516 | sme_join_rsp->beaconLength = 0; |
| 517 | sme_join_rsp->assocReqLength = 0; |
| 518 | sme_join_rsp->assocRspLength = 0; |
| 519 | } else { |
| 520 | rsp_len = session_entry->assocReqLen + |
| 521 | session_entry->assocRspLen + session_entry->bcnLen + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 522 | session_entry->RICDataLen + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 523 | #ifdef FEATURE_WLAN_ESE |
| 524 | session_entry->tspecLen + |
| 525 | #endif |
| 526 | sizeof(tSirSmeJoinRsp) - sizeof(uint8_t); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 527 | sme_join_rsp = qdf_mem_malloc(rsp_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 528 | if (NULL == sme_join_rsp) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 529 | pe_err("MemAlloc fail - JOIN/REASSOC_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 530 | return; |
| 531 | } |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 532 | |
| 533 | if (lim_is_fils_connection(session_entry)) { |
| 534 | sme_join_rsp->is_fils_connection = true; |
| 535 | lim_update_fils_seq_num(sme_join_rsp, |
| 536 | session_entry); |
| 537 | } |
| 538 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 539 | if (result_code == eSIR_SME_SUCCESS) { |
| 540 | sta_ds = dph_get_hash_entry(mac_ctx, |
| 541 | DPH_STA_HASH_INDEX_PEER, |
| 542 | &session_entry->dph.dphHashTable); |
| 543 | if (sta_ds == NULL) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 544 | pe_err("Get Self Sta Entry fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 545 | } else { |
| 546 | /* Pass the peer's staId */ |
| 547 | sme_join_rsp->staId = sta_ds->staIndex; |
| 548 | sme_join_rsp->ucastSig = |
| 549 | sta_ds->ucUcastSig; |
| 550 | sme_join_rsp->bcastSig = |
| 551 | sta_ds->ucBcastSig; |
| 552 | sme_join_rsp->timingMeasCap = |
| 553 | sta_ds->timingMeasCap; |
| 554 | #ifdef FEATURE_WLAN_TDLS |
| 555 | sme_join_rsp->tdls_prohibited = |
| 556 | session_entry->tdls_prohibited; |
| 557 | sme_join_rsp->tdls_chan_swit_prohibited = |
| 558 | session_entry->tdls_chan_swit_prohibited; |
| 559 | #endif |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 560 | sme_join_rsp->nss = sta_ds->nss; |
| 561 | sme_join_rsp->max_rate_flags = |
| 562 | lim_get_max_rate_flags(mac_ctx, sta_ds); |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 563 | lim_add_bss_info(sta_ds, sme_join_rsp); |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 564 | |
| 565 | /* Copy FILS params only for Successful join */ |
| 566 | populate_fils_connect_params(mac_ctx, |
| 567 | session_entry, sme_join_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 568 | } |
| 569 | } |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 570 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 571 | sme_join_rsp->beaconLength = 0; |
| 572 | sme_join_rsp->assocReqLength = 0; |
| 573 | sme_join_rsp->assocRspLength = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 574 | sme_join_rsp->parsedRicRspLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 575 | #ifdef FEATURE_WLAN_ESE |
| 576 | sme_join_rsp->tspecIeLen = 0; |
| 577 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 578 | lim_handle_join_rsp_status(mac_ctx, session_entry, result_code, |
| 579 | sme_join_rsp); |
Archana Ramachandran | 20d2e23 | 2016-02-11 16:58:40 -0800 | [diff] [blame] | 580 | |
| 581 | /* Send supported NSS 1x1 to SME */ |
| 582 | sme_join_rsp->supported_nss_1x1 = |
| 583 | session_entry->supported_nss_1x1; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 584 | pe_debug("SME Join Rsp is supported NSS 1X1: %d", |
Archana Ramachandran | 20d2e23 | 2016-02-11 16:58:40 -0800 | [diff] [blame] | 585 | sme_join_rsp->supported_nss_1x1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 586 | } |
| 587 | |
| 588 | sme_join_rsp->messageType = msg_type; |
| 589 | sme_join_rsp->length = (uint16_t) rsp_len; |
| 590 | sme_join_rsp->statusCode = result_code; |
| 591 | sme_join_rsp->protStatusCode = prot_status_code; |
| 592 | |
| 593 | sme_join_rsp->sessionId = sme_session_id; |
| 594 | sme_join_rsp->transactionId = sme_transaction_id; |
| 595 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 596 | lim_send_sme_join_reassoc_rsp_after_resume(mac_ctx, QDF_STATUS_SUCCESS, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | (uint32_t *)sme_join_rsp); |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * lim_send_sme_start_bss_rsp() |
| 602 | * |
| 603 | ***FUNCTION: |
| 604 | * This function is called to send eWNI_SME_START_BSS_RSP |
| 605 | * message to applications above MAC Software. |
| 606 | * |
| 607 | ***PARAMS: |
| 608 | * |
| 609 | ***LOGIC: |
| 610 | * |
| 611 | ***ASSUMPTIONS: |
| 612 | * NA |
| 613 | * |
| 614 | ***NOTE: |
| 615 | * NA |
| 616 | * |
| 617 | * @param pMac Pointer to Global MAC structure |
| 618 | * @param msgType Indicates message type |
| 619 | * @param resultCode Indicates the result of previously issued |
| 620 | * eWNI_SME_msgType_REQ message |
| 621 | * |
| 622 | * @return None |
| 623 | */ |
| 624 | |
| 625 | void |
| 626 | lim_send_sme_start_bss_rsp(tpAniSirGlobal pMac, |
| 627 | uint16_t msgType, tSirResultCodes resultCode, |
| 628 | tpPESession psessionEntry, uint8_t smesessionId, |
| 629 | uint16_t smetransactionId) |
| 630 | { |
| 631 | |
| 632 | uint16_t size = 0; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 633 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 634 | tSirSmeStartBssRsp *pSirSmeRsp; |
| 635 | uint16_t ieLen; |
| 636 | uint16_t ieOffset, curLen; |
| 637 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 638 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 639 | lim_msg_str(msgType), lim_result_code_str(resultCode)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 640 | |
| 641 | size = sizeof(tSirSmeStartBssRsp); |
| 642 | |
| 643 | if (psessionEntry == NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 644 | pSirSmeRsp = qdf_mem_malloc(size); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 645 | if (NULL == pSirSmeRsp) { |
| 646 | /* / Buffer not available. Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 647 | pe_err("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | return; |
| 649 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 650 | } else { |
| 651 | /* subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID */ |
| 652 | ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET; |
| 653 | ieLen = psessionEntry->schBeaconOffsetBegin |
| 654 | + psessionEntry->schBeaconOffsetEnd - ieOffset; |
| 655 | /* calculate the memory size to allocate */ |
| 656 | size += ieLen; |
| 657 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 658 | pSirSmeRsp = qdf_mem_malloc(size); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 659 | if (NULL == pSirSmeRsp) { |
| 660 | /* / Buffer not available. Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 661 | pe_err("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 662 | return; |
| 663 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 664 | size = sizeof(tSirSmeStartBssRsp); |
| 665 | if (resultCode == eSIR_SME_SUCCESS) { |
| 666 | |
| 667 | sir_copy_mac_addr(pSirSmeRsp->bssDescription.bssId, |
| 668 | psessionEntry->bssId); |
| 669 | |
| 670 | /* Read beacon interval from session */ |
| 671 | pSirSmeRsp->bssDescription.beaconInterval = |
| 672 | (uint16_t) psessionEntry->beaconParams. |
| 673 | beaconInterval; |
| 674 | pSirSmeRsp->bssType = psessionEntry->bssType; |
| 675 | |
| 676 | if (cfg_get_capability_info |
| 677 | (pMac, &pSirSmeRsp->bssDescription.capabilityInfo, |
| 678 | psessionEntry) |
| 679 | != eSIR_SUCCESS) |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 680 | pe_err("could not retrieve Capabilities value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 681 | |
| 682 | lim_get_phy_mode(pMac, |
| 683 | (uint32_t *) &pSirSmeRsp->bssDescription. |
| 684 | nwType, psessionEntry); |
| 685 | |
| 686 | pSirSmeRsp->bssDescription.channelId = |
| 687 | psessionEntry->currentOperChannel; |
| 688 | |
Deepak Dhamdhere | e2dd544 | 2016-05-27 15:05:51 -0700 | [diff] [blame] | 689 | if (!LIM_IS_NDI_ROLE(psessionEntry)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 690 | curLen = psessionEntry->schBeaconOffsetBegin - ieOffset; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 691 | qdf_mem_copy((uint8_t *) &pSirSmeRsp->bssDescription. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 692 | ieFields, |
| 693 | psessionEntry->pSchBeaconFrameBegin + |
| 694 | ieOffset, (uint32_t) curLen); |
| 695 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 696 | qdf_mem_copy(((uint8_t *) &pSirSmeRsp->bssDescription. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 697 | ieFields) + curLen, |
| 698 | psessionEntry->pSchBeaconFrameEnd, |
| 699 | (uint32_t) psessionEntry-> |
| 700 | schBeaconOffsetEnd); |
| 701 | |
Abhishek Singh | 34a4d86 | 2016-10-26 16:01:51 +0530 | [diff] [blame] | 702 | pSirSmeRsp->bssDescription.length = (uint16_t) |
| 703 | (offsetof(tSirBssDescription, ieFields[0]) |
| 704 | - sizeof(pSirSmeRsp->bssDescription.length) |
| 705 | + ieLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 706 | /* This is the size of the message, subtracting the size of the pointer to ieFields */ |
| 707 | size += ieLen - sizeof(uint32_t); |
Deepak Dhamdhere | e2dd544 | 2016-05-27 15:05:51 -0700 | [diff] [blame] | 708 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 709 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 710 | if (psessionEntry->cc_switch_mode |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 711 | != QDF_MCC_TO_SCC_SWITCH_DISABLE) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 712 | pSirSmeRsp->HTProfile. |
| 713 | htSupportedChannelWidthSet = |
| 714 | psessionEntry->htSupportedChannelWidthSet; |
| 715 | pSirSmeRsp->HTProfile.htRecommendedTxWidthSet = |
| 716 | psessionEntry->htRecommendedTxWidthSet; |
| 717 | pSirSmeRsp->HTProfile.htSecondaryChannelOffset = |
| 718 | psessionEntry->htSecondaryChannelOffset; |
| 719 | pSirSmeRsp->HTProfile.dot11mode = |
| 720 | psessionEntry->dot11mode; |
| 721 | pSirSmeRsp->HTProfile.htCapability = |
| 722 | psessionEntry->htCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 723 | pSirSmeRsp->HTProfile.vhtCapability = |
| 724 | psessionEntry->vhtCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 725 | pSirSmeRsp->HTProfile.apCenterChan = |
| 726 | psessionEntry->ch_center_freq_seg0; |
| 727 | pSirSmeRsp->HTProfile.apChanWidth = |
| 728 | psessionEntry->ch_width; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 729 | } |
| 730 | #endif |
| 731 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 732 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 733 | pSirSmeRsp->messageType = msgType; |
| 734 | pSirSmeRsp->length = size; |
| 735 | |
| 736 | /* Update SME session Id and transaction Id */ |
| 737 | pSirSmeRsp->sessionId = smesessionId; |
| 738 | pSirSmeRsp->transactionId = smetransactionId; |
| 739 | pSirSmeRsp->statusCode = resultCode; |
| 740 | if (psessionEntry != NULL) |
| 741 | pSirSmeRsp->staId = psessionEntry->staId; /* else it will be always zero smeRsp StaID = 0 */ |
| 742 | |
| 743 | mmhMsg.type = msgType; |
| 744 | mmhMsg.bodyptr = pSirSmeRsp; |
| 745 | mmhMsg.bodyval = 0; |
| 746 | if (psessionEntry == NULL) { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 747 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 748 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 749 | } else { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 750 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 751 | psessionEntry->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 752 | } |
| 753 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 754 | lim_diag_event_report(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, |
| 755 | psessionEntry, (uint16_t) resultCode, 0); |
| 756 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 757 | |
| 758 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 759 | } /*** end lim_send_sme_start_bss_rsp() ***/ |
| 760 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 761 | /** |
| 762 | * lim_send_sme_scan_rsp() - Send scan response to SME |
| 763 | * @pMac: Pointer to Global MAC structure |
| 764 | * @length: Indicates length of message |
| 765 | * @resultCode: Indicates the result of previously issued |
| 766 | * eWNI_SME_SCAN_REQ message |
| 767 | * @scan_id: scan identifier |
| 768 | * |
| 769 | * This function is called by lim_process_sme_req_messages() to send |
| 770 | * eWNI_SME_SCAN_RSP message to applications above MAC |
| 771 | * |
| 772 | * return: None |
| 773 | */ |
| 774 | |
| 775 | void |
| 776 | lim_send_sme_scan_rsp(tpAniSirGlobal pMac, tSirResultCodes resultCode, |
| 777 | uint8_t smesessionId, uint16_t smetranscationId, |
| 778 | uint32_t scan_id) |
| 779 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 780 | lim_post_sme_scan_rsp_message(pMac, resultCode, smesessionId, |
| 781 | smetranscationId, scan_id); |
| 782 | } |
| 783 | |
| 784 | /** |
| 785 | * lim_post_sme_scan_rsp_message() |
| 786 | * |
| 787 | ***FUNCTION: |
| 788 | * This function is called by lim_send_sme_scan_rsp() to send |
| 789 | * eWNI_SME_SCAN_RSP message with failed result code |
| 790 | * |
| 791 | ***NOTE: |
| 792 | * NA |
| 793 | * |
| 794 | * @param pMac Pointer to Global MAC structure |
| 795 | * @param length Indicates length of message |
| 796 | * @param resultCode failed result code |
| 797 | * |
| 798 | * @return None |
| 799 | */ |
| 800 | |
| 801 | void |
| 802 | lim_post_sme_scan_rsp_message(tpAniSirGlobal pMac, |
| 803 | tSirResultCodes resultCode, uint8_t smesessionId, |
| 804 | uint16_t smetransactionId, |
| 805 | uint32_t scan_id) |
| 806 | { |
| 807 | tpSirSmeScanRsp pSirSmeScanRsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 808 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 809 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 810 | pe_debug("send SME_SCAN_RSP reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 811 | lim_result_code_str(resultCode)); |
| 812 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 813 | pSirSmeScanRsp = qdf_mem_malloc(sizeof(tSirSmeScanRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 814 | if (NULL == pSirSmeScanRsp) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 815 | pe_err("AllocateMemory failed for eWNI_SME_SCAN_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 816 | return; |
| 817 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 818 | |
| 819 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 820 | pSirSmeScanRsp->statusCode = resultCode; |
| 821 | |
| 822 | /*Update SME session Id and transaction Id */ |
| 823 | pSirSmeScanRsp->sessionId = smesessionId; |
| 824 | pSirSmeScanRsp->transcationId = smetransactionId; |
| 825 | pSirSmeScanRsp->scan_id = scan_id; |
| 826 | |
| 827 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 828 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 829 | mmhMsg.bodyval = 0; |
| 830 | |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 831 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 832 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 833 | lim_diag_event_report(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, |
| 834 | (uint16_t) resultCode, 0); |
| 835 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 836 | |
| 837 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 838 | return; |
| 839 | |
| 840 | } /*** lim_post_sme_scan_rsp_message ***/ |
| 841 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 842 | void lim_send_sme_disassoc_deauth_ntf(tpAniSirGlobal pMac, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 843 | QDF_STATUS status, uint32_t *pCtx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 844 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 845 | struct scheduler_msg mmhMsg = {0}; |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 846 | struct scheduler_msg *pMsg = (struct scheduler_msg *) pCtx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 847 | |
| 848 | mmhMsg.type = pMsg->type; |
| 849 | mmhMsg.bodyptr = pMsg; |
| 850 | mmhMsg.bodyval = 0; |
| 851 | |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 852 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 853 | |
| 854 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 855 | } |
| 856 | |
| 857 | /** |
| 858 | * lim_send_sme_disassoc_ntf() |
| 859 | * |
| 860 | ***FUNCTION: |
| 861 | * This function is called by limProcessSmeMessages() to send |
| 862 | * eWNI_SME_DISASSOC_RSP/IND message to host |
| 863 | * |
| 864 | ***PARAMS: |
| 865 | * |
| 866 | ***LOGIC: |
| 867 | * |
| 868 | ***ASSUMPTIONS: |
| 869 | * NA |
| 870 | * |
| 871 | ***NOTE: |
| 872 | * This function is used for sending eWNI_SME_DISASSOC_CNF, |
| 873 | * or eWNI_SME_DISASSOC_IND to host depending on |
| 874 | * disassociation trigger. |
| 875 | * |
| 876 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 877 | * disassociate was initiated |
| 878 | * @param reasonCode Indicates the reason for Disassociation |
| 879 | * @param disassocTrigger Indicates the trigger for Disassociation |
| 880 | * @param aid Indicates the STAID. This parameter is |
| 881 | * present only on AP. |
| 882 | * |
| 883 | * @return None |
| 884 | */ |
| 885 | void |
| 886 | lim_send_sme_disassoc_ntf(tpAniSirGlobal pMac, |
| 887 | tSirMacAddr peerMacAddr, |
| 888 | tSirResultCodes reasonCode, |
| 889 | uint16_t disassocTrigger, |
| 890 | uint16_t aid, |
| 891 | uint8_t smesessionId, |
| 892 | uint16_t smetransactionId, tpPESession psessionEntry) |
| 893 | { |
| 894 | |
| 895 | uint8_t *pBuf; |
| 896 | tSirSmeDisassocRsp *pSirSmeDisassocRsp; |
| 897 | tSirSmeDisassocInd *pSirSmeDisassocInd; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 898 | uint32_t *pMsg = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 899 | bool failure = false; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 900 | tpPESession session = NULL; |
| 901 | uint16_t i, assoc_id; |
| 902 | tpDphHashNode sta_ds = NULL; |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 903 | struct sir_sme_discon_done_ind *sir_sme_dis_ind; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 904 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 905 | pe_debug("Disassoc Ntf with trigger : %d reasonCode: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 906 | disassocTrigger, reasonCode); |
| 907 | |
| 908 | switch (disassocTrigger) { |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 909 | case eLIM_DUPLICATE_ENTRY: |
| 910 | /* |
| 911 | * Duplicate entry is removed at LIM. |
| 912 | * Initiate new entry for other session |
| 913 | */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 914 | pe_debug("Rcvd eLIM_DUPLICATE_ENTRY for " MAC_ADDRESS_STR, |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 915 | MAC_ADDR_ARRAY(peerMacAddr)); |
| 916 | |
| 917 | for (i = 0; i < pMac->lim.maxBssId; i++) { |
| 918 | if ((&pMac->lim.gpSession[i] != NULL) && |
| 919 | (pMac->lim.gpSession[i].valid) && |
| 920 | (pMac->lim.gpSession[i].pePersona == |
| 921 | QDF_SAP_MODE)) { |
| 922 | /* Find the sta ds entry in another session */ |
| 923 | session = &pMac->lim.gpSession[i]; |
| 924 | sta_ds = dph_lookup_hash_entry(pMac, |
| 925 | peerMacAddr, &assoc_id, |
| 926 | &session->dph.dphHashTable); |
Abhishek Singh | 6d6e3d1 | 2017-12-04 14:16:00 +0530 | [diff] [blame] | 927 | if (sta_ds) |
| 928 | break; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 929 | } |
| 930 | } |
| 931 | if (sta_ds |
| 932 | #ifdef WLAN_FEATURE_11W |
| 933 | && (!sta_ds->rmfEnabled) |
| 934 | #endif |
| 935 | ) { |
| 936 | if (lim_add_sta(pMac, sta_ds, false, session) != |
| 937 | eSIR_SUCCESS) |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 938 | pe_err("could not Add STA with assocId: %d", |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 939 | sta_ds->assocId); |
| 940 | } |
| 941 | failure = true; |
| 942 | break; |
| 943 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 944 | case eLIM_HOST_DISASSOC: |
| 945 | /** |
| 946 | * Disassociation response due to |
| 947 | * host triggered disassociation |
| 948 | */ |
| 949 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 950 | pSirSmeDisassocRsp = qdf_mem_malloc(sizeof(tSirSmeDisassocRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 951 | if (NULL == pSirSmeDisassocRsp) { |
| 952 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 953 | pe_err("Memory allocation failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 954 | failure = true; |
| 955 | goto error; |
| 956 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 957 | pe_debug("send eWNI_SME_DISASSOC_RSP with retCode: %d for " MAC_ADDRESS_STR, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 958 | reasonCode, MAC_ADDR_ARRAY(peerMacAddr)); |
| 959 | pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP; |
| 960 | pSirSmeDisassocRsp->length = sizeof(tSirSmeDisassocRsp); |
| 961 | /* sessionId */ |
| 962 | pBuf = (uint8_t *) &pSirSmeDisassocRsp->sessionId; |
| 963 | *pBuf = smesessionId; |
| 964 | pBuf++; |
| 965 | |
| 966 | /* transactionId */ |
| 967 | lim_copy_u16(pBuf, smetransactionId); |
| 968 | pBuf += sizeof(uint16_t); |
| 969 | |
| 970 | /* statusCode */ |
| 971 | lim_copy_u32(pBuf, reasonCode); |
| 972 | pBuf += sizeof(tSirResultCodes); |
| 973 | |
| 974 | /* peerMacAddr */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 975 | qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 976 | pBuf += sizeof(tSirMacAddr); |
| 977 | |
| 978 | /* Clear Station Stats */ |
| 979 | /* for sta, it is always 1, IBSS is handled at halInitSta */ |
| 980 | |
| 981 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 982 | |
| 983 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DISASSOC_RSP_EVENT, |
| 984 | psessionEntry, (uint16_t) reasonCode, 0); |
| 985 | #endif |
| 986 | pMsg = (uint32_t *) pSirSmeDisassocRsp; |
| 987 | break; |
| 988 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 989 | case eLIM_PEER_ENTITY_DISASSOC: |
| 990 | case eLIM_LINK_MONITORING_DISASSOC: |
| 991 | sir_sme_dis_ind = |
| 992 | qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); |
| 993 | if (!sir_sme_dis_ind) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 994 | pe_err("call to AllocateMemory failed for disconnect indication"); |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 995 | return; |
| 996 | } |
| 997 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 998 | pe_debug("send eWNI_SME_DISCONNECT_DONE_IND with retCode: %d", |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 999 | reasonCode); |
| 1000 | |
| 1001 | sir_sme_dis_ind->message_type = |
| 1002 | eWNI_SME_DISCONNECT_DONE_IND; |
| 1003 | sir_sme_dis_ind->length = |
| 1004 | sizeof(*sir_sme_dis_ind); |
| 1005 | qdf_mem_copy(sir_sme_dis_ind->peer_mac, peerMacAddr, |
| 1006 | sizeof(tSirMacAddr)); |
| 1007 | sir_sme_dis_ind->session_id = smesessionId; |
| 1008 | sir_sme_dis_ind->reason_code = reasonCode; |
Selvaraj, Sridhar | c7d8089 | 2016-09-29 11:56:45 +0530 | [diff] [blame] | 1009 | /* |
| 1010 | * Instead of sending deauth reason code as 505 which is |
| 1011 | * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1012 | * Send reason code as zero to Supplicant |
| 1013 | */ |
| 1014 | if (reasonCode == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1015 | sir_sme_dis_ind->reason_code = 0; |
| 1016 | else |
| 1017 | sir_sme_dis_ind->reason_code = reasonCode; |
| 1018 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1019 | pMsg = (uint32_t *)sir_sme_dis_ind; |
| 1020 | |
| 1021 | break; |
| 1022 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1023 | default: |
| 1024 | /** |
| 1025 | * Disassociation indication due to Disassociation |
| 1026 | * frame reception from peer entity or due to |
| 1027 | * loss of link with peer entity. |
| 1028 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1029 | pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1030 | if (NULL == pSirSmeDisassocInd) { |
| 1031 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1032 | pe_err("Memory allocation failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1033 | failure = true; |
| 1034 | goto error; |
| 1035 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1036 | pe_debug("send eWNI_SME_DISASSOC_IND with retCode: %d for " MAC_ADDRESS_STR, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1037 | reasonCode, MAC_ADDR_ARRAY(peerMacAddr)); |
| 1038 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1039 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
| 1040 | |
| 1041 | /* Update SME session Id and Transaction Id */ |
| 1042 | pSirSmeDisassocInd->sessionId = smesessionId; |
| 1043 | pSirSmeDisassocInd->transactionId = smetransactionId; |
| 1044 | pSirSmeDisassocInd->reasonCode = reasonCode; |
| 1045 | pBuf = (uint8_t *) &pSirSmeDisassocInd->statusCode; |
| 1046 | |
| 1047 | lim_copy_u32(pBuf, reasonCode); |
| 1048 | pBuf += sizeof(tSirResultCodes); |
| 1049 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1050 | qdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1051 | pBuf += sizeof(tSirMacAddr); |
| 1052 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1053 | qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1054 | |
| 1055 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1056 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
| 1057 | psessionEntry, (uint16_t) reasonCode, 0); |
| 1058 | #endif |
| 1059 | pMsg = (uint32_t *) pSirSmeDisassocInd; |
| 1060 | |
| 1061 | break; |
| 1062 | } |
| 1063 | |
| 1064 | error: |
| 1065 | /* Delete the PE session Created */ |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 1066 | if ((psessionEntry != NULL) && LIM_IS_STA_ROLE(psessionEntry)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1067 | pe_delete_session(pMac, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1068 | |
| 1069 | if (false == failure) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1070 | lim_send_sme_disassoc_deauth_ntf(pMac, QDF_STATUS_SUCCESS, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1071 | (uint32_t *) pMsg); |
| 1072 | } /*** end lim_send_sme_disassoc_ntf() ***/ |
| 1073 | |
| 1074 | /** ----------------------------------------------------------------- |
| 1075 | \brief lim_send_sme_disassoc_ind() - sends SME_DISASSOC_IND |
| 1076 | |
| 1077 | After receiving disassociation frame from peer entity, this |
| 1078 | function sends a eWNI_SME_DISASSOC_IND to SME with a specific |
| 1079 | reason code. |
| 1080 | |
| 1081 | \param pMac - global mac structure |
| 1082 | \param pStaDs - station dph hash node |
| 1083 | \return none |
| 1084 | \sa |
| 1085 | ----------------------------------------------------------------- */ |
| 1086 | void |
| 1087 | lim_send_sme_disassoc_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 1088 | tpPESession psessionEntry) |
| 1089 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1090 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1091 | tSirSmeDisassocInd *pSirSmeDisassocInd; |
| 1092 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1093 | pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1094 | if (NULL == pSirSmeDisassocInd) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1095 | pe_err("AllocateMemory failed for eWNI_SME_DISASSOC_IND"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1096 | return; |
| 1097 | } |
| 1098 | |
| 1099 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1100 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
| 1101 | |
| 1102 | pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId; |
| 1103 | pSirSmeDisassocInd->transactionId = psessionEntry->transactionId; |
Padma, Santhosh Kumar | 0228921 | 2016-09-30 13:30:08 +0530 | [diff] [blame] | 1104 | pSirSmeDisassocInd->statusCode = eSIR_SME_DEAUTH_STATUS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1105 | pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
| 1106 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1107 | qdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, psessionEntry->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1108 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1109 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1110 | qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, pStaDs->staAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1111 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1112 | |
| 1113 | pSirSmeDisassocInd->staId = pStaDs->staIndex; |
| 1114 | |
| 1115 | mmhMsg.type = eWNI_SME_DISASSOC_IND; |
| 1116 | mmhMsg.bodyptr = pSirSmeDisassocInd; |
| 1117 | mmhMsg.bodyval = 0; |
| 1118 | |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1119 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1120 | psessionEntry->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1121 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1122 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, |
| 1123 | 0, (uint16_t) pStaDs->mlmStaContext.disassocReason); |
| 1124 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1125 | |
| 1126 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1127 | |
| 1128 | } /*** end lim_send_sme_disassoc_ind() ***/ |
| 1129 | |
| 1130 | /** ----------------------------------------------------------------- |
| 1131 | \brief lim_send_sme_deauth_ind() - sends SME_DEAUTH_IND |
| 1132 | |
| 1133 | After receiving deauthentication frame from peer entity, this |
| 1134 | function sends a eWNI_SME_DEAUTH_IND to SME with a specific |
| 1135 | reason code. |
| 1136 | |
| 1137 | \param pMac - global mac structure |
| 1138 | \param pStaDs - station dph hash node |
| 1139 | \return none |
| 1140 | \sa |
| 1141 | ----------------------------------------------------------------- */ |
| 1142 | void |
| 1143 | lim_send_sme_deauth_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 1144 | tpPESession psessionEntry) |
| 1145 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1146 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1147 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
| 1148 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1149 | pSirSmeDeauthInd = qdf_mem_malloc(sizeof(tSirSmeDeauthInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1150 | if (NULL == pSirSmeDeauthInd) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1151 | pe_err("AllocateMemory failed for eWNI_SME_DEAUTH_IND"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1152 | return; |
| 1153 | } |
| 1154 | |
| 1155 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1156 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
| 1157 | |
| 1158 | pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId; |
| 1159 | pSirSmeDeauthInd->transactionId = psessionEntry->transactionId; |
| 1160 | if (eSIR_INFRA_AP_MODE == psessionEntry->bssType) { |
| 1161 | pSirSmeDeauthInd->statusCode = |
| 1162 | (tSirResultCodes) pStaDs->mlmStaContext.cleanupTrigger; |
| 1163 | } else { |
| 1164 | /* Need to indicatet he reascon code over the air */ |
| 1165 | pSirSmeDeauthInd->statusCode = |
| 1166 | (tSirResultCodes) pStaDs->mlmStaContext.disassocReason; |
| 1167 | } |
| 1168 | /* BSSID */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1169 | qdf_mem_copy(pSirSmeDeauthInd->bssid.bytes, psessionEntry->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1170 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1171 | /* peerMacAddr */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1172 | qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, pStaDs->staAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1173 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1174 | pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
| 1175 | |
| 1176 | pSirSmeDeauthInd->staId = pStaDs->staIndex; |
Kiran Kumar Lokere | 37d3aa2 | 2015-11-03 14:58:26 -0800 | [diff] [blame] | 1177 | if (eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON == |
| 1178 | pStaDs->mlmStaContext.disassocReason) |
| 1179 | pSirSmeDeauthInd->rssi = pStaDs->del_sta_ctx_rssi; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1180 | |
| 1181 | mmhMsg.type = eWNI_SME_DEAUTH_IND; |
| 1182 | mmhMsg.bodyptr = pSirSmeDeauthInd; |
| 1183 | mmhMsg.bodyval = 0; |
| 1184 | |
| 1185 | MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 1186 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1187 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, psessionEntry, |
| 1188 | 0, pStaDs->mlmStaContext.cleanupTrigger); |
| 1189 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1190 | |
| 1191 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1192 | return; |
| 1193 | } /*** end lim_send_sme_deauth_ind() ***/ |
| 1194 | |
| 1195 | #ifdef FEATURE_WLAN_TDLS |
| 1196 | /** |
| 1197 | * lim_send_sme_tdls_del_sta_ind() |
| 1198 | * |
| 1199 | ***FUNCTION: |
| 1200 | * This function is called to send the TDLS STA context deletion to SME. |
| 1201 | * |
| 1202 | ***LOGIC: |
| 1203 | * |
| 1204 | ***ASSUMPTIONS: |
| 1205 | * |
| 1206 | ***NOTE: |
| 1207 | * NA |
| 1208 | * |
| 1209 | * @param pMac - Pointer to global MAC structure |
| 1210 | * @param pStaDs - Pointer to internal STA Datastructure |
| 1211 | * @param psessionEntry - Pointer to the session entry |
| 1212 | * @param reasonCode - Reason for TDLS sta deletion |
| 1213 | * @return None |
| 1214 | */ |
| 1215 | void |
| 1216 | lim_send_sme_tdls_del_sta_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 1217 | tpPESession psessionEntry, uint16_t reasonCode) |
| 1218 | { |
Frank Liu | d1a2846 | 2017-09-06 22:55:48 +0800 | [diff] [blame] | 1219 | struct tdls_event_info info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1220 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1221 | pe_debug("Delete TDLS Peer "MAC_ADDRESS_STR "with reason code: %d", |
Nitesh Shah | 82c5281 | 2016-12-27 12:27:51 +0530 | [diff] [blame] | 1222 | MAC_ADDR_ARRAY(pStaDs->staAddr), reasonCode); |
Frank Liu | d1a2846 | 2017-09-06 22:55:48 +0800 | [diff] [blame] | 1223 | info.vdev_id = psessionEntry->smeSessionId; |
| 1224 | qdf_mem_copy(info.peermac.bytes, pStaDs->staAddr, QDF_MAC_ADDR_SIZE); |
| 1225 | info.message_type = TDLS_PEER_DISCONNECTED; |
| 1226 | info.peer_reason = TDLS_DISCONNECTED_PEER_DELETE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1227 | |
Frank Liu | d1a2846 | 2017-09-06 22:55:48 +0800 | [diff] [blame] | 1228 | tgt_tdls_event_handler(pMac->psoc, &info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1229 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1230 | return; |
| 1231 | } /*** end lim_send_sme_tdls_del_sta_ind() ***/ |
| 1232 | |
| 1233 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1234 | * lim_send_sme_mgmt_tx_completion() |
| 1235 | * |
| 1236 | ***FUNCTION: |
| 1237 | * This function is called to send the eWNI_SME_MGMT_FRM_TX_COMPLETION_IND |
| 1238 | * message to SME. |
| 1239 | * |
| 1240 | ***LOGIC: |
| 1241 | * |
| 1242 | ***ASSUMPTIONS: |
| 1243 | * |
| 1244 | ***NOTE: |
| 1245 | * NA |
| 1246 | * |
| 1247 | * @param pMac - Pointer to global MAC structure |
| 1248 | * @param psessionEntry - Pointer to the session entry |
| 1249 | * @param txCompleteStatus - TX Complete Status of Mgmt Frames |
| 1250 | * @return None |
| 1251 | */ |
| 1252 | void |
| 1253 | lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, |
Ganesh Kondabattini | ac57007 | 2016-12-21 12:45:48 +0530 | [diff] [blame] | 1254 | uint32_t sme_session_id, |
| 1255 | uint32_t txCompleteStatus) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1256 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1257 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1258 | tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd; |
| 1259 | |
| 1260 | pSirMgmtTxCompletionInd = |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1261 | qdf_mem_malloc(sizeof(tSirMgmtTxCompletionInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1262 | if (NULL == pSirMgmtTxCompletionInd) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1263 | pe_err("AllocateMemory failed for eWNI_SME_MGMT_FRM_TX_COMPLETION_IND"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1264 | return; |
| 1265 | } |
| 1266 | /* messageType */ |
| 1267 | pSirMgmtTxCompletionInd->messageType = |
| 1268 | eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1269 | pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd); |
| 1270 | |
| 1271 | /* sessionId */ |
Ganesh Kondabattini | ac57007 | 2016-12-21 12:45:48 +0530 | [diff] [blame] | 1272 | pSirMgmtTxCompletionInd->sessionId = sme_session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1273 | |
| 1274 | pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus; |
| 1275 | |
| 1276 | mmhMsg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1277 | mmhMsg.bodyptr = pSirMgmtTxCompletionInd; |
| 1278 | mmhMsg.bodyval = 0; |
| 1279 | |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 1280 | pSirMgmtTxCompletionInd->psoc = pMac->psoc; |
| 1281 | mmhMsg.callback = tgt_tdls_send_mgmt_tx_completion; |
| 1282 | scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg); |
| 1283 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1284 | } /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/ |
| 1285 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1286 | #endif /* FEATURE_WLAN_TDLS */ |
| 1287 | |
| 1288 | /** |
| 1289 | * lim_send_sme_deauth_ntf() |
| 1290 | * |
| 1291 | ***FUNCTION: |
| 1292 | * This function is called by limProcessSmeMessages() to send |
| 1293 | * eWNI_SME_DISASSOC_RSP/IND message to host |
| 1294 | * |
| 1295 | ***PARAMS: |
| 1296 | * |
| 1297 | ***LOGIC: |
| 1298 | * |
| 1299 | ***ASSUMPTIONS: |
| 1300 | * NA |
| 1301 | * |
| 1302 | ***NOTE: |
| 1303 | * This function is used for sending eWNI_SME_DEAUTH_CNF or |
| 1304 | * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger. |
| 1305 | * |
| 1306 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1307 | * deauthentication was initiated |
| 1308 | * @param reasonCode Indicates the reason for Deauthetication |
| 1309 | * @param deauthTrigger Indicates the trigger for Deauthetication |
| 1310 | * @param aid Indicates the STAID. This parameter is present |
| 1311 | * only on AP. |
| 1312 | * |
| 1313 | * @return None |
| 1314 | */ |
| 1315 | void |
| 1316 | lim_send_sme_deauth_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 1317 | tSirResultCodes reasonCode, uint16_t deauthTrigger, |
| 1318 | uint16_t aid, uint8_t smesessionId, |
| 1319 | uint16_t smetransactionId) |
| 1320 | { |
| 1321 | uint8_t *pBuf; |
| 1322 | tSirSmeDeauthRsp *pSirSmeDeauthRsp; |
| 1323 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
| 1324 | tpPESession psessionEntry; |
| 1325 | uint8_t sessionId; |
| 1326 | uint32_t *pMsg; |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1327 | struct sir_sme_discon_done_ind *sir_sme_dis_ind; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1328 | |
| 1329 | psessionEntry = pe_find_session_by_bssid(pMac, peerMacAddr, &sessionId); |
| 1330 | switch (deauthTrigger) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1331 | case eLIM_HOST_DEAUTH: |
| 1332 | /** |
| 1333 | * Deauthentication response to host triggered |
| 1334 | * deauthentication. |
| 1335 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1336 | pSirSmeDeauthRsp = qdf_mem_malloc(sizeof(tSirSmeDeauthRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1337 | if (NULL == pSirSmeDeauthRsp) { |
| 1338 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1339 | pe_err("call to AllocateMemory failed for eWNI_SME_DEAUTH_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1340 | return; |
| 1341 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1342 | pe_debug("send eWNI_SME_DEAUTH_RSP with retCode: %d for" MAC_ADDRESS_STR, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1343 | reasonCode, MAC_ADDR_ARRAY(peerMacAddr)); |
| 1344 | pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP; |
| 1345 | pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp); |
| 1346 | pSirSmeDeauthRsp->statusCode = reasonCode; |
| 1347 | pSirSmeDeauthRsp->sessionId = smesessionId; |
| 1348 | pSirSmeDeauthRsp->transactionId = smetransactionId; |
| 1349 | |
Srinivas Girigowda | 9cf95c5 | 2016-01-04 16:17:15 -0800 | [diff] [blame] | 1350 | pBuf = (uint8_t *) pSirSmeDeauthRsp->peer_macaddr.bytes; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1351 | qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1352 | |
| 1353 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1354 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
| 1355 | psessionEntry, 0, (uint16_t) reasonCode); |
| 1356 | #endif |
| 1357 | pMsg = (uint32_t *) pSirSmeDeauthRsp; |
| 1358 | |
| 1359 | break; |
| 1360 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1361 | case eLIM_PEER_ENTITY_DEAUTH: |
| 1362 | case eLIM_LINK_MONITORING_DEAUTH: |
| 1363 | sir_sme_dis_ind = |
| 1364 | qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); |
| 1365 | if (!sir_sme_dis_ind) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1366 | pe_err("call to AllocateMemory failed for disconnect indication"); |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1367 | return; |
| 1368 | } |
| 1369 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1370 | pe_debug("send eWNI_SME_DISCONNECT_DONE_IND withretCode: %d", |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1371 | reasonCode); |
| 1372 | |
| 1373 | sir_sme_dis_ind->message_type = |
| 1374 | eWNI_SME_DISCONNECT_DONE_IND; |
| 1375 | sir_sme_dis_ind->length = |
| 1376 | sizeof(*sir_sme_dis_ind); |
| 1377 | sir_sme_dis_ind->session_id = smesessionId; |
| 1378 | sir_sme_dis_ind->reason_code = reasonCode; |
| 1379 | qdf_mem_copy(sir_sme_dis_ind->peer_mac, peerMacAddr, |
| 1380 | ETH_ALEN); |
Selvaraj, Sridhar | c7d8089 | 2016-09-29 11:56:45 +0530 | [diff] [blame] | 1381 | /* |
| 1382 | * Instead of sending deauth reason code as 505 which is |
| 1383 | * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1384 | * Send reason code as zero to Supplicant |
| 1385 | */ |
| 1386 | if (reasonCode == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1387 | sir_sme_dis_ind->reason_code = 0; |
| 1388 | else |
| 1389 | sir_sme_dis_ind->reason_code = reasonCode; |
| 1390 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1391 | pMsg = (uint32_t *)sir_sme_dis_ind; |
| 1392 | |
| 1393 | break; |
| 1394 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1395 | default: |
| 1396 | /** |
| 1397 | * Deauthentication indication due to Deauthentication |
| 1398 | * frame reception from peer entity or due to |
| 1399 | * loss of link with peer entity. |
| 1400 | */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1401 | pSirSmeDeauthInd = qdf_mem_malloc(sizeof(tSirSmeDeauthInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1402 | if (NULL == pSirSmeDeauthInd) { |
| 1403 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1404 | pe_err("call to AllocateMemory failed for eWNI_SME_DEAUTH_Ind"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1405 | return; |
| 1406 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1407 | pe_debug("send eWNI_SME_DEAUTH_IND with retCode: %d for " MAC_ADDRESS_STR, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1408 | reasonCode, MAC_ADDR_ARRAY(peerMacAddr)); |
| 1409 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1410 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
| 1411 | pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1412 | |
| 1413 | /* sessionId */ |
| 1414 | pBuf = (uint8_t *) &pSirSmeDeauthInd->sessionId; |
| 1415 | *pBuf++ = smesessionId; |
| 1416 | |
| 1417 | /* transaction ID */ |
| 1418 | lim_copy_u16(pBuf, smetransactionId); |
| 1419 | pBuf += sizeof(uint16_t); |
| 1420 | |
| 1421 | /* status code */ |
| 1422 | lim_copy_u32(pBuf, reasonCode); |
| 1423 | pBuf += sizeof(tSirResultCodes); |
| 1424 | |
| 1425 | /* bssId */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1426 | qdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1427 | pBuf += sizeof(tSirMacAddr); |
| 1428 | |
| 1429 | /* peerMacAddr */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1430 | qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, peerMacAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1431 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1432 | |
| 1433 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1434 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
| 1435 | psessionEntry, 0, (uint16_t) reasonCode); |
| 1436 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1437 | pMsg = (uint32_t *) pSirSmeDeauthInd; |
| 1438 | |
| 1439 | break; |
| 1440 | } |
| 1441 | |
| 1442 | /*Delete the PE session created */ |
| 1443 | if (psessionEntry != NULL) { |
| 1444 | pe_delete_session(pMac, psessionEntry); |
| 1445 | } |
| 1446 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1447 | lim_send_sme_disassoc_deauth_ntf(pMac, QDF_STATUS_SUCCESS, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1448 | (uint32_t *) pMsg); |
| 1449 | |
| 1450 | } /*** end lim_send_sme_deauth_ntf() ***/ |
| 1451 | |
| 1452 | /** |
| 1453 | * lim_send_sme_wm_status_change_ntf() - Send Notification |
| 1454 | * @mac_ctx: Global MAC Context |
| 1455 | * @status_change_code: Indicates the change in the wireless medium. |
| 1456 | * @status_change_info: Indicates the information associated with |
| 1457 | * change in the wireless medium. |
| 1458 | * @info_len: Indicates the length of status change information |
| 1459 | * being sent. |
| 1460 | * @session_id SessionID |
| 1461 | * |
| 1462 | * This function is called by limProcessSmeMessages() to send |
| 1463 | * eWNI_SME_WM_STATUS_CHANGE_NTF message to host. |
| 1464 | * |
| 1465 | * Return: None |
| 1466 | */ |
| 1467 | void |
| 1468 | lim_send_sme_wm_status_change_ntf(tpAniSirGlobal mac_ctx, |
| 1469 | tSirSmeStatusChangeCode status_change_code, |
| 1470 | uint32_t *status_change_info, uint16_t info_len, uint8_t session_id) |
| 1471 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1472 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1473 | tSirSmeWmStatusChangeNtf *wm_status_change_ntf; |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1474 | uint32_t max_info_len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1475 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1476 | wm_status_change_ntf = qdf_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1477 | if (NULL == wm_status_change_ntf) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1478 | pe_err("Mem Alloc failed - eWNI_SME_WM_STATUS_CHANGE_NTF"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1479 | return; |
| 1480 | } |
| 1481 | |
| 1482 | msg.type = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1483 | msg.bodyval = 0; |
| 1484 | msg.bodyptr = wm_status_change_ntf; |
| 1485 | |
| 1486 | switch (status_change_code) { |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1487 | case eSIR_SME_AP_CAPS_CHANGED: |
| 1488 | max_info_len = sizeof(tSirSmeApNewCaps); |
| 1489 | break; |
| 1490 | case eSIR_SME_JOINED_NEW_BSS: |
| 1491 | max_info_len = sizeof(tSirSmeNewBssInfo); |
| 1492 | break; |
| 1493 | default: |
| 1494 | max_info_len = sizeof(wm_status_change_ntf->statusChangeInfo); |
| 1495 | break; |
| 1496 | } |
| 1497 | |
| 1498 | switch (status_change_code) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1499 | case eSIR_SME_RADAR_DETECTED: |
| 1500 | break; |
| 1501 | default: |
| 1502 | wm_status_change_ntf->messageType = |
| 1503 | eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1504 | wm_status_change_ntf->statusChangeCode = status_change_code; |
| 1505 | wm_status_change_ntf->length = sizeof(tSirSmeWmStatusChangeNtf); |
| 1506 | wm_status_change_ntf->sessionId = session_id; |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1507 | if (info_len <= max_info_len && status_change_info) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1508 | qdf_mem_copy( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1509 | (uint8_t *) &wm_status_change_ntf->statusChangeInfo, |
| 1510 | (uint8_t *) status_change_info, info_len); |
| 1511 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1512 | pe_debug("StatusChg code: 0x%x length: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1513 | status_change_code, info_len); |
| 1514 | break; |
| 1515 | } |
| 1516 | |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1517 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, session_id, msg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1518 | if (eSIR_SUCCESS != lim_sys_process_mmh_msg_api(mac_ctx, &msg, ePROT)) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1519 | qdf_mem_free(wm_status_change_ntf); |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1520 | pe_err("lim_sys_process_mmh_msg_api failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1521 | } |
| 1522 | |
| 1523 | } /*** end lim_send_sme_wm_status_change_ntf() ***/ |
| 1524 | |
| 1525 | /** |
| 1526 | * lim_send_sme_set_context_rsp() |
| 1527 | * |
| 1528 | ***FUNCTION: |
| 1529 | * This function is called by limProcessSmeMessages() to send |
| 1530 | * eWNI_SME_SETCONTEXT_RSP message to host |
| 1531 | * |
| 1532 | ***PARAMS: |
| 1533 | * |
| 1534 | ***LOGIC: |
| 1535 | * |
| 1536 | ***ASSUMPTIONS: |
| 1537 | * NA |
| 1538 | * |
| 1539 | ***NOTE: |
| 1540 | * |
| 1541 | * @param pMac Pointer to Global MAC structure |
| 1542 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1543 | * setContext was performed |
| 1544 | * @param aid Indicates the aid corresponding to the peer MAC |
| 1545 | * address |
| 1546 | * @param resultCode Indicates the result of previously issued |
| 1547 | * eWNI_SME_SETCONTEXT_RSP message |
| 1548 | * |
| 1549 | * @return None |
| 1550 | */ |
| 1551 | void |
| 1552 | lim_send_sme_set_context_rsp(tpAniSirGlobal pMac, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1553 | struct qdf_mac_addr peer_macaddr, uint16_t aid, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1554 | tSirResultCodes resultCode, |
| 1555 | tpPESession psessionEntry, uint8_t smesessionId, |
| 1556 | uint16_t smetransactionId) |
| 1557 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1558 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1559 | tSirSmeSetContextRsp *pSirSmeSetContextRsp; |
| 1560 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1561 | pSirSmeSetContextRsp = qdf_mem_malloc(sizeof(tSirSmeSetContextRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1562 | if (NULL == pSirSmeSetContextRsp) { |
| 1563 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1564 | pe_err("call to AllocateMemory failed for SmeSetContextRsp"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1565 | return; |
| 1566 | } |
| 1567 | |
| 1568 | pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP; |
| 1569 | pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp); |
| 1570 | pSirSmeSetContextRsp->statusCode = resultCode; |
| 1571 | |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 1572 | qdf_copy_macaddr(&pSirSmeSetContextRsp->peer_macaddr, &peer_macaddr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1573 | |
| 1574 | /* Update SME session and transaction Id */ |
| 1575 | pSirSmeSetContextRsp->sessionId = smesessionId; |
| 1576 | pSirSmeSetContextRsp->transactionId = smetransactionId; |
| 1577 | |
| 1578 | mmhMsg.type = eWNI_SME_SETCONTEXT_RSP; |
| 1579 | mmhMsg.bodyptr = pSirSmeSetContextRsp; |
| 1580 | mmhMsg.bodyval = 0; |
| 1581 | if (NULL == psessionEntry) { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1582 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1583 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1584 | } else { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1585 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1586 | psessionEntry->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1587 | } |
| 1588 | |
| 1589 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1590 | lim_diag_event_report(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, |
| 1591 | psessionEntry, (uint16_t) resultCode, 0); |
| 1592 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1593 | |
| 1594 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1595 | } /*** end lim_send_sme_set_context_rsp() ***/ |
| 1596 | |
| 1597 | /** |
| 1598 | * lim_send_sme_neighbor_bss_ind() |
| 1599 | * |
| 1600 | ***FUNCTION: |
| 1601 | * This function is called by lim_lookup_nadd_hash_entry() to send |
| 1602 | * eWNI_SME_NEIGHBOR_BSS_IND message to host |
| 1603 | * |
| 1604 | ***PARAMS: |
| 1605 | * |
| 1606 | ***LOGIC: |
| 1607 | * |
| 1608 | ***ASSUMPTIONS: |
| 1609 | * NA |
| 1610 | * |
| 1611 | ***NOTE: |
| 1612 | * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to |
| 1613 | * host upon detecting new BSS during background scanning if CFG |
| 1614 | * option is enabled for sending such indication |
| 1615 | * |
| 1616 | * @param pMac - Pointer to Global MAC structure |
| 1617 | * @return None |
| 1618 | */ |
| 1619 | |
| 1620 | void |
| 1621 | lim_send_sme_neighbor_bss_ind(tpAniSirGlobal pMac, tLimScanResultNode *pBssDescr) |
| 1622 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1623 | struct scheduler_msg msgQ = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1624 | uint32_t val; |
| 1625 | tSirSmeNeighborBssInd *pNewBssInd; |
| 1626 | |
| 1627 | if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) || |
| 1628 | ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) && |
| 1629 | pMac->lim.gLimRspReqd)) { |
| 1630 | /* LIM is not in background scan state OR */ |
| 1631 | /* current scan is initiated by HDD. */ |
| 1632 | /* No need to send new BSS indication to HDD */ |
| 1633 | return; |
| 1634 | } |
| 1635 | |
| 1636 | if (wlan_cfg_get_int(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != |
| 1637 | eSIR_SUCCESS) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1638 | pe_err("could not get NEIGHBOR_BSS_IND from CFG"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1639 | return; |
| 1640 | } |
| 1641 | |
| 1642 | if (val == 0) |
| 1643 | return; |
| 1644 | |
| 1645 | /** |
| 1646 | * Need to indicate new BSSs found during |
| 1647 | * background scanning to host. |
| 1648 | * Allocate buffer for sending indication. |
| 1649 | * Length of buffer is length of BSS description |
| 1650 | * and length of header itself |
| 1651 | */ |
| 1652 | val = pBssDescr->bssDescription.length + sizeof(uint16_t) + |
| 1653 | sizeof(uint32_t) + sizeof(uint8_t); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1654 | pNewBssInd = qdf_mem_malloc(val); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1655 | if (NULL == pNewBssInd) { |
| 1656 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1657 | pe_err("call to AllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1658 | return; |
| 1659 | } |
| 1660 | |
| 1661 | pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND; |
| 1662 | pNewBssInd->length = (uint16_t) val; |
| 1663 | pNewBssInd->sessionId = 0; |
| 1664 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1665 | qdf_mem_copy((uint8_t *) pNewBssInd->bssDescription, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1666 | (uint8_t *) &pBssDescr->bssDescription, |
| 1667 | pBssDescr->bssDescription.length + sizeof(uint16_t)); |
| 1668 | |
| 1669 | msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND; |
| 1670 | msgQ.bodyptr = pNewBssInd; |
| 1671 | msgQ.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1672 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1673 | lim_sys_process_mmh_msg_api(pMac, &msgQ, ePROT); |
| 1674 | } /*** end lim_send_sme_neighbor_bss_ind() ***/ |
| 1675 | |
| 1676 | /** ----------------------------------------------------------------- |
| 1677 | \brief lim_send_sme_addts_rsp() - sends SME ADDTS RSP |
| 1678 | \ This function sends a eWNI_SME_ADDTS_RSP to SME. |
| 1679 | \ SME only looks at rc and tspec field. |
| 1680 | \param pMac - global mac structure |
| 1681 | \param rspReqd - is SmeAddTsRsp required |
| 1682 | \param status - status code of SME_ADD_TS_RSP |
| 1683 | \return tspec |
| 1684 | \sa |
| 1685 | ----------------------------------------------------------------- */ |
| 1686 | void |
| 1687 | lim_send_sme_addts_rsp(tpAniSirGlobal pMac, uint8_t rspReqd, uint32_t status, |
| 1688 | tpPESession psessionEntry, tSirMacTspecIE tspec, |
| 1689 | uint8_t smesessionId, uint16_t smetransactionId) |
| 1690 | { |
| 1691 | tpSirAddtsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1692 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1693 | |
| 1694 | if (!rspReqd) |
| 1695 | return; |
| 1696 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1697 | rsp = qdf_mem_malloc(sizeof(tSirAddtsRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1698 | if (NULL == rsp) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1699 | pe_err("AllocateMemory failed for ADDTS_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1700 | return; |
| 1701 | } |
| 1702 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1703 | rsp->messageType = eWNI_SME_ADDTS_RSP; |
| 1704 | rsp->rc = status; |
| 1705 | rsp->rsp.status = (enum eSirMacStatusCodes)status; |
| 1706 | rsp->rsp.tspec = tspec; |
| 1707 | /* Update SME session Id and transcation Id */ |
| 1708 | rsp->sessionId = smesessionId; |
| 1709 | rsp->transactionId = smetransactionId; |
| 1710 | |
| 1711 | mmhMsg.type = eWNI_SME_ADDTS_RSP; |
| 1712 | mmhMsg.bodyptr = rsp; |
| 1713 | mmhMsg.bodyval = 0; |
| 1714 | if (NULL == psessionEntry) { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1715 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1716 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1717 | } else { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1718 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1719 | psessionEntry->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1720 | } |
| 1721 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1722 | lim_diag_event_report(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, |
| 1723 | 0); |
| 1724 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1725 | |
| 1726 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1727 | return; |
| 1728 | } |
| 1729 | |
| 1730 | void |
| 1731 | lim_send_sme_delts_rsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, uint32_t status, |
| 1732 | tpPESession psessionEntry, uint8_t smesessionId, |
| 1733 | uint16_t smetransactionId) |
| 1734 | { |
| 1735 | tpSirDeltsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1736 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1737 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1738 | pe_debug("SendSmeDeltsRsp aid: %d tsid: %d up: %d status: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1739 | delts->aid, |
| 1740 | delts->req.tsinfo.traffic.tsid, |
| 1741 | delts->req.tsinfo.traffic.userPrio, status); |
| 1742 | if (!delts->rspReqd) |
| 1743 | return; |
| 1744 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1745 | rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1746 | if (NULL == rsp) { |
| 1747 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1748 | pe_err("AllocateMemory failed for DELTS_RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1749 | return; |
| 1750 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1751 | |
| 1752 | if (psessionEntry != NULL) { |
| 1753 | |
| 1754 | rsp->aid = delts->aid; |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 1755 | qdf_copy_macaddr(&rsp->macaddr, &delts->macaddr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1756 | qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) &delts->req, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1757 | sizeof(tSirDeltsReqInfo)); |
| 1758 | } |
| 1759 | |
| 1760 | rsp->messageType = eWNI_SME_DELTS_RSP; |
| 1761 | rsp->rc = status; |
| 1762 | |
| 1763 | /* Update SME session Id and transcation Id */ |
| 1764 | rsp->sessionId = smesessionId; |
| 1765 | rsp->transactionId = smetransactionId; |
| 1766 | |
| 1767 | mmhMsg.type = eWNI_SME_DELTS_RSP; |
| 1768 | mmhMsg.bodyptr = rsp; |
| 1769 | mmhMsg.bodyval = 0; |
| 1770 | if (NULL == psessionEntry) { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1771 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1772 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1773 | } else { |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1774 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 1775 | psessionEntry->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1776 | } |
| 1777 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1778 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, |
| 1779 | (uint16_t) status, 0); |
| 1780 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1781 | |
| 1782 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1783 | } |
| 1784 | |
| 1785 | void |
| 1786 | lim_send_sme_delts_ind(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, uint16_t aid, |
| 1787 | tpPESession psessionEntry) |
| 1788 | { |
| 1789 | tpSirDeltsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1790 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1791 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1792 | pe_debug("SendSmeDeltsInd aid: %d tsid: %d up: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1793 | aid, delts->tsinfo.traffic.tsid, delts->tsinfo.traffic.userPrio); |
| 1794 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1795 | rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1796 | if (NULL == rsp) { |
| 1797 | /* Log error */ |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1798 | pe_err("AllocateMemory failed for DELTS_IND"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1799 | return; |
| 1800 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1801 | |
| 1802 | rsp->messageType = eWNI_SME_DELTS_IND; |
| 1803 | rsp->rc = eSIR_SUCCESS; |
| 1804 | rsp->aid = aid; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1805 | qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) delts, sizeof(*delts)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1806 | |
| 1807 | /* Update SME session Id and SME transaction Id */ |
| 1808 | |
| 1809 | rsp->sessionId = psessionEntry->smeSessionId; |
| 1810 | rsp->transactionId = psessionEntry->transactionId; |
| 1811 | |
| 1812 | mmhMsg.type = eWNI_SME_DELTS_IND; |
| 1813 | mmhMsg.bodyptr = rsp; |
| 1814 | mmhMsg.bodyval = 0; |
| 1815 | MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 1816 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1817 | lim_diag_event_report(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, |
| 1818 | 0); |
| 1819 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1820 | |
| 1821 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1822 | } |
| 1823 | |
| 1824 | /** |
| 1825 | * lim_send_sme_pe_statistics_rsp() |
| 1826 | * |
| 1827 | ***FUNCTION: |
| 1828 | * This function is called to send 802.11 statistics response to HDD. |
| 1829 | * This function posts the result back to HDD. This is a response to |
| 1830 | * HDD's request for statistics. |
| 1831 | * |
| 1832 | ***PARAMS: |
| 1833 | * |
| 1834 | ***LOGIC: |
| 1835 | * |
| 1836 | ***ASSUMPTIONS: |
| 1837 | * NA |
| 1838 | * |
| 1839 | ***NOTE: |
| 1840 | * NA |
| 1841 | * |
| 1842 | * @param pMac Pointer to Global MAC structure |
| 1843 | * @param p80211Stats Statistics sent in response |
| 1844 | * @param resultCode TODO: |
| 1845 | * |
| 1846 | * |
| 1847 | * @return none |
| 1848 | */ |
| 1849 | |
| 1850 | void |
| 1851 | lim_send_sme_pe_statistics_rsp(tpAniSirGlobal pMac, uint16_t msgType, void *stats) |
| 1852 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1853 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1854 | uint8_t sessionId; |
| 1855 | tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats; |
| 1856 | tpPESession pPeSessionEntry; |
| 1857 | |
| 1858 | /* Get the Session Id based on Sta Id */ |
| 1859 | pPeSessionEntry = |
| 1860 | pe_find_session_by_sta_id(pMac, pPeStats->staId, &sessionId); |
| 1861 | |
| 1862 | /* Fill the Session Id */ |
| 1863 | if (NULL != pPeSessionEntry) { |
| 1864 | /* Fill the Session Id */ |
| 1865 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 1866 | } |
| 1867 | |
| 1868 | pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP; |
| 1869 | |
| 1870 | /* msgType should be WMA_GET_STATISTICS_RSP */ |
| 1871 | mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP; |
| 1872 | |
| 1873 | mmhMsg.bodyptr = stats; |
| 1874 | mmhMsg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1875 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1876 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1877 | |
| 1878 | return; |
| 1879 | |
| 1880 | } /*** end lim_send_sme_pe_statistics_rsp() ***/ |
| 1881 | |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1882 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1883 | /** |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1884 | * lim_send_sme_pe_ese_tsm_rsp() - send tsm response |
| 1885 | * @pMac: Pointer to global pMac structure |
| 1886 | * @pStats: Pointer to TSM Stats |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1887 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1888 | * This function is called to send tsm stats response to HDD. |
| 1889 | * This function posts the result back to HDD. This is a response to |
| 1890 | * HDD's request to get tsm stats. |
| 1891 | * |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1892 | * Return: None |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1893 | */ |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1894 | void lim_send_sme_pe_ese_tsm_rsp(tpAniSirGlobal pMac, |
| 1895 | tAniGetTsmStatsRsp *pStats) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1896 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1897 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1898 | uint8_t sessionId; |
| 1899 | tAniGetTsmStatsRsp *pPeStats = (tAniGetTsmStatsRsp *) pStats; |
| 1900 | tpPESession pPeSessionEntry = NULL; |
| 1901 | |
| 1902 | /* Get the Session Id based on Sta Id */ |
| 1903 | pPeSessionEntry = |
| 1904 | pe_find_session_by_sta_id(pMac, pPeStats->staId, &sessionId); |
| 1905 | |
| 1906 | /* Fill the Session Id */ |
| 1907 | if (NULL != pPeSessionEntry) { |
| 1908 | /* Fill the Session Id */ |
| 1909 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 1910 | } else { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1911 | pe_err("Session not found for the Sta id: %d", |
Nishank Aggarwal | d5941bb | 2017-03-11 14:41:24 +0530 | [diff] [blame] | 1912 | pPeStats->staId); |
Manikandan Mohan | 41e2d6f | 2017-04-10 16:17:39 +0530 | [diff] [blame] | 1913 | qdf_mem_free(pPeStats->tsmStatsReq); |
| 1914 | qdf_mem_free(pPeStats); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1915 | return; |
| 1916 | } |
| 1917 | |
| 1918 | pPeStats->msgType = eWNI_SME_GET_TSM_STATS_RSP; |
| 1919 | pPeStats->tsmMetrics.RoamingCount |
| 1920 | = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingCount; |
| 1921 | pPeStats->tsmMetrics.RoamingDly |
| 1922 | = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingDly; |
| 1923 | |
| 1924 | mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP; |
| 1925 | mmhMsg.bodyptr = pStats; |
| 1926 | mmhMsg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1927 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1928 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1929 | |
| 1930 | return; |
| 1931 | } /*** end lim_send_sme_pe_ese_tsm_rsp() ***/ |
| 1932 | |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1933 | #endif /* FEATURE_WLAN_ESE */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1934 | |
| 1935 | void |
| 1936 | lim_send_sme_ibss_peer_ind(tpAniSirGlobal pMac, |
| 1937 | tSirMacAddr peerMacAddr, |
| 1938 | uint16_t staIndex, |
| 1939 | uint8_t ucastIdx, |
| 1940 | uint8_t bcastIdx, |
| 1941 | uint8_t *beacon, |
| 1942 | uint16_t beaconLen, uint16_t msgType, uint8_t sessionId) |
| 1943 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1944 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1945 | tSmeIbssPeerInd *pNewPeerInd; |
| 1946 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1947 | pNewPeerInd = qdf_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1948 | if (NULL == pNewPeerInd) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1949 | pe_err("Failed to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1950 | return; |
| 1951 | } |
| 1952 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1953 | qdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1954 | peerMacAddr, QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1955 | pNewPeerInd->staId = staIndex; |
| 1956 | pNewPeerInd->ucastSig = ucastIdx; |
| 1957 | pNewPeerInd->bcastSig = bcastIdx; |
| 1958 | pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen; |
| 1959 | pNewPeerInd->mesgType = msgType; |
| 1960 | pNewPeerInd->sessionId = sessionId; |
| 1961 | |
| 1962 | if (beacon != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1963 | qdf_mem_copy((void *)((uint8_t *) pNewPeerInd + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1964 | sizeof(tSmeIbssPeerInd)), (void *)beacon, |
| 1965 | beaconLen); |
| 1966 | } |
| 1967 | |
| 1968 | mmhMsg.type = msgType; |
| 1969 | mmhMsg.bodyptr = pNewPeerInd; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1970 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1971 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 1972 | |
| 1973 | } |
| 1974 | |
Kiran Kumar Lokere | fc8feea | 2016-10-27 17:07:00 -0700 | [diff] [blame] | 1975 | /** |
| 1976 | * lim_process_csa_wbw_ie() - Process CSA Wide BW IE |
| 1977 | * @mac_ctx: pointer to global adapter context |
| 1978 | * @csa_params: pointer to CSA parameters |
| 1979 | * @chnl_switch_info:pointer to channel switch parameters |
| 1980 | * @session_entry: session pointer |
| 1981 | * |
| 1982 | * Return: None |
| 1983 | */ |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 1984 | static QDF_STATUS lim_process_csa_wbw_ie(tpAniSirGlobal mac_ctx, |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1985 | struct csa_offload_params *csa_params, |
| 1986 | tLimWiderBWChannelSwitchInfo *chnl_switch_info, |
| 1987 | tpPESession session_entry) |
| 1988 | { |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 1989 | struct ch_params ch_params = {0}; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1990 | uint8_t ap_new_ch_width; |
| 1991 | bool new_ch_width_dfn = false; |
| 1992 | uint8_t center_freq_diff; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 1993 | uint32_t fw_vht_ch_wd = wma_get_vht_ch_width() + 1; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1994 | |
| 1995 | ap_new_ch_width = csa_params->new_ch_width + 1; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 1996 | |
| 1997 | pe_info("new channel: %d new_ch_width: %d seg0: %d seg1: %d", |
| 1998 | csa_params->channel, ap_new_ch_width, |
| 1999 | csa_params->new_ch_freq_seg1, |
| 2000 | csa_params->new_ch_freq_seg2); |
| 2001 | |
| 2002 | if ((ap_new_ch_width != CH_WIDTH_80MHZ) && |
| 2003 | (ap_new_ch_width != CH_WIDTH_160MHZ) && |
| 2004 | (ap_new_ch_width != CH_WIDTH_80P80MHZ)) { |
| 2005 | pe_err("CSA wide BW IE has wrong ch_width %d", |
| 2006 | csa_params->new_ch_width); |
| 2007 | return QDF_STATUS_E_INVAL; |
| 2008 | } |
| 2009 | |
| 2010 | if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) { |
| 2011 | pe_err("CSA wide BW IE has invalid center freq"); |
| 2012 | return QDF_STATUS_E_INVAL; |
| 2013 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2014 | if ((ap_new_ch_width == CH_WIDTH_80MHZ) && |
| 2015 | csa_params->new_ch_freq_seg2) { |
| 2016 | new_ch_width_dfn = true; |
| 2017 | if (csa_params->new_ch_freq_seg2 > |
| 2018 | csa_params->new_ch_freq_seg1) |
| 2019 | center_freq_diff = csa_params->new_ch_freq_seg2 - |
| 2020 | csa_params->new_ch_freq_seg1; |
| 2021 | else |
| 2022 | center_freq_diff = csa_params->new_ch_freq_seg1 - |
| 2023 | csa_params->new_ch_freq_seg2; |
| 2024 | if (center_freq_diff == CENTER_FREQ_DIFF_160MHz) |
| 2025 | ap_new_ch_width = CH_WIDTH_160MHZ; |
| 2026 | else if (center_freq_diff > CENTER_FREQ_DIFF_80P80MHz) |
| 2027 | ap_new_ch_width = CH_WIDTH_80P80MHZ; |
| 2028 | else |
| 2029 | ap_new_ch_width = CH_WIDTH_80MHZ; |
| 2030 | } |
| 2031 | session_entry->gLimChannelSwitch.state = |
| 2032 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2033 | if ((ap_new_ch_width == CH_WIDTH_160MHZ) && |
| 2034 | !new_ch_width_dfn) { |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2035 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 2036 | CH_TO_CNTR_FREQ_DIFF_160MHz) { |
| 2037 | pe_err("CSA wide BW IE has invalid center freq"); |
| 2038 | return QDF_STATUS_E_INVAL; |
| 2039 | } |
| 2040 | |
| 2041 | if (ap_new_ch_width > fw_vht_ch_wd) { |
| 2042 | pe_info("New BW is not supported, setting BW to %d", |
| 2043 | fw_vht_ch_wd); |
| 2044 | ap_new_ch_width = fw_vht_ch_wd; |
| 2045 | } |
| 2046 | ch_params.ch_width = ap_new_ch_width ; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2047 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 2048 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2049 | ap_new_ch_width = ch_params.ch_width; |
| 2050 | csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0; |
| 2051 | csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2052 | } else if (!new_ch_width_dfn) { |
| 2053 | if (ap_new_ch_width > fw_vht_ch_wd) { |
| 2054 | pe_info("New BW is not supported, setting BW to %d", |
| 2055 | fw_vht_ch_wd); |
| 2056 | ap_new_ch_width = fw_vht_ch_wd; |
| 2057 | } |
| 2058 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 2059 | CH_TO_CNTR_FREQ_DIFF_80MHz) { |
| 2060 | pe_err("CSA wide BW IE has invalid center freq"); |
| 2061 | return QDF_STATUS_E_INVAL; |
| 2062 | } |
| 2063 | csa_params->new_ch_freq_seg2 = 0; |
| 2064 | } |
| 2065 | if (new_ch_width_dfn) { |
| 2066 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 2067 | CH_TO_CNTR_FREQ_DIFF_80MHz) { |
| 2068 | pe_err("CSA wide BW IE has invalid center freq"); |
| 2069 | return QDF_STATUS_E_INVAL; |
| 2070 | } |
| 2071 | if (ap_new_ch_width > fw_vht_ch_wd) { |
| 2072 | pe_info("New width is not supported, setting BW to %d", |
| 2073 | fw_vht_ch_wd); |
| 2074 | ap_new_ch_width = fw_vht_ch_wd; |
| 2075 | } |
| 2076 | if ((ap_new_ch_width == CH_WIDTH_160MHZ) && |
| 2077 | (csa_params->new_ch_freq_seg1 != |
| 2078 | csa_params->channel + |
| 2079 | CH_TO_CNTR_FREQ_DIFF_160MHz)) { |
| 2080 | pe_err("wide BW IE has invalid 160M center freq"); |
| 2081 | csa_params->new_ch_freq_seg2 = 0; |
| 2082 | ap_new_ch_width = CH_WIDTH_80MHZ; |
| 2083 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2084 | } |
| 2085 | chnl_switch_info->newChanWidth = ap_new_ch_width; |
| 2086 | chnl_switch_info->newCenterChanFreq0 = csa_params->new_ch_freq_seg1; |
| 2087 | chnl_switch_info->newCenterChanFreq1 = csa_params->new_ch_freq_seg2; |
| 2088 | |
| 2089 | if (session_entry->ch_width == ap_new_ch_width) |
| 2090 | goto prnt_log; |
| 2091 | |
| 2092 | if (session_entry->ch_width == CH_WIDTH_80MHZ) { |
| 2093 | chnl_switch_info->newChanWidth = CH_WIDTH_80MHZ; |
| 2094 | chnl_switch_info->newCenterChanFreq1 = 0; |
| 2095 | } else { |
| 2096 | session_entry->ch_width = ap_new_ch_width; |
| 2097 | chnl_switch_info->newChanWidth = ap_new_ch_width; |
| 2098 | } |
| 2099 | prnt_log: |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2100 | pe_debug("new channel: %d new_ch_width: %d seg0: %d seg1: %d", |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2101 | csa_params->channel, |
| 2102 | chnl_switch_info->newChanWidth, |
| 2103 | chnl_switch_info->newCenterChanFreq0, |
| 2104 | chnl_switch_info->newCenterChanFreq1); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2105 | |
| 2106 | return QDF_STATUS_SUCCESS; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2107 | } |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2108 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2109 | /** |
| 2110 | * lim_handle_csa_offload_msg() - Handle CSA offload message |
| 2111 | * @mac_ctx: pointer to global adapter context |
| 2112 | * @msg: Message pointer. |
| 2113 | * |
| 2114 | * Return: None |
| 2115 | */ |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 2116 | void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, |
| 2117 | struct scheduler_msg *msg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2118 | { |
| 2119 | tpPESession session_entry; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 2120 | struct scheduler_msg mmh_msg = {0}; |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 2121 | struct csa_offload_params *csa_params = |
| 2122 | (struct csa_offload_params *) (msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2123 | tpSmeCsaOffloadInd csa_offload_ind; |
| 2124 | tpDphHashNode sta_ds = NULL; |
| 2125 | uint8_t session_id; |
| 2126 | uint16_t aid = 0; |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 2127 | uint16_t chan_space = 0; |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 2128 | struct ch_params ch_params; |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 2129 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2130 | tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL; |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 2131 | tLimChannelSwitchInfo *lim_ch_switch = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2132 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2133 | pe_debug("handle csa offload msg"); |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 2134 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2135 | if (!csa_params) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2136 | pe_err("limMsgQ body ptr is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2137 | return; |
| 2138 | } |
| 2139 | |
| 2140 | session_entry = |
| 2141 | pe_find_session_by_bssid(mac_ctx, |
| 2142 | csa_params->bssId, &session_id); |
| 2143 | if (!session_entry) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2144 | pe_err("Session does not exists for %pM", |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 2145 | csa_params->bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2146 | goto err; |
| 2147 | } |
| 2148 | |
| 2149 | sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid, |
| 2150 | &session_entry->dph.dphHashTable); |
| 2151 | |
| 2152 | if (!sta_ds) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2153 | pe_err("sta_ds does not exist"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2154 | goto err; |
| 2155 | } |
| 2156 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2157 | if (!LIM_IS_STA_ROLE(session_entry)) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2158 | pe_debug("Invalid role to handle CSA"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2159 | goto err; |
| 2160 | } |
Masti, Narayanraddi | 1c63044 | 2015-11-02 12:03:50 +0530 | [diff] [blame] | 2161 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2162 | /* |
| 2163 | * on receiving channel switch announcement from AP, delete all |
| 2164 | * TDLS peers before leaving BSS and proceed for channel switch |
| 2165 | */ |
| 2166 | lim_delete_tdls_peers(mac_ctx, session_entry); |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 2167 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2168 | lim_ch_switch = &session_entry->gLimChannelSwitch; |
| 2169 | session_entry->gLimChannelSwitch.switchMode = |
| 2170 | csa_params->switch_mode; |
| 2171 | /* timer already started by firmware, switch immediately */ |
| 2172 | session_entry->gLimChannelSwitch.switchCount = 0; |
| 2173 | session_entry->gLimChannelSwitch.primaryChannel = |
| 2174 | csa_params->channel; |
| 2175 | session_entry->gLimChannelSwitch.state = |
| 2176 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 2177 | session_entry->gLimChannelSwitch.ch_width = CH_WIDTH_20MHZ; |
| 2178 | lim_ch_switch->sec_ch_offset = |
| 2179 | session_entry->htSecondaryChannelOffset; |
| 2180 | session_entry->gLimChannelSwitch.ch_center_freq_seg0 = 0; |
| 2181 | session_entry->gLimChannelSwitch.ch_center_freq_seg1 = 0; |
| 2182 | chnl_switch_info = |
| 2183 | &session_entry->gLimWiderBWChannelSwitch; |
| 2184 | |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2185 | pe_info("vht: %d ht: %d flag: %x chan: %d, sec_ch_offset %d", |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 2186 | session_entry->vhtCapability, |
| 2187 | session_entry->htSupportedChannelWidthSet, |
| 2188 | csa_params->ies_present_flag, |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2189 | csa_params->channel, |
| 2190 | csa_params->sec_chan_offset); |
| 2191 | pe_info("seg1: %d seg2: %d width: %d country: %s class: %d", |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2192 | csa_params->new_ch_freq_seg1, |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 2193 | csa_params->new_ch_freq_seg2, |
| 2194 | csa_params->new_ch_width, |
| 2195 | mac_ctx->scan.countryCodeCurrent, |
| 2196 | csa_params->new_op_class); |
| 2197 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2198 | if (session_entry->vhtCapability && |
| 2199 | session_entry->htSupportedChannelWidthSet) { |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame^] | 2200 | if ((csa_params->ies_present_flag & lim_wbw_ie_present) && |
| 2201 | (QDF_STATUS_SUCCESS == lim_process_csa_wbw_ie(mac_ctx, |
| 2202 | csa_params, chnl_switch_info, |
| 2203 | session_entry))) { |
| 2204 | pe_debug("CSA wide BW IE process successful"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2205 | lim_ch_switch->sec_ch_offset = |
Abhishek Singh | af639b4 | 2017-06-16 14:14:36 +0530 | [diff] [blame] | 2206 | PHY_SINGLE_CHANNEL_CENTERED; |
| 2207 | if (chnl_switch_info->newChanWidth) { |
| 2208 | if (csa_params->channel < |
| 2209 | csa_params->new_ch_freq_seg1) |
| 2210 | lim_ch_switch->sec_ch_offset = |
| 2211 | PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 2212 | else |
| 2213 | lim_ch_switch->sec_ch_offset = |
| 2214 | PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 2215 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2216 | } else if (csa_params->ies_present_flag |
| 2217 | & lim_xcsa_ie_present) { |
| 2218 | chan_space = |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2219 | wlan_reg_dmn_get_chanwidth_from_opclass( |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2220 | mac_ctx->scan.countryCodeCurrent, |
| 2221 | csa_params->channel, |
| 2222 | csa_params->new_op_class); |
| 2223 | session_entry->gLimChannelSwitch.state = |
| 2224 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2225 | |
| 2226 | if (chan_space == 80) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2227 | chnl_switch_info->newChanWidth = |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2228 | CH_WIDTH_80MHZ; |
| 2229 | } else if (chan_space == 40) { |
| 2230 | chnl_switch_info->newChanWidth = |
| 2231 | CH_WIDTH_40MHZ; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2232 | } else { |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2233 | chnl_switch_info->newChanWidth = |
| 2234 | CH_WIDTH_20MHZ; |
| 2235 | lim_ch_switch->state = |
| 2236 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 2237 | } |
| 2238 | |
| 2239 | ch_params.ch_width = |
| 2240 | chnl_switch_info->newChanWidth; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2241 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 2242 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2243 | chnl_switch_info->newCenterChanFreq0 = |
| 2244 | ch_params.center_freq_seg0; |
| 2245 | /* |
| 2246 | * This is not applicable for 20/40/80 MHz. |
| 2247 | * Only used when we support 80+80 MHz operation. |
| 2248 | * In case of 80+80 MHz, this parameter indicates |
| 2249 | * center channel frequency index of 80 MHz |
| 2250 | * channel offrequency segment 1. |
| 2251 | */ |
| 2252 | chnl_switch_info->newCenterChanFreq1 = |
| 2253 | ch_params.center_freq_seg1; |
| 2254 | lim_ch_switch->sec_ch_offset = |
| 2255 | ch_params.sec_ch_offset; |
| 2256 | |
Kiran Kumar Lokere | 4712748 | 2017-12-20 18:09:55 -0800 | [diff] [blame] | 2257 | } else { |
| 2258 | lim_ch_switch->state = |
| 2259 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2260 | ch_params.ch_width = CH_WIDTH_40MHZ; |
| 2261 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 2262 | csa_params->channel, 0, &ch_params); |
| 2263 | lim_ch_switch->sec_ch_offset = |
| 2264 | ch_params.sec_ch_offset; |
| 2265 | chnl_switch_info->newChanWidth = CH_WIDTH_40MHZ; |
| 2266 | chnl_switch_info->newCenterChanFreq0 = |
| 2267 | ch_params.center_freq_seg0; |
| 2268 | chnl_switch_info->newCenterChanFreq1 = 0; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2269 | } |
| 2270 | session_entry->gLimChannelSwitch.ch_center_freq_seg0 = |
| 2271 | chnl_switch_info->newCenterChanFreq0; |
| 2272 | session_entry->gLimChannelSwitch.ch_center_freq_seg1 = |
| 2273 | chnl_switch_info->newCenterChanFreq1; |
| 2274 | session_entry->gLimChannelSwitch.ch_width = |
| 2275 | chnl_switch_info->newChanWidth; |
| 2276 | |
| 2277 | } else if (session_entry->htSupportedChannelWidthSet) { |
| 2278 | if (csa_params->ies_present_flag |
| 2279 | & lim_xcsa_ie_present) { |
| 2280 | chan_space = |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2281 | wlan_reg_dmn_get_chanwidth_from_opclass( |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2282 | mac_ctx->scan.countryCodeCurrent, |
| 2283 | csa_params->channel, |
| 2284 | csa_params->new_op_class); |
| 2285 | lim_ch_switch->state = |
| 2286 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2287 | if (chan_space == 40) { |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 2288 | lim_ch_switch->ch_width = |
| 2289 | CH_WIDTH_40MHZ; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2290 | chnl_switch_info->newChanWidth = |
| 2291 | CH_WIDTH_40MHZ; |
| 2292 | ch_params.ch_width = |
| 2293 | chnl_switch_info->newChanWidth; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2294 | wlan_reg_set_channel_params(mac_ctx->pdev, |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2295 | csa_params->channel, |
Sandeep Puligilla | 1cc23f6 | 2016-04-27 16:52:49 -0700 | [diff] [blame] | 2296 | 0, &ch_params); |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 2297 | lim_ch_switch->ch_center_freq_seg0 = |
| 2298 | ch_params.center_freq_seg0; |
| 2299 | lim_ch_switch->sec_ch_offset = |
| 2300 | ch_params.sec_ch_offset; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2301 | } else { |
| 2302 | lim_ch_switch->ch_width = |
| 2303 | CH_WIDTH_20MHZ; |
| 2304 | chnl_switch_info->newChanWidth = |
| 2305 | CH_WIDTH_40MHZ; |
| 2306 | lim_ch_switch->state = |
| 2307 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 2308 | lim_ch_switch->sec_ch_offset = |
| 2309 | PHY_SINGLE_CHANNEL_CENTERED; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2310 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2311 | } else { |
| 2312 | lim_ch_switch->ch_width = |
| 2313 | CH_WIDTH_40MHZ; |
| 2314 | lim_ch_switch->state = |
| 2315 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2316 | ch_params.ch_width = CH_WIDTH_40MHZ; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2317 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 2318 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2319 | lim_ch_switch->ch_center_freq_seg0 = |
| 2320 | ch_params.center_freq_seg0; |
| 2321 | lim_ch_switch->sec_ch_offset = |
| 2322 | ch_params.sec_ch_offset; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2323 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2324 | |
| 2325 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2326 | pe_debug("new ch width: %d space: %d", |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 2327 | session_entry->gLimChannelSwitch.ch_width, chan_space); |
Kiran Kumar Lokere | 75d636f | 2016-12-20 14:52:03 -0800 | [diff] [blame] | 2328 | if ((session_entry->currentOperChannel == csa_params->channel) && |
| 2329 | (session_entry->ch_width == |
| 2330 | session_entry->gLimChannelSwitch.ch_width)) { |
| 2331 | pe_debug("Ignore CSA, no change in ch and bw"); |
| 2332 | goto err; |
| 2333 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2334 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2335 | lim_prepare_for11h_channel_switch(mac_ctx, session_entry); |
| 2336 | csa_offload_ind = qdf_mem_malloc(sizeof(tSmeCsaOffloadInd)); |
| 2337 | if (NULL == csa_offload_ind) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2338 | pe_err("memalloc fail eWNI_SME_CSA_OFFLOAD_EVENT"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2339 | goto err; |
| 2340 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2341 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2342 | csa_offload_ind->mesgType = eWNI_SME_CSA_OFFLOAD_EVENT; |
| 2343 | csa_offload_ind->mesgLen = sizeof(tSmeCsaOffloadInd); |
| 2344 | qdf_mem_copy(csa_offload_ind->bssid.bytes, session_entry->bssId, |
| 2345 | QDF_MAC_ADDR_SIZE); |
| 2346 | mmh_msg.type = eWNI_SME_CSA_OFFLOAD_EVENT; |
| 2347 | mmh_msg.bodyptr = csa_offload_ind; |
| 2348 | mmh_msg.bodyval = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2349 | pe_debug("Sending eWNI_SME_CSA_OFFLOAD_EVENT to SME"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2350 | MTRACE(mac_trace_msg_tx |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2351 | (mac_ctx, session_entry->peSessionId, mmh_msg.type)); |
| 2352 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2353 | lim_diag_event_report(mac_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2354 | WLAN_PE_DIAG_SWITCH_CHL_IND_EVENT, session_entry, |
| 2355 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 2356 | #endif |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 2357 | lim_sys_process_mmh_msg_api(mac_ctx, &mmh_msg, ePROT); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2358 | |
| 2359 | err: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2360 | qdf_mem_free(csa_params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2361 | } |
| 2362 | |
| 2363 | /*-------------------------------------------------------------------------- |
| 2364 | \brief pe_delete_session() - Handle the Delete BSS Response from HAL. |
| 2365 | |
| 2366 | \param pMac - pointer to global adapter context |
| 2367 | \param sessionId - Message pointer. |
| 2368 | |
| 2369 | \sa |
| 2370 | --------------------------------------------------------------------------*/ |
| 2371 | |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 2372 | void lim_handle_delete_bss_rsp(tpAniSirGlobal pMac, struct scheduler_msg *MsgQ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2373 | { |
| 2374 | tpPESession psessionEntry; |
| 2375 | tpDeleteBssParams pDelBss = (tpDeleteBssParams) (MsgQ->bodyptr); |
| 2376 | |
| 2377 | psessionEntry = |
| 2378 | pe_find_session_by_session_id(pMac, pDelBss->sessionId); |
| 2379 | if (psessionEntry == NULL) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2380 | pe_err("Session Does not exist for given sessionID: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2381 | pDelBss->sessionId); |
Naveen Rawat | 0c81edc | 2016-06-08 10:08:30 -0700 | [diff] [blame] | 2382 | qdf_mem_free(MsgQ->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2383 | return; |
| 2384 | } |
Krunal Soni | e50ff45 | 2017-10-11 18:23:55 -0700 | [diff] [blame] | 2385 | |
| 2386 | /* |
Deepak Dhamdhere | 2dae1bd | 2016-10-27 10:58:29 -0700 | [diff] [blame] | 2387 | * During DEL BSS handling, the PE Session will be deleted, but it is |
| 2388 | * better to clear this flag if the session is hanging around due |
| 2389 | * to some error conditions so that the next DEL_BSS request does |
| 2390 | * not take the HO_FAIL path |
| 2391 | */ |
| 2392 | psessionEntry->process_ho_fail = false; |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 2393 | if (LIM_IS_IBSS_ROLE(psessionEntry)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2394 | lim_ibss_del_bss_rsp(pMac, MsgQ->bodyptr, psessionEntry); |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 2395 | else if (LIM_IS_UNKNOWN_ROLE(psessionEntry)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2396 | lim_process_sme_del_bss_rsp(pMac, MsgQ->bodyval, psessionEntry); |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 2397 | else if (LIM_IS_NDI_ROLE(psessionEntry)) |
| 2398 | lim_ndi_del_bss_rsp(pMac, MsgQ->bodyptr, psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2399 | else |
| 2400 | lim_process_mlm_del_bss_rsp(pMac, MsgQ, psessionEntry); |
| 2401 | |
| 2402 | } |
| 2403 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2404 | /** ----------------------------------------------------------------- |
| 2405 | \brief lim_send_sme_aggr_qos_rsp() - sends SME FT AGGR QOS RSP |
| 2406 | \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME. |
| 2407 | \ SME only looks at rc and tspec field. |
| 2408 | \param pMac - global mac structure |
| 2409 | \param rspReqd - is SmeAddTsRsp required |
| 2410 | \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP |
| 2411 | \return tspec |
| 2412 | \sa |
| 2413 | ----------------------------------------------------------------- */ |
| 2414 | void |
| 2415 | lim_send_sme_aggr_qos_rsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp, |
| 2416 | uint8_t smesessionId) |
| 2417 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 2418 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2419 | |
| 2420 | mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP; |
| 2421 | mmhMsg.bodyptr = aggrQosRsp; |
| 2422 | mmhMsg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 2423 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2424 | smesessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2425 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 2426 | |
| 2427 | return; |
| 2428 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2429 | |
| 2430 | void lim_send_sme_max_assoc_exceeded_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2431 | uint8_t smesessionId) |
| 2432 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 2433 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2434 | tSmeMaxAssocInd *pSmeMaxAssocInd; |
| 2435 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2436 | pSmeMaxAssocInd = qdf_mem_malloc(sizeof(tSmeMaxAssocInd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2437 | if (NULL == pSmeMaxAssocInd) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2438 | pe_err("Failed to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2439 | return; |
| 2440 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2441 | qdf_mem_copy((uint8_t *) pSmeMaxAssocInd->peer_mac.bytes, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 2442 | (uint8_t *) peerMacAddr, QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2443 | pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED; |
| 2444 | pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd); |
| 2445 | pSmeMaxAssocInd->sessionId = smesessionId; |
| 2446 | mmhMsg.type = pSmeMaxAssocInd->mesgType; |
| 2447 | mmhMsg.bodyptr = pSmeMaxAssocInd; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2448 | pe_debug("msgType: %s peerMacAddr "MAC_ADDRESS_STR "sme session id %d", |
| 2449 | "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr), |
| 2450 | pSmeMaxAssocInd->sessionId); |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 2451 | MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2452 | smesessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2453 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 2454 | |
| 2455 | return; |
| 2456 | } |
| 2457 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2458 | /*-------------------------------------------------------------------------- |
| 2459 | \brief lim_send_dfs_chan_sw_ie_update() |
| 2460 | This timer handler updates the channel switch IE in beacon template |
| 2461 | |
| 2462 | \param pMac - pointer to global adapter context |
| 2463 | \return - channel to scan from valid session else zero. |
| 2464 | \sa |
| 2465 | --------------------------------------------------------------------------*/ |
| 2466 | static void |
| 2467 | lim_send_dfs_chan_sw_ie_update(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 2468 | { |
| 2469 | |
| 2470 | /* Update the beacon template and send to FW */ |
| 2471 | if (sch_set_fixed_beacon_fields(pMac, psessionEntry) != eSIR_SUCCESS) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2472 | pe_err("Unable to set CSA IE in beacon"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2473 | return; |
| 2474 | } |
| 2475 | |
| 2476 | /* Send update beacon template message */ |
| 2477 | lim_send_beacon_ind(pMac, psessionEntry); |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2478 | pe_debug("Updated CSA IE, IE COUNT: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2479 | psessionEntry->gLimChannelSwitch.switchCount); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2480 | |
| 2481 | return; |
| 2482 | } |
| 2483 | |
| 2484 | /** ----------------------------------------------------------------- |
| 2485 | \brief lim_send_sme_ap_channel_switch_resp() - sends |
| 2486 | eWNI_SME_CHANNEL_CHANGE_RSP |
| 2487 | After receiving WMA_SWITCH_CHANNEL_RSP indication this |
| 2488 | function sends a eWNI_SME_CHANNEL_CHANGE_RSP to SME to notify |
| 2489 | that the Channel change has been done to the specified target |
| 2490 | channel in the Channel change request |
| 2491 | \param pMac - global mac structure |
| 2492 | \param psessionEntry - session info |
| 2493 | \param pChnlParams - Channel switch params |
| 2494 | --------------------------------------------------------------------*/ |
| 2495 | void |
| 2496 | lim_send_sme_ap_channel_switch_resp(tpAniSirGlobal pMac, |
| 2497 | tpPESession psessionEntry, |
| 2498 | tpSwitchChannelParams pChnlParams) |
| 2499 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 2500 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2501 | tpSwitchChannelParams pSmeSwithChnlParams; |
| 2502 | uint8_t channelId; |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2503 | bool is_ch_dfs = false; |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 2504 | enum phy_ch_width ch_width; |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2505 | uint8_t ch_center_freq_seg1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2506 | |
| 2507 | pSmeSwithChnlParams = (tSwitchChannelParams *) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2508 | qdf_mem_malloc(sizeof(tSwitchChannelParams)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2509 | if (NULL == pSmeSwithChnlParams) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2510 | pe_err("AllocateMemory failed for pSmeSwithChnlParams"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2511 | return; |
| 2512 | } |
| 2513 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2514 | qdf_mem_copy(pSmeSwithChnlParams, pChnlParams, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2515 | sizeof(tSwitchChannelParams)); |
| 2516 | |
| 2517 | channelId = pSmeSwithChnlParams->channelNumber; |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2518 | ch_width = pSmeSwithChnlParams->ch_width; |
| 2519 | ch_center_freq_seg1 = pSmeSwithChnlParams->ch_center_freq_seg1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2520 | |
| 2521 | /* |
| 2522 | * Pass the sme sessionID to SME instead |
| 2523 | * PE session ID. |
| 2524 | */ |
| 2525 | pSmeSwithChnlParams->peSessionId = psessionEntry->smeSessionId; |
| 2526 | |
| 2527 | mmhMsg.type = eWNI_SME_CHANNEL_CHANGE_RSP; |
| 2528 | mmhMsg.bodyptr = (void *)pSmeSwithChnlParams; |
| 2529 | mmhMsg.bodyval = 0; |
| 2530 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 2531 | |
| 2532 | /* |
| 2533 | * We should start beacon transmission only if the new |
| 2534 | * channel after channel change is Non-DFS. For a DFS |
| 2535 | * channel, PE will receive an explicit request from |
| 2536 | * upper layers to start the beacon transmission . |
| 2537 | */ |
| 2538 | |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2539 | if (ch_width == CH_WIDTH_160MHZ) { |
| 2540 | is_ch_dfs = true; |
| 2541 | } else if (ch_width == CH_WIDTH_80P80MHZ) { |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2542 | if (wlan_reg_get_channel_state(pMac->pdev, channelId) == |
| 2543 | CHANNEL_STATE_DFS || |
| 2544 | wlan_reg_get_channel_state(pMac->pdev, |
| 2545 | ch_center_freq_seg1 - |
| 2546 | SIR_80MHZ_START_CENTER_CH_DIFF) == |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2547 | CHANNEL_STATE_DFS) |
| 2548 | is_ch_dfs = true; |
| 2549 | } else { |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 2550 | if (wlan_reg_get_channel_state(pMac->pdev, channelId) == |
| 2551 | CHANNEL_STATE_DFS) |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 2552 | is_ch_dfs = true; |
| 2553 | } |
| 2554 | |
| 2555 | if (!is_ch_dfs) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2556 | if (channelId == psessionEntry->currentOperChannel) { |
| 2557 | lim_apply_configuration(pMac, psessionEntry); |
| 2558 | lim_send_beacon_ind(pMac, psessionEntry); |
| 2559 | } else { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2560 | pe_debug("Failed to Transmit Beacons on channel: %d after AP channel change response", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2561 | psessionEntry->bcnLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2562 | } |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 2563 | |
| 2564 | lim_obss_send_detection_cfg(pMac, psessionEntry, true); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2565 | } |
| 2566 | return; |
| 2567 | } |
| 2568 | |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2569 | #ifdef WLAN_FEATURE_11AX_BSS_COLOR |
| 2570 | /** |
| 2571 | * lim_send_bss_color_change_ie_update() - update bss color change IE in |
| 2572 | * beacon template |
| 2573 | * |
| 2574 | * @mac_ctx: pointer to global adapter context |
| 2575 | * @session: session pointer |
| 2576 | * |
| 2577 | * Return: none |
| 2578 | */ |
| 2579 | static void |
| 2580 | lim_send_bss_color_change_ie_update(tpAniSirGlobal mac_ctx, |
| 2581 | tpPESession session) |
| 2582 | { |
| 2583 | /* Update the beacon template and send to FW */ |
| 2584 | if (sch_set_fixed_beacon_fields(mac_ctx, session) != eSIR_SUCCESS) { |
| 2585 | pe_err("Unable to set BSS color change IE in beacon"); |
| 2586 | return; |
| 2587 | } |
| 2588 | |
| 2589 | /* Send update beacon template message */ |
| 2590 | lim_send_beacon_ind(mac_ctx, session); |
| 2591 | pe_info("Updated BSS color change countdown = %d", |
| 2592 | session->he_bss_color_change.countdown); |
| 2593 | } |
| 2594 | |
| 2595 | static void |
| 2596 | lim_handle_bss_color_change_ie(tpAniSirGlobal mac_ctx, |
| 2597 | tpPESession session) |
| 2598 | { |
| 2599 | /* handle bss color change IE */ |
| 2600 | if (LIM_IS_AP_ROLE(session) && |
| 2601 | session->he_op.bss_col_disabled) { |
| 2602 | if (session->he_bss_color_change.countdown > 0) { |
| 2603 | session->he_bss_color_change.countdown--; |
| 2604 | } else { |
| 2605 | session->bss_color_changing = 0; |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2606 | if (session->he_bss_color_change.new_color != 0) { |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2607 | session->he_op.bss_col_disabled = 0; |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2608 | session->he_op.bss_color = |
| 2609 | session->he_bss_color_change.new_color; |
| 2610 | lim_send_obss_color_collision_cfg(mac_ctx, |
| 2611 | session, |
| 2612 | OBSS_COLOR_COLLISION_DETECTION); |
| 2613 | } |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2614 | } |
| 2615 | |
| 2616 | lim_send_bss_color_change_ie_update(mac_ctx, session); |
| 2617 | } |
| 2618 | } |
| 2619 | |
| 2620 | #else |
| 2621 | static void |
| 2622 | lim_handle_bss_color_change_ie(tpAniSirGlobal mac_ctx, |
| 2623 | tpPESession session) |
| 2624 | { |
| 2625 | } |
| 2626 | #endif |
| 2627 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2628 | /** ----------------------------------------------------------------- |
| 2629 | \brief lim_process_beacon_tx_success_ind() - This function is used |
| 2630 | explicitely to handle successful beacon transmission indication |
| 2631 | from the FW. This is a generic event generated by the FW afer the |
| 2632 | first beacon is sent out after the beacon template update by the |
| 2633 | host |
| 2634 | \param pMac - global mac structure |
| 2635 | \param psessionEntry - session info |
| 2636 | \return none |
| 2637 | \sa |
| 2638 | ----------------------------------------------------------------- */ |
| 2639 | void |
| 2640 | lim_process_beacon_tx_success_ind(tpAniSirGlobal pMac, uint16_t msgType, void *event) |
| 2641 | { |
| 2642 | /* Currently, this event is used only for DFS channel switch announcement |
| 2643 | * IE update in the template. If required to be used for other IE updates |
| 2644 | * add appropriate code by introducing a state variable |
| 2645 | */ |
| 2646 | tpPESession psessionEntry; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 2647 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2648 | tSirSmeCSAIeTxCompleteRsp *pChanSwTxResponse; |
| 2649 | struct sir_beacon_tx_complete_rsp *beacon_tx_comp_rsp_ptr; |
| 2650 | uint8_t length = sizeof(tSirSmeCSAIeTxCompleteRsp); |
| 2651 | tpSirFirstBeaconTxCompleteInd pBcnTxInd = |
| 2652 | (tSirFirstBeaconTxCompleteInd *) event; |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 2653 | uint8_t ch, ch_width; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2654 | |
| 2655 | psessionEntry = pe_find_session_by_bss_idx(pMac, pBcnTxInd->bssIdx); |
| 2656 | if (psessionEntry == NULL) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2657 | pe_err("Session Does not exist for given sessionID"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2658 | return; |
| 2659 | } |
| 2660 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2661 | pe_debug("role: %d swIe: %d opIe: %d", |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 2662 | GET_LIM_SYSTEM_ROLE(psessionEntry), |
| 2663 | psessionEntry->dfsIncludeChanSwIe, |
| 2664 | psessionEntry->gLimOperatingMode.present); |
| 2665 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2666 | if (LIM_IS_AP_ROLE(psessionEntry) && |
| 2667 | true == psessionEntry->dfsIncludeChanSwIe) { |
Ganesh Kondabattini | 02ec62b | 2018-01-24 18:22:24 +0530 | [diff] [blame] | 2668 | |
| 2669 | if (psessionEntry->gLimChannelSwitch.switchCount) { |
| 2670 | /* Decrement the beacon switch count */ |
| 2671 | psessionEntry->gLimChannelSwitch.switchCount--; |
| 2672 | pe_debug("current beacon count %d", |
| 2673 | psessionEntry->gLimChannelSwitch.switchCount); |
| 2674 | } |
| 2675 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2676 | /* Send only 5 beacons with CSA IE Set in when a radar is detected */ |
| 2677 | if (psessionEntry->gLimChannelSwitch.switchCount > 0) { |
| 2678 | /* |
| 2679 | * Send the next beacon with updated CSA IE count |
| 2680 | */ |
| 2681 | lim_send_dfs_chan_sw_ie_update(pMac, psessionEntry); |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 2682 | |
| 2683 | ch = psessionEntry->gLimChannelSwitch.primaryChannel; |
| 2684 | ch_width = psessionEntry->gLimChannelSwitch.ch_width; |
| 2685 | if (pMac->sap.SapDfsInfo.dfs_beacon_tx_enhanced) |
| 2686 | /* Send Action frame after updating beacon */ |
| 2687 | lim_send_chan_switch_action_frame(pMac, |
| 2688 | ch, ch_width, psessionEntry); |
| 2689 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2690 | } else { |
| 2691 | /* Done with CSA IE update, send response back to SME */ |
| 2692 | psessionEntry->gLimChannelSwitch.switchCount = 0; |
| 2693 | if (pMac->sap.SapDfsInfo.disable_dfs_ch_switch == false) |
| 2694 | psessionEntry->gLimChannelSwitch.switchMode = 0; |
| 2695 | psessionEntry->dfsIncludeChanSwIe = false; |
| 2696 | psessionEntry->dfsIncludeChanWrapperIe = false; |
| 2697 | |
| 2698 | pChanSwTxResponse = (tSirSmeCSAIeTxCompleteRsp *) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2699 | qdf_mem_malloc(length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2700 | |
| 2701 | if (NULL == pChanSwTxResponse) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2702 | pe_err("AllocateMemory failed for tSirSmeCSAIeTxCompleteRsp"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2703 | return; |
| 2704 | } |
| 2705 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2706 | pChanSwTxResponse->sessionId = |
| 2707 | psessionEntry->smeSessionId; |
| 2708 | pChanSwTxResponse->chanSwIeTxStatus = |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 2709 | QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2710 | |
| 2711 | mmhMsg.type = eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND; |
| 2712 | mmhMsg.bodyptr = pChanSwTxResponse; |
| 2713 | mmhMsg.bodyval = 0; |
| 2714 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 2715 | } |
| 2716 | } |
| 2717 | |
| 2718 | if (LIM_IS_AP_ROLE(psessionEntry) && |
| 2719 | psessionEntry->gLimOperatingMode.present) { |
| 2720 | /* Done with nss update, send response back to SME */ |
| 2721 | psessionEntry->gLimOperatingMode.present = 0; |
| 2722 | beacon_tx_comp_rsp_ptr = (struct sir_beacon_tx_complete_rsp *) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 2723 | qdf_mem_malloc(sizeof(*beacon_tx_comp_rsp_ptr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2724 | if (NULL == beacon_tx_comp_rsp_ptr) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 2725 | pe_err("AllocateMemory failed for beacon_tx_comp_rsp_ptr"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2726 | return; |
| 2727 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2728 | beacon_tx_comp_rsp_ptr->session_id = |
| 2729 | psessionEntry->smeSessionId; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 2730 | beacon_tx_comp_rsp_ptr->tx_status = QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2731 | mmhMsg.type = eWNI_SME_NSS_UPDATE_RSP; |
| 2732 | mmhMsg.bodyptr = beacon_tx_comp_rsp_ptr; |
| 2733 | mmhMsg.bodyval = 0; |
| 2734 | lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); |
| 2735 | } |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2736 | |
| 2737 | lim_handle_bss_color_change_ie(pMac, psessionEntry); |
| 2738 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2739 | return; |
| 2740 | } |