xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_son.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
6*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
7*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
8*5113495bSYour Name 
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*5113495bSYour Name  */
17*5113495bSYour Name 
18*5113495bSYour Name /**
19*5113495bSYour Name  * DOC: contains son hdd API implementation
20*5113495bSYour Name  */
21*5113495bSYour Name 
22*5113495bSYour Name #ifndef WLAN_HDD_SON_H
23*5113495bSYour Name #define WLAN_HDD_SON_H
24*5113495bSYour Name 
25*5113495bSYour Name #include <qdf_types.h>
26*5113495bSYour Name #include <wlan_hdd_main.h>
27*5113495bSYour Name 
28*5113495bSYour Name /*
29*5113495bSYour Name  * Determines type of event sent for MLME_EVENT_ASSOC_DISASSOC
30*5113495bSYour Name  * @ALD_ASSOC_EVENT: event name to send assoc event
31*5113495bSYour Name  * @ALD_DISASSOC_EVENT: event name to send disassoc event
32*5113495bSYour Name  */
33*5113495bSYour Name enum assoc_disassoc_event {
34*5113495bSYour Name 	ALD_ASSOC_EVENT,
35*5113495bSYour Name 	ALD_DISASSOC_EVENT,
36*5113495bSYour Name };
37*5113495bSYour Name 
38*5113495bSYour Name #ifdef WLAN_FEATURE_SON
39*5113495bSYour Name 
40*5113495bSYour Name /**
41*5113495bSYour Name  * hdd_son_register_callbacks() - register hdd callback for son
42*5113495bSYour Name  * @hdd_ctx: hdd context
43*5113495bSYour Name  *
44*5113495bSYour Name  * Return: void
45*5113495bSYour Name  */
46*5113495bSYour Name void hdd_son_register_callbacks(struct hdd_context *hdd_ctx);
47*5113495bSYour Name 
48*5113495bSYour Name /**
49*5113495bSYour Name  * hdd_son_deliver_acs_complete_event() - send acs complete event to son
50*5113495bSYour Name  * @adapter: adapter object
51*5113495bSYour Name  *
52*5113495bSYour Name  * Return: 0 if event is sent successfully
53*5113495bSYour Name  */
54*5113495bSYour Name int hdd_son_deliver_acs_complete_event(struct hdd_adapter *adapter);
55*5113495bSYour Name 
56*5113495bSYour Name /**
57*5113495bSYour Name  * hdd_son_deliver_cac_status_event() - send cac status to son
58*5113495bSYour Name  * @adapter: adapter object
59*5113495bSYour Name  * @freq: the operating frequency when radar is detected
60*5113495bSYour Name  * @radar_detected: true if radar is detected else false
61*5113495bSYour Name  *
62*5113495bSYour Name  * Return: 0 if event is sent successfully
63*5113495bSYour Name  */
64*5113495bSYour Name int hdd_son_deliver_cac_status_event(struct hdd_adapter *adapter,
65*5113495bSYour Name 				     qdf_freq_t freq, bool radar_detected);
66*5113495bSYour Name 
67*5113495bSYour Name /**
68*5113495bSYour Name  * hdd_son_deliver_assoc_disassoc_event() - send sta assoc disassoc event
69*5113495bSYour Name  *						to son
70*5113495bSYour Name  * @adapter: adapter object
71*5113495bSYour Name  * @sta_mac: Mac address of the sta
72*5113495bSYour Name  * @reason_code: reason code
73*5113495bSYour Name  * @flag: determines the type of event sent(Assoc/disassoc)
74*5113495bSYour Name  *
75*5113495bSYour Name  * Return: 0 if event is sent successfully
76*5113495bSYour Name  */
77*5113495bSYour Name int hdd_son_deliver_assoc_disassoc_event(struct hdd_adapter *adapter,
78*5113495bSYour Name 					 struct qdf_mac_addr sta_mac,
79*5113495bSYour Name 					 uint32_t reason_code,
80*5113495bSYour Name 					 enum assoc_disassoc_event flag);
81*5113495bSYour Name /**
82*5113495bSYour Name  * hdd_son_deliver_peer_authorize_event() - Deliver peer auth event to SON
83*5113495bSYour Name  * @link_info: Link info pointer in HDD adapter
84*5113495bSYour Name  * @peer_mac: Peer mac address
85*5113495bSYour Name  *
86*5113495bSYour Name  * Return: Void
87*5113495bSYour Name  */
88*5113495bSYour Name void hdd_son_deliver_peer_authorize_event(struct wlan_hdd_link_info *link_info,
89*5113495bSYour Name 					  uint8_t *peer_mac);
90*5113495bSYour Name 
91*5113495bSYour Name /**
92*5113495bSYour Name  * hdd_son_send_set_wifi_generic_command() - Send Generic SET command to SON
93*5113495bSYour Name  * @wiphy: standard kernel wiphy
94*5113495bSYour Name  * @wdev: wireless device
95*5113495bSYour Name  * @tb: NL attributes
96*5113495bSYour Name  *
97*5113495bSYour Name  * Return: 0 on success
98*5113495bSYour Name  */
99*5113495bSYour Name int hdd_son_send_set_wifi_generic_command(struct wiphy *wiphy,
100*5113495bSYour Name 					  struct wireless_dev *wdev,
101*5113495bSYour Name 					  struct nlattr **tb);
102*5113495bSYour Name 
103*5113495bSYour Name /**
104*5113495bSYour Name  * hdd_son_send_get_wifi_generic_command() - Send Generic GET command to SON
105*5113495bSYour Name  * @wiphy: standard kernel wiphy
106*5113495bSYour Name  * @wdev: wireless device
107*5113495bSYour Name  * @tb: NL attributes
108*5113495bSYour Name  *
109*5113495bSYour Name  * Return: 0 on success
110*5113495bSYour Name  */
111*5113495bSYour Name int hdd_son_send_get_wifi_generic_command(struct wiphy *wiphy,
112*5113495bSYour Name 					  struct wireless_dev *wdev,
113*5113495bSYour Name 					  struct nlattr **tb);
114*5113495bSYour Name 
115*5113495bSYour Name /**
116*5113495bSYour Name  * hdd_son_get_peer_max_mcs_idx() - Get peer max mcs index
117*5113495bSYour Name  * @vdev: vdev object
118*5113495bSYour Name  * @peer: peer obj
119*5113495bSYour Name  *
120*5113495bSYour Name  * Return: number of max mcs on success or 0 on failure
121*5113495bSYour Name  */
122*5113495bSYour Name uint32_t hdd_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
123*5113495bSYour Name 				      struct wlan_objmgr_peer *peer);
124*5113495bSYour Name 
125*5113495bSYour Name /**
126*5113495bSYour Name  * hdd_son_deliver_chan_change_event() - send chan change to SON
127*5113495bSYour Name  * @adapter: pointer to adapter
128*5113495bSYour Name  * @freq: new operating channel frequency
129*5113495bSYour Name  *
130*5113495bSYour Name  * Return: 0 on success
131*5113495bSYour Name  */
132*5113495bSYour Name int hdd_son_deliver_chan_change_event(struct hdd_adapter *adapter,
133*5113495bSYour Name 				      qdf_freq_t freq);
134*5113495bSYour Name #else
135*5113495bSYour Name 
hdd_son_register_callbacks(struct hdd_context * hdd_ctx)136*5113495bSYour Name static inline void hdd_son_register_callbacks(struct hdd_context *hdd_ctx)
137*5113495bSYour Name {
138*5113495bSYour Name }
139*5113495bSYour Name 
140*5113495bSYour Name static inline int
hdd_son_deliver_acs_complete_event(struct hdd_adapter * adapter)141*5113495bSYour Name 	hdd_son_deliver_acs_complete_event(struct hdd_adapter *adapter)
142*5113495bSYour Name {
143*5113495bSYour Name 	return 0;
144*5113495bSYour Name }
145*5113495bSYour Name 
146*5113495bSYour Name static inline int
hdd_son_deliver_cac_status_event(struct hdd_adapter * adapter,qdf_freq_t freq,bool radar_detected)147*5113495bSYour Name 	hdd_son_deliver_cac_status_event(struct hdd_adapter *adapter,
148*5113495bSYour Name 					 qdf_freq_t freq, bool radar_detected)
149*5113495bSYour Name {
150*5113495bSYour Name 	return 0;
151*5113495bSYour Name }
152*5113495bSYour Name 
153*5113495bSYour Name static inline int
hdd_son_deliver_assoc_disassoc_event(struct hdd_adapter * adapter,struct qdf_mac_addr sta_mac,uint32_t reason_code,enum assoc_disassoc_event flag)154*5113495bSYour Name 	hdd_son_deliver_assoc_disassoc_event(struct hdd_adapter *adapter,
155*5113495bSYour Name 					     struct qdf_mac_addr sta_mac,
156*5113495bSYour Name 					     uint32_t reason_code,
157*5113495bSYour Name 					     enum assoc_disassoc_event flag)
158*5113495bSYour Name {
159*5113495bSYour Name 	return 0;
160*5113495bSYour Name }
161*5113495bSYour Name 
162*5113495bSYour Name static inline void
hdd_son_deliver_peer_authorize_event(struct wlan_hdd_link_info * link_info,uint8_t * peer_mac)163*5113495bSYour Name hdd_son_deliver_peer_authorize_event(struct wlan_hdd_link_info *link_info,
164*5113495bSYour Name 				     uint8_t *peer_mac)
165*5113495bSYour Name {
166*5113495bSYour Name }
167*5113495bSYour Name 
168*5113495bSYour Name static inline
hdd_son_send_set_wifi_generic_command(struct wiphy * wiphy,struct wireless_dev * wdev,struct nlattr ** tb)169*5113495bSYour Name int hdd_son_send_set_wifi_generic_command(struct wiphy *wiphy,
170*5113495bSYour Name 					  struct wireless_dev *wdev,
171*5113495bSYour Name 					  struct nlattr **tb)
172*5113495bSYour Name {
173*5113495bSYour Name 	return -EINVAL;
174*5113495bSYour Name }
175*5113495bSYour Name 
176*5113495bSYour Name static inline
hdd_son_send_get_wifi_generic_command(struct wiphy * wiphy,struct wireless_dev * wdev,struct nlattr ** tb)177*5113495bSYour Name int hdd_son_send_get_wifi_generic_command(struct wiphy *wiphy,
178*5113495bSYour Name 					  struct wireless_dev *wdev,
179*5113495bSYour Name 					  struct nlattr **tb)
180*5113495bSYour Name {
181*5113495bSYour Name 	return -EINVAL;
182*5113495bSYour Name }
183*5113495bSYour Name 
184*5113495bSYour Name static inline
hdd_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer)185*5113495bSYour Name uint32_t hdd_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
186*5113495bSYour Name 				      struct wlan_objmgr_peer *peer)
187*5113495bSYour Name {
188*5113495bSYour Name 	return 0;
189*5113495bSYour Name }
190*5113495bSYour Name 
191*5113495bSYour Name static inline
hdd_son_deliver_chan_change_event(struct hdd_adapter * adapter,qdf_freq_t freq)192*5113495bSYour Name int hdd_son_deliver_chan_change_event(struct hdd_adapter *adapter,
193*5113495bSYour Name 				      qdf_freq_t freq)
194*5113495bSYour Name {
195*5113495bSYour Name 	return 0;
196*5113495bSYour Name }
197*5113495bSYour Name #endif /* WLAN_FEATURE_SON */
198*5113495bSYour Name #endif
199