1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 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: os_if_son.h
20  *
21  * WLAN Host Device Driver file for son (Self Organizing Network)
22  * support.
23  *
24  */
25 #ifndef _OS_IF_SON_H_
26 #define _OS_IF_SON_H_
27 
28 #include <qdf_types.h>
29 #include <wlan_objmgr_vdev_obj.h>
30 #include <wlan_objmgr_psoc_obj.h>
31 #include <wlan_objmgr_pdev_obj.h>
32 #include <wlan_reg_ucfg_api.h>
33 #include <ieee80211_external.h>
34 
35 #define INVALID_WIDTH 0xFF
36 
37 /**
38  * struct son_callbacks - struct containing callback to non-converged driver
39  * @os_if_is_acs_in_progress: whether acs is in progress or not
40  * @os_if_set_chan_ext_offset: set chan extend offset
41  * @os_if_get_chan_ext_offset: get chan extend offset
42  * @os_if_set_bandwidth: set band width
43  * @os_if_get_bandwidth: get band width
44  * @os_if_set_chan: set chan
45  * @os_if_get_sta_count: get station count
46  * @os_if_set_country_code: set country code
47  * @os_if_set_candidate_freq: set freq to switch after radar detection
48  * @os_if_get_candidate_freq: get freq to switch after radar detection
49  * @os_if_set_phymode: set phy mode
50  * @os_if_get_phymode: get phy mode
51  * @os_if_get_rx_nss: Gets number of RX spatial streams
52  * @os_if_set_acl_policy: set acl policy
53  * @os_if_get_acl_policy: get acl policy
54  * @os_if_add_acl_mac: add mac to acl
55  * @os_if_del_acl_mac: del mac from acl
56  * @os_if_kickout_mac: kickout sta with given mac
57  * @os_if_set_chwidth: set chan width
58  * @os_if_get_chwidth: get chan width
59  * @os_if_get_sta_list: get sta list
60  * @os_if_get_sta_space: get sta space
61  * @os_if_deauth_sta: Deauths the target peer
62  * @os_if_modify_acl: Add/Del target peer in ACL
63  * @os_if_get_vdev_by_netdev: Get vdev from net device
64  * @os_if_trigger_objmgr_object_creation: Trigger objmgr object creation
65  * @os_if_trigger_objmgr_object_deletion: Trigger objmgr object deletion
66  * @os_if_start_acs: Trigger ACS
67  * @os_if_set_acs_channels: Set channel list for ACS
68  * @os_if_get_acs_report: Gets the ACS report
69  * @os_if_get_node_info: Gets the datarate info for node
70  * @os_if_get_peer_capability: Gets peer capability
71  * @os_if_get_peer_max_mcs_idx: Gets peer max MCS index
72  * @os_if_get_sta_stats: Get sta stats
73  */
74 struct son_callbacks {
75 	uint32_t (*os_if_is_acs_in_progress)(struct wlan_objmgr_vdev *vdev);
76 	int (*os_if_set_chan_ext_offset)(
77 				struct wlan_objmgr_vdev *vdev,
78 				enum sec20_chan_offset son_chan_ext_offset);
79 	enum sec20_chan_offset (*os_if_get_chan_ext_offset)(
80 				struct wlan_objmgr_vdev *vdev);
81 	int (*os_if_set_bandwidth)(struct wlan_objmgr_vdev *vdev,
82 				   uint32_t son_bandwidth);
83 	uint32_t (*os_if_get_bandwidth)(struct wlan_objmgr_vdev *vdev);
84 	int (*os_if_set_chan)(struct wlan_objmgr_vdev *vdev, int chan,
85 			      enum wlan_band_id son_band);
86 	uint32_t (*os_if_get_sta_count)(struct wlan_objmgr_vdev *vdev);
87 	int (*os_if_set_country_code)(struct wlan_objmgr_vdev *vdev,
88 				      char *country_code);
89 	int (*os_if_set_candidate_freq)(struct wlan_objmgr_vdev *vdev,
90 					qdf_freq_t freq);
91 	qdf_freq_t (*os_if_get_candidate_freq)(struct wlan_objmgr_vdev *vdev);
92 	int (*os_if_set_phymode)(struct wlan_objmgr_vdev *vdev,
93 				 enum ieee80211_phymode mode);
94 	enum ieee80211_phymode (*os_if_get_phymode)(
95 					struct wlan_objmgr_vdev *vdev);
96 	uint8_t (*os_if_get_rx_nss)(struct wlan_objmgr_vdev *vdev);
97 	QDF_STATUS (*os_if_set_acl_policy)(struct wlan_objmgr_vdev *vdev,
98 					   ieee80211_acl_cmd son_acl_policy);
99 	ieee80211_acl_cmd (*os_if_get_acl_policy)(
100 						struct wlan_objmgr_vdev *vdev);
101 	int (*os_if_add_acl_mac)(struct wlan_objmgr_vdev *vdev,
102 				 struct qdf_mac_addr *acl_mac);
103 	int (*os_if_del_acl_mac)(struct wlan_objmgr_vdev *vdev,
104 				 struct qdf_mac_addr *acl_mac);
105 	int (*os_if_kickout_mac)(struct wlan_objmgr_vdev *vdev,
106 				 struct qdf_mac_addr *acl_mac);
107 	int (*os_if_set_chwidth)(struct wlan_objmgr_vdev *vdev,
108 				 enum ieee80211_cwm_width son_chwidth);
109 	enum ieee80211_cwm_width (*os_if_get_chwidth)(
110 				struct wlan_objmgr_vdev *vdev);
111 	void (*os_if_get_sta_list)(struct wlan_objmgr_vdev *vdev,
112 				   struct ieee80211req_sta_info *req,
113 				   uint32_t *space);
114 	uint32_t (*os_if_get_sta_space)(struct wlan_objmgr_vdev *vdev);
115 	void (*os_if_deauth_sta)(struct wlan_objmgr_vdev *vdev,
116 				 uint8_t *peer_mac,
117 				 bool ignore_frame);
118 	void (*os_if_modify_acl)(struct wlan_objmgr_vdev *vdev,
119 				 uint8_t *peer_mac,
120 				 bool allow_auth);
121 	struct wlan_objmgr_vdev *(*os_if_get_vdev_by_netdev)
122 				(struct net_device *dev);
123 	QDF_STATUS (*os_if_trigger_objmgr_object_creation)
124 				(enum wlan_umac_comp_id id);
125 	QDF_STATUS (*os_if_trigger_objmgr_object_deletion)
126 				(enum wlan_umac_comp_id id);
127 	int (*os_if_start_acs)(struct wlan_objmgr_vdev *vdev, uint8_t enable);
128 	int (*os_if_set_acs_channels)(struct wlan_objmgr_vdev *vdev,
129 				      struct ieee80211req_athdbg *req);
130 	int (*os_if_get_acs_report)(struct wlan_objmgr_vdev *vdev,
131 				    struct ieee80211_acs_dbg *acs_r);
132 	QDF_STATUS (*os_if_get_node_info)(struct wlan_objmgr_vdev *vdev,
133 					  uint8_t *mac_addr,
134 					  wlan_node_info *nodeinfo);
135 	QDF_STATUS (*os_if_get_peer_capability)(struct wlan_objmgr_vdev *vdev,
136 						struct wlan_objmgr_peer *peer,
137 						wlan_peer_cap *cap);
138 	uint32_t (*os_if_get_peer_max_mcs_idx)(struct wlan_objmgr_vdev *vdev,
139 					       struct wlan_objmgr_peer *peer);
140 	int (*os_if_get_sta_stats)(struct wlan_objmgr_vdev *vdev,
141 				   uint8_t *mac_addr,
142 				   struct ieee80211_nodestats *stats);
143 };
144 
145 /**
146  * enum os_if_son_vendor_cmd_type - Enum to specify get/set command
147  * @OS_IF_SON_VENDOR_GET_CMD: Get type command called from wificonfiguration
148  *                            vendor command handler
149  * @OS_IF_SON_VENDOR_SET_CMD: Set type command called from wificonfiguration
150  *                            vendor command handler
151  * @OS_IF_SON_VENDOR_MAX_CMD: Max cmd type
152  */
153 enum os_if_son_vendor_cmd_type {
154 	OS_IF_SON_VENDOR_GET_CMD,
155 	OS_IF_SON_VENDOR_SET_CMD,
156 	OS_IF_SON_VENDOR_MAX_CMD,
157 };
158 
159 /**
160  * struct os_if_son_rx_ops - Contains cb for os_if rx ops used by SON
161  * @parse_generic_nl_cmd: Callback for parsing generic nl vendor commands
162  */
163 struct os_if_son_rx_ops {
164 	int (*parse_generic_nl_cmd)(struct wiphy *wiphy,
165 				    struct wireless_dev *wdev, void *params,
166 				    enum os_if_son_vendor_cmd_type type);
167 };
168 
169 /**
170  * struct wlan_os_if_son_ops - Contains cb for os_if txrx ops used by SON
171  * @son_osif_rx_ops: structure to contain rx ops
172  */
173 struct wlan_os_if_son_ops {
174 	struct os_if_son_rx_ops son_osif_rx_ops;
175 };
176 
177 /**
178  * wlan_os_if_son_ops_register_cb() - Set son os_if ops cb
179  * @handler: son os_if ops cb table
180  *
181  * Return: void
182  */
183 void
184 wlan_os_if_son_ops_register_cb(void (*handler)(struct wlan_os_if_son_ops *));
185 
186 /**
187  * os_if_son_register_osif_ops() - Register son os_if ops with os_if
188  *
189  * Return: void
190  */
191 void os_if_son_register_osif_ops(void);
192 
193 /**
194  * os_if_son_register_lmac_if_ops() - Register son lmac_if rx_ops with lmac
195  * @psoc: objmrg psoc handle
196  *
197  * Register son lmac_if rx_ops with lmac to be called by SON DLKM
198  *
199  * Return: void
200  */
201 void os_if_son_register_lmac_if_ops(struct wlan_objmgr_psoc *psoc);
202 
203 /**
204  * os_if_son_register_hdd_callbacks() - register son hdd callback
205  * @psoc: psoc
206  * @cb_obj: pointer to callback
207  *
208  * Return: void
209  */
210 void os_if_son_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
211 				      struct son_callbacks *cb_obj);
212 
213 /**
214  * os_if_son_get_freq() - get freq
215  * @vdev: vdev
216  *
217  * Return: freq of given vdev
218  */
219 qdf_freq_t os_if_son_get_freq(struct wlan_objmgr_vdev *vdev);
220 
221 /**
222  * os_if_son_is_acs_in_progress() - whether ACS in progress or not
223  * @vdev: vdev
224  *
225  * Return: true if ACS is in progress
226  */
227 uint32_t os_if_son_is_acs_in_progress(struct wlan_objmgr_vdev *vdev);
228 
229 /**
230  * os_if_son_is_cac_in_progress() - whether CAC is in progress or not
231  * @vdev: vdev
232  *
233  * Return: true if CAC is in progress
234  */
235 uint32_t os_if_son_is_cac_in_progress(struct wlan_objmgr_vdev *vdev);
236 
237 /**
238  * os_if_son_set_chan_ext_offset() - set chan extend offset
239  * @vdev: vdev
240  * @son_chan_ext_offset: son chan extend offset
241  *
242  * Return: 0 on success, negative errno on failure
243  */
244 int os_if_son_set_chan_ext_offset(struct wlan_objmgr_vdev *vdev,
245 				  enum sec20_chan_offset son_chan_ext_offset);
246 
247 /**
248  * os_if_son_get_chan_ext_offset() - get chan extend offset
249  * @vdev: vdev
250  *
251  * Return: enum sec20_chan_offset
252  */
253 enum sec20_chan_offset os_if_son_get_chan_ext_offset(
254 					struct wlan_objmgr_vdev *vdev);
255 
256 /**
257  * os_if_son_set_bandwidth() - set band width
258  * @vdev: vdev
259  * @son_bandwidth: band width
260  *
261  * Return: 0 on success, negative errno on failure
262  */
263 int os_if_son_set_bandwidth(struct wlan_objmgr_vdev *vdev,
264 			    uint32_t son_bandwidth);
265 
266 /**
267  * os_if_son_get_bandwidth() - get band width
268  * @vdev: vdev
269  *
270  * Return: band width
271  */
272 uint32_t os_if_son_get_bandwidth(struct wlan_objmgr_vdev *vdev);
273 
274 /**
275  * os_if_son_get_band_info() - get band info
276  * @vdev: vdev
277  *
278  * Return: band info
279  */
280 uint32_t os_if_son_get_band_info(struct wlan_objmgr_vdev *vdev);
281 
282 /**
283  * os_if_son_get_chan_list() - get a list of chan information
284  * @vdev: vdev
285  * @ic_chans: chan information array to get
286  * @chan_info: pointer to ieee80211_channel_info to get
287  * @ic_nchans: number of chan information it gets
288  * @flag_160: flag indicating the API to fill the center frequencies of 160MHz.
289  * @flag_6ghz: flag indicating the API to include 6 GHz or not
290  *
291  * Return: 0 on success, negative errno on failure
292  */
293 int os_if_son_get_chan_list(struct wlan_objmgr_vdev *vdev,
294 			    struct ieee80211_ath_channel *ic_chans,
295 			    struct ieee80211_channel_info *chan_info,
296 			    uint8_t *ic_nchans, bool flag_160, bool flag_6ghz);
297 
298 /**
299  * os_if_son_get_sta_count() - get connected STA count
300  * @vdev: vdev
301  *
302  * Return: connected STA count
303  */
304 uint32_t os_if_son_get_sta_count(struct wlan_objmgr_vdev *vdev);
305 
306 /**
307  * os_if_son_get_bssid() - get bssid of given vdev
308  * @vdev: vdev
309  * @bssid: pointer to BSSID
310  *
311  * Return: 0 if BSSID is gotten successfully
312  */
313 int os_if_son_get_bssid(struct wlan_objmgr_vdev *vdev,
314 			uint8_t bssid[QDF_MAC_ADDR_SIZE]);
315 
316 /**
317  * os_if_son_get_ssid() - get ssid of given vdev
318  * @vdev: vdev
319  * @ssid: pointer to SSID
320  * @ssid_len: ssid length
321  *
322  * Return: 0 if SSID is gotten successfully
323  */
324 int os_if_son_get_ssid(struct wlan_objmgr_vdev *vdev,
325 		       char ssid[WLAN_SSID_MAX_LEN + 1],
326 		       uint8_t *ssid_len);
327 
328 /**
329  * os_if_son_set_chan() - set chan
330  * @vdev: vdev
331  * @chan: given chan
332  * @son_band: given band
333  *
334  * Return: 0 on success, negative errno on failure
335  */
336 int os_if_son_set_chan(struct wlan_objmgr_vdev *vdev,
337 		       int chan, enum wlan_band_id son_band);
338 
339 /**
340  * os_if_son_set_cac_timeout() - set cac timeout
341  * @vdev: vdev
342  * @cac_timeout: cac timeount to set
343  *
344  * Return: 0 if cac time out is set successfully
345  */
346 int os_if_son_set_cac_timeout(struct wlan_objmgr_vdev *vdev,
347 			      int cac_timeout);
348 
349 /**
350  * os_if_son_get_cac_timeout() - get cac timeout
351  * @vdev: vdev
352  * @cac_timeout: cac timeout to get
353  *
354  * Return 0 if cac time out is get successfully
355  */
356 int os_if_son_get_cac_timeout(struct wlan_objmgr_vdev *vdev,
357 			      int *cac_timeout);
358 
359 /**
360  * os_if_son_set_country_code() - set country code
361  * @vdev: vdev
362  * @country_code: country code to set
363  *
364  * Return: 0 if country code is set successfully
365  */
366 int os_if_son_set_country_code(struct wlan_objmgr_vdev *vdev,
367 			       char *country_code);
368 
369 /**
370  * os_if_son_get_country_code() - get country code
371  * @vdev: vdev
372  * @country_code: country code to get
373  *
374  * Return: 0 if country code is get successfully
375  */
376 int os_if_son_get_country_code(struct wlan_objmgr_vdev *vdev,
377 			       char *country_code);
378 
379 /**
380  * os_if_son_set_candidate_freq() - set freq to switch after radar detection
381  * @vdev: vdev
382  * @freq: freq to switch
383  *
384  * Return: 0 if candidate freq is set successfully
385  */
386 int os_if_son_set_candidate_freq(struct wlan_objmgr_vdev *vdev,
387 				 qdf_freq_t freq);
388 
389 /**
390  * os_if_son_get_candidate_freq() - get freq to switch after radar detection
391  * @vdev: vdev
392  *
393  * Return: candidate freq to switch after radar detection
394  */
395 qdf_freq_t os_if_son_get_candidate_freq(struct wlan_objmgr_vdev *vdev);
396 
397 /**
398  * os_if_son_get_phymode() - get phy mode
399  * @vdev: vdev
400  *
401  * Return: enum ieee80211_phymode
402  */
403 enum ieee80211_phymode os_if_son_get_phymode(struct wlan_objmgr_vdev *vdev);
404 
405 /**
406  * os_if_son_set_phymode() - set phy mode
407  * @vdev: vdev
408  * @mode: son phy mode to set
409  *
410  * Return: 0 on success, negative errno on failure
411  */
412 int os_if_son_set_phymode(struct wlan_objmgr_vdev *vdev,
413 			  enum ieee80211_phymode mode);
414 
415 /**
416  * os_if_son_get_phy_stats() - get phy stats
417  * @vdev: vdev
418  * @phy_stats: phy stats
419  *
420  * Return: void
421  */
422 void os_if_son_get_phy_stats(struct wlan_objmgr_vdev *vdev,
423 			     struct ol_ath_radiostats *phy_stats);
424 
425 /**
426  * os_if_son_cbs_init() - cbs init
427  *
428  * Return: 0 on success, negative errno on failure
429  */
430 int os_if_son_cbs_init(void);
431 
432 /**
433  * os_if_son_cbs_deinit() - cbs deinit
434  *
435  * Return: 0 on success, negative errno on failure
436  */
437 int os_if_son_cbs_deinit(void);
438 
439 /**
440  * os_if_son_set_cbs() - enable cbs or disable
441  * @vdev: vdev
442  * @enable: true or false
443  *
444  * Return: 0 on success, negative errno on failure
445  */
446 int os_if_son_set_cbs(struct wlan_objmgr_vdev *vdev,
447 		      bool enable);
448 
449 /**
450  * os_if_son_set_cbs_wait_time() - set cbs wait time
451  * @vdev: vdev
452  * @val: value
453  *
454  * Return: 0 on success, negative errno on failure
455  */
456 int os_if_son_set_cbs_wait_time(struct wlan_objmgr_vdev *vdev,
457 				uint32_t val);
458 
459 /**
460  * os_if_son_set_cbs_dwell_split_time() - set cbs dwell split time
461  * @vdev: vdev
462  * @val: value
463  *
464  * Return: 0 on success, negative errno on failure
465  */
466 int os_if_son_set_cbs_dwell_split_time(struct wlan_objmgr_vdev *vdev,
467 				       uint32_t val);
468 
469 /**
470  * os_if_son_get_chan_util() - get chan utilization
471  * @vdev: vdev
472  *
473  * Return: chan utilization (0 - 100)
474  */
475 uint8_t os_if_son_get_chan_util(struct wlan_objmgr_vdev *vdev);
476 
477 /**
478  * os_if_son_pdev_ops() - Handles PDEV specific SON commands
479  * @pdev: pdev
480  * @type: SON command to handle
481  * @data: Input Data
482  * @ret: Output Data
483  *
484  * Return: QDF_SUCCCESS_SUCCESS in case of success
485  */
486 QDF_STATUS os_if_son_pdev_ops(struct wlan_objmgr_pdev *pdev,
487 			      enum wlan_mlme_pdev_param type,
488 			      void *data, void *ret);
489 
490 /**
491  * os_if_son_vdev_ops() - Handles VDEV specific SON commands
492  * @vdev: vdev
493  * @type: SON command to handle
494  * @data: Input Data
495  * @ret: Output Data
496  *
497  * Return: QDF_SUCCCESS_SUCCESS in case of success
498  */
499 QDF_STATUS os_if_son_vdev_ops(struct wlan_objmgr_vdev *vdev,
500 			      enum wlan_mlme_vdev_param type,
501 			      void *data, void *ret);
502 
503 /**
504  * os_if_son_peer_ops() - Handles PEER specific SON commands
505  * @peer: peer
506  * @type: SON command to handle
507  * @data: Input Data. Pointer to wlan_mlme_peer_data
508  * @ret: Output Data. Pointer to wlan_mlme_peer_data
509  *
510  * Return: QDF_SUCCCESS_SUCCESS in case of success
511  */
512 QDF_STATUS os_if_son_peer_ops(struct wlan_objmgr_peer *peer,
513 			      enum wlan_mlme_peer_param type,
514 			      union wlan_mlme_peer_data *data,
515 			      union wlan_mlme_peer_data *ret);
516 
517 /**
518  * os_if_son_scan_db_iterate() - get country code
519  * @pdev: pdev
520  * @handler: scan_iterator
521  * @arg: argument to be passed to handler
522  *
523  * Return: QDF_SUCCCESS_SUCCESS in case of success
524  */
525 QDF_STATUS os_if_son_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
526 				     scan_iterator_func handler, void *arg);
527 
528 /**
529  * os_if_son_acl_is_probe_wh_set() - Withheld probes for given mac_addr,
530  *				     not supported
531  * @vdev: vdev
532  * @mac_addr: 6-Byte MAC address
533  * @probe_rssi: Probe Request RSSI
534  *
535  * Return: true / false
536  */
537 bool os_if_son_acl_is_probe_wh_set(struct wlan_objmgr_vdev *vdev,
538 				   const uint8_t *mac_addr,
539 				   uint8_t probe_rssi);
540 
541 /**
542  * os_if_son_get_rx_streams() - Gets number of RX spatial streams
543  * @vdev: target vdev
544  *
545  * Return: number of spatial stream
546  */
547 uint8_t os_if_son_get_rx_streams(struct wlan_objmgr_vdev *vdev);
548 
549 /**
550  * os_if_son_cfg80211_reply() - replies to cfg80211
551  * @sk_buf: sk_buff to uper layer
552  *
553  * Return: QDF_STATUS_SUCCESS on success
554  */
555 QDF_STATUS os_if_son_cfg80211_reply(qdf_nbuf_t sk_buf);
556 
557 /**
558  * os_if_son_vdev_is_wds() - checks if wds capability is supported or not
559  * @vdev: Pointer to vdev
560  *
561  * Return: true if wds is supported
562  */
563 bool os_if_son_vdev_is_wds(struct wlan_objmgr_vdev *vdev);
564 
565 /*
566  * os_if_son_set_acl_policy() - set acl policy
567  * @vdev: vdev
568  * @son_acl_policy: son acl policy. enum ieee80211_acl_cmd
569  *
570  * Return: QDF_STATUS
571  */
572 QDF_STATUS os_if_son_set_acl_policy(struct wlan_objmgr_vdev *vdev,
573 				    ieee80211_acl_cmd son_acl_policy);
574 
575 /**
576  * os_if_son_get_acl_policy() - get acl policy
577  * @vdev: vdev
578  *
579  * Return: acl policy. enum ieee80211_acl_cmd
580  */
581 ieee80211_acl_cmd os_if_son_get_acl_policy(struct wlan_objmgr_vdev *vdev);
582 
583 /**
584  * os_if_son_add_acl_mac() - add mac to acl
585  * @vdev: vdev
586  * @acl_mac: mac to add
587  *
588  * Return: 0 on success, negative errno on failure
589  */
590 int os_if_son_add_acl_mac(struct wlan_objmgr_vdev *vdev,
591 			  struct qdf_mac_addr *acl_mac);
592 
593 /**
594  * os_if_son_get_sta_space() - get sta space
595  * @vdev: target vdev
596  *
597  * Return: bytes which is needed to fill sta information
598  */
599 uint32_t os_if_son_get_sta_space(struct wlan_objmgr_vdev *vdev);
600 
601 /**
602  * os_if_son_get_sta_list() - get sta list
603  * @vdev: target vdev
604  * @si: pointer to ieee80211req_sta_info
605  * @space: space left
606  *
607  * Return: void
608  */
609 void os_if_son_get_sta_list(struct wlan_objmgr_vdev *vdev,
610 			    struct ieee80211req_sta_info *si, uint32_t *space);
611 
612 /**
613  * os_if_son_del_acl_mac() - del mac from acl
614  * @vdev: vdev
615  * @acl_mac: mac to del
616  *
617  * Return: 0 on success, negative errno on failure
618  */
619 int os_if_son_del_acl_mac(struct wlan_objmgr_vdev *vdev,
620 			  struct qdf_mac_addr *acl_mac);
621 
622 /**
623  * os_if_son_kickout_mac() - kickout sta with given mac
624  * @vdev: vdev
625  * @mac: sta mac to kickout
626  *
627  * Return: 0 on success, negative errno on failure
628  */
629 int os_if_son_kickout_mac(struct wlan_objmgr_vdev *vdev,
630 			  struct qdf_mac_addr *mac);
631 
632 /**
633  * os_if_son_set_chwidth() - set chan width
634  * @vdev: vdev
635  * @son_chwidth: son chan width
636  *
637  * Return: 0 on success, negative errno on failure
638  */
639 int os_if_son_set_chwidth(struct wlan_objmgr_vdev *vdev,
640 			  enum ieee80211_cwm_width son_chwidth);
641 
642 /**
643  * os_if_son_get_chwidth() - get chan width
644  * @vdev: vdev
645  *
646  * Return: son chan width
647  */
648 enum ieee80211_cwm_width os_if_son_get_chwidth(struct wlan_objmgr_vdev *vdev);
649 
650 /**
651  * os_if_son_deauth_peer_sta - Deauths specified STA
652  * @vdev: vdev
653  * @peer_mac: Target peer MAC address
654  * @ignore_frame: True to silently deauth the peer
655  *
656  * Return: void
657  */
658 void os_if_son_deauth_peer_sta(struct wlan_objmgr_vdev *vdev,
659 			       uint8_t *peer_mac,
660 			       bool ignore_frame);
661 
662 /**
663  * os_if_son_modify_acl - Updates ACL with given peer
664  * @vdev: vdev
665  * @peer_mac: Target peer MAC address
666  * @allow_auth: True to allow specified peer to connect
667  *
668  * Return: void
669  */
670 void os_if_son_modify_acl(struct wlan_objmgr_vdev *vdev,
671 			  uint8_t *peer_mac,
672 			  bool allow_auth);
673 
674 /**
675  * os_if_son_deliver_ald_event() - deliver ald events to son
676  * @vdev: vdev object
677  * @peer: peer object
678  * @event: Name of the event
679  * @event_data: event data
680  *
681  * Return: 0 on success
682  */
683 int os_if_son_deliver_ald_event(struct wlan_objmgr_vdev *vdev,
684 				struct wlan_objmgr_peer *peer,
685 				enum ieee80211_event_type event,
686 				void *event_data);
687 /**
688  * os_if_son_get_vdev_by_netdev() - Get vdev from net device
689  * @dev: net device struct
690  *
691  * Return: objmgr vdev on success else NULL
692  */
693 struct wlan_objmgr_vdev *os_if_son_get_vdev_by_netdev(struct net_device *dev);
694 
695 /**
696  * os_if_son_trigger_objmgr_object_deletion() - Trigger objmgr object deletion
697  * @id: umac component id
698  *
699  * Return: QDF_STATUS_SUCCESS on success
700  */
701 QDF_STATUS os_if_son_trigger_objmgr_object_deletion(enum wlan_umac_comp_id id);
702 
703 /**
704  * os_if_son_trigger_objmgr_object_creation() - Trigger objmgr object creation
705  * @id: umac component id
706  *
707  * Return: QDF_STATUS_SUCCESS on success
708  */
709 QDF_STATUS os_if_son_trigger_objmgr_object_creation(enum wlan_umac_comp_id id);
710 
711 /**
712  * os_if_son_start_acs() - Triggers ACS on the target vdev
713  * @vdev: target vdev
714  * @enable: True - to start ACS
715  *
716  * Return: 0 on success
717  */
718 int os_if_son_start_acs(struct wlan_objmgr_vdev *vdev, uint8_t enable);
719 
720 /**
721  * os_if_son_set_acs_chan() - Set channel list for ACS
722  * @vdev: target vdev
723  * @req: channel list
724  *
725  * Return: 0 on success
726  */
727 int os_if_son_set_acs_chan(struct wlan_objmgr_vdev *vdev,
728 			   struct ieee80211req_athdbg *req);
729 
730 /**
731  * os_if_son_get_acs_report() - Get ACS report
732  * @vdev: target vdev
733  * @acs_r: ACS report structure
734  *
735  * Return: 0 on success
736  */
737 int os_if_son_get_acs_report(struct wlan_objmgr_vdev *vdev,
738 			     struct ieee80211_acs_dbg *acs_r);
739 
740 /**
741  * os_if_son_parse_generic_nl_cmd() - Sends the Generic vendor commands
742  *				      to SON.
743  * @wiphy: Standard wiphy object
744  * @wdev: wireless device
745  * @tb: Command type structure pointer
746  * @type: Get/Set command
747  *
748  * This function parses the GENERIC vendor commands received from
749  * userspace then sends the extracted data to SON module for further
750  * processing along with wiphy, wdev, extected structure - param
751  * and command type i.e. GET / SET. Each of the GENERIC commands are
752  * interdependent and hence in SON module, they will be further
753  * parsed based on type i.e. GET / SET.
754  *
755  * Return: 0 on success
756  */
757 int os_if_son_parse_generic_nl_cmd(struct wiphy *wiphy,
758 				   struct wireless_dev *wdev,
759 				   struct nlattr **tb,
760 				   enum os_if_son_vendor_cmd_type type);
761 
762 /**
763  * os_if_son_get_node_datarate_info() - Get datarate info about given mac
764  * @vdev: vdev_obj
765  * @mac_addr: mac_address to get datarate information
766  * @node_info: object to store datarate information
767  *
768  * Return: void
769  */
770 QDF_STATUS os_if_son_get_node_datarate_info(struct wlan_objmgr_vdev *vdev,
771 					    uint8_t *mac_addr,
772 					    wlan_node_info *node_info);
773 
774 /**
775  * os_if_son_get_peer_max_mcs_idx() - Get max mcs index of the peer
776  * @vdev: vdev obj
777  * @peer: peer obj
778  *
779  * Return: max mcs index on success / 0 on failure
780  */
781 uint32_t os_if_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
782 					struct wlan_objmgr_peer *peer);
783 
784 /**
785  * os_if_son_get_sta_stats() - get connected sta rssi and estimated data rate
786  * @vdev: pointer to vdev
787  * @mac_addr: connected sta mac addr
788  * @stats: pointer to ieee80211_nodestats
789  *
790  * Return: 0 on success, negative errno on failure
791  */
792 int os_if_son_get_sta_stats(struct wlan_objmgr_vdev *vdev, uint8_t *mac_addr,
793 			    struct ieee80211_nodestats *stats);
794 #endif
795