1 /*
2  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /*
21  * This file lim_types.h contains the definitions used by all
22  * all LIM modules.
23  * Author:        Chandra Modumudi
24  * Date:          02/11/02
25  * History:-
26  * Date           Modified by    Modification Information
27  * --------------------------------------------------------------------
28  *
29  */
30 #ifndef __LIM_TYPES_H
31 #define __LIM_TYPES_H
32 
33 #include "wni_api.h"
34 #include "sir_api.h"
35 #include "sir_common.h"
36 #include "sir_mac_prot_def.h"
37 #include "utils_api.h"
38 
39 #include "lim_api.h"
40 #include "lim_trace.h"
41 #include "lim_send_sme_rsp_messages.h"
42 #include "sys_global.h"
43 #include "dph_global.h"
44 #include "parser_api.h"
45 #include "wma_if.h"
46 
47 #define LINK_TEST_DEFER 1
48 
49 #define TRACE_EVENT_CNF_TIMER_DEACT        0x6600
50 #define TRACE_EVENT_CNF_TIMER_ACT          0x6601
51 #define TRACE_EVENT_AUTH_RSP_TIMER_DEACT   0x6602
52 #define TRACE_EVENT_AUTH_RSP_TIMER_ACT     0x6603
53 
54 #define SAE_AUTH_SEQ_NUM_OFFSET       2
55 #define SAE_AUTH_STATUS_CODE_OFFSET   4
56 #define SAE_AUTH_GROUP_ID_OFFSET      6
57 
58 #define SAE_GROUP_ID_19                    19
59 #define SAE_GROUP_ID_20                    20
60 #define SAE_GROUP_ID_21                    21
61 
62 #define SAE_GROUP_19_FIXED_FIELDS_LEN      96
63 #define SAE_GROUP_20_FIXED_FIELDS_LEN      144
64 #define SAE_GROUP_21_FIXED_FIELDS_LEN      198
65 
66 #define WLAN_SAE_STATUS_HASH_TO_ELEMENT    126
67 #define WLAN_SAE_STATUS_PK                 127
68 
69 /* MLM message types */
70 enum mlmmsgtype {
71 	LIM_MLM_MSG_START = 1000,
72 	LIM_MLM_SCAN_REQ = LIM_MLM_MSG_START,
73 	LIM_MLM_SCAN_CNF = (LIM_MLM_MSG_START + 1),
74 	LIM_MLM_START_CNF  = (LIM_MLM_MSG_START + 3),
75 	LIM_MLM_JOIN_REQ = (LIM_MLM_MSG_START + 4),
76 	LIM_MLM_JOIN_CNF = (LIM_MLM_MSG_START + 5),
77 	LIM_MLM_AUTH_REQ = (LIM_MLM_MSG_START + 6),
78 	LIM_MLM_AUTH_CNF = (LIM_MLM_MSG_START + 7),
79 	LIM_MLM_AUTH_IND = (LIM_MLM_MSG_START + 8),
80 	LIM_MLM_ASSOC_REQ = (LIM_MLM_MSG_START + 9),
81 	LIM_MLM_ASSOC_CNF = (LIM_MLM_MSG_START + 10),
82 	LIM_MLM_ASSOC_IND = (LIM_MLM_MSG_START + 11),
83 	LIM_MLM_DISASSOC_REQ = (LIM_MLM_MSG_START + 12),
84 	LIM_MLM_DISASSOC_CNF = (LIM_MLM_MSG_START + 13),
85 	LIM_MLM_DISASSOC_IND = (LIM_MLM_MSG_START + 14),
86 	LIM_MLM_REASSOC_CNF = (LIM_MLM_MSG_START + 15),
87 	LIM_MLM_REASSOC_IND = (LIM_MLM_MSG_START + 16),
88 	LIM_MLM_DEAUTH_REQ = (LIM_MLM_MSG_START + 17),
89 	LIM_MLM_DEAUTH_CNF = (LIM_MLM_MSG_START + 18),
90 	LIM_MLM_DEAUTH_IND = (LIM_MLM_MSG_START + 19),
91 	LIM_MLM_TSPEC_REQ = (LIM_MLM_MSG_START + 20),
92 	LIM_MLM_TSPEC_CNF = (LIM_MLM_MSG_START + 21),
93 	LIM_MLM_TSPEC_IND = (LIM_MLM_MSG_START + 22),
94 	LIM_MLM_SETKEYS_CNF  =  LIM_MLM_MSG_START + 24,
95 	LIM_MLM_LINK_TEST_STOP_REQ  =  LIM_MLM_MSG_START + 30,
96 	LIM_MLM_PURGE_STA_IND = (LIM_MLM_MSG_START + 31),
97 	/*
98 	 * Values (LIM_MLM_MSG_START + 32) through
99 	 * (LIM_MLM_MSG_START + 40) are unused.
100 	 */
101 };
102 
103 #define LIM_WEP_IN_FC           1
104 #define LIM_NO_WEP_IN_FC        0
105 
106 #define LIM_DECRYPT_ICV_FAIL    1
107 
108 /* / Definitions to distinguish between Association/Reassociaton */
109 #define LIM_ASSOC    0
110 #define LIM_REASSOC  1
111 
112 /* / Verifies whether given mac addr matches the CURRENT Bssid */
113 #define IS_CURRENT_BSSID(mac, addr, pe_session)  (!qdf_mem_cmp(addr, \
114 								      pe_session->bssId, \
115 								      sizeof(pe_session->bssId)))
116 /* / Verifies whether given addr matches the REASSOC Bssid */
117 #define IS_REASSOC_BSSID(mac, addr, pe_session)  (!qdf_mem_cmp(addr, \
118 								      pe_session->limReAssocbssId, \
119 								      sizeof(pe_session->limReAssocbssId)))
120 
121 #define REQ_TYPE_REGISTRAR                   (0x2)
122 #define REQ_TYPE_WLAN_MANAGER_REGISTRAR      (0x3)
123 
124 #define RESP_TYPE_ENROLLEE_INFO_ONLY         (0x0)
125 #define RESP_TYPE_ENROLLEE_OPEN_8021X        (0x1)
126 #define RESP_TYPE_AP                         (0x3)
127 
128 
129 #define HAL_USE_SELF_STA_REQUESTED_MASK     0x2 /* bit 1 for STA overwrite with selfSta Requested. */
130 
131 #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40      /* Bit 6 will be used to control BD rate for Management frames */
132 #define HAL_USE_PEER_STA_REQUESTED_MASK   0x80  /* bit 7 will be used to control frames for p2p interface */
133 #define HAL_USE_PMF   0x20
134 #define HAL_USE_INCORRECT_KEY_PMF   0x10
135 
136 #define MGMT_TX_USE_INCORRECT_KEY   BIT(0)
137 
138 #define LIM_DOS_PROTECTION_TIME 1000 //1000ms
139 /* enums used by LIM are as follows */
140 
141 enum eLimDisassocTrigger {
142 	eLIM_HOST_DISASSOC,
143 	eLIM_PEER_ENTITY_DISASSOC,
144 	eLIM_LINK_MONITORING_DISASSOC,
145 	eLIM_PROMISCUOUS_MODE_DISASSOC,
146 	eLIM_HOST_DEAUTH,
147 	eLIM_PEER_ENTITY_DEAUTH,
148 	eLIM_LINK_MONITORING_DEAUTH,
149 	eLIM_JOIN_FAILURE,
150 	eLIM_REASSOC_REJECT,
151 	eLIM_DUPLICATE_ENTRY,
152 };
153 
154 /**
155  * enum eChannelChangeReasonCodes - Reason code to determine the channel change
156  * reason
157  * @LIM_SWITCH_CHANNEL_REASSOC: channel switch to reassoc
158  * @LIM_SWITCH_CHANNEL_JOIN: switch for connect req
159  * @LIM_SWITCH_CHANNEL_OPERATION: Generic change channel for STA
160  * @LIM_SWITCH_CHANNEL_SAP_DFS: SAP channel change req
161  * @LIM_SWITCH_CHANNEL_HT_WIDTH: HT channel width change reg
162  * @LIM_SWITCH_CHANNEL_MONITOR: Monitor mode channel change req
163  */
164 enum eChannelChangeReasonCodes {
165 	LIM_SWITCH_CHANNEL_REASSOC,
166 	LIM_SWITCH_CHANNEL_JOIN,
167 	LIM_SWITCH_CHANNEL_OPERATION,
168 	LIM_SWITCH_CHANNEL_SAP_DFS,
169 	LIM_SWITCH_CHANNEL_HT_WIDTH,
170 	LIM_SWITCH_CHANNEL_MONITOR,
171 };
172 
173 typedef struct sLimMlmStartReq {
174 	tSirMacSSid ssId;
175 	enum bss_type bssType;
176 	tSirMacAddr bssId;
177 	tSirMacBeaconInterval beaconPeriod;
178 	uint8_t dtimPeriod;
179 	tSirMacCfParamSet cfParamSet;
180 	uint32_t oper_ch_freq;
181 	ePhyChanBondState cbMode;
182 	tSirMacRateSet rateSet;
183 	uint8_t sessionId;      /* Added For BT-AMP Support */
184 
185 	/* Parameters reqd for new HAL (message) interface */
186 	tSirNwType nwType;
187 	uint8_t htCapable;
188 	tSirMacHTOperatingMode htOperMode;
189 	uint8_t dualCTSProtection;
190 	uint8_t txChannelWidthSet;
191 	uint8_t ssidHidden;
192 	uint8_t wps_state;
193 	uint8_t obssProtEnabled;
194 	uint16_t beacon_tx_rate;
195 	uint32_t cac_duration_ms;
196 	uint32_t dfs_regdomain;
197 } tLimMlmStartReq, *tpLimMlmStartReq;
198 
199 typedef struct sLimMlmStartCnf {
200 	tSirResultCodes resultCode;
201 	uint8_t sessionId;
202 } tLimMlmStartCnf, *tpLimMlmStartCnf;
203 
204 typedef struct sLimMlmJoinCnf {
205 	tSirResultCodes resultCode;
206 	uint16_t protStatusCode;
207 	uint8_t sessionId;
208 } tLimMlmJoinCnf, *tpLimMlmJoinCnf;
209 
210 typedef struct sLimMlmAssocReq {
211 	tSirMacAddr peerMacAddr;
212 	uint16_t capabilityInfo;
213 	tSirMacListenInterval listenInterval;
214 	uint8_t sessionId;
215 } tLimMlmAssocReq, *tpLimMlmAssocReq;
216 
217 typedef struct sLimMlmAssocCnf {
218 	tSirResultCodes resultCode;     /* Internal status code. */
219 	uint16_t protStatusCode;        /* Protocol Status code. */
220 	uint8_t sessionId;
221 } tLimMlmAssocCnf, *tpLimMlmAssocCnf;
222 
223 typedef struct sLimMlmAssocInd {
224 	tSirMacAddr peerMacAddr;
225 	uint16_t aid;
226 	tAniAuthType authType;
227 	enum ani_akm_type akm_type;
228 	tAniSSID ssId;
229 	tSirRSNie rsnIE;
230 	tSirWAPIie wapiIE;
231 	tSirAddie addIE;        /* additional IE received from the peer, which possibly includes WSC IE and/or P2P IE. */
232 	tSirMacCapabilityInfo capabilityInfo;
233 	bool spectrumMgtIndicator;
234 	struct power_cap_info powerCap;
235 	struct supported_channels supportedChannels;
236 	uint8_t sessionId;
237 
238 	bool WmmStaInfoPresent;
239 
240 	/* Required for indicating the frames to upper layer */
241 	uint32_t assocReqLength;
242 	uint8_t *assocReqPtr;
243 	struct oem_channel_info chan_info;
244 	bool ampdu;
245 	bool sgi_enable;
246 	bool tx_stbc;
247 	bool rx_stbc;
248 	tSirMacHTChannelWidth ch_width;
249 	enum sir_sme_phy_mode mode;
250 	uint8_t max_supp_idx;
251 	uint8_t max_ext_idx;
252 	uint8_t max_mcs_idx;
253 	uint8_t max_real_mcs_idx;
254 	uint8_t rx_mcs_map;
255 	uint8_t tx_mcs_map;
256 	uint8_t ecsa_capable;
257 	uint32_t ext_cap;
258 	uint8_t supported_band;
259 
260 	tDot11fIEHTCaps ht_caps;
261 	tDot11fIEVHTCaps vht_caps;
262 	bool he_caps_present;
263 	bool eht_caps_present;
264 	bool is_sae_authenticated;
265 #ifdef WLAN_FEATURE_11BE_MLO
266 	tSirMacAddr peer_mld_addr;
267 #endif
268 } tLimMlmAssocInd, *tpLimMlmAssocInd;
269 
270 typedef struct sLimMlmReassocReq {
271 	tSirMacAddr peerMacAddr;
272 	uint16_t capabilityInfo;
273 	tSirMacListenInterval listenInterval;
274 	uint8_t sessionId;
275 } tLimMlmReassocReq, *tpLimMlmReassocReq;
276 
277 typedef struct sLimMlmReassocCnf {
278 	tSirResultCodes resultCode;
279 	uint16_t protStatusCode;        /* Protocol Status code. */
280 	uint8_t sessionId;
281 } tLimMlmReassocCnf, *tpLimMlmReassocCnf;
282 
283 typedef struct sLimMlmAuthCnf {
284 	tSirMacAddr peerMacAddr;
285 	tAniAuthType authType;
286 	tSirResultCodes resultCode;
287 	uint16_t protStatusCode;
288 	uint8_t sessionId;
289 } tLimMlmAuthCnf, *tpLimMlmAuthCnf;
290 
291 typedef struct sLimMlmDeauthReq {
292 	struct qdf_mac_addr peer_macaddr;
293 	uint16_t reasonCode;
294 	uint16_t deauthTrigger;
295 	uint16_t aid;
296 	uint8_t sessionId;      /* Added for BT-AMP SUPPORT */
297 
298 } tLimMlmDeauthReq, *tpLimMlmDeauthReq;
299 
300 typedef struct sLimMlmDeauthCnf {
301 	struct qdf_mac_addr peer_macaddr;
302 	tSirResultCodes resultCode;
303 	uint16_t deauthTrigger;
304 	uint16_t aid;
305 	uint8_t sessionId;
306 } tLimMlmDeauthCnf, *tpLimMLmDeauthCnf;
307 
308 typedef struct sLimMlmDeauthInd {
309 	tSirMacAddr peerMacAddr;
310 	uint16_t reasonCode;
311 	uint16_t deauthTrigger;
312 	uint16_t aid;
313 } tLimMlmDeauthInd, *tpLimMlmDeauthInd;
314 
315 typedef struct sLimMlmDisassocReq {
316 	struct qdf_mac_addr peer_macaddr;
317 	uint16_t reasonCode;
318 	uint16_t disassocTrigger;
319 	uint16_t aid;
320 	uint8_t sessionId;
321 } tLimMlmDisassocReq, *tpLimMlmDisassocReq;
322 
323 typedef struct sLimMlmDisassocCnf {
324 	tSirMacAddr peerMacAddr;
325 	tSirResultCodes resultCode;
326 	uint16_t disassocTrigger;
327 	uint16_t aid;
328 	uint8_t sessionId;
329 } tLimMlmDisassocCnf, *tpLimMlmDisassocCnf;
330 
331 typedef struct sLimMlmDisassocInd {
332 	tSirMacAddr peerMacAddr;
333 	uint16_t reasonCode;
334 	uint16_t disassocTrigger;
335 	uint16_t aid;
336 	uint8_t sessionId;
337 } tLimMlmDisassocInd, *tpLimMlmDisassocInd;
338 
339 typedef struct sLimMlmPurgeStaInd {
340 	tSirMacAddr peerMacAddr;
341 	uint16_t reasonCode;
342 	uint16_t purgeTrigger;
343 	uint16_t aid;
344 	uint8_t sessionId;
345 } tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd;
346 
347 /**
348  * struct sLimMlmSetKeysCnf - set key confirmation parameters
349  * @peer_macaddr: peer mac address
350  * @resultCode: Result of set key operation
351  * @aid: association id
352  * @sessionId: PE session id
353  * @key_len_nonzero: Keys are non-zero length
354  */
355 typedef struct sLimMlmSetKeysCnf {
356 	struct qdf_mac_addr peer_macaddr;
357 	uint16_t resultCode;
358 	uint16_t aid;
359 	uint8_t sessionId;
360 	bool key_len_nonzero;
361 } tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf;
362 
363 /* Function templates */
364 
365 bool lim_process_sme_req_messages(struct mac_context *, struct scheduler_msg *);
366 void lim_process_mlm_req_messages(struct mac_context *, struct scheduler_msg *);
367 void lim_process_mlm_rsp_messages(struct mac_context *, uint32_t, uint32_t *);
368 void lim_process_sme_del_bss_rsp(struct mac_context *mac,
369 				 struct pe_session *pe_session);
370 
371 /**
372  * lim_process_mlm_start_cnf(): called to processes MLM_START_CNF message from
373  * MLM State machine.
374  * @mac_ctx: Pointer to Global MAC structure
375  * @msg_buf: A pointer to the MLM message buffer
376  *
377  * Return: None
378  */
379 void lim_process_mlm_start_cnf(struct mac_context *mac_ctx, uint32_t *msg_buf);
380 
381 void lim_get_random_bssid(struct mac_context *mac, uint8_t *data);
382 
383 /* Function to handle HT and HT IE CFG parameter intializations */
384 void handle_ht_capabilityand_ht_info(struct mac_context *mac,
385 				     struct pe_session *pe_session);
386 
387 void lim_handle_param_update(struct mac_context *mac, eUpdateIEsType cfgId);
388 
389 /* Function to apply CFG parameters before join/reassoc/start BSS */
390 void lim_apply_configuration(struct mac_context *, struct pe_session *);
391 
392 /**
393  * lim_set_cfg_protection() - sets lim global cfg cache from the config
394  * @mac: global mac context
395  * @pesessionEntry: PE session
396  *
397  * Return none
398  */
399 void lim_set_cfg_protection(struct mac_context *mac, struct pe_session *pesessionEntry);
400 
401 /* Function to Initialize MLM state machine on STA */
402 QDF_STATUS lim_init_mlm(struct mac_context *);
403 
404 /**
405  * struct pasn_peer_delete_msg  - PASN peer delete request message
406  * @message_type: Message type
407  * @length: message length
408  * @vdev_id: Vdev id
409  */
410 struct pasn_peer_delete_msg {
411 	uint16_t message_type;
412 	uint16_t length;
413 	uint8_t vdev_id;
414 };
415 
416 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
417 /**
418  * lim_process_pasn_delete_all_peers() - Process delete all PASN peers
419  * request
420  * @mac: Pointer to mac address
421  * @msg: Peer delete message
422  *
423  * Return: QDF_STATUS
424  */
425 QDF_STATUS
426 lim_process_pasn_delete_all_peers(struct mac_context *mac,
427 				  struct pasn_peer_delete_msg *msg);
428 #else
429 static inline QDF_STATUS
lim_process_pasn_delete_all_peers(struct mac_context * mac,struct pasn_peer_delete_msg * msg)430 lim_process_pasn_delete_all_peers(struct mac_context *mac,
431 				  struct pasn_peer_delete_msg *msg)
432 {
433 	return QDF_STATUS_SUCCESS;
434 }
435 #endif
436 
437 /* Function to cleanup MLM state machine */
438 void lim_cleanup_mlm(struct mac_context *);
439 
440 /* Management frame handling functions */
441 
442 #ifdef WLAN_FEATURE_11BE
443 /**
444  * lim_process_beacon_eht() - process beacon 11be IE
445  * @mac_ctx: global mac context
446  * @session: pe session
447  * @bcn_ptr: pointer to tSchBeaconStruct
448  *
449  * Return none
450  */
451 void lim_process_beacon_eht(struct mac_context *mac_ctx,
452 			    struct pe_session *session,
453 			    tSchBeaconStruct *bcn_ptr);
454 
455 /**
456  * lim_process_beacon_eht_op() - process beacon 11be eht op IE
457  * @session: pe session
458  * @bcn_ptr: pointer to bcn ptr
459  *
460  * Return none
461  */
462 void lim_process_beacon_eht_op(struct pe_session *session,
463 			       struct sSirProbeRespBeacon *bcn_ptr);
464 #else
465 static inline
lim_process_beacon_eht(struct mac_context * mac_ctx,struct pe_session * session,tSchBeaconStruct * bcn_ptr)466 void lim_process_beacon_eht(struct mac_context *mac_ctx,
467 			    struct pe_session *session,
468 			    tSchBeaconStruct *bcn_ptr)
469 {
470 }
471 
472 static inline
lim_process_beacon_eht_op(struct pe_session * session,struct sSirProbeRespBeacon * bcn_ptr)473 void lim_process_beacon_eht_op(struct pe_session *session,
474 			       struct sSirProbeRespBeacon *bcn_ptr)
475 {
476 }
477 #endif
478 
479 #ifdef WLAN_FEATURE_11BE_MLO
480 /**
481  * lim_process_bcn_prb_rsp_t2lm() - process beacon/probe response
482  * 11be t2lm IE
483  * @mac_ctx: global mac context
484  * @session: pe session
485  * @bcn_ptr: pointer to tpSirProbeRespBeacon
486  *
487  * Return none
488  */
489 void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
490 				  struct pe_session *session,
491 				  tpSirProbeRespBeacon bcn_ptr);
492 
493 /**
494  * lim_process_beacon_mlo() - process beacon mlo IE
495  * @mac_ctx: global mac context
496  * @session: pe session
497  * @bcn_ptr: pointer to tSchBeaconStruct
498  *
499  * Return none
500  */
501 void lim_process_beacon_mlo(struct mac_context *mac_ctx,
502 			    struct pe_session *session,
503 			    tSchBeaconStruct *bcn_ptr);
504 
505 /**
506  * lim_process_ml_reconfig() - to process beacon frames with reconfig IE
507  * @mac_ctx: Pointer to Global MAC structure
508  * @session: A pointer to session
509  * @rx_pkt_info: A pointer to RX packet info structure
510  *
511  * This function will process ml reconfig beacon frames. If reconfig ie
512  * is present for link removal, link reconfig timer will start.
513  *
514  * Return: none
515  */
516 void
517 lim_process_ml_reconfig(struct mac_context *mac_ctx,
518 			struct pe_session *session,
519 			uint8_t *rx_pkt_info);
520 #else
521 static inline
lim_process_beacon_mlo(struct mac_context * mac_ctx,struct pe_session * session,tSchBeaconStruct * bcn_ptr)522 void lim_process_beacon_mlo(struct mac_context *mac_ctx,
523 			    struct pe_session *session,
524 			    tSchBeaconStruct *bcn_ptr)
525 {
526 }
527 
528 static inline
lim_process_bcn_prb_rsp_t2lm(struct mac_context * mac_ctx,struct pe_session * session,tpSirProbeRespBeacon bcn_ptr)529 void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
530 				  struct pe_session *session,
531 				  tpSirProbeRespBeacon bcn_ptr)
532 {
533 }
534 
535 static inline void
lim_process_ml_reconfig(struct mac_context * mac_ctx,struct pe_session * session,uint8_t * rx_pkt_info)536 lim_process_ml_reconfig(struct mac_context *mac_ctx,
537 			struct pe_session *session,
538 			uint8_t *rx_pkt_info)
539 {
540 }
541 #endif
542 
543 void lim_process_beacon_frame(struct mac_context *, uint8_t *, struct pe_session *);
544 void lim_process_probe_req_frame(struct mac_context *, uint8_t *, struct pe_session *);
545 void lim_process_probe_rsp_frame(struct mac_context *, uint8_t *, struct pe_session *);
546 void lim_process_probe_req_frame_multiple_bss(struct mac_context *, uint8_t *,
547 					      struct pe_session *);
548 
549 /**
550  * lim_process_gen_probe_rsp_frame() - process generate probe rsp frame
551  * @mac_ctx: pointer to global mac context
552  * @session_entry: pointer to pe session
553  * @bcn_probe: pointer to the data frame
554  * @len: the length of data frame
555  *
556  * Return: void
557  */
558 void lim_process_gen_probe_rsp_frame(struct mac_context *mac_ctx,
559 				     struct pe_session *session_entry,
560 				     uint8_t *bcn_probe, uint32_t len);
561 
562 /* Process Auth frame when we have a session in progress. */
563 void lim_process_auth_frame(struct mac_context *, uint8_t *, struct pe_session *);
564 
565 /**
566  * lim_process_auth_frame_no_session() - Process auth frame received from AP to
567  * which we are not connected currently.
568  * @mac: Pointer to global mac context
569  * @bd: Pointer to rx auth frame
570  * @body: Pointer to lim_msg->body_ptr
571  *
572  * This is possibly the pre-auth from the neighbor AP, in the same mobility
573  * domain or pre-authentication reply for WPA3 SAE roaming.
574  * This will be used in case of 11r FT.
575  */
576 QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac,
577 					     uint8_t *bd, void *body);
578 
579 /**
580  * lim_check_assoc_req() - check session and peer info before handling it
581  * @mac_ctx: pointer to Global MAC structure
582  * @sub_type: Assoc(=0) or Reassoc(=1) Requestframe
583  * @sa: Mac address of requesting peer
584  * @session: pointer to pe session entry
585  *
586  * Return: QDF_STATUS
587  */
588 QDF_STATUS lim_check_assoc_req(struct mac_context *mac_ctx,
589 			       uint8_t sub_type, tSirMacAddr sa,
590 			       struct pe_session *session);
591 
592 /**
593  * lim_proc_assoc_req_frm_cmn() - process assoc req frame
594  * @mac_ctx: pointer to Global MAC structure
595  * @sub_type: Assoc(=0) or Reassoc(=1) Requestframe
596  * @session: pointer to pe session entry
597  * @sa: Mac address of requesting peer
598  * @assoc_req: assoc req
599  * @peer_aid: association id
600  *
601  * Return: QDF_STATUS
602  */
603 QDF_STATUS lim_proc_assoc_req_frm_cmn(struct mac_context *mac_ctx,
604 				      uint8_t sub_type,
605 				      struct pe_session *session,
606 				      tSirMacAddr sa,
607 				      tpSirAssocReq assoc_req,
608 				      uint16_t peer_aid);
609 
610 void lim_process_assoc_req_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
611 
612 /**
613  * lim_fill_lim_assoc_ind_params() - Initialize lim association indication
614  * @assoc_ind: PE association indication structure
615  * @mac_ctx: Pointer to Global MAC structure
616  * @sta_ds: station dph entry
617  * @session_entry: PE session entry
618  *
619  * Return: true if lim assoc ind filled successfully
620  */
621 bool lim_fill_lim_assoc_ind_params(
622 		tpLimMlmAssocInd assoc_ind,
623 		struct mac_context *mac_ctx,
624 		tpDphHashNode sta_ds,
625 		struct pe_session *session_entry);
626 
627 /**
628  * lim_sae_auth_cleanup_retry() - API to cleanup sae auth frmae stored
629  * and deactivate the timer
630  * @mac_ctx: Pointer to mac context
631  * @vdev_id: vdev id
632  *
633  * Return: none
634  */
635 void lim_sae_auth_cleanup_retry(struct mac_context *mac_ctx,
636 				uint8_t vdev_id);
637 
638 /**
639  * lim_fill_sme_assoc_ind_params() - Initialize association indication
640  * @mac_ctx: Pointer to Global MAC structure
641  * @assoc_ind: PE association indication structure
642  * @sme_assoc_ind: SME association indication
643  * @session_entry: PE session entry
644  * @assoc_req_alloc: malloc memory for assoc_req or not
645  *
646  * Return: None
647  */
648 void
649 lim_fill_sme_assoc_ind_params(
650 	struct mac_context *mac_ctx,
651 	tpLimMlmAssocInd assoc_ind, struct assoc_ind *sme_assoc_ind,
652 	struct pe_session *session_entry, bool assoc_req_alloc);
653 
654 /**
655  * lim_send_mlm_assoc_ind() - Sends assoc indication to SME
656  * @mac_ctx: Global Mac context
657  * @sta_ds: Station DPH hash entry
658  * @session_entry: PE session entry
659  *
660  * This function sends either LIM_MLM_ASSOC_IND
661  * or LIM_MLM_REASSOC_IND to SME.
662  *
663  * Return: QDF_STATUS
664  */
665 QDF_STATUS lim_send_mlm_assoc_ind(struct mac_context *mac,
666 				  tpDphHashNode sta,
667 				  struct pe_session *pe_session);
668 
669 /**
670  * lim_process_assoc_rsp_frame() - Processes assoc response
671  * @mac_ctx:              Pointer to Global MAC structure
672  * @rx_packet_info:       A pointer to Rx packet info structure
673  * @reassoc_frame_length: Valid frame length if its a reassoc response frame
674  * else 0
675  * @sub_type: Indicates whether it is Association Response (=0) or
676  *             Reassociation Response (=1) frame
677  *
678  * This function is called by lim_handle80211_frames() or
679  * pe_roam_synch_callback() upon Re/Association Response frame reception or
680  * roam synch indication with reassociation response frame is received.
681  *
682  * Return: None
683  */
684 void lim_process_assoc_rsp_frame(struct mac_context *mac, uint8_t *rx_pkt_info,
685 				 uint32_t reassoc_frame_len, uint8_t subtype,
686 				 struct pe_session *pe_session);
687 
688 void lim_process_disassoc_frame(struct mac_context *, uint8_t *, struct pe_session *);
689 
690 /**
691  * lim_get_nss_supported_by_ap() - finds out nss from AP's beacons
692  * @vht_caps: VHT capabilities
693  * @ht_caps: HT capabilities
694  *
695  * Return: nss advertised by AP in beacon
696  */
697 uint8_t lim_get_nss_supported_by_ap(tDot11fIEVHTCaps *vht_caps,
698 				    tDot11fIEHTCaps *ht_caps,
699 				    tDot11fIEhe_cap *he_caps);
700 /*
701  * lim_perform_disassoc() - Actual action taken after receiving disassoc
702  * @mac_ctx: Global MAC context
703  * @frame_rssi: RSSI of the frame
704  * @rc: Reason code of the deauth
705  * @pe_session: PE session entry pointer
706  * @addr: BSSID from which the disassoc is received
707  *
708  * Return: None
709  */
710 void lim_perform_disassoc(struct mac_context *mac_ctx, int32_t frame_rssi,
711 			  uint16_t rc, struct pe_session *pe_session,
712 			  tSirMacAddr addr);
713 /*
714  * lim_disassoc_tdls_peers() - Disassoc action for tdls peers
715  * @mac_ctx: Global MAC context
716  * @pe_session: PE session entry pointer
717  * @addr: BSSID from which the disassoc is received
718  *
719  * Return: None
720  */
721 #ifdef FEATURE_WLAN_TDLS
722 void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
723 				    struct pe_session *pe_session, tSirMacAddr addr);
724 #else
lim_disassoc_tdls_peers(struct mac_context * mac_ctx,struct pe_session * pe_session,tSirMacAddr addr)725 static inline void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
726 				    struct pe_session *pe_session, tSirMacAddr addr)
727 {
728 }
729 #endif
730 void lim_process_deauth_frame(struct mac_context *, uint8_t *, struct pe_session *);
731 /*
732  * lim_perform_deauth() - Actual action taken after receiving deauth
733  * @mac_ctx: Global MAC context
734  * @pe_session: PE session entry pointer
735  * @rc: Reason code of the deauth
736  * @addr: BSSID from which the deauth is received
737  * @frame_rssi: RSSI of the frame
738  *
739  * Return: None
740  */
741 void lim_perform_deauth(struct mac_context *mac_ctx, struct pe_session *pe_session,
742 			uint16_t rc, tSirMacAddr addr, int32_t frame_rssi);
743 void lim_process_action_frame(struct mac_context *, uint8_t *, struct pe_session *);
744 void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pRxMetaInfo);
745 
746 void lim_populate_mac_header(struct mac_context *, uint8_t *, uint8_t, uint8_t,
747 				      tSirMacAddr, tSirMacAddr);
748 QDF_STATUS lim_send_probe_req_mgmt_frame(struct mac_context *, tSirMacSSid *,
749 					 tSirMacAddr, qdf_freq_t, tSirMacAddr,
750 					 uint32_t, uint16_t *, uint8_t *);
751 
752 /**
753  * lim_send_probe_rsp_mgmt_frame() - Send probe response
754  * @mac_ctx: Handle for mac context
755  * @peer_macaddr: Mac address of requesting peer
756  * @ssid: SSID for response
757  * @pe_session: PE session id
758  * @preq_p2pie: P2P IE in incoming probe request
759  *
760  * Builds and sends probe response frame to the requesting peer
761  *
762  * Return: void
763  */
764 void
765 lim_send_probe_rsp_mgmt_frame(struct mac_context *mac_ctx,
766 			      tSirMacAddr peer_macaddr,
767 			      tpAniSSID ssid,
768 			      struct pe_session *pe_session,
769 			      uint8_t preq_p2pie);
770 
771 void lim_send_auth_mgmt_frame(struct mac_context *, tSirMacAuthFrameBody *, tSirMacAddr,
772 			      uint8_t, struct pe_session *);
773 void lim_send_assoc_req_mgmt_frame(struct mac_context *, tLimMlmAssocReq *, struct pe_session *);
774 #ifdef WLAN_FEATURE_HOST_ROAM
775 void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac,
776 		tLimMlmReassocReq *pMlmReassocReq, struct pe_session *pe_session);
777 void lim_send_reassoc_req_mgmt_frame(struct mac_context *, tLimMlmReassocReq *,
778 				     struct pe_session *);
779 /**
780  * lim_process_rx_scan_handler() -
781  *	process the event for scan which is issued by LIM
782  * @vdev: wlan objmgr vdev pointer
783  * @event: scan event
784  * @arg: global mac context pointer
785  *
786  * Return: void
787  */
788 void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
789 				 struct scan_event *event, void *arg);
790 #else
lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context * mac,tLimMlmReassocReq * pMlmReassocReq,struct pe_session * pe_session)791 static inline void lim_send_reassoc_req_with_ft_ies_mgmt_frame(
792 		struct mac_context *mac, tLimMlmReassocReq *pMlmReassocReq,
793 		struct pe_session *pe_session)
794 {}
lim_send_reassoc_req_mgmt_frame(struct mac_context * mac_ctx,tLimMlmReassocReq * reassoc_req,struct pe_session * pe_session)795 static inline void lim_send_reassoc_req_mgmt_frame(struct mac_context *mac_ctx,
796 		tLimMlmReassocReq *reassoc_req, struct pe_session *pe_session)
797 {}
lim_process_rx_scan_handler(struct wlan_objmgr_vdev * vdev,struct scan_event * event,void * arg)798 static inline void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
799 				 struct scan_event *event, void *arg)
800 {}
801 #endif
802 #ifdef WLAN_FEATURE_11AX_BSS_COLOR
803 /**
804  * lim_process_set_he_bss_color() - process the set he bss color request
805  *
806  * @mac_ctx: global mac context pointer
807  * @msg_buf: message buffer pointer
808  *
809  * Return: void
810  */
811 void lim_process_set_he_bss_color(struct mac_context *mac_ctx, uint32_t *msg_buf);
812 
813 /**
814  * lim_reconfig_obss_scan_param() - reconfig the obss scan params
815  *
816  * @mac_ctx: global mac context pointer
817  * @msg_buf: message buffer pointer
818  *
819  * Return: void
820  */
821 void lim_reconfig_obss_scan_param(struct mac_context *mac_ctx,
822 				  uint32_t *msg_buf);
823 
824 /**
825  * lim_process_obss_color_collision_info() - Process the obss color collision
826  *  request.
827  * @mac_ctx: global mac context pointer
828  * @msg_buf: message buffer pointer
829  *
830  * Return: void
831  */
832 void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
833 					   uint32_t *msg_buf);
834 
835 /**
836  * lim_send_obss_color_collision_cfg() - Send obss color collision cfg.
837  * @mac_ctx: global mac context pointer
838  * @session: Pointer to session
839  * @event_type: obss color collision detection type
840  *
841  * Return: void
842  */
843 void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
844 				       struct pe_session *session,
845 				       enum wmi_obss_color_collision_evt_type
846 				       event_type);
847 #else
lim_process_set_he_bss_color(struct mac_context * mac_ctx,uint32_t * msg_buf)848 static inline void lim_process_set_he_bss_color(struct mac_context *mac_ctx,
849 		uint32_t *msg_buf)
850 {}
851 
lim_reconfig_obss_scan_param(struct mac_context * mac_ctx,uint32_t * msg_buf)852 static inline void lim_reconfig_obss_scan_param(struct mac_context *mac_ctx,
853 						uint32_t *msg_buf)
854 {
855 }
lim_process_obss_color_collision_info(struct mac_context * mac_ctx,uint32_t * msg_buf)856 static inline void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
857 							 uint32_t *msg_buf)
858 {}
lim_send_obss_color_collision_cfg(struct mac_context * mac_ctx,struct pe_session * session,enum wmi_obss_color_collision_evt_type event_type)859 static inline void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
860 			struct pe_session *session,
861 			enum wmi_obss_color_collision_evt_type event_type)
862 {}
863 #endif
864 void lim_send_delts_req_action_frame(struct mac_context *mac, tSirMacAddr peer,
865 				     uint8_t wmmTspecPresent,
866 				     struct mac_ts_info * pTsinfo,
867 				     struct mac_tspec_ie * pTspecIe,
868 				     struct pe_session *pe_session);
869 void lim_send_addts_req_action_frame(struct mac_context *mac, tSirMacAddr peerMacAddr,
870 				     tSirAddtsReqInfo *addts, struct pe_session *);
871 
872 #ifdef WLAN_FEATURE_MSCS
873 /**
874  * lim_send_mscs_req_action_frame() - Send mscs req
875  * @mac_ctx: Handle for mac context
876  * @peer_mac: Mac address of requesting peer
877  * @mscs_req: mscs request buffer
878  * @pe_session: PE session id.
879  *
880  * Builds and sends mscs action frame to the peer.
881  *
882  * Return: void
883  */
884 void lim_send_mscs_req_action_frame(struct mac_context *mac,
885 				    struct qdf_mac_addr peer_mac,
886 				    struct mscs_req_info *mscs_req,
887 				    struct pe_session *pe_session);
888 #endif
889 
890 /**
891  * lim_send_assoc_rsp_mgmt_frame() - Send assoc response
892  * @mac_ctx: Handle for mac context
893  * @status_code: Status code for assoc response frame
894  * @aid: Association ID
895  * @peer_addr: Mac address of requesting peer
896  * @subtype: Assoc/Reassoc
897  * @sta: Pointer to station node
898  * @pe_session: PE session id.
899  * @tx_complete: Need tx complete callback or not
900  *
901  * Builds and sends association response frame to the requesting peer.
902  *
903  * Return: void
904  */
905 void
906 lim_send_assoc_rsp_mgmt_frame(
907 	struct mac_context *mac_ctx,
908 	uint16_t status_code, uint16_t aid, tSirMacAddr peer_addr,
909 	uint8_t subtype, tpDphHashNode sta, struct pe_session *pe_session,
910 	bool tx_complete);
911 
912 void lim_send_disassoc_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr,
913 				  struct pe_session *, bool waitForAck);
914 void lim_send_deauth_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr, struct pe_session *,
915 				bool waitForAck);
916 
917 /**
918  * lim_process_mlm_update_hidden_ssid_rsp() - process hidden ssid response
919  * @mac_ctx: global mac context
920  * @vdev_id: vdev id
921  *
922  * Return: None
923  */
924 void lim_process_mlm_update_hidden_ssid_rsp(struct mac_context *mac_ctx,
925 					    uint8_t vdev_id);
926 
927 tSirResultCodes lim_mlm_add_bss(struct mac_context *, tLimMlmStartReq *,
928 				struct pe_session *pe_session);
929 
930 QDF_STATUS lim_send_channel_switch_mgmt_frame(struct mac_context *, tSirMacAddr,
931 						 uint8_t, uint8_t, uint8_t,
932 						 struct pe_session *);
933 
934 QDF_STATUS lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx,
935 	tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
936 	uint8_t new_channel, uint8_t count, struct pe_session *session_entry);
937 QDF_STATUS lim_p2p_oper_chan_change_confirm_action_frame(
938 	struct mac_context *mac_ctx, tSirMacAddr peer,
939 	struct pe_session *session_entry);
940 
941 QDF_STATUS lim_send_neighbor_report_request_frame(struct mac_context *,
942 						     tpSirMacNeighborReportReq,
943 						     tSirMacAddr, struct pe_session *);
944 
945 /**
946  * lim_send_link_report_action_frame() - Send link measurement report action
947  * frame in response for a link measurement request received.
948  * @mac: Pointer to Mac context
949  * @link_report: Pointer to the sSirMacLinkReport struct
950  * @peer: BSSID of the peer
951  * @pe_session: Pointer to the pe_session
952  *
953  * Return: QDF_STATUS
954  *
955  */
956 QDF_STATUS
957 lim_send_link_report_action_frame(struct mac_context *mac,
958 				  tpSirMacLinkReport link_report,
959 				  tSirMacAddr peer,
960 				  struct pe_session *pe_session);
961 
962 /**
963  * lim_send_radio_measure_report_action_frame - Send RRM report action frame
964  * @mac: pointer to global MAC context
965  * @dialog_token: Dialog token to be used in the action frame
966  * @num_report: number of reports in pRRMReport
967  * @is_last_frame: is the current report last or more reports to follow
968  * @pRRMReport: Pointer to the RRM report structure
969  * @peer: MAC address of the peer
970  * @pe_session: Pointer to the PE session entry
971  *
972  * Return: Ret Status
973  */
974 QDF_STATUS
975 lim_send_radio_measure_report_action_frame(struct mac_context *mac,
976 				uint8_t dialog_token,
977 				uint8_t num_report,
978 				bool is_last_frame,
979 				tpSirMacRadioMeasureReport pRRMReport,
980 				tSirMacAddr peer,
981 				struct pe_session *pe_session);
982 
983 #ifdef FEATURE_WLAN_TDLS
984 void lim_init_tdls_data(struct mac_context *, struct pe_session *);
985 
986 /**
987  * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
988  * @mac_ctx: global mac context
989  * @msg: message buffer received from SME.
990  *
991  * Process Send Mgmt Request from SME and transmit to AP.
992  *
993  * Return: QDF_STATUS_SUCCESS on success, error code otherwise
994  */
995 QDF_STATUS lim_process_sme_tdls_mgmt_send_req(struct mac_context *mac_ctx,
996 					      void *msg);
997 
998 /**
999  * lim_process_sme_tdls_add_sta_req() - process TDLS Add STA
1000  * @mac_ctx: global mac context
1001  * @msg: message buffer received from SME.
1002  *
1003  * Process TDLS Add Station request
1004  *
1005  * Return: QDF_STATUS_SUCCESS on success, error code otherwise
1006  */
1007 QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac,
1008 					    void *msg);
1009 
1010 /**
1011  * lim_process_sme_tdls_del_sta_req() - process TDLS Del STA
1012  * @mac_ctx: global mac context
1013  * @msg: message buffer received from SME.
1014  *
1015  * Process TDLS Delete Station request
1016  *
1017  * Return: QDF_STATUS_SUCCESS on success, error code otherwise
1018  */
1019 QDF_STATUS lim_process_sme_tdls_del_sta_req(struct mac_context *mac,
1020 					    void *msg);
1021 
1022 void lim_send_sme_mgmt_tx_completion(struct mac_context *mac, uint32_t vdev_id,
1023 				     uint32_t txCompleteStatus);
1024 QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
1025 				    struct pe_session *session_entry);
1026 QDF_STATUS lim_process_tdls_add_sta_rsp(struct mac_context *mac, void *msg, struct pe_session *);
1027 void lim_process_tdls_del_sta_rsp(struct mac_context *mac_ctx,
1028 				  struct scheduler_msg *lim_msg,
1029 				  struct pe_session *session_entry);
1030 
1031 /**
1032  * lim_update_tdls_state_in_fw() - Update TDLS state in FW
1033  *
1034  * @session_entry - PE sessions
1035  * @value  -value to be updated
1036  *
1037  *
1038  * Return: void
1039  */
1040 void lim_update_tdls_set_state_for_fw(struct pe_session *session_entry,
1041 				      bool value);
1042 
1043 /**
1044  * lim_update_tdls_2g_bw() - Update TDLS peer bw to fw
1045  *
1046  * @session_entry - PE sessions
1047  *
1048  * Return: void
1049  */
1050 void lim_update_tdls_2g_bw(struct pe_session *session);
1051 
1052 #else
lim_delete_tdls_peers(struct mac_context * mac_ctx,struct pe_session * session_entry)1053 static inline QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
1054 						struct pe_session *session_entry)
1055 {
1056 	return QDF_STATUS_SUCCESS;
1057 }
lim_init_tdls_data(struct mac_context * mac,struct pe_session * pe_session)1058 static inline void lim_init_tdls_data(struct mac_context *mac,
1059 					struct pe_session *pe_session)
1060 {
1061 
1062 }
1063 
lim_update_tdls_set_state_for_fw(struct pe_session * session_entry,bool value)1064 static inline void lim_update_tdls_set_state_for_fw(struct pe_session
1065 						    *session_entry, bool value)
1066 {
1067 }
1068 
lim_update_tdls_2g_bw(struct pe_session * session)1069 static inline void lim_update_tdls_2g_bw(struct pe_session *session)
1070 {
1071 }
1072 #endif
1073 
1074 /* Algorithms & Link Monitoring related functions */
1075 /* / Function that handles heartbeat failure */
1076 void lim_handle_heart_beat_failure(struct mac_context *, struct pe_session *);
1077 
1078 /**
1079  * lim_tear_down_link_with_ap() - Tear down link with AP
1080  * @mac: mac context
1081  * @session_id: PE session id
1082  * @reason_code: Disconnect reason code as per emun wlan_reason_code
1083  * @trigger: Disconnect trigger as per enum eLimDisassocTrigger
1084  *
1085  * Function that triggers link tear down with AP upon HB failure
1086  *
1087  * Return: None
1088  */
1089 void lim_tear_down_link_with_ap(struct mac_context *mac,
1090 				uint8_t session_id,
1091 				enum wlan_reason_code reason_code,
1092 				enum eLimDisassocTrigger trigger);
1093 
1094 /* / Function that defers the messages received */
1095 uint32_t lim_defer_msg(struct mac_context *, struct scheduler_msg *);
1096 
1097 #ifdef ANI_SUPPORT_11H
1098 /* / Function that sends Measurement Report action frame */
1099 QDF_STATUS lim_send_meas_report_frame(struct mac_context *, tpSirMacMeasReqActionFrame,
1100 					 tSirMacAddr, struct pe_session *pe_session);
1101 
1102 /* / Function that sends TPC Report action frame */
1103 QDF_STATUS lim_send_tpc_report_frame(struct mac_context *, tpSirMacTpcReqActionFrame,
1104 					tSirMacAddr, struct pe_session *pe_session);
1105 #endif
1106 
1107 /**
1108  * lim_handle_add_bss_rsp() - Handle add bss response
1109  * @mac_ctx: mac context
1110  * @add_bss_rsp: add bss rsp
1111  *
1112  * This function is called to handle all types of add bss rsp
1113  * It will free memory of add_bss_rsp in the end after rsp is handled.
1114  *
1115  * Return: None
1116  */
1117 void lim_handle_add_bss_rsp(struct mac_context *mac_ctx,
1118 			    struct add_bss_rsp *add_bss_rsp);
1119 
1120 void lim_process_mlm_add_sta_rsp(struct mac_context *mac,
1121 				struct scheduler_msg *limMsgQt,
1122 				 struct pe_session *pe_session);
1123 void lim_process_mlm_del_sta_rsp(struct mac_context *mac,
1124 				 struct scheduler_msg *limMsgQ);
1125 
1126 QDF_STATUS
1127 lim_process_mlm_del_all_sta_rsp(struct vdev_mlme_obj *vdev_mlme,
1128 				struct peer_delete_all_response *rsp);
1129 /**
1130  * lim_process_mlm_del_bss_rsp () - API to process delete bss response
1131  * @mac: Pointer to Global MAC structure
1132  * @vdev_stop_rsp: pointer to vdev stop response
1133  * @pe_session: pointer to pe_session
1134  *
1135  * Return: None
1136  */
1137 void lim_process_mlm_del_bss_rsp(struct mac_context *mac,
1138 				 struct del_bss_resp *vdev_stop_rsp,
1139 				 struct pe_session *pe_session);
1140 
1141 void lim_process_sta_mlm_add_sta_rsp(struct mac_context *mac,
1142 				     struct scheduler_msg *limMsgQ,
1143 				     struct pe_session *pe_session);
1144 void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac,
1145 				     struct scheduler_msg *limMsgQ,
1146 				     struct pe_session *pe_session);
1147 
1148 /**
1149  * lim_process_sta_mlm_del_bss_rsp() - handle del bss response of STA
1150  * @mac: Pointer to Global MAC structure
1151  * @vdev_stop_rsp: pointer to vdev stop response
1152  * @pe_session: pointer to pe_session
1153  *
1154  * Return: none
1155  */
1156 void lim_process_sta_mlm_del_bss_rsp(struct mac_context *mac,
1157 				     struct del_bss_resp *vdev_stop_rsp,
1158 				     struct pe_session *pe_session);
1159 
1160 void lim_process_mlm_set_sta_key_rsp(struct mac_context *mac,
1161 				     struct scheduler_msg *limMsgQ);
1162 void lim_process_mlm_set_bss_key_rsp(struct mac_context *mac,
1163 				     struct scheduler_msg *limMsgQ);
1164 
1165 /* Function to process WMA_SWITCH_CHANNEL_RSP message */
1166 void lim_process_switch_channel_rsp(struct mac_context *mac,
1167 				    struct vdev_start_response *rsp);
1168 
1169 /**
1170  * lim_sta_handle_connect_fail() - handle connect failure of STA
1171  * @param - join params
1172  *
1173  * Return: QDF_STATUS
1174  */
1175 QDF_STATUS lim_sta_handle_connect_fail(join_params *param);
1176 
1177 /**
1178  * lim_join_result_callback() - Callback to handle join rsp
1179  * @mac: Pointer to Global MAC structure
1180  * @vdev_id: vdev id
1181  *
1182  * This callback function is used to delete PE session
1183  * entry and send join response to sme.
1184  *
1185  * Return: None
1186  */
1187 void lim_join_result_callback(struct mac_context *mac,
1188 			      uint8_t vdev_id);
1189 
1190 /**
1191  * lim_update_lost_link_rssi() - API to update lost link rssi in lim session
1192  * @mac: Pointer to Global MAC structure
1193  * @rssi: rssi at disconnect time
1194  *
1195  * Return: None
1196  */
1197 void lim_update_lost_link_rssi(struct mac_context *mac, uint32_t rssi);
1198 
1199 #ifdef WLAN_FEATURE_HOST_ROAM
1200 QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param);
1201 #else
1202 static inline
lim_sta_reassoc_error_handler(struct reassoc_params * param)1203 QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param)
1204 {
1205 	return QDF_STATUS_E_NOSUPPORT;
1206 }
1207 #endif
1208 
1209 /* 11w send SA query request action frame */
1210 QDF_STATUS lim_send_sa_query_request_frame(struct mac_context *mac, uint8_t *transId,
1211 					      tSirMacAddr peer,
1212 					      struct pe_session *pe_session);
1213 /* 11w SA query request action frame handler */
1214 QDF_STATUS lim_send_sa_query_response_frame(struct mac_context *mac,
1215 					       uint8_t *transId, tSirMacAddr peer,
1216 					       struct pe_session *pe_session);
1217 /* Inline functions */
1218 
1219 /**
1220  * lim_post_sme_message()
1221  *
1222  ***FUNCTION:
1223  * This function is called by limProcessMlmMessages(). In this
1224  * function MLM sub-module invokes MLM ind/cnf primitives.
1225  *
1226  ***LOGIC:
1227  * Initially MLM makes an SME function call to invoke MLM ind/cnf
1228  * primitive. In future this can be enhanced to 'post' messages to SME.
1229  *
1230  ***ASSUMPTIONS:
1231  * NA
1232  *
1233  ***NOTE:
1234  * NA
1235  *
1236  * @param mac      Pointer to Global MAC structure
1237  * @param msgType   Indicates the MLM primitive message type
1238  * @param *msg_buf  A pointer to the MLM message buffer
1239  *
1240  * @return None
1241  */
1242 static inline void
lim_post_sme_message(struct mac_context * mac,uint32_t msgType,uint32_t * msg_buf)1243 lim_post_sme_message(struct mac_context *mac, uint32_t msgType,
1244 		     uint32_t *msg_buf)
1245 {
1246 	struct scheduler_msg msg = {0};
1247 
1248 	if (!msg_buf) {
1249 		pe_err("Buffer is Pointing to NULL");
1250 		return;
1251 	}
1252 
1253 	msg.type = (uint16_t) msgType;
1254 	msg.bodyptr = msg_buf;
1255 	msg.bodyval = 0;
1256 	if (msgType > eWNI_SME_MSG_TYPES_BEGIN) {
1257 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
1258 				 msg.type));
1259 		lim_process_sme_req_messages(mac, &msg);
1260 	} else {
1261 		lim_process_mlm_rsp_messages(mac, msgType, msg_buf);
1262 	}
1263 } /*** end lim_post_sme_message() ***/
1264 
1265 /**
1266  * lim_post_mlm_message()
1267  *
1268  ***FUNCTION:
1269  * This function is called by limProcessSmeMessages(). In this
1270  * function SME invokes MLME primitives.
1271  *
1272  ***PARAMS:
1273  *
1274  ***LOGIC:
1275  * Initially SME makes an MLM function call to invoke MLM primitive.
1276  * In future this can be enhanced to 'post' messages to MLM.
1277  *
1278  ***ASSUMPTIONS:
1279  * NA
1280  *
1281  ***NOTE:
1282  * NA
1283  *
1284  * @param mac      Pointer to Global MAC structure
1285  * @param msgType   Indicates the MLM primitive message type
1286  * @param *msg_buf  A pointer to the MLM message buffer
1287  *
1288  * @return None
1289  */
1290 static inline void
lim_post_mlm_message(struct mac_context * mac,uint32_t msgType,uint32_t * msg_buf)1291 lim_post_mlm_message(struct mac_context *mac, uint32_t msgType,
1292 		     uint32_t *msg_buf)
1293 {
1294 	struct scheduler_msg msg = {0};
1295 
1296 	if (!msg_buf) {
1297 		pe_err("Buffer is Pointing to NULL");
1298 		return;
1299 	}
1300 	msg.type = (uint16_t) msgType;
1301 	msg.bodyptr = msg_buf;
1302 	msg.bodyval = 0;
1303 	MTRACE(mac_trace_msg_rx(mac, NO_SESSION, msg.type));
1304 	lim_process_mlm_req_messages(mac, &msg);
1305 } /*** end lim_post_mlm_message() ***/
1306 
1307 /**
1308  * lim_get_ielen_from_bss_description()
1309  *
1310  ***FUNCTION:
1311  * This function is called in various places to get IE length
1312  * from struct bss_description structure
1313  * number being scanned.
1314  *
1315  ***PARAMS:
1316  *
1317  ***LOGIC:
1318  *
1319  ***ASSUMPTIONS:
1320  * NA
1321  *
1322  ***NOTE:
1323  * NA
1324  *
1325  * @param     pBssDescr
1326  * @return    Total IE length
1327  */
1328 
1329 static inline uint16_t
lim_get_ielen_from_bss_description(struct bss_description * pBssDescr)1330 lim_get_ielen_from_bss_description(struct bss_description *pBssDescr)
1331 {
1332 	return wlan_get_ielen_from_bss_description(pBssDescr);
1333 } /*** end lim_get_ielen_from_bss_description() ***/
1334 
1335 /**
1336  * lim_send_beacon_ind() - send the beacon indication
1337  * @mac_ctx: pointer to mac structure
1338  * @session: pe session
1339  * @reason: beacon update reason
1340  *
1341  * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
1342  */
1343 QDF_STATUS lim_send_beacon_ind(struct mac_context *mac_ctx, struct pe_session *session,
1344 			       enum sir_bcn_update_reason reason);
1345 
1346 void
1347 lim_send_vdev_restart(struct mac_context *mac, struct pe_session *pe_session,
1348 		      uint8_t sessionId);
1349 
1350 void lim_wpspbc_close(struct mac_context *mac, struct pe_session *pe_session);
1351 
1352 #define LIM_WPS_OVERLAP_TIMER_MS                 10000
1353 
1354 void lim_process_disassoc_ack_timeout(struct mac_context *mac);
1355 void lim_process_deauth_ack_timeout(void *pMacGlobal, uint32_t vdev_id);
1356 QDF_STATUS lim_send_disassoc_cnf(struct mac_context *mac);
1357 QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac, uint8_t vdev_id);
1358 
1359 /**
1360  * lim_disassoc_tx_complete_cnf() - callback to indicate Tx completion
1361  * @context: pointer to mac structure
1362  * @txCompleteSuccess: indicates tx success/failure
1363  * @params: tx completion params
1364  *
1365  * function will be invoked on receiving tx completion indication
1366  *
1367  * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
1368  */
1369 QDF_STATUS lim_disassoc_tx_complete_cnf(void *context,
1370 					uint32_t txCompleteSuccess,
1371 					void *params);
1372 
1373 /**
1374  * lim_deauth_tx_complete_cnf() - callback to indicate Tx completion
1375  * @context: pointer to mac structure
1376  * @txCompleteSuccess: indicates tx success/failure
1377  * @params: tx completion params
1378  *
1379  * function will be invoked on receiving tx completion indication
1380  *
1381  * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
1382  */
1383 QDF_STATUS lim_deauth_tx_complete_cnf(void *context,
1384 				      uint32_t txCompleteSuccess,
1385 				      void *params);
1386 
1387 /**
1388  * lim_cm_send_disconnect_rsp() - To send disconnect rsp to CM
1389  * @ctx: pointer to mac structure
1390  * @vdev_id: vdev id
1391  *
1392  * return: None
1393  */
1394 void lim_cm_send_disconnect_rsp(struct mac_context *mac_ctx, uint8_t vdev_id);
1395 
1396 void lim_send_sme_disassoc_deauth_ntf(struct mac_context *mac_ctx,
1397 				QDF_STATUS status, uint32_t *ctx);
1398 
1399 #ifdef FEATURE_WLAN_TDLS
1400 QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
1401 						 uint32_t *msg_buf);
1402 #else
1403 static inline
lim_process_sme_del_all_tdls_peers(struct mac_context * p_mac,uint32_t * msg_buf)1404 QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
1405 						 uint32_t *msg_buf)
1406 {
1407 	return QDF_STATUS_SUCCESS;
1408 }
1409 #endif
1410 
1411 /**
1412  * lim_send_bcn_rsp() - handle beacon send response
1413  * @mac_ctx Pointer to Global MAC structure
1414  * @rsp: beacon send response
1415  *
1416  * Return: None
1417  */
1418 void lim_send_bcn_rsp(struct mac_context *mac_ctx, tpSendbeaconParams rsp);
1419 
1420 /* / Bit value data structure */
1421 typedef enum sHalBitVal         /* For Bit operations */
1422 {
1423 	eHAL_CLEAR,
1424 	eHAL_SET
1425 } tHalBitVal;
1426 
1427 /**
1428  * lim_send_addba_response_frame(): Send ADDBA response action frame to peer
1429  * @mac_ctx: mac context
1430  * @peer_mac: Peer MAC address
1431  * @tid: TID for which addba response is being sent
1432  * @session: PE session entry
1433  * @addba_extn_present: ADDBA extension present flag
1434  * @amsdu_support: amsdu in ampdu support
1435  * @is_wep: protected bit in fc
1436  * @calc_buff_size: Calculated buf size from peer and self capabilities
1437  * @bssid: peer BSSID
1438  *
1439  * This function is called when ADDBA request is successful. ADDBA response is
1440  * setup by calling addba_response_setup API and frame is then sent out OTA.
1441  *
1442  * Return: QDF_STATUS
1443  */
1444 QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
1445 					 tSirMacAddr peer_mac, uint16_t tid,
1446 					 struct pe_session *session,
1447 					 uint8_t addba_extn_present,
1448 					 uint8_t amsdu_support, uint8_t is_wep,
1449 					 uint16_t calc_buff_size,
1450 					 tSirMacAddr bssid);
1451 
1452 /**
1453  * lim_send_delba_action_frame() - Send delba to peer
1454  * @mac_ctx: mac context
1455  * @vdev_id: vdev id
1456  * @peer_macaddr: Peer mac addr
1457  * @tid: Tid number
1458  * @reason_code: reason code
1459  *
1460  * Return: 0 for success, non-zero for failure
1461  */
1462 QDF_STATUS lim_send_delba_action_frame(struct mac_context *mac_ctx,
1463 				       uint8_t vdev_id,
1464 				       uint8_t *peer_macaddr, uint8_t tid,
1465 				       uint8_t reason_code);
1466 
1467 #ifdef WLAN_FEATURE_11BE_MLO
1468 /**
1469  * lim_send_t2lm_action_req_frame() - Send T2LM negotiation request to peer
1470  * @vdev: vdev pointer
1471  * @peer_mac: Peer mac addr
1472  * @args: Pointer to action frame args
1473  * @ongoing_t2lm_neg: T2LM negotiation request
1474  * @token: Dialog token
1475  *
1476  * Return: 0 for success, non-zero for failure
1477  */
1478 QDF_STATUS
1479 lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev *vdev,
1480 			       uint8_t *peer_mac,
1481 			       struct wlan_action_frame_args *args,
1482 			       struct wlan_t2lm_onging_negotiation_info *t2lm_neg,
1483 			       uint8_t token);
1484 
1485 /**
1486  * lim_send_t2lm_action_rsp_frame() - Send T2LM negotiation response to peer
1487  * @mac_ctx: mac context
1488  * @peer_mac: Peer mac addr
1489  * @session: PE session entry
1490  * @token: Dialog token
1491  * @status_code: T2LM negotiation response status code
1492  *
1493  * Return: 0 for success, non-zero for failure
1494  */
1495 QDF_STATUS
1496 lim_send_t2lm_action_rsp_frame(struct mac_context *mac_ctx,
1497 			       tSirMacAddr peer_mac,
1498 			       struct pe_session *session,
1499 			       uint8_t token,
1500 			       enum wlan_t2lm_resp_frm_type status_code);
1501 
1502 /**
1503  * lim_send_epcs_update_edca_params() - Wrapper for EPCS update edca
1504  * @vdev: vdev object
1505  * @edca: the pointer of edca parameters
1506  * @mu_edca: the flag of mu edca
1507  *
1508  * Return: 0 for success, non-zero for failure
1509  */
1510 QDF_STATUS
1511 lim_send_epcs_update_edca_params(struct wlan_objmgr_vdev *vdev,
1512 				 tSirMacEdcaParamRecord *edca, bool mu_edca);
1513 
1514 /**
1515  * lim_send_epcs_restore_edca_params() - Restore edca parameters
1516  * @vdev: vdev object
1517  *
1518  * Return: 0 for success, non-zero for failure
1519  */
1520 QDF_STATUS
1521 lim_send_epcs_restore_edca_params(struct wlan_objmgr_vdev *vdev);
1522 
1523 /**
1524  * lim_send_epcs_action_rsp_frame() - Send EPCS action response frame
1525  * @vdev: vdev object
1526  * @peer_mac: peer mac address pointer
1527  * @args: the pointer of action frame args
1528  *
1529  * Return: 0 for success, non-zero for failure
1530  */
1531 QDF_STATUS
1532 lim_send_epcs_action_rsp_frame(struct wlan_objmgr_vdev *vdev,
1533 			       uint8_t *peer_mac,
1534 			       struct wlan_action_frame_args *args);
1535 
1536 /**
1537  * lim_send_epcs_action_req_frame() - Send EPCS action request frame
1538  * @vdev: vdev object
1539  * @peer_mac: peer mac address pointer
1540  * @args: the pointer of action frame args
1541  *
1542  * Return: 0 for success, non-zero for failure
1543  */
1544 QDF_STATUS
1545 lim_send_epcs_action_req_frame(struct wlan_objmgr_vdev *vdev,
1546 			       uint8_t *peer_mac,
1547 			       struct wlan_action_frame_args *args);
1548 
1549 /**
1550  * lim_send_epcs_action_teardown_frame() - Send EPCS action teardown frame
1551  * @vdev: vdev object
1552  * @peer_mac: peer mac address pointer
1553  * @args: the pointer of action frame args
1554  *
1555  * Return: 0 for success, non-zero for failure
1556  */
1557 QDF_STATUS
1558 lim_send_epcs_action_teardown_frame(struct wlan_objmgr_vdev *vdev,
1559 				    uint8_t *peer_mac,
1560 				    struct wlan_action_frame_args *args);
1561 #else
1562 static inline QDF_STATUS
lim_send_t2lm_action_rsp_frame(struct mac_context * mac_ctx,tSirMacAddr peer_mac,struct pe_session * session,uint8_t token,enum wlan_t2lm_resp_frm_type status_code)1563 lim_send_t2lm_action_rsp_frame(struct mac_context *mac_ctx,
1564 			       tSirMacAddr peer_mac,
1565 			       struct pe_session *session, uint8_t token,
1566 			       enum wlan_t2lm_resp_frm_type status_code)
1567 {
1568 	return QDF_STATUS_SUCCESS;
1569 }
1570 
1571 static inline QDF_STATUS
lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev * vdev,uint8_t * peer_mac,struct wlan_action_frame_args * args,struct wlan_t2lm_onging_negotiation_info * t2lm_neg,uint8_t token)1572 lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev *vdev,
1573 			       uint8_t *peer_mac,
1574 			       struct wlan_action_frame_args *args,
1575 			       struct wlan_t2lm_onging_negotiation_info *t2lm_neg,
1576 			       uint8_t token)
1577 {
1578 	return QDF_STATUS_SUCCESS;
1579 }
1580 #endif
1581 
1582 /**
1583  * lim_process_join_failure_timeout() - This function is called to process
1584  * JoinFailureTimeout
1585  *
1586  * @mac_ctx: Pointer to Global MAC structure
1587  *
1588  * This function is called to process JoinFailureTimeout
1589  *
1590  * @Return None
1591  */
1592 void lim_process_join_failure_timeout(struct mac_context *mac_ctx);
1593 
1594 /**
1595  * lim_process_auth_failure_timeout() - This function is called to process Min
1596  * Channel Timeout during channel scan.
1597  *
1598  * @mac_ctx: Pointer to Global MAC structure
1599  *
1600  * This function is called to process Min Channel Timeout during channel scan.
1601  *
1602  * @Return: None
1603  */
1604 void lim_process_auth_failure_timeout(struct mac_context *mac_ctx);
1605 
1606 /**
1607  * lim_process_assoc_failure_timeout() - This function is called to process Min
1608  * Channel Timeout during channel scan.
1609  *
1610  * @mac_ctx: Pointer to Global MAC structure
1611  * @msg_type: Assoc or reassoc
1612  *
1613  * This function is called to process Min Channel Timeout during channel scan.
1614  *
1615  * @Return: None
1616  */
1617 void lim_process_assoc_failure_timeout(struct mac_context *mac_ctx,
1618 				       uint32_t msg_type);
1619 
1620 /**
1621  * lim_process_sae_auth_timeout() - This function is called to process sae
1622  * auth timeout
1623  * @mac_ctx: Pointer to Global MAC structure
1624  *
1625  * @Return: None
1626  */
1627 void lim_process_sae_auth_timeout(struct mac_context *mac_ctx);
1628 
1629 /**
1630  * lim_process_rrm_sta_stats_rsp_timeout() - This function is called to process
1631  * sta stats response timeout
1632  * @mac_ctx: Pointer to Global MAC structure
1633  *
1634  * @Return: None
1635  */
1636 void lim_process_rrm_sta_stats_rsp_timeout(struct mac_context *mac_ctx);
1637 
1638 /**
1639  * lim_send_frame() - API to send frame
1640  * @mac_ctx Pointer to Global MAC structure
1641  * @vdev_id: vdev id
1642  * @buf: Pointer to SAE auth retry frame
1643  * @buf_len: length of frame
1644  *
1645  * Return: None
1646  */
1647 void lim_send_frame(struct mac_context *mac_ctx, uint8_t vdev_id, uint8_t *buf,
1648 		    uint16_t buf_len);
1649 
1650 /**
1651  * lim_send_mgmt_frame_tx() - Sends mgmt frame
1652  * @mac_ctx Pointer to Global MAC structure
1653  * @msg: Received message info
1654  *
1655  * Return: None
1656  */
1657 void lim_send_mgmt_frame_tx(struct mac_context *mac_ctx,
1658 		struct scheduler_msg *msg);
1659 
1660 /**
1661  * lim_send_csa_restart_req() - send csa restart req
1662  * @mac_ctx Pointer to Global MAC structure
1663  * @vdev_id: vdev id
1664  *
1665  * Return: None
1666  */
1667 void lim_send_csa_restart_req(struct mac_context *mac_ctx, uint8_t vdev_id);
1668 
1669 /**
1670  * lim_continue_sta_csa_req() - continue with CSA req after HW mode change
1671  * @mac_ctx Pointer to Global MAC structure
1672  * @vdev_id: vdev id
1673  *
1674  * Return: None
1675  */
1676 void lim_continue_sta_csa_req(struct mac_context *mac_ctx, uint8_t vdev_id);
1677 
1678 /**
1679  * lim_process_mlm_start_req() - process MLM_START_REQ message
1680  *
1681  * @mac_ctx: global MAC context
1682  * @mlm_start_req: Pointer to start req
1683  *
1684  * This function is called to process MLM_START_REQ message
1685  * from SME. MLME now waits for HAL to send WMA_ADD_BSS_RSP.
1686  *
1687  * Return: None
1688  */
1689 void lim_process_mlm_start_req(struct mac_context *mac_ctx,
1690 					  tLimMlmStartReq *mlm_start_req);
1691 
1692 /**
1693  * lim_process_mlm_join_req() - process mlm join request.
1694  *
1695  * @mac_ctx:    Pointer to Global MAC structure
1696  * @msg:        Pointer to the MLM message buffer
1697  *
1698  * This function is called to process MLM_JOIN_REQ message
1699  * from SME. It does following:
1700  * 1) Initialize LIM, HAL, DPH
1701  * 2) Configure the BSS for which the JOIN REQ was received
1702  *   a) Send WMA_ADD_BSS_REQ to HAL -
1703  *   This will identify the BSS that we are interested in
1704  *   --AND--
1705  *   Add a STA entry for the AP (in a STA context)
1706  *   b) Wait for WMA_ADD_BSS_RSP
1707  *   c) Send WMA_ADD_STA_REQ to HAL
1708  *   This will add the "local STA" entry to the STA table
1709  * 3) Continue as before, i.e,
1710  *   a) Send a PROBE REQ
1711  *   b) Wait for PROBE RSP/BEACON containing the SSID that
1712  *   we are interested in
1713  *   c) Then start an AUTH seq
1714  *   d) Followed by the ASSOC seq
1715  *
1716  * @Return: None
1717  */
1718 void lim_process_mlm_join_req(struct mac_context *mac_ctx,
1719 			      tLimMlmJoinReq *mlm_join_req);
1720 
1721 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
1722 /**
1723  * lim_pasn_peer_del_all_resp_vdev_delete_resume() - Delete all PASN peers is
1724  * complete resume vdev delete.
1725  * @mac: Mac context pointer
1726  * @vdev: Vdev object pointer
1727  *
1728  * Return: None
1729  */
1730 void
1731 lim_pasn_peer_del_all_resp_vdev_delete_resume(struct mac_context *mac,
1732 					      struct wlan_objmgr_vdev *vdev);
1733 #else
1734 static inline void
lim_pasn_peer_del_all_resp_vdev_delete_resume(struct mac_context * mac,struct wlan_objmgr_vdev * vdev)1735 lim_pasn_peer_del_all_resp_vdev_delete_resume(struct mac_context *mac,
1736 					      struct wlan_objmgr_vdev *vdev)
1737 {}
1738 #endif
1739 
1740 /**
1741  * lim_send_peer_create_resp() -  Send peer create response
1742  * @mac:     Pointer to MAC context
1743  * @vdev_id: vdev id
1744  * @status:  Status of peer create
1745  * @peer_mac: Peer mac address
1746  */
1747 void lim_send_peer_create_resp(struct mac_context *mac, uint8_t vdev_id,
1748 			       QDF_STATUS status, uint8_t *peer_mac);
1749 
1750 /*
1751  * lim_process_mlm_deauth_req() - This function is called to process
1752  * MLM_DEAUTH_REQ message from SME
1753  *
1754  * @mac_ctx:      Pointer to Global MAC structure
1755  * @msg_buf:      A pointer to the MLM message buffer
1756  *
1757  * This function is called to process MLM_DEAUTH_REQ message from SME
1758  *
1759  * @Return: None
1760  */
1761 void lim_process_mlm_deauth_req(struct mac_context *mac_ctx, uint32_t *msg_buf);
1762 
1763 /**
1764  * lim_sta_mlme_vdev_disconnect_bss() - Disconnect from BSS
1765  * @vdev_mlme_obj:  VDEV MLME comp object
1766  * @data_len: data size
1767  * @data: event data
1768  *
1769  * API invokes BSS disconnection
1770  *
1771  * Return: SUCCESS on successful completion of disconnection
1772  *         FAILURE, if it fails due to any
1773  */
1774 QDF_STATUS lim_sta_mlme_vdev_disconnect_bss(struct vdev_mlme_obj *vdev_mlme,
1775 					    uint16_t data_len, void *data);
1776 
1777 /**
1778  * lim_process_assoc_cleanup() - frees up resources used in function
1779  * lim_process_assoc_req_frame()
1780  * @mac_ctx: pointer to Global MAC structure
1781  * @session: pointer to pe session entry
1782  * @assoc_req: pointer to ASSOC/REASSOC Request frame
1783  * @sta_ds: station dph entry
1784  * @assoc_req_copied: boolean to indicate if assoc req was copied to tmp above
1785  *
1786  * Frees up resources used in function lim_process_assoc_req_frame
1787  *
1788  * Return: void
1789  */
1790 void lim_process_assoc_cleanup(struct mac_context *mac_ctx,
1791 			       struct pe_session *session,
1792 			       tpSirAssocReq assoc_req,
1793 			       tpDphHashNode sta_ds,
1794 			       bool assoc_req_copied);
1795 
1796 /**
1797  * lim_send_assoc_ind_to_sme() - Initialize PE data structures and send assoc
1798  *				 indication to SME.
1799  * @mac_ctx: Pointer to Global MAC structure
1800  * @session: pe session entry
1801  * @sub_type: Indicates whether it is Association Request(=0) or Reassociation
1802  *            Request(=1) frame
1803  * @sa: Mac address of requesting peer
1804  * @assoc_req: pointer to ASSOC/REASSOC Request frame
1805  * @akm_type: AKM type
1806  * @pmf_connection: flag indicating pmf connection
1807  * @assoc_req_copied: boolean to indicate if assoc req was copied to tmp above
1808  * @dup_entry: flag indicating if duplicate entry found
1809  * @force_1x1: flag to indicate if the STA nss needs to be downgraded to 1x1
1810  * @partner_peer_idx: peer_idx which is already allocated by partner link
1811  *
1812  * Return: void
1813  */
1814 bool lim_send_assoc_ind_to_sme(struct mac_context *mac_ctx,
1815 			       struct pe_session *session,
1816 			       uint8_t sub_type,
1817 			       tSirMacAddr sa,
1818 			       tpSirAssocReq assoc_req,
1819 			       enum ani_akm_type akm_type,
1820 			       bool pmf_connection,
1821 			       bool *assoc_req_copied,
1822 			       bool dup_entry, bool force_1x1,
1823 			       uint16_t partner_peer_idx);
1824 
1825 /**
1826  * lim_process_sta_add_bss_rsp_pre_assoc - Processes handoff request
1827  * @mac_ctx:  Pointer to mac context
1828  * @pAddBssParams: Bss params including rsp data
1829  * @session_entry: PE session handle
1830  * @status: Qdf status
1831  *
1832  * This function is called to process a WMA_ADD_BSS_RSP from HAL.
1833  * Upon receipt of this message from HAL if the state is pre assoc.
1834  *
1835  * Return: Null
1836  */
1837 void lim_process_sta_add_bss_rsp_pre_assoc(struct mac_context *mac_ctx,
1838 					   struct bss_params *add_bss_params,
1839 					   struct pe_session *session_entry,
1840 					   QDF_STATUS status);
1841 #endif /* __LIM_TYPES_H */
1842