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