1 /*
2  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 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  * DOC: declare internal API related to the mlme component
21  */
22 
23 #ifndef _WLAN_MLME_MAIN_H_
24 #define _WLAN_MLME_MAIN_H_
25 
26 #include "qdf_periodic_work.h"
27 #include <wlan_mlme_public_struct.h>
28 #include <wlan_objmgr_psoc_obj.h>
29 #include <wlan_objmgr_global_obj.h>
30 #include <wlan_cmn.h>
31 #include <wlan_objmgr_vdev_obj.h>
32 #include <wlan_objmgr_peer_obj.h>
33 #include "wlan_wfa_config_public_struct.h"
34 #include "wlan_connectivity_logging.h"
35 
36 #define MAC_MAX_ADD_IE_LENGTH       2048
37 /* Join probe request Retry  timer default (200)ms */
38 #define JOIN_PROBE_REQ_TIMER_MS              200
39 #define MAX_JOIN_PROBE_REQ                   5
40 
41 #define MAX_WAKELOCK_FOR_BSS_COLOR_CHANGE    2000
42 
43 /* If AP reported link delete timer less than such value,
44  * host will do link removel directly without wait for the
45  * timer timeout.
46  */
47 #define LINK_REMOVAL_MIN_TIMEOUT_MS 1000
48 
49 /*
50  * Following time is used to program WOW_TIMER_PATTERN to FW so that FW will
51  * wake host up to do graceful disconnect in case PEER remains un-authorized
52  * for this long.
53  */
54 #define INSTALL_KEY_TIMEOUT_SEC      70
55 #define INSTALL_KEY_TIMEOUT_MS       \
56 			(INSTALL_KEY_TIMEOUT_SEC * SYSTEM_TIME_SEC_TO_MSEC)
57 /* 70 seconds, for WPA, WPA2, CCKM */
58 #define WAIT_FOR_KEY_TIMEOUT_PERIOD     \
59 	(INSTALL_KEY_TIMEOUT_SEC * QDF_MC_TIMER_TO_SEC_UNIT)
60 /* 120 seconds, for WPS */
61 #define WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD (120 * QDF_MC_TIMER_TO_SEC_UNIT)
62 
63 #define MLME_PEER_SET_KEY_WAKELOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
64 /* QCN IE definitions */
65 #define QCN_IE_HDR_LEN     6
66 
67 #define QCN_IE_VERSION_SUBATTR_ID        1
68 #define QCN_IE_VERSION_SUBATTR_DATA_LEN  2
69 #define QCN_IE_VERSION_SUBATTR_LEN       4
70 #define QCN_IE_VERSION_SUPPORTED    1
71 #define QCN_IE_SUBVERSION_SUPPORTED 0
72 
73 #define QCN_IE_ATTR_ID_VERSION 1
74 #define QCN_IE_ATTR_ID_VHT_MCS11 2
75 #define QCN_IE_ATTR_ID_ALL 0xFF
76 
77 #define mlme_legacy_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params)
78 #define mlme_legacy_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params)
79 #define mlme_legacy_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_MLME, params)
80 #define mlme_legacy_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_MLME, params)
81 #define mlme_legacy_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_MLME, params)
82 #define MAC_B_PR_SSID_OFFSET 12
83 
84 enum size_of_len_field {
85 	ONE_BYTE = 1,
86 	TWO_BYTE = 2
87 };
88 
89 enum medium_access_type {
90 	MEDIUM_ACCESS_AUTO = 0,
91 	MEDIUM_ACCESS_DCF,
92 	MEDIUM_ACCESS_11E_EDCF,
93 	MEDIUM_ACCESS_WMM_EDCF_DSCP,
94 };
95 
96 enum wmm_user_mode {
97 	WMM_USER_MODE_AUTO = 0,
98 	WMM_USER_MODE_QBSS_ONLY = 1,
99 	WMM_USER_MODE_NO_QOS = 2,
100 
101 };
102 
103 /**
104  * struct peer_mac_addresses -Peer MAC address info
105  * @mac: Provided peer MAC address
106  * @peer_mac: Peer MAC address
107  * @peer_mld: Peer MLD address
108  */
109 struct peer_mac_addresses {
110 	struct qdf_mac_addr mac;
111 	struct qdf_mac_addr peer_mac;
112 	struct qdf_mac_addr peer_mld;
113 };
114 
115 struct pwr_channel_info {
116 	uint32_t first_freq;
117 	uint8_t num_chan;
118 	int8_t max_tx_pwr;
119 };
120 
121 /**
122  * struct peer_disconnect_stats_param -Peer disconnect stats params
123  * @vdev_id: vdev_id of the SAP vdev on which disconnect stats request is sent
124  * @is_disconn_stats_completed: Indicates if disconnect stats request is
125  * completed or not
126  * @disconn_stats_timer: Disconnect stats timer
127  */
128 struct peer_disconnect_stats_param {
129 	uint8_t vdev_id;
130 	qdf_atomic_t is_disconn_stats_completed;
131 	qdf_mc_timer_t disconn_stats_timer;
132 };
133 
134 /**
135  * struct wlan_mlme_rx_ops  - structure of tx function pointers for
136  * roaming related commands
137  * @peer_oper_mode_eventid : Rx ops function pointer for operating mode event
138  */
139 struct wlan_mlme_rx_ops {
140 	QDF_STATUS (*peer_oper_mode_eventid)(struct wlan_objmgr_psoc *psoc,
141 					     struct peer_oper_mode_event *data);
142 };
143 
144 /**
145  * struct wlan_mlme_tx_ops - structure of mlme tx function pointers
146  * @send_csa_event_status_ind: Tx ops function to send csa event indication
147  *
148  */
149 struct wlan_mlme_tx_ops {
150 	QDF_STATUS
151 		(*send_csa_event_status_ind)(struct wlan_objmgr_vdev *vdev,
152 					     uint8_t csa_status);
153 };
154 
155 /**
156  * struct wlan_mlme_psoc_ext_obj -MLME ext psoc priv object
157  * @cfg:     cfg items
158  * @rso_tx_ops: Roam Tx ops to send roam offload commands to firmware
159  * @rso_rx_ops: Roam Rx ops to receive roam offload events from firmware
160  * @mlme_rx_ops: mlme Rx ops to receive events from firmware
161  * @mlme_tx_ops: mlme tx ops
162  * @wfa_testcmd: WFA config tx ops to send to FW
163  * @disconnect_stats_param: Peer disconnect stats related params for SAP case
164  * @scan_requester_id: mlme scan requester id
165  */
166 struct wlan_mlme_psoc_ext_obj {
167 	struct wlan_mlme_cfg cfg;
168 	struct wlan_cm_roam_tx_ops rso_tx_ops;
169 	struct wlan_cm_roam_rx_ops rso_rx_ops;
170 	struct wlan_mlme_rx_ops mlme_rx_ops;
171 	struct wlan_mlme_tx_ops mlme_tx_ops;
172 	struct wlan_mlme_wfa_cmd wfa_testcmd;
173 	struct peer_disconnect_stats_param disconnect_stats_param;
174 	wlan_scan_requester scan_requester_id;
175 };
176 
177 /**
178  * struct wlan_disconnect_info - WLAN Disconnection Information
179  * @self_discon_ies: Disconnect IEs to be sent in deauth/disassoc frames
180  *                   originated from driver
181  * @peer_discon_ies: Disconnect IEs received in deauth/disassoc frames
182  *                       from peer
183  */
184 struct wlan_disconnect_info {
185 	struct element_info self_discon_ies;
186 	struct element_info peer_discon_ies;
187 };
188 
189 /**
190  * struct sae_auth_retry - SAE auth retry Information
191  * @sae_auth_max_retry: Max number of sae auth retries
192  * @sae_auth: SAE auth frame information
193  */
194 struct sae_auth_retry {
195 	uint8_t sae_auth_max_retry;
196 	struct element_info sae_auth;
197 };
198 
199 /**
200  * struct peer_mlme_priv_obj - peer MLME component object
201  * @last_pn_valid: if last PN is valid
202  * @last_pn: last pn received
203  * @rmf_pn_replays: rmf pn replay count
204  * @is_pmf_enabled: True if PMF is enabled
205  * @last_assoc_received_time: last assoc received time
206  * @last_disassoc_deauth_received_time: last disassoc/deauth received time
207  * @twt_ctx: TWT context
208  * @allow_kickout: True if the peer can be kicked out. Peer can't be kicked
209  *                 out if it is being steered
210  * @nss: Peer NSS
211  * @peer_set_key_wakelock: wakelock to protect peer set key op with firmware
212  * @peer_set_key_runtime_wakelock: runtime pm wakelock for set key
213  * @is_key_wakelock_set: flag to check if key wakelock is pending to release
214  * @assoc_rsp: assoc rsp IE received during connection
215  * @peer_ind_bw: peer indication channel bandwidth
216  */
217 struct peer_mlme_priv_obj {
218 	uint8_t last_pn_valid;
219 	uint64_t last_pn;
220 	uint32_t rmf_pn_replays;
221 	bool is_pmf_enabled;
222 	qdf_time_t last_assoc_received_time;
223 	qdf_time_t last_disassoc_deauth_received_time;
224 #ifdef WLAN_SUPPORT_TWT
225 	struct twt_context twt_ctx;
226 #endif
227 #ifdef WLAN_FEATURE_SON
228 	bool allow_kickout;
229 #endif
230 	uint8_t nss;
231 	qdf_wake_lock_t peer_set_key_wakelock;
232 	qdf_runtime_lock_t peer_set_key_runtime_wakelock;
233 	bool is_key_wakelock_set;
234 	struct element_info assoc_rsp;
235 	enum phy_ch_width peer_ind_bw;
236 };
237 
238 /**
239  * enum vdev_assoc_type - VDEV associate/reassociate type
240  * @VDEV_ASSOC: associate
241  * @VDEV_REASSOC: reassociate
242  * @VDEV_FT_REASSOC: fast reassociate
243  */
244 enum vdev_assoc_type {
245 	VDEV_ASSOC,
246 	VDEV_REASSOC,
247 	VDEV_FT_REASSOC
248 };
249 
250 /**
251  * struct wlan_mlme_roam_state_info - Structure containing roaming
252  * state related details
253  * @state: Roaming module state.
254  * @mlme_operations_bitmap: Bitmap containing what mlme operations are in
255  *  progress where roaming should not be allowed.
256  */
257 struct wlan_mlme_roam_state_info {
258 	enum roam_offload_state state;
259 	uint8_t mlme_operations_bitmap;
260 };
261 
262 /**
263  * struct wlan_mlme_roaming_config - Roaming configurations structure
264  * @roam_trigger_bitmap: Master bitmap of roaming triggers. If the bitmap is
265  *  zero, roaming module will be deinitialized at firmware for this vdev.
266  * @supplicant_disabled_roaming: Enable/disable roam scan in firmware; will be
267  *  used by supplicant to do roam invoke after disabling roam scan in firmware,
268  *  it is only effective for current connection, it will be cleared during new
269  *  connection.
270  */
271 struct wlan_mlme_roaming_config {
272 	uint32_t roam_trigger_bitmap;
273 	bool supplicant_disabled_roaming;
274 };
275 
276 /**
277  * struct wlan_mlme_roam - Roam structure containing roam state and
278  *  roam config info
279  * @roam_sm: Structure containing roaming state related details
280  * @roam_cfg: Roaming configurations structure
281  * @sae_single_pmk: Details for sae roaming using single pmk
282  * @set_pmk_pending: RSO update status of PMK from set_key
283  * @sae_auth_ta: SAE pre-auth tx address
284  * @sae_auth_pending:  Roaming SAE auth pending
285  */
286 struct wlan_mlme_roam {
287 	struct wlan_mlme_roam_state_info roam_sm;
288 	struct wlan_mlme_roaming_config roam_cfg;
289 #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
290 	struct wlan_mlme_sae_single_pmk sae_single_pmk;
291 #endif
292 	bool set_pmk_pending;
293 	struct qdf_mac_addr sae_auth_ta;
294 	uint8_t sae_auth_pending;
295 };
296 
297 #ifdef WLAN_FEATURE_MSCS
298 /**
299  * struct tclas_mask - TCLAS Mask Elements for mscs request
300  * @classifier_type: specifies the type of classifier parameters
301  * in TCLAS element. Currently driver supports classifier type = 4 only.
302  * @classifier_mask: Mask for tclas elements. For example, if
303  * classifier type = 4, value of classifier mask is 0x5F.
304  * @info: information of classifier type
305  */
306 struct tclas_mask {
307 	uint8_t classifier_type;
308 	uint8_t classifier_mask;
309 	union {
310 		struct {
311 			uint8_t reserved[16];
312 		} ip_param; /* classifier_type = 4 */
313 	} info;
314 };
315 
316 /**
317  * enum scs_request_type - scs request type to peer
318  * @SCS_REQ_ADD: To set mscs parameters
319  * @SCS_REQ_REMOVE: Remove mscs parameters
320  * @SCS_REQ_CHANGE: Update mscs parameters
321  */
322 enum scs_request_type {
323 	SCS_REQ_ADD = 0,
324 	SCS_REQ_REMOVE = 1,
325 	SCS_REQ_CHANGE = 2,
326 };
327 
328 /**
329  * struct descriptor_element - mscs Descriptor element
330  * @request_type: mscs request type defined in enum scs_request_type
331  * @user_priority_control: To set user priority of tx packet
332  * @stream_timeout: minimum timeout value, in TUs, for maintaining
333  * variable user priority in the MSCS list.
334  * @tclas_mask: to specify how incoming MSDUs are classified into
335  * streams in MSCS
336  * @status_code: status of mscs request
337  */
338 struct descriptor_element {
339 	uint8_t request_type;
340 	uint16_t user_priority_control;
341 	uint64_t stream_timeout;
342 	struct tclas_mask tclas_mask;
343 	uint8_t status_code;
344 };
345 
346 /**
347  * struct mscs_req_info - mscs request information
348  * @vdev_id: session id
349  * @bssid: peer bssid
350  * @dialog_token: Token number of mscs req action frame
351  * @dec: mscs Descriptor element defines information about
352  * the parameters used to classify streams
353  * @is_mscs_req_sent: To Save mscs req request if any (only
354  * one can be outstanding at any time)
355  */
356 struct mscs_req_info {
357 	uint8_t vdev_id;
358 	struct qdf_mac_addr bssid;
359 	uint8_t dialog_token;
360 	struct descriptor_element dec;
361 	bool is_mscs_req_sent;
362 };
363 #endif
364 
365 #ifdef WLAN_FEATURE_HOST_ROAM
366 /**
367  * enum ft_ie_state - ft state
368  * @FT_START_READY: Start before and after 11r assoc
369  * @FT_AUTH_REQ_READY: When we have recvd the 1st or nth auth req
370  * @FT_REASSOC_REQ_WAIT: waiting for reassoc
371  * @FT_SET_KEY_WAIT: waiting for key
372  */
373 enum ft_ie_state {
374 	FT_START_READY,
375 	FT_AUTH_REQ_READY,
376 	FT_REASSOC_REQ_WAIT,
377 	FT_SET_KEY_WAIT,
378 };
379 #endif
380 
381 /**
382  * struct ft_context - ft related information
383  * @r0kh_id_len: r0kh id len
384  * @r0kh_id: r0kh id
385  * @auth_ft_ie: auth ft ies received during preauth phase
386  * @auth_ie_len: auth ie length
387  * @reassoc_ft_ie: reassoc ft ies received during reassoc phase
388  * @reassoc_ie_len: reassoc ie length
389  * @ric_ies: ric ie
390  * @ric_ies_length: ric ie len
391  * @set_ft_preauth_state: preauth state
392  * @ft_state: ft state
393  * @add_mdie: add mdie in assoc req
394  */
395 struct ft_context {
396 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
397 	uint32_t r0kh_id_len;
398 	uint8_t r0kh_id[ROAM_R0KH_ID_MAX_LEN];
399 #endif
400 #ifdef WLAN_FEATURE_HOST_ROAM
401 	uint8_t auth_ft_ie[MAX_FTIE_SIZE];
402 	uint16_t auth_ie_len;
403 	uint8_t reassoc_ft_ie[MAX_FTIE_SIZE];
404 	uint16_t reassoc_ie_len;
405 	uint8_t ric_ies[MAX_FTIE_SIZE];
406 	uint16_t ric_ies_length;
407 	bool set_ft_preauth_state;
408 	enum ft_ie_state ft_state;
409 	bool add_mdie;
410 #endif
411 };
412 
413 /**
414  * struct assoc_channel_info - store channel info at the time of association
415  * @assoc_ch_width: channel width at the time of initial connection
416  * @omn_ie_ch_width: ch width present in operating mode notification IE of bcn
417  * @sec_2g_freq: secondary 2 GHz freq
418  * @cen320_freq: 320 MHz center freq
419  */
420 struct assoc_channel_info {
421 	enum phy_ch_width assoc_ch_width;
422 	enum phy_ch_width omn_ie_ch_width;
423 	qdf_freq_t sec_2g_freq;
424 	qdf_freq_t cen320_freq;
425 };
426 
427 /**
428  * struct mlme_connect_info - mlme connect information
429  * @timing_meas_cap: Timing meas cap
430  * @chan_info: oem channel info
431  * @tdls_chan_swit_prohibited: if tdls chan switch is prohobited by AP
432  * @tdls_prohibited: if tdls is prohobited by AP
433  * @uapsd_per_ac_bitmask: Used on STA, this is a static UAPSD mask setting
434  * derived from JOIN_REQ and REASSOC_REQ. If a particular AC bit is set, it
435  * means the AC is both trigger enabled and delivery enabled.
436  * @qos_enabled: is qos enabled
437  * @ft_info: ft related info
438  * @hlp_ie: hldp ie
439  * @hlp_ie_len: hlp ie length
440  * @fils_con_info: Pointer to fils connection info from connect req
441  * @cckm_ie: cck IE
442  * @cckm_ie_len: cckm_ie len
443  * @ese_tspec_info: ese tspec info
444  * @ext_cap_ie: Ext CAP IE
445  * @assoc_btm_cap: BSS transition management cap used in (re)assoc req
446  * @assoc_chan_info: store channel info at the time of association
447  * @force_20mhz_in_24ghz: Only 20 MHz BW allowed in 2.4 GHz
448  *
449  */
450 struct mlme_connect_info {
451 	uint8_t timing_meas_cap;
452 	struct oem_channel_info chan_info;
453 #ifdef FEATURE_WLAN_TDLS
454 	bool tdls_chan_swit_prohibited;
455 	bool tdls_prohibited;
456 #endif
457 	uint8_t uapsd_per_ac_bitmask;
458 	bool qos_enabled;
459 	struct ft_context ft_info;
460 #ifdef WLAN_FEATURE_FILS_SK
461 	uint8_t *hlp_ie;
462 	uint32_t hlp_ie_len;
463 	struct wlan_fils_connection_info *fils_con_info;
464 #endif
465 #ifdef FEATURE_WLAN_ESE
466 	uint8_t cckm_ie[DOT11F_IE_RSN_MAX_LEN];
467 	uint8_t cckm_ie_len;
468 #ifdef WLAN_FEATURE_HOST_ROAM
469 	tESETspecInfo ese_tspec_info;
470 #endif
471 #endif
472 	uint8_t ext_cap_ie[DOT11F_IE_EXTCAP_MAX_LEN + 2];
473 	bool assoc_btm_cap;
474 	struct assoc_channel_info assoc_chan_info;
475 	bool force_20mhz_in_24ghz;
476 };
477 
478 /** struct wait_for_key_timer - wait for key timer object
479  * @vdev: Pointer to vdev
480  * @timer: timer for wati for key
481  */
482 struct wait_for_key_timer {
483 	struct wlan_objmgr_vdev *vdev;
484 	qdf_mc_timer_t timer;
485 };
486 
487 /**
488  * struct mlme_ap_config - VDEV MLME legacy private SAP
489  * related configurations
490  * @user_config_sap_ch_freq : Frequency from userspace to start SAP
491  * @update_required_scc_sta_power: Change the 6 GHz power type of the
492  * concurrent STA
493  * @ap_policy: Concurrent ap policy config
494  * @oper_ch_width: SAP current operating ch_width
495  * @psd_20mhz: PSD power(dBm/MHz) of SAP operating in 20 MHz
496  */
497 struct mlme_ap_config {
498 	qdf_freq_t user_config_sap_ch_freq;
499 #ifdef CONFIG_BAND_6GHZ
500 	bool update_required_scc_sta_power;
501 #endif
502 	enum host_concurrent_ap_policy ap_policy;
503 	enum phy_ch_width oper_ch_width;
504 	uint8_t psd_20mhz;
505 };
506 
507 /**
508  * struct roam_trigger_per - per roam trigger related information
509  * @rx_rate_thresh_percent:  percentage of lower than rx rate threshold
510  * @tx_rate_thresh_percent:  percentage of lower than tx rate threshold
511  */
512 struct roam_trigger_per {
513 	uint8_t rx_rate_thresh_percent;
514 	uint8_t tx_rate_thresh_percent;
515 };
516 
517 /**
518  * struct roam_trigger_bmiss - bmiss roam trigger related information
519  * @final_bmiss_cnt:        final beacon miss count
520  * @consecutive_bmiss_cnt:  consecutive beacon miss count
521  * @qos_null_success:       is Qos-Null tx Success: 0: success, 1:fail
522  */
523 struct roam_trigger_bmiss {
524 	uint32_t final_bmiss_cnt;
525 	uint32_t consecutive_bmiss_cnt;
526 	bool qos_null_success;
527 };
528 
529 /**
530  * struct roam_trigger_poor_rssi - low rssi roam trigger
531  * related information
532  * @current_rssi:         Connected AP rssi in dBm
533  * @roam_rssi_threshold:  rssi threshold value in dBm
534  * @rx_linkspeed_status:  rx linkspeed status, 0:good linkspeed, 1:bad
535  */
536 struct roam_trigger_poor_rssi {
537 	int8_t current_rssi;
538 	int8_t roam_rssi_threshold;
539 	bool rx_linkspeed_status;
540 };
541 
542 /**
543  * struct roam_trigger_better_rssi - high rssi roam trigger
544  * related information
545  * @current_rssi:      Connected AP rssi in dBm
546  * @hi_rssi_threshold:  roam high RSSI threshold
547  */
548 struct roam_trigger_better_rssi {
549 	int8_t current_rssi;
550 	int8_t hi_rssi_threshold;
551 };
552 
553 /**
554  * struct roam_trigger_congestion - congestion roam trigger
555  * related information
556  * @rx_tput:         RX Throughput in bytes per second in dense env
557  * @tx_tput:         TX Throughput in bytes per second in dense env
558  * @roamable_count:  roamable AP count info in dense env
559  */
560 struct roam_trigger_congestion {
561 	uint32_t rx_tput;
562 	uint32_t tx_tput;
563 	uint8_t roamable_count;
564 };
565 
566 /**
567  * struct roam_trigger_user_trigger - user roam trigger related information
568  * @invoke_reason: defined in roam_invoke_reason
569  */
570 struct roam_trigger_user_trigger {
571 	enum roam_invoke_reason invoke_reason;
572 };
573 
574 /**
575  * struct roam_trigger_background -  roam trigger related information
576  * @current_rssi:         Connected AP rssi in dBm
577  * @data_rssi:            data frame rssi in dBm
578  * @data_rssi_threshold:  data rssi threshold in dBm
579  */
580 struct roam_trigger_background {
581 	int8_t current_rssi;
582 	int8_t data_rssi;
583 	int8_t data_rssi_threshold;
584 };
585 
586 /**
587  * struct roam_trigger_btm - BTM roam trigger related information
588  * @btm_request_mode: mode values are defined in IEEE Std
589  *  802.11-2020, 9.6.13.9
590  * @disassoc_imminent_timer:     disassoc time in milliseconds
591  * @validity_internal:           Preferred candidate list validity interval in
592  *  milliseconds
593  * @candidate_list_count:        Number of preferred candidates from BTM request
594  * @btm_response_status_code:    Response status values are enumerated in
595  *  IEEE Std 802.11-2020, Table 9-428 (BTM status code definitions)
596  * @btm_bss_termination_timeout: BTM BSS termination timeout value in
597  *  milliseconds
598  * @btm_mbo_assoc_retry_timeout: BTM MBO assoc retry timeout value in
599  *  milliseconds
600  * @btm_req_dialog_token:        btm_req_dialog_token: dialog token number in
601  *  BTM request frame
602  */
603 
604 struct roam_trigger_btm {
605 	uint8_t btm_request_mode;
606 	uint32_t disassoc_imminent_timer;
607 	uint32_t validity_internal;
608 	uint8_t candidate_list_count;
609 	uint8_t btm_response_status_code;
610 	uint32_t btm_bss_termination_timeout;
611 	uint32_t btm_mbo_assoc_retry_timeout;
612 	uint8_t btm_req_dialog_token;
613 };
614 
615 /**
616  * struct roam_trigger_bss_load - BSS Load roam trigger parameters
617  * @cu_load: percentage of Connected AP channel congestion utilization
618  */
619 struct roam_trigger_bss_load {
620 	uint8_t cu_load;
621 };
622 
623 /**
624  * struct roam_trigger_disconnection - Deauth roaming trigger related
625  * parameters
626  * @deauth_type:   1- Deauthentication 2- Disassociation
627  * @deauth_reason: Status code of the Deauth/Disassoc received, Values
628  *  are enumerated in IEEE Std 802.11-2020, Table 9-49 (Reason codes).
629  */
630 struct roam_trigger_disconnection {
631 	uint8_t deauth_type;
632 	uint16_t deauth_reason;
633 };
634 
635 /**
636  * struct roam_trigger_periodic - periodic roam trigger
637  * related information
638  * @periodic_timer_ms: roam scan periodic, milliseconds
639  */
640 struct roam_trigger_periodic {
641 	uint32_t periodic_timer_ms;
642 };
643 
644 /**
645  * struct roam_trigger_tx_failures - tx failures roam trigger
646  * related information
647  * @kickout_threshold:  consecutive tx failure threshold
648  * @kickout_reason:     defined in roam_tx_failures_reason
649  */
650 struct roam_trigger_tx_failures {
651 	uint32_t kickout_threshold;
652 	enum roam_tx_failures_reason kickout_reason;
653 };
654 
655 /**
656  * union roam_trigger_condition - union of all types roam trigger info
657  * structures
658  * @roam_per: per roam trigger related information
659  * @roam_bmiss: bmiss roam trigger related information
660  * @roam_poor_rssi: low rssi roam trigger related information
661  * @roam_better_rssi: high rssi roam trigger related information
662  * @roam_congestion: congestion roam trigger related information
663  * @roam_user_trigger: user trigger roam related information
664  * @roam_btm: btm roam trigger related information
665  * @roam_bss_load: bss load roam trigger related information
666  * @roam_disconnection: disconnect roam trigger related information
667  * @roam_periodic: periodic roam trigger related information
668  * @roam_background: background roam trigger related information
669  * @roam_tx_failures: tx failures roam trigger related information
670  */
671 union roam_trigger_condition {
672 	struct roam_trigger_per roam_per;
673 	struct roam_trigger_bmiss roam_bmiss;
674 	struct roam_trigger_poor_rssi roam_poor_rssi;
675 	struct roam_trigger_better_rssi roam_better_rssi;
676 	struct roam_trigger_congestion roam_congestion;
677 	struct roam_trigger_user_trigger roam_user_trigger;
678 	struct roam_trigger_btm roam_btm;
679 	struct roam_trigger_bss_load roam_bss_load;
680 	struct roam_trigger_disconnection roam_disconnection;
681 	struct roam_trigger_periodic roam_periodic;
682 	struct roam_trigger_background roam_background;
683 	struct roam_trigger_tx_failures roam_tx_failures;
684 };
685 
686 /**
687  * struct roam_trigger_abort_reason - roam abort related information
688  * @abort_reason_code:    detail in roam_abort_reason
689  * @data_rssi:            data rssi in dBm
690  * @data_rssi_threshold:  data rssi threshold in dBm
691  * @rx_linkspeed_status:  rx linkspeed status, 0:good linkspeed, 1:bad
692  */
693 struct roam_trigger_abort_reason {
694 	enum roam_abort_reason abort_reason_code;
695 	int8_t data_rssi;
696 	int8_t data_rssi_threshold;
697 	bool rx_linkspeed_status;
698 };
699 
700 /**
701  * struct eroam_trigger_info - roam trigger related information
702  * @timestamp: timestamp of roaming start
703  * @trigger_reason: roam trigger reason, enum in roam_trigger_reason
704  * @condition: roam trigger detail information
705  * @abort: roam abort related information
706  * @roam_scan_type: roam scan type, enum in roam_stats_scan_type
707  * @roam_status: roam result, 0 - Roaming is success, 1 - Roaming is failed
708  * @roam_fail_reason: roam fail reason, enum in wlan_roam_failure_reason_code
709  */
710 struct eroam_trigger_info {
711 	uint64_t timestamp;
712 	uint32_t trigger_reason;
713 	union roam_trigger_condition condition;
714 	struct roam_trigger_abort_reason abort;
715 	enum roam_stats_scan_type roam_scan_type;
716 	uint8_t roam_status;
717 	enum wlan_roam_failure_reason_code roam_fail_reason;
718 };
719 
720 /**
721  * struct roam_scan_chn - each roam scan channel information
722  * @chan_freq: roam scan channel frequency(MHz)
723  * @dwell_type: indicate channel dwell type, enum in roam_scan_dwell_type
724  * @max_dwell_time: max dwell time of each channel
725  */
726 struct roam_scan_chn {
727 	uint16_t chan_freq;
728 	enum roam_scan_dwell_type dwell_type;
729 	uint32_t max_dwell_time;
730 };
731 
732 /**
733  * struct eroam_scan_info - all roam scan channel related information
734  * @num_channels: total number of channels scanned during roam scan
735  * @roam_chn: each roam scan channel information
736  * @total_scan_time: total scan time of all roam channel
737  * @original_bssid: connected AP before roam happens, regardless of
738  *  the roam resulting in success or failure.
739  *  For non-MLO scenario, it indicates the original connected AP BSSID.
740  *  For MLO scenario, it indicates the original BSSID of the link
741  *  for which the reassociation occurred during the roam.
742  * @roamed_bssid: roamed AP BSSID when roam succeeds.
743  *  For non-MLO case, it indicates new AP BSSID which has been
744  *  successfully roamed.
745  *  For MLO case, it indicates the new AP BSSID of the link on
746  *  which the reassociation occurred during the roam.
747  */
748 struct eroam_scan_info {
749 	uint8_t num_channels;
750 	struct roam_scan_chn roam_chn[MAX_ROAM_SCAN_CHAN];
751 	uint32_t total_scan_time;
752 	struct qdf_mac_addr original_bssid;
753 	struct qdf_mac_addr roamed_bssid;
754 };
755 
756 /**
757  * struct eroam_frame_info - frame information during roaming
758  * @frame_type: frame subtype defined in eroam_frame_subtype
759  * @status: frame status defined in eroam_roam_status
760  * @timestamp: timestamp of the auth/assoc/eapol-M1/M2/M3/M4 frame,
761  *  if status is successful, indicate received or send success,
762  *  if status is failed, timestamp indicate roaming fail at that time
763  * @bssid: Source address for auth/assoc/eapol frame.
764  */
765 struct eroam_frame_info {
766 	enum eroam_frame_subtype frame_type;
767 	enum eroam_frame_status status;
768 	uint64_t timestamp;
769 	struct qdf_mac_addr bssid;
770 
771 };
772 
773 /**
774  * struct enhance_roam_info - enhance roam information
775  * @trigger: roam trigger information
776  * @scan: roam scan information
777  * @timestamp: types of frame information during roaming
778  */
779 struct enhance_roam_info {
780 	struct eroam_trigger_info trigger;
781 	struct eroam_scan_info scan;
782 	struct eroam_frame_info timestamp[WLAN_ROAM_MAX_FRAME_INFO];
783 };
784 
785 /**
786  * struct mlme_legacy_priv - VDEV MLME legacy priv object
787  * @chan_switch_in_progress: flag to indicate that channel switch is in progress
788  * @hidden_ssid_restart_in_progress: flag to indicate hidden ssid restart is
789  *                                   in progress
790  * @vdev_start_failed: flag to indicate that vdev start failed.
791  * @connection_fail: flag to indicate connection failed
792  * @cac_required_for_new_channel: if CAC is required for new channel
793  * @follow_ap_edca: if true, it is forced to follow the AP's edca.
794  * @reconn_after_assoc_timeout: reconnect to the same AP if association timeout
795  * @assoc_type: vdev associate/reassociate type
796  * @dynamic_cfg: current configuration of nss, chains for vdev.
797  * @ini_cfg: Max configuration of nss, chains supported for vdev.
798  * @sta_dynamic_oce_value: Dynamic oce flags value for sta
799  * @disconnect_info: Disconnection information
800  * @vdev_stop_type: vdev stop type request
801  * @mlme_roam: Roam offload state
802  * @cm_roam: Roaming configuration
803  * @auth_log: Cached log records for SAE authentication frame
804  * related information.
805  * @roam_info: enhanced roam information include trigger, scan and
806  *  frame information.
807  * @roam_cache_num: number of roam information cached in driver
808  * @roam_write_index: indicate current write position of ring buffer
809  * @roam_rd_wr_lock: protect roam buffer write and read
810  * @bigtk_vdev_support: BIGTK feature support for this vdev (SAP)
811  * @sae_retry: SAE auth retry information
812  * @roam_reason_better_ap: roam due to better AP found
813  * @hb_failure_rssi: heartbeat failure AP RSSI
814  * @opr_rate_set: operational rates set
815  * @ext_opr_rate_set: extended operational rates set
816  * @mcs_rate_set: MCS Based rates set
817  * @mscs_req_info: Information related to mscs request
818  * @he_config: he config
819  * @he_sta_obsspd: he_sta_obsspd
820  * @twt_wait_for_notify: TWT session teardown received, wait for
821  * notify event from firmware before next TWT setup is done.
822  * @rso_cfg: per vdev RSO config to be sent to FW
823  * @connect_info: mlme connect information
824  * @wait_key_timer: wait key timer
825  * @eht_config: Eht capability configuration
826  * @last_delba_sent_time: Last delba sent time to handle back to back delba
827  *			  requests from some IOT APs
828  * @ba_2k_jump_iot_ap: This is set to true if connected to the ba 2k jump IOT AP
829  * @is_usr_ps_enabled: Is Power save enabled
830  * @notify_co_located_ap_upt_rnr: Notify co located AP to update RNR or not
831  * @is_user_std_set: true if user set the @wifi_std
832  * @wifi_std: wifi standard version
833  * @max_mcs_index: Max supported mcs index of vdev
834  * @vdev_traffic_type: to set if vdev is LOW_LATENCY or HIGH_TPUT
835  * @country_ie_for_all_band: take all band channel info in country ie
836  * @mlme_ap: SAP related vdev private configurations
837  * @is_single_link_mlo_roam: Single link mlo roam flag
838  * @bss_color_change_wakelock: wakelock to complete bss color change
839  *				operation on bss color collision detection
840  * @bss_color_change_runtime_lock: runtime lock to complete bss color change
841  * @disconnect_runtime_lock: runtime lock to complete disconnection
842  * @keep_alive_period: KEEPALIVE period in seconds
843  */
844 struct mlme_legacy_priv {
845 	bool chan_switch_in_progress;
846 	bool hidden_ssid_restart_in_progress;
847 	bool vdev_start_failed;
848 	bool connection_fail;
849 	bool cac_required_for_new_channel;
850 	bool follow_ap_edca;
851 	bool reconn_after_assoc_timeout;
852 	enum vdev_assoc_type assoc_type;
853 	struct wlan_mlme_nss_chains dynamic_cfg;
854 	struct wlan_mlme_nss_chains ini_cfg;
855 	uint8_t sta_dynamic_oce_value;
856 	struct wlan_disconnect_info disconnect_info;
857 	uint32_t vdev_stop_type;
858 	struct wlan_mlme_roam mlme_roam;
859 	struct wlan_cm_roam cm_roam;
860 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && \
861 		defined(WLAN_FEATURE_CONNECTIVITY_LOGGING)
862 	struct wlan_log_record
863 	    auth_log[MAX_ROAM_CANDIDATE_AP][WLAN_ROAM_MAX_CACHED_AUTH_FRAMES];
864 #elif defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(CONNECTIVITY_DIAG_EVENT)
865 	struct wlan_diag_packet_info
866 	    auth_log[MAX_ROAM_CANDIDATE_AP][WLAN_ROAM_MAX_CACHED_AUTH_FRAMES];
867 #endif
868 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
869 #ifdef WLAN_FEATURE_ROAM_INFO_STATS
870 	struct enhance_roam_info *roam_info;
871 	uint32_t roam_cache_num;
872 	uint32_t roam_write_index;
873 	qdf_mutex_t roam_rd_wr_lock;
874 #endif
875 #endif
876 	bool bigtk_vdev_support;
877 	struct sae_auth_retry sae_retry;
878 	bool roam_reason_better_ap;
879 	uint32_t hb_failure_rssi;
880 	struct mlme_cfg_str opr_rate_set;
881 	struct mlme_cfg_str ext_opr_rate_set;
882 	struct mlme_cfg_str mcs_rate_set;
883 	bool twt_wait_for_notify;
884 #ifdef WLAN_FEATURE_MSCS
885 	struct mscs_req_info mscs_req_info;
886 #endif
887 #ifdef WLAN_FEATURE_11AX
888 	tDot11fIEhe_cap he_config;
889 	uint32_t he_sta_obsspd;
890 #endif
891 	struct mlme_connect_info connect_info;
892 	struct wait_for_key_timer wait_key_timer;
893 #ifdef WLAN_FEATURE_11BE
894 	tDot11fIEeht_cap eht_config;
895 #endif
896 	qdf_time_t last_delba_sent_time;
897 	bool ba_2k_jump_iot_ap;
898 	bool is_usr_ps_enabled;
899 	bool notify_co_located_ap_upt_rnr;
900 	bool is_user_std_set;
901 	WMI_HOST_WIFI_STANDARD wifi_std;
902 #ifdef WLAN_FEATURE_SON
903 	uint8_t max_mcs_index;
904 #endif
905 	uint8_t vdev_traffic_type;
906 	bool country_ie_for_all_band;
907 	struct mlme_ap_config mlme_ap;
908 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
909 	bool is_single_link_mlo_roam;
910 #endif
911 	qdf_wake_lock_t bss_color_change_wakelock;
912 	qdf_runtime_lock_t bss_color_change_runtime_lock;
913 	qdf_runtime_lock_t disconnect_runtime_lock;
914 	enum reg_6g_ap_type best_6g_power_type;
915 	uint16_t keep_alive_period;
916 };
917 
918 /**
919  * struct del_bss_resp - params required for del bss response
920  * @status: QDF status
921  * @vdev_id: vdev_id
922  */
923 struct del_bss_resp {
924 	QDF_STATUS status;
925 	uint8_t vdev_id;
926 };
927 
928 /**
929  * mlme_init_rate_config() - initialize rate configuration of vdev
930  * @vdev_mlme: pointer to vdev mlme object
931  *
932  * Return: Success or Failure status
933  */
934 QDF_STATUS mlme_init_rate_config(struct vdev_mlme_obj *vdev_mlme);
935 
936 /**
937  * mlme_init_connect_chan_info_config() - initialize channel info for a
938  * connection
939  * @vdev_mlme: pointer to vdev mlme object
940  *
941  * Return: Success or Failure status
942  */
943 QDF_STATUS mlme_init_connect_chan_info_config(struct vdev_mlme_obj *vdev_mlme);
944 
945 /**
946  * mlme_get_peer_mic_len() - get mic hdr len and mic length for peer
947  * @psoc: psoc
948  * @pdev_id: pdev id for the peer
949  * @peer_mac: peer mac
950  * @mic_len: mic length for peer
951  * @mic_hdr_len: mic header length for peer
952  *
953  * Return: Success or Failure status
954  */
955 QDF_STATUS mlme_get_peer_mic_len(struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
956 				 uint8_t *peer_mac, uint8_t *mic_len,
957 				 uint8_t *mic_hdr_len);
958 
959 /**
960  * mlme_peer_object_created_notification(): mlme peer create handler
961  * @peer: peer which is going to created by objmgr
962  * @arg: argument for vdev create handler
963  *
964  * Register this api with objmgr to detect peer is created
965  *
966  * Return: QDF_STATUS status in case of success else return error
967  */
968 
969 QDF_STATUS
970 mlme_peer_object_created_notification(struct wlan_objmgr_peer *peer,
971 				      void *arg);
972 
973 /**
974  * mlme_peer_object_destroyed_notification(): mlme peer delete handler
975  * @peer: peer which is going to delete by objmgr
976  * @arg: argument for vdev delete handler
977  *
978  * Register this api with objmgr to detect peer is deleted
979  *
980  * Return: QDF_STATUS status in case of success else return error
981  */
982 QDF_STATUS
983 mlme_peer_object_destroyed_notification(struct wlan_objmgr_peer *peer,
984 					void *arg);
985 
986 /**
987  * mlme_get_dynamic_oce_flags(): mlme get dynamic oce flags
988  * @vdev: pointer to vdev object
989  *
990  * This api is used to get the dynamic oce flags pointer
991  *
992  * Return: QDF_STATUS status in case of success else return error
993  */
994 uint8_t *mlme_get_dynamic_oce_flags(struct wlan_objmgr_vdev *vdev);
995 
996 /**
997  * mlme_get_dynamic_vdev_config() - get the vdev dynamic config params
998  * @vdev: vdev pointer
999  *
1000  * Return: pointer to the dynamic vdev config structure
1001  */
1002 struct wlan_mlme_nss_chains *mlme_get_dynamic_vdev_config(
1003 					struct wlan_objmgr_vdev *vdev);
1004 
1005 /**
1006  * mlme_get_vdev_he_ops()  - Get vdev HE operations IE info
1007  * @psoc: Pointer to PSOC object
1008  * @vdev_id: vdev id
1009  *
1010  * Return: HE ops IE
1011  */
1012 uint32_t mlme_get_vdev_he_ops(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
1013 
1014 /**
1015  * mlme_connected_chan_stats_request() - process connected channel stats
1016  * request
1017  * @psoc: pointer to psoc object
1018  * @vdev_id: Vdev id
1019  *
1020  * Return: QDF_STATUS
1021  */
1022 QDF_STATUS mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc,
1023 					     uint8_t vdev_id);
1024 
1025 /**
1026  * mlme_get_ini_vdev_config() - get the vdev ini config params
1027  * @vdev: vdev pointer
1028  *
1029  * Return: pointer to the ini vdev config structure
1030  */
1031 struct wlan_mlme_nss_chains *mlme_get_ini_vdev_config(
1032 					struct wlan_objmgr_vdev *vdev);
1033 
1034 /**
1035  * mlme_cfg_on_psoc_enable() - Populate MLME structure from CFG and INI
1036  * @psoc: pointer to the psoc object
1037  *
1038  * Populate the MLME CFG structure from CFG and INI values using CFG APIs
1039  *
1040  * Return: QDF_STATUS
1041  */
1042 QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc);
1043 
1044 /**
1045  * mlme_get_psoc_ext_obj() - Get MLME object from psoc
1046  * @psoc: pointer to the psoc object
1047  *
1048  * Get the MLME object pointer from the psoc
1049  *
1050  * Return: pointer to MLME object
1051  */
1052 #define mlme_get_psoc_ext_obj(psoc) \
1053 			mlme_get_psoc_ext_obj_fl(psoc, __func__, __LINE__)
1054 struct wlan_mlme_psoc_ext_obj *mlme_get_psoc_ext_obj_fl(struct wlan_objmgr_psoc
1055 							*psoc,
1056 							const char *func,
1057 							uint32_t line);
1058 
1059 /**
1060  * mlme_get_sae_auth_retry() - Get sae_auth_retry pointer
1061  * @vdev: vdev pointer
1062  *
1063  * Return: Pointer to struct sae_auth_retry or NULL
1064  */
1065 struct sae_auth_retry *mlme_get_sae_auth_retry(struct wlan_objmgr_vdev *vdev);
1066 
1067 /**
1068  * mlme_free_sae_auth_retry() - Free the SAE auth info
1069  * @vdev: vdev pointer
1070  *
1071  * Return: None
1072  */
1073 void mlme_free_sae_auth_retry(struct wlan_objmgr_vdev *vdev);
1074 
1075 /**
1076  * mlme_set_self_disconnect_ies() - Set diconnect IEs configured from userspace
1077  * @vdev: vdev pointer
1078  * @ie: pointer for disconnect IEs
1079  *
1080  * Return: None
1081  */
1082 void mlme_set_self_disconnect_ies(struct wlan_objmgr_vdev *vdev,
1083 				  struct element_info *ie);
1084 
1085 /**
1086  * mlme_free_self_disconnect_ies() - Free the self diconnect IEs
1087  * @vdev: vdev pointer
1088  *
1089  * Return: None
1090  */
1091 void mlme_free_self_disconnect_ies(struct wlan_objmgr_vdev *vdev);
1092 
1093 /**
1094  * mlme_get_self_disconnect_ies() - Get diconnect IEs from vdev object
1095  * @vdev: vdev pointer
1096  *
1097  * Return: Returns a pointer to the self disconnect IEs present in vdev object
1098  */
1099 struct element_info *mlme_get_self_disconnect_ies(struct wlan_objmgr_vdev *vdev);
1100 
1101 /**
1102  * mlme_set_peer_disconnect_ies() - Cache disconnect IEs received from peer
1103  * @vdev: vdev pointer
1104  * @ie: pointer for disconnect IEs
1105  *
1106  * Return: None
1107  */
1108 void mlme_set_peer_disconnect_ies(struct wlan_objmgr_vdev *vdev,
1109 				  struct element_info *ie);
1110 
1111 /**
1112  * mlme_free_peer_disconnect_ies() - Free the peer diconnect IEs
1113  * @vdev: vdev pointer
1114  *
1115  * Return: None
1116  */
1117 void mlme_free_peer_disconnect_ies(struct wlan_objmgr_vdev *vdev);
1118 
1119 /**
1120  * mlme_set_follow_ap_edca_flag() - Set follow ap's edca flag
1121  * @vdev: vdev pointer
1122  * @flag: carries if following ap's edca is true or not.
1123  *
1124  * Return: None
1125  */
1126 void mlme_set_follow_ap_edca_flag(struct wlan_objmgr_vdev *vdev, bool flag);
1127 
1128 /**
1129  * mlme_get_follow_ap_edca_flag() - Get follow ap's edca flag
1130  * @vdev: vdev pointer
1131  *
1132  * Return: value of follow_ap_edca
1133  */
1134 bool mlme_get_follow_ap_edca_flag(struct wlan_objmgr_vdev *vdev);
1135 
1136 /**
1137  * mlme_set_best_6g_power_type() - Set best 6g power type
1138  * @vdev: vdev pointer
1139  * @best_6g_power_type: best 6g power type
1140  *
1141  * Return: None
1142  */
1143 void mlme_set_best_6g_power_type(struct wlan_objmgr_vdev *vdev,
1144 				 enum reg_6g_ap_type best_6g_power_type);
1145 
1146 /**
1147  * mlme_get_best_6g_power_type() - Get best 6g power type
1148  * @vdev: vdev pointer
1149  *
1150  * Return: value of best 6g power type
1151  */
1152 enum reg_6g_ap_type mlme_get_best_6g_power_type(struct wlan_objmgr_vdev *vdev);
1153 
1154 /**
1155  * mlme_set_reconn_after_assoc_timeout_flag() - Set reconn after assoc timeout
1156  * flag
1157  * @psoc: soc object
1158  * @vdev_id: vdev id
1159  * @flag: enable or disable reconnect
1160  *
1161  * Return: void
1162  */
1163 void mlme_set_reconn_after_assoc_timeout_flag(struct wlan_objmgr_psoc *psoc,
1164 					      uint8_t vdev_id, bool flag);
1165 
1166 /**
1167  * mlme_get_reconn_after_assoc_timeout_flag() - Get reconn after assoc timeout
1168  * flag
1169  * @psoc: soc object
1170  * @vdev_id: vdev id
1171  *
1172  * Return: true for enabling reconnect, otherwise false
1173  */
1174 bool mlme_get_reconn_after_assoc_timeout_flag(struct wlan_objmgr_psoc *psoc,
1175 					      uint8_t vdev_id);
1176 
1177 /**
1178  * mlme_get_peer_disconnect_ies() - Get diconnect IEs from vdev object
1179  * @vdev: vdev pointer
1180  *
1181  * Return: Returns a pointer to the peer disconnect IEs present in vdev object
1182  */
1183 struct element_info *mlme_get_peer_disconnect_ies(struct wlan_objmgr_vdev *vdev);
1184 
1185 /**
1186  * mlme_free_peer_assoc_rsp_ie() - Free the peer Assoc resp IE
1187  * @peer_priv: Peer priv object
1188  *
1189  * Return: None
1190  */
1191 void mlme_free_peer_assoc_rsp_ie(struct peer_mlme_priv_obj *peer_priv);
1192 
1193 /**
1194  * mlme_set_peer_assoc_rsp_ie() - Cache Assoc resp IE send to peer
1195  * @psoc: soc object
1196  * @peer_addr: Mac address of requesting peer
1197  * @ie: pointer for assoc resp IEs
1198  *
1199  * Return: None
1200  */
1201 void mlme_set_peer_assoc_rsp_ie(struct wlan_objmgr_psoc *psoc,
1202 				uint8_t *peer_addr, struct element_info *ie);
1203 
1204 /**
1205  * mlme_set_peer_pmf_status() - set pmf status of peer
1206  * @peer: PEER object
1207  * @is_pmf_enabled: Carries if PMF is enabled or not
1208  *
1209  * is_pmf_enabled will be set to true if PMF is enabled by peer
1210  *
1211  * Return: void
1212  */
1213 void mlme_set_peer_pmf_status(struct wlan_objmgr_peer *peer,
1214 			      bool is_pmf_enabled);
1215 /**
1216  * mlme_get_peer_pmf_status() - get if peer is of pmf capable
1217  * @peer: PEER object
1218  *
1219  * Return: Value of is_pmf_enabled; True if PMF is enabled by peer
1220  */
1221 bool mlme_get_peer_pmf_status(struct wlan_objmgr_peer *peer);
1222 
1223 /**
1224  * wlan_get_opmode_from_vdev_id() - Get opmode from vdevid
1225  * @pdev: pdev pointer
1226  * @vdev_id: vdev id
1227  *
1228  * Return: opmode
1229  */
1230 enum QDF_OPMODE wlan_get_opmode_from_vdev_id(struct wlan_objmgr_pdev *pdev,
1231 					     uint8_t vdev_id);
1232 
1233 /**
1234  * wlan_mlme_get_bssid_vdev_id() - get bss peer mac address(BSSID) using vdev id
1235  * @pdev: pdev
1236  * @vdev_id: vdev_id
1237  * @bss_peer_mac: pointer to bss_peer_mac_address
1238  *
1239  * This API is used to get mac address of bss peer/bssid.
1240  *
1241  * Context: Any context.
1242  *
1243  * Return: QDF_STATUS based on overall success
1244  */
1245 QDF_STATUS wlan_mlme_get_bssid_vdev_id(struct wlan_objmgr_pdev *pdev,
1246 				       uint8_t vdev_id,
1247 				       struct qdf_mac_addr *bss_peer_mac);
1248 
1249 /**
1250  * mlme_update_freq_in_scan_start_req() - Fill frequencies in wide
1251  * band scan req for mlo connection
1252  * @vdev: vdev common object
1253  * @req: pointer to scan request
1254  * @scan_ch_width: Channel width for which to trigger a wide band scan
1255  * @scan_freq: frequency for which to trigger a wide band RRM scan
1256  * @cen320_freq: 320 MHz center freq
1257  *
1258  * Return: QDF_STATUS
1259  */
1260 QDF_STATUS
1261 mlme_update_freq_in_scan_start_req(struct wlan_objmgr_vdev *vdev,
1262 				   struct scan_start_request *req,
1263 				   enum phy_ch_width scan_ch_width,
1264 				   qdf_freq_t scan_freq,
1265 				   qdf_freq_t cen320_freq);
1266 
1267 /**
1268  * wlan_get_operation_chan_freq() - get operating chan freq of
1269  * given vdev
1270  * @vdev: vdev
1271  *
1272  * Return: chan freq of given vdev id
1273  */
1274 qdf_freq_t wlan_get_operation_chan_freq(struct wlan_objmgr_vdev *vdev);
1275 
1276 /**
1277  * wlan_get_operation_chan_freq_vdev_id() - get operating chan freq of
1278  * given vdev id
1279  * @pdev: Pointer to pdev
1280  * @vdev_id: vdev id
1281  *
1282  * Return: chan freq of given vdev id
1283  */
1284 qdf_freq_t wlan_get_operation_chan_freq_vdev_id(struct wlan_objmgr_pdev *pdev,
1285 						uint8_t vdev_id);
1286 
1287 /**
1288  * wlan_vdev_set_dot11mode - Set the dot11mode of the vdev
1289  * @mac_mlme_cfg: MAC's MLME config pointer
1290  * @device_mode: OPMODE of the vdev
1291  * @vdev_mlme: MLME component of the vdev
1292  *
1293  * Use this API to set the dot11mode of the vdev.
1294  * For non-ML type vdev, this API restricts the connection
1295  * of vdev to 11ax on 11be capable operation.
1296  *
1297  * Return: void
1298  */
1299 void wlan_vdev_set_dot11mode(struct wlan_mlme_cfg *mac_mlme_cfg,
1300 			     enum QDF_OPMODE device_mode,
1301 			     struct vdev_mlme_obj *vdev_mlme);
1302 
1303 /**
1304  * wlan_is_open_wep_cipher() - check if cipher is open or WEP
1305  * @pdev: Pointer to pdev
1306  * @vdev_id: vdev id
1307  *
1308  * Return: if cipher is open or WEP
1309  */
1310 bool wlan_is_open_wep_cipher(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
1311 
1312 /**
1313  * wlan_vdev_id_is_open_cipher() - check if cipher is open
1314  * @pdev: Pointer to pdev
1315  * @vdev_id: vdev id
1316  *
1317  * Return: if cipher is open
1318  */
1319 bool wlan_vdev_id_is_open_cipher(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
1320 
1321 /**
1322  * wlan_vdev_is_open_mode() - check if cipher is open
1323  * @vdev: Pointer to vdev
1324  *
1325  * Return: if cipher is open
1326  */
1327 bool wlan_vdev_is_open_mode(struct wlan_objmgr_vdev *vdev);
1328 
1329 /**
1330  * wlan_vdev_id_is_11n_allowed() - check if 11n allowed
1331  * @pdev: Pointer to pdev
1332  * @vdev_id: vdev id
1333  *
1334  * Return: false if cipher is TKIP or WEP
1335  */
1336 bool wlan_vdev_id_is_11n_allowed(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
1337 
1338 /**
1339  * wlan_is_vdev_id_up() - check if vdev id is in UP state
1340  * @pdev: Pointer to pdev
1341  * @vdev_id: vdev id
1342  *
1343  * Return: if vdev is up
1344  */
1345 bool wlan_is_vdev_id_up(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
1346 
1347 QDF_STATUS
1348 wlan_get_op_chan_freq_info_vdev_id(struct wlan_objmgr_pdev *pdev,
1349 				   uint8_t vdev_id, qdf_freq_t *op_freq,
1350 				   qdf_freq_t *freq_seg_0,
1351 				   enum phy_ch_width *ch_width);
1352 
1353 /**
1354  * wlan_strip_ie() - strip requested IE from IE buffer
1355  * @addn_ie: Additional IE buffer
1356  * @addn_ielen: Length of additional IE
1357  * @eid: EID of IE to strip
1358  * @size_of_len_field: length of IE length field
1359  * @oui: if present matches OUI also
1360  * @oui_length: if previous present, this is length of oui
1361  * @extracted_ie: if not NULL, copy the stripped IE to this buffer
1362  * @eid_max_len: maximum length of IE @eid
1363  *
1364  * This utility function is used to strip of the requested IE if present
1365  * in IE buffer.
1366  *
1367  * Return: QDF_STATUS
1368  */
1369 QDF_STATUS wlan_strip_ie(uint8_t *addn_ie, uint16_t *addn_ielen,
1370 			 uint8_t eid, enum size_of_len_field size_of_len_field,
1371 			 uint8_t *oui, uint8_t oui_length,
1372 			 uint8_t *extracted_ie, uint32_t eid_max_len);
1373 
1374 /**
1375  * wlan_is_channel_present_in_list() - check if rfeq is present in the list
1376  * given vdev id
1377  * @freq_lst: given freq list
1378  * @num_chan: num of chan freq
1379  * @chan_freq: chan freq to check
1380  *
1381  * Return: chan freq of given vdev id
1382  */
1383 bool wlan_is_channel_present_in_list(qdf_freq_t *freq_lst,
1384 				     uint32_t num_chan, qdf_freq_t chan_freq);
1385 
1386 /**
1387  * wlan_roam_is_channel_valid() - validate channel frequency
1388  * @reg: regulatory context
1389  * @chan_freq: channel frequency
1390  *
1391  * This function validates channel frequency present in valid channel
1392  * list or not.
1393  *
1394  * Return: true or false
1395  */
1396 bool wlan_roam_is_channel_valid(struct wlan_mlme_reg *reg,
1397 				qdf_freq_t chan_freq);
1398 
1399 int8_t wlan_get_cfg_max_tx_power(struct wlan_objmgr_psoc *psoc,
1400 				 struct wlan_objmgr_pdev *pdev,
1401 				 uint32_t ch_freq);
1402 
1403 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
1404 /**
1405  * mlme_get_supplicant_disabled_roaming() - Get supplicant disabled roaming
1406  *  value for a given vdev.
1407  * @psoc: PSOC pointer
1408  * @vdev_id: Vdev for which the supplicant disabled roaming value is being
1409  *  requested
1410  *
1411  * Return: True if supplicant disabled roaming else false
1412  */
1413 bool
1414 mlme_get_supplicant_disabled_roaming(struct wlan_objmgr_psoc *psoc,
1415 				     uint8_t vdev_id);
1416 
1417 /**
1418  * mlme_set_supplicant_disabled_roaming - Set the supplicant disabled
1419  *  roaming flag.
1420  * @psoc: PSOC pointer
1421  * @vdev_id: Vdev for which the supplicant disabled roaming needs to
1422  *  be set
1423  * @val: value true is to disable RSO and false to enable RSO
1424  *
1425  * Return: None
1426  */
1427 void mlme_set_supplicant_disabled_roaming(struct wlan_objmgr_psoc *psoc,
1428 					  uint8_t vdev_id, bool val);
1429 
1430 /**
1431  * mlme_get_roam_trigger_bitmap() - Get roaming trigger bitmap value for a given
1432  *  vdev.
1433  * @psoc: PSOC pointer
1434  * @vdev_id: Vdev for which the roam trigger bitmap is being requested
1435  *
1436  * Return: roaming trigger bitmap
1437  */
1438 uint32_t
1439 mlme_get_roam_trigger_bitmap(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
1440 
1441 /**
1442  * mlme_set_roam_trigger_bitmap() - Set the roaming trigger bitmap value for
1443  *  the given vdev. If the bitmap is zero then roaming is completely disabled
1444  *  on the vdev which means roam structure in firmware is not allocated and no
1445  *  RSO start/stop commands can be sent
1446  * @psoc: PSOC pointer
1447  * @vdev_id: Vdev for which the roam trigger bitmap is to be set
1448  * @val: bitmap value to set
1449  *
1450  * Return: None
1451  */
1452 void mlme_set_roam_trigger_bitmap(struct wlan_objmgr_psoc *psoc,
1453 				  uint8_t vdev_id, uint32_t val);
1454 
1455 /**
1456  * mlme_get_roam_state() - Get roam state from vdev object
1457  * @psoc: psoc pointer
1458  * @vdev_id: vdev id
1459  *
1460  * Return: Returns roam offload state
1461  */
1462 enum roam_offload_state
1463 mlme_get_roam_state(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
1464 
1465 /**
1466  * mlme_set_roam_state() - Set roam state in vdev object
1467  * @psoc: psoc pointer
1468  * @vdev_id: vdev id
1469  * @val: roam offload state
1470  *
1471  * Return: None
1472  */
1473 void mlme_set_roam_state(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1474 			 enum roam_offload_state val);
1475 
1476 /**
1477  * mlme_get_operations_bitmap() - Get the mlme operations bitmap which
1478  *  contains the bitmap of mlme operations which have disabled roaming
1479  *  temporarily
1480  * @psoc: PSOC pointer
1481  * @vdev_id: vdev for which the mlme operation bitmap is requested
1482  *
1483  * Return: bitmap value
1484  */
1485 uint8_t
1486 mlme_get_operations_bitmap(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
1487 
1488 /**
1489  * mlme_set_operations_bitmap() - Set the mlme operations bitmap which
1490  *  indicates what mlme operations are in progress
1491  * @psoc: PSOC pointer
1492  * @vdev_id: vdev for which the mlme operation bitmap is requested
1493  * @reqs: RSO stop requestor
1494  * @clear: clear bit if true else set bit
1495  *
1496  * Return: None
1497  */
1498 void
1499 mlme_set_operations_bitmap(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1500 			   enum wlan_cm_rso_control_requestor reqs, bool clear);
1501 /**
1502  * mlme_clear_operations_bitmap() - Clear mlme operations bitmap which
1503  *  indicates what mlme operations are in progress
1504  * @psoc: PSOC pointer
1505  * @vdev_id: vdev for which the mlme operation bitmap is requested
1506  *
1507  * Return: None
1508  */
1509 void
1510 mlme_clear_operations_bitmap(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
1511 
1512 /**
1513  * mlme_get_cfg_wlm_level() - Get the WLM level value
1514  * @psoc: pointer to psoc object
1515  * @level: level that needs to be filled.
1516  *
1517  * Return: QDF Status
1518  */
1519 QDF_STATUS mlme_get_cfg_wlm_level(struct wlan_objmgr_psoc *psoc,
1520 				  uint8_t *level);
1521 
1522 #ifdef MULTI_CLIENT_LL_SUPPORT
1523 /**
1524  * mlme_get_cfg_multi_client_ll_ini_support() - Get the ini value of wlm multi
1525  * client latency level feature
1526  * @psoc: pointer to psoc object
1527  * @multi_client_ll_support: parameter that needs to be filled.
1528  *
1529  * Return: QDF Status
1530  */
1531 QDF_STATUS
1532 mlme_get_cfg_multi_client_ll_ini_support(struct wlan_objmgr_psoc *psoc,
1533 					 bool *multi_client_ll_support);
1534 #else
1535 static inline QDF_STATUS
mlme_get_cfg_multi_client_ll_ini_support(struct wlan_objmgr_psoc * psoc,bool * multi_client_ll_support)1536 mlme_get_cfg_multi_client_ll_ini_support(struct wlan_objmgr_psoc *psoc,
1537 					 bool *multi_client_ll_support)
1538 {
1539 	return QDF_STATUS_E_FAILURE;
1540 }
1541 #endif
1542 
1543 /**
1544  * mlme_get_cfg_wlm_reset() - Get the WLM reset flag
1545  * @psoc: pointer to psoc object
1546  * @reset: reset that needs to be filled.
1547  *
1548  * Return: QDF Status
1549  */
1550 QDF_STATUS mlme_get_cfg_wlm_reset(struct wlan_objmgr_psoc *psoc,
1551 				  bool *reset);
1552 
1553 #define MLME_IS_ROAM_STATE_RSO_ENABLED(psoc, vdev_id) \
1554 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAM_RSO_ENABLED)
1555 
1556 #define MLME_IS_ROAM_STATE_DEINIT(psoc, vdev_id) \
1557 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAM_DEINIT)
1558 
1559 #define MLME_IS_ROAM_STATE_INIT(psoc, vdev_id) \
1560 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAM_INIT)
1561 
1562 #define MLME_IS_ROAM_STATE_STOPPED(psoc, vdev_id) \
1563 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAM_RSO_STOPPED)
1564 
1565 #define MLME_IS_ROAM_INITIALIZED(psoc, vdev_id) \
1566 	(mlme_get_roam_state(psoc, vdev_id) >= WLAN_ROAM_INIT)
1567 #endif
1568 
1569 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1570 #define MLME_IS_ROAMING_IN_PROG(psoc, vdev_id) \
1571 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAMING_IN_PROG)
1572 
1573 #define MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) \
1574 	(mlme_get_roam_state(psoc, vdev_id) == WLAN_ROAM_SYNCH_IN_PROG)
1575 
1576 #else
1577 #define MLME_IS_ROAMING_IN_PROG(psoc, vdev_id) (false)
1578 #define MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) (false)
1579 #endif
1580 
1581 #if defined (WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
1582 #define MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) \
1583 		(mlme_get_roam_state(psoc, vdev_id) == WLAN_MLO_ROAM_SYNCH_IN_PROG)
1584 #else
1585 #define MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) (false)
1586 #endif
1587 
1588 /**
1589  * mlme_reinit_control_config_lfr_params() - Reinitialize roam control config
1590  * @psoc: PSOC pointer
1591  * @lfr: Pointer of an lfr_cfg buffer to fill.
1592  *
1593  * Reinitialize/restore the param related control roam config lfr params with
1594  * default values of corresponding ini params.
1595  *
1596  * Return: None
1597  */
1598 void mlme_reinit_control_config_lfr_params(struct wlan_objmgr_psoc *psoc,
1599 					   struct wlan_mlme_lfr_cfg *lfr);
1600 
1601 /**
1602  * wlan_mlme_get_mac_vdev_id() - get vdev self mac address using vdev id
1603  * @pdev: pdev
1604  * @vdev_id: vdev_id
1605  * @self_mac: pointer to self_mac_address
1606  *
1607  * This API is used to get self mac address.
1608  *
1609  * Context: Any context.
1610  *
1611  * Return: QDF_STATUS based on overall success
1612  */
1613 QDF_STATUS wlan_mlme_get_mac_vdev_id(struct wlan_objmgr_pdev *pdev,
1614 				     uint8_t vdev_id,
1615 				     struct qdf_mac_addr *self_mac);
1616 
1617 /**
1618  * wlan_acquire_peer_key_wakelock -api to get key wakelock
1619  * @pdev: pdev
1620  * @mac_addr: peer mac addr
1621  *
1622  * This function acquires wakelock and prevent runtime pm during key
1623  * installation
1624  *
1625  * Return: None
1626  */
1627 void wlan_acquire_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
1628 				    uint8_t *mac_addr);
1629 
1630 /**
1631  * wlan_release_peer_key_wakelock -api to release key wakelock
1632  * @pdev: pdev
1633  * @mac_addr: peer mac addr
1634  *
1635  * This function releases wakelock and allow runtime pm after key
1636  * installation
1637  *
1638  * Return: None
1639  */
1640 void wlan_release_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
1641 				    uint8_t *mac_addr);
1642 
1643 /**
1644  * wlan_get_sap_user_config_freq() - Get the user configured frequency
1645  *
1646  * @vdev: pointer to vdev
1647  *
1648  * Return: User configured sap frequency.
1649  */
1650 qdf_freq_t
1651 wlan_get_sap_user_config_freq(struct wlan_objmgr_vdev *vdev);
1652 
1653 /**
1654  * wlan_set_sap_user_config_freq() - Set the user configured frequency
1655  *
1656  * @vdev: pointer to vdev
1657  * @freq: user configured SAP frequency
1658  *
1659  * Return: QDF_STATUS
1660  */
1661 QDF_STATUS
1662 wlan_set_sap_user_config_freq(struct wlan_objmgr_vdev *vdev,
1663 			      qdf_freq_t freq);
1664 
1665 #if defined(WLAN_FEATURE_11BE_MLO)
1666 /**
1667  * wlan_clear_mlo_sta_link_removed_flag() - Clear link removal flag on all
1668  * vdev of same ml dev
1669  * @vdev: pointer to vdev
1670  *
1671  * Return: void
1672  */
1673 void wlan_clear_mlo_sta_link_removed_flag(struct wlan_objmgr_vdev *vdev);
1674 
1675 /**
1676  * wlan_get_mlo_link_agnostic_flag() - Update mlo link agnostic flag
1677  *
1678  * @vdev: pointer to vdev
1679  * @dest_addr: destination address
1680  *
1681  * Return: true/false
1682  */
1683 bool wlan_get_mlo_link_agnostic_flag(struct wlan_objmgr_vdev *vdev,
1684 				     uint8_t *dest_addr);
1685 /**
1686  * wlan_set_vdev_link_removed_flag_by_vdev_id() - Set link removal flag
1687  * on vdev
1688  * @psoc: psoc object
1689  * @vdev_id: vdev id
1690  * @removed: link removal flag
1691  *
1692  * Return: QDF_STATUS_SUCCESS if success, otherwise error code
1693  */
1694 QDF_STATUS
1695 wlan_set_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc *psoc,
1696 					   uint8_t vdev_id, bool removed);
1697 
1698 /**
1699  * wlan_get_vdev_link_removed_flag_by_vdev_id() - Get link removal flag
1700  * of vdev
1701  * @psoc: psoc object
1702  * @vdev_id: vdev id
1703  *
1704  * Return: true if link is removed on vdev, otherwise false.
1705  */
1706 bool
1707 wlan_get_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc *psoc,
1708 					   uint8_t vdev_id);
1709 
1710 /**
1711  * wlan_drop_mgmt_frame_on_link_removal() - Check mgmt frame
1712  * allow dropped due to link removal
1713  * @vdev: pointer to vdev
1714  *
1715  * Return: true if frame can be dropped.
1716  */
1717 bool wlan_drop_mgmt_frame_on_link_removal(struct wlan_objmgr_vdev *vdev);
1718 #else
1719 static inline void
wlan_clear_mlo_sta_link_removed_flag(struct wlan_objmgr_vdev * vdev)1720 wlan_clear_mlo_sta_link_removed_flag(struct wlan_objmgr_vdev *vdev)
1721 {
1722 }
1723 
1724 static inline
wlan_get_mlo_link_agnostic_flag(struct wlan_objmgr_vdev * vdev,uint8_t * dest_addr)1725 bool wlan_get_mlo_link_agnostic_flag(struct wlan_objmgr_vdev *vdev,
1726 				     uint8_t *dest_addr)
1727 {
1728 	return false;
1729 }
1730 
1731 static inline QDF_STATUS
wlan_set_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool removed)1732 wlan_set_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc *psoc,
1733 					   uint8_t vdev_id, bool removed)
1734 {
1735 	return QDF_STATUS_SUCCESS;
1736 }
1737 
1738 static inline bool
wlan_get_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)1739 wlan_get_vdev_link_removed_flag_by_vdev_id(struct wlan_objmgr_psoc *psoc,
1740 					   uint8_t vdev_id)
1741 {
1742 	return false;
1743 }
1744 
1745 static inline bool
wlan_drop_mgmt_frame_on_link_removal(struct wlan_objmgr_vdev * vdev)1746 wlan_drop_mgmt_frame_on_link_removal(struct wlan_objmgr_vdev *vdev)
1747 {
1748 	return false;
1749 }
1750 #endif
1751 
1752 #ifdef CONFIG_BAND_6GHZ
1753 /**
1754  * wlan_get_tpc_update_required_for_sta() - Get the tpc update required config
1755  * to identify whether the tpc power has changed for concurrent STA interface
1756  *
1757  * @vdev: pointer to SAP vdev
1758  *
1759  * Return: Change scc power config
1760  */
1761 bool
1762 wlan_get_tpc_update_required_for_sta(struct wlan_objmgr_vdev *vdev);
1763 
1764 /**
1765  * wlan_set_tpc_update_required_for_sta() - Set the tpc update required config
1766  * for the concurrent STA interface
1767  *
1768  * @vdev:   pointer to SAP vdev
1769  * @value:  change scc power config
1770  *
1771  * Return: QDF_STATUS
1772  */
1773 QDF_STATUS
1774 wlan_set_tpc_update_required_for_sta(struct wlan_objmgr_vdev *vdev, bool value);
1775 #else
1776 static inline bool
wlan_get_tpc_update_required_for_sta(struct wlan_objmgr_vdev * vdev)1777 wlan_get_tpc_update_required_for_sta(struct wlan_objmgr_vdev *vdev)
1778 {
1779 	return false;
1780 }
1781 
1782 static inline QDF_STATUS
wlan_set_tpc_update_required_for_sta(struct wlan_objmgr_vdev * vdev,bool value)1783 wlan_set_tpc_update_required_for_sta(struct wlan_objmgr_vdev *vdev, bool value)
1784 {
1785 	return QDF_STATUS_SUCCESS;
1786 }
1787 #endif
1788 
1789 /**
1790  * wlan_mlme_get_sta_num_tx_chains() - API to get station num tx chains
1791  *
1792  * @psoc: psoc context
1793  * @vdev: pointer to vdev
1794  * @tx_chains : tx_chains out parameter
1795  *
1796  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
1797  */
1798 QDF_STATUS
1799 wlan_mlme_get_sta_num_tx_chains(struct wlan_objmgr_psoc *psoc,
1800 				struct wlan_objmgr_vdev *vdev,
1801 				uint8_t *tx_chains);
1802 
1803 /**
1804  * wlan_mlme_get_sta_tx_nss() - API to get station tx NSS
1805  *
1806  * @psoc: psoc context
1807  * @vdev: pointer to vdev
1808  * @tx_nss : tx_nss out parameter
1809  *
1810  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
1811  */
1812 QDF_STATUS
1813 wlan_mlme_get_sta_tx_nss(struct wlan_objmgr_psoc *psoc,
1814 			 struct wlan_objmgr_vdev *vdev,
1815 			 uint8_t *tx_nss);
1816 
1817 /**
1818  * wlan_mlme_get_sta_num_rx_chains() - API to get station num rx chains
1819  *
1820  * @psoc: psoc context
1821  * @vdev: pointer to vdev
1822  * @rx_chains : rx_chains out parameter
1823  *
1824  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
1825  */
1826 QDF_STATUS
1827 wlan_mlme_get_sta_num_rx_chains(struct wlan_objmgr_psoc *psoc,
1828 				struct wlan_objmgr_vdev *vdev,
1829 				uint8_t *rx_chains);
1830 
1831 /**
1832  * wlan_mlme_get_sta_rx_nss() - API to get station rx NSS
1833  *
1834  * @psoc: psoc context
1835  * @vdev: pointer to vdev
1836  * @rx_nss : rx_nss out parameter
1837  *
1838  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
1839  */
1840 QDF_STATUS
1841 wlan_mlme_get_sta_rx_nss(struct wlan_objmgr_psoc *psoc,
1842 			 struct wlan_objmgr_vdev *vdev,
1843 			 uint8_t *rx_nss);
1844 
1845 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1846 /**
1847  * wlan_mlme_defer_pmk_set_in_roaming() - Set the set_key pending status
1848  *
1849  * @psoc: pointer to psoc
1850  * @vdev_id: vdev id
1851  * @set_pmk_pending: set_key pending status
1852  *
1853  * Return: None
1854  */
1855 void
1856 wlan_mlme_defer_pmk_set_in_roaming(struct wlan_objmgr_psoc *psoc,
1857 				   uint8_t vdev_id, bool set_pmk_pending);
1858 
1859 /**
1860  * wlan_mlme_is_pmk_set_deferred() - Get the set_key pending status
1861  *
1862  * @psoc: pointer to psoc
1863  * @vdev_id: vdev id
1864  *
1865  * Return : set_key pending status
1866  */
1867 bool
1868 wlan_mlme_is_pmk_set_deferred(struct wlan_objmgr_psoc *psoc,
1869 			      uint8_t vdev_id);
1870 #else
1871 static inline void
wlan_mlme_defer_pmk_set_in_roaming(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool set_pmk_pending)1872 wlan_mlme_defer_pmk_set_in_roaming(struct wlan_objmgr_psoc *psoc,
1873 				   uint8_t vdev_id, bool set_pmk_pending)
1874 {
1875 }
1876 
1877 static inline bool
wlan_mlme_is_pmk_set_deferred(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)1878 wlan_mlme_is_pmk_set_deferred(struct wlan_objmgr_psoc *psoc,
1879 			      uint8_t vdev_id)
1880 {
1881 	return false;
1882 }
1883 #endif
1884 
1885 #ifdef WLAN_FEATURE_SAE
1886 /**
1887  * wlan_vdev_is_sae_auth_type() - is vdev SAE auth type
1888  * @vdev: pointer to vdev
1889  *
1890  * Return: true if vdev is SAE auth type
1891  */
1892 bool wlan_vdev_is_sae_auth_type(struct wlan_objmgr_vdev *vdev);
1893 #endif /* WLAN_FEATURE_SAE */
1894 
1895 /**
1896  * wlan_get_rand_from_lst_for_freq()- Get random channel from a given channel
1897  * list.
1898  * @freq_lst: Frequency list
1899  * @num_chan: number of channels
1900  *
1901  * Get random channel from given channel list.
1902  *
1903  * Return: channel frequency.
1904  */
1905 uint16_t wlan_get_rand_from_lst_for_freq(uint16_t *freq_lst,
1906 					 uint8_t num_chan);
1907 #if defined WLAN_FEATURE_SR
1908 /**
1909  * mlme_sr_update() - MLME sr update callback
1910  * @vdev: vdev object
1911  * @enable: true or false
1912  *
1913  * This function is called to update the SR threshold
1914  */
1915 void mlme_sr_update(struct wlan_objmgr_vdev *vdev, bool enable);
1916 
1917 /**
1918  * mlme_sr_is_enable: Check whether SR is enabled or not
1919  * @vdev: object manager vdev
1920  *
1921  * Return: True/False
1922  */
1923 int mlme_sr_is_enable(struct wlan_objmgr_vdev *vdev);
1924 #else
mlme_sr_update(struct wlan_objmgr_vdev * vdev,bool enable)1925 static inline void mlme_sr_update(struct wlan_objmgr_vdev *vdev, bool enable)
1926 {
1927 }
1928 
mlme_sr_is_enable(struct wlan_objmgr_vdev * vdev)1929 static inline int mlme_sr_is_enable(struct wlan_objmgr_vdev *vdev)
1930 {
1931 	return 0;
1932 }
1933 #endif /* WLAN_FEATURE_SR */
1934 
1935 /**
1936  * mlme_peer_oper_mode_change_event_handler() - Handle peer oper mode event
1937  * @scn: handle
1938  * @event: Event data received from firmware
1939  * @len: Event data length received from firmware
1940  */
1941 int mlme_peer_oper_mode_change_event_handler(ol_scn_t scn, uint8_t *event,
1942 					     uint32_t len);
1943 
1944 /**
1945  * wmi_extract_peer_oper_mode_event() - Extract the peer operating
1946  * mode change event and update the new bandwidth
1947  * @wmi_handle: wmi handle
1948  * @event: Event data received from firmware
1949  * @len: Event data length received from firmware
1950  * @data: Extract the event and fill in data
1951  */
1952 QDF_STATUS
1953 wmi_extract_peer_oper_mode_event(wmi_unified_t wmi_handle,
1954 				 uint8_t *event,
1955 				 uint32_t len,
1956 				 struct peer_oper_mode_event *data);
1957 
1958 /**
1959  * wlan_mlme_register_rx_ops - Target IF mlme API to register mlme
1960  * related rx op.
1961  * @rx_ops: Pointer to rx ops fp struct
1962  *
1963  * Return: none
1964  */
1965 void wlan_mlme_register_rx_ops(struct wlan_mlme_rx_ops *rx_ops);
1966 
1967 /**
1968  * mlme_get_rx_ops - Get mlme rx ops from psoc
1969  * @psoc: psoc
1970  *
1971  * Return: Pointer to rx ops fp struct
1972  */
1973 struct wlan_mlme_rx_ops *
1974 mlme_get_rx_ops(struct wlan_objmgr_psoc *psoc);
1975 
1976 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1977 /**
1978  * wlan_mlme_register_common_events - Wrapper to register common events
1979  * @psoc: psoc
1980  *
1981  * Return: QDF_STATUS
1982  */
1983 QDF_STATUS wlan_mlme_register_common_events(struct wlan_objmgr_psoc *psoc);
1984 #else
1985 static inline QDF_STATUS
wlan_mlme_register_common_events(struct wlan_objmgr_psoc * psoc)1986 wlan_mlme_register_common_events(struct wlan_objmgr_psoc *psoc)
1987 {
1988 	return QDF_STATUS_SUCCESS;
1989 }
1990 #endif
1991 
1992 /**
1993  * wlan_mlme_send_csa_event_status_ind_cmd() - send csa event status indication
1994  * @vdev: vdev obj
1995  * @csa_status: csa status
1996  *
1997  *  Return: QDF_STATUS
1998  */
1999 QDF_STATUS
2000 wlan_mlme_send_csa_event_status_ind_cmd(struct wlan_objmgr_vdev *vdev,
2001 					uint8_t csa_status);
2002 
2003 /**
2004  * wlan_mlme_get_sap_psd_for_20mhz() - Get the PSD power for 20 MHz
2005  * frequency
2006  * @vdev: pointer to vdev object
2007  *
2008  * Return: psd power
2009  */
2010 uint8_t wlan_mlme_get_sap_psd_for_20mhz(struct wlan_objmgr_vdev *vdev);
2011 
2012 /**
2013  * wlan_mlme_set_sap_psd_for_20mhz() - Set the PSD power for 20 MHz
2014  * frequency
2015  * @vdev: pointer to vdev object
2016  * @psd_power : psd power
2017  *
2018  * Return: None
2019  */
2020 QDF_STATUS wlan_mlme_set_sap_psd_for_20mhz(struct wlan_objmgr_vdev *vdev,
2021 					   uint8_t psd_power);
2022 
2023 /**
2024  * wlan_find_peer_and_get_mac_and_mld_addr() - This API find peer from the peer
2025  * list and cache peer MAC and MLD address in the peer_mac_info.
2026  * @psoc: PSOC object
2027  * @peer_mac_info: Peer MAC address info
2028  *
2029  * Return: None
2030  */
2031 QDF_STATUS
2032 wlan_find_peer_and_get_mac_and_mld_addr(
2033 				struct wlan_objmgr_psoc *psoc,
2034 				struct peer_mac_addresses *peer_mac_info);
2035 
2036 #endif
2037