Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /* |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 20 | * This file lim_send_sme_rspMessages.cc contains the functions |
| 21 | * for sending SME response/notification messages to applications |
| 22 | * above MAC software. |
| 23 | * Author: Chandra Modumudi |
| 24 | * Date: 02/13/02 |
| 25 | * History:- |
| 26 | * Date Modified by Modification Information |
| 27 | * -------------------------------------------------------------------- |
| 28 | */ |
| 29 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 30 | #include "qdf_types.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 31 | #include "wni_api.h" |
| 32 | #include "sir_common.h" |
| 33 | #include "ani_global.h" |
| 34 | |
| 35 | #include "wni_cfg.h" |
| 36 | #include "sys_def.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 37 | |
| 38 | #include "sch_api.h" |
| 39 | #include "utils_api.h" |
| 40 | #include "lim_utils.h" |
| 41 | #include "lim_security_utils.h" |
| 42 | #include "lim_ser_des_utils.h" |
| 43 | #include "lim_send_sme_rsp_messages.h" |
| 44 | #include "lim_ibss_peer_mgmt.h" |
| 45 | #include "lim_session_utils.h" |
| 46 | #include "lim_types.h" |
| 47 | #include "sir_api.h" |
Naveen Rawat | 3b6068c | 2016-04-14 19:01:06 -0700 | [diff] [blame] | 48 | #include "cds_regdomain.h" |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 49 | #include "lim_send_messages.h" |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 50 | #include "nan_datapath.h" |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 51 | #include "lim_assoc_utils.h" |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 52 | #include "wlan_reg_services_api.h" |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 53 | #include "wlan_utility.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 55 | #include "wlan_tdls_tgt_api.h" |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 56 | #include "lim_process_fils.h" |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 57 | #include "wma.h" |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 58 | |
Jeff Johnson | 41485c2 | 2019-02-21 11:00:30 -0800 | [diff] [blame] | 59 | void lim_send_sme_rsp(struct mac_context *mac_ctx, uint16_t msg_type, |
| 60 | tSirResultCodes result_code, uint8_t sme_session_id) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 61 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 62 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | tSirSmeRsp *sme_rsp; |
| 64 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 65 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 66 | lim_msg_str(msg_type), lim_result_code_str(result_code)); |
| 67 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 68 | sme_rsp = qdf_mem_malloc(sizeof(tSirSmeRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 69 | if (!sme_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 70 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 71 | |
| 72 | sme_rsp->messageType = msg_type; |
| 73 | sme_rsp->length = sizeof(tSirSmeRsp); |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 74 | sme_rsp->status_code = result_code; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 75 | sme_rsp->sessionId = sme_session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 76 | |
| 77 | msg.type = msg_type; |
| 78 | msg.bodyptr = sme_rsp; |
| 79 | msg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 80 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, |
| 81 | sme_session_id, msg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 82 | |
| 83 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 84 | switch (msg_type) { |
| 85 | case eWNI_SME_STOP_BSS_RSP: |
| 86 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, |
| 87 | NULL, (uint16_t) result_code, 0); |
| 88 | break; |
| 89 | } |
| 90 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 91 | lim_sys_process_mmh_msg_api(mac_ctx, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 92 | } |
| 93 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 94 | /** |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 95 | * lim_get_max_rate_flags() - Get rate flags |
| 96 | * @mac_ctx: Pointer to global MAC structure |
| 97 | * @sta_ds: Pointer to station ds structure |
| 98 | * |
| 99 | * This function is called to get the rate flags for a connection |
| 100 | * from the station ds structure depending on the ht and the vht |
| 101 | * channel width supported. |
| 102 | * |
| 103 | * Return: Returns the populated rate_flags |
| 104 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 105 | uint32_t lim_get_max_rate_flags(struct mac_context *mac_ctx, tpDphHashNode sta_ds) |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 106 | { |
| 107 | uint32_t rate_flags = 0; |
| 108 | |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 109 | if (!sta_ds) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 110 | pe_err("sta_ds is NULL"); |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 111 | return rate_flags; |
| 112 | } |
| 113 | |
| 114 | if (!sta_ds->mlmStaContext.htCapability && |
| 115 | !sta_ds->mlmStaContext.vhtCapability) { |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 116 | rate_flags |= TX_RATE_LEGACY; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 117 | } else { |
| 118 | if (sta_ds->mlmStaContext.vhtCapability) { |
| 119 | if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ == |
| 120 | sta_ds->vhtSupportedChannelWidthSet) { |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 121 | rate_flags |= TX_RATE_VHT80; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 122 | } else if (WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ == |
| 123 | sta_ds->vhtSupportedChannelWidthSet) { |
| 124 | if (sta_ds->htSupportedChannelWidthSet) |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 125 | rate_flags |= TX_RATE_VHT40; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 126 | else |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 127 | rate_flags |= TX_RATE_VHT20; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 128 | } |
| 129 | } else if (sta_ds->mlmStaContext.htCapability) { |
| 130 | if (sta_ds->htSupportedChannelWidthSet) |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 131 | rate_flags |= TX_RATE_HT40; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 132 | else |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 133 | rate_flags |= TX_RATE_HT20; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 134 | } |
| 135 | } |
| 136 | |
| 137 | if (sta_ds->htShortGI20Mhz || sta_ds->htShortGI40Mhz) |
Naveen Rawat | ea1564b | 2018-05-17 15:56:11 -0700 | [diff] [blame] | 138 | rate_flags |= TX_RATE_SGI; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 139 | |
| 140 | return rate_flags; |
| 141 | } |
| 142 | |
| 143 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 144 | * lim_send_sme_join_reassoc_rsp_after_resume() - Send Response to SME |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 145 | * @mac_ctx: Pointer to Global MAC structure |
| 146 | * @status: Resume link status |
| 147 | * @sme_join_rsp: Join response to be sent |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | * |
| 149 | * This function is called to send Join/Reassoc rsp |
| 150 | * message to SME after the resume link. |
| 151 | * |
| 152 | * Return: None |
| 153 | */ |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 154 | static void |
| 155 | lim_send_sme_join_reassoc_rsp_after_resume(struct mac_context *mac_ctx, |
| 156 | QDF_STATUS status, |
| 157 | struct join_rsp *sme_join_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 158 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 159 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 160 | |
| 161 | msg.type = sme_join_rsp->messageType; |
| 162 | msg.bodyptr = sme_join_rsp; |
| 163 | msg.bodyval = 0; |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 164 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, NO_SESSION, msg.type)); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 165 | lim_sys_process_mmh_msg_api(mac_ctx, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | /** |
| 169 | * lim_handle_join_rsp_status() - Handle the response. |
| 170 | * @mac_ctx: Pointer to Global MAC structure |
| 171 | * @session_entry: PE Session Info |
| 172 | * @result_code: Indicates the result of previously issued |
| 173 | * eWNI_SME_msgType_REQ message |
| 174 | * @sme_join_rsp The received response. |
| 175 | * |
| 176 | * This function will handle both the success and failure status |
| 177 | * of the received response. |
| 178 | * |
| 179 | * Return: None |
| 180 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 181 | static void lim_handle_join_rsp_status(struct mac_context *mac_ctx, |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 182 | struct pe_session *session_entry, |
| 183 | tSirResultCodes result_code, |
| 184 | struct join_rsp *sme_join_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | { |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 186 | uint16_t bss_ie_len; |
| 187 | void *bss_ies; |
| 188 | bool is_vendor_ap_1_present; |
Jeff Johnson | 701444f | 2019-02-02 22:35:13 -0800 | [diff] [blame] | 189 | struct join_req *join_reassoc_req = NULL; |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 190 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 191 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
Jeff Johnson | 704af11 | 2019-02-02 16:11:55 -0800 | [diff] [blame] | 192 | struct ht_profile *ht_profile; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 193 | #endif |
gaurank kathpalia | efb20a8 | 2019-04-18 19:17:23 +0530 | [diff] [blame] | 194 | if (session_entry->beacon) { |
| 195 | sme_join_rsp->beaconLength = session_entry->bcnLen; |
| 196 | qdf_mem_copy(sme_join_rsp->frames, |
| 197 | session_entry->beacon, |
| 198 | sme_join_rsp->beaconLength); |
| 199 | qdf_mem_free(session_entry->beacon); |
| 200 | session_entry->beacon = NULL; |
| 201 | session_entry->bcnLen = 0; |
| 202 | pe_debug("Beacon: %d", |
| 203 | sme_join_rsp->beaconLength); |
| 204 | } |
| 205 | |
Pragaspathi Thilagaraj | f812ccf | 2019-06-22 13:07:04 +0530 | [diff] [blame] | 206 | if (session_entry->assoc_req) { |
gaurank kathpalia | efb20a8 | 2019-04-18 19:17:23 +0530 | [diff] [blame] | 207 | sme_join_rsp->assocReqLength = |
| 208 | session_entry->assocReqLen; |
| 209 | qdf_mem_copy(sme_join_rsp->frames + |
| 210 | sme_join_rsp->beaconLength, |
Pragaspathi Thilagaraj | f812ccf | 2019-06-22 13:07:04 +0530 | [diff] [blame] | 211 | session_entry->assoc_req, |
gaurank kathpalia | efb20a8 | 2019-04-18 19:17:23 +0530 | [diff] [blame] | 212 | sme_join_rsp->assocReqLength); |
Pragaspathi Thilagaraj | f812ccf | 2019-06-22 13:07:04 +0530 | [diff] [blame] | 213 | qdf_mem_free(session_entry->assoc_req); |
| 214 | session_entry->assoc_req = NULL; |
gaurank kathpalia | efb20a8 | 2019-04-18 19:17:23 +0530 | [diff] [blame] | 215 | session_entry->assocReqLen = 0; |
| 216 | pe_debug("AssocReq: %d", |
| 217 | sme_join_rsp->assocReqLength); |
| 218 | } |
| 219 | if (session_entry->assocRsp) { |
| 220 | sme_join_rsp->assocRspLength = |
| 221 | session_entry->assocRspLen; |
| 222 | qdf_mem_copy(sme_join_rsp->frames + |
| 223 | sme_join_rsp->beaconLength + |
| 224 | sme_join_rsp->assocReqLength, |
| 225 | session_entry->assocRsp, |
| 226 | sme_join_rsp->assocRspLength); |
| 227 | qdf_mem_free(session_entry->assocRsp); |
| 228 | session_entry->assocRsp = NULL; |
| 229 | session_entry->assocRspLen = 0; |
| 230 | pe_debug("AssocRsp: %d", |
| 231 | sme_join_rsp->assocRspLength); |
| 232 | } |
| 233 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 234 | if (result_code == eSIR_SME_SUCCESS) { |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 235 | if (session_entry->ricData) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 236 | sme_join_rsp->parsedRicRspLen = |
| 237 | session_entry->RICDataLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 238 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 239 | sme_join_rsp->beaconLength + |
| 240 | sme_join_rsp->assocReqLength + |
| 241 | sme_join_rsp->assocRspLength, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 242 | session_entry->ricData, |
| 243 | sme_join_rsp->parsedRicRspLen); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 244 | qdf_mem_free(session_entry->ricData); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | session_entry->ricData = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 246 | session_entry->RICDataLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 247 | pe_debug("RicLength: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 248 | sme_join_rsp->parsedRicRspLen); |
| 249 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 250 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 251 | if (session_entry->tspecIes) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 252 | sme_join_rsp->tspecIeLen = |
| 253 | session_entry->tspecLen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 254 | qdf_mem_copy(sme_join_rsp->frames + |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 255 | sme_join_rsp->beaconLength + |
| 256 | sme_join_rsp->assocReqLength + |
| 257 | sme_join_rsp->assocRspLength + |
| 258 | sme_join_rsp->parsedRicRspLen, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 259 | session_entry->tspecIes, |
| 260 | sme_join_rsp->tspecIeLen); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 261 | qdf_mem_free(session_entry->tspecIes); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 262 | session_entry->tspecIes = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 263 | session_entry->tspecLen = 0; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 264 | pe_debug("ESE-TspecLen: %d", |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 265 | sme_join_rsp->tspecIeLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 266 | } |
| 267 | #endif |
| 268 | sme_join_rsp->aid = session_entry->limAID; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 269 | sme_join_rsp->vht_channel_width = |
| 270 | session_entry->ch_width; |
| 271 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 272 | if (session_entry->cc_switch_mode != |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 273 | QDF_MCC_TO_SCC_SWITCH_DISABLE) { |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 274 | ht_profile = &sme_join_rsp->ht_profile; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 275 | ht_profile->htSupportedChannelWidthSet = |
| 276 | session_entry->htSupportedChannelWidthSet; |
| 277 | ht_profile->htRecommendedTxWidthSet = |
| 278 | session_entry->htRecommendedTxWidthSet; |
| 279 | ht_profile->htSecondaryChannelOffset = |
| 280 | session_entry->htSecondaryChannelOffset; |
| 281 | ht_profile->dot11mode = session_entry->dot11mode; |
| 282 | ht_profile->htCapability = session_entry->htCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | ht_profile->vhtCapability = |
| 284 | session_entry->vhtCapability; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 285 | ht_profile->apCenterChan = session_entry->ch_center_freq_seg0; |
| 286 | ht_profile->apChanWidth = session_entry->ch_width; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 287 | } |
| 288 | #endif |
Pragaspathi Thilagaraj | 64ae59d | 2019-06-22 13:00:34 +0530 | [diff] [blame] | 289 | pe_debug("lim_join_req:%pK, pLimReAssocReq:%pK", |
| 290 | session_entry->lim_join_req, |
| 291 | session_entry->pLimReAssocReq); |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 292 | |
Pragaspathi Thilagaraj | 64ae59d | 2019-06-22 13:00:34 +0530 | [diff] [blame] | 293 | if (session_entry->lim_join_req) |
| 294 | join_reassoc_req = session_entry->lim_join_req; |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 295 | |
| 296 | if (session_entry->pLimReAssocReq) |
| 297 | join_reassoc_req = session_entry->pLimReAssocReq; |
| 298 | |
| 299 | if (!join_reassoc_req) { |
Pragaspathi Thilagaraj | 64ae59d | 2019-06-22 13:00:34 +0530 | [diff] [blame] | 300 | pe_err("both lim_join_req and pLimReAssocReq NULL"); |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 301 | return; |
| 302 | } |
| 303 | |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 304 | bss_ie_len = lim_get_ielen_from_bss_description( |
Wu Gao | 2968fc9 | 2017-06-19 19:18:34 +0800 | [diff] [blame] | 305 | &join_reassoc_req->bssDescription); |
| 306 | bss_ies = &join_reassoc_req->bssDescription.ieFields; |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 307 | is_vendor_ap_1_present = (wlan_get_vendor_ie_ptr_from_oui( |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 308 | SIR_MAC_VENDOR_AP_1_OUI, SIR_MAC_VENDOR_AP_1_OUI_LEN, |
| 309 | bss_ies, bss_ie_len) != NULL); |
| 310 | |
| 311 | if (mac_ctx->roam.configParam.is_force_1x1 && |
Krunal Soni | e6a1cda | 2017-09-27 15:23:02 -0700 | [diff] [blame] | 312 | is_vendor_ap_1_present && (session_entry->nss == 2) && |
| 313 | (mac_ctx->lteCoexAntShare == 0 || |
Liangwei Dong | e0d4db2 | 2019-07-15 16:40:48 +0800 | [diff] [blame] | 314 | wlan_reg_is_5ghz_ch_freq(session_entry->curr_op_freq))) { |
Naveen Rawat | c4a0e66 | 2017-05-19 08:06:57 -0700 | [diff] [blame] | 315 | /* SET vdev param */ |
| 316 | pe_debug("sending SMPS intolrent vdev_param"); |
| 317 | wma_cli_set_command(session_entry->smeSessionId, |
| 318 | (int)WMI_VDEV_PARAM_SMPS_INTOLERANT, |
| 319 | 1, VDEV_CMD); |
| 320 | |
| 321 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 322 | } else { |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 323 | if (session_entry->beacon) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 324 | qdf_mem_free(session_entry->beacon); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 325 | session_entry->beacon = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 326 | session_entry->bcnLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 327 | } |
Pragaspathi Thilagaraj | f812ccf | 2019-06-22 13:07:04 +0530 | [diff] [blame] | 328 | if (session_entry->assoc_req) { |
| 329 | qdf_mem_free(session_entry->assoc_req); |
| 330 | session_entry->assoc_req = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 331 | session_entry->assocReqLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 332 | } |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 333 | if (session_entry->assocRsp) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 334 | qdf_mem_free(session_entry->assocRsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 335 | session_entry->assocRsp = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 336 | session_entry->assocRspLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 337 | } |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 338 | if (session_entry->ricData) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 339 | qdf_mem_free(session_entry->ricData); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 340 | session_entry->ricData = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 341 | session_entry->RICDataLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 342 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 343 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 344 | if (session_entry->tspecIes) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 345 | qdf_mem_free(session_entry->tspecIes); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 346 | session_entry->tspecIes = NULL; |
Sreelakshmi Konamki | 3b8ba61 | 2015-12-02 18:13:22 +0530 | [diff] [blame] | 347 | session_entry->tspecLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 348 | } |
| 349 | #endif |
| 350 | } |
| 351 | } |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 352 | |
| 353 | /** |
| 354 | * lim_add_bss_info() - copy data from session entry to join rsp |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 355 | * @sta_ds: Station dph entry |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 356 | * @sme_join_rsp: Join response buffer to be filled up |
| 357 | * |
| 358 | * Return: None |
| 359 | */ |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 360 | static void lim_add_bss_info(tpDphHashNode sta_ds, |
| 361 | struct join_rsp *sme_join_rsp) |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 362 | { |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 363 | struct parsed_ies *parsed_ies = &sta_ds->parsed_ies; |
| 364 | |
| 365 | if (parsed_ies->hs20vendor_ie.present) |
| 366 | sme_join_rsp->hs20vendor_ie = parsed_ies->hs20vendor_ie; |
| 367 | if (parsed_ies->vht_caps.present) |
| 368 | sme_join_rsp->vht_caps = parsed_ies->vht_caps; |
| 369 | if (parsed_ies->ht_caps.present) |
| 370 | sme_join_rsp->ht_caps = parsed_ies->ht_caps; |
| 371 | if (parsed_ies->ht_operation.present) |
| 372 | sme_join_rsp->ht_operation = parsed_ies->ht_operation; |
| 373 | if (parsed_ies->vht_operation.present) |
| 374 | sme_join_rsp->vht_operation = parsed_ies->vht_operation; |
Anurag Chouhan | 5de8d17 | 2016-07-13 14:44:28 +0530 | [diff] [blame] | 375 | } |
| 376 | |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 377 | #ifdef WLAN_FEATURE_FILS_SK |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 378 | static void lim_update_fils_seq_num(struct join_rsp *sme_join_rsp, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 379 | struct pe_session *session_entry) |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 380 | { |
| 381 | sme_join_rsp->fils_seq_num = |
| 382 | session_entry->fils_info->sequence_number; |
| 383 | } |
| 384 | #else |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 385 | static inline void lim_update_fils_seq_num(struct join_rsp *sme_join_rsp, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 386 | struct pe_session *session_entry) |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 387 | {} |
| 388 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 389 | |
Jeff Johnson | 27b9896 | 2019-02-20 20:53:08 -0800 | [diff] [blame] | 390 | void lim_send_sme_join_reassoc_rsp(struct mac_context *mac_ctx, |
| 391 | uint16_t msg_type, |
| 392 | tSirResultCodes result_code, |
| 393 | uint16_t prot_status_code, |
| 394 | struct pe_session *session_entry, |
| 395 | uint8_t sme_session_id) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 396 | { |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 397 | struct join_rsp *sme_join_rsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 398 | uint32_t rsp_len; |
| 399 | tpDphHashNode sta_ds = NULL; |
| 400 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 401 | if (msg_type == eWNI_SME_REASSOC_RSP) |
| 402 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_REASSOC_RSP_EVENT, |
| 403 | session_entry, (uint16_t) result_code, 0); |
| 404 | else |
| 405 | lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_JOIN_RSP_EVENT, |
| 406 | session_entry, (uint16_t) result_code, 0); |
| 407 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 408 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 409 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 410 | lim_msg_str(msg_type), lim_result_code_str(result_code)); |
| 411 | |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 412 | if (!session_entry) { |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 413 | rsp_len = sizeof(*sme_join_rsp); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 414 | sme_join_rsp = qdf_mem_malloc(rsp_len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 415 | if (!sme_join_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 416 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 418 | sme_join_rsp->beaconLength = 0; |
| 419 | sme_join_rsp->assocReqLength = 0; |
| 420 | sme_join_rsp->assocRspLength = 0; |
| 421 | } else { |
| 422 | rsp_len = session_entry->assocReqLen + |
| 423 | session_entry->assocRspLen + session_entry->bcnLen + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 424 | session_entry->RICDataLen + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 425 | #ifdef FEATURE_WLAN_ESE |
| 426 | session_entry->tspecLen + |
| 427 | #endif |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 428 | sizeof(*sme_join_rsp) - sizeof(uint8_t); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 429 | sme_join_rsp = qdf_mem_malloc(rsp_len); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 430 | if (!sme_join_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 431 | return; |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 432 | |
| 433 | if (lim_is_fils_connection(session_entry)) { |
| 434 | sme_join_rsp->is_fils_connection = true; |
| 435 | lim_update_fils_seq_num(sme_join_rsp, |
| 436 | session_entry); |
| 437 | } |
| 438 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 439 | if (result_code == eSIR_SME_SUCCESS) { |
| 440 | sta_ds = dph_get_hash_entry(mac_ctx, |
| 441 | DPH_STA_HASH_INDEX_PEER, |
| 442 | &session_entry->dph.dphHashTable); |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 443 | if (!sta_ds) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 444 | pe_err("Get Self Sta Entry fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 445 | } else { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 446 | sme_join_rsp->timingMeasCap = |
| 447 | sta_ds->timingMeasCap; |
| 448 | #ifdef FEATURE_WLAN_TDLS |
| 449 | sme_join_rsp->tdls_prohibited = |
| 450 | session_entry->tdls_prohibited; |
| 451 | sme_join_rsp->tdls_chan_swit_prohibited = |
| 452 | session_entry->tdls_chan_swit_prohibited; |
| 453 | #endif |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 454 | sme_join_rsp->nss = sta_ds->nss; |
| 455 | sme_join_rsp->max_rate_flags = |
| 456 | lim_get_max_rate_flags(mac_ctx, sta_ds); |
Selvaraj, Sridhar | e01e073 | 2016-09-13 12:45:22 +0530 | [diff] [blame] | 457 | lim_add_bss_info(sta_ds, sme_join_rsp); |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 458 | |
| 459 | /* Copy FILS params only for Successful join */ |
| 460 | populate_fils_connect_params(mac_ctx, |
| 461 | session_entry, sme_join_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 462 | } |
| 463 | } |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 464 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 465 | sme_join_rsp->beaconLength = 0; |
| 466 | sme_join_rsp->assocReqLength = 0; |
| 467 | sme_join_rsp->assocRspLength = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 468 | sme_join_rsp->parsedRicRspLen = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 469 | #ifdef FEATURE_WLAN_ESE |
| 470 | sme_join_rsp->tspecIeLen = 0; |
| 471 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 472 | lim_handle_join_rsp_status(mac_ctx, session_entry, result_code, |
| 473 | sme_join_rsp); |
Bala Venkatesh | e7f7916 | 2019-01-16 16:43:59 +0530 | [diff] [blame] | 474 | sme_join_rsp->uapsd_mask = session_entry->gUapsdPerAcBitmask; |
Archana Ramachandran | 20d2e23 | 2016-02-11 16:58:40 -0800 | [diff] [blame] | 475 | /* Send supported NSS 1x1 to SME */ |
| 476 | sme_join_rsp->supported_nss_1x1 = |
| 477 | session_entry->supported_nss_1x1; |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 478 | pe_debug("SME Join Rsp is supported NSS 1X1: %d", |
Archana Ramachandran | 20d2e23 | 2016-02-11 16:58:40 -0800 | [diff] [blame] | 479 | sme_join_rsp->supported_nss_1x1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 480 | } |
| 481 | |
| 482 | sme_join_rsp->messageType = msg_type; |
| 483 | sme_join_rsp->length = (uint16_t) rsp_len; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 484 | sme_join_rsp->status_code = result_code; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 485 | sme_join_rsp->protStatusCode = prot_status_code; |
| 486 | |
| 487 | sme_join_rsp->sessionId = sme_session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 488 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 489 | lim_send_sme_join_reassoc_rsp_after_resume(mac_ctx, QDF_STATUS_SUCCESS, |
Jeff Johnson | 2df04b8 | 2019-02-02 23:30:25 -0800 | [diff] [blame] | 490 | sme_join_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 491 | } |
| 492 | |
Jeff Johnson | 9e3d899 | 2019-02-20 20:11:48 -0800 | [diff] [blame] | 493 | void lim_send_sme_start_bss_rsp(struct mac_context *mac, |
| 494 | uint16_t msgType, |
| 495 | tSirResultCodes resultCode, |
| 496 | struct pe_session *pe_session, |
| 497 | uint8_t smesessionId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 498 | { |
| 499 | |
| 500 | uint16_t size = 0; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 501 | struct scheduler_msg mmhMsg = {0}; |
Jeff Johnson | a0d3462 | 2019-02-02 17:26:19 -0800 | [diff] [blame] | 502 | struct start_bss_rsp *pSirSmeRsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 503 | uint16_t ieLen; |
| 504 | uint16_t ieOffset, curLen; |
| 505 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 506 | pe_debug("Sending message: %s with reasonCode: %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 507 | lim_msg_str(msgType), lim_result_code_str(resultCode)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 508 | |
Jeff Johnson | a0d3462 | 2019-02-02 17:26:19 -0800 | [diff] [blame] | 509 | size = sizeof(struct start_bss_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 510 | |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 511 | if (!pe_session) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 512 | pSirSmeRsp = qdf_mem_malloc(size); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 513 | if (!pSirSmeRsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 514 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 515 | } else { |
| 516 | /* subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID */ |
| 517 | ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 518 | ieLen = pe_session->schBeaconOffsetBegin |
| 519 | + pe_session->schBeaconOffsetEnd - ieOffset; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 520 | /* calculate the memory size to allocate */ |
| 521 | size += ieLen; |
| 522 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 523 | pSirSmeRsp = qdf_mem_malloc(size); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 524 | if (!pSirSmeRsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 525 | return; |
Jeff Johnson | a0d3462 | 2019-02-02 17:26:19 -0800 | [diff] [blame] | 526 | size = sizeof(struct start_bss_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 527 | if (resultCode == eSIR_SME_SUCCESS) { |
| 528 | |
| 529 | sir_copy_mac_addr(pSirSmeRsp->bssDescription.bssId, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 530 | pe_session->bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 531 | |
| 532 | /* Read beacon interval from session */ |
| 533 | pSirSmeRsp->bssDescription.beaconInterval = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 534 | (uint16_t) pe_session->beaconParams. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 535 | beaconInterval; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 536 | pSirSmeRsp->bssType = pe_session->bssType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 537 | |
Wu Gao | 5c3d94b | 2019-01-17 21:15:54 +0800 | [diff] [blame] | 538 | if (lim_get_capability_info |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 539 | (mac, &pSirSmeRsp->bssDescription.capabilityInfo, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 540 | pe_session) |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 541 | != QDF_STATUS_SUCCESS) |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 542 | pe_err("could not retrieve Capabilities value"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 543 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 544 | lim_get_phy_mode(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 545 | (uint32_t *) &pSirSmeRsp->bssDescription. |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 546 | nwType, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 547 | |
wadesong | 91a2c1b | 2019-07-12 12:18:06 +0800 | [diff] [blame] | 548 | pSirSmeRsp->bssDescription.chan_freq = |
Liangwei Dong | e0d4db2 | 2019-07-15 16:40:48 +0800 | [diff] [blame] | 549 | pe_session->curr_op_freq; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 550 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 551 | if (!LIM_IS_NDI_ROLE(pe_session)) { |
| 552 | curLen = pe_session->schBeaconOffsetBegin - ieOffset; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 553 | qdf_mem_copy((uint8_t *) &pSirSmeRsp->bssDescription. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 554 | ieFields, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 555 | pe_session->pSchBeaconFrameBegin + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | ieOffset, (uint32_t) curLen); |
| 557 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 558 | qdf_mem_copy(((uint8_t *) &pSirSmeRsp->bssDescription. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 559 | ieFields) + curLen, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 560 | pe_session->pSchBeaconFrameEnd, |
| 561 | (uint32_t) pe_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 562 | schBeaconOffsetEnd); |
| 563 | |
Abhishek Singh | 34a4d86 | 2016-10-26 16:01:51 +0530 | [diff] [blame] | 564 | pSirSmeRsp->bssDescription.length = (uint16_t) |
Pragaspathi Thilagaraj | 1112c96 | 2019-05-23 23:45:38 +0530 | [diff] [blame] | 565 | (offsetof(struct bss_description, ieFields[0]) |
Abhishek Singh | 34a4d86 | 2016-10-26 16:01:51 +0530 | [diff] [blame] | 566 | - sizeof(pSirSmeRsp->bssDescription.length) |
| 567 | + ieLen); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 568 | /* This is the size of the message, subtracting the size of the pointer to ieFields */ |
| 569 | size += ieLen - sizeof(uint32_t); |
Deepak Dhamdhere | e2dd544 | 2016-05-27 15:05:51 -0700 | [diff] [blame] | 570 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 571 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 572 | if (pe_session->cc_switch_mode |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 573 | != QDF_MCC_TO_SCC_SWITCH_DISABLE) { |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 574 | pSirSmeRsp->ht_profile. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 575 | htSupportedChannelWidthSet = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 576 | pe_session->htSupportedChannelWidthSet; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 577 | pSirSmeRsp->ht_profile.htRecommendedTxWidthSet = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 578 | pe_session->htRecommendedTxWidthSet; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 579 | pSirSmeRsp->ht_profile.htSecondaryChannelOffset = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 580 | pe_session->htSecondaryChannelOffset; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 581 | pSirSmeRsp->ht_profile.dot11mode = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 582 | pe_session->dot11mode; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 583 | pSirSmeRsp->ht_profile.htCapability = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 584 | pe_session->htCapability; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 585 | pSirSmeRsp->ht_profile.vhtCapability = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 586 | pe_session->vhtCapability; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 587 | pSirSmeRsp->ht_profile.apCenterChan = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 588 | pe_session->ch_center_freq_seg0; |
Jeff Johnson | f654188 | 2019-02-02 16:16:00 -0800 | [diff] [blame] | 589 | pSirSmeRsp->ht_profile.apChanWidth = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 590 | pe_session->ch_width; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 591 | } |
| 592 | #endif |
| 593 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 594 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 595 | pSirSmeRsp->messageType = msgType; |
| 596 | pSirSmeRsp->length = size; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | pSirSmeRsp->sessionId = smesessionId; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 598 | pSirSmeRsp->status_code = resultCode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 599 | |
| 600 | mmhMsg.type = msgType; |
| 601 | mmhMsg.bodyptr = pSirSmeRsp; |
| 602 | mmhMsg.bodyval = 0; |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 603 | if (!pe_session) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 604 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 605 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 606 | } else { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 607 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 608 | pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 609 | } |
| 610 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 611 | lim_diag_event_report(mac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 612 | pe_session, (uint16_t) resultCode, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 613 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 614 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 615 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 616 | } /*** end lim_send_sme_start_bss_rsp() ***/ |
| 617 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 618 | void lim_send_sme_disassoc_deauth_ntf(struct mac_context *mac, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 619 | QDF_STATUS status, uint32_t *pCtx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 620 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 621 | struct scheduler_msg mmhMsg = {0}; |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 622 | struct scheduler_msg *pMsg = (struct scheduler_msg *) pCtx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 623 | |
| 624 | mmhMsg.type = pMsg->type; |
| 625 | mmhMsg.bodyptr = pMsg; |
| 626 | mmhMsg.bodyval = 0; |
| 627 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 628 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 629 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 630 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 631 | } |
| 632 | |
Jeff Johnson | b82e6d7 | 2019-02-20 21:32:32 -0800 | [diff] [blame] | 633 | void lim_send_sme_disassoc_ntf(struct mac_context *mac, |
| 634 | tSirMacAddr peerMacAddr, |
| 635 | tSirResultCodes reasonCode, |
| 636 | uint16_t disassocTrigger, |
| 637 | uint16_t aid, |
| 638 | uint8_t smesessionId, |
| 639 | struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 640 | { |
Jeff Johnson | 380a1cd | 2019-02-03 21:43:51 -0800 | [diff] [blame] | 641 | struct disassoc_rsp *pSirSmeDisassocRsp; |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 642 | struct disassoc_ind *pSirSmeDisassocInd; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 643 | uint32_t *pMsg = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 644 | bool failure = false; |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 645 | struct pe_session *session = NULL; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 646 | uint16_t i, assoc_id; |
| 647 | tpDphHashNode sta_ds = NULL; |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 648 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 649 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 650 | pe_debug("Disassoc Ntf with trigger : %d reasonCode: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 651 | disassocTrigger, reasonCode); |
| 652 | |
| 653 | switch (disassocTrigger) { |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 654 | case eLIM_DUPLICATE_ENTRY: |
| 655 | /* |
| 656 | * Duplicate entry is removed at LIM. |
| 657 | * Initiate new entry for other session |
| 658 | */ |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 659 | pe_debug("Rcvd eLIM_DUPLICATE_ENTRY for " QDF_MAC_ADDR_STR, |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 660 | QDF_MAC_ADDR_ARRAY(peerMacAddr)); |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 661 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 662 | for (i = 0; i < mac->lim.maxBssId; i++) { |
Jeff Johnson | eac5aad | 2019-03-19 12:57:04 -0700 | [diff] [blame] | 663 | session = &mac->lim.gpSession[i]; |
| 664 | if (session->valid && |
Pragaspathi Thilagaraj | e64714a | 2019-05-23 00:46:25 +0530 | [diff] [blame] | 665 | (session->opmode == QDF_SAP_MODE)) { |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 666 | /* Find the sta ds entry in another session */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 667 | sta_ds = dph_lookup_hash_entry(mac, |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 668 | peerMacAddr, &assoc_id, |
| 669 | &session->dph.dphHashTable); |
Abhishek Singh | 6d6e3d1 | 2017-12-04 14:16:00 +0530 | [diff] [blame] | 670 | if (sta_ds) |
| 671 | break; |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 672 | } |
| 673 | } |
| 674 | if (sta_ds |
| 675 | #ifdef WLAN_FEATURE_11W |
| 676 | && (!sta_ds->rmfEnabled) |
| 677 | #endif |
| 678 | ) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 679 | if (lim_add_sta(mac, sta_ds, false, session) != |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 680 | QDF_STATUS_SUCCESS) |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 681 | pe_err("could not Add STA with assocId: %d", |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 682 | sta_ds->assocId); |
| 683 | } |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 684 | status = lim_prepare_disconnect_done_ind(mac, &pMsg, |
Pragaspathi Thilagaraj | 766c76f | 2018-08-08 16:44:40 +0530 | [diff] [blame] | 685 | smesessionId, |
| 686 | reasonCode, |
| 687 | &peerMacAddr[0]); |
| 688 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 689 | pe_err("Failed to prepare message"); |
| 690 | return; |
| 691 | } |
Sandeep Puligilla | 7e3e3c5 | 2016-09-02 17:54:21 -0700 | [diff] [blame] | 692 | break; |
| 693 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 694 | case eLIM_HOST_DISASSOC: |
| 695 | /** |
| 696 | * Disassociation response due to |
| 697 | * host triggered disassociation |
| 698 | */ |
| 699 | |
Jeff Johnson | 380a1cd | 2019-02-03 21:43:51 -0800 | [diff] [blame] | 700 | pSirSmeDisassocRsp = qdf_mem_malloc(sizeof(struct disassoc_rsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 701 | if (!pSirSmeDisassocRsp) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 702 | failure = true; |
| 703 | goto error; |
| 704 | } |
Jeff Johnson | ff1fd43 | 2019-02-20 09:50:54 -0800 | [diff] [blame] | 705 | pe_debug("send eWNI_SME_DISASSOC_RSP with retCode: %d for " |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 706 | QDF_MAC_ADDR_STR, |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 707 | reasonCode, QDF_MAC_ADDR_ARRAY(peerMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 708 | pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP; |
Jeff Johnson | 380a1cd | 2019-02-03 21:43:51 -0800 | [diff] [blame] | 709 | pSirSmeDisassocRsp->length = sizeof(struct disassoc_rsp); |
Jeff Johnson | ff1fd43 | 2019-02-20 09:50:54 -0800 | [diff] [blame] | 710 | pSirSmeDisassocRsp->sessionId = smesessionId; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 711 | pSirSmeDisassocRsp->status_code = reasonCode; |
Jeff Johnson | ff1fd43 | 2019-02-20 09:50:54 -0800 | [diff] [blame] | 712 | qdf_mem_copy(pSirSmeDisassocRsp->peer_macaddr.bytes, |
| 713 | peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 714 | |
| 715 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 716 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 717 | lim_diag_event_report(mac, WLAN_PE_DIAG_DISASSOC_RSP_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 718 | pe_session, (uint16_t) reasonCode, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 719 | #endif |
| 720 | pMsg = (uint32_t *) pSirSmeDisassocRsp; |
| 721 | break; |
| 722 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 723 | case eLIM_PEER_ENTITY_DISASSOC: |
| 724 | case eLIM_LINK_MONITORING_DISASSOC: |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 725 | status = lim_prepare_disconnect_done_ind(mac, &pMsg, |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 726 | smesessionId, |
| 727 | reasonCode, &peerMacAddr[0]); |
| 728 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 729 | pe_err("Failed to prepare message"); |
| 730 | return; |
| 731 | } |
| 732 | break; |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 733 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 734 | default: |
| 735 | /** |
| 736 | * Disassociation indication due to Disassociation |
| 737 | * frame reception from peer entity or due to |
| 738 | * loss of link with peer entity. |
| 739 | */ |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 740 | pSirSmeDisassocInd = |
| 741 | qdf_mem_malloc(sizeof(*pSirSmeDisassocInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 742 | if (!pSirSmeDisassocInd) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 743 | failure = true; |
| 744 | goto error; |
| 745 | } |
Jeff Johnson | ff1fd43 | 2019-02-20 09:50:54 -0800 | [diff] [blame] | 746 | pe_debug("send eWNI_SME_DISASSOC_IND with retCode: %d for " |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 747 | QDF_MAC_ADDR_STR, |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 748 | reasonCode, QDF_MAC_ADDR_ARRAY(peerMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 749 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 750 | pSirSmeDisassocInd->length = sizeof(*pSirSmeDisassocInd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 751 | pSirSmeDisassocInd->sessionId = smesessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 752 | pSirSmeDisassocInd->reasonCode = reasonCode; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 753 | pSirSmeDisassocInd->status_code = reasonCode; |
Jeff Johnson | ff1fd43 | 2019-02-20 09:50:54 -0800 | [diff] [blame] | 754 | qdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, |
| 755 | pe_session->bssId, sizeof(tSirMacAddr)); |
| 756 | qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, |
| 757 | peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 758 | |
| 759 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 760 | lim_diag_event_report(mac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 761 | pe_session, (uint16_t) reasonCode, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 762 | #endif |
| 763 | pMsg = (uint32_t *) pSirSmeDisassocInd; |
| 764 | |
| 765 | break; |
| 766 | } |
| 767 | |
| 768 | error: |
| 769 | /* Delete the PE session Created */ |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 770 | if ((pe_session) && LIM_IS_STA_ROLE(pe_session)) |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 771 | pe_delete_session(mac, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 772 | |
| 773 | if (false == failure) |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 774 | lim_send_sme_disassoc_deauth_ntf(mac, QDF_STATUS_SUCCESS, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 775 | (uint32_t *) pMsg); |
| 776 | } /*** end lim_send_sme_disassoc_ntf() ***/ |
| 777 | |
| 778 | /** ----------------------------------------------------------------- |
| 779 | \brief lim_send_sme_disassoc_ind() - sends SME_DISASSOC_IND |
| 780 | |
| 781 | After receiving disassociation frame from peer entity, this |
| 782 | function sends a eWNI_SME_DISASSOC_IND to SME with a specific |
| 783 | reason code. |
| 784 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 785 | \param mac - global mac structure |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 786 | \param sta - station dph hash node |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 787 | \return none |
| 788 | \sa |
| 789 | ----------------------------------------------------------------- */ |
| 790 | void |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 791 | lim_send_sme_disassoc_ind(struct mac_context *mac, tpDphHashNode sta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 792 | struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 793 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 794 | struct scheduler_msg mmhMsg = {0}; |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 795 | struct disassoc_ind *pSirSmeDisassocInd; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 796 | |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 797 | pSirSmeDisassocInd = qdf_mem_malloc(sizeof(*pSirSmeDisassocInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 798 | if (!pSirSmeDisassocInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 799 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 800 | |
| 801 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
Jeff Johnson | 318a988 | 2019-02-04 08:30:50 -0800 | [diff] [blame] | 802 | pSirSmeDisassocInd->length = sizeof(*pSirSmeDisassocInd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 803 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 804 | pSirSmeDisassocInd->sessionId = pe_session->smeSessionId; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 805 | pSirSmeDisassocInd->status_code = eSIR_SME_DEAUTH_STATUS; |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 806 | pSirSmeDisassocInd->reasonCode = sta->mlmStaContext.disassocReason; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 807 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 808 | qdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, pe_session->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 809 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 810 | |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 811 | qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, sta->staAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 812 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 813 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 814 | mmhMsg.type = eWNI_SME_DISASSOC_IND; |
| 815 | mmhMsg.bodyptr = pSirSmeDisassocInd; |
| 816 | mmhMsg.bodyval = 0; |
| 817 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 818 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 819 | pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 820 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 821 | lim_diag_event_report(mac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, pe_session, |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 822 | 0, (uint16_t) sta->mlmStaContext.disassocReason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 823 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 824 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 825 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 826 | |
| 827 | } /*** end lim_send_sme_disassoc_ind() ***/ |
| 828 | |
| 829 | /** ----------------------------------------------------------------- |
| 830 | \brief lim_send_sme_deauth_ind() - sends SME_DEAUTH_IND |
| 831 | |
| 832 | After receiving deauthentication frame from peer entity, this |
| 833 | function sends a eWNI_SME_DEAUTH_IND to SME with a specific |
| 834 | reason code. |
| 835 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 836 | \param mac - global mac structure |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 837 | \param sta - station dph hash node |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 838 | \return none |
| 839 | \sa |
| 840 | ----------------------------------------------------------------- */ |
| 841 | void |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 842 | lim_send_sme_deauth_ind(struct mac_context *mac, tpDphHashNode sta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 843 | struct pe_session *pe_session) |
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}; |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 846 | struct deauth_ind *pSirSmeDeauthInd; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 847 | |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 848 | pSirSmeDeauthInd = qdf_mem_malloc(sizeof(*pSirSmeDeauthInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 849 | if (!pSirSmeDeauthInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 850 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 851 | |
| 852 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 853 | pSirSmeDeauthInd->length = sizeof(*pSirSmeDeauthInd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 854 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 855 | pSirSmeDeauthInd->sessionId = pe_session->smeSessionId; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 856 | if (eSIR_INFRA_AP_MODE == pe_session->bssType) { |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 857 | pSirSmeDeauthInd->status_code = |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 858 | (tSirResultCodes) sta->mlmStaContext.cleanupTrigger; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 859 | } else { |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 860 | /* Need to indicate the reason code over the air */ |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 861 | pSirSmeDeauthInd->status_code = |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 862 | (tSirResultCodes) sta->mlmStaContext.disassocReason; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 863 | } |
| 864 | /* BSSID */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 865 | qdf_mem_copy(pSirSmeDeauthInd->bssid.bytes, pe_session->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 866 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 867 | /* peerMacAddr */ |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 868 | qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, sta->staAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 869 | QDF_MAC_ADDR_SIZE); |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 870 | pSirSmeDeauthInd->reasonCode = sta->mlmStaContext.disassocReason; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 871 | |
Kiran Kumar Lokere | 37d3aa2 | 2015-11-03 14:58:26 -0800 | [diff] [blame] | 872 | if (eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON == |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 873 | sta->mlmStaContext.disassocReason) |
| 874 | pSirSmeDeauthInd->rssi = sta->del_sta_ctx_rssi; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 875 | |
| 876 | mmhMsg.type = eWNI_SME_DEAUTH_IND; |
| 877 | mmhMsg.bodyptr = pSirSmeDeauthInd; |
| 878 | mmhMsg.bodyval = 0; |
| 879 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 880 | MTRACE(mac_trace_msg_tx(mac, pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 881 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 882 | lim_diag_event_report(mac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, pe_session, |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 883 | 0, sta->mlmStaContext.cleanupTrigger); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 884 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 885 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 886 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 887 | return; |
| 888 | } /*** end lim_send_sme_deauth_ind() ***/ |
| 889 | |
| 890 | #ifdef FEATURE_WLAN_TDLS |
| 891 | /** |
| 892 | * lim_send_sme_tdls_del_sta_ind() |
| 893 | * |
| 894 | ***FUNCTION: |
| 895 | * This function is called to send the TDLS STA context deletion to SME. |
| 896 | * |
| 897 | ***LOGIC: |
| 898 | * |
| 899 | ***ASSUMPTIONS: |
| 900 | * |
| 901 | ***NOTE: |
| 902 | * NA |
| 903 | * |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 904 | * @param mac - Pointer to global MAC structure |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 905 | * @param sta - Pointer to internal STA Datastructure |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 906 | * @param pe_session - Pointer to the session entry |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 907 | * @param reasonCode - Reason for TDLS sta deletion |
| 908 | * @return None |
| 909 | */ |
| 910 | void |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 911 | lim_send_sme_tdls_del_sta_ind(struct mac_context *mac, tpDphHashNode sta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 912 | struct pe_session *pe_session, uint16_t reasonCode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 913 | { |
Frank Liu | d1a2846 | 2017-09-06 22:55:48 +0800 | [diff] [blame] | 914 | struct tdls_event_info info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 915 | |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 916 | pe_debug("Delete TDLS Peer "QDF_MAC_ADDR_STR "with reason code: %d", |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 917 | QDF_MAC_ADDR_ARRAY(sta->staAddr), reasonCode); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 918 | info.vdev_id = pe_session->smeSessionId; |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 919 | qdf_mem_copy(info.peermac.bytes, sta->staAddr, QDF_MAC_ADDR_SIZE); |
Frank Liu | d1a2846 | 2017-09-06 22:55:48 +0800 | [diff] [blame] | 920 | info.message_type = TDLS_PEER_DISCONNECTED; |
| 921 | info.peer_reason = TDLS_DISCONNECTED_PEER_DELETE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 922 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 923 | tgt_tdls_event_handler(mac->psoc, &info); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 925 | return; |
| 926 | } /*** end lim_send_sme_tdls_del_sta_ind() ***/ |
| 927 | |
| 928 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 929 | * lim_send_sme_mgmt_tx_completion() |
| 930 | * |
| 931 | ***FUNCTION: |
| 932 | * This function is called to send the eWNI_SME_MGMT_FRM_TX_COMPLETION_IND |
| 933 | * message to SME. |
| 934 | * |
| 935 | ***LOGIC: |
| 936 | * |
| 937 | ***ASSUMPTIONS: |
| 938 | * |
| 939 | ***NOTE: |
| 940 | * NA |
| 941 | * |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 942 | * @param mac - Pointer to global MAC structure |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 943 | * @param pe_session - Pointer to the session entry |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 944 | * @param txCompleteStatus - TX Complete Status of Mgmt Frames |
| 945 | * @return None |
| 946 | */ |
| 947 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 948 | lim_send_sme_mgmt_tx_completion(struct mac_context *mac, |
Ganesh Kondabattini | ac57007 | 2016-12-21 12:45:48 +0530 | [diff] [blame] | 949 | uint32_t sme_session_id, |
| 950 | uint32_t txCompleteStatus) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 951 | { |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 952 | struct scheduler_msg msg = {0}; |
| 953 | struct tdls_mgmt_tx_completion_ind *mgmt_tx_completion_ind; |
| 954 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 955 | |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 956 | mgmt_tx_completion_ind = |
| 957 | qdf_mem_malloc(sizeof(*mgmt_tx_completion_ind)); |
| 958 | if (!mgmt_tx_completion_ind) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 959 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 960 | |
| 961 | /* sessionId */ |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 962 | mgmt_tx_completion_ind->session_id = sme_session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 963 | |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 964 | mgmt_tx_completion_ind->tx_complete_status = txCompleteStatus; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 965 | |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 966 | msg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 967 | msg.bodyptr = mgmt_tx_completion_ind; |
| 968 | msg.bodyval = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 969 | |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 970 | mgmt_tx_completion_ind->psoc = mac->psoc; |
| 971 | msg.callback = tgt_tdls_send_mgmt_tx_completion; |
| 972 | status = scheduler_post_message(QDF_MODULE_ID_PE, |
gaurank kathpalia | 3a7f25b | 2018-08-28 16:26:39 +0530 | [diff] [blame] | 973 | QDF_MODULE_ID_TDLS, |
Wu Gao | 6768d76 | 2018-12-28 16:31:08 +0800 | [diff] [blame] | 974 | QDF_MODULE_ID_TARGET_IF, &msg); |
| 975 | if (QDF_IS_STATUS_ERROR(status)) { |
| 976 | pe_err("post msg fail, %d", status); |
| 977 | qdf_mem_free(mgmt_tx_completion_ind); |
| 978 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 979 | } /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/ |
| 980 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 981 | #endif /* FEATURE_WLAN_TDLS */ |
| 982 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 983 | QDF_STATUS lim_prepare_disconnect_done_ind(struct mac_context *mac_ctx, |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 984 | uint32_t **msg, |
| 985 | uint8_t session_id, |
| 986 | tSirResultCodes reason_code, |
| 987 | uint8_t *peer_mac_addr) |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 988 | { |
| 989 | struct sir_sme_discon_done_ind *sir_sme_dis_ind; |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 990 | |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 991 | sir_sme_dis_ind = qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 992 | if (!sir_sme_dis_ind) |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 993 | return QDF_STATUS_E_FAILURE; |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 994 | |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 995 | pe_debug("Prepare eWNI_SME_DISCONNECT_DONE_IND withretCode: %d", |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 996 | reason_code); |
| 997 | |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 998 | sir_sme_dis_ind->message_type = eWNI_SME_DISCONNECT_DONE_IND; |
| 999 | sir_sme_dis_ind->length = sizeof(*sir_sme_dis_ind); |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 1000 | sir_sme_dis_ind->session_id = session_id; |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1001 | if (peer_mac_addr) |
Vignesh Viswanathan | b2dcdd0 | 2018-05-24 11:48:12 +0530 | [diff] [blame] | 1002 | qdf_mem_copy(sir_sme_dis_ind->peer_mac, |
| 1003 | peer_mac_addr, ETH_ALEN); |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1004 | |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 1005 | /* |
| 1006 | * Instead of sending deauth reason code as 505 which is |
| 1007 | * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1008 | * Send reason code as zero to Supplicant |
| 1009 | */ |
| 1010 | if (reason_code == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) |
| 1011 | sir_sme_dis_ind->reason_code = 0; |
| 1012 | else |
| 1013 | sir_sme_dis_ind->reason_code = reason_code; |
| 1014 | |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1015 | *msg = (uint32_t *)sir_sme_dis_ind; |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 1016 | |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1017 | return QDF_STATUS_SUCCESS; |
Himanshu Agarwal | d519b4a | 2018-03-27 15:36:09 +0530 | [diff] [blame] | 1018 | } |
| 1019 | |
Jeff Johnson | 953f99a | 2019-02-20 22:08:31 -0800 | [diff] [blame] | 1020 | void lim_send_sme_deauth_ntf(struct mac_context *mac, tSirMacAddr peerMacAddr, |
| 1021 | tSirResultCodes reasonCode, uint16_t deauthTrigger, |
| 1022 | uint16_t aid, uint8_t smesessionId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1023 | { |
| 1024 | uint8_t *pBuf; |
Jeff Johnson | 15ae0c1 | 2019-02-04 12:55:07 -0800 | [diff] [blame] | 1025 | struct deauth_rsp *pSirSmeDeauthRsp; |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 1026 | struct deauth_ind *pSirSmeDeauthInd; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1027 | struct pe_session *pe_session; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1028 | uint8_t sessionId; |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1029 | uint32_t *pMsg = NULL; |
| 1030 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1031 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1032 | pe_session = pe_find_session_by_bssid(mac, peerMacAddr, &sessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1033 | switch (deauthTrigger) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1034 | case eLIM_HOST_DEAUTH: |
| 1035 | /** |
| 1036 | * Deauthentication response to host triggered |
| 1037 | * deauthentication. |
| 1038 | */ |
Jeff Johnson | 15ae0c1 | 2019-02-04 12:55:07 -0800 | [diff] [blame] | 1039 | pSirSmeDeauthRsp = qdf_mem_malloc(sizeof(*pSirSmeDeauthRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1040 | if (!pSirSmeDeauthRsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1041 | return; |
Jeff Johnson | 15ae0c1 | 2019-02-04 12:55:07 -0800 | [diff] [blame] | 1042 | pe_debug("send eWNI_SME_DEAUTH_RSP with retCode: %d for " |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 1043 | QDF_MAC_ADDR_STR, |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 1044 | reasonCode, QDF_MAC_ADDR_ARRAY(peerMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1045 | pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP; |
Jeff Johnson | 15ae0c1 | 2019-02-04 12:55:07 -0800 | [diff] [blame] | 1046 | pSirSmeDeauthRsp->length = sizeof(*pSirSmeDeauthRsp); |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 1047 | pSirSmeDeauthRsp->status_code = reasonCode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1048 | pSirSmeDeauthRsp->sessionId = smesessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1049 | |
Srinivas Girigowda | 9cf95c5 | 2016-01-04 16:17:15 -0800 | [diff] [blame] | 1050 | pBuf = (uint8_t *) pSirSmeDeauthRsp->peer_macaddr.bytes; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1051 | qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1052 | |
| 1053 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1054 | lim_diag_event_report(mac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1055 | pe_session, 0, (uint16_t) reasonCode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1056 | #endif |
| 1057 | pMsg = (uint32_t *) pSirSmeDeauthRsp; |
| 1058 | |
| 1059 | break; |
| 1060 | |
Hanumantha Reddy Pothula | 3e5d6aa | 2016-09-08 15:21:54 +0530 | [diff] [blame] | 1061 | case eLIM_PEER_ENTITY_DEAUTH: |
| 1062 | case eLIM_LINK_MONITORING_DEAUTH: |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1063 | status = lim_prepare_disconnect_done_ind(mac, &pMsg, |
Vignesh Viswanathan | 5b909f5 | 2018-05-15 20:13:35 +0530 | [diff] [blame] | 1064 | smesessionId, reasonCode, |
| 1065 | &peerMacAddr[0]); |
| 1066 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 1067 | pe_err("Failed to prepare message"); |
| 1068 | return; |
| 1069 | } |
| 1070 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1071 | default: |
| 1072 | /** |
| 1073 | * Deauthentication indication due to Deauthentication |
| 1074 | * frame reception from peer entity or due to |
| 1075 | * loss of link with peer entity. |
| 1076 | */ |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 1077 | pSirSmeDeauthInd = qdf_mem_malloc(sizeof(*pSirSmeDeauthInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1078 | if (!pSirSmeDeauthInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1079 | return; |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 1080 | pe_debug("send eWNI_SME_DEAUTH_IND with retCode: %d for " |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 1081 | QDF_MAC_ADDR_STR, |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 1082 | reasonCode, QDF_MAC_ADDR_ARRAY(peerMacAddr)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1083 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
Jeff Johnson | fec0871 | 2019-02-04 13:12:08 -0800 | [diff] [blame] | 1084 | pSirSmeDeauthInd->length = sizeof(*pSirSmeDeauthInd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1085 | pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
Jeff Johnson | 8ee46ef | 2019-02-20 18:34:17 -0800 | [diff] [blame] | 1086 | pSirSmeDeauthInd->sessionId = smesessionId; |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 1087 | pSirSmeDeauthInd->status_code = reasonCode; |
Jeff Johnson | 8ee46ef | 2019-02-20 18:34:17 -0800 | [diff] [blame] | 1088 | qdf_mem_copy(pSirSmeDeauthInd->bssid.bytes, pe_session->bssId, |
| 1089 | sizeof(tSirMacAddr)); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1090 | qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, peerMacAddr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1091 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1092 | |
| 1093 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1094 | lim_diag_event_report(mac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1095 | pe_session, 0, (uint16_t) reasonCode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1096 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1097 | pMsg = (uint32_t *) pSirSmeDeauthInd; |
| 1098 | |
| 1099 | break; |
| 1100 | } |
| 1101 | |
| 1102 | /*Delete the PE session created */ |
Bala Venkatesh | 03b4f0c | 2019-01-28 22:00:50 +0530 | [diff] [blame] | 1103 | if (pe_session && LIM_IS_STA_ROLE(pe_session)) |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1104 | pe_delete_session(mac, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1105 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1106 | lim_send_sme_disassoc_deauth_ntf(mac, QDF_STATUS_SUCCESS, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1107 | (uint32_t *) pMsg); |
| 1108 | |
| 1109 | } /*** end lim_send_sme_deauth_ntf() ***/ |
| 1110 | |
| 1111 | /** |
| 1112 | * lim_send_sme_wm_status_change_ntf() - Send Notification |
| 1113 | * @mac_ctx: Global MAC Context |
| 1114 | * @status_change_code: Indicates the change in the wireless medium. |
| 1115 | * @status_change_info: Indicates the information associated with |
| 1116 | * change in the wireless medium. |
| 1117 | * @info_len: Indicates the length of status change information |
| 1118 | * being sent. |
| 1119 | * @session_id SessionID |
| 1120 | * |
| 1121 | * This function is called by limProcessSmeMessages() to send |
| 1122 | * eWNI_SME_WM_STATUS_CHANGE_NTF message to host. |
| 1123 | * |
| 1124 | * Return: None |
| 1125 | */ |
| 1126 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1127 | lim_send_sme_wm_status_change_ntf(struct mac_context *mac_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1128 | tSirSmeStatusChangeCode status_change_code, |
| 1129 | uint32_t *status_change_info, uint16_t info_len, uint8_t session_id) |
| 1130 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1131 | struct scheduler_msg msg = {0}; |
Jeff Johnson | 5388932 | 2019-02-03 17:37:09 -0800 | [diff] [blame] | 1132 | struct wm_status_change_ntf *wm_status_change_ntf; |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1133 | uint32_t max_info_len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1134 | |
Jeff Johnson | 5388932 | 2019-02-03 17:37:09 -0800 | [diff] [blame] | 1135 | wm_status_change_ntf = qdf_mem_malloc(sizeof(*wm_status_change_ntf)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1136 | if (!wm_status_change_ntf) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1137 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1138 | |
| 1139 | msg.type = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1140 | msg.bodyval = 0; |
| 1141 | msg.bodyptr = wm_status_change_ntf; |
| 1142 | |
| 1143 | switch (status_change_code) { |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1144 | case eSIR_SME_AP_CAPS_CHANGED: |
Jeff Johnson | 9c9961c | 2019-02-03 17:10:53 -0800 | [diff] [blame] | 1145 | max_info_len = sizeof(struct ap_new_caps); |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1146 | break; |
| 1147 | case eSIR_SME_JOINED_NEW_BSS: |
Jeff Johnson | 2e6d173 | 2019-02-03 17:00:30 -0800 | [diff] [blame] | 1148 | max_info_len = sizeof(struct new_bss_info); |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1149 | break; |
| 1150 | default: |
| 1151 | max_info_len = sizeof(wm_status_change_ntf->statusChangeInfo); |
| 1152 | break; |
| 1153 | } |
| 1154 | |
| 1155 | switch (status_change_code) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1156 | case eSIR_SME_RADAR_DETECTED: |
| 1157 | break; |
| 1158 | default: |
| 1159 | wm_status_change_ntf->messageType = |
| 1160 | eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1161 | wm_status_change_ntf->statusChangeCode = status_change_code; |
Jeff Johnson | 5388932 | 2019-02-03 17:37:09 -0800 | [diff] [blame] | 1162 | wm_status_change_ntf->length = sizeof(*wm_status_change_ntf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1163 | wm_status_change_ntf->sessionId = session_id; |
Naveen Rawat | e01ed17 | 2016-11-17 11:34:50 -0800 | [diff] [blame] | 1164 | if (info_len <= max_info_len && status_change_info) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1165 | qdf_mem_copy( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1166 | (uint8_t *) &wm_status_change_ntf->statusChangeInfo, |
| 1167 | (uint8_t *) status_change_info, info_len); |
| 1168 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1169 | pe_debug("StatusChg code: 0x%x length: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1170 | status_change_code, info_len); |
| 1171 | break; |
| 1172 | } |
| 1173 | |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1174 | MTRACE(mac_trace(mac_ctx, TRACE_CODE_TX_SME_MSG, session_id, msg.type)); |
Harprit Chhabada | e20b556 | 2019-03-11 14:13:42 -0700 | [diff] [blame] | 1175 | lim_sys_process_mmh_msg_api(mac_ctx, &msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1176 | |
| 1177 | } /*** end lim_send_sme_wm_status_change_ntf() ***/ |
| 1178 | |
Jeff Johnson | c80ed54 | 2019-02-21 06:24:57 -0800 | [diff] [blame] | 1179 | void lim_send_sme_set_context_rsp(struct mac_context *mac, |
| 1180 | struct qdf_mac_addr peer_macaddr, |
| 1181 | uint16_t aid, |
| 1182 | tSirResultCodes resultCode, |
| 1183 | struct pe_session *pe_session, |
| 1184 | uint8_t smesessionId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1185 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1186 | struct scheduler_msg mmhMsg = {0}; |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1187 | struct set_context_rsp *set_context_rsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1188 | |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1189 | set_context_rsp = qdf_mem_malloc(sizeof(*set_context_rsp)); |
| 1190 | if (!set_context_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1191 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1192 | |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1193 | set_context_rsp->messageType = eWNI_SME_SETCONTEXT_RSP; |
| 1194 | set_context_rsp->length = sizeof(*set_context_rsp); |
Pragaspathi Thilagaraj | d48e6cd | 2019-05-30 00:52:43 +0530 | [diff] [blame] | 1195 | set_context_rsp->status_code = resultCode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1196 | |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1197 | qdf_copy_macaddr(&set_context_rsp->peer_macaddr, &peer_macaddr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1198 | |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1199 | set_context_rsp->sessionId = smesessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1200 | |
| 1201 | mmhMsg.type = eWNI_SME_SETCONTEXT_RSP; |
Jeff Johnson | 924ae61 | 2019-02-05 12:01:50 -0800 | [diff] [blame] | 1202 | mmhMsg.bodyptr = set_context_rsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1203 | mmhMsg.bodyval = 0; |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1204 | if (!pe_session) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1205 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1206 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1207 | } else { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1208 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1209 | pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1213 | lim_diag_event_report(mac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1214 | pe_session, (uint16_t) resultCode, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1215 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1216 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1217 | mac->lim.sme_msg_callback(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1218 | } /*** end lim_send_sme_set_context_rsp() ***/ |
| 1219 | |
Jeff Johnson | 0781949 | 2019-02-21 09:34:02 -0800 | [diff] [blame] | 1220 | void lim_send_sme_addts_rsp(struct mac_context *mac, |
| 1221 | uint8_t rspReqd, uint32_t status, |
| 1222 | struct pe_session *pe_session, |
| 1223 | struct mac_tspec_ie tspec, |
| 1224 | uint8_t smesessionId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1225 | { |
| 1226 | tpSirAddtsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1227 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1228 | |
| 1229 | if (!rspReqd) |
| 1230 | return; |
| 1231 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1232 | rsp = qdf_mem_malloc(sizeof(tSirAddtsRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1233 | if (!rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1234 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1235 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1236 | rsp->messageType = eWNI_SME_ADDTS_RSP; |
| 1237 | rsp->rc = status; |
Pragaspathi Thilagaraj | cb58bbc | 2019-05-23 15:34:51 +0530 | [diff] [blame] | 1238 | rsp->rsp.status = (enum mac_status_code)status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1239 | rsp->rsp.tspec = tspec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1240 | rsp->sessionId = smesessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1241 | |
| 1242 | mmhMsg.type = eWNI_SME_ADDTS_RSP; |
| 1243 | mmhMsg.bodyptr = rsp; |
| 1244 | mmhMsg.bodyval = 0; |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1245 | if (!pe_session) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1246 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1247 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1248 | } else { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1249 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1250 | pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1251 | } |
| 1252 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1253 | lim_diag_event_report(mac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, pe_session, 0, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1254 | 0); |
| 1255 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1256 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1257 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1258 | return; |
| 1259 | } |
| 1260 | |
Jeff Johnson | b2b63e0 | 2019-02-21 09:46:03 -0800 | [diff] [blame] | 1261 | void lim_send_sme_delts_rsp(struct mac_context *mac, tpSirDeltsReq delts, |
| 1262 | uint32_t status, struct pe_session *pe_session, |
| 1263 | uint8_t smesessionId) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1264 | { |
| 1265 | tpSirDeltsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1266 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1267 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1268 | pe_debug("SendSmeDeltsRsp aid: %d tsid: %d up: %d status: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1269 | delts->aid, |
| 1270 | delts->req.tsinfo.traffic.tsid, |
| 1271 | delts->req.tsinfo.traffic.userPrio, status); |
| 1272 | if (!delts->rspReqd) |
| 1273 | return; |
| 1274 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1275 | rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1276 | if (!rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1277 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1278 | |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1279 | if (pe_session) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1280 | |
| 1281 | rsp->aid = delts->aid; |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 1282 | qdf_copy_macaddr(&rsp->macaddr, &delts->macaddr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1283 | qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) &delts->req, |
Jeff Johnson | cf2ec16 | 2018-12-22 16:46:43 -0800 | [diff] [blame] | 1284 | sizeof(struct delts_req_info)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1285 | } |
| 1286 | |
| 1287 | rsp->messageType = eWNI_SME_DELTS_RSP; |
| 1288 | rsp->rc = status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1289 | rsp->sessionId = smesessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1290 | |
| 1291 | mmhMsg.type = eWNI_SME_DELTS_RSP; |
| 1292 | mmhMsg.bodyptr = rsp; |
| 1293 | mmhMsg.bodyval = 0; |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1294 | if (!pe_session) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1295 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1296 | NO_SESSION, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1297 | } else { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1298 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1299 | pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1300 | } |
| 1301 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1302 | lim_diag_event_report(mac, WLAN_PE_DIAG_DELTS_RSP_EVENT, pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1303 | (uint16_t) status, 0); |
| 1304 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1305 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1306 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1307 | } |
| 1308 | |
| 1309 | void |
Jeff Johnson | cf2ec16 | 2018-12-22 16:46:43 -0800 | [diff] [blame] | 1310 | lim_send_sme_delts_ind(struct mac_context *mac, struct delts_req_info *delts, |
| 1311 | uint16_t aid, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1312 | { |
| 1313 | tpSirDeltsRsp rsp; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1314 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1315 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1316 | pe_debug("SendSmeDeltsInd aid: %d tsid: %d up: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1317 | aid, delts->tsinfo.traffic.tsid, delts->tsinfo.traffic.userPrio); |
| 1318 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1319 | rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1320 | if (!rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1321 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1322 | |
| 1323 | rsp->messageType = eWNI_SME_DELTS_IND; |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1324 | rsp->rc = QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1325 | rsp->aid = aid; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1326 | qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) delts, sizeof(*delts)); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1327 | rsp->sessionId = pe_session->smeSessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1328 | |
| 1329 | mmhMsg.type = eWNI_SME_DELTS_IND; |
| 1330 | mmhMsg.bodyptr = rsp; |
| 1331 | mmhMsg.bodyval = 0; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1332 | MTRACE(mac_trace_msg_tx(mac, pe_session->peSessionId, mmhMsg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1333 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1334 | lim_diag_event_report(mac, WLAN_PE_DIAG_DELTS_IND_EVENT, pe_session, 0, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1335 | 0); |
| 1336 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1337 | |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1338 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1339 | } |
| 1340 | |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1341 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1342 | /** |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1343 | * lim_send_sme_pe_ese_tsm_rsp() - send tsm response |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1344 | * @mac: Pointer to global mac structure |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1345 | * @pStats: Pointer to TSM Stats |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1346 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1347 | * This function is called to send tsm stats response to HDD. |
| 1348 | * This function posts the result back to HDD. This is a response to |
| 1349 | * HDD's request to get tsm stats. |
| 1350 | * |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1351 | * Return: None |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1352 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1353 | void lim_send_sme_pe_ese_tsm_rsp(struct mac_context *mac, |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1354 | tAniGetTsmStatsRsp *pStats) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1355 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1356 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1357 | uint8_t sessionId; |
| 1358 | tAniGetTsmStatsRsp *pPeStats = (tAniGetTsmStatsRsp *) pStats; |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 1359 | struct pe_session *pPeSessionEntry = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1360 | |
| 1361 | /* Get the Session Id based on Sta Id */ |
Abhinav Kumar | aa8f2df | 2019-01-11 20:02:26 +0530 | [diff] [blame] | 1362 | pPeSessionEntry = pe_find_session_by_bssid(mac, pPeStats->bssid.bytes, |
| 1363 | &sessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1364 | /* Fill the Session Id */ |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1365 | if (pPeSessionEntry) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1366 | /* Fill the Session Id */ |
| 1367 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 1368 | } else { |
Sourav Mohapatra | dcd8f8d | 2019-07-03 15:43:15 +0530 | [diff] [blame] | 1369 | pe_err("Session not found for the Sta peer:" QDF_MAC_ADDR_STR, |
| 1370 | QDF_MAC_ADDR_ARRAY(pPeStats->bssid.bytes)); |
Manikandan Mohan | 41e2d6f | 2017-04-10 16:17:39 +0530 | [diff] [blame] | 1371 | qdf_mem_free(pPeStats->tsmStatsReq); |
| 1372 | qdf_mem_free(pPeStats); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1373 | return; |
| 1374 | } |
| 1375 | |
| 1376 | pPeStats->msgType = eWNI_SME_GET_TSM_STATS_RSP; |
| 1377 | pPeStats->tsmMetrics.RoamingCount |
| 1378 | = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingCount; |
| 1379 | pPeStats->tsmMetrics.RoamingDly |
| 1380 | = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingDly; |
| 1381 | |
| 1382 | mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP; |
| 1383 | mmhMsg.bodyptr = pStats; |
| 1384 | mmhMsg.bodyval = 0; |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1385 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1386 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1387 | |
| 1388 | return; |
| 1389 | } /*** end lim_send_sme_pe_ese_tsm_rsp() ***/ |
| 1390 | |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1391 | #endif /* FEATURE_WLAN_ESE */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1392 | |
Abhishek Ambure | dddf428 | 2019-09-27 18:54:38 +0530 | [diff] [blame] | 1393 | #ifdef QCA_IBSS_SUPPORT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1394 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1395 | lim_send_sme_ibss_peer_ind(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1396 | tSirMacAddr peerMacAddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1397 | uint8_t *beacon, |
| 1398 | uint16_t beaconLen, uint16_t msgType, uint8_t sessionId) |
| 1399 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1400 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1401 | tSmeIbssPeerInd *pNewPeerInd; |
| 1402 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1403 | pNewPeerInd = qdf_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1404 | if (!pNewPeerInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1405 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1406 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1407 | qdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1408 | peerMacAddr, QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1409 | pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen; |
| 1410 | pNewPeerInd->mesgType = msgType; |
| 1411 | pNewPeerInd->sessionId = sessionId; |
| 1412 | |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1413 | if (beacon) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1414 | qdf_mem_copy((void *)((uint8_t *) pNewPeerInd + |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1415 | sizeof(tSmeIbssPeerInd)), (void *)beacon, |
| 1416 | beaconLen); |
| 1417 | } |
| 1418 | |
| 1419 | mmhMsg.type = msgType; |
| 1420 | mmhMsg.bodyptr = pNewPeerInd; |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1421 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1422 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1423 | |
| 1424 | } |
Abhishek Ambure | dddf428 | 2019-09-27 18:54:38 +0530 | [diff] [blame] | 1425 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1426 | |
Kiran Kumar Lokere | fc8feea | 2016-10-27 17:07:00 -0700 | [diff] [blame] | 1427 | /** |
| 1428 | * lim_process_csa_wbw_ie() - Process CSA Wide BW IE |
| 1429 | * @mac_ctx: pointer to global adapter context |
| 1430 | * @csa_params: pointer to CSA parameters |
| 1431 | * @chnl_switch_info:pointer to channel switch parameters |
| 1432 | * @session_entry: session pointer |
| 1433 | * |
| 1434 | * Return: None |
| 1435 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1436 | static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx, |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1437 | struct csa_offload_params *csa_params, |
| 1438 | tLimWiderBWChannelSwitchInfo *chnl_switch_info, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 1439 | struct pe_session *session_entry) |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1440 | { |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 1441 | struct ch_params ch_params = {0}; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1442 | uint8_t ap_new_ch_width; |
| 1443 | bool new_ch_width_dfn = false; |
| 1444 | uint8_t center_freq_diff; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1445 | 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] | 1446 | |
| 1447 | ap_new_ch_width = csa_params->new_ch_width + 1; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1448 | |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 1449 | pe_debug("new channel: %d new_ch_width: %d seg0: %d seg1: %d", |
| 1450 | csa_params->channel, ap_new_ch_width, |
| 1451 | csa_params->new_ch_freq_seg1, |
| 1452 | csa_params->new_ch_freq_seg2); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1453 | |
| 1454 | if ((ap_new_ch_width != CH_WIDTH_80MHZ) && |
| 1455 | (ap_new_ch_width != CH_WIDTH_160MHZ) && |
| 1456 | (ap_new_ch_width != CH_WIDTH_80P80MHZ)) { |
| 1457 | pe_err("CSA wide BW IE has wrong ch_width %d", |
| 1458 | csa_params->new_ch_width); |
| 1459 | return QDF_STATUS_E_INVAL; |
| 1460 | } |
| 1461 | |
| 1462 | if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) { |
| 1463 | pe_err("CSA wide BW IE has invalid center freq"); |
| 1464 | return QDF_STATUS_E_INVAL; |
| 1465 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1466 | if ((ap_new_ch_width == CH_WIDTH_80MHZ) && |
| 1467 | csa_params->new_ch_freq_seg2) { |
| 1468 | new_ch_width_dfn = true; |
| 1469 | if (csa_params->new_ch_freq_seg2 > |
| 1470 | csa_params->new_ch_freq_seg1) |
| 1471 | center_freq_diff = csa_params->new_ch_freq_seg2 - |
| 1472 | csa_params->new_ch_freq_seg1; |
| 1473 | else |
| 1474 | center_freq_diff = csa_params->new_ch_freq_seg1 - |
| 1475 | csa_params->new_ch_freq_seg2; |
| 1476 | if (center_freq_diff == CENTER_FREQ_DIFF_160MHz) |
| 1477 | ap_new_ch_width = CH_WIDTH_160MHZ; |
| 1478 | else if (center_freq_diff > CENTER_FREQ_DIFF_80P80MHz) |
| 1479 | ap_new_ch_width = CH_WIDTH_80P80MHZ; |
| 1480 | else |
| 1481 | ap_new_ch_width = CH_WIDTH_80MHZ; |
| 1482 | } |
| 1483 | session_entry->gLimChannelSwitch.state = |
| 1484 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 1485 | if ((ap_new_ch_width == CH_WIDTH_160MHZ) && |
| 1486 | !new_ch_width_dfn) { |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1487 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 1488 | CH_TO_CNTR_FREQ_DIFF_160MHz) { |
| 1489 | pe_err("CSA wide BW IE has invalid center freq"); |
| 1490 | return QDF_STATUS_E_INVAL; |
| 1491 | } |
| 1492 | |
| 1493 | if (ap_new_ch_width > fw_vht_ch_wd) { |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 1494 | pe_debug("New BW is not supported, setting BW to %d", |
| 1495 | fw_vht_ch_wd); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1496 | ap_new_ch_width = fw_vht_ch_wd; |
| 1497 | } |
| 1498 | ch_params.ch_width = ap_new_ch_width ; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1499 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 1500 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1501 | ap_new_ch_width = ch_params.ch_width; |
| 1502 | csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0; |
| 1503 | csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1; |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1504 | } else if (!new_ch_width_dfn) { |
| 1505 | if (ap_new_ch_width > fw_vht_ch_wd) { |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 1506 | pe_debug("New BW is not supported, setting BW to %d", |
| 1507 | fw_vht_ch_wd); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1508 | ap_new_ch_width = fw_vht_ch_wd; |
| 1509 | } |
| 1510 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 1511 | CH_TO_CNTR_FREQ_DIFF_80MHz) { |
| 1512 | pe_err("CSA wide BW IE has invalid center freq"); |
| 1513 | return QDF_STATUS_E_INVAL; |
| 1514 | } |
| 1515 | csa_params->new_ch_freq_seg2 = 0; |
| 1516 | } |
| 1517 | if (new_ch_width_dfn) { |
| 1518 | if (csa_params->new_ch_freq_seg1 != csa_params->channel + |
| 1519 | CH_TO_CNTR_FREQ_DIFF_80MHz) { |
| 1520 | pe_err("CSA wide BW IE has invalid center freq"); |
| 1521 | return QDF_STATUS_E_INVAL; |
| 1522 | } |
| 1523 | if (ap_new_ch_width > fw_vht_ch_wd) { |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 1524 | pe_debug("New width is not supported, setting BW to %d", |
| 1525 | fw_vht_ch_wd); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1526 | ap_new_ch_width = fw_vht_ch_wd; |
| 1527 | } |
| 1528 | if ((ap_new_ch_width == CH_WIDTH_160MHZ) && |
| 1529 | (csa_params->new_ch_freq_seg1 != |
| 1530 | csa_params->channel + |
| 1531 | CH_TO_CNTR_FREQ_DIFF_160MHz)) { |
| 1532 | pe_err("wide BW IE has invalid 160M center freq"); |
| 1533 | csa_params->new_ch_freq_seg2 = 0; |
| 1534 | ap_new_ch_width = CH_WIDTH_80MHZ; |
| 1535 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1536 | } |
| 1537 | chnl_switch_info->newChanWidth = ap_new_ch_width; |
| 1538 | chnl_switch_info->newCenterChanFreq0 = csa_params->new_ch_freq_seg1; |
| 1539 | chnl_switch_info->newCenterChanFreq1 = csa_params->new_ch_freq_seg2; |
| 1540 | |
| 1541 | if (session_entry->ch_width == ap_new_ch_width) |
| 1542 | goto prnt_log; |
| 1543 | |
| 1544 | if (session_entry->ch_width == CH_WIDTH_80MHZ) { |
| 1545 | chnl_switch_info->newChanWidth = CH_WIDTH_80MHZ; |
| 1546 | chnl_switch_info->newCenterChanFreq1 = 0; |
| 1547 | } else { |
| 1548 | session_entry->ch_width = ap_new_ch_width; |
| 1549 | chnl_switch_info->newChanWidth = ap_new_ch_width; |
| 1550 | } |
| 1551 | prnt_log: |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1552 | 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] | 1553 | csa_params->channel, |
| 1554 | chnl_switch_info->newChanWidth, |
| 1555 | chnl_switch_info->newCenterChanFreq0, |
| 1556 | chnl_switch_info->newCenterChanFreq1); |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1557 | |
| 1558 | return QDF_STATUS_SUCCESS; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1559 | } |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1560 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1561 | /** |
| 1562 | * lim_handle_csa_offload_msg() - Handle CSA offload message |
| 1563 | * @mac_ctx: pointer to global adapter context |
| 1564 | * @msg: Message pointer. |
| 1565 | * |
| 1566 | * Return: None |
| 1567 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1568 | void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 1569 | struct scheduler_msg *msg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1570 | { |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 1571 | struct pe_session *session_entry; |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1572 | struct csa_offload_params *csa_params = |
| 1573 | (struct csa_offload_params *) (msg->bodyptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1574 | tpDphHashNode sta_ds = NULL; |
| 1575 | uint8_t session_id; |
| 1576 | uint16_t aid = 0; |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 1577 | uint16_t chan_space = 0; |
Krunal Soni | e2c45a9 | 2018-05-03 11:51:26 -0700 | [diff] [blame] | 1578 | struct ch_params ch_params = {0}; |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 1579 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1580 | tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL; |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 1581 | tLimChannelSwitchInfo *lim_ch_switch = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1582 | |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1583 | pe_debug("handle csa offload msg"); |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1584 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1585 | if (!csa_params) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1586 | pe_err("limMsgQ body ptr is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1587 | return; |
| 1588 | } |
| 1589 | |
| 1590 | session_entry = |
| 1591 | pe_find_session_by_bssid(mac_ctx, |
| 1592 | csa_params->bssId, &session_id); |
| 1593 | if (!session_entry) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1594 | pe_err("Session does not exists for %pM", |
Chandrasekaran, Manishekar | 5c19dc5 | 2016-02-04 14:58:26 +0530 | [diff] [blame] | 1595 | csa_params->bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1596 | goto err; |
| 1597 | } |
| 1598 | |
| 1599 | sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid, |
| 1600 | &session_entry->dph.dphHashTable); |
| 1601 | |
| 1602 | if (!sta_ds) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1603 | pe_err("sta_ds does not exist"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1604 | goto err; |
| 1605 | } |
| 1606 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1607 | if (!LIM_IS_STA_ROLE(session_entry)) { |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1608 | pe_debug("Invalid role to handle CSA"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1609 | goto err; |
| 1610 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1611 | /* |
| 1612 | * on receiving channel switch announcement from AP, delete all |
| 1613 | * TDLS peers before leaving BSS and proceed for channel switch |
| 1614 | */ |
Bala Venkatesh | 33f270b | 2019-01-14 16:31:29 +0530 | [diff] [blame] | 1615 | |
| 1616 | lim_update_tdls_set_state_for_fw(session_entry, false); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1617 | lim_delete_tdls_peers(mac_ctx, session_entry); |
Gupta, Kapil | 121bf21 | 2015-11-25 19:21:29 +0530 | [diff] [blame] | 1618 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1619 | lim_ch_switch = &session_entry->gLimChannelSwitch; |
| 1620 | session_entry->gLimChannelSwitch.switchMode = |
| 1621 | csa_params->switch_mode; |
| 1622 | /* timer already started by firmware, switch immediately */ |
| 1623 | session_entry->gLimChannelSwitch.switchCount = 0; |
| 1624 | session_entry->gLimChannelSwitch.primaryChannel = |
| 1625 | csa_params->channel; |
| 1626 | session_entry->gLimChannelSwitch.state = |
| 1627 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 1628 | session_entry->gLimChannelSwitch.ch_width = CH_WIDTH_20MHZ; |
| 1629 | lim_ch_switch->sec_ch_offset = |
| 1630 | session_entry->htSecondaryChannelOffset; |
| 1631 | session_entry->gLimChannelSwitch.ch_center_freq_seg0 = 0; |
| 1632 | session_entry->gLimChannelSwitch.ch_center_freq_seg1 = 0; |
| 1633 | chnl_switch_info = |
| 1634 | &session_entry->gLimWiderBWChannelSwitch; |
| 1635 | |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 1636 | pe_debug("vht: %d ht: %d flag: %x chan: %d, sec_ch_offset %d", |
| 1637 | session_entry->vhtCapability, |
| 1638 | session_entry->htSupportedChannelWidthSet, |
| 1639 | csa_params->ies_present_flag, |
| 1640 | csa_params->channel, |
| 1641 | csa_params->sec_chan_offset); |
| 1642 | pe_debug("seg1: %d seg2: %d width: %d country: %s class: %d", |
| 1643 | csa_params->new_ch_freq_seg1, |
| 1644 | csa_params->new_ch_freq_seg2, |
| 1645 | csa_params->new_ch_width, |
| 1646 | mac_ctx->scan.countryCodeCurrent, |
| 1647 | csa_params->new_op_class); |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 1648 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1649 | if (session_entry->vhtCapability && |
| 1650 | session_entry->htSupportedChannelWidthSet) { |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 1651 | if ((csa_params->ies_present_flag & lim_wbw_ie_present) && |
| 1652 | (QDF_STATUS_SUCCESS == lim_process_csa_wbw_ie(mac_ctx, |
| 1653 | csa_params, chnl_switch_info, |
| 1654 | session_entry))) { |
| 1655 | pe_debug("CSA wide BW IE process successful"); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1656 | lim_ch_switch->sec_ch_offset = |
Abhishek Singh | af639b4 | 2017-06-16 14:14:36 +0530 | [diff] [blame] | 1657 | PHY_SINGLE_CHANNEL_CENTERED; |
| 1658 | if (chnl_switch_info->newChanWidth) { |
| 1659 | if (csa_params->channel < |
| 1660 | csa_params->new_ch_freq_seg1) |
| 1661 | lim_ch_switch->sec_ch_offset = |
| 1662 | PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 1663 | else |
| 1664 | lim_ch_switch->sec_ch_offset = |
| 1665 | PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 1666 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1667 | } else if (csa_params->ies_present_flag |
| 1668 | & lim_xcsa_ie_present) { |
| 1669 | chan_space = |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1670 | wlan_reg_dmn_get_chanwidth_from_opclass( |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1671 | mac_ctx->scan.countryCodeCurrent, |
| 1672 | csa_params->channel, |
| 1673 | csa_params->new_op_class); |
| 1674 | session_entry->gLimChannelSwitch.state = |
| 1675 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 1676 | |
| 1677 | if (chan_space == 80) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1678 | chnl_switch_info->newChanWidth = |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1679 | CH_WIDTH_80MHZ; |
| 1680 | } else if (chan_space == 40) { |
| 1681 | chnl_switch_info->newChanWidth = |
| 1682 | CH_WIDTH_40MHZ; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1683 | } else { |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1684 | chnl_switch_info->newChanWidth = |
| 1685 | CH_WIDTH_20MHZ; |
| 1686 | lim_ch_switch->state = |
| 1687 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 1688 | } |
| 1689 | |
| 1690 | ch_params.ch_width = |
| 1691 | chnl_switch_info->newChanWidth; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1692 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 1693 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1694 | chnl_switch_info->newCenterChanFreq0 = |
| 1695 | ch_params.center_freq_seg0; |
| 1696 | /* |
| 1697 | * This is not applicable for 20/40/80 MHz. |
| 1698 | * Only used when we support 80+80 MHz operation. |
| 1699 | * In case of 80+80 MHz, this parameter indicates |
| 1700 | * center channel frequency index of 80 MHz |
| 1701 | * channel offrequency segment 1. |
| 1702 | */ |
| 1703 | chnl_switch_info->newCenterChanFreq1 = |
| 1704 | ch_params.center_freq_seg1; |
| 1705 | lim_ch_switch->sec_ch_offset = |
| 1706 | ch_params.sec_ch_offset; |
| 1707 | |
Kiran Kumar Lokere | 4712748 | 2017-12-20 18:09:55 -0800 | [diff] [blame] | 1708 | } else { |
| 1709 | lim_ch_switch->state = |
| 1710 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 1711 | ch_params.ch_width = CH_WIDTH_40MHZ; |
| 1712 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 1713 | csa_params->channel, 0, &ch_params); |
| 1714 | lim_ch_switch->sec_ch_offset = |
| 1715 | ch_params.sec_ch_offset; |
| 1716 | chnl_switch_info->newChanWidth = CH_WIDTH_40MHZ; |
| 1717 | chnl_switch_info->newCenterChanFreq0 = |
| 1718 | ch_params.center_freq_seg0; |
| 1719 | chnl_switch_info->newCenterChanFreq1 = 0; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1720 | } |
| 1721 | session_entry->gLimChannelSwitch.ch_center_freq_seg0 = |
| 1722 | chnl_switch_info->newCenterChanFreq0; |
| 1723 | session_entry->gLimChannelSwitch.ch_center_freq_seg1 = |
| 1724 | chnl_switch_info->newCenterChanFreq1; |
| 1725 | session_entry->gLimChannelSwitch.ch_width = |
| 1726 | chnl_switch_info->newChanWidth; |
| 1727 | |
| 1728 | } else if (session_entry->htSupportedChannelWidthSet) { |
| 1729 | if (csa_params->ies_present_flag |
| 1730 | & lim_xcsa_ie_present) { |
| 1731 | chan_space = |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1732 | wlan_reg_dmn_get_chanwidth_from_opclass( |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1733 | mac_ctx->scan.countryCodeCurrent, |
| 1734 | csa_params->channel, |
| 1735 | csa_params->new_op_class); |
| 1736 | lim_ch_switch->state = |
| 1737 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 1738 | if (chan_space == 40) { |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 1739 | lim_ch_switch->ch_width = |
| 1740 | CH_WIDTH_40MHZ; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1741 | chnl_switch_info->newChanWidth = |
| 1742 | CH_WIDTH_40MHZ; |
| 1743 | ch_params.ch_width = |
| 1744 | chnl_switch_info->newChanWidth; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1745 | wlan_reg_set_channel_params(mac_ctx->pdev, |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1746 | csa_params->channel, |
Sandeep Puligilla | 1cc23f6 | 2016-04-27 16:52:49 -0700 | [diff] [blame] | 1747 | 0, &ch_params); |
Kiran Kumar Lokere | 999e58c | 2016-01-07 02:18:39 -0800 | [diff] [blame] | 1748 | lim_ch_switch->ch_center_freq_seg0 = |
| 1749 | ch_params.center_freq_seg0; |
| 1750 | lim_ch_switch->sec_ch_offset = |
| 1751 | ch_params.sec_ch_offset; |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1752 | } else { |
| 1753 | lim_ch_switch->ch_width = |
| 1754 | CH_WIDTH_20MHZ; |
| 1755 | chnl_switch_info->newChanWidth = |
| 1756 | CH_WIDTH_40MHZ; |
| 1757 | lim_ch_switch->state = |
| 1758 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 1759 | lim_ch_switch->sec_ch_offset = |
| 1760 | PHY_SINGLE_CHANNEL_CENTERED; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1761 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1762 | } else { |
| 1763 | lim_ch_switch->ch_width = |
| 1764 | CH_WIDTH_40MHZ; |
| 1765 | lim_ch_switch->state = |
| 1766 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 1767 | ch_params.ch_width = CH_WIDTH_40MHZ; |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1768 | wlan_reg_set_channel_params(mac_ctx->pdev, |
| 1769 | csa_params->channel, 0, &ch_params); |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1770 | lim_ch_switch->ch_center_freq_seg0 = |
| 1771 | ch_params.center_freq_seg0; |
| 1772 | lim_ch_switch->sec_ch_offset = |
| 1773 | ch_params.sec_ch_offset; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1774 | } |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1775 | |
| 1776 | } |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1777 | pe_debug("new ch width: %d space: %d", |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 1778 | session_entry->gLimChannelSwitch.ch_width, chan_space); |
Liangwei Dong | e0d4db2 | 2019-07-15 16:40:48 +0800 | [diff] [blame] | 1779 | if ((wlan_reg_freq_to_chan(mac_ctx->pdev, |
| 1780 | session_entry->curr_op_freq) == |
| 1781 | csa_params->channel) && |
| 1782 | session_entry->ch_width == |
| 1783 | session_entry->gLimChannelSwitch.ch_width) { |
Kiran Kumar Lokere | 75d636f | 2016-12-20 14:52:03 -0800 | [diff] [blame] | 1784 | pe_debug("Ignore CSA, no change in ch and bw"); |
| 1785 | goto err; |
| 1786 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1787 | |
Pragaspathi Thilagaraj | 5fcd718 | 2018-06-06 13:46:18 +0530 | [diff] [blame] | 1788 | if (WLAN_REG_IS_24GHZ_CH(csa_params->channel) && |
gaurank kathpalia | 0c48d3d | 2019-01-29 15:03:07 +0530 | [diff] [blame] | 1789 | (session_entry->dot11mode == MLME_DOT11_MODE_11A)) |
| 1790 | session_entry->dot11mode = MLME_DOT11_MODE_11G; |
Pragaspathi Thilagaraj | 5fcd718 | 2018-06-06 13:46:18 +0530 | [diff] [blame] | 1791 | else if (WLAN_REG_IS_5GHZ_CH(csa_params->channel) && |
gaurank kathpalia | 0c48d3d | 2019-01-29 15:03:07 +0530 | [diff] [blame] | 1792 | ((session_entry->dot11mode == MLME_DOT11_MODE_11G) || |
| 1793 | (session_entry->dot11mode == MLME_DOT11_MODE_11G_ONLY))) |
| 1794 | session_entry->dot11mode = MLME_DOT11_MODE_11A; |
Pragaspathi Thilagaraj | 5fcd718 | 2018-06-06 13:46:18 +0530 | [diff] [blame] | 1795 | |
Vignesh Viswanathan | 3d47803 | 2018-08-02 20:18:53 +0530 | [diff] [blame] | 1796 | /* Send RSO Stop to FW before triggering the vdev restart for CSA */ |
| 1797 | if (mac_ctx->lim.stop_roaming_callback) |
| 1798 | mac_ctx->lim.stop_roaming_callback(mac_ctx, |
| 1799 | session_entry->smeSessionId, |
Abhinav Kumar | 523ca37 | 2019-08-30 16:28:19 +0530 | [diff] [blame] | 1800 | REASON_DRIVER_DISABLED, |
| 1801 | RSO_CHANNEL_SWITCH); |
Vignesh Viswanathan | 3d47803 | 2018-08-02 20:18:53 +0530 | [diff] [blame] | 1802 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1803 | lim_prepare_for11h_channel_switch(mac_ctx, session_entry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1804 | |
Abhishek Singh | ecc2c75 | 2019-03-18 11:05:39 +0530 | [diff] [blame] | 1805 | lim_flush_bssid(mac_ctx, session_entry->bssId); |
| 1806 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1807 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 1808 | lim_diag_event_report(mac_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1809 | WLAN_PE_DIAG_SWITCH_CHL_IND_EVENT, session_entry, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1810 | QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1811 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1812 | |
| 1813 | err: |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1814 | qdf_mem_free(csa_params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1815 | } |
| 1816 | |
| 1817 | /*-------------------------------------------------------------------------- |
| 1818 | \brief pe_delete_session() - Handle the Delete BSS Response from HAL. |
| 1819 | |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1820 | \param mac - pointer to global adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1821 | \param sessionId - Message pointer. |
| 1822 | |
| 1823 | \sa |
| 1824 | --------------------------------------------------------------------------*/ |
| 1825 | |
Abhishek Ambure | 2bd960b | 2019-08-21 16:30:53 +0530 | [diff] [blame] | 1826 | void lim_handle_delete_bss_rsp(struct mac_context *mac, |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1827 | struct del_bss_resp *del_bss_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1828 | { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1829 | struct pe_session *pe_session; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1830 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1831 | pe_session = |
Abhishek Singh | efe21e6 | 2019-09-20 10:03:24 +0530 | [diff] [blame] | 1832 | pe_find_session_by_vdev_id(mac, del_bss_rsp->vdev_id); |
Jeff Johnson | 8e9530b | 2019-03-18 13:41:42 -0700 | [diff] [blame] | 1833 | if (!pe_session) { |
Abhishek Ambure | 2bd960b | 2019-08-21 16:30:53 +0530 | [diff] [blame] | 1834 | pe_err("Session Does not exist for vdev id: %d", |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1835 | del_bss_rsp->vdev_id); |
| 1836 | qdf_mem_free(del_bss_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1837 | return; |
| 1838 | } |
Krunal Soni | e50ff45 | 2017-10-11 18:23:55 -0700 | [diff] [blame] | 1839 | |
| 1840 | /* |
Deepak Dhamdhere | 2dae1bd | 2016-10-27 10:58:29 -0700 | [diff] [blame] | 1841 | * During DEL BSS handling, the PE Session will be deleted, but it is |
| 1842 | * better to clear this flag if the session is hanging around due |
| 1843 | * to some error conditions so that the next DEL_BSS request does |
| 1844 | * not take the HO_FAIL path |
| 1845 | */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1846 | pe_session->process_ho_fail = false; |
| 1847 | if (LIM_IS_IBSS_ROLE(pe_session)) |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1848 | lim_ibss_del_bss_rsp(mac, del_bss_rsp, pe_session); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1849 | else if (LIM_IS_UNKNOWN_ROLE(pe_session)) |
Abhishek Ambure | 2bd960b | 2019-08-21 16:30:53 +0530 | [diff] [blame] | 1850 | lim_process_sme_del_bss_rsp(mac, pe_session); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1851 | else if (LIM_IS_NDI_ROLE(pe_session)) |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1852 | lim_ndi_del_bss_rsp(mac, del_bss_rsp, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1853 | else |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1854 | lim_process_mlm_del_bss_rsp(mac, del_bss_rsp, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1855 | |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1856 | qdf_mem_free(del_bss_rsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1857 | } |
| 1858 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1859 | /** ----------------------------------------------------------------- |
| 1860 | \brief lim_send_sme_aggr_qos_rsp() - sends SME FT AGGR QOS RSP |
| 1861 | \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME. |
| 1862 | \ SME only looks at rc and tspec field. |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1863 | \param mac - global mac structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1864 | \param rspReqd - is SmeAddTsRsp required |
| 1865 | \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP |
| 1866 | \return tspec |
| 1867 | \sa |
| 1868 | ----------------------------------------------------------------- */ |
| 1869 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1870 | lim_send_sme_aggr_qos_rsp(struct mac_context *mac, tpSirAggrQosRsp aggrQosRsp, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1871 | uint8_t smesessionId) |
| 1872 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1873 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1874 | |
| 1875 | mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP; |
| 1876 | mmhMsg.bodyptr = aggrQosRsp; |
| 1877 | mmhMsg.bodyval = 0; |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1878 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1879 | smesessionId, mmhMsg.type)); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1880 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1881 | |
| 1882 | return; |
| 1883 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1884 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1885 | void lim_send_sme_max_assoc_exceeded_ntf(struct mac_context *mac, tSirMacAddr peerMacAddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1886 | uint8_t smesessionId) |
| 1887 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1888 | struct scheduler_msg mmhMsg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1889 | tSmeMaxAssocInd *pSmeMaxAssocInd; |
| 1890 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1891 | pSmeMaxAssocInd = qdf_mem_malloc(sizeof(tSmeMaxAssocInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 1892 | if (!pSmeMaxAssocInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1893 | return; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1894 | qdf_mem_copy((uint8_t *) pSmeMaxAssocInd->peer_mac.bytes, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1895 | (uint8_t *) peerMacAddr, QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1896 | pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED; |
| 1897 | pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd); |
| 1898 | pSmeMaxAssocInd->sessionId = smesessionId; |
| 1899 | mmhMsg.type = pSmeMaxAssocInd->mesgType; |
| 1900 | mmhMsg.bodyptr = pSmeMaxAssocInd; |
Srinivas Girigowda | cb7b8b8 | 2019-04-10 14:27:47 -0700 | [diff] [blame] | 1901 | pe_debug("msgType: %s peerMacAddr "QDF_MAC_ADDR_STR "sme session id %d", |
Srinivas Girigowda | 34fbba0 | 2019-04-08 12:07:44 -0700 | [diff] [blame] | 1902 | "eWNI_SME_MAX_ASSOC_EXCEEDED", QDF_MAC_ADDR_ARRAY(peerMacAddr), |
Nishank Aggarwal | 2d6162b | 2017-03-24 17:38:12 +0530 | [diff] [blame] | 1903 | pSmeMaxAssocInd->sessionId); |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1904 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Sreelakshmi Konamki | beacc2e | 2016-09-01 16:14:56 +0530 | [diff] [blame] | 1905 | smesessionId, mmhMsg.type)); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1906 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1907 | |
| 1908 | return; |
| 1909 | } |
| 1910 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1911 | /** ----------------------------------------------------------------- |
| 1912 | \brief lim_send_sme_ap_channel_switch_resp() - sends |
| 1913 | eWNI_SME_CHANNEL_CHANGE_RSP |
| 1914 | After receiving WMA_SWITCH_CHANNEL_RSP indication this |
| 1915 | function sends a eWNI_SME_CHANNEL_CHANGE_RSP to SME to notify |
| 1916 | that the Channel change has been done to the specified target |
| 1917 | channel in the Channel change request |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1918 | \param mac - global mac structure |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1919 | \param pe_session - session info |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1920 | \param pChnlParams - Channel switch params |
| 1921 | --------------------------------------------------------------------*/ |
| 1922 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 1923 | lim_send_sme_ap_channel_switch_resp(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1924 | struct pe_session *pe_session, |
Jianmin Zhu | 160d364 | 2019-08-19 21:27:52 +0800 | [diff] [blame] | 1925 | struct vdev_start_response *rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1926 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 1927 | struct scheduler_msg mmhMsg = {0}; |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1928 | struct sSirChanChangeResponse *chan_change_rsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1929 | uint8_t channelId; |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 1930 | bool is_ch_dfs = false; |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 1931 | enum phy_ch_width ch_width; |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 1932 | uint8_t ch_center_freq_seg1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1933 | |
gaurank kathpalia | 2fcec84 | 2019-08-05 17:22:27 +0530 | [diff] [blame] | 1934 | qdf_runtime_pm_allow_suspend(&pe_session->ap_ecsa_runtime_lock); |
| 1935 | qdf_wake_lock_release(&pe_session->ap_ecsa_wakelock, 0); |
| 1936 | |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1937 | chan_change_rsp = |
| 1938 | qdf_mem_malloc(sizeof(struct sSirChanChangeResponse)); |
| 1939 | if (!chan_change_rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1940 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1941 | |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1942 | chan_change_rsp->new_op_freq = pe_session->curr_op_freq; |
| 1943 | chan_change_rsp->channelChangeStatus = rsp->status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1944 | /* |
| 1945 | * Pass the sme sessionID to SME instead |
| 1946 | * PE session ID. |
| 1947 | */ |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1948 | chan_change_rsp->sessionId = rsp->vdev_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1949 | |
| 1950 | mmhMsg.type = eWNI_SME_CHANNEL_CHANGE_RSP; |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1951 | mmhMsg.bodyptr = (void *)chan_change_rsp; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1952 | mmhMsg.bodyval = 0; |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 1953 | lim_sys_process_mmh_msg_api(mac, &mmhMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1954 | |
Jianmin Zhu | 160d364 | 2019-08-19 21:27:52 +0800 | [diff] [blame] | 1955 | if (QDF_IS_STATUS_ERROR(rsp->status)) { |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1956 | pe_err("failed to change sap freq to %u", |
| 1957 | pe_session->curr_op_freq); |
Jingxiang Ge | ace2c3c | 2019-08-05 16:05:31 +0800 | [diff] [blame] | 1958 | return; |
| 1959 | } |
| 1960 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1961 | /* |
| 1962 | * We should start beacon transmission only if the new |
| 1963 | * channel after channel change is Non-DFS. For a DFS |
| 1964 | * channel, PE will receive an explicit request from |
| 1965 | * upper layers to start the beacon transmission . |
| 1966 | */ |
Jianmin Zhu | e9fbc3f | 2019-09-18 09:55:16 +0800 | [diff] [blame] | 1967 | ch_width = pe_session->ch_width; |
| 1968 | ch_center_freq_seg1 = pe_session->ch_center_freq_seg1; |
| 1969 | channelId = wlan_reg_freq_to_chan(mac->pdev, pe_session->curr_op_freq); |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 1970 | if (ch_width == CH_WIDTH_160MHZ) { |
| 1971 | is_ch_dfs = true; |
| 1972 | } else if (ch_width == CH_WIDTH_80P80MHZ) { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1973 | if (wlan_reg_get_channel_state(mac->pdev, channelId) == |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1974 | CHANNEL_STATE_DFS || |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1975 | wlan_reg_get_channel_state(mac->pdev, |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1976 | ch_center_freq_seg1 - |
| 1977 | SIR_80MHZ_START_CENTER_CH_DIFF) == |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 1978 | CHANNEL_STATE_DFS) |
| 1979 | is_ch_dfs = true; |
| 1980 | } else { |
Jeff Johnson | 35c58a8 | 2018-11-22 15:04:57 -0800 | [diff] [blame] | 1981 | if (wlan_reg_get_channel_state(mac->pdev, channelId) == |
Kiran Kumar Lokere | a3de226 | 2017-04-12 12:15:04 -0700 | [diff] [blame] | 1982 | CHANNEL_STATE_DFS) |
Sandeep Puligilla | 2111d3c | 2016-02-03 01:46:15 -0800 | [diff] [blame] | 1983 | is_ch_dfs = true; |
| 1984 | } |
| 1985 | |
Jingxiang Ge | ace2c3c | 2019-08-05 16:05:31 +0800 | [diff] [blame] | 1986 | if (is_ch_dfs) { |
| 1987 | lim_sap_move_to_cac_wait_state(pe_session); |
| 1988 | |
| 1989 | } else { |
Jianmin Zhu | 160d364 | 2019-08-19 21:27:52 +0800 | [diff] [blame] | 1990 | lim_apply_configuration(mac, pe_session); |
| 1991 | lim_send_beacon(mac, pe_session); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1992 | lim_obss_send_detection_cfg(mac, pe_session, true); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1993 | } |
| 1994 | return; |
| 1995 | } |
| 1996 | |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 1997 | #ifdef WLAN_FEATURE_11AX_BSS_COLOR |
| 1998 | /** |
| 1999 | * lim_send_bss_color_change_ie_update() - update bss color change IE in |
| 2000 | * beacon template |
| 2001 | * |
| 2002 | * @mac_ctx: pointer to global adapter context |
| 2003 | * @session: session pointer |
| 2004 | * |
| 2005 | * Return: none |
| 2006 | */ |
| 2007 | static void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 2008 | lim_send_bss_color_change_ie_update(struct mac_context *mac_ctx, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 2009 | struct pe_session *session) |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2010 | { |
| 2011 | /* Update the beacon template and send to FW */ |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 2012 | if (sch_set_fixed_beacon_fields(mac_ctx, session) != QDF_STATUS_SUCCESS) { |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2013 | pe_err("Unable to set BSS color change IE in beacon"); |
Srinivas Girigowda | eff16d9 | 2018-09-12 14:56:29 -0700 | [diff] [blame] | 2014 | return; |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2015 | } |
| 2016 | |
| 2017 | /* Send update beacon template message */ |
Abhishek Singh | fc740be | 2018-10-12 11:34:26 +0530 | [diff] [blame] | 2018 | lim_send_beacon_ind(mac_ctx, session, REASON_COLOR_CHANGE); |
Tushnim Bhattacharyya | 332b74c | 2018-08-10 10:55:51 -0700 | [diff] [blame] | 2019 | pe_debug("Updated BSS color change countdown = %d", |
| 2020 | session->he_bss_color_change.countdown); |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2021 | } |
| 2022 | |
| 2023 | static void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 2024 | lim_handle_bss_color_change_ie(struct mac_context *mac_ctx, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 2025 | struct pe_session *session) |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2026 | { |
Arif Hussain | 2f2d351 | 2018-03-06 12:37:03 -0800 | [diff] [blame] | 2027 | tUpdateBeaconParams beacon_params; |
| 2028 | |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2029 | /* handle bss color change IE */ |
| 2030 | if (LIM_IS_AP_ROLE(session) && |
| 2031 | session->he_op.bss_col_disabled) { |
| 2032 | if (session->he_bss_color_change.countdown > 0) { |
| 2033 | session->he_bss_color_change.countdown--; |
| 2034 | } else { |
| 2035 | session->bss_color_changing = 0; |
Arif Hussain | 2f2d351 | 2018-03-06 12:37:03 -0800 | [diff] [blame] | 2036 | qdf_mem_zero(&beacon_params, sizeof(beacon_params)); |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2037 | if (session->he_bss_color_change.new_color != 0) { |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2038 | session->he_op.bss_col_disabled = 0; |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2039 | session->he_op.bss_color = |
| 2040 | session->he_bss_color_change.new_color; |
Arif Hussain | 2f2d351 | 2018-03-06 12:37:03 -0800 | [diff] [blame] | 2041 | beacon_params.paramChangeBitmap |= |
| 2042 | PARAM_BSS_COLOR_CHANGED; |
| 2043 | beacon_params.bss_color_disabled = 0; |
| 2044 | beacon_params.bss_color = |
| 2045 | session->he_op.bss_color; |
| 2046 | lim_send_beacon_params(mac_ctx, |
| 2047 | &beacon_params, |
| 2048 | session); |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 2049 | lim_send_obss_color_collision_cfg(mac_ctx, |
| 2050 | session, |
| 2051 | OBSS_COLOR_COLLISION_DETECTION); |
| 2052 | } |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2053 | } |
| 2054 | |
| 2055 | lim_send_bss_color_change_ie_update(mac_ctx, session); |
| 2056 | } |
| 2057 | } |
| 2058 | |
| 2059 | #else |
| 2060 | static void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 2061 | lim_handle_bss_color_change_ie(struct mac_context *mac_ctx, |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 2062 | struct pe_session *session) |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2063 | { |
| 2064 | } |
| 2065 | #endif |
| 2066 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2067 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 2068 | lim_process_beacon_tx_success_ind(struct mac_context *mac_ctx, uint16_t msgType, |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2069 | void *event) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2070 | { |
Jeff Johnson | d7035a3 | 2018-11-18 22:03:13 -0800 | [diff] [blame] | 2071 | struct pe_session *session; |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2072 | tpSirFirstBeaconTxCompleteInd bcn_ind = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2073 | (tSirFirstBeaconTxCompleteInd *) event; |
| 2074 | |
Abhishek Singh | c70afa3 | 2019-09-19 15:17:21 +0530 | [diff] [blame] | 2075 | session = pe_find_session_by_vdev_id(mac_ctx, bcn_ind->bss_idx); |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2076 | if (!session) { |
| 2077 | pe_err("Session Does not exist for given session id"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2078 | return; |
| 2079 | } |
| 2080 | |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2081 | pe_debug("role: %d swIe: %d opIe: %d switch cnt:%d", |
| 2082 | GET_LIM_SYSTEM_ROLE(session), |
| 2083 | session->dfsIncludeChanSwIe, |
| 2084 | session->gLimOperatingMode.present, |
| 2085 | session->gLimChannelSwitch.switchCount); |
Chandrasekaran, Manishekar | ce2172e | 2016-02-18 16:12:43 +0530 | [diff] [blame] | 2086 | |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2087 | if (!LIM_IS_AP_ROLE(session)) |
| 2088 | return; |
Ganesh Kondabattini | 02ec62b | 2018-01-24 18:22:24 +0530 | [diff] [blame] | 2089 | |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2090 | if (session->dfsIncludeChanSwIe && |
| 2091 | (session->gLimChannelSwitch.switchCount == |
| 2092 | mac_ctx->sap.SapDfsInfo.sap_ch_switch_beacon_cnt)) |
| 2093 | lim_process_ap_ecsa_timeout(session); |
Ganesh Kondabattini | 02ec62b | 2018-01-24 18:22:24 +0530 | [diff] [blame] | 2094 | |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 2095 | |
Abhishek Singh | fc740be | 2018-10-12 11:34:26 +0530 | [diff] [blame] | 2096 | if (session->gLimOperatingMode.present) |
| 2097 | /* Done with nss update */ |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2098 | session->gLimOperatingMode.present = 0; |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2099 | |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 2100 | lim_handle_bss_color_change_ie(mac_ctx, session); |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 2101 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2102 | return; |
| 2103 | } |