1 /*
2 * Copyright (c) 2018-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 * DOC: declare VDEV Manager interface APIs exposed by the mlme component
21 */
22
23 #ifndef _WLAN_MLME_VDEV_MGR_INT_API_H_
24 #define _WLAN_MLME_VDEV_MGR_INT_API_H_
25
26 #include <wlan_objmgr_vdev_obj.h>
27 #include "include/wlan_vdev_mlme.h"
28 #include "wlan_mlme_main.h"
29 #include "wma_if.h"
30
31 /**
32 * mlme_register_mlme_ext_ops() - Register mlme ext ops
33 *
34 * This function is called to register mlme ext operations
35 *
36 * Return: QDF_STATUS
37 */
38 QDF_STATUS mlme_register_mlme_ext_ops(void);
39
40 /**
41 * mlme_register_mlo_ext_ops() - Register mlme mlo ext ops
42 *
43 * This function is called to register mlme mlo ext operations
44 *
45 * Return: QDF_STATUS
46 */
47 QDF_STATUS mlme_register_mlo_ext_ops(void);
48
49 /**
50 * mlme_unregister_mlo_ext_ops() - Unregister mlme mlo ext ops
51 *
52 * This function is called to unregister mlme mlo ext operations
53 *
54 * Return: QDF_STATUS
55 */
56 QDF_STATUS mlme_unregister_mlo_ext_ops(void);
57
58 /**
59 * mlme_register_vdev_mgr_ops() - Register vdev mgr ops
60 * @vdev_mlme: vdev mlme object
61 *
62 * This function is called to register vdev manager operations
63 *
64 * Return: QDF_STATUS
65 */
66 QDF_STATUS mlme_register_vdev_mgr_ops(struct vdev_mlme_obj *vdev_mlme);
67 /**
68 * mlme_unregister_vdev_mgr_ops() - Unregister vdev mgr ops
69 * @vdev_mlme: vdev mlme object
70 *
71 * This function is called to unregister vdev manager operations
72 *
73 * Return: QDF_STATUS
74 */
75 QDF_STATUS mlme_unregister_vdev_mgr_ops(struct vdev_mlme_obj *vdev_mlme);
76
77 /**
78 * mlme_set_chan_switch_in_progress() - set mlme priv restart in progress
79 * @vdev: vdev pointer
80 * @val: value to be set
81 *
82 * Return: QDF_STATUS
83 */
84 QDF_STATUS mlme_set_chan_switch_in_progress(struct wlan_objmgr_vdev *vdev,
85 bool val);
86
87 #ifdef WLAN_FEATURE_MSCS
88 /**
89 * mlme_set_is_mscs_req_sent() - set mscs frame req flag
90 * @vdev: vdev pointer
91 * @val: value to be set
92 *
93 * Return: QDF_STATUS
94 */
95 QDF_STATUS mlme_set_is_mscs_req_sent(struct wlan_objmgr_vdev *vdev, bool val);
96
97 /**
98 * mlme_get_is_mscs_req_sent() - get mscs frame req flag
99 * @vdev: vdev pointer
100 *
101 * Return: value of mscs flag
102 */
103 bool mlme_get_is_mscs_req_sent(struct wlan_objmgr_vdev *vdev);
104 #else
105 static inline
mlme_set_is_mscs_req_sent(struct wlan_objmgr_vdev * vdev,bool val)106 QDF_STATUS mlme_set_is_mscs_req_sent(struct wlan_objmgr_vdev *vdev, bool val)
107 {
108 return QDF_STATUS_E_FAILURE;
109 }
110
111 static inline
mlme_get_is_mscs_req_sent(struct wlan_objmgr_vdev * vdev)112 bool mlme_get_is_mscs_req_sent(struct wlan_objmgr_vdev *vdev)
113 {
114 return false;
115 }
116 #endif
117
118 /**
119 * mlme_is_chan_switch_in_progress() - get mlme priv restart in progress
120 * @vdev: vdev pointer
121 *
122 * Return: value of mlme priv restart in progress
123 */
124 bool mlme_is_chan_switch_in_progress(struct wlan_objmgr_vdev *vdev);
125
126 /**
127 * ap_mlme_set_hidden_ssid_restart_in_progress() - set mlme priv hidden ssid
128 * restart in progress
129 * @vdev: vdev pointer
130 * @val: value to be set
131 *
132 * Return: QDF_STATUS
133 */
134 QDF_STATUS
135 ap_mlme_set_hidden_ssid_restart_in_progress(struct wlan_objmgr_vdev *vdev,
136 bool val);
137
138 /**
139 * ap_mlme_is_hidden_ssid_restart_in_progress() - get mlme priv hidden ssid
140 * restart in progress
141 * @vdev: vdev pointer
142 *
143 * Return: value of mlme priv hidden ssid restart in progress
144 */
145 bool ap_mlme_is_hidden_ssid_restart_in_progress(struct wlan_objmgr_vdev *vdev);
146
147 /**
148 * mlme_set_vdev_start_failed() - set mlme priv vdev restart fail flag
149 * @vdev: vdev pointer
150 * @val: value to be set
151 *
152 * Return: QDF_STATUS
153 */
154 QDF_STATUS
155 mlme_set_vdev_start_failed(struct wlan_objmgr_vdev *vdev, bool val);
156
157 /**
158 * mlme_is_connection_fail() - get connection fail flag
159 * @vdev: vdev pointer
160 *
161 * Return: value of vdev connection failure flag
162 */
163 bool mlme_is_connection_fail(struct wlan_objmgr_vdev *vdev);
164
165 /**
166 * mlme_is_wapi_sta_active() - check sta with wapi security exists and is active
167 * @pdev: pdev pointer
168 *
169 * Return: true if sta with wapi security exists
170 */
171 #ifdef FEATURE_WLAN_WAPI
172 bool mlme_is_wapi_sta_active(struct wlan_objmgr_pdev *pdev);
173 #else
mlme_is_wapi_sta_active(struct wlan_objmgr_pdev * pdev)174 static inline bool mlme_is_wapi_sta_active(struct wlan_objmgr_pdev *pdev)
175 {
176 return false;
177 }
178 #endif
179
180 QDF_STATUS mlme_set_bigtk_support(struct wlan_objmgr_vdev *vdev, bool val);
181
182 bool mlme_get_bigtk_support(struct wlan_objmgr_vdev *vdev);
183
184 #ifdef FEATURE_WLAN_TDLS
185 /**
186 * mlme_set_tdls_chan_switch_prohibited() - set tdls chan switch prohibited
187 * @vdev: vdev pointer
188 * @val: value to be set
189 *
190 * Return: QDF_STATUS
191 */
192 QDF_STATUS
193 mlme_set_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev *vdev, bool val);
194
195 /**
196 * mlme_get_tdls_chan_switch_prohibited() - get tdls chan switch prohibited
197 * @vdev: vdev pointer
198 *
199 * Return: bool
200 */
201 bool mlme_get_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev *vdev);
202
203 /**
204 * mlme_set_tdls_prohibited() - set tdls prohibited
205 * @vdev: vdev pointer
206 * @val: value to be set
207 *
208 * Return: QDF_STATUS
209 */
210 QDF_STATUS
211 mlme_set_tdls_prohibited(struct wlan_objmgr_vdev *vdev, bool val);
212
213 /**
214 * mlme_get_tdls_prohibited() - get tdls prohibited
215 * @vdev: vdev pointer
216 *
217 * Return: bool
218 */
219 bool mlme_get_tdls_prohibited(struct wlan_objmgr_vdev *vdev);
220 #else
221 static inline QDF_STATUS
mlme_set_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev * vdev,bool val)222 mlme_set_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev *vdev, bool val)
223 {
224 return QDF_STATUS_SUCCESS;
225 }
226
227 static inline
mlme_get_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev * vdev)228 bool mlme_get_tdls_chan_switch_prohibited(struct wlan_objmgr_vdev *vdev)
229 {
230 return false;
231 }
232
233 static inline QDF_STATUS
mlme_set_tdls_prohibited(struct wlan_objmgr_vdev * vdev,bool val)234 mlme_set_tdls_prohibited(struct wlan_objmgr_vdev *vdev, bool val)
235 {
236 return QDF_STATUS_SUCCESS;
237 }
238
mlme_get_tdls_prohibited(struct wlan_objmgr_vdev * vdev)239 static inline bool mlme_get_tdls_prohibited(struct wlan_objmgr_vdev *vdev)
240 {
241 return false;
242 }
243 #endif
244 /**
245 * mlme_set_roam_reason_better_ap() - set roam reason better AP
246 * @vdev: vdev pointer
247 * @val: value to be set
248 *
249 * Return: QDF_STATUS
250 */
251 QDF_STATUS
252 mlme_set_roam_reason_better_ap(struct wlan_objmgr_vdev *vdev, bool val);
253
254 /**
255 * mlme_get_roam_reason_better_ap() - get roam reason better AP
256 * @vdev: vdev pointer
257 *
258 * Return: bool
259 */
260 bool mlme_get_roam_reason_better_ap(struct wlan_objmgr_vdev *vdev);
261
262 /**
263 * mlme_set_hb_ap_rssi() - set hb ap RSSI
264 * @vdev: vdev pointer
265 * @val: value to be set
266 *
267 * Return: QDF_STATUS
268 */
269 QDF_STATUS mlme_set_hb_ap_rssi(struct wlan_objmgr_vdev *vdev, uint32_t val);
270
271 /**
272 * mlme_get_hb_ap_rssi() - get HB AP RSSIc
273 * @vdev: vdev pointer
274 *
275 * Return: rssi value
276 */
277 uint32_t mlme_get_hb_ap_rssi(struct wlan_objmgr_vdev *vdev);
278
279 /**
280 * mlme_set_connection_fail() - set connection failure flag
281 * @vdev: vdev pointer
282 * @val: value to be set
283 *
284 * Return: QDF_STATUS
285 */
286 QDF_STATUS
287 mlme_set_connection_fail(struct wlan_objmgr_vdev *vdev, bool val);
288
289 /**
290 * mlme_get_vdev_start_failed() - get mlme priv vdev restart fail flag
291 * @vdev: vdev pointer
292 *
293 * Return: value of mlme priv vdev restart fail flag
294 */
295 bool mlme_get_vdev_start_failed(struct wlan_objmgr_vdev *vdev);
296
297 /**
298 * mlme_get_cac_required() - get if cac is required for new channel
299 * @vdev: vdev pointer
300 *
301 * Return: if cac is required
302 */
303 bool mlme_get_cac_required(struct wlan_objmgr_vdev *vdev);
304
305 /**
306 * mlme_set_cac_required() - set if cac is required for new channel
307 * @vdev: vdev pointer
308 * @val: value to be set
309 *
310 * Return: QDF_STATUS
311 */
312 QDF_STATUS
313 mlme_set_cac_required(struct wlan_objmgr_vdev *vdev, bool val);
314
315 /**
316 * mlme_set_mbssid_info() - save mbssid info
317 * @vdev: vdev pointer
318 * @mbssid_info: mbssid info
319 * @freq: current operating frequency
320 *
321 * Return: QDF_STATUS
322 */
323 QDF_STATUS
324 mlme_set_mbssid_info(struct wlan_objmgr_vdev *vdev,
325 struct scan_mbssid_info *mbssid_info, qdf_freq_t freq);
326
327 /**
328 * mlme_get_mbssid_info() - get mbssid info
329 * @vdev: vdev pointer
330 * @mbss_11ax: mbss 11ax info
331 *
332 * Return: None
333 */
334 void mlme_get_mbssid_info(struct wlan_objmgr_vdev *vdev,
335 struct vdev_mlme_mbss_11ax *mbss_11ax);
336
337 /**
338 * mlme_set_tx_power() - set tx power
339 * @vdev: vdev pointer
340 * @tx_power: tx power to be set
341 *
342 * Return: QDF_STATUS
343 */
344 QDF_STATUS mlme_set_tx_power(struct wlan_objmgr_vdev *vdev,
345 int8_t tx_power);
346
347 /**
348 * mlme_get_tx_power() - get tx power
349 * @vdev: vdev pointer
350 *
351 * Return: current tx power
352 */
353 int8_t mlme_get_tx_power(struct wlan_objmgr_vdev *vdev);
354
355 /**
356 * mlme_get_max_reg_power() - get max reg power
357 * @vdev: vdev pointer
358 *
359 * Return: max reg power
360 */
361 int8_t mlme_get_max_reg_power(struct wlan_objmgr_vdev *vdev);
362
363 /**
364 * mlme_set_max_reg_power() - set max reg power
365 * @vdev: vdev pointer
366 * @max_reg_power: max regulatory power to be set
367 *
368 * Return: QDF_STATUS
369 */
370 QDF_STATUS mlme_set_max_reg_power(struct wlan_objmgr_vdev *vdev,
371 int8_t max_reg_power);
372
373 /**
374 * mlme_is_vdev_in_beaconning_mode() - check if vdev is beaconing mode
375 * @vdev_opmode: vdev opmode
376 *
377 * To check if vdev is operating in beaconing mode or not.
378 *
379 * Return: true or false
380 */
381 bool mlme_is_vdev_in_beaconning_mode(enum QDF_OPMODE vdev_opmode);
382
383 /**
384 * mlme_set_assoc_type() - set associate type
385 * @vdev: vdev pointer
386 * @assoc_type: type to be set
387 *
388 * Return: QDF_STATUS
389 */
390 QDF_STATUS mlme_set_assoc_type(struct wlan_objmgr_vdev *vdev,
391 enum vdev_assoc_type assoc_type);
392
393 /**
394 * mlme_get_vdev_stop_type() - to get vdev stop type
395 * @vdev: vdev pointer
396 * @vdev_stop_type: vdev stop type
397 *
398 * This API will get vdev stop type from mlme legacy priv.
399 *
400 * Return: QDF_STATUS
401 */
402 QDF_STATUS mlme_get_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
403 uint32_t *vdev_stop_type);
404
405 /**
406 * mlme_set_vdev_stop_type() - to set vdev stop type
407 * @vdev: vdev pointer
408 * @vdev_stop_type: vdev stop type
409 *
410 * This API will set vdev stop type from mlme legacy priv.
411 *
412 * Return: QDF_STATUS
413 */
414 QDF_STATUS mlme_set_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
415 uint32_t vdev_stop_type);
416
417 /**
418 * mlme_is_notify_co_located_ap_update_rnr() - Need co-located ap update rnr
419 * @vdev: vdev pointer
420 *
421 * Return: True if vdev need notify co-located ap to update rnr.
422 */
423 bool mlme_is_notify_co_located_ap_update_rnr(struct wlan_objmgr_vdev *vdev);
424
425 /**
426 * mlme_set_notify_co_located_ap_update_rnr() - notify co-located ap to update
427 * rnr
428 * @vdev: vdev pointer
429 * @update_rnr: whether to notify co-located ap to update rnr
430 *
431 * Return: Void
432 */
433 void mlme_set_notify_co_located_ap_update_rnr(struct wlan_objmgr_vdev *vdev,
434 bool update_rnr);
435
436 /**
437 * wlan_is_vdev_traffic_ll_ht() - if vdev traffic type is low latency or high TP
438 * @vdev: vdev pointer
439 *
440 * Return: true is LL or HT is set.
441 */
442 bool wlan_is_vdev_traffic_ll_ht(struct wlan_objmgr_vdev *vdev);
443
444 /**
445 * mlme_get_vdev_wifi_std() - get the wifi std version for the vdev
446 * @vdev: vdev pointer
447 *
448 * Return: WMI_HOST_WIFI_STANDARD
449 */
450 WMI_HOST_WIFI_STANDARD mlme_get_vdev_wifi_std(struct wlan_objmgr_vdev *vdev);
451
452 /**
453 * mlme_get_assoc_type() - get associate type
454 * @vdev: vdev pointer
455 *
456 * Return: associate type
457 */
458 enum vdev_assoc_type mlme_get_assoc_type(struct wlan_objmgr_vdev *vdev);
459
460 /**
461 * mlme_vdev_self_peer_create() - function to send the vdev create self peer
462 * @vdev: vdev pointer
463 *
464 * Return: QDF_STATUS_SUCCESS when the self peer is successfully created
465 * to firmware or QDF_STATUS_E_** when there is a failure.
466 */
467 QDF_STATUS mlme_vdev_self_peer_create(struct wlan_objmgr_vdev *vdev);
468
469 /**
470 * mlme_vdev_self_peer_delete() - function to delete vdev self peer
471 * @self_peer_del_msg: scheduler message containing the del_vdev_params
472 *
473 * Return: QDF_STATUS_SUCCESS when the self peer is successfully deleted
474 * to firmware or QDF_STATUS_E_** when there is a failure.
475 */
476 QDF_STATUS mlme_vdev_self_peer_delete(struct scheduler_msg *self_peer_del_msg);
477
478 /**
479 * mlme_vdev_uses_self_peer() - does vdev use self peer?
480 * @vdev_type: vdev type
481 * @vdev_subtype: vdev subtype
482 *
483 * Return: true if the vdev type/subtype uses the self peer
484 */
485 bool mlme_vdev_uses_self_peer(uint32_t vdev_type, uint32_t vdev_subtype);
486
487 /**
488 * mlme_vdev_self_peer_delete_resp() - send vdev self peer delete resp to Upper
489 * layer
490 * @param: params of del vdev response
491 *
492 * Return: none
493 */
494 void mlme_vdev_self_peer_delete_resp(struct del_vdev_params *param);
495
496 /**
497 * mlme_vdev_del_resp() - send vdev delete resp to Upper layer
498 * @vdev_id: vdev id for which del vdev response is received
499 *
500 * Return: none
501 */
502 void mlme_vdev_del_resp(uint8_t vdev_id);
503
504 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
505 /**
506 * mlme_set_single_link_mlo_roaming() - to set single link mlo roaming
507 * @vdev: vdev pointer
508 * @val: single link mlo roaming value true/false
509 *
510 * This API will set single link mlo roaming value.
511 *
512 * Return: QDF_STATUS
513 */
514 QDF_STATUS
515 mlme_set_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev, bool val);
516
517 /**
518 * mlme_get_single_link_mlo_roaming() - get single link mlo roaming
519 * @vdev: vdev pointer
520 *
521 * Return: single link mlo roaming boolean value true/false
522 */
523 bool mlme_get_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev);
524 #endif
525 /**
526 * wlan_sap_disconnect_all_p2p_client() - send SAP disconnect all P2P
527 * client event to the SAP event handler
528 * @vdev_id: vdev id of SAP
529 *
530 * Return: QDF_STATUS
531 */
532 QDF_STATUS wlan_sap_disconnect_all_p2p_client(uint8_t vdev_id);
533
534 /**
535 * wlan_sap_stop_bss() - send SAP stop bss event to the SAP event
536 * handler
537 * @vdev_id: vdev id of SAP
538 *
539 * Return: QDF_STATUS
540 */
541 QDF_STATUS wlan_sap_stop_bss(uint8_t vdev_id);
542
543 /**
544 * wlan_get_conc_freq() - get concurrent operation frequency
545 *
546 * Return: concurrent frequency
547 */
548 qdf_freq_t wlan_get_conc_freq(void);
549
550 #ifdef WLAN_FEATURE_11BE_MLO
551 /**
552 * wlan_handle_emlsr_sta_concurrency() - Handle concurrency scenarios with
553 * EMLSR STA.
554 * @psoc: pointer to psoc
555 * @conc_con_coming_up: Carries true if any concurrent connection(STA/SAP/NAN)
556 * is comng up
557 * @emlsr_sta_coming_up: Check if the new connection request is EMLSR STA
558 *
559 * The API handles concurrency scenarios with existing EMLSR connection when a
560 * new connection request is received OR with an existing legacy connection when
561 * an EMLSR sta comes up.
562 *
563 * Return: none
564 */
565 void
566 wlan_handle_emlsr_sta_concurrency(struct wlan_objmgr_psoc *psoc,
567 bool conc_con_coming_up,
568 bool emlsr_sta_coming_up);
569 #else
570 static inline void
wlan_handle_emlsr_sta_concurrency(struct wlan_objmgr_psoc * psoc,bool conc_con_coming_up,bool emlsr_sta_coming_up)571 wlan_handle_emlsr_sta_concurrency(struct wlan_objmgr_psoc *psoc,
572 bool conc_con_coming_up,
573 bool emlsr_sta_coming_up)
574 {
575 }
576 #endif
577
578 #ifdef WLAN_FEATURE_LL_LT_SAP
579 /**
580 * wlan_ll_sap_sort_channel_list() - Sort channel list
581 * @vdev_id: Vdev Id
582 * @list: Pointer to list
583 * @ch_info: Pointer to ch_info
584 *
585 * Return: QDF_STATUS
586 */
587 QDF_STATUS
588 wlan_ll_sap_sort_channel_list(uint8_t vdev_id, qdf_list_t *list,
589 struct sap_sel_ch_info *ch_info);
590
591 /**
592 * wlan_ll_sap_free_chan_info() - API to free allocated memory
593 * @ch_param: pointer to sap_sel_ch_info structure
594 *
595 * Return: None
596 */
597 void wlan_ll_sap_free_chan_info(struct sap_sel_ch_info *ch_param);
598
599 /**
600 * wlan_ll_sap_freq_present_in_pcl() - API to check whether given
601 * frequency is present in PCL or not
602 * @pcl: pcl list
603 * @freq: Frequency to check in PCL list
604 *
605 * Return: True/False
606 */
607 bool wlan_ll_sap_freq_present_in_pcl(struct policy_mgr_pcl_list *pcl,
608 qdf_freq_t freq);
609 #endif
610
611 /**
612 * wlan_sap_get_user_config_acs_ch_list: Get user configured channel list
613 * @vdev_id: Vdev Id
614 * @filter: Filter to apply to get scan result
615 *
616 * Return: None
617 *
618 */
619 void
620 wlan_sap_get_user_config_acs_ch_list(uint8_t vdev_id,
621 struct scan_filter *filter);
622 #endif
623