xref: /wlan-dirver/qcacld-3.0/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h (revision e22f9adc774eb030715d9a453ec9ea346916ed3b)
1 /*
2  * Copyright (c) 2020-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 any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /*
19  * DOC: wlan_cm_roam_api.h
20  *
21  * Implementation for the Common Roaming interfaces.
22  */
23 
24 #ifndef WLAN_CM_ROAM_API_H__
25 #define WLAN_CM_ROAM_API_H__
26 
27 #include "wlan_mlme_dbg.h"
28 #include "../../core/src/wlan_cm_roam_offload.h"
29 #include "wlan_mlme_main.h"
30 #include "wlan_mlme_api.h"
31 #include "wlan_reg_ucfg_api.h"
32 #include "wlan_cm_tgt_if_tx_api.h"
33 
34 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
35 /**
36  * wlan_cm_enable_roaming_on_connected_sta() - Enable roaming on other connected
37  * sta vdev
38  * @pdev: pointer to pdev object
39  * @vdev_id: vdev id on which roaming should not be enabled
40  *
41  * Return: QDF_STATUS
42  */
43 QDF_STATUS
44 wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
45 					uint8_t vdev_id);
46 
47 /**
48  * wlan_cm_roam_send_rso_cmd() - send rso command
49  * @psoc: psoc pointer
50  * @vdev_id: vdev id
51  * @rso_command: roam command to send
52  * @reason: reason for changing roam state for the requested vdev id
53  *
54  * similar to csr_roam_offload_scan, will be used from many legacy
55  * process directly, generate a new function wlan_cm_roam_send_rso_cmd
56  * for external usage.
57  *
58  * Return: QDF_STATUS
59  */
60 QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
61 				     uint8_t vdev_id, uint8_t rso_command,
62 				     uint8_t reason);
63 
64 /**
65  * wlan_cm_handle_sta_sta_roaming_enablement() - Handle roaming in case
66  * of STA + STA
67  * @psoc: psoc common object
68  * @vdev_id: Vdev id
69  *
70  * Wrapper function to cm_handle_sta_sta_roaming_enablement
71  *
72  * Return: none
73  */
74 void wlan_cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc,
75 					       uint8_t vdev_id);
76 
77 /**
78  * wlan_cm_roam_state_change() - Post roam state change to roam state machine
79  * @pdev: pdev pointer
80  * @vdev_id: vdev id
81  * @requested_state: roam state to be set
82  * @reason: reason for changing roam state for the requested vdev id
83  *
84  * This function posts roam state change to roam state machine handling
85  *
86  * Return: QDF_STATUS
87  */
88 QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
89 				     uint8_t vdev_id,
90 				     enum roam_offload_state requested_state,
91 				     uint8_t reason);
92 
93 /**
94  * wlan_roam_update_cfg() - Process RSO update cfg request
95  * @psoc: psoc context
96  * @vdev_id: vdev id
97  * @reason: reason for requesting RSO update cfg
98  *
99  * Return: QDF_STATUS
100  */
101 QDF_STATUS
102 wlan_roam_update_cfg(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
103 		     uint8_t reason);
104 
105 /**
106  * wlan_cm_send_beacon_miss() - initiate beacon miss
107  * @vdev_id: vdev id
108  * @rssi: AP rssi
109  *
110  * Return: void
111  */
112 void wlan_cm_send_beacon_miss(uint8_t vdev_id, int32_t rssi);
113 
114 #else
115 static inline
116 QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
117 				     uint8_t vdev_id, uint8_t rso_command,
118 				     uint8_t reason)
119 {
120 	return QDF_STATUS_E_NOSUPPORT;
121 }
122 
123 static inline void
124 wlan_cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc,
125 					  uint8_t vdev_id)
126 {
127 }
128 
129 static inline QDF_STATUS
130 wlan_roam_update_cfg(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
131 		     uint8_t reason)
132 {
133 	return QDF_STATUS_E_NOSUPPORT;
134 }
135 
136 static inline
137 QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
138 				     uint8_t vdev_id,
139 				     enum roam_offload_state requested_state,
140 				     uint8_t reason)
141 {
142 	return QDF_STATUS_E_NOSUPPORT;
143 }
144 
145 static inline QDF_STATUS
146 wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
147 					uint8_t vdev_id)
148 {
149 	return QDF_STATUS_E_NOSUPPORT;
150 }
151 #endif
152 
153 /**
154  * cm_update_associated_ch_info() - to save channel info in mlme priv obj at
155  * the time of initial connection
156  * @vdev: Pointer to vdev
157  * @is_update: to distinguish whether update is during connection or
158  * disconnection
159  *
160  * Return: none
161  */
162 void
163 cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update);
164 
165 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
166 #define wlan_is_roam_offload_enabled(lfr) \
167 	(lfr.lfr3_roaming_offload)
168 #else
169 #define wlan_is_roam_offload_enabled(lfr)  false
170 #endif
171 
172 /**
173  * wlan_cm_host_roam_in_progress() -Check if STA is in the middle of
174  * roaming states
175  * @psoc: psoc
176  * @vdev_id: vdev id
177  *
178  * Return: True or False
179  */
180 bool wlan_cm_host_roam_in_progress(struct wlan_objmgr_psoc *psoc,
181 				   uint8_t vdev_id);
182 
183 /**
184  * cm_roam_acquire_lock() - Wrapper for rso lock.
185  * @vdev: Pointer to vdev
186  *
187  * Return: QDF_STATUS
188  */
189 QDF_STATUS cm_roam_acquire_lock(struct wlan_objmgr_vdev *vdev);
190 
191 /**
192  * cm_roam_release_lock() - Wrapper for rso lock
193  * @vdev: Pointer to vdev
194  *
195  * Return: QDF_STATUS
196  */
197 QDF_STATUS cm_roam_release_lock(struct wlan_objmgr_vdev *vdev);
198 
199 /**
200  * cm_roam_get_requestor_string() - RSO control requestor to string api
201  * @requestor: Requestor of type enum wlan_cm_rso_control_requestor
202  *
203  * Return: Pointer to converted string
204  */
205 char
206 *cm_roam_get_requestor_string(enum wlan_cm_rso_control_requestor requestor);
207 
208 /**
209  * wlan_cm_rso_set_roam_trigger() - Send roam trigger bitmap firmware
210  * @pdev: Pointer to pdev
211  * @vdev_id: vdev id
212  * @trigger_data: Carries pointer of the object containing vdev id and
213  *  roam_trigger_bitmap.
214  *
215  * Return: QDF_STATUS
216  */
217 QDF_STATUS
218 wlan_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
219 			     struct wlan_roam_triggers *trigger_data);
220 
221 /**
222  * wlan_cm_disable_rso() - Disable roam scan offload to firmware
223  * @pdev: Pointer to pdev
224  * @vdev_id: vdev id
225  * @requestor: RSO disable requestor
226  * @reason: Reason for RSO disable
227  *
228  * Return:  QDF_STATUS
229  */
230 QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
231 			       enum wlan_cm_rso_control_requestor requestor,
232 			       uint8_t reason);
233 
234 /**
235  * wlan_cm_enable_rso() - Enable roam scan offload to firmware
236  * @pdev: Pointer to pdev
237  * @vdev_id: vdev id
238  * @requestor: RSO disable requestor
239  * @reason: Reason for RSO disable
240  *
241  * Return:  QDF_STATUS
242  */
243 QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
244 			      enum wlan_cm_rso_control_requestor requestor,
245 			      uint8_t reason);
246 
247 /**
248  * wlan_cm_roaming_in_progress() - check if roaming is in progress
249  * @pdev: Pointer to pdev
250  * @vdev_id: vdev id
251  *
252  * Return: true or false
253  */
254 bool
255 wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
256 
257 /**
258  * wlan_cm_roam_stop_req() - roam stop request handling
259  * @psoc: psoc pointer
260  * @vdev_id: vdev id
261  * @reason: reason for changing roam state for the requested vdev id
262  *
263  * Return: QDF_STATUS
264  */
265 QDF_STATUS wlan_cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
266 				 uint8_t reason);
267 
268 /**
269  * wlan_cm_roam_cfg_get_value  - Get RSO config value from mlme vdev private
270  * object
271  * @psoc: psoc pointer
272  * @vdev_id: vdev id
273  * @roam_cfg_type: Value needed
274  * @dst_config: Destination config
275  *
276  * Return: QDF_STATUS
277  */
278 QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,
279 				      uint8_t vdev_id,
280 				      enum roam_cfg_param roam_cfg_type,
281 				      struct cm_roam_values_copy *dst_config);
282 
283 static inline void
284 wlan_cm_flush_roam_channel_list(struct rso_chan_info *channel_info)
285 {
286 	cm_flush_roam_channel_list(channel_info);
287 }
288 
289 /**
290  * wlan_cm_roam_cfg_set_value  - Set RSO config value
291  * @psoc: psoc pointer
292  * @vdev_id: vdev id
293  * @roam_cfg_type: Roam configuration type to set
294  * @src_config: Source config
295  *
296  * Return: QDF_STATUS
297  */
298 QDF_STATUS
299 wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
300 			   enum roam_cfg_param roam_cfg_type,
301 			   struct cm_roam_values_copy *src_config);
302 
303 
304 struct rso_config *wlan_cm_get_rso_config_fl(struct wlan_objmgr_vdev *vdev,
305 					     const char *func, uint32_t line);
306 
307 struct rso_user_config *
308 wlan_cm_get_rso_user_config_fl(struct wlan_objmgr_vdev *vdev,
309 			       const char *func, uint32_t line);
310 /**
311  * wlan_cm_get_rso_config  - get per vdev RSO config
312  * @vdev: vdev pointer
313  *
314  * Return: rso config pointer
315  */
316 #define wlan_cm_get_rso_config(vdev) \
317 	wlan_cm_get_rso_config_fl(vdev, __func__, __LINE__)
318 
319 /**
320  * wlan_cm_get_rso_user_config - get per vdev RSO userspace config
321  * @vdev: vdev pointer
322  *
323  * Return: rso user space config pointer
324  */
325 #define wlan_cm_get_rso_user_config(vdev) \
326 	wlan_cm_get_rso_user_config_fl(vdev, __func__, __LINE__)
327 /**
328  * wlan_cm_set_disable_hi_rssi  - set disable hi rssi config
329  * @pdev: pdev pointer
330  * @vdev_id: vdev id
331  * @value: value to set
332  *
333  * Return: void
334  */
335 void wlan_cm_set_disable_hi_rssi(struct wlan_objmgr_pdev *pdev,
336 				 uint8_t vdev_id, bool value);
337 
338 /**
339  * wlan_cm_set_country_code - set country code to vdev rso config
340  * @pdev: pdev pointer
341  * @vdev_id: vdev id
342  * @cc: country code
343  *
344  * Return: void
345  */
346 void wlan_cm_set_country_code(struct wlan_objmgr_pdev *pdev,
347 			      uint8_t vdev_id, uint8_t  *cc);
348 
349 /**
350  * wlan_cm_get_country_code - get country code from vdev rso config
351  * @pdev: pdev pointer
352  * @vdev_id: vdev id
353  * @cc: country code
354  *
355  * Return: qdf status
356  */
357 QDF_STATUS wlan_cm_get_country_code(struct wlan_objmgr_pdev *pdev,
358 				    uint8_t vdev_id, uint8_t *cc);
359 
360 #ifdef FEATURE_WLAN_ESE
361 /**
362  * wlan_cm_set_ese_assoc  - set ese assoc
363  * @pdev: pdev pointer
364  * @vdev_id: vdev
365  * @value: value to set
366  *
367  * Return: void
368  */
369 void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev,
370 			   uint8_t vdev_id, bool value);
371 
372 /**
373  * wlan_cm_get_ese_assoc  - get ese assoc
374  * @pdev: pdev pointer
375  * @vdev_id: vdev
376  *
377  * Return: value
378  */
379 bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev,
380 			   uint8_t vdev_id);
381 void wlan_cm_ese_populate_additional_ies(struct wlan_objmgr_pdev *pdev,
382 			struct wlan_mlme_psoc_ext_obj *mlme_obj,
383 			uint8_t vdev_id,
384 			struct wlan_roam_scan_offload_params *rso_mode_cfg);
385 #else
386 static inline void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev,
387 					 uint8_t vdev_id, bool value) {}
388 static inline
389 bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev,
390 			   uint8_t vdev_id)
391 {
392 	return false;
393 }
394 static inline void wlan_cm_ese_populate_additional_ies(
395 		struct wlan_objmgr_pdev *pdev,
396 		struct wlan_mlme_psoc_ext_obj *mlme_obj,
397 		uint8_t vdev_id,
398 		struct wlan_roam_scan_offload_params *rso_mode_cfg)
399 {}
400 #endif
401 
402 /**
403  * wlan_roam_reset_roam_params  - reset_roam params
404  * @vdev: vdev pointer
405  *
406  * Return: void
407  */
408 void wlan_roam_reset_roam_params(struct wlan_objmgr_vdev *vdev);
409 
410 /**
411  * wlan_cm_rso_config_init  - initialize RSO config
412  * @vdev: vdev pointer
413  * @rso_cfg: rso config to init
414  *
415  * Return: QDF_STATUS
416  */
417 QDF_STATUS wlan_cm_rso_config_init(struct wlan_objmgr_vdev *vdev,
418 				   struct rso_config *rso_cfg);
419 
420 /**
421  * wlan_cm_rso_config_deinit  - deinit RSO config
422  * @vdev: vdev pointer
423  * @rso_cfg: rso config to deinit
424  *
425  * Return: void
426  */
427 void wlan_cm_rso_config_deinit(struct wlan_objmgr_vdev *vdev,
428 			       struct rso_config *rso_cfg);
429 
430 /**
431  * wlan_cm_fill_crypto_filter_from_vdev() - fill scan filter crypto from vdev
432  * given vdev id
433  * @vdev: vdev
434  * @filter: filetr to fill
435  *
436  * Return: void
437  */
438 void wlan_cm_fill_crypto_filter_from_vdev(struct wlan_objmgr_vdev *vdev,
439 					  struct scan_filter *filter);
440 
441 /**
442  * wlan_cm_init_occupied_ch_freq_list  - init occupied chan freq list
443  * @pdev: pdev pointer
444  * @psoc: psoc
445  * @vdev_id: vdev_id of vdev for which init is required
446  *
447  * Return: void
448  */
449 void wlan_cm_init_occupied_ch_freq_list(struct wlan_objmgr_pdev *pdev,
450 					struct wlan_objmgr_psoc *psoc,
451 					uint8_t vdev_id);
452 
453 uint32_t cm_crypto_authmode_to_wmi_authmode(int32_t authmodeset,
454 					    int32_t akm,
455 					    int32_t ucastcipherset);
456 uint8_t *wlan_cm_get_rrm_cap_ie_data(void);
457 
458 /**
459  * wlan_cm_append_assoc_ies() - Append specific IE to assoc IE's buffer
460  * @rso_mode_cfg: Pointer to Roam offload scan request
461  * @ie_id: IE ID to be appended
462  * @ie_len: IE length to be appended
463  * @ie_data: IE data to be appended
464  *
465  * Return: None
466  */
467 void wlan_cm_append_assoc_ies(struct wlan_roam_scan_offload_params *rso_mode_cfg,
468 			      uint8_t ie_id, uint8_t ie_len,
469 			      const uint8_t *ie_data);
470 /**
471  * wlan_add_supported_5Ghz_channels()- Add valid 5Ghz channels
472  * in Join req.
473  * @psoc: psoc ptr
474  * @pdev: pdev
475  * @chan_list: Pointer to channel list buffer to populate
476  * @num_chnl: Pointer to number of channels value to update
477  * @supp_chan_ie: Boolean to check if we need to populate as IE
478  *
479  * This function is called to update valid 5Ghz channels
480  * in Join req. If @supp_chan_ie is true, supported channels IE
481  * format[chan num 1, num of channels 1, chan num 2, num of
482  * channels 2, ..] is populated. Else, @chan_list would be a list
483  * of supported channels[chan num 1, chan num 2..]
484  *
485  * Return: void
486  */
487 void wlan_add_supported_5Ghz_channels(struct wlan_objmgr_psoc *psoc,
488 				      struct wlan_objmgr_pdev *pdev,
489 				      uint8_t *chan_list,
490 				      uint8_t *num_chnl,
491 				      bool supp_chan_ie);
492 #ifdef WLAN_ADAPTIVE_11R
493 /**
494  * wlan_get_adaptive_11r_enabled() - Function to check if adaptive 11r
495  * ini is enabled or disabled
496  * @lfr_cfg: LFR configuration
497  *
498  * Return: true if adaptive 11r is enabled
499  */
500 static inline bool
501 wlan_get_adaptive_11r_enabled(struct wlan_mlme_lfr_cfg *lfr_cfg)
502 {
503 	return lfr_cfg->enable_adaptive_11r;
504 }
505 #else
506 static inline bool
507 wlan_get_adaptive_11r_enabled(struct wlan_mlme_lfr_cfg *lfr_cfg)
508 {
509 	return false;
510 }
511 #endif
512 
513 #ifdef WLAN_FEATURE_FILS_SK
514 /**
515  * wlan_cm_get_fils_connection_info  - Copy fils connection information from
516  * mlme vdev private object
517  * @psoc: Pointer to psoc object
518  * @vdev_id: vdev id
519  *
520  * Return: QDF_STATUS
521  */
522 struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
523 		struct wlan_objmgr_psoc *psoc,
524 		uint8_t vdev_id);
525 
526 /**
527  * wlan_cm_update_mlme_fils_info  - Update FILS connection info
528  * to mlme vdev private object
529  * @vdev: Pointer to pdev object
530  * @src_fils_info: Current profile FILS connection information
531  *
532  * Return: QDF_STATUS
533  */
534 QDF_STATUS
535 wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
536 			      struct wlan_fils_con_info *src_fils_info);
537 
538 /**
539  * wlan_cm_update_fils_ft - Update the FILS FT derived to mlme
540  * @psoc: Psoc pointer
541  * @vdev_id: vdev id
542  * @fils_ft: Pointer to FILS FT
543  * @fils_ft_len: FILS FT length
544  *
545  * Return: QDF_STATUS
546  */
547 QDF_STATUS wlan_cm_update_fils_ft(struct wlan_objmgr_psoc *psoc,
548 				  uint8_t vdev_id, uint8_t *fils_ft,
549 				  uint8_t fils_ft_len);
550 
551 /**
552  * wlan_cm_update_hlp_info - API to save HLP IE
553  * @psoc: Pointer to psoc
554  * @gen_ie: IE buffer to store
555  * @len: length of the IE buffer @gen_ie
556  * @vdev_id: vdev id
557  * @flush: Flush the older saved HLP if any
558  *
559  * Return: None
560  */
561 void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
562 			     const uint8_t *gen_ie, uint16_t len,
563 			     uint8_t vdev_id, bool flush);
564 #else
565 static inline
566 struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
567 		struct wlan_objmgr_psoc *psoc,
568 		uint8_t vdev_id)
569 {
570 	return NULL;
571 }
572 
573 static inline void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
574 					   const uint8_t *gen_ie, uint16_t len,
575 					   uint8_t vdev_id, bool flush)
576 {}
577 #endif
578 
579 static inline
580 bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
581 			      struct wlan_objmgr_vdev *vdev,
582 			      bool mdie_present)
583 {
584 	return cm_is_auth_type_11r(mlme_obj, vdev, mdie_present);
585 }
586 
587 static inline bool cm_is_open_mode(struct wlan_objmgr_vdev *vdev)
588 {
589 	return wlan_vdev_is_open_mode(vdev);
590 }
591 
592 #ifdef WLAN_FEATURE_SAE
593 /**
594  * cm_is_auth_type_sae() - is vdev SAE auth type
595  * @vdev: pointer to vdev
596  *
597  * Return: true if vdev is SAE auth type
598  */
599 static inline bool cm_is_auth_type_sae(struct wlan_objmgr_vdev *vdev)
600 {
601 	return wlan_vdev_is_sae_auth_type(vdev);
602 }
603 #else
604 static inline bool cm_is_auth_type_sae(struct wlan_objmgr_vdev *vdev)
605 {
606 	return false;
607 }
608 #endif
609 
610 #ifdef FEATURE_WLAN_ESE
611 bool
612 cm_ese_open_present(struct wlan_objmgr_vdev *vdev,
613 		    struct wlan_mlme_psoc_ext_obj *mlme_obj,
614 		    bool ese_version_present);
615 bool
616 cm_is_ese_connection(struct wlan_objmgr_vdev *vdev, bool ese_version_present);
617 #else
618 static inline bool
619 cm_ese_open_present(struct wlan_objmgr_vdev *vdev,
620 		    struct wlan_mlme_psoc_ext_obj *mlme_obj,
621 		    bool ese_version_present)
622 {
623 	return false;
624 }
625 static inline bool
626 cm_is_ese_connection(struct wlan_objmgr_vdev *vdev, bool ese_version_present)
627 {
628 	return false;
629 }
630 #endif
631 
632 /**
633  * cm_roam_start_init_on_connect() - init roaming
634  * @pdev: pdev pointer
635  * @vdev_id: vdev_id
636  *
637  * Return: void
638  */
639 void cm_roam_start_init_on_connect(struct wlan_objmgr_pdev *pdev,
640 				   uint8_t vdev_id);
641 
642 void cm_update_session_assoc_ie(struct wlan_objmgr_psoc *psoc,
643 				uint8_t vdev_id,
644 				struct element_info *assoc_ie);
645 
646 /**
647  * wlan_cm_roam_invoke() - Validate and send Roam invoke req to CM
648  * @pdev: Pdev pointer
649  * @vdev_id: vdev_id
650  * @bssid: Target bssid
651  * @chan_freq: channel frequency on which reassoc should be send
652  * @source: source of roam
653  *
654  * Return: QDF_STATUS
655  */
656 QDF_STATUS
657 wlan_cm_roam_invoke(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
658 		    struct qdf_mac_addr *bssid, qdf_freq_t chan_freq,
659 		    enum wlan_cm_source source);
660 
661 /**
662  * cm_is_fast_roam_enabled() - check fast roam enabled or not
663  * @psoc: psoc pointer
664  *
665  * Return: true or false
666  */
667 bool cm_is_fast_roam_enabled(struct wlan_objmgr_psoc *psoc);
668 
669 /**
670  * cm_is_rsn_or_8021x_sha256_auth_type() - check whether auth type is rsn
671  * or 8021x_sha256 or not
672  * @vdev: vdev object pointer
673  *
674  * Return: true, if auth type is rsn/8021x_sha256, false otherwise
675  */
676 bool cm_is_rsn_or_8021x_sha256_auth_type(struct wlan_objmgr_vdev *vdev);
677 
678 #ifdef WLAN_FEATURE_HOST_ROAM
679 /**
680  * wlan_cm_host_roam_start() - fw host roam start handler
681  * @msg: msg pointer
682  *
683  * Return: QDF_STATUS
684  */
685 QDF_STATUS wlan_cm_host_roam_start(struct scheduler_msg *msg);
686 
687 /**
688  * cm_mlme_roam_preauth_fail() - roam preauth fail
689  * @vdev: VDEV object
690  * @req: Connection manager roam request
691  * @reason: connection manager connect fail reason
692  *
693  * Return: QDF_STATUS
694  */
695 QDF_STATUS
696 cm_mlme_roam_preauth_fail(struct wlan_objmgr_vdev *vdev,
697 			  struct wlan_cm_roam_req *req,
698 			  enum wlan_cm_connect_fail_reason reason);
699 
700 /**
701  * cm_free_preauth_req() - free preauth request related memory
702  * @preauth_req: preauth request
703  *
704  * Return: void
705  */
706 void cm_free_preauth_req(struct wlan_preauth_req *preauth_req);
707 
708 /**
709  * cm_handle_preauth_rsp() - Process vdev preauth rsp and send to CM
710  * @msg: scheduler message
711  *
712  * Process preauth rsp and send it to CM SM.
713  *
714  * Return: QDF_STATUS
715  */
716 QDF_STATUS cm_handle_preauth_rsp(struct scheduler_msg *msg);
717 
718 /**
719  * cm_reassoc_timer_callback() - reassoc timer callback, gets called at time out
720  * @context: context
721  *
722  * Timer callback for the timer that is started between the preauth completion
723  * and reassoc request. In this interval, it is expected that the
724  * pre-auth response and RIC IEs are passed up to the WPA supplicant and
725  * received back the necessary FTIEs required to be sent in the reassoc request
726  *
727  * Return: None
728  */
729 void cm_reassoc_timer_callback(void *context);
730 #else
731 static inline QDF_STATUS wlan_cm_host_roam_start(struct scheduler_msg *msg)
732 {
733 	if (msg && msg->bodyptr)
734 		qdf_mem_free(msg->bodyptr);
735 
736 	return QDF_STATUS_SUCCESS;
737 }
738 #endif
739 
740 /**
741  * wlan_cm_get_associated_ch_info() - get associated channel info
742  * @psoc: psoc pointer
743  * @vdev_id: vdev id
744  * @scanned_ch_width: channel width as per scan response
745  * @assoc_chan_info: channel info to get
746  *
747  * Return: none
748  */
749 void wlan_cm_get_associated_ch_info(struct wlan_objmgr_psoc *psoc,
750 				    uint8_t vdev_id,
751 				    enum phy_ch_width scanned_ch_width,
752 				    struct assoc_channel_info *assoc_chan_info);
753 
754 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
755 /**
756  * wlan_cm_fw_roam_abort_req() - roam abort request handling
757  * @psoc: psoc pointer
758  * @vdev_id: vdev id
759  *
760  * Return: QDF_STATUS
761  */
762 QDF_STATUS
763 wlan_cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
764 
765 /**
766  * wlan_cm_get_roam_band_value  - Get roam band value from RSO config
767  * @psoc: psoc pointer
768  * @vdev: Pointer to vdev
769  *
770  * Return: Roam Band
771  */
772 uint32_t wlan_cm_get_roam_band_value(struct wlan_objmgr_psoc *psoc,
773 				     struct wlan_objmgr_vdev *vdev);
774 
775 /**
776  * wlan_cm_roam_activate_pcl_per_vdev() - Set the PCL command to be sent per
777  * vdev instead of pdev.
778  * @psoc: PSOC pointer
779  * @vdev_id: VDEV id
780  * @pcl_per_vdev: Activate vdev PCL type. 1- VDEV PCL, 0- PDEV PCL
781  *
782  * pcl_per_vdev will be set when:
783  *  STA + STA is connected in DBS mode and roaming init is done on
784  *  the 2nd STA.
785  *
786  * pcl_per_vdev will be false when only 1 sta connection exists or
787  * when 2nd sta gets disconnected
788  *
789  * Return: None
790  */
791 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc,
792 					uint8_t vdev_id,
793 					bool pcl_per_vdev);
794 
795 /**
796  * wlan_cm_roam_is_pcl_per_vdev_active() - API to know if the pcl command needs
797  * to be sent per vdev or not
798  * @psoc: PSOC pointer
799  * @vdev_id: VDEV id
800  *
801  * Return: PCL level
802  */
803 bool wlan_cm_roam_is_pcl_per_vdev_active(struct wlan_objmgr_psoc *psoc,
804 					 uint8_t vdev_id);
805 
806 /**
807  * wlan_cm_dual_sta_roam_update_connect_channels() - Fill the allowed channels
808  * for connection of the 2nd STA based on the 1st STA connected band if dual
809  * sta roaming is enabled.
810  * @psoc:   Pointer to PSOC object
811  * @filter: Pointer to scan filter
812  *
813  * Return: None
814  */
815 void
816 wlan_cm_dual_sta_roam_update_connect_channels(struct wlan_objmgr_psoc *psoc,
817 					      struct scan_filter *filter);
818 /**
819  * wlan_cm_roam_set_vendor_btm_params() - API to set vendor btm params
820  * @psoc: PSOC pointer
821  * @param: vendor configured roam trigger param
822  *
823  * Return: none
824  */
825 void
826 wlan_cm_roam_set_vendor_btm_params(struct wlan_objmgr_psoc *psoc,
827 				   struct wlan_cm_roam_vendor_btm_params
828 								*param);
829 /**
830  * wlan_cm_roam_get_vendor_btm_params() - API to get vendor btm param
831  * @psoc: PSOC pointer
832  * @param: vendor configured roam trigger param
833  *
834  * Return: none
835  */
836 void wlan_cm_roam_get_vendor_btm_params(
837 		struct wlan_objmgr_psoc *psoc,
838 		struct wlan_cm_roam_vendor_btm_params *param);
839 
840 /**
841  * wlan_cm_roam_get_score_delta_params() - API to get roam score delta param
842  * @psoc: PSOC pointer
843  * @params: roam trigger param
844  *
845  * Return: none
846  */
847 void
848 wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc,
849 				    struct wlan_roam_triggers *params);
850 
851 /**
852  * wlan_cm_roam_get_min_rssi_params() - API to get roam trigger min rssi param
853  * @psoc: PSOC pointer
854  * @params: roam trigger param
855  *
856  * Return: none
857  */
858 void
859 wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc,
860 				 struct wlan_roam_triggers *params);
861 
862 /**
863  * wlan_cm_update_roam_scan_scheme_bitmap() - Set roam scan scheme bitmap for
864  * each vdev
865  * @psoc: PSOC pointer
866  * @vdev_id: VDEV id
867  * @roam_scan_scheme_bitmap: bitmap of roam triggers for which partial roam
868  * scan needs to be enabled
869  *
870  * Return: QDF_STATUS
871  */
872 QDF_STATUS
873 wlan_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
874 				       uint8_t vdev_id,
875 				       uint32_t roam_scan_scheme_bitmap);
876 
877 /**
878  * wlan_cm_set_roam_band_bitmask() - Set roam band bitmask for vdev
879  * @psoc: psoc pointer
880  * @vdev_id: vdev id
881  * @roam_band_bitmask: bitmask of roam band for which roam scan needs to be
882  * enabled in fw
883  *
884  * Return: QDF_STATUS
885  */
886 QDF_STATUS wlan_cm_set_roam_band_bitmask(struct wlan_objmgr_psoc *psoc,
887 					 uint8_t vdev_id,
888 					 uint32_t roam_band_bitmask);
889 
890 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
891 /**
892  * struct roam_link_speed_cfg - link speed state config
893  * @psoc: pointer to psoc
894  * @vdev_id: vdev id
895  * @is_link_speed_good: true means link speed good, false means bad
896  */
897 struct roam_link_speed_cfg {
898 	struct wlan_objmgr_psoc *psoc;
899 	uint8_t vdev_id;
900 	uint8_t is_link_speed_good;
901 };
902 
903 /**
904  * wlan_cm_send_roam_linkspeed_state() - Send link speed state to target
905  * @msg: Pointer to schedule message
906  *
907  * Return: QDF_STATUS
908  */
909 QDF_STATUS wlan_cm_send_roam_linkspeed_state(struct scheduler_msg *msg);
910 
911 /**
912  * wlan_cm_roam_link_speed_update() - Update link speed state for roaming
913  * @psoc: psoc pointer
914  * @vdev_id: vdev id
915  * @is_link_speed_good: true means link speed good, false means bad
916  *
917  * Return: None
918  */
919 void wlan_cm_roam_link_speed_update(struct wlan_objmgr_psoc *psoc,
920 				    uint8_t vdev_id,
921 				    bool is_link_speed_good);
922 
923 /**
924  * wlan_cm_is_linkspeed_roam_trigger_supported() - Get roam linkspeed check
925  * @psoc: pointer to psoc object
926  *
927  * Return: bool, true: Linkspeed check for low rssi roaming supported
928  */
929 bool wlan_cm_is_linkspeed_roam_trigger_supported(struct wlan_objmgr_psoc *psoc);
930 #endif
931 
932 /**
933  * wlan_cm_set_roam_band_update() - send rso update on set band
934  * @psoc: psoc pointer
935  * @vdev_id: vdev id
936  *
937  * Return: QDF_STATUS
938  */
939 QDF_STATUS wlan_cm_set_roam_band_update(struct wlan_objmgr_psoc *psoc,
940 					uint8_t vdev_id);
941 
942 /**
943  * wlan_cm_get_roam_scan_scheme_bitmap() - Get roam scan scheme bitmap value
944  * @psoc: PSOC pointer
945  * @vdev_id: VDEV id
946  *
947  * Return: Roam scan scheme bitmap value
948  */
949 uint32_t wlan_cm_get_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
950 					     uint8_t vdev_id);
951 
952 /**
953  * wlan_cm_update_roam_states() - Set roam states for the vdev
954  * @psoc: PSOC pointer
955  * @vdev_id: VDEV id
956  * @value: Value to update
957  * @states: type of value to update
958  *
959  * Return: QDF_STATUS
960  */
961 QDF_STATUS
962 wlan_cm_update_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
963 			   uint32_t value, enum roam_fail_params states);
964 
965 /**
966  * wlan_cm_get_roam_states() - Get roam states value
967  * @psoc: PSOC pointer
968  * @vdev_id: VDEV id
969  * @states: For which action get roam states
970  *
971  * Return: Roam fail reason value
972  */
973 uint32_t
974 wlan_cm_get_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
975 			enum roam_fail_params states);
976 
977 void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev,
978 			 uint8_t vdev_id, uint8_t *psk_pmk,
979 			 uint8_t pmk_len);
980 
981 void wlan_cm_get_psk_pmk(struct wlan_objmgr_pdev *pdev,
982 			 uint8_t vdev_id, uint8_t *psk_pmk,
983 			 uint8_t *pmk_len);
984 
985 /**
986  * cm_akm_roam_allowed() - check if  roam allowed for some akm type
987  * roaming using single pmk
988  * with same pmk or not
989  * @psoc: psoc
990  * @vdev: vdev pointer
991  *
992  * Return: QDF_STATUS: QDF_STATUS_SUCCESS is allowed
993  */
994 QDF_STATUS
995 cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
996 		    struct wlan_objmgr_vdev *vdev);
997 
998 /**
999  * cm_invalid_roam_reason_handler() - Handler for invalid roam reason
1000  * @vdev_id: vdev id
1001  * @notif: roam notification of type enum cm_roam_notif
1002  * @reason: Notif param value from the roam event that carries trigger reason
1003  *
1004  * Return: QDF_STATUS
1005  */
1006 void cm_invalid_roam_reason_handler(uint32_t vdev_id, enum cm_roam_notif notif,
1007 				    uint32_t reason);
1008 
1009 /**
1010  * cm_handle_roam_reason_ho_failed() - Handler for roam due to ho failure
1011  * @vdev_id: vdev id
1012  * @bssid: carries the BSSID mac address
1013  * @hw_mode_trans_ind: hw_mode transition indication
1014  *
1015  * Return: None
1016  */
1017 void
1018 cm_handle_roam_reason_ho_failed(uint8_t vdev_id, struct qdf_mac_addr bssid,
1019 				struct cm_hw_mode_trans_ind *hw_mode_trans_ind);
1020 
1021 /**
1022  * cm_handle_scan_ch_list_data() - Roam scan ch evt wrapper for wma
1023  * @data: roam scan channel event data
1024  *
1025  * Return: QDF_STATUS
1026  */
1027 QDF_STATUS
1028 cm_handle_scan_ch_list_data(struct cm_roam_scan_ch_resp *data);
1029 
1030 /**
1031  * wlan_cm_free_roam_synch_frame_ind() - Free the bcn_probe_rsp, reassoc_req,
1032  * reassoc_rsp received as part of the ROAM_SYNC_FRAME event
1033  *
1034  * @rso_cfg: RSO configuration to be freed
1035  *
1036  * This API is used to free the buffer allocated during the ROAM_SYNC_FRAME
1037  * event
1038  *
1039  * Return: QDF_STATUS
1040  */
1041 QDF_STATUS wlan_cm_free_roam_synch_frame_ind(struct rso_config *rso_cfg);
1042 
1043 /**
1044  * cm_roam_sync_event_handler() - CM handler for roam sync event
1045  *
1046  * @psoc: psoc objmgr ptr
1047  * @event: event ptr
1048  * @len: event buff length
1049  * @sync_ind: sync indication data
1050  *
1051  * This API is used to handle the buffer allocated during the ROAM_SYNC_EVENT
1052  * event
1053  *
1054  * Return: QDF_STATUS
1055  */
1056 QDF_STATUS cm_roam_sync_event_handler(struct wlan_objmgr_psoc *psoc,
1057 				      uint8_t *event,
1058 				      uint32_t len,
1059 				      struct roam_offload_synch_ind *sync_ind);
1060 
1061 /**
1062  * cm_roam_sync_frame_event_handler() - CM handler for roam sync frame event
1063  *
1064  * @psoc: psoc objmgr ptr
1065  * @frame_ind: ptr to roam sync frame struct
1066  *
1067  * This API is used to handle the buffer allocated during the ROAM_SYNC_FRAME
1068  * event
1069  *
1070  * Return: QDF_STATUS
1071  */
1072 QDF_STATUS
1073 cm_roam_sync_frame_event_handler(struct wlan_objmgr_psoc *psoc,
1074 				 struct roam_synch_frame_ind *frame_ind);
1075 
1076 /**
1077  * cm_roam_sync_event_handler_cb() - CM callback handler for roam
1078  * sync event
1079  *
1080  * @vdev: vdev objmgr ptr
1081  * @event: event ptr
1082  * @len: event data len
1083  *
1084  * This API is used to handle the buffer allocated during the ROAM_SYNC
1085  * event
1086  *
1087  * Return: QDF_STATUS
1088  */
1089 QDF_STATUS cm_roam_sync_event_handler_cb(struct wlan_objmgr_vdev *vdev,
1090 					 uint8_t *event,
1091 					 uint32_t len);
1092 
1093 /**
1094  * wlan_cm_update_roam_rt_stats() - Store roam event stats command params
1095  * @psoc: PSOC pointer
1096  * @value: Value to update
1097  * @stats: type of value to update
1098  *
1099  * Return: QDF_STATUS
1100  */
1101 QDF_STATUS
1102 wlan_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1103 			     uint8_t value, enum roam_rt_stats_params stats);
1104 
1105 /**
1106  * wlan_cm_get_roam_rt_stats() - Get roam event stats value
1107  * @psoc: PSOC pointer
1108  * @stats: Get roam event command param for specific attribute
1109  *
1110  * Return: Roam events stats param value
1111  */
1112 uint8_t
1113 wlan_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1114 			  enum roam_rt_stats_params stats);
1115 
1116 /**
1117  * cm_report_roam_rt_stats - Gathers/Sends the roam events stats
1118  * @psoc:      Pointer to psoc structure
1119  * @vdev_id:   Vdev ID
1120  * @events:    Event/Notif type from roam event/roam stats event
1121  * @roam_info: Roam stats from the roam stats event
1122  * @value:     Notif param value from the roam event
1123  * @idx:       TLV index in roam stats event
1124  * @reason:    Notif param value from the roam event that carries trigger reason
1125  *
1126  * Gathers the roam stats from the roam event and the roam stats event and
1127  * sends them to hdd for filling the vendor attributes.
1128  *
1129  * Return: none
1130  */
1131 void cm_report_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1132 			     uint8_t vdev_id,
1133 			     enum roam_rt_stats_type events,
1134 			     struct roam_stats_event *roam_info,
1135 			     uint32_t value, uint8_t idx, uint32_t reason);
1136 /**
1137  * cm_roam_candidate_event_handler() - CM callback to save roam
1138  * candidate entry in scan db
1139  *
1140  * @psoc: psoc objmgr ptr
1141  * @candidate: roam scan candidate info
1142  */
1143 QDF_STATUS
1144 cm_roam_candidate_event_handler(struct wlan_objmgr_psoc *psoc,
1145 				struct roam_scan_candidate_frame *candidate);
1146 
1147 /**
1148  * wlan_cm_is_roam_sync_in_progress() - Check if the vdev is in roam sync
1149  * substate
1150  * @psoc: psoc pointer
1151  * @vdev_id: vdev_id
1152  *
1153  * Return: bool
1154  */
1155 bool wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc,
1156 				      uint8_t vdev_id);
1157 
1158 /**
1159  * wlan_cm_set_roam_offload_bssid() - Set the roam offload bssid of the sae
1160  * roam candidate
1161  * @vdev: pointer to vdev
1162  * @bssid: bssid
1163  *
1164  * Return: None
1165  */
1166 void
1167 wlan_cm_set_roam_offload_bssid(struct wlan_objmgr_vdev *vdev,
1168 			       struct qdf_mac_addr *bssid);
1169 
1170 /**
1171  * wlan_cm_get_roam_offload_bssid() - Get the roam offload bssid of the sae
1172  * roam candidate
1173  * @vdev: pointer to vdev
1174  * @bssid: bssid
1175  *
1176  * Return: None
1177  */
1178 void
1179 wlan_cm_get_roam_offload_bssid(struct wlan_objmgr_vdev *vdev,
1180 			       struct qdf_mac_addr *bssid);
1181 
1182 /**
1183  * wlan_cm_set_roam_offload_ssid() - Set the roam offload candidate ssid
1184  *
1185  * @vdev: pointer to vdev
1186  * @ssid: ssid of candidate
1187  * @len: length of ssid
1188  *
1189  * Return: None
1190  */
1191 void
1192 wlan_cm_set_roam_offload_ssid(struct wlan_objmgr_vdev *vdev,
1193 			      uint8_t *ssid, uint8_t len);
1194 
1195 /**
1196  * wlan_cm_get_roam_offload_ssid() - Get the roam offload candidate ssid
1197  *
1198  * @psoc: pointer to psoc
1199  * @vdev_id: vdev id
1200  * @ssid: ssid of the candidate
1201  * @len: length of the ssid
1202  *
1203  * Return: None
1204  */
1205 void
1206 wlan_cm_get_roam_offload_ssid(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1207 			      uint8_t *ssid, uint8_t *len);
1208 
1209 /**
1210  * wlan_cm_roam_set_ho_delay_config() - Set roam hand-off delay
1211  * @psoc: PSOC pointer
1212  * @roam_ho_delay: vendor configured roam HO delay value
1213  *
1214  * Return: none
1215  */
1216 void
1217 wlan_cm_roam_set_ho_delay_config(struct wlan_objmgr_psoc *psoc,
1218 				 uint16_t roam_ho_delay);
1219 
1220 /**
1221  * wlan_cm_roam_get_ho_delay_config() - Get roam hand-off delay
1222  * @psoc: PSOC pointer
1223  *
1224  * Return: Roam HO delay value
1225  */
1226 uint16_t
1227 wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc);
1228 
1229 /**
1230  * wlan_cm_set_exclude_rm_partial_scan_freq() - set value to include/exclude
1231  * the partial scan channels in roam full scan.
1232  * @psoc: PSOC pointer
1233  * @exclude_rm_partial_scan_freq: Include/exclude the channels in roam full scan
1234  * that are already scanned as part of partial scan.
1235  *
1236  * Return: none
1237  */
1238 void
1239 wlan_cm_set_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
1240 					 uint8_t exclude_rm_partial_scan_freq);
1241 
1242 /**
1243  * wlan_cm_get_exclude_rm_partial_scan_freq() - Get value to include/exclude
1244  * the partial scan channels in roam full scan.
1245  * @psoc: PSOC pointer
1246  *
1247  * Return: value to include/exclude the partial scan channels in roam full scan
1248  */
1249 uint8_t
1250 wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc);
1251 
1252 /**
1253  * wlan_cm_roam_set_full_scan_6ghz_on_disc() - set value to include the 6 GHz
1254  * channels in roam full scan only on prior discovery of any 6 GHz support in
1255  * the environment.
1256  * @psoc: PSOC pointer
1257  * @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan:
1258  * 1 - Include only on prior discovery of any 6 GHz support in the environment
1259  * 0 - Include all the supported 6 GHz channels by default
1260  *
1261  * Return: none
1262  */
1263 void
1264 wlan_cm_roam_set_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
1265 					uint8_t roam_full_scan_6ghz_on_disc);
1266 
1267 /**
1268  * wlan_cm_roam_get_full_scan_6ghz_on_disc() - Get value to include the 6 GHz
1269  * channels in roam full scan only on prior discovery of any 6 GHz support in
1270  * the environment.
1271  * @psoc: PSOC pointer
1272  *
1273  * Return:
1274  * 1 - Include only on prior discovery of any 6 GHz support in the environment
1275  * 0 - Include all the supported 6 GHz channels by default
1276  */
1277 uint8_t wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc);
1278 
1279 #ifdef WLAN_FEATURE_ROAM_INFO_STATS
1280 /**
1281  * mlme_cm_alloc_roam_stats_info() - alloc roam stats info buffer
1282  * @vdev_mlme: MLME-private vdev context
1283  *
1284  * Return: None
1285  */
1286 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme);
1287 
1288 /**
1289  * mlme_cm_free_roam_stats_info() - free roam stats info buffer in
1290  * struct mlme_legacy_priv
1291  * @ext_hdl: mlme_legacy_priv pointer
1292  *
1293  * Return: None
1294  */
1295 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl);
1296 
1297 /**
1298  * wlan_cm_roam_stats_info_get() - get vdev roam stats info
1299  *
1300  * @vdev: pointer to vdev
1301  * @roam_info: pointer to buffer to copy roam stats info
1302  * @roam_num: pointer to valid roam stats num
1303  *
1304  * Return: QDF_STATUS
1305  */
1306 
1307 QDF_STATUS
1308 wlan_cm_roam_stats_info_get(struct wlan_objmgr_vdev *vdev,
1309 			    struct enhance_roam_info **roam_info,
1310 			    uint32_t  *roam_num);
1311 #else
1312 static inline
1313 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme)
1314 {
1315 }
1316 
1317 static inline
1318 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl)
1319 {
1320 }
1321 #endif
1322 
1323 /**
1324  * wlan_cm_update_offload_ssid_from_candidate() - Set the roam offload ssid of
1325  * the roam candidate into the mlme priv
1326  *
1327  * @pdev: pointer to pdev
1328  * @vdev_id: vdev id
1329  * @ap_bssid: roam candidate bssid
1330  *
1331  * Get the scan entry corresponding to the bssid and save the ssid
1332  * in the mlme priv of the STA vdev
1333  *
1334  * Return: QDF_STATUS
1335  */
1336 QDF_STATUS
1337 wlan_cm_update_offload_ssid_from_candidate(struct wlan_objmgr_pdev *pdev,
1338 					   uint8_t vdev_id,
1339 					   struct qdf_mac_addr *ap_bssid);
1340 
1341 /**
1342  * wlan_cm_add_frame_to_scan_db() - Add the frame to scan db
1343  *
1344  * @psoc: PSOC pointer
1345  * @frame: frame to be added to scan db
1346  *
1347  * Fetch the channel from frame and add the frame to scan db
1348  *
1349  * Return: QDF_STATUS
1350  */
1351 QDF_STATUS
1352 wlan_cm_add_frame_to_scan_db(struct wlan_objmgr_psoc *psoc,
1353 			     struct roam_scan_candidate_frame *frame);
1354 
1355 /**
1356  * wlan_cm_add_all_link_probe_rsp_to_scan_db() - Parse and generate
1357  * probe responses for each of the per-sta profile
1358  *
1359  * @psoc: psoc objmgr ptr
1360  * @candidate: roam scan candidate info
1361  */
1362 QDF_STATUS
1363 wlan_cm_add_all_link_probe_rsp_to_scan_db(struct wlan_objmgr_psoc *psoc,
1364 				struct roam_scan_candidate_frame *candidate);
1365 
1366 #else
1367 static inline
1368 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc,
1369 					uint8_t vdev_id,
1370 					bool pcl_per_vdev)
1371 {}
1372 
1373 static inline
1374 uint32_t wlan_cm_get_roam_band_value(struct wlan_objmgr_psoc *psoc,
1375 				     struct wlan_objmgr_vdev *vdev)
1376 {
1377 	uint32_t current_band;
1378 
1379 	ucfg_reg_get_band(wlan_vdev_get_pdev(vdev), &current_band);
1380 
1381 	return current_band;
1382 }
1383 
1384 static inline
1385 bool wlan_cm_roam_is_pcl_per_vdev_active(struct wlan_objmgr_psoc *psoc,
1386 					 uint8_t vdev_id)
1387 {
1388 	return false;
1389 }
1390 
1391 static inline void
1392 wlan_cm_dual_sta_roam_update_connect_channels(struct wlan_objmgr_psoc *psoc,
1393 					      struct scan_filter *filter)
1394 {}
1395 
1396 static inline QDF_STATUS
1397 wlan_cm_roam_extract_btm_response(wmi_unified_t wmi, void *evt_buf,
1398 				  struct roam_btm_response_data *dst,
1399 				  uint8_t idx)
1400 {
1401 	return QDF_STATUS_E_NOSUPPORT;
1402 }
1403 
1404 static inline QDF_STATUS
1405 wlan_cm_roam_extract_frame_info(wmi_unified_t wmi, void *evt_buf,
1406 				struct roam_frame_info *dst, uint8_t idx)
1407 {
1408 	return QDF_STATUS_E_NOSUPPORT;
1409 }
1410 
1411 static inline QDF_STATUS
1412 wlan_cm_roam_extract_roam_initial_info(wmi_unified_t wmi, void *evt_buf,
1413 				       struct roam_initial_data *dst,
1414 				       uint8_t idx)
1415 {
1416 	return QDF_STATUS_E_NOSUPPORT;
1417 }
1418 
1419 static inline QDF_STATUS
1420 wlan_cm_roam_extract_roam_msg_info(wmi_unified_t wmi, void *evt_buf,
1421 				   struct roam_msg_info *dst, uint8_t idx)
1422 {
1423 	return QDF_STATUS_E_NOSUPPORT;
1424 }
1425 
1426 static inline void
1427 wlan_cm_roam_disable_vendor_btm(struct wlan_objmgr_psoc *psoc)
1428 {}
1429 
1430 static inline void
1431 wlan_cm_roam_set_vendor_btm_params(struct wlan_objmgr_psoc *psoc,
1432 				   struct wlan_cm_roam_vendor_btm_params *param)
1433 {}
1434 
1435 static inline void
1436 wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc,
1437 				    uint8_t vdev_id,
1438 				    struct roam_trigger_score_delta *param)
1439 {}
1440 
1441 static inline void
1442 wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc,
1443 				 struct wlan_roam_triggers *params)
1444 {}
1445 
1446 static inline QDF_STATUS
1447 wlan_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
1448 				       uint8_t vdev_id,
1449 				       uint32_t roam_scan_scheme_bitmap)
1450 {
1451 	return QDF_STATUS_E_NOSUPPORT;
1452 }
1453 
1454 static inline QDF_STATUS
1455 wlan_cm_set_roam_band_bitmask(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1456 			      uint32_t roam_band_bitmask)
1457 {
1458 	return QDF_STATUS_E_NOSUPPORT;
1459 }
1460 
1461 static inline
1462 uint32_t wlan_cm_get_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
1463 					     uint8_t vdev_id)
1464 {
1465 	return 0;
1466 }
1467 
1468 static inline QDF_STATUS
1469 wlan_cm_update_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1470 			   uint32_t value, enum roam_fail_params states)
1471 {
1472 	return QDF_STATUS_SUCCESS;
1473 }
1474 
1475 static inline uint32_t
1476 wlan_cm_get_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1477 			enum roam_fail_params states)
1478 {
1479 	return 0;
1480 }
1481 
1482 static inline void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev,
1483 				       uint8_t vdev_id, uint8_t *psk_pmk,
1484 				       uint8_t pmk_len)
1485 {}
1486 
1487 static inline QDF_STATUS
1488 cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
1489 		    struct wlan_objmgr_vdev *vdev)
1490 {
1491 	return false;
1492 }
1493 
1494 static inline void
1495 cm_handle_roam_reason_ho_failed(uint8_t vdev_id, struct qdf_mac_addr bssid,
1496 				struct cm_hw_mode_trans_ind *hw_mode_trans_ind)
1497 {}
1498 
1499 static inline QDF_STATUS
1500 cm_handle_scan_ch_list_data(struct cm_roam_scan_ch_resp *data)
1501 {
1502 	return QDF_STATUS_E_NOSUPPORT;
1503 }
1504 
1505 static inline QDF_STATUS
1506 wlan_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1507 			     uint8_t value, enum roam_rt_stats_params stats)
1508 {
1509 	return QDF_STATUS_SUCCESS;
1510 }
1511 
1512 static inline uint8_t
1513 wlan_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1514 			  enum roam_rt_stats_params stats)
1515 {
1516 	return 0;
1517 }
1518 
1519 static inline void
1520 cm_report_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
1521 			uint8_t vdev_id, enum roam_rt_stats_type events,
1522 			struct roam_stats_event *roam_info,
1523 			uint32_t value, uint8_t idx, uint32_t reason)
1524 {}
1525 
1526 static inline QDF_STATUS
1527 cm_roam_candidate_event_handler(struct wlan_objmgr_psoc *psoc,
1528 				struct roam_scan_candidate_frame *candidate)
1529 {
1530 	return QDF_STATUS_SUCCESS;
1531 }
1532 
1533 static inline QDF_STATUS
1534 cm_roam_sync_event_handler(struct wlan_objmgr_psoc *psoc,
1535 			   uint8_t *event, uint32_t len,
1536 			   struct roam_offload_synch_ind *sync_ind)
1537 {
1538 	return QDF_STATUS_SUCCESS;
1539 }
1540 
1541 static inline QDF_STATUS
1542 cm_roam_sync_frame_event_handler(struct wlan_objmgr_psoc *psoc,
1543 				 struct roam_synch_frame_ind *frame_ind)
1544 {
1545 	return QDF_STATUS_SUCCESS;
1546 }
1547 
1548 static inline bool
1549 wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc,
1550 				 uint8_t vdev_id)
1551 {
1552 	return false;
1553 }
1554 
1555 static inline void
1556 wlan_cm_set_roam_offload_bssid(struct wlan_objmgr_vdev *vdev,
1557 			       struct qdf_mac_addr *bssid)
1558 {
1559 }
1560 
1561 static inline void
1562 wlan_cm_get_roam_offload_bssid(struct wlan_objmgr_vdev *vdev,
1563 			       struct qdf_mac_addr *bssid)
1564 {
1565 }
1566 
1567 static inline void
1568 wlan_cm_set_roam_offload_ssid(struct wlan_objmgr_vdev *vdev,
1569 			      uint8_t *ssid, uint8_t len)
1570 {
1571 }
1572 
1573 static inline void
1574 wlan_cm_get_roam_offload_ssid(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
1575 			      uint8_t *ssid, uint8_t *len)
1576 {
1577 }
1578 
1579 static inline uint16_t
1580 wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc)
1581 {
1582 	return 0;
1583 }
1584 
1585 static inline uint8_t
1586 wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc)
1587 {
1588 	return 0;
1589 }
1590 
1591 static inline uint8_t
1592 wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc)
1593 {
1594 	return 0;
1595 }
1596 
1597 static inline
1598 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme)
1599 {
1600 }
1601 
1602 static inline
1603 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl)
1604 {
1605 }
1606 
1607 static inline QDF_STATUS
1608 wlan_cm_update_offload_ssid_from_candidate(struct wlan_objmgr_pdev *pdev,
1609 					   uint8_t vdev_id,
1610 					   struct qdf_mac_addr *ap_bssid)
1611 {
1612 	return QDF_STATUS_SUCCESS;
1613 }
1614 
1615 static inline QDF_STATUS
1616 wlan_cm_add_frame_to_scan_db(struct wlan_objmgr_psoc *psoc,
1617 			     struct roam_scan_candidate_frame *frame)
1618 {
1619 	return QDF_STATUS_SUCCESS;
1620 }
1621 
1622 static inline QDF_STATUS
1623 wlan_cm_add_all_link_probe_rsp_to_scan_db(struct wlan_objmgr_psoc *psoc,
1624 				struct roam_scan_candidate_frame *candidate)
1625 {
1626 	return QDF_STATUS_SUCCESS;
1627 }
1628 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
1629 
1630 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
1631 /**
1632  * cm_roam_sync_key_event_handler() - Handle roam sync key event and
1633  * store the keys in crypto module
1634  * @psoc:  Pointer to psoc object
1635  * @keys:  Pointer to the keys
1636  * @num_keys: Number of links for which keys entries are available
1637  *
1638  * Return: QDF_STATUS
1639  */
1640 QDF_STATUS cm_roam_sync_key_event_handler(struct wlan_objmgr_psoc *psoc,
1641 					  struct wlan_crypto_key_entry *keys,
1642 					  uint8_t num_keys);
1643 #else
1644 static inline
1645 QDF_STATUS cm_roam_sync_key_event_handler(struct wlan_objmgr_psoc *psoc,
1646 					  struct wlan_crypto_key_entry *keys,
1647 					  uint8_t num_keys)
1648 {
1649 	return QDF_STATUS_E_NOSUPPORT;
1650 }
1651 #endif
1652 
1653 #ifdef WLAN_FEATURE_FIPS
1654 /**
1655  * cm_roam_pmkid_req_ind() - Function to handle
1656  * roam event from firmware for pmkid generation.
1657  * @psoc: psoc pointer
1658  * @vdev_id: Vdev id
1659  * @bss_list: candidate AP bssid list
1660  */
1661 QDF_STATUS
1662 cm_roam_pmkid_req_ind(struct wlan_objmgr_psoc *psoc,
1663 		      uint8_t vdev_id, struct roam_pmkid_req_event *bss_list);
1664 #else /* WLAN_FEATURE_FIPS */
1665 static inline QDF_STATUS
1666 cm_roam_pmkid_req_ind(struct wlan_objmgr_psoc *psoc,
1667 		      uint8_t vdev_id, struct roam_pmkid_req_event *bss_list)
1668 {
1669 	return QDF_STATUS_SUCCESS;
1670 }
1671 #endif /* WLAN_FEATURE_FIPS */
1672 
1673 /**
1674  * wlan_get_chan_by_bssid_from_rnr: get chan from rnr through bssid
1675  * @vdev: vdev
1676  * @cm_id: connect manager id
1677  * @link_addr: bssid of given link
1678  * @chan: chan to get
1679  * @op_class: operation class
1680  *
1681  * Return: QDF_STATUS
1682  */
1683 QDF_STATUS wlan_get_chan_by_bssid_from_rnr(struct wlan_objmgr_vdev *vdev,
1684 					   wlan_cm_id cm_id,
1685 					   struct qdf_mac_addr *link_addr,
1686 					   uint8_t *chan, uint8_t *op_class);
1687 
1688 /**
1689  * wlan_get_chan_by_link_id_from_rnr: get chan from rnr through link id
1690  * @vdev: vdev
1691  * @cm_id: connect manager id
1692  * @link_id: link id of given link
1693  * @chan: chan to get
1694  * @op_class: operation class
1695  *
1696  * Return: QDF_STATUS
1697  */
1698 #ifdef WLAN_FEATURE_11BE_MLO
1699 QDF_STATUS wlan_get_chan_by_link_id_from_rnr(struct wlan_objmgr_vdev *vdev,
1700 					     wlan_cm_id cm_id,
1701 					     uint8_t link_id,
1702 					     uint8_t *chan, uint8_t *op_class);
1703 #endif
1704 
1705 /**
1706  * cm_rso_cmd_status_event_handler() - Handler for rso cmd status
1707  * @vdev_id: vdev id
1708  * @notif: roam notification of type enum cm_roam_notif
1709  *
1710  * Return: QDF_STATUS
1711  */
1712 int cm_rso_cmd_status_event_handler(uint8_t vdev_id, enum cm_roam_notif notif);
1713 
1714 /**
1715  * cm_handle_roam_reason_invoke_roam_fail() - Handler for roam invoke fail event
1716  * @vdev_id: vdev id
1717  * @notif_params: contains roam invoke fail reason from wmi_roam_invoke_error_t
1718  * @trans_ind: hw_mode transition indication
1719  *
1720  * Return: None
1721  */
1722 void
1723 cm_handle_roam_reason_invoke_roam_fail(uint8_t vdev_id,	uint32_t notif_params,
1724 				       struct cm_hw_mode_trans_ind *trans_ind);
1725 
1726 /**
1727  * cm_handle_roam_sync_update_hw_mode() - Handler for roam sync hw mode update
1728  * @trans_ind: hw_mode transition indication
1729  *
1730  * Return: None
1731  */
1732 void
1733 cm_handle_roam_sync_update_hw_mode(struct cm_hw_mode_trans_ind *trans_ind);
1734 
1735 /**
1736  * cm_handle_roam_reason_deauth() - Handler for roam due to deauth from AP
1737  * @vdev_id: vdev id
1738  * @notif_params: contains roam invoke fail reason from wmi_roam_invoke_error_t
1739  * @deauth_disassoc_frame: Disassoc or deauth frame
1740  * @frame_len: Contains the length of @deauth_disassoc_frame
1741  *
1742  * Return: None
1743  */
1744 void cm_handle_roam_reason_deauth(uint8_t vdev_id, uint32_t notif_params,
1745 				  uint8_t *deauth_disassoc_frame,
1746 				  uint32_t frame_len);
1747 
1748 /**
1749  * cm_handle_roam_reason_btm() - Handler for roam due to btm from AP
1750  * @vdev_id: vdev id
1751  *
1752  * Return: None
1753  */
1754 void cm_handle_roam_reason_btm(uint8_t vdev_id);
1755 
1756 /**
1757  * cm_handle_roam_reason_bmiss() - Handler for roam due to bmiss
1758  * @vdev_id: vdev id
1759  * @rssi: RSSI value
1760  *
1761  * Return: None
1762  */
1763 void cm_handle_roam_reason_bmiss(uint8_t vdev_id, uint32_t rssi);
1764 
1765 /**
1766  * cm_handle_roam_reason_better_ap() - Handler for roam due to better AP
1767  * @vdev_id: vdev id
1768  * @rssi: RSSI value
1769  *
1770  * Return: None
1771  */
1772 void cm_handle_roam_reason_better_ap(uint8_t vdev_id, uint32_t rssi);
1773 
1774 /**
1775  * cm_handle_roam_reason_suitable_ap() - Handler for roam due to suitable AP
1776  * @vdev_id: vdev id
1777  * @rssi: RSSI value
1778  *
1779  * Return: None
1780  */
1781 void cm_handle_roam_reason_suitable_ap(uint8_t vdev_id, uint32_t rssi);
1782 
1783 /**
1784  * cm_roam_event_handler() - Carries extracted roam info
1785  * @roam_event: data carried by roam event
1786  *
1787  * Return: QDF_STATUS
1788  */
1789 QDF_STATUS
1790 cm_roam_event_handler(struct roam_offload_roam_event *roam_event);
1791 
1792 /**
1793  * cm_btm_denylist_event_handler() - Deny list the given BSSID due to btm
1794  * @psoc: PSOC pointer
1795  * @list: Roam denylist info
1796  *
1797  * Return: QDF_STATUS
1798  */
1799 QDF_STATUS
1800 cm_btm_denylist_event_handler(struct wlan_objmgr_psoc *psoc,
1801 			      struct roam_denylist_event *list);
1802 
1803 /**
1804  * cm_vdev_disconnect_event_handler() - disconnect evt handler for target_if
1805  * @data: disconnect event data
1806  *
1807  * Return: QDF_STATUS
1808  */
1809 QDF_STATUS
1810 cm_vdev_disconnect_event_handler(struct vdev_disconnect_event_data *data);
1811 
1812 /**
1813  * cm_handle_disconnect_reason() - disconnect reason evt wrapper for wma
1814  * @data: disconnect event data
1815  *
1816  * Return: QDF_STATUS
1817  */
1818 QDF_STATUS
1819 cm_handle_disconnect_reason(struct vdev_disconnect_event_data *data);
1820 
1821 /**
1822  * cm_roam_scan_ch_list_event_handler() - Roam scan ch evt handler for target_if
1823  * @data: roam scan channel event data
1824  *
1825  * Return: QDF_STATUS
1826  */
1827 QDF_STATUS
1828 cm_roam_scan_ch_list_event_handler(struct cm_roam_scan_ch_resp *data);
1829 
1830 /**
1831  * cm_roam_stats_event_handler() - Carries extracted roam stats info
1832  * @psoc: PSOC pointer
1833  * @stats_info: stats data carried by roam_stats_event
1834  *
1835  * Return: QDF_STATUS
1836  */
1837 QDF_STATUS
1838 cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,
1839 			    struct roam_stats_event *stats_info);
1840 
1841 /**
1842  * cm_handle_auth_offload() - auth offload evt wrapper for wma
1843  * @auth_event: auth offload event data
1844  *
1845  * Return: QDF_STATUS
1846  */
1847 QDF_STATUS
1848 cm_handle_auth_offload(struct auth_offload_event *auth_event);
1849 
1850 /**
1851  * cm_roam_auth_offload_event_handler() - Handler for auth offload event
1852  * @auth_event: Authentication event
1853  *
1854  * Return: QDF_STATUS
1855  */
1856 QDF_STATUS
1857 cm_roam_auth_offload_event_handler(struct auth_offload_event *auth_event);
1858 
1859 /*
1860  * cm_roam_pmkid_request_handler() - Carries extracted pmkid list info
1861  * @data: Pmkid event with entries
1862  *
1863  * Return: QDF_STATUS
1864  */
1865 QDF_STATUS
1866 cm_roam_pmkid_request_handler(struct roam_pmkid_req_event *data);
1867 
1868 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
1869 /**
1870  * cm_roam_vendor_handoff_event_handler() - vendor handoff event handler
1871  * @psoc: psoc object
1872  * @data: vendor handoff params
1873  *
1874  * Return: None
1875  */
1876 void
1877 cm_roam_vendor_handoff_event_handler(struct wlan_objmgr_psoc *psoc,
1878 				     struct roam_vendor_handoff_params *data);
1879 #endif
1880 
1881 /**
1882  * cm_roam_update_vdev() - Update the STA and BSS
1883  * @sync_ind: Information needed for roam sync propagation
1884  * @vdev_id: vdev id
1885  *
1886  * This function will perform all the vdev related operations with
1887  * respect to the self sta and the peer after roaming and completes
1888  * the roam synch propagation with respect to WMA layer.
1889  *
1890  * Return: None
1891  */
1892 void cm_roam_update_vdev(struct roam_offload_synch_ind *sync_ind,
1893 			 uint8_t vdev_id);
1894 
1895 /**
1896  * cm_roam_pe_sync_callback() - Callback registered at pe, gets invoked when
1897  * ROAM SYNCH event is received from firmware
1898  * @sync_ind: Structure with roam synch parameters
1899  * @vdev_id: vdev id
1900  * @len: length for bss_description
1901  *
1902  * This is a PE level callback called from CM to complete the roam synch
1903  * propagation at PE level and also fill the BSS descriptor which will be
1904  * helpful further to complete the roam synch propagation.
1905  *
1906  * Return: QDF_STATUS
1907  */
1908 QDF_STATUS
1909 cm_roam_pe_sync_callback(struct roam_offload_synch_ind *sync_ind,
1910 			 uint8_t vdev_id, uint16_t len);
1911 
1912 /**
1913  * cm_update_phymode_on_roam() - Update new phymode after
1914  * ROAM SYNCH event is received from firmware
1915  * @vdev_id: roamed vdev id
1916  * @sync_ind: Structure with roam synch parameters
1917  *
1918  * This api will update the phy mode after roam sync is received.
1919  *
1920  * Return: none
1921  */
1922 void
1923 cm_update_phymode_on_roam(uint8_t vdev_id,
1924 			  struct roam_offload_synch_ind *sync_ind);
1925 
1926 /**
1927  * wlan_cm_fw_to_host_phymode() - Convert fw phymode to host
1928  * @phymode: wmi phymode
1929  *
1930  * This api will convert the phy mode from fw to host type.
1931  *
1932  * Return: wlan phymode
1933  */
1934 enum wlan_phymode
1935 wlan_cm_fw_to_host_phymode(WMI_HOST_WLAN_PHY_MODE phymode);
1936 
1937 /**
1938  * wlan_cm_sta_mlme_vdev_roam_notify() - STA mlme vdev roam notify
1939  * @vdev_mlme: MLME-private vdev context
1940  * @data_len: Length of @data
1941  * @data: Roam data
1942  *
1943  * This function will handle the roam notify event
1944  *
1945  * Return: QDF_STATUS
1946  */
1947 QDF_STATUS
1948 wlan_cm_sta_mlme_vdev_roam_notify(struct vdev_mlme_obj *vdev_mlme,
1949 				  uint16_t data_len, void *data);
1950 
1951 /**
1952  * wlan_cm_same_band_sta_allowed() - check if same band STA +STA is allowed
1953  *
1954  * @psoc: psoc ptr
1955  *
1956  * Return: true if same band STA+STA is allowed
1957  */
1958 bool wlan_cm_same_band_sta_allowed(struct wlan_objmgr_psoc *psoc);
1959 
1960 /**
1961  * cm_cleanup_mlo_link() - Cleanup the MLO link
1962  *
1963  * @vdev: MLO link vdev
1964  *
1965  * This posts the event WLAN_CM_SM_EV_ROAM_LINK_DOWN to CM to cleanup the
1966  * resources allocated for MLO link e.g. vdev, pe_session, etc..
1967  * This gets called when MLO to non-MLO roaming happens
1968  *
1969  * Return: qdf_status
1970  */
1971 QDF_STATUS cm_cleanup_mlo_link(struct wlan_objmgr_vdev *vdev);
1972 
1973 /**
1974  * wlan_is_roaming_enabled() - Check if Roaming is enabled
1975  *
1976  * @pdev: pointer to pdev object
1977  * @vdev_id : Vdev id
1978  *
1979  * Check if the ROAM enable vdev param (WMI_VDEV_PARAM_ROAM_FW_OFFLOAD)
1980  * is sent to firmware or not.
1981  *
1982  * Return: True if RSO state is not DEINIT, which indicates that vdev param
1983  * WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent to firmware.
1984  */
1985 bool wlan_is_roaming_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
1986 
1987 /**
1988  * wlan_is_rso_enabled() - Check if RSO state is enabled
1989  *
1990  * @pdev: pointer to pdev object
1991  * @vdev_id : Vdev id
1992  *
1993  * Check if the ROAM SCAN OFFLOAD enable is sent to firmware. Host driver tracks
1994  * this through RSO state machine and the states can be WLAN_ROAM_RSO_ENABLED/
1995  * WLAN_ROAMING_IN_PROG/WLAN_ROAM_SYNCH_IN_PROG/WLAN_MLO_ROAM_SYNCH_IN_PROG.
1996  *
1997  * Return: True if RSO state is any of the above mentioned states.
1998  */
1999 bool wlan_is_rso_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
2000 
2001 /**
2002  * wlan_cm_set_sae_auth_ta() - Set SAE auth tx address
2003  * @pdev: pdev object
2004  * @vdev_id : Vdev id
2005  * @sae_auth_ta: SAE auth tx address
2006  *
2007  * Return: QDF_STATUS
2008  */
2009 QDF_STATUS
2010 wlan_cm_set_sae_auth_ta(struct wlan_objmgr_pdev *pdev,
2011 			uint8_t vdev_id,
2012 			struct qdf_mac_addr sae_auth_ta);
2013 
2014 /**
2015  * wlan_cm_get_sae_auth_ta() - Get SAE auth tx address
2016  * @pdev: pdev object
2017  * @vdev_id: Vdev id
2018  * @sae_auth_ta: SAE auth tx address
2019  *
2020  * Return: QDF_STATUS
2021  */
2022 QDF_STATUS
2023 wlan_cm_get_sae_auth_ta(struct wlan_objmgr_pdev *pdev,
2024 			uint8_t vdev_id,
2025 			struct qdf_mac_addr *sae_auth_ta);
2026 
2027 /**
2028  * wlan_cm_set_assoc_btm_cap() - Set the assoc BTM capability
2029  * @vdev: pointer to vdev
2030  * @val: BTM cap
2031  *
2032  * Return: None
2033  */
2034 void
2035 wlan_cm_set_assoc_btm_cap(struct wlan_objmgr_vdev *vdev, bool val);
2036 
2037 /**
2038  * wlan_cm_get_assoc_btm_cap() - Get the assoc BTM capability
2039  * @vdev: pointer to vdev
2040  *
2041  * Return: BTM cap
2042  */
2043 bool
2044 wlan_cm_get_assoc_btm_cap(struct wlan_objmgr_vdev *vdev);
2045 
2046 /**
2047  * wlan_cm_is_self_mld_roam_supported() - Is self mld roam supported
2048  * @psoc: pointer to psoc object
2049  *
2050  * Return: bool, true: self mld roam supported
2051  */
2052 bool wlan_cm_is_self_mld_roam_supported(struct wlan_objmgr_psoc *psoc);
2053 
2054 #ifdef WLAN_FEATURE_11BE_MLO
2055 /**
2056  * wlan_cm_is_sae_auth_addr_conversion_required() - check whether address
2057  * conversion is required or not.
2058  * @vdev: pointer to vdev
2059  *
2060  * This API checks the address conversion (mld to link and vice-versa) for sae
2061  * auth frames for below listed scenarios when mlo sae auth external conversion
2062  * is true.
2063  *
2064  * Connected AP Roam AP Connection Conversion
2065  * (MLO vdev)
2066  *	non-ML  non-ML  initial     FALSE
2067  *	non-ML  ML      initial     FALSE
2068  *	non-ML  non-ML  roam        FALSE
2069  *	non-ML  ML      roam        TRUE
2070  *	ML      non-ML  initial     TRUE
2071  *	ML      ML      initial     TRUE
2072  *	ML      non-ML  roam        FALSE
2073  *	ML      ML      roam        TRUE
2074  *
2075  * Return: true if address conversion required, otherwise false.
2076  */
2077 bool
2078 wlan_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev);
2079 #else
2080 static inline bool
2081 wlan_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev)
2082 {
2083 	return false;
2084 }
2085 #endif /* WLAN_FEATURE_11BE_MLO */
2086 
2087 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
2088 /**
2089  * wlan_cm_store_mlo_roam_peer_address() - cache peer mld and link address
2090  * while roaming
2091  * @pdev: pdev object
2092  * @auth_event: auth offload event data
2093  *
2094  * Return: void
2095  */
2096 void
2097 wlan_cm_store_mlo_roam_peer_address(struct wlan_objmgr_pdev *pdev,
2098 				    struct auth_offload_event *auth_event);
2099 
2100 /**
2101  * wlan_cm_roaming_get_peer_mld_addr() - retrieve the peer mld address for
2102  * roaming.
2103  * @vdev: vdev pointer
2104  *
2105  * Return: pointer to struct qdf_mac_addr
2106  */
2107 struct qdf_mac_addr *
2108 wlan_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev *vdev);
2109 
2110 /**
2111  * wlan_cm_roaming_get_peer_link_addr() - get peer link address for roaming
2112  * @vdev: vdev pointer
2113  *
2114  * Return: pointer to struct qdf_mac_addr
2115  */
2116 struct qdf_mac_addr *
2117 wlan_cm_roaming_get_peer_link_addr(struct wlan_objmgr_vdev *vdev);
2118 
2119 /**
2120  * wlan_cm_roam_is_mlo_ap() - to check whether vdev will be roam to ml ap
2121  * @vdev: object manager vdev
2122  *
2123  * this function check whether roaming vdev will be connected to ml ap or not.
2124  *
2125  * Return: true if roam ap is ml capable otherwise false
2126  */
2127 bool
2128 wlan_cm_roam_is_mlo_ap(struct wlan_objmgr_vdev *vdev);
2129 
2130 /**
2131  * wlan_cm_link_switch_notif_cb() - MLME CM link switch notifier callback
2132  * @vdev: object manager vdev
2133  * @req: Link switch request
2134  * @notify_reason: Notify reason
2135  *
2136  * Return: QDF_STATUS
2137  */
2138 QDF_STATUS wlan_cm_link_switch_notif_cb(struct wlan_objmgr_vdev *vdev,
2139 					struct wlan_mlo_link_switch_req *req,
2140 					enum wlan_mlo_link_switch_notify_reason notify_reason);
2141 #else
2142 static inline void
2143 wlan_cm_store_mlo_roam_peer_address(struct wlan_objmgr_pdev *pdev,
2144 				    struct auth_offload_event *auth_event)
2145 {
2146 }
2147 
2148 static inline struct qdf_mac_addr *
2149 wlan_cm_roaming_get_mld_addr(struct wlan_objmgr_vdev *vdev)
2150 {
2151 	return NULL;
2152 }
2153 
2154 static inline struct qdf_mac_addr *
2155 wlan_cm_roaming_get_peer_link_addr(struct wlan_objmgr_vdev *vdev)
2156 {
2157 	return NULL;
2158 }
2159 
2160 static inline bool
2161 wlan_cm_roam_is_mlo_ap(struct wlan_objmgr_vdev *vdev)
2162 {
2163 	return false;
2164 }
2165 
2166 static inline
2167 QDF_STATUS wlan_cm_link_switch_notif_cb(struct wlan_objmgr_vdev *vdev,
2168 					struct wlan_mlo_link_switch_req *req,
2169 					enum wlan_mlo_link_switch_notify_reason notify_reason)
2170 {
2171 	return QDF_STATUS_E_NOSUPPORT;
2172 }
2173 #endif /* WLAN_FEATURE_11BE_MLO && WLAN_FEATURE_ROAM_OFFLOAD */
2174 
2175 /**
2176  * wlan_update_peer_phy_mode() - update phymode in peer object
2177  * @des_chan: wlan_channel pointer contain new ch_freq
2178  * @vdev: vdev pointer
2179  *
2180  * Return: QDF_STATUS_SUCCESS if peer object phymode is set otherwise
2181  *         QDF_STATUS_E_INVAL
2182  */
2183 QDF_STATUS
2184 wlan_update_peer_phy_mode(struct wlan_channel *des_chan,
2185 			  struct wlan_objmgr_vdev *vdev);
2186 
2187 #endif  /* WLAN_CM_ROAM_API_H__ */
2188