xref: /wlan-driver/qcacld-3.0/components/son/dispatcher/inc/son_ucfg_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 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: contains interface prototypes for OS_IF layer
20  */
21 #ifndef _SON_UCFG_API_H_
22 #define _SON_UCFG_API_H_
23 
24 #include <qdf_trace.h>
25 #include <wlan_objmgr_pdev_obj.h>
26 #include <wlan_mlme_ucfg_api.h>
27 #include <son_api.h>
28 
29 /**
30  * ucfg_son_get_operation_chan_freq_vdev_id() - get operating chan freq of
31  *                                              given vdev id
32  * @pdev: Pointer to pdev
33  * @vdev_id: vdev id
34  *
35  * Return: chan freq of given vdev id
36  */
37 qdf_freq_t
38 ucfg_son_get_operation_chan_freq_vdev_id(struct wlan_objmgr_pdev *pdev,
39 					 uint8_t vdev_id);
40 
41 /**
42  * ucfg_son_get_min_and_max_power() - get min and max power
43  * @psoc: pointer to psoc
44  * @max_tx_power: max tx power(dBm units) to get.
45  * @min_tx_power: min tx power(dBm units) to get.
46  *
47  * Return: Void
48  */
49 void ucfg_son_get_min_and_max_power(struct wlan_objmgr_psoc *psoc,
50 				    int8_t *max_tx_power,
51 				    int8_t *min_tx_power);
52 
53 /**
54  * ucfg_son_is_cac_in_progress() - whether cac in progress or not
55  * @vdev: Pointer to vdev
56  *
57  * Return: whether vdev in cac or not
58  */
59 bool ucfg_son_is_cac_in_progress(struct wlan_objmgr_vdev *vdev);
60 
61 /**
62  * ucfg_son_get_sta_count() - get sta count
63  * @vdev: Pointer to vdev
64  *
65  * Return: sta count
66  */
67 uint32_t ucfg_son_get_sta_count(struct wlan_objmgr_vdev *vdev);
68 
69 /**
70  * ucfg_son_get_chan_flag() - get chan flag
71  * @pdev: pointer to pdev
72  * @freq: qdf_freq_t
73  * @flag_160: whether 160 band width is enabled or not
74  * @chan_params: chan parameters
75  *
76  * Return: chan flag
77  */
78 uint32_t ucfg_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
79 				qdf_freq_t freq, bool flag_160,
80 				struct ch_params *chan_params);
81 
82 /**
83  * ucfg_son_get_he_supported() - get he supported
84  * @psoc: pointer to psoc
85  * @he_supported: he supported or not
86  *
87  * Return: void
88  */
89 #ifdef WLAN_FEATURE_11AX
90 void ucfg_son_get_he_supported(struct wlan_objmgr_psoc *psoc,
91 			       bool *he_supported);
92 #else
ucfg_son_get_he_supported(struct wlan_objmgr_psoc * psoc,bool * he_supported)93 static inline void ucfg_son_get_he_supported(struct wlan_objmgr_psoc *psoc,
94 					     bool *he_supported)
95 {
96 	*he_supported = false;
97 }
98 #endif /*WLAN_FEATURE_11AX*/
99 
100 /**
101  * ucfg_son_set_peer_kickout_allow() - set the peer is allowed to kickout
102  * @vdev: pointer to vdev
103  * @peer: pointer to peer
104  * @kickout_allow: kickout_allow to set
105  *
106  * Return: QDF_STATUS_SUCCESS on Success else failure.
107  */
108 QDF_STATUS ucfg_son_set_peer_kickout_allow(struct wlan_objmgr_vdev *vdev,
109 					   struct wlan_objmgr_peer *peer,
110 					   bool kickout_allow);
111 
112 /**
113  * ucfg_son_register_deliver_opmode_cb() - register deliver opmode cb
114  * @psoc: pointer to psoc
115  * @cb: deliver opmode callback
116  *
117  * Return: QDF_STATUS_SUCCESS on Success else failure.
118  */
119 QDF_STATUS ucfg_son_register_deliver_opmode_cb(struct wlan_objmgr_psoc *psoc,
120 					       mlme_deliver_cb cb);
121 
122 /**
123  * ucfg_son_register_deliver_smps_cb() - register deliver smps cb
124  * @psoc: pointer to psoc
125  * @cb: deliver smps callback
126  *
127  * Return: QDF_STATUS_SUCCESS on Success else failure.
128  */
129 
130 QDF_STATUS ucfg_son_register_deliver_smps_cb(struct wlan_objmgr_psoc *psoc,
131 					     mlme_deliver_cb cb);
132 
133 /**
134  * ucfg_son_cbs_init() - son cbs init
135  *
136  * Return: 0 if succeed
137  */
138 int ucfg_son_cbs_init(void);
139 
140 /**
141  * ucfg_son_cbs_deinit() - son cbs deinit
142  *
143  * Return: 0 if succeed
144  */
145 int ucfg_son_cbs_deinit(void);
146 
147 /**
148  * ucfg_son_set_cbs() - son cbs set
149  * @vdev: pointer to vdev
150  * @enable: enable or disable son cbs
151  *
152  * Return: 0 if succeed
153  */
154 int ucfg_son_set_cbs(struct wlan_objmgr_vdev *vdev,
155 		     bool enable);
156 
157 /**
158  * ucfg_son_set_cbs_wait_time() - cbs wait time configure
159  * @vdev: pointer to vdev
160  * @val: wait time value
161  *
162  * Return: 0 if succeed
163  */
164 int ucfg_son_set_cbs_wait_time(struct wlan_objmgr_vdev *vdev,
165 			       uint32_t val);
166 
167 /**
168  * ucfg_son_set_cbs_dwell_split_time() - cbs dwell spilt time configure
169  * @vdev: pointer to vdev
170  * @val: dwell spilt time value
171  *
172  * Return: 0 if succeed
173  */
174 int ucfg_son_set_cbs_dwell_split_time(struct wlan_objmgr_vdev *vdev,
175 				      uint32_t val);
176 
177 /**
178  * ucfg_son_get_tx_power() - Gets the max transmit power for peer
179  * @assoc_req_ies: assoc req ies
180  *
181  * Return: Returns the max tx power
182  */
183 uint8_t ucfg_son_get_tx_power(struct element_info assoc_req_ies);
184 
185 /**
186  * ucfg_son_get_peer_rrm_info() - Get RRM info for peer
187  * @assoc_req_ies: assoc req ies
188  * @rrmcaps: rrm capabilities
189  * @is_beacon_meas_supported: if beacon meas is supported
190  *
191  * Return: Returns QDF_STATUS_SUCCESS if succeed
192  */
193 QDF_STATUS ucfg_son_get_peer_rrm_info(struct element_info assoc_req_ies,
194 				      uint8_t *rrmcaps,
195 				      bool *is_beacon_meas_supported);
196 
197 /**
198  * ucfg_son_vdev_get_supported_txrx_streams() - get supported spatial streams
199  * @vdev: pointer to vdev
200  * @num_tx_streams: pointer to number of tx streams
201  * @num_rx_streams: pointer to number of rx streams
202  *
203  * Return: QDF_STATUS_SUCCESS on Success else failure.
204  */
205 QDF_STATUS
206 ucfg_son_vdev_get_supported_txrx_streams(struct wlan_objmgr_vdev *vdev,
207 					 uint32_t *num_tx_streams,
208 					 uint32_t *num_rx_streams);
209 /**
210  * ucfg_son_get_vht_cap() - get the vht capability ie
211  * @psoc: psoc object
212  * @vht_caps: VHT caps bit fields
213  *
214  * Return: QDF_STATUS_SUCCESS on Success else failure.
215  */
216 QDF_STATUS ucfg_son_get_vht_cap(struct wlan_objmgr_psoc *psoc,
217 				int32_t *vht_caps);
218 
219 #ifdef WLAN_FEATURE_SON
220 /* ucfg_son_disable_cbs() - son cbs disable
221  * @vdev: vdev pointer
222  *
223  * Return: 0 if succeed
224  */
225 int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev);
226 #else
ucfg_son_disable_cbs(struct wlan_objmgr_vdev * vdev)227 static inline int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev)
228 {
229 	return -EINVAL;
230 }
231 #endif
232 #endif
233