xref: /wlan-driver/qca-wifi-host-cmn/umac/mlo_mgr/inc/wlan_mlo_mgr_public_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name /**
18*5113495bSYour Name  * DOC: contains mlo mgr north bound interface api
19*5113495bSYour Name  */
20*5113495bSYour Name 
21*5113495bSYour Name #ifndef _WLAN_MLO_MGR_PUBLIC_API_H_
22*5113495bSYour Name #define _WLAN_MLO_MGR_PUBLIC_API_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include <wlan_mlo_mgr_link_switch.h>
25*5113495bSYour Name 
26*5113495bSYour Name /**
27*5113495bSYour Name  * wlan_mlo_mgr_register_link_switch_notifier() - Components to register
28*5113495bSYour Name  * notifier callback on start of link switch.
29*5113495bSYour Name  * @comp_id: Component ID to register callback.
30*5113495bSYour Name  * @cb: Callback to register.
31*5113495bSYour Name  *
32*5113495bSYour Name  * The global MLO MGR will store the list of callbacks registered via this
33*5113495bSYour Name  * API and call each callback on start of link switch.
34*5113495bSYour Name  *
35*5113495bSYour Name  * Return: QDF_STATUS
36*5113495bSYour Name  */
37*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_mgr_register_link_switch_notifier(enum wlan_umac_comp_id comp_id,mlo_mgr_link_switch_notifier_cb cb)38*5113495bSYour Name wlan_mlo_mgr_register_link_switch_notifier(enum wlan_umac_comp_id comp_id,
39*5113495bSYour Name 					   mlo_mgr_link_switch_notifier_cb cb)
40*5113495bSYour Name {
41*5113495bSYour Name 	return mlo_mgr_register_link_switch_notifier(comp_id, cb);
42*5113495bSYour Name }
43*5113495bSYour Name 
44*5113495bSYour Name /**
45*5113495bSYour Name  * wlan_mlo_mgr_unregister_link_switch_notifier() - Components to unregister
46*5113495bSYour Name  * notifier callback on start of link switch.
47*5113495bSYour Name  * @comp_id: Component ID to unregister the callback.
48*5113495bSYour Name  *
49*5113495bSYour Name  * The global MLO MGR will remove the registered callback for @comp_id for
50*5113495bSYour Name  * notifying start of link switch.
51*5113495bSYour Name  *
52*5113495bSYour Name  * Return: QDF_STATUS
53*5113495bSYour Name  */
54*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_mgr_unregister_link_switch_notifier(enum wlan_umac_comp_id comp_id)55*5113495bSYour Name wlan_mlo_mgr_unregister_link_switch_notifier(enum wlan_umac_comp_id comp_id)
56*5113495bSYour Name {
57*5113495bSYour Name 	return mlo_mgr_unregister_link_switch_notifier(comp_id);
58*5113495bSYour Name }
59*5113495bSYour Name 
60*5113495bSYour Name /**
61*5113495bSYour Name  * wlan_mlo_mgr_is_link_switch_in_progress() - Check link switch in progress
62*5113495bSYour Name  * on MLO dev context level.
63*5113495bSYour Name  * @vdev: VDEV object manager
64*5113495bSYour Name  *
65*5113495bSYour Name  * This API will check if current state of MLO manager link switch state is
66*5113495bSYour Name  * in progress or not. The return value of true shall not be treated as @vdev
67*5113495bSYour Name  * is in link switch in progress. To know the status of VDEV in link switch or
68*5113495bSYour Name  * not need to use wlan_vdev_mlme_is_mlo_link_switch_in_progress() API
69*5113495bSYour Name  *
70*5113495bSYour Name  * Return: bool
71*5113495bSYour Name  */
72*5113495bSYour Name static inline bool
wlan_mlo_mgr_is_link_switch_in_progress(struct wlan_objmgr_vdev * vdev)73*5113495bSYour Name wlan_mlo_mgr_is_link_switch_in_progress(struct wlan_objmgr_vdev *vdev)
74*5113495bSYour Name {
75*5113495bSYour Name 	return mlo_mgr_is_link_switch_in_progress(vdev);
76*5113495bSYour Name }
77*5113495bSYour Name 
78*5113495bSYour Name /**
79*5113495bSYour Name  * wlan_mlo_mgr_is_link_switch_on_assoc_vdev() - Is link switch in progress is
80*5113495bSYour Name  * on assoc VDEV.
81*5113495bSYour Name  * @vdev: VDEV object manager.
82*5113495bSYour Name  *
83*5113495bSYour Name  * Return true if current link switch in progress is on assoc VDEV or not.
84*5113495bSYour Name  *
85*5113495bSYour Name  * Return: void
86*5113495bSYour Name  */
87*5113495bSYour Name static inline bool
wlan_mlo_mgr_is_link_switch_on_assoc_vdev(struct wlan_objmgr_vdev * vdev)88*5113495bSYour Name wlan_mlo_mgr_is_link_switch_on_assoc_vdev(struct wlan_objmgr_vdev *vdev)
89*5113495bSYour Name {
90*5113495bSYour Name 	return mlo_mgr_is_link_switch_on_assoc_vdev(vdev);
91*5113495bSYour Name }
92*5113495bSYour Name 
93*5113495bSYour Name /**
94*5113495bSYour Name  * wlan_mlo_mgr_link_switch_get_assoc_vdev() - Return assco VDEV pointer
95*5113495bSYour Name  * if it is in link switch.
96*5113495bSYour Name  * @vdev: VDEV object manager
97*5113495bSYour Name  *
98*5113495bSYour Name  * Return: VDEV object manager pointer
99*5113495bSYour Name  */
100*5113495bSYour Name static inline struct wlan_objmgr_vdev *
wlan_mlo_mgr_link_switch_get_assoc_vdev(struct wlan_objmgr_vdev * vdev)101*5113495bSYour Name wlan_mlo_mgr_link_switch_get_assoc_vdev(struct wlan_objmgr_vdev *vdev)
102*5113495bSYour Name {
103*5113495bSYour Name 	return mlo_mgr_link_switch_get_assoc_vdev(vdev);
104*5113495bSYour Name }
105*5113495bSYour Name 
106*5113495bSYour Name /**
107*5113495bSYour Name  * wlan_mlo_mgr_link_switch_set_mac_addr_resp() - Dispatcher API to call to
108*5113495bSYour Name  * notify about status of set mac addr request.
109*5113495bSYour Name  * @vdev: VDEV object manager
110*5113495bSYour Name  * @resp_status: Status of request
111*5113495bSYour Name  *
112*5113495bSYour Name  * Return: QDF_STATUS
113*5113495bSYour Name  */
114*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_mgr_link_switch_set_mac_addr_resp(struct wlan_objmgr_vdev * vdev,uint8_t resp_status)115*5113495bSYour Name wlan_mlo_mgr_link_switch_set_mac_addr_resp(struct wlan_objmgr_vdev *vdev,
116*5113495bSYour Name 					   uint8_t resp_status)
117*5113495bSYour Name {
118*5113495bSYour Name 	return mlo_mgr_link_switch_set_mac_addr_resp(vdev, resp_status);
119*5113495bSYour Name }
120*5113495bSYour Name 
121*5113495bSYour Name /**
122*5113495bSYour Name  * wlan_mlo_mgr_link_switch_defer_disconnect_req() - Defer disconnect requests
123*5113495bSYour Name  * from source other than link switch.
124*5113495bSYour Name  * @vdev: VDEV object manager
125*5113495bSYour Name  * @source: Disconnect requestor
126*5113495bSYour Name  * @reason: Reason for disconnect
127*5113495bSYour Name  *
128*5113495bSYour Name  * Return: QDF_STATUS.
129*5113495bSYour Name  */
130*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_mgr_link_switch_defer_disconnect_req(struct wlan_objmgr_vdev * vdev,enum wlan_cm_source source,enum wlan_reason_code reason)131*5113495bSYour Name wlan_mlo_mgr_link_switch_defer_disconnect_req(struct wlan_objmgr_vdev *vdev,
132*5113495bSYour Name 					      enum wlan_cm_source source,
133*5113495bSYour Name 					      enum wlan_reason_code reason)
134*5113495bSYour Name {
135*5113495bSYour Name 	return mlo_mgr_link_switch_defer_disconnect_req(vdev, source, reason);
136*5113495bSYour Name }
137*5113495bSYour Name #endif /* _WLAN_MLO_MGR_PUBLIC_API_H_ */
138