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