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