blob: 64cef15c28a43bb81c393670768d997580332040 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Yue Mae63f42f2019-12-23 16:39:30 -08002 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * 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 Dhavali7090c5f2015-11-02 17:55:19 -080020 * This file lim_types.h contains the definitions used by all
21 * all LIM modules.
22 * Author: Chandra Modumudi
23 * Date: 02/11/02
24 * History:-
25 * Date Modified by Modification Information
26 * --------------------------------------------------------------------
27 *
28 */
29#ifndef __LIM_TYPES_H
30#define __LIM_TYPES_H
31
32#include "wni_api.h"
33#include "sir_api.h"
34#include "sir_common.h"
35#include "sir_mac_prot_def.h"
36#include "utils_api.h"
37
38#include "lim_api.h"
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +053039#include "lim_trace.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040#include "lim_send_sme_rsp_messages.h"
41#include "sys_global.h"
42#include "dph_global.h"
43#include "parser_api.h"
44#include "wma_if.h"
45
46#define LINK_TEST_DEFER 1
47
48#define TRACE_EVENT_CNF_TIMER_DEACT 0x6600
49#define TRACE_EVENT_CNF_TIMER_ACT 0x6601
50#define TRACE_EVENT_AUTH_RSP_TIMER_DEACT 0x6602
51#define TRACE_EVENT_AUTH_RSP_TIMER_ACT 0x6603
52
53/* MLM message types */
54#define LIM_MLM_MSG_START 1000
55#define LIM_MLM_SCAN_REQ LIM_MLM_MSG_START
56#define LIM_MLM_SCAN_CNF (LIM_MLM_MSG_START + 1)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057#define LIM_MLM_START_CNF (LIM_MLM_MSG_START + 3)
58#define LIM_MLM_JOIN_REQ (LIM_MLM_MSG_START + 4)
59#define LIM_MLM_JOIN_CNF (LIM_MLM_MSG_START + 5)
60#define LIM_MLM_AUTH_REQ (LIM_MLM_MSG_START + 6)
61#define LIM_MLM_AUTH_CNF (LIM_MLM_MSG_START + 7)
62#define LIM_MLM_AUTH_IND (LIM_MLM_MSG_START + 8)
63#define LIM_MLM_ASSOC_REQ (LIM_MLM_MSG_START + 9)
64#define LIM_MLM_ASSOC_CNF (LIM_MLM_MSG_START + 10)
65#define LIM_MLM_ASSOC_IND (LIM_MLM_MSG_START + 11)
66#define LIM_MLM_DISASSOC_REQ (LIM_MLM_MSG_START + 12)
67#define LIM_MLM_DISASSOC_CNF (LIM_MLM_MSG_START + 13)
68#define LIM_MLM_DISASSOC_IND (LIM_MLM_MSG_START + 14)
Harprit Chhabadae40b3102019-02-27 11:49:11 -080069#define LIM_MLM_REASSOC_CNF (LIM_MLM_MSG_START + 15)
70#define LIM_MLM_REASSOC_IND (LIM_MLM_MSG_START + 16)
71#define LIM_MLM_DEAUTH_REQ (LIM_MLM_MSG_START + 17)
72#define LIM_MLM_DEAUTH_CNF (LIM_MLM_MSG_START + 18)
73#define LIM_MLM_DEAUTH_IND (LIM_MLM_MSG_START + 19)
74#define LIM_MLM_TSPEC_REQ (LIM_MLM_MSG_START + 20)
75#define LIM_MLM_TSPEC_CNF (LIM_MLM_MSG_START + 21)
76#define LIM_MLM_TSPEC_IND (LIM_MLM_MSG_START + 22)
Harprit Chhabadae40b3102019-02-27 11:49:11 -080077#define LIM_MLM_SETKEYS_CNF (LIM_MLM_MSG_START + 24)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080078#define LIM_MLM_LINK_TEST_STOP_REQ (LIM_MLM_MSG_START + 30)
79#define LIM_MLM_PURGE_STA_IND (LIM_MLM_MSG_START + 31)
80/*
81 * Values (LIM_MLM_MSG_START + 32) through
82 * (LIM_MLM_MSG_START + 40) are unused.
83 */
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -070084
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085#define LIM_WEP_IN_FC 1
86#define LIM_NO_WEP_IN_FC 0
87
88#define LIM_DECRYPT_ICV_FAIL 1
89
90/* / Definitions to distinquish between Association/Reassociaton */
91#define LIM_ASSOC 0
92#define LIM_REASSOC 1
93
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080094/* / Verifies whether given mac addr matches the CURRENT Bssid */
Jeff Johnsonb5c13332018-12-03 09:54:51 -080095#define IS_CURRENT_BSSID(mac, addr, pe_session) (!qdf_mem_cmp(addr, \
96 pe_session->bssId, \
97 sizeof(pe_session->bssId)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080098/* / Verifies whether given addr matches the REASSOC Bssid */
Jeff Johnsonb5c13332018-12-03 09:54:51 -080099#define IS_REASSOC_BSSID(mac, addr, pe_session) (!qdf_mem_cmp(addr, \
100 pe_session->limReAssocbssId, \
101 sizeof(pe_session->limReAssocbssId)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800102
103#define REQ_TYPE_REGISTRAR (0x2)
104#define REQ_TYPE_WLAN_MANAGER_REGISTRAR (0x3)
105
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800106#define RESP_TYPE_ENROLLEE_INFO_ONLY (0x0)
107#define RESP_TYPE_ENROLLEE_OPEN_8021X (0x1)
108#define RESP_TYPE_AP (0x3)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800109
110
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800111#define HAL_USE_SELF_STA_REQUESTED_MASK 0x2 /* bit 1 for STA overwrite with selfSta Requested. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800112
113#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 /* Bit 6 will be used to control BD rate for Management frames */
114#define HAL_USE_PEER_STA_REQUESTED_MASK 0x80 /* bit 7 will be used to control frames for p2p interface */
115
Krunal Sonifa6c7f52018-08-07 11:54:19 -0700116#define LIM_DOS_PROTECTION_TIME 1000 //1000ms
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530117#define LIM_MIN_RSSI 0 /* 0dbm */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800118/* enums used by LIM are as follows */
119
120enum eLimDisassocTrigger {
121 eLIM_HOST_DISASSOC,
122 eLIM_PEER_ENTITY_DISASSOC,
123 eLIM_LINK_MONITORING_DISASSOC,
124 eLIM_PROMISCUOUS_MODE_DISASSOC,
125 eLIM_HOST_DEAUTH,
126 eLIM_PEER_ENTITY_DEAUTH,
127 eLIM_LINK_MONITORING_DEAUTH,
128 eLIM_JOIN_FAILURE,
Sandeep Puligilla7e3e3c52016-09-02 17:54:21 -0700129 eLIM_REASSOC_REJECT,
130 eLIM_DUPLICATE_ENTRY
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800131};
132
Abhishek Singh4e8524a2019-06-20 09:59:58 +0530133/**
134 * enum eChannelChangeReasonCodes - Reason code to determine the channel change
135 * reason
136 * @LIM_SWITCH_CHANNEL_REASSOC: channel switch to reassoc
137 * @LIM_SWITCH_CHANNEL_JOIN: switch for connect req
138 * @LIM_SWITCH_CHANNEL_OPERATION: Generic change channel for STA
139 * @LIM_SWITCH_CHANNEL_SAP_DFS: SAP channel change req
140 * @LIM_SWITCH_CHANNEL_HT_WIDTH: HT channel width change reg
141 * @LIM_SWITCH_CHANNEL_MONITOR: Monitor mode channel change req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142 */
143enum eChannelChangeReasonCodes {
144 LIM_SWITCH_CHANNEL_REASSOC,
145 LIM_SWITCH_CHANNEL_JOIN,
Abhishek Singh4e8524a2019-06-20 09:59:58 +0530146 LIM_SWITCH_CHANNEL_OPERATION,
147 LIM_SWITCH_CHANNEL_SAP_DFS,
148 LIM_SWITCH_CHANNEL_HT_WIDTH,
149 LIM_SWITCH_CHANNEL_MONITOR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800150};
151
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800152typedef struct sLimMlmStartReq {
153 tSirMacSSid ssId;
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530154 enum bss_type bssType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800155 tSirMacAddr bssId;
156 tSirMacBeaconInterval beaconPeriod;
157 uint8_t dtimPeriod;
158 tSirMacCfParamSet cfParamSet;
Kiran Kumar Lokere987377e2019-08-29 12:27:14 -0700159 uint32_t oper_ch_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160 ePhyChanBondState cbMode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800161 tSirMacRateSet rateSet;
162 uint8_t sessionId; /* Added For BT-AMP Support */
163
164 /* Parameters reqd for new HAL (message) interface */
165 tSirNwType nwType;
166 uint8_t htCapable;
167 tSirMacHTOperatingMode htOperMode;
168 uint8_t dualCTSProtection;
169 uint8_t txChannelWidthSet;
170 uint8_t ssidHidden;
171 uint8_t wps_state;
172 uint8_t obssProtEnabled;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800173 uint16_t beacon_tx_rate;
Arif Hussain671a1902017-03-17 09:08:32 -0700174 uint32_t cac_duration_ms;
175 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800176} tLimMlmStartReq, *tpLimMlmStartReq;
177
178typedef struct sLimMlmStartCnf {
179 tSirResultCodes resultCode;
180 uint8_t sessionId;
181} tLimMlmStartCnf, *tpLimMlmStartCnf;
182
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800183typedef struct sLimMlmJoinCnf {
184 tSirResultCodes resultCode;
185 uint16_t protStatusCode;
186 uint8_t sessionId;
187} tLimMlmJoinCnf, *tpLimMlmJoinCnf;
188
189typedef struct sLimMlmAssocReq {
190 tSirMacAddr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191 uint16_t capabilityInfo;
192 tSirMacListenInterval listenInterval;
193 uint8_t sessionId;
194} tLimMlmAssocReq, *tpLimMlmAssocReq;
195
196typedef struct sLimMlmAssocCnf {
197 tSirResultCodes resultCode; /* Internal status code. */
198 uint16_t protStatusCode; /* Protocol Status code. */
199 uint8_t sessionId;
200} tLimMlmAssocCnf, *tpLimMlmAssocCnf;
201
202typedef struct sLimMlmAssocInd {
203 tSirMacAddr peerMacAddr;
204 uint16_t aid;
205 tAniAuthType authType;
Min Liuddd23302018-12-05 16:17:48 +0800206 enum ani_akm_type akm_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800207 tAniSSID ssId;
208 tSirRSNie rsnIE;
209 tSirWAPIie wapiIE;
210 tSirAddie addIE; /* additional IE received from the peer, which possibly includes WSC IE and/or P2P IE. */
211 tSirMacCapabilityInfo capabilityInfo;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700212 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800213 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800214 struct supported_channels supportedChannels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800215 uint8_t sessionId;
216
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700217 bool WmmStaInfoPresent;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800218
219 /* Required for indicating the frames to upper layer */
220 uint32_t beaconLength;
221 uint8_t *beaconPtr;
222 uint32_t assocReqLength;
223 uint8_t *assocReqPtr;
Jeff Johnsona7d5b542019-02-03 10:15:46 -0800224 struct oem_channel_info chan_info;
Will Huang558f8082017-05-31 16:22:24 +0800225 bool ampdu;
226 bool sgi_enable;
227 bool tx_stbc;
228 bool rx_stbc;
229 tSirMacHTChannelWidth ch_width;
230 enum sir_sme_phy_mode mode;
231 uint8_t max_supp_idx;
232 uint8_t max_ext_idx;
233 uint8_t max_mcs_idx;
234 uint8_t rx_mcs_map;
235 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +0800236 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +0530237
238 tDot11fIEHTCaps ht_caps;
239 tDot11fIEVHTCaps vht_caps;
Ashish Kumar Dhanotiya6025c702019-03-20 18:48:49 +0530240 bool he_caps_present;
Srinivas Dasari5f528202019-02-11 17:29:43 +0530241 bool is_sae_authenticated;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800242} tLimMlmAssocInd, *tpLimMlmAssocInd;
243
244typedef struct sLimMlmReassocReq {
245 tSirMacAddr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800246 uint16_t capabilityInfo;
247 tSirMacListenInterval listenInterval;
248 uint8_t sessionId;
249} tLimMlmReassocReq, *tpLimMlmReassocReq;
250
251typedef struct sLimMlmReassocCnf {
252 tSirResultCodes resultCode;
253 uint16_t protStatusCode; /* Protocol Status code. */
254 uint8_t sessionId;
255} tLimMlmReassocCnf, *tpLimMlmReassocCnf;
256
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800257typedef struct sLimMlmAuthCnf {
258 tSirMacAddr peerMacAddr;
259 tAniAuthType authType;
260 tSirResultCodes resultCode;
261 uint16_t protStatusCode;
262 uint8_t sessionId;
263} tLimMlmAuthCnf, *tpLimMlmAuthCnf;
264
265typedef struct sLimMlmDeauthReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530266 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800267 uint16_t reasonCode;
268 uint16_t deauthTrigger;
269 uint16_t aid;
270 uint8_t sessionId; /* Added for BT-AMP SUPPORT */
271
272} tLimMlmDeauthReq, *tpLimMlmDeauthReq;
273
274typedef struct sLimMlmDeauthCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530275 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800276 tSirResultCodes resultCode;
277 uint16_t deauthTrigger;
278 uint16_t aid;
279 uint8_t sessionId;
280} tLimMlmDeauthCnf, *tpLimMLmDeauthCnf;
281
282typedef struct sLimMlmDeauthInd {
283 tSirMacAddr peerMacAddr;
284 uint16_t reasonCode;
285 uint16_t deauthTrigger;
286 uint16_t aid;
287} tLimMlmDeauthInd, *tpLimMlmDeauthInd;
288
289typedef struct sLimMlmDisassocReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530290 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800291 uint16_t reasonCode;
292 uint16_t disassocTrigger;
293 uint16_t aid;
294 uint8_t sessionId;
295} tLimMlmDisassocReq, *tpLimMlmDisassocReq;
296
297typedef struct sLimMlmDisassocCnf {
298 tSirMacAddr peerMacAddr;
299 tSirResultCodes resultCode;
300 uint16_t disassocTrigger;
301 uint16_t aid;
302 uint8_t sessionId;
303} tLimMlmDisassocCnf, *tpLimMlmDisassocCnf;
304
305typedef struct sLimMlmDisassocInd {
306 tSirMacAddr peerMacAddr;
307 uint16_t reasonCode;
308 uint16_t disassocTrigger;
309 uint16_t aid;
310 uint8_t sessionId;
311} tLimMlmDisassocInd, *tpLimMlmDisassocInd;
312
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800313typedef struct sLimMlmPurgeStaInd {
314 tSirMacAddr peerMacAddr;
315 uint16_t reasonCode;
316 uint16_t purgeTrigger;
317 uint16_t aid;
318 uint8_t sessionId;
319} tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd;
320
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700321/**
322 * struct sLimMlmSetKeysCnf - set key confirmation parameters
323 * @peer_macaddr: peer mac address
324 * @resultCode: Result of set key operation
325 * @aid: association id
326 * @sessionId: PE session id
327 * @key_len_nonzero: Keys are non-zero length
328 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329typedef struct sLimMlmSetKeysCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530330 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800331 uint16_t resultCode;
332 uint16_t aid;
333 uint8_t sessionId;
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700334 bool key_len_nonzero;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335} tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf;
336
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337/* Function templates */
338
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800339bool lim_process_sme_req_messages(struct mac_context *, struct scheduler_msg *);
340void lim_process_mlm_req_messages(struct mac_context *, struct scheduler_msg *);
341void lim_process_mlm_rsp_messages(struct mac_context *, uint32_t, uint32_t *);
Abhishek Ambure2bd960b2019-08-21 16:30:53 +0530342void lim_process_sme_del_bss_rsp(struct mac_context *mac,
343 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344
Abhishek Singhc5a54082018-09-12 16:08:03 +0530345/**
346 * lim_process_mlm_start_cnf(): called to processes MLM_START_CNF message from
347 * MLM State machine.
348 * @mac_ctx: Pointer to Global MAC structure
349 * @msg_buf: A pointer to the MLM message buffer
350 *
351 * Return: None
352 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800353void lim_process_mlm_start_cnf(struct mac_context *mac_ctx, uint32_t *msg_buf);
Abhishek Singhc5a54082018-09-12 16:08:03 +0530354
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800355void lim_get_random_bssid(struct mac_context *mac, uint8_t *data);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356
357/* Function to handle HT and HT IE CFG parameter intializations */
Jeff Johnson348973e2018-11-22 16:51:12 -0800358void handle_ht_capabilityand_ht_info(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800359 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800361void lim_handle_param_update(struct mac_context *mac, eUpdateIEsType cfgId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800362
363/* Function to apply CFG parameters before join/reassoc/start BSS */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800364void lim_apply_configuration(struct mac_context *, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800365
Pragaspathi Thilagaraj1ee76002018-09-18 21:38:51 +0530366/**
367 * lim_set_cfg_protection() - sets lim global cfg cache from the config
Jeff Johnson348973e2018-11-22 16:51:12 -0800368 * @mac: global mac context
Pragaspathi Thilagaraj1ee76002018-09-18 21:38:51 +0530369 * @pesessionEntry: PE session
370 *
371 * Return none
372 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800373void lim_set_cfg_protection(struct mac_context *mac, struct pe_session *pesessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800374
375/* Function to Initialize MLM state machine on STA */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800376QDF_STATUS lim_init_mlm(struct mac_context *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800377
378/* Function to cleanup MLM state machine */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800379void lim_cleanup_mlm(struct mac_context *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800380
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381/* Management frame handling functions */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800382void lim_process_beacon_frame(struct mac_context *, uint8_t *, struct pe_session *);
383void lim_process_probe_req_frame(struct mac_context *, uint8_t *, struct pe_session *);
384void lim_process_probe_rsp_frame(struct mac_context *, uint8_t *, struct pe_session *);
385void lim_process_probe_req_frame_multiple_bss(struct mac_context *, uint8_t *,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800386 struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800387
388/* Process Auth frame when we have a session in progress. */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800389void lim_process_auth_frame(struct mac_context *, uint8_t *, struct pe_session *);
Pragaspathi Thilagaraj21b88d22019-08-01 20:11:53 +0530390
391/**
392 * lim_process_auth_frame_no_session() - Process auth frame received from AP to
393 * which we are not connected currently.
394 * @mac: Pointer to global mac context
395 * @bd: Pointer to rx auth frame
396 * @body: Pointer to lim_msg->body_ptr
397 *
398 * This is possibly the pre-auth from the neighbor AP, in the same mobility
399 * domain or pre-authentication reply for WPA3 SAE roaming.
400 * This will be used in case of 11r FT.
401 */
402QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac,
403 uint8_t *bd, void *body);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800405void lim_process_assoc_req_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
bings85512332019-09-04 17:46:37 +0800406
407/**
408 * lim_fill_lim_assoc_ind_params() - Initialize lim association indication
409 * @assoc_ind: PE association indication structure
410 * @mac_ctx: Pointer to Global MAC structure
411 * @sta_ds: station dph entry
412 * @session_entry: PE session entry
413 *
414 * Return: true if lim assoc ind filled successfully
415 */
416bool lim_fill_lim_assoc_ind_params(
417 tpLimMlmAssocInd assoc_ind,
418 struct mac_context *mac_ctx,
419 tpDphHashNode sta_ds,
420 struct pe_session *session_entry);
421
422/**
423 * lim_fill_sme_assoc_ind_params() - Initialize association indication
424 * @mac_ctx: Pointer to Global MAC structure
425 * @assoc_ind: PE association indication structure
426 * @sme_assoc_ind: SME association indication
427 * @session_entry: PE session entry
Chaoli Zhou98d1b3e2019-10-10 17:13:44 +0800428 * @assoc_req_alloc: malloc memory for assoc_req or not
bings85512332019-09-04 17:46:37 +0800429 *
430 * Return: None
431 */
432void
433lim_fill_sme_assoc_ind_params(
434 struct mac_context *mac_ctx,
435 tpLimMlmAssocInd assoc_ind, struct assoc_ind *sme_assoc_ind,
Chaoli Zhou98d1b3e2019-10-10 17:13:44 +0800436 struct pe_session *session_entry, bool assoc_req_alloc);
Jeff Johnsonbddc03e2019-01-17 15:37:09 -0800437void lim_send_mlm_assoc_ind(struct mac_context *mac, tpDphHashNode sta,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800438 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800439
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800440void lim_process_assoc_rsp_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
441void lim_process_disassoc_frame(struct mac_context *, uint8_t *, struct pe_session *);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800442/*
443 * lim_perform_disassoc() - Actual action taken after receiving disassoc
444 * @mac_ctx: Global MAC context
445 * @frame_rssi: RSSI of the frame
446 * @rc: Reason code of the deauth
447 * @pe_session: PE session entry pointer
448 * @addr: BSSID from which the disassoc is received
449 *
450 * Return: None
451 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800452void lim_perform_disassoc(struct mac_context *mac_ctx, int32_t frame_rssi,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800453 uint16_t rc, struct pe_session *pe_session,
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800454 tSirMacAddr addr);
455/*
456 * lim_disassoc_tdls_peers() - Disassoc action for tdls peers
457 * @mac_ctx: Global MAC context
458 * @pe_session: PE session entry pointer
459 * @addr: BSSID from which the disassoc is received
460 *
461 * Return: None
462 */
463#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800464void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800465 struct pe_session *pe_session, tSirMacAddr addr);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800466#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800467static inline void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800468 struct pe_session *pe_session, tSirMacAddr addr)
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800469{
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800470}
471#endif
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800472void lim_process_deauth_frame(struct mac_context *, uint8_t *, struct pe_session *);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800473/*
474 * lim_perform_deauth() - Actual action taken after receiving deauth
475 * @mac_ctx: Global MAC context
476 * @pe_session: PE session entry pointer
477 * @rc: Reason code of the deauth
478 * @addr: BSSID from which the deauth is received
479 * @frame_rssi: RSSI of the frame
480 *
481 * Return: None
482 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800483void lim_perform_deauth(struct mac_context *mac_ctx, struct pe_session *pe_session,
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800484 uint16_t rc, tSirMacAddr addr, int32_t frame_rssi);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800485void lim_process_action_frame(struct mac_context *, uint8_t *, struct pe_session *);
486void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pRxMetaInfo);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800488void lim_populate_mac_header(struct mac_context *, uint8_t *, uint8_t, uint8_t,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489 tSirMacAddr, tSirMacAddr);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800490QDF_STATUS lim_send_probe_req_mgmt_frame(struct mac_context *, tSirMacSSid *,
Amruta Kulkarni1d93a852020-02-11 11:05:41 -0800491 tSirMacAddr, qdf_freq_t, tSirMacAddr,
492 uint32_t, uint16_t *, uint8_t *);
Jeff Johnson3c08ace2019-03-12 08:50:37 -0700493
494/**
495 * lim_send_probe_rsp_mgmt_frame() - Send probe response
496 * @mac_ctx: Handle for mac context
497 * @peer_macaddr: Mac address of requesting peer
498 * @ssid: SSID for response
499 * @pe_session: PE session id
500 * @preq_p2pie: P2P IE in incoming probe request
501 *
502 * Builds and sends probe response frame to the requesting peer
503 *
504 * Return: void
505 */
506void
507lim_send_probe_rsp_mgmt_frame(struct mac_context *mac_ctx,
508 tSirMacAddr peer_macaddr,
509 tpAniSSID ssid,
510 struct pe_session *pe_session,
511 uint8_t preq_p2pie);
512
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800513void lim_send_auth_mgmt_frame(struct mac_context *, tSirMacAuthFrameBody *, tSirMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800514 uint8_t, struct pe_session *);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800515void lim_send_assoc_req_mgmt_frame(struct mac_context *, tLimMlmAssocReq *, struct pe_session *);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800516#ifdef WLAN_FEATURE_HOST_ROAM
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800517void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800518 tLimMlmReassocReq *pMlmReassocReq, struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800519void lim_send_reassoc_req_mgmt_frame(struct mac_context *, tLimMlmReassocReq *,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800520 struct pe_session *);
Paul Zhang2f1077c2017-11-30 12:06:09 +0800521/**
522 * lim_process_rx_scan_handler() -
523 * process the event for scan which is issued by LIM
524 * @vdev: wlan objmgr vdev pointer
525 * @event: scan event
526 * @arg: global mac context pointer
527 *
528 * Return: void
529 */
530void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
531 struct scan_event *event, void *arg);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800532#else
533static inline void lim_send_reassoc_req_with_ft_ies_mgmt_frame(
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800534 struct mac_context *mac, tLimMlmReassocReq *pMlmReassocReq,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800535 struct pe_session *pe_session)
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800536{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800537static inline void lim_send_reassoc_req_mgmt_frame(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800538 tLimMlmReassocReq *reassoc_req, struct pe_session *pe_session)
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800539{}
Paul Zhang2f1077c2017-11-30 12:06:09 +0800540static inline void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
541 struct scan_event *event, void *arg)
542{}
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800543#endif
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700544#ifdef WLAN_FEATURE_11AX_BSS_COLOR
545/**
546 * lim_process_set_he_bss_color() - process the set he bss color request
547 *
548 * @mac_ctx: global mac context pointer
549 * @msg_buf: message buffer pointer
550 *
551 * Return: void
552 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800553void lim_process_set_he_bss_color(struct mac_context *mac_ctx, uint32_t *msg_buf);
Arif Hussain05fb4872018-01-03 16:02:55 -0800554
555/**
556 * lim_process_obss_color_collision_info() - Process the obss color collision
557 * request.
558 * @mac_ctx: global mac context pointer
559 * @msg_buf: message buffer pointer
560 *
561 * Return: void
562 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800563void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
Arif Hussain05fb4872018-01-03 16:02:55 -0800564 uint32_t *msg_buf);
565
566/**
567 * lim_send_obss_color_collision_cfg() - Send obss color collision cfg.
568 * @mac_ctx: global mac context pointer
569 * @session: Pointer to session
570 * @event_type: obss color collision detection type
571 *
572 * Return: void
573 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800574void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800575 struct pe_session *session,
Arif Hussain05fb4872018-01-03 16:02:55 -0800576 enum wmi_obss_color_collision_evt_type
577 event_type);
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700578#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800579static inline void lim_process_set_he_bss_color(struct mac_context *mac_ctx,
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700580 uint32_t *msg_buf)
581{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800582static inline void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
Arif Hussain05fb4872018-01-03 16:02:55 -0800583 uint32_t *msg_buf)
584{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800585static inline void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800586 struct pe_session *session,
Arif Hussain05fb4872018-01-03 16:02:55 -0800587 enum wmi_obss_color_collision_evt_type event_type)
588{}
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700589#endif
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800590void lim_send_delts_req_action_frame(struct mac_context *mac, tSirMacAddr peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800591 uint8_t wmmTspecPresent,
Jeff Johnson312348f2018-12-22 13:33:54 -0800592 struct mac_ts_info * pTsinfo,
Jeff Johnson56471b92018-12-22 14:36:06 -0800593 struct mac_tspec_ie * pTspecIe,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800594 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800595void lim_send_addts_req_action_frame(struct mac_context *mac, tSirMacAddr peerMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800596 tSirAddtsReqInfo *addts, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597
bings85512332019-09-04 17:46:37 +0800598/**
599 * lim_send_assoc_rsp_mgmt_frame() - Send assoc response
600 * @mac_ctx: Handle for mac context
601 * @status_code: Status code for assoc response frame
602 * @aid: Association ID
603 * @peer_addr: Mac address of requesting peer
604 * @subtype: Assoc/Reassoc
605 * @sta: Pointer to station node
606 * @pe_session: PE session id.
607 * @tx_complete: Need tx complete callback or not
608 *
609 * Builds and sends association response frame to the requesting peer.
610 *
611 * Return: void
612 */
613void
614lim_send_assoc_rsp_mgmt_frame(
615 struct mac_context *mac_ctx,
616 uint16_t status_code, uint16_t aid, tSirMacAddr peer_addr,
617 uint8_t subtype, tpDphHashNode sta, struct pe_session *pe_session,
618 bool tx_complete);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800619
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800620void lim_send_disassoc_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800621 struct pe_session *, bool waitForAck);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800622void lim_send_deauth_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr, struct pe_session *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800623 bool waitForAck);
624
Jianmin Zhu160d3642019-08-19 21:27:52 +0800625/**
626 * lim_process_mlm_update_hidden_ssid_rsp() - process hidden ssid response
627 * @mac_ctx: global mac context
628 * @vdev_id: vdev id
629 *
630 * Return: None
631 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800632void lim_process_mlm_update_hidden_ssid_rsp(struct mac_context *mac_ctx,
Jianmin Zhu160d3642019-08-19 21:27:52 +0800633 uint8_t vdev_id);
Kiran Kumar Lokere5798bfa2017-04-27 20:49:39 -0700634
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800635tSirResultCodes lim_mlm_add_bss(struct mac_context *, tLimMlmStartReq *,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800636 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800637
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800638QDF_STATUS lim_send_channel_switch_mgmt_frame(struct mac_context *, tSirMacAddr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800639 uint8_t, uint8_t, uint8_t,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800640 struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800641
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800642QDF_STATUS lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx,
Abhishek Singh518323d2015-10-19 17:42:01 +0530643 tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800644 uint8_t new_channel, uint8_t count, struct pe_session *session_entry);
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700645QDF_STATUS lim_p2p_oper_chan_change_confirm_action_frame(
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800646 struct mac_context *mac_ctx, tSirMacAddr peer,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800647 struct pe_session *session_entry);
Abhishek Singh518323d2015-10-19 17:42:01 +0530648
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800649QDF_STATUS lim_send_neighbor_report_request_frame(struct mac_context *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800650 tpSirMacNeighborReportReq,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800651 tSirMacAddr, struct pe_session *);
Pragaspathi Thilagaraj683c1cf2019-09-23 18:40:57 +0530652
653/**
654 * lim_send_link_report_action_frame() - Send link measurement report action
655 * frame in response for a link measurement request received.
656 * @mac: Pointer to Mac context
657 * @link_report: Pointer to the sSirMacLinkReport struct
658 * @peer: BSSID of the peer
659 * @pe_session: Pointer to the pe_session
660 *
661 * Return: QDF_STATUS
662 *
663 */
664QDF_STATUS
665lim_send_link_report_action_frame(struct mac_context *mac,
666 tpSirMacLinkReport link_report,
667 tSirMacAddr peer,
668 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800669
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530670/**
671 * lim_send_radio_measure_report_action_frame - Send RRM report action frame
Jeff Johnson348973e2018-11-22 16:51:12 -0800672 * @mac: pointer to global MAC context
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530673 * @dialog_token: Dialog token to be used in the action frame
674 * @num_report: number of reports in pRRMReport
Vignesh Viswanathan09bd8f42018-08-14 22:04:36 +0530675 * @is_last_frame: is the current report last or more reports to follow
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530676 * @pRRMReport: Pointer to the RRM report structure
677 * @peer: MAC address of the peer
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800678 * @pe_session: Pointer to the PE session entry
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530679 *
680 * Return: Ret Status
681 */
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700682QDF_STATUS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800683lim_send_radio_measure_report_action_frame(struct mac_context *mac,
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530684 uint8_t dialog_token,
685 uint8_t num_report,
Vignesh Viswanathan09bd8f42018-08-14 22:04:36 +0530686 bool is_last_frame,
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530687 tpSirMacRadioMeasureReport pRRMReport,
688 tSirMacAddr peer,
sheenam mongab06e28d2020-03-05 17:23:24 +0530689 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690
691#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800692void lim_init_tdls_data(struct mac_context *, struct pe_session *);
Jeff Johnson93cf08a2019-02-14 13:06:56 -0800693
694/**
695 * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
696 * @mac_ctx: global mac context
697 * @msg: message buffer received from SME.
698 *
699 * Process Send Mgmt Request from SME and transmit to AP.
700 *
701 * Return: QDF_STATUS_SUCCESS on success, error code otherwise
702 */
703QDF_STATUS lim_process_sme_tdls_mgmt_send_req(struct mac_context *mac_ctx,
704 void *msg);
705
Jeff Johnson4cdd1ac2019-02-14 20:01:24 -0800706/**
707 * lim_process_sme_tdls_add_sta_req() - process TDLS Add STA
708 * @mac_ctx: global mac context
709 * @msg: message buffer received from SME.
710 *
711 * Process TDLS Add Station request
712 *
713 * Return: QDF_STATUS_SUCCESS on success, error code otherwise
714 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800715QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac,
Jeff Johnson4cdd1ac2019-02-14 20:01:24 -0800716 void *msg);
717
Jeff Johnsonab797d62019-02-14 20:47:16 -0800718/**
719 * lim_process_sme_tdls_del_sta_req() - process TDLS Del STA
720 * @mac_ctx: global mac context
721 * @msg: message buffer received from SME.
722 *
723 * Process TDLS Delete Station request
724 *
725 * Return: QDF_STATUS_SUCCESS on success, error code otherwise
726 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800727QDF_STATUS lim_process_sme_tdls_del_sta_req(struct mac_context *mac,
Jeff Johnsonab797d62019-02-14 20:47:16 -0800728 void *msg);
729
Abhishek Singh345be412019-11-19 10:59:29 +0530730void lim_send_sme_mgmt_tx_completion(struct mac_context *mac, uint32_t vdev_id,
731 uint32_t txCompleteStatus);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800732QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800733 struct pe_session *session_entry);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800734QDF_STATUS lim_process_tdls_add_sta_rsp(struct mac_context *mac, void *msg, struct pe_session *);
735void lim_process_tdls_del_sta_rsp(struct mac_context *mac_ctx,
Padma, Santhosh Kumar4eb79082017-02-24 16:00:20 +0530736 struct scheduler_msg *lim_msg,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800737 struct pe_session *session_entry);
Bala Venkatesh33f270b2019-01-14 16:31:29 +0530738
739/**
740 * lim_update_tdls_state_in_fw() - Update TDLS state in FW
741 *
742 * @session_entry - PE sessions
743 * @value -value to be updated
744 *
745 *
746 * Return: void
747 */
748void lim_update_tdls_set_state_for_fw(struct pe_session *session_entry,
749 bool value);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530750#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800751static inline QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800752 struct pe_session *session_entry)
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530753{
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700754 return QDF_STATUS_SUCCESS;
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530755}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800756static inline void lim_init_tdls_data(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800757 struct pe_session *pe_session)
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700758{
759
760}
Bala Venkatesh33f270b2019-01-14 16:31:29 +0530761
762static inline void lim_update_tdls_set_state_for_fw(struct pe_session
763 *session_entry, bool value)
764{
765}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800766#endif
767
768/* Algorithms & Link Monitoring related functions */
769/* / Function that handles heartbeat failure */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800770void lim_handle_heart_beat_failure(struct mac_context *, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800771
Srinivas Dasarie2495dc2020-02-13 09:49:24 +0530772/**
773 * lim_tear_down_link_with_ap() - Tear down link with AP
774 * @mac: mac context
775 * @session_id: PE session id
776 * @reason_code: Disconnect reason code as per emun eSirMacReasonCodes
777 * @trigger: Disconnect trigger as per enum eLimDisassocTrigger
778 *
779 * Function that triggers link tear down with AP upon HB failure
780 *
781 * Return: None
782 */
783void lim_tear_down_link_with_ap(struct mac_context *mac,
784 uint8_t session_id,
785 tSirMacReasonCodes reason_code,
786 enum eLimDisassocTrigger trigger);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800787
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800788/* / Function that defers the messages received */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800789uint32_t lim_defer_msg(struct mac_context *, struct scheduler_msg *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800790
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800791#ifdef ANI_SUPPORT_11H
792/* / Function that sends Measurement Report action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800793QDF_STATUS lim_send_meas_report_frame(struct mac_context *, tpSirMacMeasReqActionFrame,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800794 tSirMacAddr, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800795
796/* / Function that sends TPC Report action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800797QDF_STATUS lim_send_tpc_report_frame(struct mac_context *, tpSirMacTpcReqActionFrame,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800798 tSirMacAddr, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800799#endif
800
Jianmin Zhuef228192019-08-13 15:04:23 +0800801/**
Abhishek Singh6e5c7a62019-09-18 12:24:54 +0530802 * lim_handle_add_bss_rsp() - Handle add bss response
Jianmin Zhuef228192019-08-13 15:04:23 +0800803 * @mac_ctx: mac context
Abhishek Singh6e5c7a62019-09-18 12:24:54 +0530804 * @add_bss_rsp: add bss rsp
Jianmin Zhuef228192019-08-13 15:04:23 +0800805 *
Abhishek Singh6e5c7a62019-09-18 12:24:54 +0530806 * This function is called to handle all types of add bss rsp
807 * It will free memory of add_bss_rsp in the end after rsp is handled.
Jianmin Zhuef228192019-08-13 15:04:23 +0800808 *
809 * Return: None
810 */
Abhishek Singh6e5c7a62019-09-18 12:24:54 +0530811void lim_handle_add_bss_rsp(struct mac_context *mac_ctx,
812 struct add_bss_rsp *add_bss_rsp);
Jianmin Zhuef228192019-08-13 15:04:23 +0800813
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800814void lim_process_mlm_add_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800815 struct scheduler_msg *limMsgQt,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800816 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800817void lim_process_mlm_del_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800818 struct scheduler_msg *limMsgQ);
Abhishek Ambure968f1512019-08-28 18:33:57 +0530819
820/**
821 * lim_process_mlm_del_bss_rsp () - API to process delete bss response
822 * @mac: Pointer to Global MAC structure
823 * @vdev_stop_rsp: pointer to vdev stop response
824 * @pe_session: pointer to pe_session
825 *
826 * Return: None
827 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800828void lim_process_mlm_del_bss_rsp(struct mac_context *mac,
Abhishek Ambure968f1512019-08-28 18:33:57 +0530829 struct del_bss_resp *vdev_stop_rsp,
Abhishek Ambure2bd960b2019-08-21 16:30:53 +0530830 struct pe_session *pe_session);
Abhishek Ambure968f1512019-08-28 18:33:57 +0530831
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800832void lim_process_sta_mlm_add_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800833 struct scheduler_msg *limMsgQ,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800834 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800835void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800836 struct scheduler_msg *limMsgQ,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800837 struct pe_session *pe_session);
Abhishek Ambure968f1512019-08-28 18:33:57 +0530838
839/**
840 * lim_process_sta_mlm_del_bss_rsp() - handle del bss response of STA
841 * @mac: Pointer to Global MAC structure
842 * @vdev_stop_rsp: pointer to vdev stop response
843 * @pe_session: pointer to pe_session
844 *
845 * Return: none
846 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800847void lim_process_sta_mlm_del_bss_rsp(struct mac_context *mac,
Abhishek Ambure968f1512019-08-28 18:33:57 +0530848 struct del_bss_resp *vdev_stop_rsp,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800849 struct pe_session *pe_session);
Abhishek Ambure968f1512019-08-28 18:33:57 +0530850
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800851void lim_process_mlm_set_sta_key_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800852 struct scheduler_msg *limMsgQ);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800853void lim_process_mlm_set_bss_key_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800854 struct scheduler_msg *limMsgQ);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800855
856/* Function to process WMA_SWITCH_CHANNEL_RSP message */
Jianmin Zhu160d3642019-08-19 21:27:52 +0800857void lim_process_switch_channel_rsp(struct mac_context *mac,
858 struct vdev_start_response *rsp);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800859
Abhishek Singh85865732019-07-11 13:37:20 +0530860/**
861 * lim_sta_handle_connect_fail() - handle connect failure of STA
862 * @param - join params
863 *
864 * Return: QDF_STATUS
865 */
866QDF_STATUS lim_sta_handle_connect_fail(join_params *param);
Pragaspathi Thilagaraj2071e332019-05-25 20:01:32 +0530867
Abhishek Ambure40972f12019-08-21 19:43:18 +0530868/**
869 * lim_join_result_callback() - Callback to handle join rsp
870 * @mac: Pointer to Global MAC structure
871 * @vdev_id: vdev id
872 *
873 * This callback function is used to delete PE session
874 * entry and send join response to sme.
875 *
876 * Return: None
877 */
878void lim_join_result_callback(struct mac_context *mac,
879 uint8_t vdev_id);
880
Pragaspathi Thilagaraj2071e332019-05-25 20:01:32 +0530881#ifdef WLAN_FEATURE_HOST_ROAM
Jianmin Zhud2526072019-04-25 14:04:13 +0800882QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param);
Pragaspathi Thilagaraj2071e332019-05-25 20:01:32 +0530883#else
884static inline
885QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param)
886{
887 return QDF_STATUS_E_NOSUPPORT;
888}
889#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800890
891#ifdef WLAN_FEATURE_11W
892/* 11w send SA query request action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800893QDF_STATUS lim_send_sa_query_request_frame(struct mac_context *mac, uint8_t *transId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800894 tSirMacAddr peer,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800895 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800896/* 11w SA query request action frame handler */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800897QDF_STATUS lim_send_sa_query_response_frame(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800898 uint8_t *transId, tSirMacAddr peer,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800899 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800900#endif
901
902/* Inline functions */
903
904/**
905 * lim_post_sme_message()
906 *
907 ***FUNCTION:
908 * This function is called by limProcessMlmMessages(). In this
909 * function MLM sub-module invokes MLM ind/cnf primitives.
910 *
911 ***LOGIC:
912 * Initially MLM makes an SME function call to invoke MLM ind/cnf
913 * primitive. In future this can be enhanced to 'post' messages to SME.
914 *
915 ***ASSUMPTIONS:
916 * NA
917 *
918 ***NOTE:
919 * NA
920 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800921 * @param mac Pointer to Global MAC structure
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800922 * @param msgType Indicates the MLM primitive message type
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530923 * @param *msg_buf A pointer to the MLM message buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800924 *
925 * @return None
926 */
927static inline void
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530928lim_post_sme_message(struct mac_context *mac, uint32_t msgType,
929 uint32_t *msg_buf)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800930{
Rajeev Kumarcf7bd802017-04-18 11:11:42 -0700931 struct scheduler_msg msg = {0};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800932
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530933 if (!msg_buf) {
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700934 pe_err("Buffer is Pointing to NULL");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935 return;
936 }
937
938 msg.type = (uint16_t) msgType;
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530939 msg.bodyptr = msg_buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800940 msg.bodyval = 0;
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530941 if (msgType > eWNI_SME_MSG_TYPES_BEGIN) {
Jeff Johnson348973e2018-11-22 16:51:12 -0800942 MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530943 msg.type));
Jeff Johnson348973e2018-11-22 16:51:12 -0800944 lim_process_sme_req_messages(mac, &msg);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530945 } else {
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530946 lim_process_mlm_rsp_messages(mac, msgType, msg_buf);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530947 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948} /*** end lim_post_sme_message() ***/
949
950/**
951 * lim_post_mlm_message()
952 *
953 ***FUNCTION:
954 * This function is called by limProcessSmeMessages(). In this
955 * function SME invokes MLME primitives.
956 *
957 ***PARAMS:
958 *
959 ***LOGIC:
960 * Initially SME makes an MLM function call to invoke MLM primitive.
961 * In future this can be enhanced to 'post' messages to MLM.
962 *
963 ***ASSUMPTIONS:
964 * NA
965 *
966 ***NOTE:
967 * NA
968 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800969 * @param mac Pointer to Global MAC structure
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970 * @param msgType Indicates the MLM primitive message type
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530971 * @param *msg_buf A pointer to the MLM message buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800972 *
973 * @return None
974 */
975static inline void
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530976lim_post_mlm_message(struct mac_context *mac, uint32_t msgType,
977 uint32_t *msg_buf)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800978{
Rajeev Kumarcf7bd802017-04-18 11:11:42 -0700979 struct scheduler_msg msg = {0};
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700980
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530981 if (!msg_buf) {
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700982 pe_err("Buffer is Pointing to NULL");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983 return;
984 }
985 msg.type = (uint16_t) msgType;
Pragaspathi Thilagaraj469495b2019-05-30 00:18:31 +0530986 msg.bodyptr = msg_buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800987 msg.bodyval = 0;
Jeff Johnson348973e2018-11-22 16:51:12 -0800988 MTRACE(mac_trace_msg_rx(mac, NO_SESSION, msg.type));
989 lim_process_mlm_req_messages(mac, &msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990} /*** end lim_post_mlm_message() ***/
991
992/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800993 * lim_get_ielen_from_bss_description()
994 *
995 ***FUNCTION:
996 * This function is called in various places to get IE length
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530997 * from struct bss_description structure
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800998 * number being scanned.
999 *
1000 ***PARAMS:
1001 *
1002 ***LOGIC:
1003 *
1004 ***ASSUMPTIONS:
1005 * NA
1006 *
1007 ***NOTE:
1008 * NA
1009 *
1010 * @param pBssDescr
1011 * @return Total IE length
1012 */
1013
1014static inline uint16_t
Pragaspathi Thilagaraj1d8e2ab2019-03-04 23:59:21 +05301015lim_get_ielen_from_bss_description(struct bss_description *pBssDescr)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001016{
1017 uint16_t ielen;
1018
1019 if (!pBssDescr)
1020 return 0;
1021
1022 /*
1023 * Length of BSS desription is without length of
1024 * length itself and length of pointer
1025 * that holds ieFields
1026 *
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +05301027 * <------------sizeof(struct bss_description)-------------------->
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001028 * +--------+---------------------------------+---------------+
1029 * | length | other fields | pointer to IEs|
1030 * +--------+---------------------------------+---------------+
1031 * ^
1032 * ieFields
1033 */
1034
1035 ielen = (uint16_t)(pBssDescr->length + sizeof(pBssDescr->length) -
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +05301036 GET_FIELD_OFFSET(struct bss_description, ieFields));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001037
1038 return ielen;
1039} /*** end lim_get_ielen_from_bss_description() ***/
1040
1041/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05301042 * lim_send_beacon_ind() - send the beacon indication
1043 * @mac_ctx: pointer to mac structure
1044 * @session: pe session
1045 * @reason: beacon update reason
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001046 *
Abhishek Singhfc740be2018-10-12 11:34:26 +05301047 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001048 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001049QDF_STATUS lim_send_beacon_ind(struct mac_context *mac_ctx, struct pe_session *session,
Abhishek Singhfc740be2018-10-12 11:34:26 +05301050 enum sir_bcn_update_reason reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001051
1052void
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001053lim_send_vdev_restart(struct mac_context *mac, struct pe_session *pe_session,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001054 uint8_t sessionId);
1055
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001056void lim_wpspbc_close(struct mac_context *mac, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001057
1058#define LIM_WPS_OVERLAP_TIMER_MS 10000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001059
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001060void lim_process_disassoc_ack_timeout(struct mac_context *mac);
1061void lim_process_deauth_ack_timeout(struct mac_context *mac);
1062QDF_STATUS lim_send_disassoc_cnf(struct mac_context *mac);
1063QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301064
1065/**
1066 * lim_disassoc_tx_complete_cnf() - callback to indicate Tx completion
1067 * @context: pointer to mac structure
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301068 * @txCompleteSuccess: indicates tx success/failure
1069 * @params: tx completion params
1070 *
1071 * function will be invoked on receiving tx completion indication
1072 *
1073 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
1074 */
1075QDF_STATUS lim_disassoc_tx_complete_cnf(void *context,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301076 uint32_t txCompleteSuccess,
1077 void *params);
1078
1079/**
1080 * lim_deauth_tx_complete_cnf() - callback to indicate Tx completion
1081 * @context: pointer to mac structure
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301082 * @txCompleteSuccess: indicates tx success/failure
1083 * @params: tx completion params
1084 *
1085 * function will be invoked on receiving tx completion indication
1086 *
1087 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
1088 */
1089QDF_STATUS lim_deauth_tx_complete_cnf(void *context,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301090 uint32_t txCompleteSuccess,
1091 void *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001092
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001093void lim_send_sme_disassoc_deauth_ntf(struct mac_context *mac_ctx,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301094 QDF_STATUS status, uint32_t *ctx);
Yingying Tangd491e182017-04-18 14:11:03 +08001095
1096#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001097QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
Nitesh Shah99dd9552017-03-20 19:27:47 +05301098 uint32_t *msg_buf);
Yingying Tangd491e182017-04-18 14:11:03 +08001099#else
1100static inline
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001101QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
Yingying Tangd491e182017-04-18 14:11:03 +08001102 uint32_t *msg_buf)
1103{
Jeff Johnson0301ecb2018-06-29 09:36:23 -07001104 return QDF_STATUS_SUCCESS;
Yingying Tangd491e182017-04-18 14:11:03 +08001105}
1106#endif
1107
gaoleze5108942017-03-31 16:56:42 +08001108/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05301109 * lim_send_bcn_rsp() - handle beacon send response
1110 * @mac_ctx Pointer to Global MAC structure
1111 * @rsp: beacon send response
1112 *
1113 * Return: None
1114 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001115void lim_send_bcn_rsp(struct mac_context *mac_ctx, tpSendbeaconParams rsp);
Abhishek Singhfc740be2018-10-12 11:34:26 +05301116
1117/**
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +05301118 * lim_add_roam_blacklist_ap() - handle the blacklist bssid list received from
1119 * firmware
1120 * @mac_ctx: Pointer to Global MAC structure
1121 * @list: roam blacklist ap list
1122 *
1123 * Return: None
1124 */
1125void lim_add_roam_blacklist_ap(struct mac_context *mac_ctx,
1126 struct roam_blacklist_event *src_lst);
1127
1128/**
gaoleze5108942017-03-31 16:56:42 +08001129 * lim_process_rx_channel_status_event() - processes
1130 * event WDA_RX_CHN_STATUS_EVENT
1131 * @mac_ctx Pointer to Global MAC structure
1132 * @buf: Received message info
1133 *
1134 * Return: None
1135 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001136void lim_process_rx_channel_status_event(struct mac_context *mac_ctx, void *buf);
gaoleze5108942017-03-31 16:56:42 +08001137
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001138/* / Bit value data structure */
1139typedef enum sHalBitVal /* For Bit operations */
1140{
1141 eHAL_CLEAR,
1142 eHAL_SET
1143} tHalBitVal;
1144
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001145QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
Kiran Kumar Lokereaee823a2018-03-22 15:27:05 -07001146 tSirMacAddr peer_mac, uint16_t tid,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -08001147 struct pe_session *session,
Kiran Kumar Lokereaee823a2018-03-22 15:27:05 -07001148 uint8_t addba_extn_present,
1149 uint8_t amsdu_support);
Abhishek Singh6a730172017-12-29 14:07:21 +05301150/**
1151 * lim_process_join_failure_timeout() - This function is called to process
1152 * JoinFailureTimeout
1153 *
1154 * @mac_ctx: Pointer to Global MAC structure
1155 *
1156 * This function is called to process JoinFailureTimeout
1157 *
1158 * @Return None
1159 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001160void lim_process_join_failure_timeout(struct mac_context *mac_ctx);
Abhishek Singh6a730172017-12-29 14:07:21 +05301161
1162/**
1163 * lim_process_auth_failure_timeout() - This function is called to process Min
1164 * Channel Timeout during channel scan.
1165 *
1166 * @mac_ctx: Pointer to Global MAC structure
1167 *
1168 * This function is called to process Min Channel Timeout during channel scan.
1169 *
1170 * @Return: None
1171 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001172void lim_process_auth_failure_timeout(struct mac_context *mac_ctx);
Abhishek Singh6a730172017-12-29 14:07:21 +05301173
1174/**
1175 * lim_process_assoc_failure_timeout() - This function is called to process Min
1176 * Channel Timeout during channel scan.
1177 *
1178 * @mac_ctx: Pointer to Global MAC structure
1179 * @msg_type: Assoc or reassoc
1180 *
1181 * This function is called to process Min Channel Timeout during channel scan.
1182 *
1183 * @Return: None
1184 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001185void lim_process_assoc_failure_timeout(struct mac_context *mac_ctx,
Abhishek Singh6a730172017-12-29 14:07:21 +05301186 uint32_t msg_type);
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301187
1188/**
1189 * lim_send_mgmt_frame_tx() - Sends mgmt frame
1190 * @mac_ctx Pointer to Global MAC structure
1191 * @msg: Received message info
1192 *
1193 * Return: None
1194 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001195void lim_send_mgmt_frame_tx(struct mac_context *mac_ctx,
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301196 struct scheduler_msg *msg);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301197
1198/**
1199 * lim_send_csa_restart_req() - send csa restart req
1200 * @mac_ctx Pointer to Global MAC structure
1201 * @vdev_id: vdev id
1202 *
1203 * Return: None
1204 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001205void lim_send_csa_restart_req(struct mac_context *mac_ctx, uint8_t vdev_id);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301206
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301207/**
Abhishek Singhbc4261f2019-03-14 13:21:57 +05301208 * lim_continue_sta_csa_req() - continue with CSA req after HW mode change
1209 * @mac_ctx Pointer to Global MAC structure
1210 * @vdev_id: vdev id
1211 *
1212 * Return: None
1213 */
1214void lim_continue_sta_csa_req(struct mac_context *mac_ctx, uint8_t vdev_id);
1215
1216/**
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301217 * lim_process_mlm_start_req() - process MLM_START_REQ message
1218 *
1219 * @mac_ctx: global MAC context
1220 * @mlm_start_req: Pointer to start req
1221 *
1222 * This function is called to process MLM_START_REQ message
1223 * from SME. MLME now waits for HAL to send WMA_ADD_BSS_RSP.
1224 *
1225 * Return: None
1226 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001227void lim_process_mlm_start_req(struct mac_context *mac_ctx,
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301228 tLimMlmStartReq *mlm_start_req);
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301229
Sandeep Puligilla45e0c5e2018-09-21 00:38:23 -07001230/**
1231 * lim_process_mlm_join_req() - process mlm join request.
1232 *
1233 * @mac_ctx: Pointer to Global MAC structure
1234 * @msg: Pointer to the MLM message buffer
1235 *
1236 * This function is called to process MLM_JOIN_REQ message
1237 * from SME. It does following:
1238 * 1) Initialize LIM, HAL, DPH
1239 * 2) Configure the BSS for which the JOIN REQ was received
1240 * a) Send WMA_ADD_BSS_REQ to HAL -
1241 * This will identify the BSS that we are interested in
1242 * --AND--
1243 * Add a STA entry for the AP (in a STA context)
1244 * b) Wait for WMA_ADD_BSS_RSP
1245 * c) Send WMA_ADD_STA_REQ to HAL
1246 * This will add the "local STA" entry to the STA table
1247 * 3) Continue as before, i.e,
1248 * a) Send a PROBE REQ
1249 * b) Wait for PROBE RSP/BEACON containing the SSID that
1250 * we are interested in
1251 * c) Then start an AUTH seq
1252 * d) Followed by the ASSOC seq
1253 *
1254 * @Return: None
1255 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001256void lim_process_mlm_join_req(struct mac_context *mac_ctx,
Sandeep Puligilla45e0c5e2018-09-21 00:38:23 -07001257 tLimMlmJoinReq *mlm_join_req);
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001258
1259/*
1260 * lim_process_mlm_deauth_req() - This function is called to process
1261 * MLM_DEAUTH_REQ message from SME
1262 *
1263 * @mac_ctx: Pointer to Global MAC structure
1264 * @msg_buf: A pointer to the MLM message buffer
1265 *
1266 * This function is called to process MLM_DEAUTH_REQ message from SME
1267 *
1268 * @Return: None
1269 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001270void lim_process_mlm_deauth_req(struct mac_context *mac_ctx, uint32_t *msg_buf);
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001271
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001272/**
1273 * lim_sta_mlme_vdev_disconnect_bss() - Disconnect from BSS
1274 * @vdev_mlme_obj: VDEV MLME comp object
1275 * @data_len: data size
1276 * @data: event data
1277 *
1278 * API invokes BSS disconnection
1279 *
1280 * Return: SUCCESS on successful completion of disconnection
1281 * FAILURE, if it fails due to any
1282 */
1283QDF_STATUS lim_sta_mlme_vdev_disconnect_bss(struct vdev_mlme_obj *vdev_mlme,
1284 uint16_t data_len, void *data);
Abhishek Ambure7acc2c12019-05-16 14:28:46 +05301285
Srinivas Dasari3e54a4a2019-01-28 12:02:35 +05301286/**
1287 * lim_process_assoc_cleanup() - frees up resources used in function
1288 * lim_process_assoc_req_frame()
1289 * @mac_ctx: pointer to Global MAC structure
1290 * @session: pointer to pe session entry
1291 * @assoc_req: pointer to ASSOC/REASSOC Request frame
1292 * @sta_ds: station dph entry
1293 * @assoc_req_copied: boolean to indicate if assoc req was copied to tmp above
1294 *
1295 * Frees up resources used in function lim_process_assoc_req_frame
1296 *
1297 * Return: void
1298 */
1299void lim_process_assoc_cleanup(struct mac_context *mac_ctx,
1300 struct pe_session *session,
1301 tpSirAssocReq assoc_req,
1302 tpDphHashNode sta_ds,
1303 bool assoc_req_copied);
1304
1305/**
1306 * lim_send_assoc_ind_to_sme() - Initialize PE data structures and send assoc
1307 * indication to SME.
1308 * @mac_ctx: Pointer to Global MAC structure
1309 * @session: pe session entry
1310 * @sub_type: Indicates whether it is Association Request(=0) or Reassociation
1311 * Request(=1) frame
1312 * @hdr: A pointer to the MAC header
1313 * @assoc_req: pointer to ASSOC/REASSOC Request frame
Min Liuddd23302018-12-05 16:17:48 +08001314 * @akm_type: AKM type
Srinivas Dasari3e54a4a2019-01-28 12:02:35 +05301315 * @pmf_connection: flag indicating pmf connection
1316 * @assoc_req_copied: boolean to indicate if assoc req was copied to tmp above
1317 * @dup_entry: flag indicating if duplicate entry found
Pragaspathi Thilagarajb3472f02019-06-04 14:10:44 +05301318 * @force_1x1: flag to indicate if the STA nss needs to be downgraded to 1x1
Srinivas Dasari3e54a4a2019-01-28 12:02:35 +05301319 *
1320 * Return: void
1321 */
1322bool lim_send_assoc_ind_to_sme(struct mac_context *mac_ctx,
1323 struct pe_session *session,
1324 uint8_t sub_type,
1325 tpSirMacMgmtHdr hdr,
1326 tpSirAssocReq assoc_req,
Min Liuddd23302018-12-05 16:17:48 +08001327 enum ani_akm_type akm_type,
Srinivas Dasari3e54a4a2019-01-28 12:02:35 +05301328 bool pmf_connection,
1329 bool *assoc_req_copied,
Pragaspathi Thilagarajb3472f02019-06-04 14:10:44 +05301330 bool dup_entry, bool force_1x1);
Jianmin Zhu9772c4a2019-08-14 16:38:05 +08001331
1332/**
1333 * lim_process_sta_add_bss_rsp_pre_assoc - Processes handoff request
1334 * @mac_ctx: Pointer to mac context
1335 * @pAddBssParams: Bss params including rsp data
1336 * @session_entry: PE session handle
Abhishek Singh7944c9a2019-09-18 17:55:22 +05301337 * @status: Qdf status
Jianmin Zhu9772c4a2019-08-14 16:38:05 +08001338 *
1339 * This function is called to process a WMA_ADD_BSS_RSP from HAL.
1340 * Upon receipt of this message from HAL if the state is pre assoc.
1341 *
1342 * Return: Null
1343 */
1344void lim_process_sta_add_bss_rsp_pre_assoc(struct mac_context *mac_ctx,
1345 struct bss_params *add_bss_params,
Abhishek Singh7944c9a2019-09-18 17:55:22 +05301346 struct pe_session *session_entry,
1347 QDF_STATUS status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001348#endif /* __LIM_TYPES_H */