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_ucfg_api.h
20 *
21 * Implementation for roaming public ucfg API interfaces.
22 */
23
24 #ifndef _WLAN_CM_ROAM_UCFG_API_H_
25 #define _WLAN_CM_ROAM_UCFG_API_H_
26
27 #include "wlan_cm_roam_api.h"
28
29 /**
30 * ucfg_user_space_enable_disable_rso() - Enable/Disable Roam Scan offload
31 * to firmware.
32 * @pdev: Pointer to pdev
33 * @vdev_id: vdev id
34 * @is_fast_roam_enabled: Value provided by userspace.
35 * is_fast_roam_enabled - true: enable RSO if FastRoamEnabled ini is enabled
36 * false: disable RSO
37 *
38 * Return: QDF_STATUS
39 */
40 QDF_STATUS
41 ucfg_user_space_enable_disable_rso(struct wlan_objmgr_pdev *pdev,
42 uint8_t vdev_id,
43 const bool is_fast_roam_enabled);
44
45 /**
46 * ucfg_clear_user_disabled_roaming() - clear user/wpa_supplicant
47 * disabled_roaming flag in driver
48 * @psoc: Pointer to pdev
49 * @vdev_id: vdev id
50 *
51 * Return: void
52 */
53 void
54 ucfg_clear_user_disabled_roaming(struct wlan_objmgr_psoc *psoc,
55 uint8_t vdev_id);
56
57 /**
58 * ucfg_is_rso_enabled() - Check if rso is enabled
59 * @pdev: Pointer to pdev
60 * @vdev_id: vdev id
61 *
62 * Return: Wrapper for wlan_is_rso_enabled.
63 */
64 bool ucfg_is_rso_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
65
66 /*
67 * ucfg_cm_abort_roam_scan() -abort current roam scan cycle by roam scan
68 * offload module.
69 * @pdev: Pointer to pdev
70 * vdev_id - vdev Identifier
71 *
72 * Return QDF_STATUS
73 */
74 QDF_STATUS ucfg_cm_abort_roam_scan(struct wlan_objmgr_pdev *pdev,
75 uint8_t vdev_id);
76
77 #ifdef FEATURE_WLAN_ESE
78 /**
79 * ucfg_cm_set_ese_roam_scan_channel_list() - To set ese roam scan channel list
80 * @pdev: pdev pointer
81 * @vdev_id: vdev_id id
82 * @chan_freq_list: Output channel list
83 * @num_chan: Output number of channels
84 *
85 * Return: QDF_STATUS
86 */
87 QDF_STATUS ucfg_cm_set_ese_roam_scan_channel_list(struct wlan_objmgr_pdev *pdev,
88 uint8_t vdev_id,
89 qdf_freq_t *chan_freq_list,
90 uint8_t num_chan);
91 QDF_STATUS ucfg_cm_set_cckm_ie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
92 const uint8_t *cck_ie, const uint8_t cck_ie_len);
93 #endif
94
95 /**
96 * ucfg_cm_get_roam_band() - Get roam band from rso config
97 * @psoc: Pointer to psoc
98 * @vdev_id: vdev id
99 * @roam_band: Pointer of a buffer to fill the roam band
100 *
101 * Return: QDF_STATUS
102 */
103 QDF_STATUS ucfg_cm_get_roam_band(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
104 uint32_t *roam_band);
105
106 /**
107 * ucfg_cm_rso_set_roam_trigger() - Send roam trigger bitmap firmware
108 * @pdev: Pointer to pdev
109 * @vdev_id: vdev id
110 * @trigger: Carries pointer of the object containing vdev id and
111 * roam_trigger_bitmap.
112 *
113 * Return: QDF_STATUS
114 */
115 static inline QDF_STATUS
ucfg_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,struct wlan_roam_triggers * trigger)116 ucfg_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
117 struct wlan_roam_triggers *trigger)
118 {
119 return wlan_cm_rso_set_roam_trigger(pdev, vdev_id, trigger);
120 }
121
122 /**
123 * ucfg_cm_update_session_assoc_ie() - Send assoc ie
124 * @psoc: Pointer to psoc
125 * @vdev_id: vdev id
126 * @assoc_ie: assoc ir to update.
127 *
128 * Return: QDF_STATUS
129 */
130 static inline void
ucfg_cm_update_session_assoc_ie(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,struct element_info * assoc_ie)131 ucfg_cm_update_session_assoc_ie(struct wlan_objmgr_psoc *psoc,
132 uint8_t vdev_id,
133 struct element_info *assoc_ie)
134 {
135 cm_update_session_assoc_ie(psoc, vdev_id, assoc_ie);
136 }
137
138 static inline void
ucfg_cm_get_associated_ch_info(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,enum phy_ch_width scanned_ch_width,struct assoc_channel_info * assoc_chan_info)139 ucfg_cm_get_associated_ch_info(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
140 enum phy_ch_width scanned_ch_width,
141 struct assoc_channel_info *assoc_chan_info)
142 {
143 wlan_cm_get_associated_ch_info(psoc, vdev_id, scanned_ch_width,
144 assoc_chan_info);
145 }
146
147 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
148 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
149 /**
150 * ucfg_cm_roam_link_speed_update() - Update link speed state for roaming
151 * @psoc: psoc pointer
152 * @vdev_id: vdev id
153 * @is_link_speed_good: true means link speed good, false means bad
154 *
155 * Return: QDF_STATUS
156 */
157 static inline
ucfg_cm_roam_link_speed_update(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool is_link_speed_good)158 void ucfg_cm_roam_link_speed_update(struct wlan_objmgr_psoc *psoc,
159 uint8_t vdev_id,
160 bool is_link_speed_good)
161 {
162 wlan_cm_roam_link_speed_update(psoc,
163 vdev_id,
164 is_link_speed_good);
165 }
166
167 /**
168 * ucfg_cm_is_linkspeed_roam_trigger_supported() - Get roam linkspeed check
169 * @psoc: pointer to psoc object
170 *
171 * Return: bool, true: Linkspeed check for low rssi roaming supported
172 */
173 static inline bool
ucfg_cm_is_linkspeed_roam_trigger_supported(struct wlan_objmgr_psoc * psoc)174 ucfg_cm_is_linkspeed_roam_trigger_supported(struct wlan_objmgr_psoc *psoc)
175 {
176 return wlan_cm_is_linkspeed_roam_trigger_supported(psoc);
177 }
178 #endif
179
180 static inline QDF_STATUS
ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_scan_scheme_bitmap)181 ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
182 uint8_t vdev_id,
183 uint32_t roam_scan_scheme_bitmap)
184 {
185 return wlan_cm_update_roam_scan_scheme_bitmap(psoc, vdev_id,
186 roam_scan_scheme_bitmap);
187 }
188
189 static inline QDF_STATUS
ucfg_cm_set_roam_band_mask(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_band_mask)190 ucfg_cm_set_roam_band_mask(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
191 uint32_t roam_band_mask)
192 {
193 return wlan_cm_set_roam_band_bitmask(psoc, vdev_id, roam_band_mask);
194 }
195
196 /**
197 * ucfg_cm_set_btm_config() - Inline ucfg api to set btm roaming disable flag
198 * @psoc: pointer to psoc object
199 * @vdev_id: vdev id
200 * @is_disable_btm: btm config flag that needs to be set from the caller
201 *
202 * Return: QDF Status
203 */
ucfg_cm_set_btm_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool is_disable_btm)204 static inline QDF_STATUS ucfg_cm_set_btm_config(struct wlan_objmgr_psoc *psoc,
205 uint8_t vdev_id,
206 bool is_disable_btm)
207 {
208 return wlan_cm_set_btm_config(psoc, vdev_id, is_disable_btm);
209 }
210
211 static inline QDF_STATUS
ucfg_cm_set_roam_band_update(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)212 ucfg_cm_set_roam_band_update(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
213 {
214 return wlan_cm_set_roam_band_update(psoc, vdev_id);
215 }
216
217 static inline bool
ucfg_cm_is_change_in_band_allowed(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_band_mask)218 ucfg_cm_is_change_in_band_allowed(struct wlan_objmgr_psoc *psoc,
219 uint8_t vdev_id, uint32_t roam_band_mask)
220 {
221 return cm_roam_is_change_in_band_allowed(psoc, vdev_id, roam_band_mask);
222 }
223
224 static inline QDF_STATUS
ucfg_cm_update_roam_rt_stats(struct wlan_objmgr_psoc * psoc,uint8_t value,enum roam_rt_stats_params stats)225 ucfg_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
226 uint8_t value, enum roam_rt_stats_params stats)
227 {
228 return wlan_cm_update_roam_rt_stats(psoc, value, stats);
229 }
230
231 static inline uint8_t
ucfg_cm_get_roam_rt_stats(struct wlan_objmgr_psoc * psoc,enum roam_rt_stats_params stats)232 ucfg_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
233 enum roam_rt_stats_params stats)
234 {
235 return wlan_cm_get_roam_rt_stats(psoc, stats);
236 }
237 #else
238 static inline QDF_STATUS
ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_scan_scheme_bitmap)239 ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
240 uint8_t vdev_id,
241 uint32_t roam_scan_scheme_bitmap)
242 {
243 return QDF_STATUS_SUCCESS;
244 }
245
246 static inline QDF_STATUS
ucfg_cm_set_roam_band_mask(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_band_mask)247 ucfg_cm_set_roam_band_mask(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
248 uint32_t roam_band_mask)
249 {
250 return QDF_STATUS_SUCCESS;
251 }
252
ucfg_cm_set_btm_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool is_disable_btm)253 static inline QDF_STATUS ucfg_cm_set_btm_config(struct wlan_objmgr_psoc *psoc,
254 uint8_t vdev_id,
255 bool is_disable_btm)
256 {
257 return QDF_STATUS_SUCCESS;
258 }
259
260 static inline QDF_STATUS
ucfg_cm_set_roam_band_update(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)261 ucfg_cm_set_roam_band_update(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
262 {
263 return QDF_STATUS_SUCCESS;
264 }
265
266 static inline bool
ucfg_cm_is_change_in_band_allowed(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint32_t roam_band_mask)267 ucfg_cm_is_change_in_band_allowed(struct wlan_objmgr_psoc *psoc,
268 uint8_t vdev_id, uint32_t roam_band_mask)
269 {
270 return true;
271 }
272
273 static inline QDF_STATUS
ucfg_cm_update_roam_rt_stats(struct wlan_objmgr_psoc * psoc,uint8_t value,enum roam_rt_stats_params stats)274 ucfg_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
275 uint8_t value, enum roam_rt_stats_params stats)
276 {
277 return QDF_STATUS_SUCCESS;
278 }
279
280 static inline uint8_t
ucfg_cm_get_roam_rt_stats(struct wlan_objmgr_psoc * psoc,enum roam_rt_stats_params stats)281 ucfg_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc,
282 enum roam_rt_stats_params stats)
283 {
284 return 0;
285 }
286
287 #endif
288
289 /**
290 * ucfg_wlan_cm_roam_invoke() - Invokes Roam request
291 * @pdev: Pointer to pdev
292 * @vdev_id: vdev id
293 * @bssid: Pointer to bssid to look for in scan cache
294 * @ch_freq: channel on which reassoc should be send
295 * @source: source of roam
296 *
297 * Return: true or false
298 */
299 QDF_STATUS
300 ucfg_wlan_cm_roam_invoke(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
301 struct qdf_mac_addr *bssid, qdf_freq_t ch_freq,
302 enum wlan_cm_source source);
303
304 #ifdef WLAN_FEATURE_FILS_SK
305 QDF_STATUS
306 ucfg_cm_update_fils_config(struct wlan_objmgr_psoc *psoc,
307 uint8_t vdev_id,
308 struct wlan_fils_con_info *fils_info);
309 #else
310 static inline QDF_STATUS
ucfg_cm_update_fils_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,struct wlan_fils_con_info * fils_info)311 ucfg_cm_update_fils_config(struct wlan_objmgr_psoc *psoc,
312 uint8_t vdev_id,
313 struct wlan_fils_con_info *fils_info)
314 {
315 return QDF_STATUS_SUCCESS;
316 }
317 #endif
318
319 #ifdef WLAN_FEATURE_HOST_ROAM
320 void ucfg_cm_ft_reset(struct wlan_objmgr_vdev *vdev);
321
322 /**
323 * ucfg_cm_set_ft_ies() - to set FT IEs
324 * @pdev: pdev ctx
325 * @vdev_id: vdev identifier
326 * @ft_ies: pointer to FT IEs
327 * @ft_ies_length: length of FT IEs
328 *
329 * Each time the supplicant sends down the FT IEs to the driver. This function
330 * is called in SME. This function packages and sends the FT IEs to PE.
331 *
332 * Return: none
333 */
334 void ucfg_cm_set_ft_ies(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
335 const uint8_t *ft_ies, uint16_t ft_ies_length);
336
337 /**
338 * ucfg_cm_check_ft_status() - Check for key wait status in FT mode
339 * @pdev: pdev ctx
340 * @vdev_id: vdev identifier
341 *
342 * Return: QDF_STATUS
343 */
344 QDF_STATUS ucfg_cm_check_ft_status(struct wlan_objmgr_pdev *pdev,
345 uint8_t vdev_id);
346
347 /**
348 * ucfg_cm_ft_key_ready_for_install() - API to check ft key ready for install
349 * @vdev: pdev handle
350 *
351 * It is only applicable for LFR2.0 enabled
352 *
353 * Return: true when ft key is ready otherwise false
354 */
355 bool ucfg_cm_ft_key_ready_for_install(struct wlan_objmgr_vdev *vdev);
356 void ucfg_cm_set_ft_pre_auth_state(struct wlan_objmgr_vdev *vdev, bool state);
357
358 #else /* WLAN_FEATURE_HOST_ROAM */
359
ucfg_cm_ft_reset(struct wlan_objmgr_vdev * vdev)360 static inline void ucfg_cm_ft_reset(struct wlan_objmgr_vdev *vdev) {}
361 static inline
ucfg_cm_set_ft_ies(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,const uint8_t * ft_ies,uint16_t ft_ies_length)362 void ucfg_cm_set_ft_ies(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
363 const uint8_t *ft_ies, uint16_t ft_ies_length) {}
364
365 static inline
ucfg_cm_check_ft_status(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id)366 QDF_STATUS ucfg_cm_check_ft_status(struct wlan_objmgr_pdev *pdev,
367 uint8_t vdev_id)
368 {
369 return QDF_STATUS_E_FAILURE;
370 }
371
ucfg_cm_set_ft_pre_auth_state(struct wlan_objmgr_vdev * vdev,bool state)372 static inline void ucfg_cm_set_ft_pre_auth_state(struct wlan_objmgr_vdev *vdev,
373 bool state) {}
374 #endif /* WLAN_FEATURE_HOST_ROAM */
375
376 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
377 /**
378 * ucfg_cm_reset_key() -Reset key information
379 * @pdev: pdev handle
380 * @vdev_id: vdev identifier
381 *
382 * Return: None
383 */
384 void ucfg_cm_reset_key(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
385
386 /**
387 * ucfg_cm_roam_send_rt_stats_config() - Enable/Disable Roam event stats from FW
388 * @pdev: Pointer to pdev
389 * @vdev_id: vdev id
390 * @param_value: Value set based on the userspace attributes.
391 * param_value - 0: if configure attribute is 0
392 * 1: if configure is 1 and suspend_state is not set
393 * 3: if configure is 1 and suspend_state is set
394 *
395 * Return: QDF_STATUS
396 */
397 QDF_STATUS
398 ucfg_cm_roam_send_rt_stats_config(struct wlan_objmgr_pdev *pdev,
399 uint8_t vdev_id, uint8_t param_value);
400
401 /**
402 * ucfg_cm_roam_send_ho_delay_config() - Send the HO delay value to Firmware
403 * @pdev: Pointer to pdev
404 * @vdev_id: vdev id
405 * @param_value: Value will be from range 20 to 1000 in msec.
406 *
407 * Return: QDF_STATUS
408 */
409 QDF_STATUS
410 ucfg_cm_roam_send_ho_delay_config(struct wlan_objmgr_pdev *pdev,
411 uint8_t vdev_id, uint16_t param_value);
412
413 /**
414 * ucfg_cm_exclude_rm_partial_scan_freq() - Exclude the channels in roam full
415 * scan that are already scanned as part of partial scan.
416 * @pdev: Pointer to pdev
417 * @vdev_id: vdev id
418 * @param_value: Include/exclude the partial scan channel in roam full scan
419 * 1 - Exclude
420 * 0 - Include
421 *
422 * Return: QDF_STATUS
423 */
424 QDF_STATUS
425 ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev,
426 uint8_t vdev_id, uint8_t param_value);
427
428 /**
429 * ucfg_cm_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels in roam
430 * full scan only on prior discovery of any 6 GHz support in the environment.
431 * @pdev: Pointer to pdev
432 * @vdev_id: vdev id
433 * @param_value: Include the 6 GHz channels in roam full scan:
434 * 1 - Include only on prior discovery of any 6 GHz support in the environment
435 * 0 - Include all the supported 6 GHz channels by default
436 *
437 * Return: QDF_STATUS
438 */
439 QDF_STATUS ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev,
440 uint8_t vdev_id,
441 uint8_t param_value);
442
443 /**
444 * ucfg_cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI
445 * at which roam scan is triggered in 2.4/5 GHz.
446 * @psoc: Pointer to psoc object
447 * @vdev_id: vdev id
448 * @param_value: Set the High RSSI delta for roam scan trigger
449 * 0 - Disable
450 * 1-16 - Set an offset value in this range
451 *
452 * Return: QDF_STATUS
453 */
454 static inline QDF_STATUS
ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t param_value)455 ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc,
456 uint8_t vdev_id, uint8_t param_value)
457 {
458 return cm_set_roam_scan_high_rssi_offset(psoc, vdev_id, param_value);
459 }
460 #else
461 static inline void
ucfg_cm_reset_key(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id)462 ucfg_cm_reset_key(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id) {}
463
464 static inline QDF_STATUS
ucfg_cm_roam_send_rt_stats_config(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,uint8_t param_value)465 ucfg_cm_roam_send_rt_stats_config(struct wlan_objmgr_pdev *pdev,
466 uint8_t vdev_id, uint8_t param_value)
467 {
468 return QDF_STATUS_SUCCESS;
469 }
470
471 static inline QDF_STATUS
ucfg_cm_roam_send_ho_delay_config(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,uint16_t param_value)472 ucfg_cm_roam_send_ho_delay_config(struct wlan_objmgr_pdev *pdev,
473 uint8_t vdev_id, uint16_t param_value)
474 {
475 return QDF_STATUS_SUCCESS;
476 }
477
478 static inline QDF_STATUS
ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,uint8_t param_value)479 ucfg_cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_pdev *pdev,
480 uint8_t vdev_id, uint8_t param_value)
481 {
482 return QDF_STATUS_SUCCESS;
483 }
484
485 static inline QDF_STATUS
ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,uint8_t param_value)486 ucfg_cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_pdev *pdev,
487 uint8_t vdev_id, uint8_t param_value)
488 {
489 return QDF_STATUS_SUCCESS;
490 }
491
492 static inline QDF_STATUS
ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t param_value)493 ucfg_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc,
494 uint8_t vdev_id, uint8_t param_value)
495 {
496 return QDF_STATUS_SUCCESS;
497 }
498 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
499
500 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
501 /**
502 * ucfg_cm_roam_send_vendor_handoff_param_req() - send vendor handoff params
503 * command request to FW
504 * @psoc: Pointer to psoc
505 * @vdev_id: vdev id
506 * @param_id: Vendor Control Param ID from
507 * enum WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID
508 * @vendor_handoff_context:
509 *
510 * Return: QDF_STATUS
511 */
512 QDF_STATUS
513 ucfg_cm_roam_send_vendor_handoff_param_req(struct wlan_objmgr_psoc *psoc,
514 uint8_t vdev_id, uint32_t param_id,
515 void *vendor_handoff_context);
516
517 /**
518 * ucfg_cm_roam_is_vendor_handoff_control_enable() - check whether vendor
519 * handoff control feature is enable or not in driver
520 * @psoc: psoc pointer
521 *
522 * Return: true if feature supports
523 */
524 bool
525 ucfg_cm_roam_is_vendor_handoff_control_enable(struct wlan_objmgr_psoc *psoc);
526 #else
527 static inline bool
ucfg_cm_roam_is_vendor_handoff_control_enable(struct wlan_objmgr_psoc * psoc)528 ucfg_cm_roam_is_vendor_handoff_control_enable(struct wlan_objmgr_psoc *psoc)
529 {
530 return false;
531 }
532 #endif
533
534 /**
535 * ucfg_cm_get_sae_auth_ta() - Get SAE auth tx address
536 * @pdev: pointer to pdev object
537 * @vdev_id: Vdev id
538 * @sae_auth_ta: SAE auth tx address
539 *
540 * Return: QDF_STATUS
541 */
542 static inline QDF_STATUS
ucfg_cm_get_sae_auth_ta(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,struct qdf_mac_addr * sae_auth_ta)543 ucfg_cm_get_sae_auth_ta(struct wlan_objmgr_pdev *pdev,
544 uint8_t vdev_id,
545 struct qdf_mac_addr *sae_auth_ta)
546 {
547 return wlan_cm_get_sae_auth_ta(pdev, vdev_id, sae_auth_ta);
548 }
549
550 /**
551 * ucfg_cm_get_roam_intra_band() - get Intra band roaming
552 * @psoc: pointer to psoc object
553 * @val: Infra band value
554 *
555 * Return: Success or failure
556 */
557 QDF_STATUS
558 ucfg_cm_get_roam_intra_band(struct wlan_objmgr_psoc *psoc, uint16_t *val);
559
560 /**
561 * ucfg_cm_get_roam_rescan_rssi_diff() - gets roam rescan rssi diff
562 * @psoc: pointer to psoc object
563 * @val: value for rescan rssi diff
564 *
565 * Return: QDF_STATUS
566 */
567 QDF_STATUS
568 ucfg_cm_get_roam_rescan_rssi_diff(struct wlan_objmgr_psoc *psoc, uint8_t *val);
569
570 /**
571 * ucfg_cm_get_neighbor_lookup_rssi_threshold() -
572 * get neighbor lookup rssi threshold
573 * @psoc: pointer to psoc object
574 * @vdev_id: vdev identifier
575 * @lookup_threshold: Buffer to fill the neighbor lookup threshold.
576 * Valid only if the return status is success.
577 *
578 * Return: QDF_STATUS
579 */
580 QDF_STATUS
581 ucfg_cm_get_neighbor_lookup_rssi_threshold(struct wlan_objmgr_psoc *psoc,
582 uint8_t vdev_id,
583 uint8_t *lookup_threshold);
584
585 /**
586 * ucfg_cm_get_empty_scan_refresh_period() - get empty scan refresh period
587 * @psoc: pointer to psoc object
588 * @vdev_id: Vdev id
589 * @refresh_threshold: Buffer to fill the empty scan refresh period.
590 * Valid only if the return status is success.
591 *
592 * Return: QDF_STATUS
593 */
594 QDF_STATUS
595 ucfg_cm_get_empty_scan_refresh_period(struct wlan_objmgr_psoc *psoc,
596 uint8_t vdev_id,
597 uint16_t *refresh_threshold);
598
599 /**
600 * ucfg_cm_get_neighbor_scan_min_chan_time() -
601 * get neighbor scan min channel time
602 * @psoc: pointer to psoc object
603 * @vdev_id: vdev_id
604 *
605 * Return: channel min time value
606 */
607 uint16_t
608 ucfg_cm_get_neighbor_scan_min_chan_time(struct wlan_objmgr_psoc *psoc,
609 uint8_t vdev_id);
610
611 /**
612 * ucfg_cm_get_roam_rssi_diff() - Get Roam rssi diff
613 * @psoc: pointer to psoc object
614 * @vdev_id: vdev identifier
615 * @rssi_diff: Buffer to fill the roam RSSI diff.
616 * Valid only if the return status is success.
617 *
618 * Return: QDF_STATUS
619 */
620 QDF_STATUS
621 ucfg_cm_get_roam_rssi_diff(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
622 uint8_t *rssi_diff);
623
624 #ifdef FEATURE_WLAN_ESE
625 /**
626 * ucfg_cm_get_is_ese_feature_enabled() - Get ESE feature enabled or not
627 * This is a synchronous call
628 * @psoc: pointer to psoc object
629 *
630 * Return: true (1) - if the ESE feature is enabled
631 * false (0) - if feature is disabled (compile or runtime)
632 */
633 bool
634 ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc *psoc);
635 #else
636 static inline bool
ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc * psoc)637 ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc *psoc)
638 {
639 return false;
640 }
641 #endif
642
643 /**
644 * ucfg_cm_get_neighbor_scan_max_chan_time() - get neighbor
645 * scan max channel time
646 * @psoc: pointer to psoc object
647 * @vdev_id: vdev identifier
648 *
649 * Return: channel max time value
650 */
651 uint16_t
652 ucfg_cm_get_neighbor_scan_max_chan_time(struct wlan_objmgr_psoc *psoc,
653 uint8_t vdev_id);
654
655 /**
656 * ucfg_cm_get_neighbor_scan_period() - get neighbor scan period
657 * @psoc: pointer to psoc object
658 * @vdev_id: vdev identifier
659 *
660 * Return: neighbor scan period
661 */
662 uint16_t
663 ucfg_cm_get_neighbor_scan_period(struct wlan_objmgr_psoc *psoc,
664 uint8_t vdev_id);
665
666 /**
667 * ucfg_cm_get_wes_mode() - Get WES Mode
668 * This is a synchronous call
669 * @psoc: pointer to psoc object
670 *
671 * Return: WES Mode Enabled(1)/Disabled(0)
672 */
673 bool ucfg_cm_get_wes_mode(struct wlan_objmgr_psoc *psoc);
674
675 /**
676 * ucfg_cm_get_is_lfr_feature_enabled() - Get LFR feature enabled or not
677 * This is a synchronous call
678 * @psoc: pointer to psoc object
679 *
680 * Return: true (1) - if the feature is enabled
681 * false (0) - if feature is disabled (compile or runtime)
682 */
683 bool ucfg_cm_get_is_lfr_feature_enabled(struct wlan_objmgr_psoc *psoc);
684
685 /**
686 * ucfg_cm_get_is_ft_feature_enabled() - Get FT feature enabled or not
687 * This is a synchronous call
688 * @psoc: pointer to psoc object
689 *
690 * Return: true (1) - if the feature is enabled
691 * false (0) - if feature is disabled (compile or runtime)
692 */
693 bool ucfg_cm_get_is_ft_feature_enabled(struct wlan_objmgr_psoc *psoc);
694
695 /**
696 * ucfg_cm_get_roam_scan_home_away_time() - Get Roam scan home away time
697 * @psoc: Pointer to psoc
698 * @vdev_id: vdev identifier
699 * @roam_scan_home_away_time: Buffer to fill the roam scan home away time.
700 * Valid only if the return status is success.
701 *
702 * Return: QDF_STATUS
703 */
704 QDF_STATUS
705 ucfg_cm_get_roam_scan_home_away_time(struct wlan_objmgr_psoc *psoc,
706 uint8_t vdev_id,
707 uint16_t *roam_scan_home_away_time);
708 /**
709 * ucfg_cm_get_roam_opportunistic_scan_threshold_diff() -
710 * get Opportunistic Scan threshold diff.
711 * This is a synchronous call
712 * @psoc: Pointer to psoc
713 * @val: Opportunistic Scan threshold diff.
714 *
715 * Return: QDF_STATUS
716 */
717 QDF_STATUS
718 ucfg_cm_get_roam_opportunistic_scan_threshold_diff(
719 struct wlan_objmgr_psoc *psoc,
720 int8_t *val);
721
722 /**
723 * ucfg_cm_get_neighbor_scan_refresh_period() - Get neighbor scan results
724 * refresh period.
725 * This is a synchronous call
726 * @psoc: pointer to psoc object
727 * @value: value for scan results refresh period
728 *
729 * Return: QDF_STATUS
730 */
731 QDF_STATUS
732 ucfg_cm_get_neighbor_scan_refresh_period(struct wlan_objmgr_psoc *psoc,
733 uint16_t *value);
734
735 /**
736 * ucfg_cm_get_empty_scan_refresh_period_global() - Get global scan
737 * refresh period
738 * @psoc: pointer to psoc object
739 * @roam_scan_period_global: value for empty scan refresh period
740 *
741 * Return: QDF_STATUS
742 */
743 QDF_STATUS
744 ucfg_cm_get_empty_scan_refresh_period_global(struct wlan_objmgr_psoc *psoc,
745 uint16_t *roam_scan_period_global);
746
747 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(WLAN_FEATURE_ROAM_INFO_STATS)
748 /**
749 * ucfg_cm_roam_stats_info_get() - get vdev roam stats info
750 *
751 * @vdev: pointer to vdev
752 * @roam_info: pointer to buffer to copy roam stats info
753 * @roam_num: pointer to valid roam stats num
754 *
755 * After use, roam_info must be released by using
756 * ucfg_cm_roam_stats_info_put()
757 *
758 * Return: QDF_STATUS
759 */
760 static inline QDF_STATUS
ucfg_cm_roam_stats_info_get(struct wlan_objmgr_vdev * vdev,struct enhance_roam_info ** roam_info,uint32_t * roam_num)761 ucfg_cm_roam_stats_info_get(struct wlan_objmgr_vdev *vdev,
762 struct enhance_roam_info **roam_info,
763 uint32_t *roam_num)
764 {
765 return wlan_cm_roam_stats_info_get(vdev, roam_info, roam_num);
766 }
767
768 /**
769 * ucfg_cm_roam_stats_info_put() - put vdev roam stats info
770 *
771 * @roam_info: pointer to buffer of roam stats info
772 *
773 * Return: QDF_STATUS
774 */
775 static inline void
ucfg_cm_roam_stats_info_put(struct enhance_roam_info * roam_info)776 ucfg_cm_roam_stats_info_put(struct enhance_roam_info *roam_info)
777 {
778 qdf_mem_free(roam_info);
779 }
780
781 /**
782 * ucfg_cm_roam_info_get() - get vdev roam info
783 *
784 * @vdev: pointer to vdev
785 * @roam_info: pointer to buffer to copy roam stats info
786 * @idx: index of roam stats cache buffer
787 *
788 * Return: QDF_STATUS
789 */
790 static inline QDF_STATUS
ucfg_cm_roam_info_get(struct wlan_objmgr_vdev * vdev,struct enhance_roam_info ** roam_info,uint8_t idx)791 ucfg_cm_roam_info_get(struct wlan_objmgr_vdev *vdev,
792 struct enhance_roam_info **roam_info,
793 uint8_t idx)
794 {
795 return wlan_cm_roam_info_get(vdev, roam_info, idx);
796 }
797
798 #else
799 static inline QDF_STATUS
ucfg_cm_roam_stats_info_get(struct wlan_objmgr_vdev * vdev,struct enhance_roam_info ** roam_info,uint32_t * roam_num)800 ucfg_cm_roam_stats_info_get(struct wlan_objmgr_vdev *vdev,
801 struct enhance_roam_info **roam_info,
802 uint32_t *roam_num)
803 {
804 return QDF_STATUS_E_NOSUPPORT;
805 }
806
807 static inline void
ucfg_cm_roam_stats_info_put(struct enhance_roam_info * roam_info)808 ucfg_cm_roam_stats_info_put(struct enhance_roam_info *roam_info)
809 {
810 }
811 #endif
812
813 #ifdef WLAN_FEATURE_11BE_MLO
814 /**
815 * ucfg_cm_is_sae_auth_addr_conversion_required() - this api is wrapper for
816 * "wlan_cm_is_sae_auth_addr_conversion_required" function
817 * @vdev: pointer to vdev
818 *
819 * Return: true for address conversion otherwise false
820 */
821 static inline bool
ucfg_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev * vdev)822 ucfg_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev)
823 {
824 return wlan_cm_is_sae_auth_addr_conversion_required(vdev);
825 }
826 #else
827 static inline bool
ucfg_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev * vdev)828 ucfg_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev)
829 {
830 return false;
831 }
832 #endif
833
834 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(WLAN_FEATURE_11BE_MLO)
835 /**
836 * ucfg_cm_roaming_get_peer_mld_addr() - this api is wrapper for
837 * "wlan_cm_roaming_get_peer_mld_addr" function.
838 * @vdev: pointer to vdev
839 *
840 * Return: mld address of peer
841 */
842 static inline struct qdf_mac_addr *
ucfg_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev * vdev)843 ucfg_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev *vdev)
844 {
845 return wlan_cm_roaming_get_peer_mld_addr(vdev);
846 }
847 #else
848 static inline struct qdf_mac_addr *
ucfg_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev * vdev)849 ucfg_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev *vdev)
850 {
851 return NULL;
852 }
853 #endif
854 #endif /* _WLAN_CM_ROAM_UCFG_API_H_ */
855