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