xref: /wlan-driver/qcacld-3.0/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /*
21  * DOC: wlan_cm_roam_offload.h
22  *
23  * Implementation for the common roaming offload api interfaces.
24  */
25 
26 #ifndef _WLAN_CM_ROAM_OFFLOAD_H_
27 #define _WLAN_CM_ROAM_OFFLOAD_H_
28 
29 #include "qdf_str.h"
30 #include "wlan_cm_roam_public_struct.h"
31 #include "wlan_connectivity_logging.h"
32 
33 #if defined(CONNECTIVITY_DIAG_EVENT) && \
34 	defined(WLAN_FEATURE_ROAM_OFFLOAD)
35 /**
36  * cm_roam_scan_info_event() - send scan info to userspace
37  * @psoc: psoc common object
38  * @scan: roam scan data
39  * @vdev_id: vdev id
40  *
41  * Return: None
42  */
43 void cm_roam_scan_info_event(struct wlan_objmgr_psoc *psoc,
44 			     struct wmi_roam_scan_data *scan, uint8_t vdev_id);
45 
46 /**
47  * cm_roam_trigger_info_event() - send trigger info to userspace
48  * @data: roam trigger data
49  * @scan_data: Roam scan data
50  * @vdev_id: vdev id
51  * @is_full_scan: is full scan or partial scan
52  *
53  * Return: None
54  */
55 void cm_roam_trigger_info_event(struct wmi_roam_trigger_info *data,
56 				struct wmi_roam_scan_data *scan_data,
57 				uint8_t vdev_id, bool is_full_scan);
58 
59 /**
60  * cm_roam_candidate_info_event() - send trigger info to userspace
61  * @ap: roam candidate info
62  * @cand_ap_idx: Candidate AP index
63  *
64  * Return: void
65  */
66 void cm_roam_candidate_info_event(struct wmi_roam_candidate_info *ap,
67 				  uint8_t cand_ap_idx);
68 
69 /**
70  * cm_roam_result_info_event() - send scan results info to userspace
71  * @psoc: Pointer to PSOC object
72  * @trigger: Roam trigger data
73  * @res: roam result data
74  * @scan_data: Roam scan info
75  * @vdev_id: vdev id
76  *
77  * Return: void
78  */
79 void cm_roam_result_info_event(struct wlan_objmgr_psoc *psoc,
80 			       struct wmi_roam_trigger_info *trigger,
81 			       struct wmi_roam_result *res,
82 			       struct wmi_roam_scan_data *scan_data,
83 			       uint8_t vdev_id);
84 #elif defined(WLAN_FEATURE_CONNECTIVITY_LOGGING) && \
85     defined(WLAN_FEATURE_ROAM_OFFLOAD)
86 /**
87  * cm_roam_scan_info_event() - send scan info to userspace
88  * @psoc: psoc common object
89  * @scan: roam scan data
90  * @vdev_id: vdev id
91  *
92  * Return: None
93  */
94 void cm_roam_scan_info_event(struct wlan_objmgr_psoc *psoc,
95 			     struct wmi_roam_scan_data *scan, uint8_t vdev_id);
96 
97 /**
98  * cm_roam_trigger_info_event() - send trigger info to userspace
99  * @data: roam trigger data
100  * @scan_data: Roam scan data
101  * @vdev_id: vdev id
102  * @is_full_scan: is full scan or partial scan
103  *
104  * Return: None
105  */
106 void cm_roam_trigger_info_event(struct wmi_roam_trigger_info *data,
107 				struct wmi_roam_scan_data *scan_data,
108 				uint8_t vdev_id, bool is_full_scan);
109 
110 /**
111  * cm_roam_candidate_info_event() - send trigger info to userspace
112  * @ap: roam candidate info
113  * @cand_ap_idx: Candidate AP index
114  *
115  * Return: void
116  */
117 void cm_roam_candidate_info_event(struct wmi_roam_candidate_info *ap,
118 				  uint8_t cand_ap_idx);
119 
120 /**
121  * cm_roam_result_info_event() - send scan results info to userspace
122  * @psoc: Pointer to PSOC object
123  * @trigger: Roam trigger data
124  * @res: roam result data
125  * @scan_data: Roam scan info
126  * @vdev_id: vdev id
127  *
128  * Return: void
129  */
130 void cm_roam_result_info_event(struct wlan_objmgr_psoc *psoc,
131 			       struct wmi_roam_trigger_info *trigger,
132 			       struct wmi_roam_result *res,
133 			       struct wmi_roam_scan_data *scan_data,
134 			       uint8_t vdev_id);
135 #else
136 static inline void
cm_roam_scan_info_event(struct wlan_objmgr_psoc * psoc,struct wmi_roam_scan_data * scan,uint8_t vdev_id)137 cm_roam_scan_info_event(struct wlan_objmgr_psoc *psoc,
138 			struct wmi_roam_scan_data *scan, uint8_t vdev_id)
139 {
140 }
141 
142 static inline void
cm_roam_trigger_info_event(struct wmi_roam_trigger_info * data,struct wmi_roam_scan_data * scan_data,uint8_t vdev_id,bool is_full_scan)143 cm_roam_trigger_info_event(struct wmi_roam_trigger_info *data,
144 			   struct wmi_roam_scan_data *scan_data,
145 			   uint8_t vdev_id, bool is_full_scan)
146 {
147 }
148 
149 static inline void
cm_roam_candidate_info_event(struct wmi_roam_candidate_info * ap,uint8_t cand_idx)150 cm_roam_candidate_info_event(struct wmi_roam_candidate_info *ap,
151 			     uint8_t cand_idx)
152 {
153 }
154 
155 static inline
cm_roam_result_info_event(struct wlan_objmgr_psoc * psoc,struct wmi_roam_trigger_info * trigger,struct wmi_roam_result * res,struct wmi_roam_scan_data * scan_data,uint8_t vdev_id)156 void cm_roam_result_info_event(struct wlan_objmgr_psoc *psoc,
157 			       struct wmi_roam_trigger_info *trigger,
158 			       struct wmi_roam_result *res,
159 			       struct wmi_roam_scan_data *scan_data,
160 			       uint8_t vdev_id)
161 {
162 }
163 #endif /* WLAN_FEATURE_CONNECTIVITY_LOGGING */
164 
165 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
166 
167 /**
168  * cm_roam_state_change() - Post roam state change to roam state machine
169  * @pdev: pdev pointer
170  * @vdev_id: vdev id
171  * @requested_state: roam state to be set
172  * @reason: reason for changing roam state for the requested vdev id
173  * @send_resp: send rso stop response
174  * @start_timer: start timer for rso stop
175  *
176  * This function posts roam state change to roam state machine handling
177  *
178  * Return: QDF_STATUS
179  */
180 QDF_STATUS
181 cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
182 		     uint8_t vdev_id,
183 		     enum roam_offload_state requested_state,
184 		     uint8_t reason, bool *send_resp, bool start_timer);
185 
186 /**
187  * cm_handle_sta_sta_roaming_enablement() - To handle roaming in case
188  * of STA + STA
189  * @psoc: psoc common object
190  * @curr_vdev_id: Vdev id
191  *
192  * This function is to process STA + STA concurrency scenarios after roaming
193  * and take care of following:
194  * 1. Set PCL to vdev/pdev as per DBS, SCC or MCC
195  * 2. Enable/disable roaming based on the concurrency (DBS vs SCC/MCC) after
196  * roaming
197  *
198  * Return: none
199  */
200 void cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc,
201 					  uint8_t curr_vdev_id);
202 
203 /**
204  * cm_roam_send_rso_cmd() - send rso command
205  * @psoc: psoc pointer
206  * @vdev_id: vdev id
207  * @rso_command: roam command to send
208  * @reason: reason for changing roam state for the requested vdev id
209  *
210  * similar to csr_roam_offload_scan, will be used from many legacy
211  * process directly, generate a new function wlan_cm_roam_send_rso_cmd
212  * for external usage.
213  *
214  * Return: QDF_STATUS
215  */
216 QDF_STATUS cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
217 				uint8_t vdev_id, uint8_t rso_command,
218 				uint8_t reason);
219 
220 /**
221  * cm_rso_set_roam_trigger() - Send roam trigger bitmap firmware
222  * @pdev: Pointer to pdev
223  * @vdev_id: vdev id
224  * @trigger: Carries pointer of the object containing vdev id and
225  *  roam_trigger_bitmap.
226  *
227  * Return: QDF_STATUS
228  */
229 QDF_STATUS cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev,
230 				   uint8_t vdev_id,
231 				   struct wlan_roam_triggers *trigger);
232 
233 /**
234  * cm_roam_stop_req() - roam stop request handling
235  * @psoc: psoc pointer
236  * @vdev_id: vdev id
237  * @reason: reason for changing roam state for the requested vdev id
238  * @send_resp: send rso stop response
239  * @start_timer: start timer for rso stop
240  *
241  * Return: QDF_STATUS
242  */
243 QDF_STATUS
244 cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
245 		 uint8_t reason, bool *send_resp, bool start_timer);
246 
247 /**
248  * cm_roam_fill_rssi_change_params() - Fill roam scan rssi change parameters
249  * @psoc: PSOC pointer
250  * @vdev_id: vdev_id
251  * @params: RSSI change parameters
252  *
253  * Return: QDF_STATUS
254  */
255 QDF_STATUS
256 cm_roam_fill_rssi_change_params(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
257 				struct wlan_roam_rssi_change_params *params);
258 
259 /**
260  * cm_roam_is_change_in_band_allowed  - Check whether change in roam band is
261  * allowed in FW or not
262  * @psoc: psoc pointer
263  * @vdev_id: VDEV id
264  * @roam_band_mask: band mask to check
265  *
266  * Return: return true if change in band allowed
267  */
268 bool
269 cm_roam_is_change_in_band_allowed(struct wlan_objmgr_psoc *psoc,
270 				  uint8_t vdev_id, uint32_t roam_band_mask);
271 
272 /**
273  * cm_dump_freq_list() - dump chan list
274  * @chan_info: chan info to dump
275  *
276  * Return: void
277  */
278 void cm_dump_freq_list(struct rso_chan_info *chan_info);
279 
280 /**
281  * cm_start_roam_invoke() - Validate and send Roam invoke req to CM
282  * @psoc: Psoc pointer
283  * @vdev: vdev
284  * @bssid: Target bssid
285  * @chan_freq: channel frequency on which reassoc should be send
286  * @source: source of the roam invoke
287  *
288  * Return: QDF_STATUS
289  */
290 QDF_STATUS
291 cm_start_roam_invoke(struct wlan_objmgr_psoc *psoc,
292 		     struct wlan_objmgr_vdev *vdev,
293 		     struct qdf_mac_addr *bssid,
294 		     uint32_t chan_freq,
295 		     enum wlan_cm_source source);
296 #endif
297 
298 /**
299  * cm_update_tried_candidate_freq_list() - on connection failure update
300  * tried_candidate_freq_list structure present in struct rso_config
301  * @psoc: psoc pointer
302  * @vdev: vdev pointer
303  * @connect_rsp: connect resp from VDEV mgr
304  *
305  * Return: void
306  */
307 void
308 cm_update_tried_candidate_freq_list(struct wlan_objmgr_psoc *psoc,
309 				    struct wlan_objmgr_vdev *vdev,
310 				    struct wlan_cm_connect_resp *connect_rsp);
311 
312 #ifdef FEATURE_WLAN_ESE
313 /**
314  * cm_create_roam_scan_channel_list() - create roam scan channel list
315  * @pdev: pdev
316  * @rso_cfg: roam config
317  * @vdev_id: vdev id
318  * @chan_freq_list: pointer to channel list
319  * @num_chan: number of channels
320  * @band: band enumeration
321  *
322  * This function modifies the roam scan channel list as per AP neighbor
323  * report; AP neighbor report may be empty or may include only other AP
324  * channels; in any case, we merge the channel list with the learned occupied
325  * channels list.
326  * if the band is 2.4G, then make sure channel list contains only 2.4G
327  * valid channels if the band is 5G, then make sure channel list contains
328  * only 5G valid channels
329  *
330  * Return: QDF_STATUS enumeration
331  */
332 QDF_STATUS cm_create_roam_scan_channel_list(struct wlan_objmgr_pdev *pdev,
333 					    struct rso_config *rso_cfg,
334 					    uint8_t vdev_id,
335 					    qdf_freq_t *chan_freq_list,
336 					    uint8_t num_chan,
337 					    const enum band_info band);
338 #endif
339 
340 QDF_STATUS cm_neighbor_roam_update_config(struct wlan_objmgr_pdev *pdev,
341 					  uint8_t vdev_id, uint8_t value,
342 					  uint8_t reason);
343 void cm_flush_roam_channel_list(struct rso_chan_info *channel_info);
344 
345 QDF_STATUS cm_roam_control_restore_default_config(struct wlan_objmgr_pdev *pdev,
346 						  uint8_t vdev_id);
347 
348 /**
349  * cm_update_pmk_cache_ft - API to update MDID in PMKSA cache entry
350  * @psoc: psoc pointer
351  * @vdev_id: dvev ID
352  * @pmk_cache: pmksa from the userspace
353  *
354  * Return: None
355  */
356 void cm_update_pmk_cache_ft(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
357 			    struct wlan_crypto_pmksa *pmk_cache);
358 
359 /**
360  * cm_lookup_pmkid_using_bssid() - lookup pmkid using bssid
361  * @psoc: pointer to psoc
362  * @vdev_id: vdev_id
363  * @pmk_cache: pointer to pmk cache
364  *
365  * Return: true if pmkid is found else false
366  */
367 bool cm_lookup_pmkid_using_bssid(struct wlan_objmgr_psoc *psoc,
368 				 uint8_t vdev_id,
369 				 struct wlan_crypto_pmksa *pmk_cache);
370 
371 void cm_roam_restore_default_config(struct wlan_objmgr_pdev *pdev,
372 				    uint8_t vdev_id);
373 
374 /**
375  * cm_roam_send_disable_config() - Send roam module enable/disable cfg to fw
376  * @psoc: PSOC pointer
377  * @vdev_id: vdev id
378  * @cfg: roaming enable/disable cfg
379  *
380  * Return: QDF_STATUS
381  */
382 QDF_STATUS
383 cm_roam_send_disable_config(struct wlan_objmgr_psoc *psoc,
384 			    uint8_t vdev_id, uint8_t cfg);
385 
386 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
387 /**
388  * cm_roam_send_vendor_handoff_param_req() - send vendor handoff param cmd
389  * @psoc: psoc pointer
390  * @vdev_id: vdev id
391  * @param_value: roam stats param value
392  * @vendor_handoff_context: vendor handoff context request
393  *
394  * This function is used to send vendor handoff param cmd
395  *
396  * Return: QDF_STATUS
397  */
398 QDF_STATUS
399 cm_roam_send_vendor_handoff_param_req(struct wlan_objmgr_psoc *psoc,
400 				      uint8_t vdev_id,
401 				      uint32_t param_value,
402 				      void *vendor_handoff_context);
403 
404 /**
405  * cm_roam_is_vendor_handoff_control_enable() - check whether vendor handoff
406  * control feature is enable or not in driver
407  * @psoc: psoc pointer
408  *
409  * Return: true if feature supports
410  */
411 bool
412 cm_roam_is_vendor_handoff_control_enable(struct wlan_objmgr_psoc *psoc);
413 
414 /**
415  * cm_roam_update_vendor_handoff_config() - update vendor handoff param to
416  * rso config structure
417  * @psoc: psoc pointer
418  * @list: vendor handoff parameters to be updated
419  *
420  * Return: QDF_STATUS
421  */
422 QDF_STATUS cm_roam_update_vendor_handoff_config(struct wlan_objmgr_psoc *psoc,
423 				     struct roam_vendor_handoff_params *list);
424 #endif
425 
426 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
427 /**
428  * cm_roam_send_rt_stats_config() - Send roam event stats cfg value to FW
429  * @psoc: PSOC pointer
430  * @vdev_id: vdev id
431  * @param_value: roam stats enable/disable cfg
432  *
433  * Return: QDF_STATUS
434  */
435 QDF_STATUS
436 cm_roam_send_rt_stats_config(struct wlan_objmgr_psoc *psoc,
437 			     uint8_t vdev_id, uint8_t param_value);
438 
439 /**
440  * cm_roam_send_ho_delay_config() - Send HO delay value to FW to delay
441  * hand-off (in msec) by the specified duration to receive pending rx frames
442  * from current BSS.
443  * @psoc: PSOC pointer
444  * @vdev_id: vdev id
445  * @param_value: HO delay value
446  *
447  * Return: QDF_STATUS
448  */
449 QDF_STATUS
450 cm_roam_send_ho_delay_config(struct wlan_objmgr_psoc *psoc,
451 			     uint8_t vdev_id, uint16_t param_value);
452 
453 /**
454  * cm_exclude_rm_partial_scan_freq() - Exclude the channels in roam full scan
455  * that are already scanned as part of partial scan.
456  * @psoc: PSOC pointer
457  * @vdev_id: vdev id
458  * @param_value: include/exclude the partial scan channels in roam full scan
459  *
460  * Return: QDF_STATUS
461  */
462 QDF_STATUS
463 cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
464 				uint8_t vdev_id, uint8_t param_value);
465 
466 /**
467  * cm_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels in roam full
468  * scan only on prior discovery of any 6 GHz support in the environment
469  * @psoc: Pointer to psoc
470  * @vdev_id: vdev id
471  * @param_value: Include the 6 GHz channels in roam full scan:
472  * 1 - Include only on prior discovery of any 6 GHz support in the environment
473  * 0 - Include all the supported 6 GHz channels by default
474  *
475  * Return: QDF_STATUS
476  */
477 QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
478 					  uint8_t vdev_id, uint8_t param_value);
479 
480 /**
481  * cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI at
482  * which roam scan is triggered in 2.4/5 GHz.
483  * @psoc: PSOC pointer
484  * @vdev_id: vdev id
485  * @param_value: Set the High RSSI delta for roam scan trigger
486  * * 1-16 - Set an offset value in this range
487  * * 0    - Disable
488  *
489  * Return: QDF_STATUS
490  */
491 QDF_STATUS
492 cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc,
493 				  uint8_t vdev_id, uint8_t param_value);
494 #else
495 static inline QDF_STATUS
cm_roam_send_rt_stats_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t param_value)496 cm_roam_send_rt_stats_config(struct wlan_objmgr_psoc *psoc,
497 			     uint8_t vdev_id, uint8_t param_value)
498 {
499 	return QDF_STATUS_E_NOSUPPORT;
500 }
501 
502 static inline QDF_STATUS
cm_roam_send_ho_delay_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint16_t param_value)503 cm_roam_send_ho_delay_config(struct wlan_objmgr_psoc *psoc,
504 			     uint8_t vdev_id, uint16_t param_value)
505 {
506 	return QDF_STATUS_E_NOSUPPORT;
507 }
508 
509 static inline QDF_STATUS
cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t param_value)510 cm_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
511 				uint8_t vdev_id, uint8_t param_value)
512 {
513 	return QDF_STATUS_E_NOSUPPORT;
514 }
515 
516 static inline
cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t param_value)517 QDF_STATUS cm_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc,
518 					  uint8_t vdev_id, uint8_t param_value)
519 {
520 	return QDF_STATUS_E_NOSUPPORT;
521 }
522 #endif
523 
524 #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
525 void
526 cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
527 					struct wlan_objmgr_pdev *pdev,
528 					struct wlan_objmgr_vdev *vdev);
529 /**
530  * cm_check_and_set_sae_single_pmk_cap() - check if the Roamed AP support
531  * roaming using single pmk
532  * with same pmk or not
533  * @psoc: psoc
534  * @vdev_id: vdev id
535  * @psk_pmk: pmk of roamed AP
536  * @pmk_len: pml length
537  *
538  * Return: void
539  */
540 void cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc *psoc,
541 					 uint8_t vdev_id, uint8_t *psk_pmk,
542 					 uint8_t pmk_len);
543 #else
544 static inline void
cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_pdev * pdev,struct wlan_objmgr_vdev * vdev)545 cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
546 					struct wlan_objmgr_pdev *pdev,
547 					struct wlan_objmgr_vdev *vdev)
548 {}
549 static inline void
cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t * psk_pmk,uint8_t pmk_len)550 cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc *psoc,
551 				    uint8_t vdev_id, uint8_t *psk_pmk,
552 				    uint8_t pmk_len)
553 {}
554 #endif
555 
556 bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
557 			 struct wlan_objmgr_vdev *vdev,
558 			 bool mdie_present);
559 
560 /**
561  * cm_update_owe_info() - Update owe transition mode element info
562  * @vdev: Object manager VDEV
563  * @rsp: connect resp from VDEV mgr
564  * @vdev_id: vdev id
565  *
566  * Return: none
567  */
568 void cm_update_owe_info(struct wlan_objmgr_vdev *vdev,
569 			struct wlan_cm_connect_resp *rsp, uint8_t vdev_id);
570 
571 #ifdef WLAN_FEATURE_11BE_MLO
572 QDF_STATUS
573 cm_handle_mlo_rso_state_change(struct wlan_objmgr_pdev *pdev, uint8_t *vdev_id,
574 			       enum roam_offload_state requested_state,
575 			       uint8_t reason, bool *is_rso_skip);
576 #else
577 static inline QDF_STATUS
cm_handle_mlo_rso_state_change(struct wlan_objmgr_pdev * pdev,uint8_t * vdev_id,enum roam_offload_state requested_state,uint8_t reason,bool * is_rso_skip)578 cm_handle_mlo_rso_state_change(struct wlan_objmgr_pdev *pdev, uint8_t *vdev_id,
579 			       enum roam_offload_state requested_state,
580 			       uint8_t reason, bool *is_rso_skip)
581 {
582 	return QDF_STATUS_E_NOSUPPORT;
583 }
584 
585 #endif
586 
587 #if (defined(CONNECTIVITY_DIAG_EVENT) && \
588 	defined(WLAN_FEATURE_ROAM_OFFLOAD))
589 /**
590  * cm_roam_mgmt_frame_event() - Roam management frame event
591  * @vdev: vdev pointer
592  * @frame_data: frame_data
593  * @scan_data: Roam scan data
594  * @result: Roam result
595  *
596  * Return: QDF_STATUS
597  */
598 QDF_STATUS
599 cm_roam_mgmt_frame_event(struct wlan_objmgr_vdev *vdev,
600 			 struct roam_frame_info *frame_data,
601 			 struct wmi_roam_scan_data *scan_data,
602 			 struct wmi_roam_result *result);
603 
604 /**
605  * cm_roam_btm_req_event  - Send BTM request related logging event
606  * @neigh_rpt: Neighbor report/BTM request related data
607  * @btm_data: BTM trigger related data
608  * @trigger_info: Roam trigger related info
609  * @vdev_id: vdev id
610  * @is_wtc: Is WTC or BTM response
611  *
612  * Return: QDF_STATUS
613  */
614 QDF_STATUS
615 cm_roam_btm_req_event(struct wmi_neighbor_report_data *neigh_rpt,
616 		      struct wmi_roam_btm_trigger_data *btm_data,
617 		      struct wmi_roam_trigger_info *trigger_info,
618 		      uint8_t vdev_id, bool is_wtc);
619 
620 /**
621  * cm_roam_btm_resp_event() - Send BTM response logging event
622  * @trigger_info: Roam trigger related data
623  * @btm_data: BTM response data
624  * @vdev_id: Vdev id
625  * @is_wtc: Is WTC or BTM response
626  *
627  * Return: QDF_STATUS
628  */
629 QDF_STATUS
630 cm_roam_btm_resp_event(struct wmi_roam_trigger_info *trigger_info,
631 		       struct roam_btm_response_data *btm_data,
632 		       uint8_t vdev_id, bool is_wtc);
633 
634 /**
635  * cm_roam_btm_query_event()  - Send BTM query logging event
636  * @btm_data: BTM data
637  * @vdev_id: Vdev id
638  *
639  * Return: QDF_STATUS
640  */
641 QDF_STATUS
642 cm_roam_btm_query_event(struct wmi_neighbor_report_data *btm_data,
643 			uint8_t vdev_id);
644 
645 /**
646  * cm_roam_beacon_loss_disconnect_event() - Send BMISS disconnection logging
647  * event
648  * @psoc: Pointer to PSOC object
649  * @bssid: BSSID
650  * @vdev_id: Vdev id
651  *
652  * Return: QDF_STATUS
653  */
654 QDF_STATUS
655 cm_roam_beacon_loss_disconnect_event(struct wlan_objmgr_psoc *psoc,
656 				     struct qdf_mac_addr bssid,
657 				     uint8_t vdev_id);
658 
659 /**
660  * cm_roam_neigh_rpt_req_event() - Send Neighbor Report request logging
661  * event
662  * @neigh_rpt: Neighbor Report parameter
663  * @vdev: vdev pointer
664  */
665 void
666 cm_roam_neigh_rpt_req_event(struct wmi_neighbor_report_data *neigh_rpt,
667 			    struct wlan_objmgr_vdev *vdev);
668 
669 /**
670  * cm_roam_neigh_rpt_resp_event() - Send Neighbor Report response logging
671  * event
672  * @neigh_rpt: Neighbor Report parameter
673  * @vdev_id: vdev id
674  */
675 void
676 cm_roam_neigh_rpt_resp_event(struct wmi_neighbor_report_data *neigh_rpt,
677 			     uint8_t vdev_id);
678 
679 /**
680  * cm_roam_btm_block_event() - Send BTM block/drop logging event
681  * @vdev_id: vdev id
682  * @token: BTM token
683  * @reason: Reason for dropping the BTM frame
684  *
685  * Return: QDF_STATUS
686  */
687 QDF_STATUS
688 cm_roam_btm_block_event(uint8_t vdev_id, uint8_t token,
689 			enum wlan_diag_btm_block_reason reason);
690 #else
691 static inline QDF_STATUS
cm_roam_mgmt_frame_event(struct wlan_objmgr_vdev * vdev,struct roam_frame_info * frame_data,struct wmi_roam_scan_data * scan_data,struct wmi_roam_result * result)692 cm_roam_mgmt_frame_event(struct wlan_objmgr_vdev *vdev,
693 			 struct roam_frame_info *frame_data,
694 			 struct wmi_roam_scan_data *scan_data,
695 			 struct wmi_roam_result *result)
696 {
697 	return QDF_STATUS_E_NOSUPPORT;
698 }
699 
700 static inline QDF_STATUS
cm_roam_btm_req_event(struct wmi_neighbor_report_data * neigh_rpt,struct wmi_roam_btm_trigger_data * btm_data,struct wmi_roam_trigger_info * trigger_info,uint8_t vdev_id,bool is_wtc)701 cm_roam_btm_req_event(struct wmi_neighbor_report_data *neigh_rpt,
702 		      struct wmi_roam_btm_trigger_data *btm_data,
703 		      struct wmi_roam_trigger_info *trigger_info,
704 		      uint8_t vdev_id, bool is_wtc)
705 {
706 	return QDF_STATUS_E_NOSUPPORT;
707 }
708 
709 static inline QDF_STATUS
cm_roam_btm_resp_event(struct wmi_roam_trigger_info * trigger_info,struct roam_btm_response_data * btm_data,uint8_t vdev_id,bool is_wtc)710 cm_roam_btm_resp_event(struct wmi_roam_trigger_info *trigger_info,
711 		       struct roam_btm_response_data *btm_data,
712 		       uint8_t vdev_id, bool is_wtc)
713 {
714 	return QDF_STATUS_E_NOSUPPORT;
715 }
716 
717 static inline QDF_STATUS
cm_roam_btm_query_event(struct wmi_neighbor_report_data * btm_data,uint8_t vdev_id)718 cm_roam_btm_query_event(struct wmi_neighbor_report_data *btm_data,
719 			uint8_t vdev_id)
720 {
721 	return QDF_STATUS_E_NOSUPPORT;
722 }
723 
724 static inline QDF_STATUS
cm_roam_beacon_loss_disconnect_event(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr bssid,uint8_t vdev_id)725 cm_roam_beacon_loss_disconnect_event(struct wlan_objmgr_psoc *psoc,
726 				     struct qdf_mac_addr bssid,
727 				     uint8_t vdev_id)
728 {
729 	return QDF_STATUS_E_NOSUPPORT;
730 }
731 
732 static inline void
cm_roam_neigh_rpt_req_event(struct wmi_neighbor_report_data * neigh_rpt,struct wlan_objmgr_vdev * vdev)733 cm_roam_neigh_rpt_req_event(struct wmi_neighbor_report_data *neigh_rpt,
734 			    struct wlan_objmgr_vdev *vdev)
735 {
736 }
737 
738 static inline void
cm_roam_neigh_rpt_resp_event(struct wmi_neighbor_report_data * neigh_rpt,uint8_t vdev_id)739 cm_roam_neigh_rpt_resp_event(struct wmi_neighbor_report_data *neigh_rpt,
740 			     uint8_t vdev_id)
741 {
742 }
743 
744 static inline QDF_STATUS
cm_roam_btm_block_event(uint8_t vdev_id,uint8_t token,enum wlan_diag_btm_block_reason reason)745 cm_roam_btm_block_event(uint8_t vdev_id, uint8_t token,
746 			enum wlan_diag_btm_block_reason reason)
747 {
748 	return QDF_STATUS_E_NOSUPPORT;
749 }
750 #endif /* FEATURE_CONNECTIVITY_LOGGING */
751 
752 /**
753  * cm_is_mbo_ap_without_pmf() - Check if the connected AP is MBO without PMF
754  * @psoc: PSOC pointer
755  * @vdev_id: vdev id
756  *
757  * Return: True if connected AP is MBO capable without PMF
758  */
759 bool cm_is_mbo_ap_without_pmf(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
760 
761 /**
762  * cm_fill_rso_channel_list() - Fill roam frequencies in chan_info
763  * @psoc: PSOC pointer
764  * @vdev: vdev pointer
765  * @rso_cfg: roam config
766  * @chan_info: roam scan channel list
767  * @reason: Channel update reason
768  *
769  * Return: None
770  */
771 void cm_fill_rso_channel_list(struct wlan_objmgr_psoc *psoc,
772 			      struct wlan_objmgr_vdev *vdev,
773 			      struct rso_config *rso_cfg,
774 			      struct wlan_roam_scan_channel_list *chan_info,
775 			      uint8_t reason);
776 #endif /* _WLAN_CM_ROAM_OFFLOAD_H_ */
777