xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_sta_api.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 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 /**
21  * DOC: Implement API's specific to STA component.
22  */
23 
24 #ifndef _WMI_UNIFIED_STA_API_H_
25 #define _WMI_UNIFIED_STA_API_H_
26 
27 #include "wlan_disa_public_struct.h"
28 #include "wlan_tdls_public_structs.h"
29 #include "wlan_policy_mgr_public_struct.h"
30 #include "wmi_unified_sta_param.h"
31 
32 struct policy_mgr_dual_mac_config;
33 
34 /**
35  * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters
36  * @wmi_handle: wmi handle
37  * @vdev_id: vdev id
38  * @max_retries: max retries
39  * @retry_interval: retry interval
40  * This function sets sta query related parameters in fw.
41  *
42  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
43  */
44 QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(wmi_unified_t wmi_handle,
45 						  uint8_t vdev_id,
46 						  uint32_t max_retries,
47 						  uint32_t retry_interval);
48 
49 /**
50  * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters
51  * @wmi_handle: wmi handle
52  * @params: sta keep alive parameter
53  *
54  * This function sets keep alive related parameters in fw.
55  *
56  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
57  */
58 QDF_STATUS
59 wmi_unified_set_sta_keep_alive_cmd(wmi_unified_t wmi_handle,
60 				   struct sta_keep_alive_params *params);
61 
62 /**
63  * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
64  * @wmi_handle: wmi handle
65  * @if_id: vdev id
66  * @gtx_info: GTX config params
67  *
68  * This function set GTX related params in firmware.
69  *
70  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
71  */
72 QDF_STATUS
73 wmi_unified_vdev_set_gtx_cfg_cmd(wmi_unified_t wmi_handle, uint32_t if_id,
74 				 struct wmi_gtx_config *gtx_info);
75 
76 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(FEATURE_DENYLIST_MGR)
77 /**
78  * wmi_unified_send_reject_ap_list() - send the reject ap list maintained by
79  * DLM to FW for roaming cases.
80  * @wmi_handle: wmi handle
81  * @reject_params: This contains the reject ap list, and the num of BSSIDs.
82  *
83  * Return: QDF_STATUS_SUCCESS for success or error code
84  */
85 QDF_STATUS
86 wmi_unified_send_reject_ap_list(struct wmi_unified *wmi_handle,
87 				struct reject_ap_params *reject_params);
88 #endif
89 
90 /**
91  * wmi_unified_process_dhcp_ind() - process dhcp indication from SME
92  * @wmi_handle: wmi handle
93  * @ta_dhcp_ind: DHCP indication parameter
94  *
95  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
96  */
97 QDF_STATUS wmi_unified_process_dhcp_ind(
98 			wmi_unified_t wmi_handle,
99 			wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
100 
101 /**
102  * wmi_unified_get_link_speed_cmd() -send command to get linkspeed
103  * @wmi_handle: wmi handle
104  * @peer_macaddr: peer MAC address
105  *
106  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
107  */
108 QDF_STATUS wmi_unified_get_link_speed_cmd(wmi_unified_t wmi_handle,
109 					  wmi_mac_addr peer_macaddr);
110 
111 /**
112  * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
113  * @wmi_handle: wmi handle
114  * @cmd: Profiling command index
115  * @value1: parameter1 value
116  * @value2: parameter2 value
117  *
118  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
119  */
120 QDF_STATUS wmi_unified_fw_profiling_data_cmd(wmi_unified_t wmi_handle,
121 					     uint32_t cmd,
122 					     uint32_t value1,
123 					     uint32_t value2);
124 
125 /**
126  * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
127  * @wmi_handle: wmi handle
128  * @vdev_id: vdev id
129  *
130  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
131  */
132 QDF_STATUS wmi_unified_nat_keepalive_en_cmd(wmi_unified_t wmi_handle,
133 					    uint8_t vdev_id);
134 
135 /**
136  * wmi_unified_wlm_latency_level_cmd() - set latency level
137  * @wmi_handle: wmi handle
138  * @param: WLM parameters
139  *
140  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
141  */
142 QDF_STATUS
143 wmi_unified_wlm_latency_level_cmd(wmi_unified_t wmi_handle,
144 				  struct wlm_latency_level_param *param);
145 
146 /**
147  * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
148  * @wmi_handle:    Pointer to WMi handle
149  * @ie_data:       Pointer for ie data
150  *
151  * This function sends IE information to firmware
152  *
153  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
154  */
155 QDF_STATUS
156 wmi_unified_process_set_ie_info_cmd(wmi_unified_t wmi_handle,
157 				    struct vdev_ie_info_param *ie_info);
158 
159 /**
160  * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw
161  * @wmi_handle: wmi handle
162  * @custom_addr: base mac address
163  *
164  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
165  */
166 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(wmi_unified_t wmi_handle,
167 						     uint8_t *custom_addr);
168 
169 #ifdef FEATURE_WLAN_TDLS
170 /**
171  * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
172  * @wmi_handle: wmi handle
173  * @chan_switch_params: Pointer to tdls channel switch parameter structure
174  *
175  * This function sets tdls off channel mode
176  *
177  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
178  *         Negative errno otherwise
179  */
180 QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(
181 		wmi_unified_t wmi_handle,
182 		struct tdls_channel_switch_params *chan_switch_params);
183 
184 /**
185  * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
186  * @wmi_handle: wmi handle
187  * @tdls_param: TDLS params
188  * @tdls_state: TDLS state
189  *
190  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
191  */
192 QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(wmi_unified_t wmi_handle,
193 						struct tdls_info *tdls_param,
194 						enum wmi_tdls_state tdls_state);
195 
196 /**
197  * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
198  * @wmi_handle: wmi handle
199  * @peer_state: TDLS peer state params
200  *
201  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
202  */
203 QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(wmi_unified_t wmi_handle,
204 				struct tdls_peer_update_state *peer_state,
205 				uint32_t *ch_mhz);
206 
207 /**
208  * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event
209  * @wmi_handle: wmi handle
210  * @evt_buf: pointer to event buffer
211  * @param: Pointer to hold vdev tdls param
212  *
213  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
214  */
215 QDF_STATUS wmi_extract_vdev_tdls_ev_param(wmi_unified_t wmi_handle,
216 					  void *evt_buf,
217 					  struct tdls_event_info *param);
218 #endif /* FEATURE_WLAN_TDLS */
219 
220 /**
221  * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
222  * @wmi_handle: wmi handle
223  * @params: sar limit command params
224  *
225  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
226  */
227 QDF_STATUS wmi_unified_send_sar_limit_cmd(wmi_unified_t wmi_handle,
228 					  struct sar_limit_cmd_params *params);
229 
230 /**
231  * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
232  * @wmi_handle: wmi handle
233  *
234  * Return: QDF_STATUS_SUCCESS for success or error code
235  */
236 QDF_STATUS wmi_unified_get_sar_limit_cmd(wmi_unified_t wmi_handle);
237 
238 /**
239  * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
240  * @wmi_handle: wmi handle
241  * @evt_buf: event buffer received from firmware
242  * @event: SAR limit event which is to be populated by data extracted from
243  *         the @evt_buf buffer
244  *
245  * Return: QDF_STATUS_SUCCESS for success or error code
246  */
247 QDF_STATUS wmi_unified_extract_sar_limit_event(wmi_unified_t wmi_handle,
248 					       uint8_t *evt_buf,
249 					       struct sar_limit_event *event);
250 
251 /**
252  * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
253  * @handle: wmi handle
254  * @event: event buffer received from firmware
255  * @len: length of the event buffer
256  *
257  * Return: QDF_STATUS_SUCCESS for success or error code
258  */
259 QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
260 						 uint8_t *event, uint32_t len);
261 
262 /*
263  * wmi_unified_set_del_pmkid_cache() - set delete PMKID
264  * @wmi_handle: wma handle
265  * @pmksa: pointer to pmk cache entry
266  *
267  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
268  */
269 QDF_STATUS
270 wmi_unified_set_del_pmkid_cache(wmi_unified_t wmi_handle,
271 				struct wmi_unified_pmk_cache *pmksa);
272 
273 /**
274  * wmi_unified_del_ts_cmd() - send DELTS request to fw
275  * @wmi_handle: wmi handle
276  * @vdev_id: vdev id
277  * @ac: ac param
278  *
279  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
280  */
281 QDF_STATUS wmi_unified_del_ts_cmd(wmi_unified_t wmi_handle, uint8_t vdev_id,
282 				  uint8_t ac);
283 
284 /**
285  * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
286  * @wmi_handle: handle to wmi
287  * @aggr_qos_rsp_msg: combined struct for all ADD_TS requests.
288  *
289  * A function to handle WMI_AGGR_QOS_REQ. This will send out
290  * ADD_TS requestes to firmware in loop for all the ACs with
291  * active flow.
292  *
293  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
294  */
295 QDF_STATUS wmi_unified_aggr_qos_cmd(
296 		wmi_unified_t wmi_handle,
297 		struct aggr_add_ts_param *aggr_qos_rsp_msg);
298 
299 /**
300  * wmi_unified_add_ts_cmd() - send ADDTS request to fw
301  * @wmi_handle: wmi handle
302  * @msg: ADDTS params
303  *
304  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
305  */
306 QDF_STATUS wmi_unified_add_ts_cmd(wmi_unified_t wmi_handle,
307 				  struct add_ts_param *msg);
308 
309 /**
310  * wmi_unified_process_add_periodic_tx_ptrn_cmd() - add periodic tx pattern
311  * @wmi_handle: wmi handle
312  * @pattern: tx pattern parameters
313  * @vdev_id: vdev id
314  *
315  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
316  */
317 QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(
318 					wmi_unified_t wmi_handle,
319 					struct periodic_tx_pattern *pattern,
320 					uint8_t vdev_id);
321 
322 /**
323  * wmi_unified_process_del_periodic_tx_ptrn_cmd() - del periodic tx ptrn
324  * @wmi_handle: wmi handle
325  * @vdev_id: vdev id
326  * @pattern_id: pattern id
327  *
328  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
329  */
330 QDF_STATUS
331 wmi_unified_process_del_periodic_tx_ptrn_cmd(wmi_unified_t wmi_handle,
332 					     uint8_t vdev_id,
333 					     uint8_t pattern_id);
334 
335 /**
336  * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown
337  *					       timer in firmware
338  * @wmi_handle: wmi handle
339  * @timer_val: auto shutdown timer value
340  *
341  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
342  */
343 QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(wmi_unified_t wmi_handle,
344 						   uint32_t timer_val);
345 
346 /**
347  * wmi_unified_set_led_flashing_cmd() - set led flashing in fw
348  * @wmi_handle: wmi handle
349  * @flashing: flashing request
350  *
351  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
352  */
353 QDF_STATUS
354 wmi_unified_set_led_flashing_cmd(wmi_unified_t wmi_handle,
355 				 struct flashing_req_params *flashing);
356 
357 /**
358  * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid
359  *					       update request
360  * @wmi_handle: wmi handle
361  *
362  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
363  */
364 QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(wmi_unified_t wmi_handle);
365 
366 /**
367  * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW
368  * @wmi_handle: wmi handle
369  * @msg: PCL structure containing the PCL and the number of channels
370  *
371  * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN
372  * firmware. The DBS Manager is the consumer of this information in the WLAN
373  * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs
374  * to migrate to a new channel without host driver involvement. An example of
375  * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will
376  * manage the channel selection without firmware involvement.
377  *
378  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
379  */
380 QDF_STATUS wmi_unified_pdev_set_pcl_cmd(wmi_unified_t wmi_handle,
381 					struct wmi_pcl_chan_weights *msg);
382 
383 #ifdef WLAN_POLICY_MGR_ENABLE
384 /**
385  * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW
386  * @wmi_handle: wmi handle
387  * @msg: Dual MAC config parameters
388  *
389  * Configures WLAN firmware with the dual MAC features
390  *
391  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures.
392  */
393 QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(
394 		wmi_unified_t wmi_handle,
395 		struct policy_mgr_dual_mac_config *msg);
396 #endif /* WLAN_POLICY_MGR_ENABLE */
397 
398 /**
399  * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of
400  * adaptive dwelltime configuration params
401  * @wma_handle:  wma handler
402  * @wmi_param: pointer to dwelltime_params
403  *
404  * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
405  */
406 QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(
407 		wmi_unified_t wmi_handle,
408 		struct wmi_adaptive_dwelltime_params *wmi_param);
409 
410 /**
411  * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of
412  * DBS scan selection configuration params
413  * @wma_handle:  wma handler
414  * @wmi_param: pointer to wmi_dbs_scan_sel_params
415  *
416  * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
417  */
418 QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(
419 			wmi_unified_t wmi_handle,
420 			struct wmi_dbs_scan_sel_params *wmi_param);
421 
422 /**
423  * wmi_unified_set_arp_stats_req() - set arp stats request
424  * @wmi_handle: wmi handle
425  * @req_buf: pointer to set_arp_stats
426  *
427  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
428  */
429 QDF_STATUS wmi_unified_set_arp_stats_req(wmi_unified_t wmi_handle,
430 					 struct set_arp_stats *req_buf);
431 
432 /**
433  * wmi_unified_get_arp_stats_req() - get arp stats request
434  * @wmi_handle: wmi handle
435  * @req_buf: pointer to get_arp_stats
436  *
437  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
438  */
439 QDF_STATUS wmi_unified_get_arp_stats_req(wmi_unified_t wmi_handle,
440 					 struct get_arp_stats *req_buf);
441 
442 /**
443  * wmi_unified_peer_unmap_conf_send() - send PEER unmap conf command to fw
444  * @wmi_handle: wmi handle
445  * @vdev_id: vdev id
446  * @peer_id_cnt: number of peer id
447  * @peer_id_list: list of peer ids
448  *
449  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
450  */
451 QDF_STATUS wmi_unified_peer_unmap_conf_send(wmi_unified_t wmi_handle,
452 					    uint8_t vdev_id,
453 					    uint32_t peer_id_cnt,
454 					    uint16_t *peer_id_list);
455 
456 #endif /* _WMI_UNIFIED_STA_API_H_ */
457