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