xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_api.h (revision a175314c51a4ce5cec2835cc8a8c7dc0c1810915)
1 /*
2  * Copyright (c) 2013-2018 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  * This file contains the API definitions for the Unified Wireless Module
21  * Interface (WMI).
22  */
23 
24 #ifndef _WMI_UNIFIED_API_H_
25 #define _WMI_UNIFIED_API_H_
26 
27 #include <osdep.h>
28 #ifdef CONFIG_MCL
29 #include "wmi.h"
30 #endif
31 #include "htc_api.h"
32 #include "wmi_unified_param.h"
33 #include "service_ready_param.h"
34 #include "wlan_objmgr_psoc_obj.h"
35 #include "wlan_mgmt_txrx_utils_api.h"
36 #ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
37 #include "wmi_unified_pmo_api.h"
38 #endif
39 #ifdef CONVERGED_P2P_ENABLE
40 #include "wlan_p2p_public_struct.h"
41 #endif
42 #include "wlan_scan_public_structs.h"
43 #ifdef WLAN_FEATURE_DISA
44 #include "wlan_disa_public_struct.h"
45 #endif
46 
47 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
48 #include "nan_public_structs.h"
49 #endif
50 #ifdef WLAN_SUPPORT_GREEN_AP
51 #include "wlan_green_ap_api.h"
52 #endif
53 #ifdef WLAN_FEATURE_DSRC
54 #include "wlan_ocb_public_structs.h"
55 #endif
56 #ifdef WLAN_SUPPORT_TWT
57 #include "wmi_unified_twt_param.h"
58 #include "wmi_unified_twt_api.h"
59 #endif
60 
61 #ifdef FEATURE_WLAN_EXTSCAN
62 #include "wmi_unified_extscan_api.h"
63 #endif
64 
65 #ifdef IPA_OFFLOAD
66 #include "wlan_ipa_public_struct.h"
67 #endif
68 
69 typedef qdf_nbuf_t wmi_buf_t;
70 #define wmi_buf_data(_buf) qdf_nbuf_data(_buf)
71 
72 #define WMI_LOGD(args ...) \
73 	QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, ## args)
74 #define WMI_LOGI(args ...) \
75 	QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, ## args)
76 #define WMI_LOGW(args ...) \
77 	QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_WARN, ## args)
78 #define WMI_LOGE(args ...) \
79 	QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, ## args)
80 #define WMI_LOGP(args ...) \
81 	QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_FATAL, ## args)
82 
83 
84 
85 #define PHYERROR_MAX_BUFFER_LENGTH 0x7F000000
86 
87 struct wmi_soc;
88 struct policy_mgr_dual_mac_config;
89 /**
90  * struct wmi_ops - service callbacks to upper layer
91  * @service_ready_cbk: service ready callback
92  * @service_ready_ext_cbk: service ready ext callback
93  * @ready_cbk: ready calback
94  * @wma_process_fw_event_handler_cbk: generic event handler callback
95  */
96 struct wmi_rx_ops {
97 
98 	int (*wma_process_fw_event_handler_cbk)(void *ctx,
99 				  void *ev, uint8_t rx_ctx);
100 };
101 
102 /**
103  * enum wmi_target_type - type of supported wmi command
104  * @WMI_TLV_TARGET: tlv based target
105  * @WMI_NON_TLV_TARGET: non-tlv based target
106  *
107  */
108 enum wmi_target_type {
109 	WMI_TLV_TARGET,
110 	WMI_NON_TLV_TARGET,
111 	WMI_MAX_TARGET_TYPE
112 };
113 
114 /**
115  * enum wmi_rx_exec_ctx - wmi rx execution context
116  * @WMI_RX_WORK_CTX: work queue context execution provided by WMI layer
117  * @WMI_RX_UMAC_CTX: execution context provided by umac layer
118  *
119  */
120 enum wmi_rx_exec_ctx {
121 	WMI_RX_WORK_CTX,
122 	WMI_RX_UMAC_CTX
123 };
124 
125 /**
126  * struct wmi_unified_attach_params - wmi init parameters
127  *  @param osdev            : NIC device
128  *  @param target_type      : type of supported wmi command
129  *  @param use_cookie       : flag to indicate cookie based allocation
130  *  @param ops              : handle to wmi ops
131  *  @psoc                   : objmgr psoc
132  *  @max_commands           : max commands
133  */
134 struct wmi_unified_attach_params {
135 	osdev_t osdev;
136 	enum wmi_target_type target_type;
137 	bool use_cookie;
138 	struct wmi_rx_ops *rx_ops;
139 	struct wlan_objmgr_psoc *psoc;
140 	uint16_t max_commands;
141 	uint32_t soc_id;
142 };
143 
144 /**
145  * attach for unified WMI
146  *
147  *  @param scn_handle      : handle to SCN.
148  *  @param params          : attach params for WMI
149  *
150  */
151 void *wmi_unified_attach(void *scn_handle,
152 			 struct wmi_unified_attach_params *params);
153 
154 
155 
156 /**
157  * wmi_mgmt_cmd_record() - Wrapper function for mgmt command logging macro
158  *
159  * @wmi_handle: wmi handle
160  * @cmd: mgmt command
161  * @header: pointer to 802.11 header
162  * @vdev_id: vdev id
163  * @chanfreq: channel frequency
164  *
165  * Return: none
166  */
167 void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd,
168 			void *header, uint32_t vdev_id, uint32_t chanfreq);
169 
170 /**
171  * detach for unified WMI
172  *
173  *  @param wmi_handle      : handle to WMI.
174  *  @return void.
175  */
176 void wmi_unified_detach(struct wmi_unified *wmi_handle);
177 
178 /**
179  * API to sync time between host and firmware
180  *
181  *  @param wmi_handle      : handle to WMI.
182  *  @return void.
183  */
184 void wmi_send_time_stamp_sync_cmd_tlv(void *wmi_hdl);
185 
186 void
187 wmi_unified_remove_work(struct wmi_unified *wmi_handle);
188 
189 /**
190  * generic function to allocate WMI buffer
191  *
192  *  @param wmi_handle      : handle to WMI.
193  *  @param len             : length of the buffer
194  *  @return wmi_buf_t.
195  */
196 #ifdef NBUF_MEMORY_DEBUG
197 #define wmi_buf_alloc(h, l) wmi_buf_alloc_debug(h, l, __FILE__, __LINE__)
198 wmi_buf_t
199 wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint32_t len,
200 		    uint8_t *file_name, uint32_t line_num);
201 #else
202 wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint32_t len);
203 #endif
204 
205 /**
206  * generic function frees WMI net buffer
207  *
208  *  @param net_buf : Pointer ot net_buf to be freed
209  */
210 void wmi_buf_free(wmi_buf_t net_buf);
211 
212 /**
213  * generic function to send unified WMI command
214  *
215  *  @param wmi_handle      : handle to WMI.
216  *  @param buf             : wmi command buffer
217  *  @param buflen          : wmi command buffer length
218  *  @param cmd_id          : WMI cmd id
219  *  @return 0  on success and -ve on failure.
220  */
221 QDF_STATUS
222 wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, uint32_t buflen,
223 			uint32_t cmd_id);
224 
225 /**
226  * wmi_unified_register_event() - WMI event handler
227  * registration function for converged components
228  *
229  * @wmi_handle:   handle to WMI.
230  * @event_id:     WMI event ID
231  * @handler_func: Event handler call back function
232  *
233  *  @return 0  on success and -ve on failure.
234  */
235 int
236 wmi_unified_register_event(wmi_unified_t wmi_handle,
237 				   uint32_t event_id,
238 				   wmi_unified_event_handler handler_func);
239 
240 /**
241  * wmi_unified_register_event_handler() - WMI event handler
242  * registration function
243  *
244  * @wmi_handle:   handle to WMI.
245  * @event_id:     WMI event ID
246  * @handler_func: Event handler call back function
247  * @rx_ctx: rx event processing context
248  *
249  *  @return 0  on success and -ve on failure.
250  */
251 int
252 wmi_unified_register_event_handler(wmi_unified_t wmi_handle,
253 				   wmi_conv_event_id event_id,
254 				   wmi_unified_event_handler handler_func,
255 				   uint8_t rx_ctx);
256 
257 /**
258  * WMI event handler unregister function for converged componets
259  *
260  *  @param wmi_handle      : handle to WMI.
261  *  @param event_id        : WMI event ID
262  *  @return 0  on success and -ve on failure.
263  */
264 int
265 wmi_unified_unregister_event(wmi_unified_t wmi_handle,
266 					 uint32_t event_id);
267 
268 /**
269  * WMI event handler unregister function
270  *
271  *  @param wmi_handle      : handle to WMI.
272  *  @param event_id        : WMI event ID
273  *  @return 0  on success and -ve on failure.
274  */
275 int
276 wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle,
277 					 wmi_conv_event_id event_id);
278 
279 /**
280  * request wmi to connet its htc service.
281  *  @param wmi_handle      : handle to WMI.
282  *  @param htc_handle      : handle to HTC.
283  *  @return void
284  */
285 QDF_STATUS
286 wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle,
287 				void *htc_handle);
288 
289 /*
290  * WMI API to verify the host has enough credits to suspend
291  *  @param wmi_handle      : handle to WMI.
292  */
293 
294 int wmi_is_suspend_ready(wmi_unified_t wmi_handle);
295 
296 /**
297  *  WMI API to get updated host_credits
298  *  @param wmi_handle      : handle to WMI.
299  */
300 
301 int wmi_get_host_credits(wmi_unified_t wmi_handle);
302 
303 /**
304  *  WMI API to get WMI Pending Commands in the HTC queue
305  *  @param wmi_handle      : handle to WMI.
306  */
307 
308 int wmi_get_pending_cmds(wmi_unified_t wmi_handle);
309 
310 /**
311  *  WMI API to set target suspend state
312  *  @param wmi_handle      : handle to WMI.
313  *  @param val             : suspend state boolean
314  */
315 void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val);
316 
317 /**
318  * WMI API to set bus suspend state
319  * @param wmi_handle:	handle to WMI.
320  * @param val:		suspend state boolean
321  */
322 void wmi_set_is_wow_bus_suspended(wmi_unified_t wmi_handle, A_BOOL val);
323 
324 /**
325  * WMI API to set crash injection state
326  * @param wmi_handle:	handle to WMI.
327  * @param val:		crash injection state boolean
328  */
329 void wmi_tag_crash_inject(wmi_unified_t wmi_handle, A_BOOL flag);
330 
331 /**
332  * WMI API to set target assert
333  * @param wmi_handle: 	handle to WMI.
334  * @param val:		target assert config value.
335  *
336  * Return: 		none.
337  */
338 void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val);
339 
340 /**
341  * generic function to block unified WMI command
342  * @param wmi_handle      : handle to WMI.
343  * @return 0  on success and -ve on failure.
344  */
345 int
346 wmi_stop(wmi_unified_t wmi_handle);
347 
348 /**
349  * API to flush all the previous packets  associated with the wmi endpoint
350  *
351  * @param wmi_handle      : handle to WMI.
352  */
353 void
354 wmi_flush_endpoint(wmi_unified_t wmi_handle);
355 
356 /**
357  * wmi_pdev_id_conversion_enable() - API to enable pdev_id conversion in WMI
358  *                     By default pdev_id conversion is not done in WMI.
359  *                     This API can be used enable conversion in WMI.
360  * @param wmi_handle   : handle to WMI
361  * Return none
362  */
363 void wmi_pdev_id_conversion_enable(wmi_unified_t wmi_handle);
364 
365 /**
366  * API to handle wmi rx event after UMAC has taken care of execution
367  * context
368  *
369  * @param wmi_handle      : handle to WMI.
370  * @param evt_buf         : wmi event buffer
371  */
372 void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf);
373 #ifdef FEATURE_RUNTIME_PM
374 void
375 wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, bool val);
376 bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle);
377 #else
378 static inline void
379 wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, bool val)
380 {
381 	return;
382 }
383 static inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
384 {
385 	return false;
386 }
387 #endif
388 
389 void *wmi_unified_get_soc_handle(struct wmi_unified *wmi_handle);
390 
391 void *wmi_unified_get_pdev_handle(struct wmi_soc *soc, uint32_t pdev_idx);
392 
393 /**
394  * UMAC Callback to process fw event.
395  * @param wmi_handle      : handle to WMI.
396  * @param evt_buf         : wmi event buffer
397  */
398 void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf);
399 uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle);
400 
401 
402 QDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl,
403 				 uint8_t macaddr[IEEE80211_ADDR_LEN],
404 				 struct vdev_create_params *param);
405 
406 QDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl,
407 					  uint8_t if_id);
408 
409 QDF_STATUS wmi_unified_vdev_restart_send(void *wmi_hdl,
410 				uint8_t macaddr[IEEE80211_ADDR_LEN],
411 				struct vdev_start_params *param);
412 
413 QDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl,
414 					uint8_t vdev_id);
415 
416 QDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl,
417 			     uint8_t bssid[IEEE80211_ADDR_LEN],
418 				 struct vdev_up_params *params);
419 
420 QDF_STATUS wmi_unified_vdev_down_send(void *wmi_hdl,
421 				uint8_t vdev_id);
422 
423 QDF_STATUS wmi_unified_vdev_start_send(void *wmi_hdl,
424 				struct vdev_start_params *req);
425 /**
426  * wmi_unified_vdev_set_nac_rssi_send() - send NAC_RSSI command to fw
427  * @param wmi_handle   : handle to WMI
428  * @param req          : pointer to hold nac rssi request data
429  *
430  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
431  */
432 QDF_STATUS wmi_unified_vdev_set_nac_rssi_send(void *wmi_hdl,
433 			struct vdev_scan_nac_rssi_params *req);
434 
435 QDF_STATUS wmi_unified_hidden_ssid_vdev_restart_send(void *wmi_hdl,
436 		struct hidden_ssid_vdev_restart_params *restart_params);
437 
438 QDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl,
439 				struct vdev_set_params *param);
440 
441 QDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl,
442 				    uint8_t
443 				    peer_addr[IEEE80211_ADDR_LEN],
444 				    uint8_t vdev_id);
445 
446 QDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl,
447 					 uint8_t peer_addr[IEEE80211_ADDR_LEN],
448 					 struct peer_flush_params *param);
449 
450 QDF_STATUS wmi_set_peer_param_send(void *wmi_hdl,
451 				uint8_t peer_addr[IEEE80211_ADDR_LEN],
452 				struct peer_set_params *param);
453 
454 QDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl,
455 					struct peer_create_params *param);
456 
457 QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
458 				uint8_t macaddr[IEEE80211_ADDR_LEN],
459 				struct stats_request_params *param);
460 
461 QDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
462 					uint32_t value, uint8_t pdev_id);
463 
464 #ifdef FEATURE_WLAN_D0WOW
465 QDF_STATUS wmi_unified_d0wow_enable_send(void *wmi_hdl,
466 				uint8_t mac_id);
467 QDF_STATUS wmi_unified_d0wow_disable_send(void *wmi_hdl,
468 				uint8_t mac_id);
469 #endif
470 
471 QDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl,
472 				struct wow_cmd_params *param,
473 				uint8_t mac_id);
474 
475 QDF_STATUS wmi_unified_wow_wakeup_send(void *wmi_hdl);
476 
477 QDF_STATUS wmi_unified_wow_add_wakeup_event_send(void *wmi_hdl,
478 		struct wow_add_wakeup_params *param);
479 
480 QDF_STATUS wmi_unified_wow_add_wakeup_pattern_send(void *wmi_hdl,
481 		struct wow_add_wakeup_pattern_params *param);
482 
483 QDF_STATUS wmi_unified_wow_remove_wakeup_pattern_send(void *wmi_hdl,
484 		struct wow_remove_wakeup_pattern_params *param);
485 
486 #ifndef CONFIG_MCL
487 QDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl,
488 			WMI_HOST_PKTLOG_EVENT PKTLOG_EVENT, uint8_t mac_id);
489 #else
490 QDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl,
491 				uint8_t macaddr[IEEE80211_ADDR_LEN],
492 				struct packet_enable_params *param);
493 #endif
494 
495 QDF_STATUS wmi_unified_packet_log_disable_send(void *wmi_hdl, uint8_t mac_id);
496 
497 QDF_STATUS wmi_unified_suspend_send(void *wmi_hdl,
498 				struct suspend_params *param,
499 				uint8_t mac_id);
500 
501 QDF_STATUS wmi_unified_resume_send(void *wmi_hdl,
502 				uint8_t mac_id);
503 
504 QDF_STATUS
505 wmi_unified_pdev_param_send(void *wmi_hdl,
506 			   struct pdev_params *param,
507 				uint8_t mac_id);
508 
509 QDF_STATUS wmi_unified_beacon_tmpl_send_cmd(void *wmi_hdl,
510 				struct beacon_tmpl_params *param);
511 
512 
513 QDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl,
514 				struct beacon_params *param);
515 
516 QDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl,
517 				struct peer_assoc_params *param);
518 
519 QDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
520 				struct sta_ps_params *param);
521 
522 QDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
523 				uint8_t macaddr[IEEE80211_ADDR_LEN],
524 				struct ap_ps_params *param);
525 
526 QDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl,
527 				struct scan_req_params *param);
528 
529 QDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
530 				struct scan_cancel_param *param);
531 
532 QDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
533 				struct scan_chan_list_params *param);
534 
535 
536 QDF_STATUS wmi_crash_inject(void *wmi_hdl,
537 				struct crash_inject *param);
538 
539 QDF_STATUS wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
540 				struct pdev_utf_params *param,
541 				uint8_t mac_id);
542 
543 #ifdef FEATURE_FW_LOG_PARSING
544 QDF_STATUS wmi_unified_dbglog_cmd_send(void *wmi_hdl,
545 				       struct dbglog_params *param);
546 #else
547 static inline QDF_STATUS
548 wmi_unified_dbglog_cmd_send(void *wmi_hdl,
549 			    struct dbglog_params *param)
550 {
551 	return QDF_STATUS_SUCCESS;
552 }
553 #endif
554 
555 QDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl,
556 				struct wmi_mgmt_params *param);
557 
558 QDF_STATUS wmi_offchan_data_tx_cmd_send(void *wmi_hdl,
559 				struct wmi_offchan_data_tx_params *param);
560 
561 QDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl,
562 		uint32_t param_value);
563 
564 QDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl,
565 			       uint32_t vdev_id, uint8_t val);
566 QDF_STATUS
567 wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
568 				struct sta_uapsd_trig_params *param);
569 
570 QDF_STATUS wmi_unified_get_temperature(void *wmi_hdl);
571 
572 QDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
573 		struct p2p_ps_params *oppps);
574 
575 QDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
576 			struct p2p_ps_params *noa);
577 
578 #ifdef CONVERGED_P2P_ENABLE
579 QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
580 			struct p2p_lo_start *param);
581 
582 QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id);
583 #endif
584 
585 QDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
586 			       int value);
587 
588 QDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value);
589 
590 #ifdef WLAN_FEATURE_DSRC
591 /**
592  * wmi_unified_ocb_start_timing_advert() - start sending the timing
593  *  advertisement frames on a channel
594  * @wmi_handle: pointer to the wmi handle
595  * @timing_advert: pointer to the timing advertisement struct
596  *
597  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
598  */
599 QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
600 	struct ocb_timing_advert_param *timing_advert);
601 
602 /**
603  * wmi_unified_ocb_stop_timing_advert() - stop sending the timing
604  *  advertisement frames on a channel
605  * @wmi_handle: pointer to the wmi handle
606  * @timing_advert: pointer to the timing advertisement struct
607  *
608  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
609  */
610 QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
611 	struct ocb_timing_advert_param *timing_advert);
612 
613 /**
614  * wmi_unified_ocb_set_config() - send the OCB config to the FW
615  * @wmi_handle: pointer to the wmi handle
616  * @config: the OCB configuration
617  *
618  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
619  */
620 QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
621 				      struct ocb_config *config);
622 
623 /**
624  * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
625  * @wmi_handle: pointer to the wmi handle
626  * @req: request for tsf timer
627  *
628  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
629  */
630 QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
631 					 struct ocb_get_tsf_timer_param *req);
632 
633 /**
634  * wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
635  * @wmi_handle: pointer to the wmi handle
636  * @vdev_id: vdev id
637  *
638  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
639  */
640 QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
641 					    struct ocb_utc_param *utc);
642 
643 /**
644  * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
645  * @wmi_handle: pointer to the wmi handle
646  * @get_stats_param: pointer to the dcc stats
647  *
648  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
649  */
650 QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
651 		     struct ocb_dcc_get_stats_param *get_stats_param);
652 
653 /**
654  * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
655  * @wmi_handle: pointer to the wmi handle
656  * @clear_stats_param: parameters to the command
657  *
658  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
659  */
660 QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
661 			struct ocb_dcc_clear_stats_param *clear_stats_param);
662 
663 /**
664  * wmi_unified_dcc_update_ndl() - command to update the NDL data
665  * @wmi_handle: pointer to the wmi handle
666  * @update_ndl_param: pointer to the request parameters
667  *
668  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
669  */
670 QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
671 		       struct ocb_dcc_update_ndl_param *update_ndl_param);
672 
673 /**
674  * wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
675  * @wmi_handle: wmi handle
676  * @evt_buf: pointer to event buffer
677  * @status: status buffer
678  *
679  * Return: QDF_STATUS_SUCCESS on success
680  */
681 QDF_STATUS
682 wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
683 					void *evt_buf,
684 					uint32_t *status);
685 
686 /**
687  * wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
688  * @wmi_handle: wmi handle
689  * @evt_buf: pointer to event buffer
690  * @resp: tsf timer
691  *
692  * Return: QDF_STATUS_SUCCESS on success
693  */
694 QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
695 				     void *evt_buf,
696 				     struct ocb_get_tsf_timer_response *resp);
697 
698 /**
699  * wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
700  * @wmi_handle: wmi handle
701  * @evt_buf: pointer to event buffer
702  * @resp: ndl update status
703  *
704  * Return: QDF_STATUS_SUCCESS on success
705  */
706 QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
707 		void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
708 
709 /**
710  * wmi_extract_dcc_stats() - extract DCC stats from wmi event
711  * @wmi_handle: wmi handle
712  * @evt_buf: pointer to event buffer
713  * @resp: DCC stats
714  *
715  * Since length of the response is variable, response buffer will be allocated.
716  * The caller must free the response buffer.
717  *
718  * Return: QDF_STATUS_SUCCESS on success
719  */
720 QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
721 				 void *evt_buf,
722 				 struct ocb_dcc_get_stats_response **response);
723 #endif
724 
725 QDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl,
726 	 struct wmi_lro_config_cmd_t *wmi_lro_cmd);
727 
728 QDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
729 				struct thermal_cmd_params *thermal_info);
730 
731 QDF_STATUS wmi_unified_peer_rate_report_cmd(void *wmi_hdl,
732 		struct wmi_peer_rate_report_params *rate_report_params);
733 
734 QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd
735 	(void *wmi_hdl,
736 	uint32_t adapter_1_chan_freq,
737 	uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq);
738 
739 QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd
740 	(void *wmi_hdl,
741 	uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency);
742 
743 QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
744 		   void *wmi_hdl, uint32_t mcc_adaptive_scheduler,
745 		   uint32_t pdev_id);
746 
747 #ifdef CONFIG_MCL
748 QDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl,
749 			wmi_bcn_send_from_host_cmd_fixed_param *param);
750 #endif
751 
752 QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
753 				       uint8_t vdev_id, uint32_t max_retries,
754 					   uint32_t retry_interval);
755 
756 
757 QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
758 				struct sta_params *params);
759 
760 QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
761 				  struct wmi_gtx_config *gtx_info);
762 
763 QDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl,
764 		     uint8_t vdev_id, bool mu_edca_param,
765 		     struct wmi_host_wme_vparams wmm_vparams[WMI_MAX_NUM_AC]);
766 
767 QDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl,
768 		   uint8_t vdev_id,
769 		   struct wmi_probe_resp_params *probe_rsp_info);
770 
771 QDF_STATUS wmi_unified_setup_install_key_cmd(void *wmi_hdl,
772 			struct set_key_params *key_params);
773 
774 #ifdef WLAN_FEATURE_DISA
775 /**
776  * wmi_unified_encrypt_decrypt_send_cmd() - send encryptdecrypt cmd to fw
777  * @wmi_hdl: wmi handle
778  * @params: encrypt/decrypt params
779  *
780  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
781  */
782 QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl,
783 			struct disa_encrypt_decrypt_req_params *params);
784 
785 /**
786  * wmi_extract_encrypt_decrypt_resp_params() -
787  *       extract encrypt decrypt resp params from event buffer
788  * @wmi_handle: wmi handle
789  * @evt_buf: pointer to event buffer
790  * @resp: encrypt decrypt resp params
791  *
792  * Return: QDF_STATUS_SUCCESS for success or error code
793  */
794 QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl,
795 			uint8_t *evt_buf,
796 			struct disa_encrypt_decrypt_resp_params *resp);
797 #endif
798 
799 QDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl,
800 				    uint32_t vdev_id, uint8_t *p2p_ie);
801 
802 
803 QDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
804 					struct gateway_update_req_param *req);
805 
806 QDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
807 					struct rssi_monitor_param *req);
808 
809 QDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl,
810 			  struct scan_mac_oui *psetoui);
811 
812 #ifdef CONFIG_MCL
813 QDF_STATUS wmi_unified_roam_scan_offload_mode_cmd(void *wmi_hdl,
814 				wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
815 				struct roam_offload_scan_params *roam_req);
816 #endif
817 
818 /**
819  * wmi_unified_roam_mawc_params_cmd() - configure roaming MAWC parameters
820  * @wmi_hdl: wmi handle
821  * @params: Parameters to be configured
822  *
823  * Pass the MAWC(Motion Aided wireless connectivity) related roaming
824  * parameters from the host to the target
825  *
826  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
827  */
828 QDF_STATUS wmi_unified_roam_mawc_params_cmd(void *wmi_hdl,
829 			struct wmi_mawc_roam_params *params);
830 
831 QDF_STATUS wmi_unified_roam_scan_offload_rssi_thresh_cmd(void *wmi_hdl,
832 				struct roam_offload_scan_rssi_params *roam_req);
833 
834 QDF_STATUS wmi_unified_roam_scan_filter_cmd(void *wmi_hdl,
835 				struct roam_scan_filter_params *roam_req);
836 
837 #ifdef IPA_OFFLOAD
838 QDF_STATUS  wmi_unified_ipa_offload_control_cmd(void *wmi_hdl,
839 		struct ipa_uc_offload_control_params *ipa_offload);
840 #endif
841 
842 QDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
843 			  const struct plm_req_params *plm);
844 
845 QDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
846 			  const struct plm_req_params *plm,
847 			  uint32_t *gchannel_list);
848 
849 QDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id);
850 
851 #ifdef FEATURE_WLAN_SCAN_PNO
852 QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl,
853 		   struct pno_scan_req_params *pno);
854 #endif
855 
856 QDF_STATUS wmi_unified_nlo_mawc_cmd(void *wmi_hdl,
857 		struct nlo_mawc_params *params);
858 
859 QDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
860 			uint8_t is_add_ts);
861 
862 QDF_STATUS wmi_unified_process_ll_stats_clear_cmd
863 	(void *wmi_hdl, const struct ll_stats_clear_params *clear_req,
864 	 uint8_t addr[IEEE80211_ADDR_LEN]);
865 
866 QDF_STATUS wmi_unified_process_ll_stats_set_cmd
867 	(void *wmi_hdl, const struct ll_stats_set_params *set_req);
868 
869 QDF_STATUS wmi_unified_process_ll_stats_get_cmd
870 	(void *wmi_hdl, const struct ll_stats_get_params  *get_req,
871 		 uint8_t addr[IEEE80211_ADDR_LEN]);
872 
873 /**
874  * wmi_unified_congestion_request_cmd() - send request to fw to get CCA
875  * @wmi_hdl: wma handle
876  * @vdev_id: vdev id
877  *
878  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
879  */
880 QDF_STATUS wmi_unified_congestion_request_cmd(void *wmi_hdl,
881 		uint8_t vdev_id);
882 
883 QDF_STATUS wmi_unified_snr_request_cmd(void *wmi_hdl);
884 
885 QDF_STATUS wmi_unified_snr_cmd(void *wmi_hdl, uint8_t vdev_id);
886 
887 QDF_STATUS wmi_unified_link_status_req_cmd(void *wmi_hdl,
888 				 struct link_status_params *link_status);
889 
890 #ifdef CONFIG_MCL
891 QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
892 				wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
893 
894 QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
895 					wmi_mac_addr peer_macaddr);
896 #endif
897 
898 #ifdef WLAN_SUPPORT_GREEN_AP
899 QDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
900 		struct wlan_green_ap_egap_params *egap_params);
901 #endif
902 
903 QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
904 			uint32_t cmd, uint32_t value1, uint32_t value2);
905 
906 QDF_STATUS wmi_unified_wow_timer_pattern_cmd(void *wmi_hdl, uint8_t vdev_id,
907 					     uint32_t cookie, uint32_t time);
908 
909 QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id);
910 
911 /**
912  * wmi_unified_set_latency_config_cmd()
913  * @wmi_handle: wmi handle
914  * @param: WLM parameters
915  *
916  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
917  */
918 QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
919 					struct wlm_latency_level_param *param);
920 
921 QDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id);
922 
923 #ifdef WLAN_FEATURE_CIF_CFR
924 /**
925  * wmi_unified_oem_dma_ring_cfg() - configure OEM DMA rings
926  * @wmi_handle: wmi handle
927  * @data_len: len of dma cfg req
928  * @data: dma cfg req
929  *
930  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
931  */
932 QDF_STATUS wmi_unified_oem_dma_ring_cfg(void *wmi_hdl,
933 				wmi_oem_dma_ring_cfg_req_fixed_param *cfg);
934 #endif
935 
936 /**
937  * wmi_unified_dbr_ring_cfg: Configure direct buffer rx rings
938  * @wmi_hdl: WMI handle
939  * @cfg: pointer to direct buffer rx config request
940  *
941  * Return: QDF status of operation
942  */
943 QDF_STATUS wmi_unified_dbr_ring_cfg(void *wmi_hdl,
944 				struct direct_buf_rx_cfg_req *cfg);
945 
946 QDF_STATUS wmi_unified_start_oem_data_cmd(void *wmi_hdl,
947 			  uint32_t data_len,
948 			  uint8_t *data);
949 
950 QDF_STATUS wmi_unified_dfs_phyerr_filter_offload_en_cmd(void *wmi_hdl,
951 			bool dfs_phyerr_filter_offload);
952 
953 #ifdef CONFIG_MCL
954 QDF_STATUS wmi_unified_pktlog_wmi_send_cmd(void *wmi_hdl,
955 				   WMI_PKTLOG_EVENT pktlog_event,
956 				   uint32_t cmd_id,
957 				   uint8_t user_triggered);
958 #endif
959 
960 QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
961 					uint8_t vdev_id);
962 
963 QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl);
964 QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
965 				uint8_t ac);
966 
967 QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
968 		      struct aggr_add_ts_param *aggr_qos_rsp_msg);
969 
970 QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
971 		 struct add_ts_param *msg);
972 
973 QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
974 						struct periodic_tx_pattern  *
975 						pAddPeriodicTxPtrnParams,
976 						uint8_t vdev_id);
977 
978 QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
979 						uint8_t vdev_id,
980 						uint8_t pattern_id);
981 
982 QDF_STATUS wmi_unified_stats_ext_req_cmd(void *wmi_hdl,
983 			struct stats_ext_params *preq);
984 
985 QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
986 			struct ext_wow_params *params);
987 
988 QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
989 					  struct app_type2_params *appType2Params);
990 
991 QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
992 						  uint32_t timer_val);
993 
994 QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
995 			struct nan_req_params *nan_req);
996 
997 QDF_STATUS wmi_unified_process_dhcpserver_offload_cmd(void *wmi_hdl,
998 				struct dhcp_offload_info_params *params);
999 
1000 QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl);
1001 
1002 QDF_STATUS wmi_unified_send_regdomain_info_to_fw_cmd(void *wmi_hdl,
1003 				   uint32_t reg_dmn, uint16_t regdmn2G,
1004 				   uint16_t regdmn5G, uint8_t ctl2G,
1005 				   uint8_t ctl5G);
1006 
1007 QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
1008 			      struct tdls_channel_switch_params *chan_switch_params);
1009 
1010 QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
1011 					 void *tdls_param, uint8_t tdls_state);
1012 
1013 QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
1014 			       struct tdls_peer_state_params *peerStateParams,
1015 				   uint32_t *ch_mhz);
1016 
1017 QDF_STATUS wmi_unified_process_fw_mem_dump_cmd(void *wmi_hdl,
1018 					struct fw_dump_req_param *mem_dump_req);
1019 
1020 QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
1021 				   struct vdev_ie_info_param *ie_info);
1022 
1023 QDF_STATUS wmi_unified_save_fw_version_cmd(void *wmi_hdl,
1024 		void *evt_buf);
1025 
1026 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
1027 					 uint8_t *custom_addr);
1028 
1029 QDF_STATUS wmi_unified_log_supported_evt_cmd(void *wmi_hdl,
1030 		uint8_t *event,
1031 		uint32_t len);
1032 
1033 QDF_STATUS wmi_unified_enable_specific_fw_logs_cmd(void *wmi_hdl,
1034 		struct wmi_wifi_start_log *start_log);
1035 
1036 QDF_STATUS wmi_unified_flush_logs_to_fw_cmd(void *wmi_hdl);
1037 
1038 QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl,
1039 				struct wmi_pcl_chan_weights *msg);
1040 
1041 QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
1042 				uint32_t hw_mode_index);
1043 
1044 QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl,
1045 		struct policy_mgr_dual_mac_config *msg);
1046 
1047 QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
1048 				struct flashing_req_params *flashing);
1049 
1050 QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
1051 				   struct app_type1_params *app_type1_params);
1052 
1053 QDF_STATUS wmi_unified_set_ssid_hotlist_cmd(void *wmi_hdl,
1054 		     struct ssid_hotlist_request_params *request);
1055 
1056 QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl,
1057 		 uint8_t vdev_id);
1058 
1059 QDF_STATUS wmi_unified_unit_test_cmd(void *wmi_hdl,
1060 			       struct wmi_unit_test_cmd *wmi_utest);
1061 
1062 QDF_STATUS wmi_unified_roam_invoke_cmd(void *wmi_hdl,
1063 		struct wmi_roam_invoke_cmd *roaminvoke,
1064 		uint32_t ch_hz);
1065 
1066 QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl,
1067 					 uint32_t command, uint32_t vdev_id);
1068 
1069 #ifdef CONFIG_MCL
1070 QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl,
1071 				   struct ap_profile_params *ap_profile);
1072 #endif
1073 
1074 QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl,
1075 					     uint32_t scan_period,
1076 					     uint32_t scan_age,
1077 					     uint32_t vdev_id);
1078 
1079 QDF_STATUS wmi_unified_roam_scan_offload_chan_list_cmd(void *wmi_hdl,
1080 				   uint8_t chan_count,
1081 				   uint32_t *chan_list,
1082 				   uint8_t list_type, uint32_t vdev_id);
1083 
1084 QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
1085 			  uint32_t vdev_id,
1086 			  int32_t rssi_change_thresh,
1087 			  uint32_t bcn_rssi_weight,
1088 			  uint32_t hirssi_delay_btw_scans);
1089 
1090 /**
1091  * wmi_unified_set_per_roam_config() - set PER roam config in FW
1092  * @wmi_hdl: wmi handle
1093  * @req_buf: per roam config request buffer
1094  *
1095  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1096  */
1097 QDF_STATUS wmi_unified_set_per_roam_config(void *wmi_hdl,
1098 		struct wmi_per_roam_config_req *req_buf);
1099 
1100 #ifdef FEATURE_WLAN_APF
1101 /**
1102  * wmi_unified_set_active_apf_mode_cmd() - config active APF mode in FW
1103  * @wmi: the WMI handle
1104  * @vdev_id: the Id of the vdev to apply the configuration to
1105  * @ucast_mode: the active APF mode to configure for unicast packets
1106  * @mcast_bcast_mode: the active APF mode to configure for multicast/broadcast
1107  *	packets
1108  */
1109 QDF_STATUS
1110 wmi_unified_set_active_apf_mode_cmd(wmi_unified_t wmi, uint8_t vdev_id,
1111 				    enum wmi_host_active_apf_mode ucast_mode,
1112 				    enum wmi_host_active_apf_mode
1113 							      mcast_bcast_mode);
1114 
1115 /**
1116  * wmi_unified_send_apf_enable_cmd() - send apf enable/disable cmd
1117  * @wmi: wmi handle
1118  * @vdev_id: VDEV id
1119  * @enable: true: enable, false: disable
1120  *
1121  * This function passes the apf enable command to fw
1122  *
1123  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1124  */
1125 QDF_STATUS wmi_unified_send_apf_enable_cmd(wmi_unified_t wmi,
1126 					   uint32_t vdev_id, bool enable);
1127 
1128 /**
1129  * wmi_unified_send_apf_write_work_memory_cmd() - send cmd to write into the APF
1130  *	work memory.
1131  * @wmi: wmi handle
1132  * @write_params: parameters and buffer pointer for the write
1133  *
1134  * This function passes the write apf work mem command to fw
1135  *
1136  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1137  */
1138 QDF_STATUS wmi_unified_send_apf_write_work_memory_cmd(wmi_unified_t wmi,
1139 			struct wmi_apf_write_memory_params *write_params);
1140 
1141 /**
1142  * wmi_unified_send_apf_read_work_memory_cmd() - send cmd to read part of APF
1143  *	work memory
1144  * @wmi: wmi handle
1145  * @read_params: contains relative address and length to read from
1146  *
1147  * This function passes the read apf work mem command to fw
1148  *
1149  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1150  */
1151 QDF_STATUS wmi_unified_send_apf_read_work_memory_cmd(wmi_unified_t wmi,
1152 				struct wmi_apf_read_memory_params *read_params);
1153 
1154 /**
1155  * wmi_extract_apf_read_memory_resp_event() - exctract read mem resp event
1156  * @wmi: wmi handle
1157  * @evt_buf: Pointer to the event buffer
1158  * @resp: pointer to memory to extract event parameters into
1159  *
1160  * This function exctracts read mem response event into the given structure ptr
1161  *
1162  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1163  */
1164 QDF_STATUS
1165 wmi_extract_apf_read_memory_resp_event(wmi_unified_t wmi, void *evt_buf,
1166 				struct wmi_apf_read_memory_resp_event_params
1167 								*read_mem_evt);
1168 #endif /* FEATURE_WLAN_APF */
1169 
1170 QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
1171 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1172 				struct stats_request_params *param);
1173 
1174 QDF_STATUS wmi_unified_pdev_get_tpc_config_cmd_send(void *wmi_hdl,
1175 				uint32_t param);
1176 
1177 QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl,
1178 				struct set_bwf_params *param);
1179 
1180 QDF_STATUS wmi_send_get_user_position_cmd(void *wmi_hdl, uint32_t value);
1181 
1182 QDF_STATUS wmi_send_get_peer_mumimo_tx_count_cmd(void *wmi_hdl, uint32_t value);
1183 
1184 QDF_STATUS wmi_send_reset_peer_mumimo_tx_count_cmd(void *wmi_hdl,
1185 				uint32_t value);
1186 
1187 QDF_STATUS wmi_send_pdev_caldata_version_check_cmd(void *wmi_hdl,
1188 				uint32_t value);
1189 
1190 QDF_STATUS wmi_unified_send_btcoex_wlan_priority_cmd(void *wmi_hdl,
1191 				struct btcoex_cfg_params *param);
1192 
1193 QDF_STATUS wmi_unified_send_btcoex_duty_cycle_cmd(void *wmi_hdl,
1194 				struct btcoex_cfg_params *param);
1195 
1196 QDF_STATUS wmi_unified_send_coex_ver_cfg_cmd(void *wmi_hdl,
1197 				coex_ver_cfg_t *param);
1198 
1199 QDF_STATUS wmi_unified_send_coex_config_cmd(void *wmi_hdl,
1200 					    struct coex_config_params *param);
1201 
1202 QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl,
1203 				struct set_atf_params *param);
1204 
1205 QDF_STATUS wmi_unified_pdev_fips_cmd_send(void *wmi_hdl,
1206 				struct fips_params *param);
1207 
1208 QDF_STATUS wmi_unified_wlan_profile_enable_cmd_send(void *wmi_hdl,
1209 				struct wlan_profile_params *param);
1210 
1211 QDF_STATUS wmi_unified_wlan_profile_trigger_cmd_send(void *wmi_hdl,
1212 				struct wlan_profile_params *param);
1213 
1214 QDF_STATUS wmi_unified_set_chan_cmd_send(void *wmi_hdl,
1215 				struct channel_param *param);
1216 
1217 QDF_STATUS wmi_unified_set_ht_ie_cmd_send(void *wmi_hdl,
1218 				struct ht_ie_params *param);
1219 
1220 QDF_STATUS wmi_unified_set_vht_ie_cmd_send(void *wmi_hdl,
1221 				struct vht_ie_params *param);
1222 
1223 QDF_STATUS wmi_unified_wmm_update_cmd_send(void *wmi_hdl,
1224 				struct wmm_update_params *param);
1225 
1226 QDF_STATUS wmi_unified_set_ant_switch_tbl_cmd_send(void *wmi_hdl,
1227 				struct ant_switch_tbl_params *param);
1228 
1229 QDF_STATUS wmi_unified_set_ratepwr_table_cmd_send(void *wmi_hdl,
1230 				struct ratepwr_table_params *param);
1231 
1232 QDF_STATUS wmi_unified_get_ratepwr_table_cmd_send(void *wmi_hdl);
1233 
1234 QDF_STATUS wmi_unified_set_ctl_table_cmd_send(void *wmi_hdl,
1235 				struct ctl_table_params *param);
1236 
1237 QDF_STATUS wmi_unified_set_mimogain_table_cmd_send(void *wmi_hdl,
1238 				struct mimogain_table_params *param);
1239 
1240 QDF_STATUS wmi_unified_set_ratepwr_chainmsk_cmd_send(void *wmi_hdl,
1241 				struct ratepwr_chainmsk_params *param);
1242 
1243 QDF_STATUS wmi_unified_set_macaddr_cmd_send(void *wmi_hdl,
1244 				struct macaddr_params *param);
1245 
1246 QDF_STATUS wmi_unified_pdev_scan_start_cmd_send(void *wmi_hdl);
1247 
1248 QDF_STATUS wmi_unified_pdev_scan_end_cmd_send(void *wmi_hdl);
1249 
1250 QDF_STATUS wmi_unified_set_acparams_cmd_send(void *wmi_hdl,
1251 				struct acparams_params *param);
1252 
1253 QDF_STATUS wmi_unified_set_vap_dscp_tid_map_cmd_send(void *wmi_hdl,
1254 				struct vap_dscp_tid_map_params *param);
1255 
1256 QDF_STATUS wmi_unified_proxy_ast_reserve_cmd_send(void *wmi_hdl,
1257 				struct proxy_ast_reserve_params *param);
1258 
1259 QDF_STATUS wmi_unified_pdev_qvit_cmd_send(void *wmi_hdl,
1260 				struct pdev_qvit_params *param);
1261 
1262 QDF_STATUS wmi_unified_mcast_group_update_cmd_send(void *wmi_hdl,
1263 				struct mcast_group_update_params *param);
1264 
1265 QDF_STATUS wmi_unified_peer_add_wds_entry_cmd_send(void *wmi_hdl,
1266 				struct peer_add_wds_entry_params *param);
1267 
1268 QDF_STATUS wmi_unified_peer_del_wds_entry_cmd_send(void *wmi_hdl,
1269 				struct peer_del_wds_entry_params *param);
1270 
1271 /**
1272  *  wmi_unified_set_bridge_mac_addr_cmd_send() - WMI set bridge mac addr cmd function
1273  *  @param wmi_hdl      : handle to WMI.
1274  *  @param param        : pointer to hold bridge mac addr param
1275  *
1276  *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1277  */
1278 QDF_STATUS wmi_unified_set_bridge_mac_addr_cmd_send(void *wmi_hdl,
1279 				struct set_bridge_mac_addr_params *param);
1280 
1281 
1282 QDF_STATUS wmi_unified_peer_update_wds_entry_cmd_send(void *wmi_hdl,
1283 				struct peer_update_wds_entry_params *param);
1284 
1285 QDF_STATUS wmi_unified_phyerr_enable_cmd_send(void *wmi_hdl);
1286 
1287 QDF_STATUS wmi_unified_phyerr_enable_cmd_send(void *wmi_hdl);
1288 
1289 QDF_STATUS wmi_unified_phyerr_disable_cmd_send(void *wmi_hdl);
1290 
1291 QDF_STATUS wmi_unified_smart_ant_enable_cmd_send(void *wmi_hdl,
1292 				struct smart_ant_enable_params *param);
1293 
1294 QDF_STATUS wmi_unified_smart_ant_set_rx_ant_cmd_send(void *wmi_hdl,
1295 				struct smart_ant_rx_ant_params *param);
1296 
1297 QDF_STATUS wmi_unified_smart_ant_set_tx_ant_cmd_send(void *wmi_hdl,
1298 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1299 				struct smart_ant_tx_ant_params *param);
1300 
1301 QDF_STATUS wmi_unified_smart_ant_set_training_info_cmd_send(void *wmi_hdl,
1302 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1303 				struct smart_ant_training_info_params *param);
1304 
1305 QDF_STATUS wmi_unified_smart_ant_node_config_cmd_send(void *wmi_hdl,
1306 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1307 				struct smart_ant_node_config_params *param);
1308 
1309 QDF_STATUS wmi_unified_smart_ant_enable_tx_feedback_cmd_send(void *wmi_hdl,
1310 			struct smart_ant_enable_tx_feedback_params *param);
1311 
1312 QDF_STATUS wmi_unified_vdev_spectral_configure_cmd_send(void *wmi_hdl,
1313 				struct vdev_spectral_configure_params *param);
1314 
1315 QDF_STATUS wmi_unified_vdev_spectral_enable_cmd_send(void *wmi_hdl,
1316 				struct vdev_spectral_enable_params *param);
1317 
1318 QDF_STATUS wmi_unified_bss_chan_info_request_cmd_send(void *wmi_hdl,
1319 				struct bss_chan_info_request_params *param);
1320 
1321 QDF_STATUS wmi_unified_thermal_mitigation_param_cmd_send(void *wmi_hdl,
1322 				struct thermal_mitigation_params *param);
1323 
1324 QDF_STATUS wmi_unified_vdev_set_neighbour_rx_cmd_send(void *wmi_hdl,
1325 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1326 				struct set_neighbour_rx_params *param);
1327 
1328 QDF_STATUS wmi_unified_vdev_set_fwtest_param_cmd_send(void *wmi_hdl,
1329 				struct set_fwtest_params *param);
1330 
1331 QDF_STATUS wmi_unified_vdev_config_ratemask_cmd_send(void *wmi_hdl,
1332 				struct config_ratemask_params *param);
1333 
1334 /**
1335  *  wmi_unified_vdev_set_custom_aggr_size_cmd_send() - WMI set custom aggr
1336  *						       size command
1337  *  @param wmi_hdl      : handle to WMI.
1338  *  @param param        : pointer to hold custom aggr size param
1339  *
1340  *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1341  */
1342 QDF_STATUS wmi_unified_vdev_set_custom_aggr_size_cmd_send(void *wmi_hdl,
1343 				struct set_custom_aggr_size_params *param);
1344 
1345 /**
1346  *  wmi_unified_vdev_set_qdepth_thresh_cmd_send() - WMI set qdepth threshold
1347  *  @param wmi_hdl      : handle to WMI.
1348  *  @param param        : pointer to hold set qdepth thresh param
1349  *
1350  *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1351  */
1352 QDF_STATUS wmi_unified_vdev_set_qdepth_thresh_cmd_send(void *wmi_hdl,
1353 				struct set_qdepth_thresh_params *param);
1354 
1355 QDF_STATUS wmi_unified_pdev_set_regdomain_cmd_send(void *wmi_hdl,
1356 				struct pdev_set_regdomain_params *param);
1357 
1358 QDF_STATUS wmi_unified_set_quiet_mode_cmd_send(void *wmi_hdl,
1359 				struct set_quiet_mode_params *param);
1360 
1361 QDF_STATUS wmi_unified_set_beacon_filter_cmd_send(void *wmi_hdl,
1362 				struct set_beacon_filter_params *param);
1363 
1364 QDF_STATUS wmi_unified_remove_beacon_filter_cmd_send(void *wmi_hdl,
1365 				struct remove_beacon_filter_params *param);
1366 
1367 QDF_STATUS wmi_unified_addba_clearresponse_cmd_send(void *wmi_hdl,
1368 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1369 				struct addba_clearresponse_params *param);
1370 
1371 QDF_STATUS wmi_unified_addba_send_cmd_send(void *wmi_hdl,
1372 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1373 				struct addba_send_params *param);
1374 
1375 QDF_STATUS wmi_unified_delba_send_cmd_send(void *wmi_hdl,
1376 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1377 				struct delba_send_params *param);
1378 
1379 QDF_STATUS wmi_unified_addba_setresponse_cmd_send(void *wmi_hdl,
1380 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1381 				struct addba_setresponse_params *param);
1382 
1383 QDF_STATUS wmi_unified_singleamsdu_cmd_send(void *wmi_hdl,
1384 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1385 				struct singleamsdu_params *param);
1386 
1387 QDF_STATUS wmi_unified_set_qboost_param_cmd_send(void *wmi_hdl,
1388 				uint8_t macaddr[IEEE80211_ADDR_LEN],
1389 				struct set_qboost_params *param);
1390 
1391 QDF_STATUS wmi_unified_mu_scan_cmd_send(void *wmi_hdl,
1392 				struct mu_scan_params *param);
1393 
1394 QDF_STATUS wmi_unified_lteu_config_cmd_send(void *wmi_hdl,
1395 				struct lteu_config_params *param);
1396 
1397 QDF_STATUS wmi_unified_set_psmode_cmd_send(void *wmi_hdl,
1398 				struct set_ps_mode_params *param);
1399 
1400 QDF_STATUS wmi_unified_init_cmd_send(void *wmi_hdl,
1401 				struct wmi_init_cmd_param *param);
1402 
1403 bool wmi_service_enabled(void *wmi_hdl, uint32_t service_id);
1404 
1405 /**
1406  * wmi_save_service_bitmap() - save service bitmap
1407  * @wmi_handle: wmi handle
1408  * @param evt_buf: pointer to event buffer
1409  *
1410  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS failure code
1411  */
1412 QDF_STATUS wmi_save_service_bitmap(void *wmi_hdl, void *evt_buf,
1413 				   void *bitmap_buf);
1414 
1415 /**
1416  * wmi_save_ext_service_bitmap() - save extended service bitmap
1417  * @wmi_handle: wmi handle
1418  * @param evt_buf: pointer to event buffer
1419  *
1420  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS failure code
1421  */
1422 QDF_STATUS wmi_save_ext_service_bitmap(void *wmi_hdl, void *evt_buf,
1423 				   void *bitmap_buf);
1424 
1425 QDF_STATUS wmi_save_fw_version(void *wmi_hdl, void *evt_buf);
1426 
1427 QDF_STATUS wmi_get_target_cap_from_service_ready(void *wmi_hdl,
1428 				void *evt_buf,
1429 				struct wlan_psoc_target_capability_info *ev);
1430 
1431 QDF_STATUS wmi_extract_hal_reg_cap(void *wmi_hdl, void *evt_buf,
1432 			struct wlan_psoc_hal_reg_capability *hal_reg_cap);
1433 
1434 host_mem_req *wmi_extract_host_mem_req_from_service_ready(void *wmi_hdl,
1435 				void *evt_buf, uint8_t *num_entries);
1436 
1437 uint32_t wmi_ready_extract_init_status(void *wmi_hdl, void *ev);
1438 
1439 QDF_STATUS wmi_ready_extract_mac_addr(void *wmi_hdl,
1440 				void *ev, uint8_t *macaddr);
1441 
1442 wmi_host_mac_addr *wmi_ready_extract_mac_addr_list(void *wmi_hdl, void *ev,
1443 					      uint8_t *num_mac_addr);
1444 
1445 /**
1446  * wmi_extract_ready_params() - Extract data from ready event apart from
1447  *                     status, macaddr and version.
1448  * @wmi_handle: Pointer to WMI handle.
1449  * @evt_buf: Pointer to Ready event buffer.
1450  * @ev_param: Pointer to host defined struct to copy the data from event.
1451  *
1452  * Return: QDF_STATUS_SUCCESS on success.
1453  */
1454 QDF_STATUS wmi_extract_ready_event_params(void *wmi_hdl,
1455 		void *evt_buf, struct wmi_host_ready_ev_param *ev_param);
1456 
1457 QDF_STATUS wmi_extract_fw_version(void *wmi_hdl,
1458 				void *ev, struct wmi_host_fw_ver *fw_ver);
1459 
1460 QDF_STATUS wmi_extract_fw_abi_version(void *wmi_hdl,
1461 				void *ev, struct wmi_host_fw_abi_ver *fw_ver);
1462 
1463 QDF_STATUS wmi_check_and_update_fw_version(void *wmi_hdl, void *ev);
1464 
1465 uint8_t *wmi_extract_dbglog_data_len(void *wmi_hdl,
1466 				void *evt_b, uint32_t *len);
1467 
1468 QDF_STATUS wmi_send_ext_resource_config(void *wmi_hdl,
1469 				wmi_host_ext_resource_config *ext_cfg);
1470 
1471 QDF_STATUS wmi_unified_nf_dbr_dbm_info_get_cmd_send(void *wmi_hdl,
1472 						    uint8_t mac_id);
1473 
1474 QDF_STATUS wmi_unified_packet_power_info_get_cmd_send(void *wmi_hdl,
1475 				struct packet_power_info_params *param);
1476 
1477 QDF_STATUS wmi_unified_gpio_config_cmd_send(void *wmi_hdl,
1478 				struct gpio_config_params *param);
1479 
1480 QDF_STATUS wmi_unified_gpio_output_cmd_send(void *wmi_hdl,
1481 				struct gpio_output_params *param);
1482 
1483 QDF_STATUS wmi_unified_rtt_meas_req_test_cmd_send(void *wmi_hdl,
1484 				struct rtt_meas_req_test_params *param);
1485 
1486 QDF_STATUS wmi_unified_rtt_meas_req_cmd_send(void *wmi_hdl,
1487 				struct rtt_meas_req_params *param);
1488 
1489 QDF_STATUS wmi_unified_rtt_keepalive_req_cmd_send(void *wmi_hdl,
1490 				struct rtt_keepalive_req_params *param);
1491 
1492 QDF_STATUS wmi_unified_lci_set_cmd_send(void *wmi_hdl,
1493 				struct lci_set_params *param);
1494 
1495 QDF_STATUS wmi_unified_lcr_set_cmd_send(void *wmi_hdl,
1496 				struct lcr_set_params *param);
1497 
1498 QDF_STATUS wmi_unified_send_periodic_chan_stats_config_cmd(void *wmi_hdl,
1499 			struct periodic_chan_stats_params *param);
1500 
1501 QDF_STATUS
1502 wmi_send_atf_peer_request_cmd(void *wmi_hdl,
1503 			struct atf_peer_request_params *param);
1504 
1505 QDF_STATUS
1506 wmi_send_set_atf_grouping_cmd(void *wmi_hdl,
1507 			struct atf_grouping_params *param);
1508 /* Extract APIs */
1509 
1510 QDF_STATUS wmi_extract_wds_addr_event(void *wmi_hdl,
1511 		void *evt_buf, uint16_t len, wds_addr_event_t *wds_ev);
1512 
1513 QDF_STATUS wmi_extract_dcs_interference_type(void *wmi_hdl,
1514 		void *evt_buf, struct wmi_host_dcs_interference_param *param);
1515 
1516 QDF_STATUS wmi_extract_dcs_cw_int(void *wmi_hdl, void *evt_buf,
1517 		wmi_host_ath_dcs_cw_int *cw_int);
1518 
1519 QDF_STATUS wmi_extract_dcs_im_tgt_stats(void *wmi_hdl, void *evt_buf,
1520 		wmi_host_dcs_im_tgt_stats_t *wlan_stat);
1521 
1522 QDF_STATUS wmi_extract_fips_event_data(void *wmi_hdl, void *evt_buf,
1523 		struct wmi_host_fips_event_param *param);
1524 
1525 QDF_STATUS wmi_extract_vdev_start_resp(void *wmi_hdl, void *evt_buf,
1526 		wmi_host_vdev_start_resp *vdev_rsp);
1527 
1528 /**
1529  * wmi_extract_vdev_delete_resp - api to extract vdev delete
1530  * response event params
1531  * @wmi_handle: wma handle
1532  * @evt_buf: pointer to event buffer
1533  * @delele_rsp: pointer to hold delete response from firmware
1534  *
1535  * Return: QDF_STATUS_SUCCESS for successful event parse
1536  *         else QDF_STATUS_E_INVAL or QDF_STATUS_E_FAILURE
1537  */
1538 QDF_STATUS wmi_extract_vdev_delete_resp(void *wmi_hdl, void *evt_buf,
1539 		struct wmi_host_vdev_delete_resp *delele_rsp);
1540 
1541 QDF_STATUS wmi_extract_tbttoffset_update_params(void *wmi_hdl, void *evt_buf,
1542 		uint8_t idx, struct tbttoffset_params *tbtt_param);
1543 
1544 QDF_STATUS wmi_extract_ext_tbttoffset_update_params(void *wmi_hdl,
1545 		void *evt_buf, uint8_t idx,
1546 		struct tbttoffset_params *tbtt_param);
1547 
1548 QDF_STATUS wmi_extract_tbttoffset_num_vdevs(void *wmi_hdl, void *evt_buf,
1549 					    uint32_t *num_vdevs);
1550 
1551 QDF_STATUS wmi_extract_ext_tbttoffset_num_vdevs(void *wmi_hdl, void *evt_buf,
1552 						uint32_t *num_vdevs);
1553 
1554 QDF_STATUS wmi_extract_mgmt_rx_params(void *wmi_hdl, void *evt_buf,
1555 		struct mgmt_rx_event_params *hdr, uint8_t **bufp);
1556 
1557 QDF_STATUS wmi_extract_vdev_stopped_param(void *wmi_hdl, void *evt_buf,
1558 		uint32_t *vdev_id);
1559 
1560 QDF_STATUS wmi_extract_vdev_roam_param(void *wmi_hdl, void *evt_buf,
1561 		wmi_host_roam_event *ev);
1562 
1563 QDF_STATUS wmi_extract_vdev_scan_ev_param(void *wmi_hdl, void *evt_buf,
1564 		struct scan_event *param);
1565 
1566 #ifdef CONVERGED_TDLS_ENABLE
1567 /**
1568  * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event
1569  * @wmi_handle: wmi handle
1570  * @param evt_buf: pointer to event buffer
1571  * @param param: Pointer to hold vdev tdls param
1572  *
1573  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1574  */
1575 QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf,
1576 					  struct tdls_event_info *param);
1577 #endif
1578 
1579 QDF_STATUS wmi_extract_mu_ev_param(void *wmi_hdl, void *evt_buf,
1580 		wmi_host_mu_report_event *param);
1581 
1582 QDF_STATUS wmi_extract_mu_db_entry(void *wmi_hdl, void *evt_buf,
1583 		uint8_t idx, wmi_host_mu_db_entry *param);
1584 
1585 QDF_STATUS wmi_extract_mumimo_tx_count_ev_param(void *wmi_hdl, void *evt_buf,
1586 		wmi_host_peer_txmu_cnt_event *param);
1587 
1588 QDF_STATUS wmi_extract_peer_gid_userpos_list_ev_param(void *wmi_hdl,
1589 		void *evt_buf, wmi_host_peer_gid_userpos_list_event *param);
1590 
1591 QDF_STATUS
1592 wmi_extract_esp_estimate_ev_param(void *wmi_hdl, void *evt_buf,
1593 				  struct esp_estimation_event *param);
1594 
1595 QDF_STATUS wmi_extract_pdev_caldata_version_check_ev_param(void *wmi_hdl,
1596 		void *evt_buf, wmi_host_pdev_check_cal_version_event *param);
1597 
1598 QDF_STATUS wmi_extract_pdev_tpc_config_ev_param(void *wmi_hdl, void *evt_buf,
1599 		wmi_host_pdev_tpc_config_event *param);
1600 
1601 QDF_STATUS wmi_extract_gpio_input_ev_param(void *wmi_hdl,
1602 		void *evt_buf, uint32_t *gpio_num);
1603 
1604 QDF_STATUS wmi_extract_pdev_reserve_ast_ev_param(void *wmi_hdl,
1605 		void *evt_buf, struct wmi_host_proxy_ast_reserve_param *param);
1606 
1607 QDF_STATUS wmi_extract_nfcal_power_ev_param(void *wmi_hdl, void *evt_buf,
1608 		wmi_host_pdev_nfcal_power_all_channels_event *param);
1609 
1610 QDF_STATUS wmi_extract_pdev_tpc_ev_param(void *wmi_hdl, void *evt_buf,
1611 		wmi_host_pdev_tpc_event *param);
1612 
1613 QDF_STATUS wmi_extract_pdev_generic_buffer_ev_param(void *wmi_hdl,
1614 		void *evt_buf,
1615 		wmi_host_pdev_generic_buffer_event *param);
1616 
1617 QDF_STATUS wmi_extract_mgmt_tx_compl_param(void *wmi_hdl, void *evt_buf,
1618 		wmi_host_mgmt_tx_compl_event *param);
1619 
1620 QDF_STATUS wmi_extract_offchan_data_tx_compl_param(void *wmi_hdl, void *evt_buf,
1621 		struct wmi_host_offchan_data_tx_compl_event *param);
1622 
1623 QDF_STATUS wmi_extract_pdev_csa_switch_count_status(void *wmi_hdl,
1624 		void *evt_buf,
1625 		struct pdev_csa_switch_count_status *param);
1626 
1627 QDF_STATUS wmi_extract_swba_num_vdevs(void *wmi_hdl, void *evt_buf,
1628 		uint32_t *num_vdevs);
1629 
1630 QDF_STATUS wmi_extract_swba_tim_info(void *wmi_hdl, void *evt_buf,
1631 		 uint32_t idx, wmi_host_tim_info *tim_info);
1632 
1633 QDF_STATUS wmi_extract_swba_noa_info(void *wmi_hdl, void *evt_buf,
1634 			uint32_t idx, wmi_host_p2p_noa_info *p2p_desc);
1635 
1636 #ifdef CONVERGED_P2P_ENABLE
1637 QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl,
1638 		void *evt_buf, struct p2p_lo_event *param);
1639 
1640 QDF_STATUS wmi_extract_p2p_noa_ev_param(void *wmi_hdl,
1641 		void *evt_buf, struct p2p_noa_info *param);
1642 #endif
1643 
1644 QDF_STATUS wmi_extract_peer_sta_ps_statechange_ev(void *wmi_hdl,
1645 		void *evt_buf, wmi_host_peer_sta_ps_statechange_event *ev);
1646 
1647 QDF_STATUS wmi_extract_peer_sta_kickout_ev(void *wmi_hdl, void *evt_buf,
1648 		wmi_host_peer_sta_kickout_event *ev);
1649 
1650 QDF_STATUS wmi_extract_peer_ratecode_list_ev(void *wmi_hdl, void *evt_buf,
1651 		uint8_t *peer_mac, wmi_sa_rate_cap *rate_cap);
1652 
1653 QDF_STATUS wmi_extract_bcnflt_stats(void *wmi_hdl, void *evt_buf,
1654 		 uint32_t index, wmi_host_bcnflt_stats *bcnflt_stats);
1655 
1656 QDF_STATUS wmi_extract_rtt_hdr(void *wmi_hdl, void *evt_buf,
1657 		wmi_host_rtt_event_hdr *ev);
1658 
1659 QDF_STATUS wmi_extract_rtt_ev(void *wmi_hdl, void *evt_buf,
1660 		wmi_host_rtt_meas_event *ev, uint8_t *hdump,
1661 		uint16_t hdump_len);
1662 
1663 QDF_STATUS wmi_extract_rtt_error_report_ev(void *wmi_hdl, void *evt_buf,
1664 		wmi_host_rtt_error_report_event *ev);
1665 
1666 QDF_STATUS wmi_extract_chan_stats(void *wmi_hdl, void *evt_buf,
1667 		uint32_t index, wmi_host_chan_stats *chan_stats);
1668 
1669 QDF_STATUS wmi_extract_thermal_stats(void *wmi_hdl, void *evt_buf,
1670 		uint32_t *temp, uint32_t *level, uint32_t *pdev_id);
1671 
1672 QDF_STATUS wmi_extract_thermal_level_stats(void *wmi_hdl, void *evt_buf,
1673 		uint8_t idx, uint32_t *levelcount, uint32_t *dccount);
1674 
1675 QDF_STATUS wmi_extract_comb_phyerr(void *wmi_hdl, void *evt_buf,
1676 			uint16_t datalen, uint16_t *buf_offset,
1677 			wmi_host_phyerr_t *phyerr);
1678 
1679 QDF_STATUS wmi_extract_single_phyerr(void *wmi_hdl, void *evt_buf,
1680 			uint16_t datalen, uint16_t *buf_offset,
1681 			wmi_host_phyerr_t *phyerr);
1682 
1683 QDF_STATUS wmi_extract_composite_phyerr(void *wmi_hdl, void *evt_buf,
1684 			uint16_t datalen, wmi_host_phyerr_t *phyerr);
1685 
1686 QDF_STATUS wmi_extract_profile_ctx(void *wmi_hdl, void *evt_buf,
1687 			wmi_host_wlan_profile_ctx_t *profile_ctx);
1688 
1689 QDF_STATUS wmi_extract_profile_data(void *wmi_hdl, void *evt_buf, uint8_t idx,
1690 			wmi_host_wlan_profile_t *profile_data);
1691 
1692 QDF_STATUS wmi_extract_chan_info_event(void *wmi_hdl, void *evt_buf,
1693 			wmi_host_chan_info_event *chan_info);
1694 
1695 QDF_STATUS wmi_extract_channel_hopping_event(void *wmi_hdl, void *evt_buf,
1696 			wmi_host_pdev_channel_hopping_event *ch_hopping);
1697 
1698 QDF_STATUS wmi_extract_stats_param(void *wmi_hdl, void *evt_buf,
1699 					   wmi_host_stats_event *stats_param);
1700 
1701 QDF_STATUS wmi_extract_pdev_stats(void *wmi_hdl, void *evt_buf,
1702 					 uint32_t index,
1703 					 wmi_host_pdev_stats *pdev_stats);
1704 
1705 QDF_STATUS wmi_extract_unit_test(void *wmi_hdl, void *evt_buf,
1706 			wmi_unit_test_event *unit_test, uint32_t maxspace);
1707 
1708 QDF_STATUS wmi_extract_pdev_ext_stats(void *wmi_hdl, void *evt_buf,
1709 			uint32_t index,
1710 			wmi_host_pdev_ext_stats *pdev_ext_stats);
1711 
1712 QDF_STATUS wmi_extract_peer_extd_stats(void *wmi_hdl, void *evt_buf,
1713 			uint32_t index,
1714 			wmi_host_peer_extd_stats *peer_extd_stats);
1715 
1716 QDF_STATUS wmi_extract_bss_chan_info_event(void *wmi_hdl, void *evt_buf,
1717 			wmi_host_pdev_bss_chan_info_event *bss_chan_info);
1718 
1719 QDF_STATUS wmi_extract_inst_rssi_stats_event(void *wmi_hdl, void *evt_buf,
1720 			wmi_host_inst_stats_resp *inst_rssi_resp);
1721 
1722 QDF_STATUS wmi_extract_peer_stats(void *wmi_hdl, void *evt_buf,
1723 		uint32_t index, wmi_host_peer_stats *peer_stats);
1724 
1725 QDF_STATUS wmi_extract_tx_data_traffic_ctrl_ev(void *wmi_hdl, void *evt_buf,
1726 		wmi_host_tx_data_traffic_ctrl_event *ev);
1727 
1728 QDF_STATUS wmi_extract_atf_peer_stats_ev(void *wmi_hdl, void *evt_buf,
1729 		wmi_host_atf_peer_stats_event *ev);
1730 
1731 QDF_STATUS wmi_extract_atf_token_info_ev(void *wmi_hdl, void *evt_buf,
1732 		uint8_t idx, wmi_host_atf_peer_stats_info *atf_token_info);
1733 
1734 QDF_STATUS wmi_extract_vdev_stats(void *wmi_hdl, void *evt_buf,
1735 		uint32_t index, wmi_host_vdev_stats *vdev_stats);
1736 
1737 QDF_STATUS wmi_extract_per_chain_rssi_stats(void *wmi_hdl, void *evt_buf,
1738 	uint32_t index, struct wmi_host_per_chain_rssi_stats *rssi_stats);
1739 
1740 QDF_STATUS wmi_extract_vdev_extd_stats(void *wmi_hdl, void *evt_buf,
1741 		uint32_t index, wmi_host_vdev_extd_stats *vdev_extd_stats);
1742 
1743 QDF_STATUS wmi_extract_bcn_stats(void *wmi_hdl, void *evt_buf,
1744 		uint32_t index, wmi_host_bcn_stats *vdev_bcn_stats);
1745 
1746 /**
1747  * wmi_extract_vdev_nac_rssi_stats() - extract NAC_RSSI stats from event
1748  * @wmi_handle: wmi handle
1749  * @param evt_buf: pointer to event buffer
1750  * @param vdev_extd_stats: Pointer to hold nac rssi stats
1751  *
1752  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1753  */
1754 QDF_STATUS wmi_extract_vdev_nac_rssi_stats(void *wmi_hdl, void *evt_buf,
1755 		struct wmi_host_vdev_nac_rssi_event *vdev_nac_rssi_stats);
1756 
1757 QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl,
1758 				struct wmi_power_dbg_params *param);
1759 
1760 QDF_STATUS wmi_unified_send_multiple_vdev_restart_req_cmd(void *wmi_hdl,
1761 				struct multiple_vdev_restart_params *param);
1762 
1763 /**
1764  * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
1765  * @wmi_hdl: wmi handle
1766  * @params: sar limit command params
1767  *
1768  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1769  */
1770 QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl,
1771 					  struct sar_limit_cmd_params *params);
1772 
1773 /**
1774  * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
1775  * @wmi_hdl: wmi handle
1776  *
1777  * Return: QDF_STATUS_SUCCESS for success or error code
1778  */
1779 QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl);
1780 
1781 /**
1782  * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
1783  * @wmi_hdl: wmi handle
1784  * @evt_buf: event buffer received from firmware
1785  * @event: SAR limit event which is to be populated by data extracted from
1786  *         the @evt_buf buffer
1787  *
1788  * Return: QDF_STATUS_SUCCESS for success or error code
1789  */
1790 QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl,
1791 					       uint8_t *evt_buf,
1792 					       struct sar_limit_event *event);
1793 
1794 /**
1795  * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
1796  * @handle: wmi handle
1797  * @event: event buffer received from firmware
1798  * @len: length of the event buffer
1799  *
1800  * Return: QDF_STATUS_SUCCESS for success or error code
1801  */
1802 QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
1803 						 uint8_t *event, uint32_t len);
1804 
1805 /**
1806  * wmi_extract_sar_cap_service_ready_ext() - extract SAR cap from
1807  *					     FW service ready event
1808  * @wmi_hdl: wmi handle
1809  * @evt_buf: event buffer received from firmware
1810  * @ext_param: extended target info
1811  *
1812  * Return: QDF_STATUS_SUCCESS for success or error code
1813  */
1814 QDF_STATUS wmi_extract_sar_cap_service_ready_ext(
1815 			void *wmi_hdl,
1816 			uint8_t *evt_buf,
1817 			struct wlan_psoc_host_service_ext_param *ext_param);
1818 
1819 QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl,
1820 				   struct wmi_adaptive_dwelltime_params *
1821 				   wmi_param);
1822 QDF_STATUS wmi_unified_fw_test_cmd(void *wmi_hdl,
1823 				   struct set_fwtest_params *wmi_fwtest);
1824 
1825 QDF_STATUS wmi_unified_peer_rx_reorder_queue_setup_send(void *wmi_hdl,
1826 					struct rx_reorder_queue_setup_params *param);
1827 QDF_STATUS wmi_unified_peer_rx_reorder_queue_remove_send(void *wmi_hdl,
1828 					struct rx_reorder_queue_remove_params *param);
1829 
1830 QDF_STATUS wmi_extract_service_ready_ext(void *wmi_hdl, uint8_t *evt_buf,
1831 		struct wlan_psoc_host_service_ext_param *param);
1832 QDF_STATUS wmi_extract_hw_mode_cap_service_ready_ext(
1833 			void *wmi_hdl,
1834 			uint8_t *evt_buf, uint8_t hw_mode_idx,
1835 			struct wlan_psoc_host_hw_mode_caps *param);
1836 QDF_STATUS wmi_extract_mac_phy_cap_service_ready_ext(
1837 			void *wmi_hdl,
1838 			uint8_t *evt_buf,
1839 			uint8_t hw_mode_id,
1840 			uint8_t phy_id,
1841 			struct wlan_psoc_host_mac_phy_caps *param);
1842 QDF_STATUS wmi_extract_reg_cap_service_ready_ext(
1843 			void *wmi_hdl,
1844 			uint8_t *evt_buf, uint8_t phy_idx,
1845 			struct wlan_psoc_host_hal_reg_capabilities_ext *param);
1846 
1847 /**
1848  * wmi_extract_dbr_ring_cap_service_ready_ext: Extract direct buffer rx
1849  *                                             capability received through
1850  *                                             extended service ready event
1851  * @wmi_hdl: WMI handle
1852  * @evt_buf: Event buffer
1853  * @idx: Index of the module for which capability is received
1854  * @param: Pointer to direct buffer rx ring cap struct
1855  *
1856  * Return: QDF status of operation
1857  */
1858 QDF_STATUS wmi_extract_dbr_ring_cap_service_ready_ext(
1859 			void *wmi_hdl,
1860 			uint8_t *evt_buf, uint8_t idx,
1861 			struct wlan_psoc_host_dbr_ring_caps *param);
1862 
1863 /**
1864  * wmi_extract_dbr_buf_release_fixed : Extract direct buffer rx fixed param
1865  *                                     from buffer release event
1866  * @wmi_hdl: WMI handle
1867  * @evt_buf: Event buffer
1868  * @param: Pointer to direct buffer rx response struct
1869  *
1870  * Return: QDF status of operation
1871  */
1872 QDF_STATUS wmi_extract_dbr_buf_release_fixed(
1873 			void *wmi_hdl,
1874 			uint8_t *evt_buf,
1875 			struct direct_buf_rx_rsp *param);
1876 
1877 /**
1878  * wmi_extract_dbr_buf_release_entry: Extract direct buffer rx buffer tlv
1879  *
1880  * @wmi_hdl: WMI handle
1881  * @evt_buf: Event buffer
1882  * @idx: Index of the module for which capability is received
1883  * @param: Pointer to direct buffer rx entry
1884  *
1885  * Return: QDF status of operation
1886  */
1887 QDF_STATUS wmi_extract_dbr_buf_release_entry(
1888 			void *wmi_hdl,
1889 			uint8_t *evt_buf, uint8_t idx,
1890 			struct direct_buf_rx_entry *param);
1891 
1892 /**
1893  * wmi_extract_dbr_buf_metadata: Extract direct buffer metadata
1894  *
1895  * @wmi_hdl: WMI handle
1896  * @evt_buf: Event buffer
1897  * @idx: Index of the module for which capability is received
1898  * @param: Pointer to direct buffer metadata
1899  *
1900  * Return: QDF status of operation
1901  */
1902 QDF_STATUS wmi_extract_dbr_buf_metadata(
1903 			void *wmi_hdl,
1904 			uint8_t *evt_buf, uint8_t idx,
1905 			struct direct_buf_rx_metadata *param);
1906 
1907 QDF_STATUS wmi_extract_pdev_utf_event(void *wmi_hdl,
1908 				      uint8_t *evt_buf,
1909 				      struct wmi_host_pdev_utf_event *param);
1910 
1911 QDF_STATUS wmi_extract_pdev_qvit_event(void *wmi_hdl,
1912 				      uint8_t *evt_buf,
1913 				      struct wmi_host_pdev_qvit_event *param);
1914 
1915 QDF_STATUS wmi_extract_peer_delete_response_event(void *wmi_hdl,
1916 		uint8_t *evt_buf,
1917 		struct wmi_host_peer_delete_response_event *param);
1918 
1919 QDF_STATUS wmi_extract_chainmask_tables(void *wmi_hdl, uint8_t *evt_buf,
1920 		struct wlan_psoc_host_chainmask_table *chainmask_table);
1921 /**
1922  * wmi_unified_dfs_phyerr_offload_en_cmd() - enable dfs phyerr offload
1923  * @wmi_handle: wmi handle
1924  * @pdev_id: pdev id
1925  *
1926  * Return: QDF_STATUS
1927  */
1928 QDF_STATUS wmi_unified_dfs_phyerr_offload_en_cmd(void *wmi_hdl,
1929 		uint32_t pdev_id);
1930 
1931 /**
1932  * wmi_unified_dfs_phyerr_offload_dis_cmd() - disable dfs phyerr offload
1933  * @wmi_handle: wmi handle
1934  * @pdev_id: pdev id
1935  *
1936  * Return: QDF_STATUS
1937  */
1938 QDF_STATUS wmi_unified_dfs_phyerr_offload_dis_cmd(void *wmi_hdl,
1939 		uint32_t pdev_id);
1940 
1941 QDF_STATUS wmi_unified_set_country_cmd_send(void *wmi_hdl,
1942 				struct set_country *param);
1943 /*
1944  * wmi_unified_set_del_pmkid_cache() - set delete PMKID
1945  * @wmi_hdl: wma handle
1946  * @pmksa: pointer to pmk cache entry
1947  *
1948  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1949  */
1950 QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl,
1951 					struct wmi_unified_pmk_cache *pmksa);
1952 
1953 #if defined(WLAN_FEATURE_FILS_SK)
1954 /*
1955  * wmi_unified_roam_send_hlp_cmd() -send HLP command info
1956  * @wmi_hdl: wma handle
1957  * @req_buf: Pointer to HLP params
1958  *
1959  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1960  */
1961 QDF_STATUS wmi_unified_roam_send_hlp_cmd(void *wmi_hdl,
1962 					struct hlp_params *req_buf);
1963 #endif
1964 
1965 /**
1966  * wmi_unified_send_request_get_rcpi_cmd() - command to request rcpi value
1967  * @wmi_hdl: wma handle
1968  * @get_rcpi_param: rcpi params
1969  *
1970  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
1971  */
1972 QDF_STATUS wmi_unified_send_request_get_rcpi_cmd(void *wmi_hdl,
1973 					struct rcpi_req *get_rcpi_param);
1974 
1975 /**
1976  * wmi_extract_rcpi_response_event - api to extract RCPI event params
1977  * @wmi_handle: wma handle
1978  * @evt_buf: pointer to event buffer
1979  * @res: pointer to hold rcpi response from firmware
1980  *
1981  * Return: QDF_STATUS_SUCCESS for successful event parse
1982  *         else QDF_STATUS_E_INVAL or QDF_STATUS_E_FAILURE
1983  */
1984 QDF_STATUS wmi_extract_rcpi_response_event(void *wmi_hdl, void *evt_buf,
1985 					   struct rcpi_res *res);
1986 
1987 #ifdef WMI_INTERFACE_EVENT_LOGGING
1988 void wmi_print_cmd_log(wmi_unified_t wmi, uint32_t count,
1989 		       qdf_abstract_print *print, void *print_priv);
1990 
1991 void wmi_print_cmd_tx_cmp_log(wmi_unified_t wmi, uint32_t count,
1992 			      qdf_abstract_print *print, void *print_priv);
1993 
1994 void wmi_print_mgmt_cmd_log(wmi_unified_t wmi, uint32_t count,
1995 			    qdf_abstract_print *print, void *print_priv);
1996 
1997 void wmi_print_mgmt_cmd_tx_cmp_log(wmi_unified_t wmi, uint32_t count,
1998 				   qdf_abstract_print *print, void *print_priv);
1999 
2000 void wmi_print_event_log(wmi_unified_t wmi, uint32_t count,
2001 			 qdf_abstract_print *print, void *print_priv);
2002 
2003 void wmi_print_rx_event_log(wmi_unified_t wmi, uint32_t count,
2004 			    qdf_abstract_print *print, void *print_priv);
2005 
2006 void wmi_print_mgmt_event_log(wmi_unified_t wmi, uint32_t count,
2007 			      qdf_abstract_print *print, void *print_priv);
2008 
2009 #endif /* WMI_INTERFACE_EVENT_LOGGING */
2010 
2011 QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl,
2012 				struct wmi_dbs_scan_sel_params *wmi_param);
2013 
2014 QDF_STATUS wmi_unified_send_limit_off_chan_cmd(void *wmi_hdl,
2015 		struct wmi_limit_off_chan_param *wmi_param);
2016 QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl,
2017 					 struct set_arp_stats *req_buf);
2018 QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
2019 					 struct get_arp_stats *req_buf);
2020 
2021 /**
2022  * wmi_send_bcn_offload_control_cmd - send beacon ofload control cmd to fw
2023  * @wmi_hdl: wmi handle
2024  * @bcn_ctrl_param: pointer to bcn_offload_control param
2025  *
2026  * Return: QDF_STATUS_SUCCESS for success or error code
2027  */
2028 QDF_STATUS wmi_send_bcn_offload_control_cmd(void *wmi_hdl,
2029 			struct bcn_offload_control *bcn_ctrl_param);
2030 /**
2031  * wmi_unified_send_wds_entry_list_cmd() - WMI function to get list of
2032  *  wds entries from FW
2033  * @wmi_hdl: wmi handle
2034  *
2035  * Send WMI_PDEV_WDS_ENTRY_LIST_CMDID parameters to fw.
2036  *
2037  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
2038  */
2039 
2040 QDF_STATUS wmi_unified_send_dump_wds_table_cmd(void *wmi_hdl);
2041 
2042 /**
2043  * wmi_extract_wds_entry - api to extract wds entry
2044  * @wmi_hdl: wmi handle
2045  * @evt_buf: pointer to event buffer
2046  * @wds_entry: wds entry
2047  * @idx: index to point wds entry in event buffer
2048  *
2049  * Return: QDF_STATUS_SUCCESS for successful event parse
2050  *         else QDF_STATUS_E_INVAL or QDF_STATUS_E_FAILURE
2051  */
2052 
2053 QDF_STATUS wmi_extract_wds_entry(void *wmi_hdl, uint8_t *evt_buf,
2054 			struct wdsentry *wds_entry, u_int32_t idx);
2055 
2056 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
2057 /**
2058  * wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
2059  * @wmi_hdl: wmi handle
2060  * @req: pointer to request buffer
2061  *
2062  * Return: status of operation
2063  */
2064 QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
2065 				struct nan_datapath_initiator_req *req);
2066 
2067 /**
2068  * wmi_unified_ndp_responder_req_cmd_send - api to send responder request to FW
2069  * @wmi_hdl: wmi handle
2070  * @req: pointer to request buffer
2071  *
2072  * Return: status of operation
2073  */
2074 QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
2075 				struct nan_datapath_responder_req *req);
2076 
2077 /**
2078  * wmi_unified_ndp_end_req_cmd_send - api to send end request to FW
2079  * @wmi_hdl: wmi handle
2080  * @req: pointer to request buffer
2081  *
2082  * Return: status of operation
2083  */
2084 QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
2085 				struct nan_datapath_end_req *req);
2086 
2087 /**
2088  * wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer
2089  * @wmi_hdl: wmi handle
2090  * @data: event buffer
2091  * @rsp: buffer to populate
2092  *
2093  * Return: status of operation
2094  */
2095 QDF_STATUS wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle,
2096 			uint8_t *data, struct nan_datapath_initiator_rsp *rsp);
2097 
2098 /**
2099  * wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer
2100  * @wmi_hdl: wmi handle
2101  * @data: event buffer
2102  * @ind: buffer to populate
2103  *
2104  * Return: status of operation
2105  */
2106 QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
2107 			struct nan_datapath_indication_event *ind);
2108 
2109 /**
2110  * wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
2111  * @wmi_hdl: wmi handle
2112  * @data: event buffer
2113  * @ev: buffer to populate
2114  *
2115  * Return: status of operation
2116  */
2117 QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
2118 			struct nan_datapath_confirm_event *ev);
2119 
2120 /**
2121  * wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
2122  * @wmi_hdl: wmi handle
2123  * @data: event buffer
2124  * @rsp: buffer to populate
2125  *
2126  * Return: status of operation
2127  */
2128 QDF_STATUS wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle,
2129 			uint8_t *data, struct nan_datapath_responder_rsp *rsp);
2130 
2131 /**
2132  * wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
2133  * @wmi_hdl: wmi handle
2134  * @data: event buffer
2135  * @rsp: buffer to populate
2136  *
2137  * Return: status of operation
2138  */
2139 QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
2140 			struct nan_datapath_end_rsp_event *rsp);
2141 
2142 /**
2143  * wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
2144  * @wmi_hdl: wmi handle
2145  * @data: event buffer
2146  * @ind: buffer to populate
2147  *
2148  * Return: status of operation
2149  */
2150 QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
2151 			struct nan_datapath_end_indication_event **ind);
2152 
2153 /**
2154  * wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer
2155  * @wmi_hdl: wmi handle
2156  * @data: event buffer
2157  * @ind: buffer to populate
2158  *
2159  * Return: status of operation
2160  */
2161 QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
2162 				struct nan_datapath_sch_update_event *ind);
2163 #endif
2164 
2165 /**
2166  * wmi_unified_send_btm_config() - Send BTM config to fw
2167  * @wmi_hdl:  wmi handle
2168  * @params: pointer to wmi_btm_config
2169  *
2170  * Return: QDF_STATUS
2171  */
2172 QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
2173 				       struct wmi_btm_config *params);
2174 
2175 /**
2176  * wmi_unified_send_obss_detection_cfg_cmd() - WMI function to send obss
2177  *  detection configuration to FW.
2178  * @wmi_hdl: wmi handle
2179  * @cfg: obss detection configuration
2180  *
2181  * Send WMI_SAP_OBSS_DETECTION_CFG_CMDID parameters to fw.
2182  *
2183  * Return: QDF_STATUS
2184  */
2185 
2186 QDF_STATUS wmi_unified_send_obss_detection_cfg_cmd(void *wmi_hdl,
2187 			struct wmi_obss_detection_cfg_param *cfg);
2188 
2189 /**
2190  * wmi_unified_extract_obss_detection_info() - WMI function to extract obss
2191  *  detection info from FW.
2192  * @wmi_hdl: wmi handle
2193  * @data: event data from firmware
2194  * @info: Pointer to hold obss detection info
2195  *
2196  * This function is used to extract obss info from firmware.
2197  *
2198  * Return: QDF_STATUS
2199  */
2200 
2201 QDF_STATUS wmi_unified_extract_obss_detection_info(void *wmi_hdl,
2202 						   uint8_t *data,
2203 						   struct wmi_obss_detect_info
2204 						   *info);
2205 /**
2206  * wmi_unified_send_bss_color_change_enable_cmd() - WMI function to send bss
2207  *  color change enable to FW.
2208  * @wmi_hdl: wmi handle
2209  * @vdev_id: vdev ID
2210  * @enable: enable or disable color change handeling within firmware
2211  *
2212  * Send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID parameters to fw,
2213  * thereby firmware updates bss color when AP announces bss color change.
2214  *
2215  * Return: QDF_STATUS
2216  */
2217 
2218 QDF_STATUS wmi_unified_send_bss_color_change_enable_cmd(void *wmi_hdl,
2219 							uint32_t vdev_id,
2220 							bool enable);
2221 
2222 /**
2223  * wmi_unified_send_obss_color_collision_cfg_cmd() - WMI function to send bss
2224  *  color collision detection configuration to FW.
2225  * @wmi_hdl: wmi handle
2226  * @cfg: obss color collision detection configuration
2227  *
2228  * Send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID parameters to fw.
2229  *
2230  * Return: QDF_STATUS
2231  */
2232 
2233 QDF_STATUS wmi_unified_send_obss_color_collision_cfg_cmd(void *wmi_hdl,
2234 		struct wmi_obss_color_collision_cfg_param *cfg);
2235 
2236 /**
2237  * wmi_unified_extract_obss_color_collision_info() - WMI function to extract
2238  *  obss color collision info from FW.
2239  * @wmi_hdl: wmi handle
2240  * @data: event data from firmware
2241  * @info: Pointer to hold bss color collision info
2242  *
2243  * This function is used to extract bss collision info from firmware.
2244  *
2245  * Return: QDF_STATUS
2246  */
2247 
2248 QDF_STATUS wmi_unified_extract_obss_color_collision_info(void *wmi_hdl,
2249 		uint8_t *data, struct wmi_obss_color_collision_info *info);
2250 
2251 #ifdef WLAN_SUPPORT_GREEN_AP
2252 QDF_STATUS wmi_extract_green_ap_egap_status_info(
2253 		void *wmi_hdl, uint8_t *evt_buf,
2254 		struct wlan_green_ap_egap_status_info *egap_status_info_params);
2255 #endif
2256 
2257 #ifdef WLAN_SUPPORT_FILS
2258 /**
2259  * wmi_unified_fils_vdev_config_send_cmd() - send FILS config cmd to fw
2260  * @wmi_hdl: wmi handle
2261  * @param:   fils config params
2262  *
2263  * Return: QDF_STATUS_SUCCESS for success or error code
2264  */
2265 QDF_STATUS
2266 wmi_unified_fils_vdev_config_send_cmd(void *wmi_hdl,
2267 				      struct config_fils_params *param);
2268 
2269 /**
2270  * wmi_extract_swfda_vdev_id() - api to extract vdev id
2271  * @wmi_hdl: wmi handle
2272  * @evt_buf: pointer to event buffer
2273  * @vdev_id: pointer to vdev id
2274  *
2275  * Return: QDF_STATUS_SUCCESS for success or error code
2276  */
2277 QDF_STATUS wmi_extract_swfda_vdev_id(void *wmi_hdl, void *evt_buf,
2278 				     uint32_t *vdev_id);
2279 
2280 /**
2281  * wmi_unified_fils_discovery_send_cmd() - send FILS discovery cmd to fw
2282  * @wmi_hdl: wmi handle
2283  * @param:   fils discovery params
2284  *
2285  * Return: QDF_STATUS_SUCCESS for success or error code
2286  */
2287 QDF_STATUS wmi_unified_fils_discovery_send_cmd(void *wmi_hdl,
2288 					       struct fd_params *param);
2289 #endif /* WLAN_SUPPORT_FILS */
2290 
2291 /**
2292  * wmi_unified_offload_11k_cmd() - send 11k offload command
2293  * @wmi_hdl: wmi handle
2294  * @params: 11k offload params
2295  *
2296  * This function passes the 11k offload command params to FW
2297  *
2298  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2299  */
2300 QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
2301 				struct wmi_11k_offload_params *params);
2302 /**
2303  * wmi_unified_invoke_neighbor_report_cmd() - send invoke neighbor report cmd
2304  * @wmi_hdl: wmi handle
2305  * @params: invoke neighbor report params
2306  *
2307  * This function passes the invoke neighbor report command to fw
2308  *
2309  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2310  */
2311 QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
2312 			struct wmi_invoke_neighbor_report_params *params);
2313 
2314 /* wmi_get_ch_width_from_phy_mode() - convert phy mode to channel width
2315  * @wmi_hdl: wmi handle
2316  * @phymode: phy mode
2317  *
2318  * Return: wmi channel width
2319  */
2320 wmi_host_channel_width wmi_get_ch_width_from_phy_mode(void *wmi_hdl,
2321 					WMI_HOST_WLAN_PHY_MODE phymode);
2322 
2323 #ifdef QCA_SUPPORT_CP_STATS
2324 /**
2325  * wmi_extract_cca_stats() - api to extract congestion stats from event buffer
2326  * @wmi_handle: wma handle
2327  * @evt_buf: event buffer
2328  * @datalen: length of buffer
2329  * @stats: buffer to populated after stats extraction
2330  *
2331  * Return: status of operation
2332  */
2333 QDF_STATUS wmi_extract_cca_stats(wmi_unified_t wmi_handle, void *evt_buf,
2334 				 struct wmi_host_congestion_stats *stats);
2335 #endif /* QCA_SUPPORT_CP_STATS */
2336 
2337 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
2338 /**
2339  * wmi_unified_dfs_send_avg_params_cmd() - send average radar parameters cmd.
2340  * @wmi_hdl: wmi handle
2341  * @params: radar found params
2342  *
2343  * This function passes the average radar parameters to fw
2344  *
2345  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2346  */
2347 QDF_STATUS
2348 wmi_unified_dfs_send_avg_params_cmd(void *wmi_hdl,
2349 				    struct dfs_radar_found_params *params);
2350 
2351 /**
2352  * wmi_extract_dfs_status_from_fw() - extract host dfs status from fw.
2353  * @wmi_hdl: wmi handle
2354  * @evt_buf: pointer to event buffer
2355  * @dfs_status_check: pointer to the host dfs status
2356  *
2357  * This function extracts the result of host dfs from fw
2358  *
2359  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2360  */
2361 QDF_STATUS wmi_extract_dfs_status_from_fw(void *wmi_hdl, void *evt_buf,
2362 					  uint32_t  *dfs_status_check);
2363 #endif
2364 #ifdef OL_ATH_SMART_LOGGING
2365 /**
2366  * wmi_unified_send_smart_logging_enable_cmd() - send smart logging enable cmd
2367  * @wmi_hdl: wmi handle
2368  * @params: enable/disable
2369  *
2370  * This function enables/disable the smart logging feature
2371  *
2372  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2373  */
2374 QDF_STATUS wmi_unified_send_smart_logging_enable_cmd(void *wmi_hdl,
2375 						     uint32_t param);
2376 
2377 /**
2378  * wmi_unified_send_smart_logging_fatal_cmd() - send smart logging fatal cmd
2379  * @wmi_hdl: wmi handle
2380  * @param:  Fatal event
2381  *
2382  * This function sends the smart log fatal events to the FW
2383  *
2384  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2385  */
2386 QDF_STATUS wmi_unified_send_smart_logging_fatal_cmd
2387 					(void *wmi_hdl,
2388 					struct wmi_debug_fatal_events *param);
2389 
2390 /**
2391  * wmi_extract_smartlog_ev() - extract smartlog event info from event
2392  * @wmi_handle: wmi handle
2393  * @param evt_buf: pointer to event buffer
2394  * @param ev: Pointer to hold fatal events
2395  *
2396  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
2397  */
2398 QDF_STATUS wmi_extract_smartlog_ev
2399 				(void *wmi_hdl, void *evt_buf,
2400 				struct wmi_debug_fatal_events *ev);
2401 
2402 #endif /* OL_ATH_SMART_LOGGING */
2403 
2404 void wmi_process_fw_event_worker_thread_ctx(struct wmi_unified *wmi_handle,
2405 					    HTC_PACKET * htc_packet);
2406 
2407 #endif /* _WMI_UNIFIED_API_H_ */
2408