blob: 6501ee72689fe44c51eb0e5dd18c53f66f4ca288 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Yue Ma34321602019-12-23 12:39:20 -08002 * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * 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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef WMA_INTERNAL_H
20#define WMA_INTERNAL_H
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080021#include <cdp_txrx_handle.h>
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070022#if !defined(REMOVE_PKT_LOG)
23#include "pktlog_ac.h"
24#endif
25
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080026/* ################### defines ################### */
27/*
28 * TODO: Following constant should be shared by firwmare in
29 * wmi_unified.h. This will be done once wmi_unified.h is updated.
30 */
31#define WMI_PEER_STATE_AUTHORIZED 0x2
32
33#define WMA_2_4_GHZ_MAX_FREQ 3000
mukul sharma72c8b222015-09-04 17:02:01 +053034
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035/*AR9888/AR6320 noise floor approx value
36 * similar to the mentioned the WMA
37 */
38#define WMA_TGT_NOISE_FLOOR_DBM (-96)
Yeshwanth Sriram Guntuka14ab04c2018-09-21 15:06:49 +053039#define WMA_INVALID_PER_CHAIN_SNR (0x80)
40#define WMA_INVALID_PER_CHAIN_RSSI (0xFF)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041
42/*
43 * Make sure that link monitor and keep alive
44 * default values should be in sync with CFG.
45 */
46#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
47#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080049/* The maximum number of patterns that can be transmitted by the firmware
50 * and maximum patterns size.
51 */
jsreekumac44b922018-06-12 20:18:39 +053052#ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080053#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
jsreekumac44b922018-06-12 20:18:39 +053054#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080055
Kiran Kumar Lokere80734c02018-12-16 22:48:14 -080056#define WMA_WMM_EXPO_TO_VAL(val) ((1 << (val)) - 1)
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080057
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058#define MAX_HT_MCS_IDX 8
59#define MAX_VHT_MCS_IDX 10
Jingxiang Gef1d81592019-10-20 12:03:22 +080060#ifdef WLAN_FEATURE_11AX
61#define MAX_HE_MCS_IDX 12
62#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063#define INVALID_MCS_IDX 255
64
Jingxiang Gef1d81592019-10-20 12:03:22 +080065#define IS_MCS_HAS_DCM_RATE(val) \
66 ((val) == 0 || (val) == 1 || \
67 (val) == 3 || (val) == 4)
68
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080069#define LINK_STATUS_LEGACY 0
70#define LINK_STATUS_VHT 0x1
71#define LINK_STATUS_MIMO 0x2
72#define LINK_SUPPORT_VHT 0x4
73#define LINK_SUPPORT_MIMO 0x8
74
75#define LINK_RATE_VHT 0x3
76
77#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -070078#define MAX_ENTRY_VDEV_RESP_QUEUE 10
79
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080080/**
81 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -080082 * @mcs_index: mcs rate index
83 * @ht20_rate: HT20 supported rate table
84 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085 */
86struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -080087 uint8_t mcs_index;
88 uint16_t ht20_rate[2];
89 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080090};
91
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092/**
93 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -080094 * @mcs_index: mcs rate index
95 * @ht20_rate: VHT20 supported rate table
96 * @ht40_rate: VHT40 supported rate table
97 * @ht80_rate: VHT80 supported rate table
Liangwei Dong73fdb0d2019-12-13 15:01:00 +080098 * @ht160_rate: VHT160 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099 */
100struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800101 uint8_t mcs_index;
102 uint16_t ht20_rate[2];
103 uint16_t ht40_rate[2];
104 uint16_t ht80_rate[2];
Liangwei Dong73fdb0d2019-12-13 15:01:00 +0800105 uint16_t ht160_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800106};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800107
Jingxiang Gef1d81592019-10-20 12:03:22 +0800108#ifdef WLAN_FEATURE_11AX
109#define MAX_HE_DCM_INDEX 2
110/**
111 * struct index_he_data_rate_type - he data rate type
112 * @beacon_rate_index: Beacon rate index
113 * @supported_he80_rate: he80 rate
114 * @supported_he40_rate: he40 rate
115 * @supported_he20_rate: he20 rate
Liangwei Dong3b2fd852019-12-11 17:12:55 +0800116 * @supported_he160_rate: he160 rate
Jingxiang Gef1d81592019-10-20 12:03:22 +0800117 */
118struct index_he_data_rate_type {
119 uint8_t beacon_rate_index;
120 uint16_t supported_he20_rate[MAX_HE_DCM_INDEX][3];
121 uint16_t supported_he40_rate[MAX_HE_DCM_INDEX][3];
122 uint16_t supported_he80_rate[MAX_HE_DCM_INDEX][3];
Liangwei Dong3b2fd852019-12-11 17:12:55 +0800123 uint16_t supported_he160_rate[MAX_HE_DCM_INDEX][3];
Jingxiang Gef1d81592019-10-20 12:03:22 +0800124};
125#endif
126
Jeff Johnsondab58602018-07-14 15:30:24 -0700127struct wifi_scan_cmd_req_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800128/*
129 * wma_main.c functions declarations
130 */
131
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530132/**
133 * wma_send_msg_by_priority() - Send wma message to PE with priority.
134 * @wma_handle: wma handle
135 * @msg_type: message type
136 * @body_ptr: message body ptr
137 * @body_val: message body value
138 * @is_high_priority: if msg is high priority
139 *
140 * Return: none
141 */
142void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
143 void *body_ptr, uint32_t body_val, bool is_high_priority);
144
145/**
146 * wma_send_msg() - Send wma message to PE.
147 * @wma_handle: wma handle
148 * @msg_type: message type
149 * @body_ptr: message body ptr
150 * @body_val: message body value
151 *
152 * Return: none
153 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800154void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
155 void *body_ptr, uint32_t body_val);
156
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530157/**
158 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
159 * @wma_handle: wma handle
160 * @msg_type: message type
161 * @body_ptr: message body ptr
162 * @body_val: message body value
163 *
164 * Return: none
165 */
166void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
167 void *body_ptr, uint32_t body_val);
168
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800169void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530170 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800171
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530172QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800173 int value);
174
175/*
176 * wma_scan_roam.c functions declarations
177 */
178
179#ifdef WLAN_FEATURE_ROAM_OFFLOAD
180void wma_process_roam_invoke(WMA_HANDLE handle,
181 struct wma_roam_invoke_cmd *roaminvoke);
182
183void wma_process_roam_synch_fail(WMA_HANDLE handle,
184 struct roam_offload_synch_fail *synch_fail);
185
186int wma_roam_synch_event_handler(void *handle, uint8_t *event,
187 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530188
Srikanth Marepalli6a872782020-01-24 18:12:05 +0530189#ifdef WLAN_FEATURE_FIPS
190/**
191 * wma_register_pmkid_req_event_handler() - Register pmkid request event handler
192 * @wma_handle: wma_handle
193 *
194 * This function register pmkid request event handler.
195 */
196void wma_register_pmkid_req_event_handler(tp_wma_handle wma_handle);
197
198/**
199 * wma_roam_pmkid_request_event_handler() - Handles roam pmkid request event
200 * @handle: wma_handle
201 * @event: pmkid request event data pointer
202 * @len: length of the data
203 *
204 * Handles pmkid request event from firmware which is triggered after roam
205 * candidate selection.
206 */
207int wma_roam_pmkid_request_event_handler(void *handle,
208 uint8_t *event,
209 uint32_t len);
210#else
211static inline void
212wma_register_pmkid_req_event_handler(tp_wma_handle wma_handle)
213{
214}
Srikanth Marepalli72213312019-12-20 16:11:02 +0530215
216static inline int
217wma_roam_pmkid_request_event_handler(void *handle,
218 uint8_t *event,
219 uint32_t len)
220{
221 return 0;
222}
Srikanth Marepalli6a872782020-01-24 18:12:05 +0530223#endif /* WLAN_FEATURE_FIPS */
224
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530225/**
Pragaspathi Thilagaraj7a7163b2019-07-14 22:47:09 +0530226 * wma_roam_auth_offload_event_handler() - Handle LFR-3.0 Roam authentication
227 * offload event.
228 * @handle: wma_handle
229 * @event: rso auth offload event data pointer
230 * @len: length of the data
231 *
232 * Handles roam authentication offload event from firmware which is triggered
233 * after roam candidate selection.
234 */
235int wma_roam_auth_offload_event_handler(WMA_HANDLE handle, uint8_t *event,
236 uint32_t len);
237
238/**
Pragaspathi Thilagaraj5292e0a2019-11-29 17:36:30 +0530239 * wma_roam_stats_event_handler() - Handle the WMI_ROAM_STATS_EVENTID
240 * from target
241 * @handle: wma_handle
242 * @event: roam debug stats event data pointer
243 * @len: length of the data
244 *
245 * This function handles the roam debug stats from the target and logs it
246 * to kmsg. This WMI_ROAM_STATS_EVENTID event is received whenever roam
247 * scan trigger happens or when neighbor report is sent by the firmware.
248 *
249 * Return: Success or Failure status
250 */
251int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event,
252 uint32_t len);
253
254/**
Sandeep Puligilla3746d5d2018-10-23 16:01:11 -0700255 * wma_mlme_roam_synch_event_handler_cb() - roam synch event handler
256 * @handle: wma handle
257 * @event: event data
258 * @len: length of data
259 *
260 * This function is roam synch event handler. It sends roam
261 * indication for upper layer.
262 *
263 * Return: Success or Failure status
264 */
265int wma_mlme_roam_synch_event_handler_cb(void *handle, uint8_t *event,
266 uint32_t len);
267
268/**
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530269 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
270 * @handle: wma handle
271 * @event: event data
272 * @len: length of data
273 *
274 * This function is roam synch frame event handler.
275 *
276 * Return: Success or Failure status
277 */
278int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
279 uint32_t len);
Ashish Kumar Dhanotiya02137932019-02-26 21:43:32 +0530280#else
281static inline int wma_mlme_roam_synch_event_handler_cb(void *handle,
282 uint8_t *event,
283 uint32_t len)
284{
285 return 0;
286}
Pragaspathi Thilagaraj5292e0a2019-11-29 17:36:30 +0530287
288static inline int
289wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event,
290 uint32_t len)
291{
292 return 0;
293}
Srikanth Marepalli72213312019-12-20 16:11:02 +0530294
295static inline int
296wma_roam_pmkid_request_event_handler(void *handle,
297 uint8_t *event,
298 uint32_t len)
299{
300 return 0;
301}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800302#endif
303
Abhishek Ambure5e9b6a42020-02-12 21:32:35 +0530304#ifdef WLAN_FEATURE_ROAM_OFFLOAD
305/**
306 * wma_roam_scan_chan_list_event_handler() - roam scan chan list event handler
307 * @handle: wma handle
308 * @event: pointer to fw event
309 * @len: length of event
310 *
311 * Return: Success or Failure status
312 */
313int wma_roam_scan_chan_list_event_handler(WMA_HANDLE handle,
314 uint8_t *event,
315 uint32_t len);
316#else
317static inline int
318wma_roam_scan_chan_list_event_handler(WMA_HANDLE handle, uint8_t *event,
319 uint32_t len)
320{
321 return 0;
322}
323#endif
324
Kapil Gupta5cda2252016-12-29 18:44:26 +0530325/**
326 * wma_update_per_roam_config() -per roam config parameter updation to FW
327 * @handle: wma handle
328 * @req_buf: per roam config parameters
329 *
330 * Return: none
331 */
332void wma_update_per_roam_config(WMA_HANDLE handle,
333 struct wmi_per_roam_config_req *req_buf);
334
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530335QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336 tSirUpdateChanList *chan_list);
337
338#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530339QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530340 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800341 roam_offload_params,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800342 struct roam_offload_scan_req *roam_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343#endif
344
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530345QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346 wmi_start_scan_cmd_fixed_param *
347 scan_cmd_fp,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800348 struct roam_offload_scan_req *roam_req,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349 uint32_t mode, uint32_t vdev_id);
350
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700351/**
352 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
353 * @wma_handle: wma handle
354 * @roam_req: roam request param
355 *
356 * Fill the MAWC roaming parameters and send
357 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
358 *
359 * Return: QDF status
360 */
361QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800362 struct roam_offload_scan_req *roam_req);
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700363
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800364/**
365 * wma_roam_scan_offload_rssi_threshold() - set scan offload rssi threashold
366 * @wma_handle: wma handle
367 * @roam_req: Roaming request buffer
368 *
369 * Send WMI_ROAM_SCAN_RSSI_THRESHOLD TLV to firmware
370 *
371 * Return: QDF status
372 */
373QDF_STATUS
374wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
375 struct roam_offload_scan_req *roam_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376
Pragaspathi Thilagaraj2b8ea352019-04-12 02:23:50 +0530377QDF_STATUS
378wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
379 struct roam_offload_scan_req *roam_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800380
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530381QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800382 uint32_t vdev_id,
383 int32_t rssi_change_thresh,
384 uint32_t bcn_rssi_weight,
385 uint32_t hirssi_delay_btw_scans);
386
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530387QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388 uint8_t chan_count,
Tushnim Bhattacharyya42299b82019-09-01 18:03:54 -0700389 uint32_t *chan_freq_list,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800390 uint8_t list_type, uint32_t vdev_id);
391
Pragaspathi Thilagaraj7a1a08e2019-05-29 01:20:29 +0530392A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393 eCsrEncryptionType encr);
394
395A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
396
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800397void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
Jeff Johnson9f18aa72018-12-02 12:05:12 -0800398 struct mac_context *mac,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800399 struct roam_offload_scan_req *roam_req,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800400 wmi_start_scan_cmd_fixed_param *
401 scan_params);
402
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530403QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404 A_INT32 first_bcnt,
405 A_UINT32 final_bcnt, uint32_t vdev_id);
406
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530407QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800408 uint32_t command, uint32_t vdev_id);
409
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410#ifdef WLAN_FEATURE_ROAM_OFFLOAD
411void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
412#endif
413
414#ifdef FEATURE_WLAN_EXTSCAN
415
416int wma_extscan_start_stop_event_handler(void *handle,
417 uint8_t *cmd_param_info,
418 uint32_t len);
419
420int wma_extscan_operations_event_handler(void *handle,
421 uint8_t *cmd_param_info,
422 uint32_t len);
423
424int wma_extscan_table_usage_event_handler(void *handle,
425 uint8_t *cmd_param_info,
426 uint32_t len);
427
428int wma_extscan_capabilities_event_handler(void *handle,
429 uint8_t *cmd_param_info,
430 uint32_t len);
431
432int wma_extscan_hotlist_match_event_handler(void *handle,
433 uint8_t *cmd_param_info,
434 uint32_t len);
435
436int wma_extscan_cached_results_event_handler(void *handle,
437 uint8_t *cmd_param_info,
438 uint32_t len);
439
440int wma_extscan_change_results_event_handler(void *handle,
441 uint8_t *cmd_param_info,
442 uint32_t len);
443
444int wma_passpoint_match_event_handler(void *handle,
445 uint8_t *cmd_param_info,
446 uint32_t len);
447
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800448#endif
449
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530450int wma_handle_btm_blacklist_event(void *handle, uint8_t *cmd_param_info,
451 uint32_t len);
452
Wen Gong7952fbd2018-04-18 11:27:23 +0800453#ifdef FEATURE_WLAN_EXTSCAN
454int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
455
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800456void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
457
Jeff Johnsondab58602018-07-14 15:30:24 -0700458/**
459 * wma_start_extscan() - start extscan command to fw.
460 * @wma: wma handle
461 * @params: extscan command request params
462 *
463 * This function sends start extscan request to fw.
464 *
465 * Return: QDF Status.
466 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530467QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Jeff Johnsondab58602018-07-14 15:30:24 -0700468 struct wifi_scan_cmd_req_params *pstart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469
Jeff Johnson7272ea72018-07-15 17:22:27 -0700470/**
471 * wma_stop_extscan() - stop extscan command to fw.
472 * @wma: wma handle
473 * @params: stop scan command request params
474 *
475 * This function sends stop extscan request to fw.
476 *
477 * Return: QDF Status.
478 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530479QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Jeff Johnson7272ea72018-07-15 17:22:27 -0700480 struct extscan_stop_req_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800481
Jeff Johnson1148cb02018-07-13 23:14:32 -0700482/**
483 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
484 * @wma: wma handle
485 * @params: hotlist request params
486 *
487 * This function configures hotlist monitor in fw.
488 *
489 * Return: QDF status
490 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530491QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700492 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800493
Jeff Johnson9743eb72018-07-14 10:30:04 -0700494/**
495 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
496 * @wma: wma handle
497 * @params: hotlist request params
498 *
499 * This function configures hotlist monitor to stop in fw.
500 *
501 * Return: QDF status
502 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530503QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700504 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800505
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700506/**
507 * wma_extscan_start_change_monitor() - send start change monitor cmd
508 * @wma: wma handle
509 * @params: change monitor request params
510 *
511 * This function sends start change monitor request to fw.
512 *
513 * Return: QDF status
514 */
515QDF_STATUS
516wma_extscan_start_change_monitor(tp_wma_handle wma,
517 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800518
Jeff Johnson0c8dbc32018-07-16 22:10:48 -0700519/**
520 * wma_extscan_stop_change_monitor() - send stop change monitor cmd
521 * @wma: wma handle
522 * @params: change monitor request params
523 *
524 * This function sends stop change monitor request to fw.
525 *
526 * Return: QDF status
527 */
528QDF_STATUS
529wma_extscan_stop_change_monitor(tp_wma_handle wma,
530 struct extscan_capabilities_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800531
Jeff Johnson2ba60092018-07-17 08:19:37 -0700532/**
533 * wma_extscan_get_cached_results() - extscan get cached results
534 * @wma: wma handle
535 * @params: cached results parameters
536 *
537 * This function send request to fw to get cached results.
538 *
539 * Return: QDF status
540 */
541QDF_STATUS
542wma_extscan_get_cached_results(tp_wma_handle wma,
543 struct extscan_cached_result_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800544
Jeff Johnsonfed9a732018-07-18 12:18:03 -0700545/**
546 * wma_extscan_get_capabilities() - extscan get capabilities
547 * @wma: wma handle
548 * @params: get capabilities params
549 *
550 * This function sends request to fw to get extscan capabilities.
551 *
552 * Return: QDF status
553 */
554QDF_STATUS
555wma_extscan_get_capabilities(tp_wma_handle wma,
556 struct extscan_capabilities_params *params);
557
Jeff Johnson360135b2018-07-18 20:51:47 -0700558/**
559 * wma_set_epno_network_list() - set epno network list
560 * @wma: WMA handle
561 * @req: epno config params request structure
562 *
563 * This function reads the incoming epno config request structure
564 * and constructs the WMI message to the firmware.
565 *
566 * Return: 0 on success, error number otherwise
567 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530568QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Jeff Johnson360135b2018-07-18 20:51:47 -0700569 struct wifi_enhanced_pno_params *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800570
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700571/**
572 * wma_set_passpoint_network_list() - set passpoint network list
573 * @wma: WMA handle
574 * @params: passpoint network request structure
575 *
576 * This function sends the passpoint configs down to the firmware
577 *
578 * Return: QDF_STATUS enumeration
579 */
580QDF_STATUS
581wma_set_passpoint_network_list(tp_wma_handle wma,
582 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800583
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700584/**
585 * wma_reset_passpoint_network_list() - reset passpoint network list
586 * @wma: WMA handle
587 * @params: passpoint network request structure
588 *
589 * This function sends down WMI command with network id set to wildcard id.
590 * firmware shall clear all the config entries
591 *
592 * Return: QDF_STATUS enumeration
593 */
594QDF_STATUS
595wma_reset_passpoint_network_list(tp_wma_handle wma,
596 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597#endif
598
Jeff Johnson9d45f332019-01-29 08:42:00 -0800599/**
600 * wma_scan_probe_setoui() - set scan probe OUI
601 * @wma: wma handle
602 * @set_oui: OUI parameters
603 *
604 * set scan probe OUI parameters in firmware
605 *
606 * Return: QDF status
607 */
608QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma,
609 struct scan_mac_oui *set_oui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800610
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800611void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
612
613int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
614 uint32_t len);
615
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800617void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
618static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
619 uint8_t vdev_id)
620{
621 return wma->interfaces[vdev_id].roam_synch_in_progress;
622}
623#else
624static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
625 uint8_t vdev_id)
626{
627 return false;
628}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800629#endif
630
631/*
632 * wma_dev_if.c functions declarations
633 */
634
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530635/**
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530636 * wma_find_vdev_id_by_addr() - find vdev_id from mac address
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530637 * @wma: wma handle
638 * @addr: mac address
639 * @vdev_id: return vdev_id
640 *
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530641 * Return: SUCCESS or FAILURE
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530642 */
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530643QDF_STATUS wma_find_vdev_id_by_addr(tp_wma_handle wma, uint8_t *addr,
644 uint8_t *vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800645
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
647
648#ifdef QCA_IBSS_SUPPORT
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530649/**
650 * wma_is_vdev_in_ibss_mode() - check that vdev is in ibss mode or not
651 * @wma: wma handle
652 * @vdev_id: vdev id
653 *
654 * Helper function to know whether given vdev id
655 * is in IBSS mode or not.
656 *
657 * Return: True/False
658 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800659bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530660
661/**
662 * wma_adjust_ibss_heart_beat_timer() - set ibss heart beat timer in fw.
663 * @wma: wma handle
664 * @vdev_id: vdev id
665 * @peer_num_delta: peer number delta value
666 *
667 * Return: none
668 */
669void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
670 uint8_t vdev_id,
671 int8_t peer_num_delta);
672
673/**
674 * wma_set_ibss_pwrsave_params() - set ibss power save parameter to fw
675 * @wma: wma handle
676 * @vdev_id: vdev id
677 *
678 * Return: 0 for success or error code.
679 */
680QDF_STATUS
681wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
682
683/**
684 * wma_ibss_peer_info_event_handler() - IBSS peer info event handler
685 * @handle: wma handle
686 * @data: event data
687 * @len: length of data
688 *
689 * This function handles IBSS peer info event from FW.
690 *
691 * Return: 0 for success or error code
692 */
693int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
694 uint32_t len);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700695#else
696/**
697 * wma_is_vdev_in_ibss_mode(): dummy function
698 * @wma: wma handle
699 * @vdev_id: vdev id
700 *
701 * Return false since no vdev can be in ibss mode without ibss support
702 */
703static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700704bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700705{
706 return false;
707}
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530708
709/**
710 * wma_adjust_ibss_heart_beat_timer() - set ibss heart beat timer in fw.
711 * @wma: wma handle
712 * @vdev_id: vdev id
713 * @peer_num_delta: peer number delta value
714 *
715 * This function is dummy
716 *
717 * Return: none
718 */
719static inline void
720wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
721 uint8_t vdev_id,
722 int8_t peer_num_delta)
723{
724}
725
726/**
727 * wma_ibss_peer_info_event_handler() - IBSS peer info event handler
728 * @handle: wma handle
729 * @data: event data
730 * @len: length of data
731 *
732 * This function is dummy
733 *
734 * Return: 0 for success or error code
735 */
736static inline int
737wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
738 uint32_t len)
739{
740 return 0;
741}
Abhishek Ambure27f98302019-09-25 20:00:36 +0530742
743/**
744 * wma_set_ibss_pwrsave_params() - set ibss power save parameter to fw
745 * @wma: wma handle
746 * @vdev_id: vdev id
747 *
748 * This function is dummy
749 *
750 * Return: 0 for success or error code.
751 */
752static inline QDF_STATUS
753wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id)
754{
755 return QDF_STATUS_SUCCESS;
756}
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530757#endif /* QCA_IBSS_SUPPORT */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758
759/**
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530760 * wma_get_vdev_bssid() - Get BSSID from mlme_obj
761 * @vdev - pointer to vdev
762 *
763 * This API is used to get BSSID stored in vdev mlme object.
764 *
765 * Return: pointer to bssid on success else NULL.
766 */
767uint8_t *wma_get_vdev_bssid(struct wlan_objmgr_vdev *vdev);
768
769/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800770 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
771 * @wma - wma handle
772 * @vdev_id - vdev ID
773 *
774 * Return: Returns pointer to bssid on success,
775 * otherwise returns NULL.
776 */
777static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
778 uint8_t vdev_id)
779{
780 if (vdev_id >= wma->max_bssid)
781 return NULL;
782
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530783 return wma_get_vdev_bssid(wma->interfaces[vdev_id].vdev);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800784}
785
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530786/**
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530787 * wma_find_vdev_id_by_bssid() - Get the corresponding vdev_id from BSSID
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530788 * @wma - wma handle
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530789 * @bssid - bssid address
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530790 * @vdev_id - vdev ID
791 *
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530792 * Return: SUCCESS or FAILURE.
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530793 */
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530794QDF_STATUS wma_find_vdev_id_by_bssid(tp_wma_handle wma, uint8_t *bssid,
795 uint8_t *vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800796
Abhishek Amburecbef1442019-06-10 17:15:00 +0530797/**
798 * wma_vdev_detach() - send vdev delete command to fw
799 * @wma_handle: wma handle
800 * @pdel_vdev_req_param: del vdev params
801 *
802 * Return: QDF status
803 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530804QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Abhishek Amburecbef1442019-06-10 17:15:00 +0530805 struct del_vdev_params *pdel_vdev_req_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800806
Govind Singhd76a5b02016-03-08 15:12:14 +0530807QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800808 uint32_t param_id, uint32_t param_value);
Rajeev Kumar Sirasanagandlae5787e22018-10-25 21:10:34 +0530809
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530810QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
811 uint8_t vdev_id, bool roam_synch_in_progress);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800812
Rakshith Suresh Patkar5f9efa32019-02-04 13:26:56 +0530813QDF_STATUS wma_peer_unmap_conf_send(tp_wma_handle wma,
814 struct send_peer_unmap_conf_params *msg);
815
Vevek Venkatesan2d88a6b2019-10-04 19:03:10 +0530816QDF_STATUS wma_create_peer(tp_wma_handle wma,
817 uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
818 uint32_t peer_type, uint8_t vdev_id,
819 bool roam_synch_in_progress);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800820
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530821/**
822 * wma_send_del_bss_response() - send delete bss resp
823 * @wma: wma handle
Abhishek Ambure968f1512019-08-28 18:33:57 +0530824 * @resp: pointer to del bss response
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530825 *
826 * Return: none
827 */
Abhishek Ambure968f1512019-08-28 18:33:57 +0530828void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp);
Abhishek Singhcaa61852018-09-12 15:50:04 +0530829
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530830/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +0530831 * __wma_handle_vdev_stop_rsp() - vdev stop response handler
Abhishek Ambure09905d72019-08-08 19:45:55 +0530832 * @resp_event: pointer to response received
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530833 *
834 * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code
835 */
836QDF_STATUS
Abhishek Ambure09905d72019-08-08 19:45:55 +0530837__wma_handle_vdev_stop_rsp(struct vdev_stop_response *resp_event);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800838
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800839void wma_hold_req_timer(void *data);
840struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
841 uint8_t vdev_id, uint32_t msg_type,
842 uint8_t type, void *params,
843 uint32_t timeout);
844
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530845/**
846 * wma_add_bss() - Add BSS request to fw as per opmode
847 * @wma: wma handle
848 * @params: add bss params
849 *
850 * Return: none
851 */
Jianmin Zhuf07aa512019-08-09 18:20:17 +0800852void wma_add_bss(tp_wma_handle wma, struct bss_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800853
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530854/**
855 * wma_add_sta() - process add sta request as per opmode
856 * @wma: wma handle
857 * @add_Sta: add sta params
858 *
859 * Return: none
860 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800861void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
862
Abhishek Ambure8ed62cb2019-09-11 19:03:57 +0530863/**
864 * wma_delete_sta() - process del sta request as per opmode
865 * @wma: wma handle
866 * @del_sta: delete sta params
867 *
868 * Return: none
869 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800870void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
871
Abhishek Ambure968f1512019-08-28 18:33:57 +0530872/**
873 * wma_delete_bss() - process delete bss request from upper layer
874 * @wma: wma handle
875 * @vdev_id: vdev id
876 *
877 * Return: none
878 */
879void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800880
881int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
882
Abhishek Ambure0b2ea322019-09-23 19:25:39 +0530883/**
884 * wma_set_vdev_intrabss_fwd() - set intra_fwd value to wni_in.
885 * @wma_handle: wma handle
886 * @pdis_intra_fwd: Pointer to DisableIntraBssFwd struct
887 *
888 * Return: none
889 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800890void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
891 tpDisableIntraBssFwd pdis_intra_fwd);
892
Abhishek Ambure968f1512019-08-28 18:33:57 +0530893/**
894 * wma_delete_bss_ho_fail() - process delete bss request for handoff failure
895 * @wma: wma handle
896 * @vdev_id: vdev id
897 *
898 * Delete BSS in case of ROAM_HO_FAIL processing is handled separately in
899 * this routine. It needs to be done without sending any commands to firmware
900 * because firmware has already stopped and deleted peer and vdev is down.
901 * Relevant logic is aggregated from other routines. It changes the host
902 * data structures without sending VDEV_STOP, PEER_FLUSH_TIDS, PEER_DELETE
903 * and VDEV_DOWN commands to firmware.
904 *
905 * Return: none
906 */
907void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id);
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700908
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800909uint32_t wma_get_bcn_rate_code(uint16_t rate);
910
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800911/*
912 * wma_mgmt.c functions declarations
913 */
Liangwei Dong03e080c2019-07-02 17:06:39 +0800914#ifdef WLAN_WMI_BCN
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800915int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
Harprit Chhabada98225f62018-12-11 15:29:55 -0800916#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800917
Abhishek Ambure3ee80882019-09-20 16:32:12 +0530918/**
919 * wma_peer_sta_kickout_event_handler() - kickout event handler
920 * @handle: wma handle
921 * @event: event data
922 * @len: data length
923 *
924 * Kickout event is received from firmware on observing beacon miss
925 * It handles kickout event for different modes and indicate to
926 * upper layers.
927 *
928 * Return: 0 for success or error code
929 */
Krunal Sonibd7e8932018-10-03 11:14:51 -0700930int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
931 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800932
Abhishek Ambure0b2ea322019-09-23 19:25:39 +0530933/**
934 * wma_unified_bcntx_status_event_handler() - beacon tx status event handler
935 * @handle: wma handle
936 * @cmd_param_info: event data
937 * @len: data length
938 *
939 * WMI Handler for WMI_OFFLOAD_BCN_TX_STATUS_EVENTID event from firmware.
940 * This event is generated by FW when the beacon transmission is offloaded
941 * and the host performs beacon template modification using WMI_BCN_TMPL_CMDID
942 * The FW generates this event when the first successful beacon transmission
943 * after template update
944 *
945 * Return: 0 for success or error code
946 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800947int wma_unified_bcntx_status_event_handler(void *handle,
948 uint8_t *cmd_param_info,
949 uint32_t len);
950
mukul sharma72c8b222015-09-04 17:02:01 +0530951void wma_set_sta_sa_query_param(tp_wma_handle wma,
952 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800953
954void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
955 uint32_t method, uint32_t timeperiod,
956 uint8_t *hostv4addr, uint8_t *destv4addr,
957 uint8_t *destmac);
958
959int wma_vdev_install_key_complete_event_handler(void *handle,
960 uint8_t *event,
961 uint32_t len);
962
Abhishek Singh8d92ea72019-10-22 12:18:12 +0530963/**
964 * wma_objmgr_set_peer_mlme_phymode() - set phymode to peer object
965 * @wma: wma handle
966 * @mac_addr: mac addr of peer
967 * @phymode: phymode value to set
968 *
969 * Return: None
970 */
971void wma_objmgr_set_peer_mlme_phymode(tp_wma_handle wma, uint8_t *mac_addr,
972 enum wlan_phymode phymode);
973
Govind Singhb30d4c02016-03-24 11:01:23 +0530974QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800975 tSirNwType nw_type,
976 tpAddStaParams params);
977
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530978QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
979 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800980 gtx_config_t *gtx_info);
981
982void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
983 uint8_t llbcoexist);
984
985void wma_process_update_beacon_params(tp_wma_handle wma,
986 tUpdateBeaconParams *bcn_params);
987
Abhishek Ambure0b2ea322019-09-23 19:25:39 +0530988/**
989 * wma_update_rts_params() - update cfg parameters to target
990 * @wma: wma handle
991 * @value: rts_threshold
992 *
993 * Return: none
994 */
Harprit Chhabadabec6de42018-09-10 10:21:15 -0700995void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
996
Abhishek Ambure0b2ea322019-09-23 19:25:39 +0530997/**
998 * wma_update_frag_params() - update cfg parameters to target
999 * @wma: wma handle
1000 * @value: frag_threshold
1001 *
1002 * Return: none
1003 */
Harprit Chhabadabec6de42018-09-10 10:21:15 -07001004void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001005
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301006QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001007 tEdcaParams *edca_params);
1008
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301009/**
1010 * wma_tbttoffset_update_event_handler() - tbtt offset update handler
1011 * @handle: wma handle
1012 * @event: event buffer
1013 * @len: data length
1014 *
1015 * Return: 0 for success or error code
1016 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001017int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
1018 uint32_t len);
1019
1020void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
1021 tpSendProbeRespParams probe_rsp_info);
1022
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301023/**
1024 * wma_set_ap_vdev_up() - send vdev up req
1025 * @wma: wma handle
1026 * @vdev_id: vdev id
1027 *
Abhishek Singh3d30a3b2018-09-12 15:49:18 +05301028 * Return: QDF_STATUS
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301029 */
Abhishek Singh3d30a3b2018-09-12 15:49:18 +05301030QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301031
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
1033
1034void wma_set_keepalive_req(tp_wma_handle wma,
Jeff Johnson562ccad2019-02-06 22:10:24 -08001035 struct keep_alive_req *keepalive);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001036
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301037void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
1038 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039
1040void wma_process_update_opmode(tp_wma_handle wma_handle,
1041 tUpdateVHTOpMode *update_vht_opmode);
1042
1043void wma_process_update_rx_nss(tp_wma_handle wma_handle,
1044 tUpdateRxNss *update_rx_nss);
1045
1046void wma_process_update_membership(tp_wma_handle wma_handle,
1047 tUpdateMembership *membership);
1048
1049void wma_process_update_userpos(tp_wma_handle wma_handle,
1050 tUpdateUserPos *userpos);
1051
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001052/*
1053 * wma_power.c functions declarations
1054 */
1055
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301056/**
1057 * wma_enable_sta_ps_mode() - enable sta powersave params in fw
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301058 * @ps_req: power save request
1059 *
1060 * Return: none
1061 */
gaurank kathpaliae7bd4322020-01-29 09:07:55 +05301062void wma_enable_sta_ps_mode(tpEnablePsParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001063
Govind Singhd76a5b02016-03-08 15:12:14 +05301064QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001065 uint32_t vdev_id, uint32_t param,
1066 uint32_t value);
1067
Govind Singhd76a5b02016-03-08 15:12:14 +05301068QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001069 uint8_t *peer_addr, uint8_t uapsd_value,
1070 uint8_t max_sp);
1071
1072void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -08001073 struct wmi_host_wme_vparams *wmm_param,
1074 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001075
1076void wma_set_tx_power(WMA_HANDLE handle,
1077 tMaxTxPowerParams *tx_pwr_params);
1078
1079void wma_set_max_tx_power(WMA_HANDLE handle,
1080 tMaxTxPowerParams *tx_pwr_params);
1081
gaurank kathpaliae7bd4322020-01-29 09:07:55 +05301082void wma_disable_sta_ps_mode(tpDisablePsParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001083
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301084/**
Abhishek Amburebf230ab2020-04-17 11:16:36 +05301085 * wma_send_max_tx_pwrlmt() - send max tx power limit to fw
1086 * @handle: wma handle
1087 * @vdev_id: vdev id
1088 *
1089 * Return: none
1090 */
1091void wma_send_max_tx_pwrlmt(WMA_HANDLE handle, uint8_t vdev_id);
1092
1093/**
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301094 * wma_enable_uapsd_mode() - enable uapsd mode in fw
1095 * @wma: wma handle
1096 * @ps_req: power save request
1097 *
1098 * Return: none
1099 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001100void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
1101
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -07001102void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001103
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301104QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001105
1106int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
1107 uint32_t len);
1108
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301109QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Jeff Johnson19ce8d02019-02-08 22:56:23 -08001110 struct tx_power_limit *ptxlim);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001111
1112void wma_update_noa(struct beacon_info *beacon,
1113 struct p2p_sub_element_noa *noa_ie);
1114
1115void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
1116 struct p2p_sub_element_noa *noa_ie);
1117
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001118void wma_process_set_mimops_req(tp_wma_handle wma_handle,
1119 tSetMIMOPS *mimops);
1120
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301121QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001122
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301123QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001124 tSirModemPowerStateInd *pReq);
1125
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301126QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001127 int value);
1128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001129/*
1130 * wma_data.c functions declarations
1131 */
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301132/**
1133 * wma_set_bss_rate_flags() - set rate flags based on BSS capability
1134 * @wma: pointer to wma handle
1135 * @vdev_id: vdev id
1136 * @add_bss: pointer to bss params
1137 *
1138 * Return: none
1139 */
Naveen Rawatfa2a1002018-05-17 16:06:37 -07001140void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
Jianmin Zhuf07aa512019-08-09 18:20:17 +08001141 struct bss_params *add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001142
1143int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
1144
Jiachao Wu08719b02017-07-05 13:05:34 +08001145/**
1146 * wma_check_txrx_chainmask() - check txrx chainmask
1147 * @num_rf_chains: number of rf chains
1148 * @cmd_value: command value
1149 *
1150 * Return: QDF_STATUS_SUCCESS for success or error code
1151 */
1152QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001153
1154int wma_peer_state_change_event_handler(void *handle,
1155 uint8_t *event_buff,
1156 uint32_t len);
1157
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301158QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001159 mcc_adaptive_scheduler);
1160
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301161QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001162 (tp_wma_handle wma,
1163 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
1164
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301165QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001166 (tp_wma_handle wma,
1167 uint32_t adapter_1_chan_number,
1168 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
1169
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301170/**
1171 * wma_process_rate_update_indate() - rate update indication
1172 * @wma: wma handle
1173 * @pRateUpdateParams: Rate update params
1174 *
1175 * This function update rate & short GI interval to fw based on params
1176 * send by SME.
1177 *
1178 * Return: QDF status
1179 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301180QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001181 tSirRateUpdateInd *
1182 pRateUpdateParams);
1183
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301184QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001185
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301186QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001187
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05301188#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
1189 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
1190
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301191/**
1192 * wma_mcc_vdev_tx_pause_evt_handler() - pause event handler
1193 * @handle: wma handle
1194 * @event: event buffer
1195 * @len: data length
1196 *
1197 * This function handle pause event from fw and pause/unpause
1198 * vdev.
1199 *
1200 * Return: 0 for success or error code.
1201 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001202int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
1203 uint32_t len);
1204#endif
1205
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05301206#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
1207QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
1208 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -07001209#else
1210static inline QDF_STATUS
1211wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
1212 struct t_bad_peer_txtcl_config *config)
1213{
1214 return QDF_STATUS_E_FAILURE;
1215}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05301216#endif
1217
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301218QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001219 t_thermal_mgmt *pThermalParams);
1220
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301221QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001222 uint8_t thermal_level);
1223
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301224QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001225 t_thermal_cmd_params thermal_info);
1226
1227int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
1228 uint32_t len);
1229
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001230int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
1231 uint32_t len);
1232
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001233/*
1234 * wma_utils.c functions declarations
1235 */
1236
1237#ifdef WLAN_FEATURE_STATS_EXT
Sravan Goud1f95d222020-01-17 14:41:15 -08001238/**
1239 * wma_stats_ext_event_handler() - extended stats event handler
1240 * @handle: wma handle
1241 * @event_buf: event buffer received from fw
1242 * @len: length of data
1243 *
1244 * Return: 0 for success or error code
1245 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001246int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
1247 uint32_t len);
1248#endif
1249
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -07001250enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001251int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001252
1253#ifdef WLAN_FEATURE_LINK_LAYER_STATS
1254void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
1255
Abhishek Ambure3ee80882019-09-20 16:32:12 +05301256/**
1257 * wma_process_ll_stats_clear_req() - clear link layer stats
1258 * @wma: wma handle
1259 * @clearReq: ll stats clear request command params
1260 *
1261 * Return: QDF_STATUS_SUCCESS for success or error code
1262 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301263QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
1265
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301266QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001267 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
1268
Abhishek Ambure3ee80882019-09-20 16:32:12 +05301269/**
1270 * wma_process_ll_stats_get_req() - link layer stats get request
1271 * @wma:wma handle
1272 * @getReq:ll stats get request command params
1273 *
1274 * Return: QDF_STATUS_SUCCESS for success or error code
1275 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301276QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -07001277 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001278
1279int wma_unified_link_iface_stats_event_handler(void *handle,
1280 uint8_t *cmd_param_info,
1281 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +08001282void wma_config_stats_ext_threshold(tp_wma_handle wma,
1283 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001284#endif
1285
1286void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
1287 uint8_t link_status);
1288
Abhishek Ambure0b2ea322019-09-23 19:25:39 +05301289/**
1290 * wma_link_status_event_handler() - link status event handler
1291 * @handle: wma handle
1292 * @cmd_param_info: data from event
1293 * @len: length
1294 *
1295 * Return: 0 for success or error code
1296 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001297int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
1298 uint32_t len);
1299
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05301300/**
1301 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
1302 * @wmi_event: WMI event
1303 *
1304 * This function is used to send RSO command status to upper layer
1305 *
1306 * Return: 0 for success
1307 */
1308int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
1309
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001310int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
1311 uint32_t len);
1312
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301313QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001314
1315int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
1316 uint32_t len);
1317
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301318QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001319
1320int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
1321 uint32_t len);
1322
Abhishek Ambure6a2773e2019-10-14 15:15:42 +05301323/**
1324 * wma_peer_phymode() - get phymode
1325 * @nw_type: nw type
1326 * @sta_type: sta type
1327 * @is_ht: is ht supported
1328 * @ch_width: supported channel width
1329 * @is_vht: is vht supported
1330 * @is_he: is HE supported
1331 *
1332 * Return: host phymode
1333 */
1334enum wlan_phymode
1335wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
1336 uint8_t is_ht, uint8_t ch_width,
1337 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001338
1339int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
1340 uint8_t vdev_id, uint32_t value);
1341
1342int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
1343 uint8_t vdev_id, uint32_t value);
1344
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001345/*
1346 * wma_features.c functions declarations
1347 */
1348
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08001349/**
1350 * wma_sar_register_event_handlers() - Register SAR event handlers
1351 * @handle: WMA Handle
1352 *
1353 * Function to be called during WMA initialization to register SAR
1354 * event handlers with WMI
1355 *
1356 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
1357 * an error enumeration
1358 */
1359QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
1360
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001361void wma_process_link_status_req(tp_wma_handle wma,
1362 tAniGetLinkStatus *pGetLinkStatus);
1363
Will Huanga9814592017-05-24 15:47:58 +08001364/**
1365 * wma_get_peer_info_ext() - get peer info
1366 * @handle: wma interface
1367 * @peer_info_req: get peer info request information
1368 *
1369 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
1370 *
1371 * Return: 0 on success, otherwise error value
1372 */
1373QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
1374 struct sir_peer_info_ext_req *peer_info_req);
1375
1376/**
guangde4853c402019-05-06 15:54:04 +08001377 * wma_get_isolation() - get antenna isolation
1378 * @handle: wma interface
1379 *
1380 * This function will send WMI_COEX_GET_ANTENNA_ISOLATION_CMDID to FW
1381 *
1382 * Return: 0 on success, otherwise error value
1383 */
1384QDF_STATUS wma_get_isolation(tp_wma_handle wma);
1385
1386/**
Will Huanga9814592017-05-24 15:47:58 +08001387 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
1388 * @handle: WMA global handle
1389 * @cmd_param_info: Command event data
1390 * @len: Length of cmd_param_info
1391 *
1392 * This function will handle WMI_PEER_STATS_INFO_EVENTID
1393 *
1394 * Return: 0 on success, error code otherwise
1395 */
1396int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
1397 u_int32_t len);
1398
Govind Singha471e5e2015-10-12 17:11:14 +05301399int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
1400 uint32_t len);
1401
Govind Singhf25a0f12016-03-08 16:09:48 +05301402QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +05301403 uint32_t cmd, uint32_t value1, uint32_t value2);
1404
Govind Singhd76a5b02016-03-08 15:12:14 +05301405int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001406
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001407#ifdef FEATURE_WLAN_TDLS
1408int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
1409#endif
1410
1411int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
1412
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001413#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -08001414int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1415 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001416#endif
1417
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001418#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301419QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001420 struct ath_pktlog_wmi_params *params);
1421#endif
1422
1423int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1424 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +08001425
1426int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
1427
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001428int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1429
Jeff Johnson256002f2018-12-22 17:53:19 -08001430void wma_del_ts_req(tp_wma_handle wma, struct del_ts_params *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001431
Jeff Johnson54024412018-12-22 12:07:06 -08001432/**
1433 * wma_aggr_qos_req() - send aggr qos request to fw
1434 * @wma: handle to wma
1435 * @pAggrQosRspMsg - combined struct for all ADD_TS requests.
1436 *
1437 * A function to handle WMA_AGGR_QOS_REQ. This will send out
1438 * ADD_TS requestes to firmware in loop for all the ACs with
1439 * active flow.
1440 *
1441 * Return: none
1442 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001443void wma_aggr_qos_req(tp_wma_handle wma,
Jeff Johnson54024412018-12-22 12:07:06 -08001444 struct aggr_add_ts_param *pAggrQosRspMsg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001445
Jeff Johnson9851fcc2018-12-22 17:29:58 -08001446void wma_add_ts_req(tp_wma_handle wma, struct add_ts_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001447
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001448#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301449QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001450 void *pTsmStatsMsg);
Jeff Johnson36583f02019-02-26 08:02:11 -08001451void wma_config_plm(tp_wma_handle wma, struct plm_req_params *plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001452#endif
1453
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301454QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1455 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001456QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1457
1458QDF_STATUS wma_process_get_peer_info_req
1459 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1460
1461QDF_STATUS wma_process_tx_fail_monitor_ind
1462 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1463
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301464#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001465QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1466
1467QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1468
1469QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301470#else
1471static inline
1472QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1473{
1474 return QDF_STATUS_SUCCESS;
1475}
1476
1477static inline
1478QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1479{
1480 return QDF_STATUS_SUCCESS;
1481}
1482
1483static inline
1484QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1485{
1486 return QDF_STATUS_SUCCESS;
1487}
1488#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001489
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301490QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Jeff Johnson6dcb44a2018-12-23 10:17:00 -08001491 tSirAddPeriodicTxPtrn *pattern);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001492
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301493QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001494 tSirDelPeriodicTxPtrn *
1495 pDelPeriodicTxPtrnParams);
1496
1497#ifdef WLAN_FEATURE_STATS_EXT
Sravan Goud1f95d222020-01-17 14:41:15 -08001498/**
1499 * wma_stats_ext_req() - request ext stats from fw
1500 * @wma_ptr: wma handle
1501 * @preq: stats ext params
1502 *
1503 * Return: QDF status
1504 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301505QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001506#endif
1507
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001508#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301509QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001510
1511int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1512 tpSirAppType1Params appType1Params);
1513
Himanshu Agarwal44195412016-03-09 13:03:54 +05301514QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001515 tpSirAppType2Params appType2Params);
1516#endif
1517
1518#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1519int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1520 uint32_t len);
1521
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08001522/**
1523 * wma_set_auto_shutdown_timer_req() - sets auto shutdown timer in firmware
1524 * @wma_handle: wma handle
1525 * @auto_sh_cmd: auto shutdown timer params
1526 *
1527 * Return: QDF status
1528 */
1529QDF_STATUS
1530wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
1531 struct auto_shutdown_cmd *auto_sh_cmd);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001532#endif
1533
Manikandan Mohan976e7562016-03-15 16:33:31 -07001534#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001535int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1536QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1537QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001538QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1539#else
1540static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1541 uint32_t vdev_id)
1542{
1543 return QDF_STATUS_SUCCESS;
1544}
1545
1546static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1547 uint32_t vdev_id)
1548{
1549 return QDF_STATUS_SUCCESS;
1550}
1551
1552static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1553 uint32_t data_len)
1554{
1555 return 0;
1556}
1557
1558static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1559{
1560 return QDF_STATUS_E_INVAL;
1561}
1562#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001563QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001564
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001565#ifdef DHCP_SERVER_OFFLOAD
Jeff Johnson8bfc29e2019-02-15 07:58:15 -08001566/**
1567 * wma_process_dhcpserver_offload() - enable DHCP server offload
1568 * @wma_handle: wma handle
1569 * @params: DHCP server offload information
1570 *
1571 * Return: QDF_STATUS_SUCCESS for success or error code
1572 */
1573QDF_STATUS
1574wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1575 struct dhcp_offload_info_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001576#endif
1577
1578#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301579QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001580 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001581#endif
1582
Kabilan Kannancaa85502018-04-13 18:04:58 -07001583/**
1584 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001585 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001586 * @event: event buffer
1587 * @len: buffer length
1588 *
1589 * Return: 0 for success or error code
1590 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001591int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001592
Nirav Shaheb017be2018-02-15 11:20:58 +05301593#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301594QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001595 tSirChAvoidUpdateReq *
1596 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301597#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001598
1599#ifdef FEATURE_WLAN_TDLS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001600int wma_update_tdls_peer_state(WMA_HANDLE handle,
Jeff Johnson517ee492019-02-07 11:59:04 -08001601 struct tdls_peer_update_state *peer_state);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602#endif
1603
Hong Shib90718f2017-02-20 00:57:22 +08001604void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001605void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1606
Qiwei Caie689a262018-07-26 15:50:22 +08001607#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001608int wma_rssi_breached_event_handler(void *handle,
1609 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001610#else /* FEATURE_RSSI_MONITOR */
1611static inline
1612int wma_rssi_breached_event_handler(void *handle,
1613 u_int8_t *cmd_param_info, u_int32_t len)
1614{
1615 return 0;
1616}
1617#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001618
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07001619QDF_STATUS wma_process_cfg_action_frm_tb_ppdu(tp_wma_handle wma,
1620 struct cfg_action_frm_tb_ppdu *cfg_info);
1621
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301622QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001623 struct vdev_ie_info *ie_info);
1624int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1625 uint32_t len);
1626
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001627int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1628 uint32_t len);
1629void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1630 uint8_t type);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301631
1632QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1633 struct sir_mac_pwr_dbg_cmd *
1634 sir_pwr_dbg_params);
1635
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301636/**
1637 * wma_lost_link_info_handler() - collect lost link information and inform SME
1638 * @wma: WMA handle
1639 * @vdev_id: vdev ID
1640 * @rssi: rssi at disconnection time
1641 *
1642 * Return: none
1643 */
1644void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1645 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301646int wma_unified_power_debug_stats_event_handler(void *handle,
1647 uint8_t *cmd_param_info, uint32_t len);
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05301648/**
1649 * wma_unified_beacon_debug_stats_event_handler() - collect beacon debug stats
1650 * @handle: WMA handle
1651 * @cmd_param_info: data from event
1652 * @len: length
1653 *
1654 * Return: 0 for success or error code
1655 */
1656int wma_unified_beacon_debug_stats_event_handler(void *handle,
1657 uint8_t *cmd_param_info,
1658 uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301659
1660#ifdef FEATURE_WLAN_DIAG_SUPPORT
1661/**
1662 * wma_sta_kickout_event()- send sta kickout event
1663 * @kickout_reason - reasoncode for kickout
Srinivas Girigowdaa47b45f2019-02-27 12:29:02 -08001664 * @macaddr[QDF_MAC_ADDR_SIZE]: Peer mac address
Sen, Devendra154b3c42017-02-13 20:44:15 +05301665 * @vdev_id: Unique id for identifying the VDEV
1666 *
1667 * This function sends sta kickout diag event
1668 *
1669 * Return: void.
1670 */
1671void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1672 uint8_t *macaddr);
1673#else
1674static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1675 uint8_t vdev_id, uint8_t *macaddr)
1676{
1677
1678};
1679#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1680
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001681/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301682 * wma_get_rcpi_req() - get rcpi request
1683 * @handle: wma handle
1684 * @rcpi_request: rcpi params
1685 *
1686 * Return: none
1687 */
1688QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1689 struct sme_rcpi_req *rcpi_request);
1690
1691/**
1692 * wma_rcpi_event_handler() - rcpi event handler
1693 * @handle: wma handle
1694 * @cmd_param_info: data from event
1695 * @len: length
1696 *
1697 * Return: 0 for success or error code
1698 */
1699int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1700 uint32_t len);
1701
1702/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001703 * wma_acquire_wakelock() - acquire the given wakelock
1704 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001705 * @msec: the wakelock duration in milliseconds
1706 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001707 * This also acquires the wma runtime pm lock.
1708 *
1709 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001710 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001711void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001712
1713/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001714 * wma_release_wakelock() - release the given wakelock
1715 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001716 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001717 * This also releases the wma runtime pm lock.
1718 *
1719 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001720 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001721void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001722
1723/**
1724 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001725 * @wma: a reference to the global WMA handle
1726 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001727 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001728 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1729 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001730 *
1731 * Return: QDF_STATUS
1732 */
1733QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1734
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301735int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1736
Dustin Brownec2c92e2017-07-26 11:13:49 -07001737/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001738 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1739 * @wma: a reference to the global WMA handle
1740 * @vdev_id: the Id of the vdev to down
1741 *
1742 * This also releases the vdev start wakelock.
1743 *
1744 * Return: QDF_STATUS
1745 */
1746QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1747
lifeng66831662017-05-19 16:01:35 +08001748/*
1749 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1750 * @handle: the wma handle
1751 * @event_buf: buffer with event
1752 * @len: buffer length
1753 *
1754 * This function receives rx aggregation failure event and then pass to upper
1755 * layer
1756 *
1757 * Return: 0 on success
1758 */
1759int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1760 u_int32_t len);
1761
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301762/**
1763 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1764 * @handle: the WMA handle
1765 * @event: buffer with the event parameters
1766 * @len: length of the buffer
1767 *
1768 * This function receives BT activity event from firmware and passes the event
1769 * information to upper layers
1770 *
1771 * Return: 0 on success
1772 */
1773int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1774 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001775
1776/**
lifengfe6c3e22018-04-03 12:10:04 +08001777 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001778 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001779 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001780 * @len: buffer length
1781 *
1782 * This function receives antenna info from firmware and passes the event
1783 * to upper layer
1784 *
1785 * Return: 0 on success
1786 */
lifengfe6c3e22018-04-03 12:10:04 +08001787int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001788 u_int32_t len);
1789
lifeng7c607dd2017-02-21 21:16:49 +08001790/**
1791 * wma_update_beacon_interval() - update beacon interval in fw
1792 * @wma: wma handle
1793 * @vdev_id: vdev id
1794 * @beaconInterval: becon interval
1795 *
1796 * Return: none
1797 */
1798void
1799wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1800 uint16_t beaconInterval);
1801
1802#define RESET_BEACON_INTERVAL_TIMEOUT 200
1803
1804struct wma_beacon_interval_reset_req {
1805 qdf_timer_t event_timeout;
1806 uint8_t vdev_id;
1807 uint16_t interval;
1808};
1809
1810/**
1811 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1812 * @wma: wma handle
1813 * @vdev_id: vdev id
1814 * @beacon_interval: beacon interval
1815 * @timeout: timeout val
1816 *
1817 * Return: status
1818 */
1819int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1820 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301821/*
1822 * wma_is_vdev_valid() - check the vdev status
1823 * @vdev_id: vdev identifier
1824 *
1825 * This function verifies the vdev validity
1826 *
1827 * Return: 'true' on valid vdev else 'false'
1828 */
1829bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001830
1831/**
1832 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1833 * @handle: the wma handle
1834 * @event: buffer with event
1835 * @len: buffer length
1836 *
1837 * This function receives obss detection info from firmware which is used to
1838 * decide obss protection.
1839 *
1840 * Return: 0 on success
1841 */
1842int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1843 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001844
1845/**
1846 * wma_vdev_bss_color_collision_info_handler - event handler to
1847 * handle obss color collision detection.
1848 * @handle: the wma handle
1849 * @event: buffer with event
1850 * @len: buffer length
1851 *
1852 * This function receives obss color collision detection info from firmware
1853 * which is used to select new bss color.
1854 *
1855 * Return: 0 on success
1856 */
1857int wma_vdev_bss_color_collision_info_handler(void *handle,
1858 uint8_t *event,
1859 uint32_t len);
1860
Kiran Kumar Lokere54819a32019-10-04 18:30:43 -07001861#ifdef WLAN_SUPPORT_TWT
1862/**
1863 * wma_twt_en_complete_event_handler - TWT enable complete event handler
1864 * @handle: wma handle
1865 * @event: buffer with event
1866 * @len: buffer length
1867 *
1868 * Return: 0 on success
1869 */
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001870int wma_twt_en_complete_event_handler(void *handle,
1871 uint8_t *event, uint32_t len);
Kiran Kumar Lokere54819a32019-10-04 18:30:43 -07001872
1873/**
1874 * wma_twt_disable_comp_event_handler- TWT disable complete event handler
1875 * @handle: wma handle
1876 * @event: buffer with event
1877 * @len: buffer length
1878 *
1879 * Return: 0 on success
1880 */
1881int wma_twt_disable_comp_event_handler(void *handle, uint8_t *event,
1882 uint32_t len);
1883#else
1884static inline int wma_twt_en_complete_event_handler(void *handle,
1885 uint8_t *event,
1886 uint32_t len)
1887{
1888 return 0;
1889}
1890
1891static inline int wma_twt_disable_comp_event_handler(void *handle,
1892 uint8_t *event,
1893 uint32_t len)
1894{
1895 return 0;
1896}
1897#endif
Abhishek Ambure6a2773e2019-10-14 15:15:42 +05301898
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301899/**
1900 * wma_get_roam_scan_stats() - Get roam scan stats request
1901 * @handle: wma handle
1902 * @req: request details
1903 *
1904 * Return: QDF_STATUS
1905 */
1906QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
1907 struct sir_roam_scan_stats *req);
1908
1909/**
1910 * wma_roam_scan_stats_event_handler() - roam scan stats event handler
1911 * @handle: wma handle
1912 * @event: event data
1913 * @len: length of data
1914 *
1915 * Return: Success or Failure status
1916 */
1917int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event,
1918 uint32_t len);
1919
Abhishek Singhcaa61852018-09-12 15:50:04 +05301920/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +05301921 * wma_send_vdev_down() - send del bss req to firmware
Abhishek Singhcaa61852018-09-12 15:50:04 +05301922 * @wma: wma handle.
Abhishek Ambure968f1512019-08-28 18:33:57 +05301923 * @req: pointer to del bss response
Abhishek Singhcaa61852018-09-12 15:50:04 +05301924 *
1925 * This function sends del bss resp to upper layer
1926 *
1927 * Return: none
1928 */
Abhishek Ambure968f1512019-08-28 18:33:57 +05301929void wma_send_vdev_down(tp_wma_handle wma, struct del_bss_resp *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +05301930
Yeshwanth Sriram Guntukafa9f3792019-02-28 18:24:58 +05301931/**
1932 * wma_cold_boot_cal_event_handler() - Cold boot cal event handler
1933 * @wma_ctx: wma handle
1934 * @event_buff: event data
1935 * @len: length of data
1936 *
1937 * Return: Success or Failure status
1938 */
1939int wma_cold_boot_cal_event_handler(void *wma_ctx, uint8_t *event_buff,
1940 uint32_t len);
Srinivas Dasarif4e1b122019-08-22 03:39:48 +05301941
Ashish Kumar Dhanotiyad8d7dea2019-10-24 14:34:56 +05301942#ifdef FEATURE_OEM_DATA
1943/**
1944 * wma_oem_event_handler() - oem data event handler
1945 * @wma_ctx: wma handle
1946 * @event_buff: event data
1947 * @len: length of event buffer
1948 *
1949 * Return: Success or Failure status
1950 */
1951int wma_oem_event_handler(void *wma_ctx, uint8_t *event_buff, uint32_t len);
1952#endif
1953
Srinivas Dasarif4e1b122019-08-22 03:39:48 +05301954/**
1955 * wma_set_roam_triggers() - Send roam trigger bitmap to WMI
1956 * @wma_handle: wma handle
1957 * @triggers: Carries vdev id and roam trigger bitmap.
1958 *
1959 * Return: Success or Failure status
1960 */
1961QDF_STATUS wma_set_roam_triggers(tp_wma_handle wma_handle,
1962 struct roam_triggers *triggers);
Sourav Mohapatra2a67b0e2019-10-15 17:59:59 +05301963
1964/**
1965 * wma_get_ani_level_evt_handler - event handler to fetch ani level
1966 * @handle: the wma handle
1967 * @event_buf: buffer with event
1968 * @len: buffer length
1969 *
1970 * This function receives ani level from firmware and passes the event
1971 * to upper layer
1972 *
1973 * Return: 0 on success
1974 */
1975int wma_get_ani_level_evt_handler(void *handle, uint8_t *event_buf,
1976 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001977#endif