blob: 3736fde09679ea7734c51f9a066e88092c724066 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Nachiket Kukade2c73ade2017-12-20 17:30:36 +05302 * Copyright (c) 2013-2018 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
34#define WOW_CSA_EVENT_OFFSET 12
35
36#define WMA_DEFAULT_SCAN_REQUESTER_ID 1
37#define WMI_SCAN_FINISH_EVENTS (WMI_SCAN_EVENT_START_FAILED | \
38 WMI_SCAN_EVENT_COMPLETED | \
39 WMI_SCAN_EVENT_DEQUEUED)
40/* default value */
41#define DEFAULT_INFRA_STA_KEEP_ALIVE_PERIOD 20
mukul sharma72c8b222015-09-04 17:02:01 +053042#define DEFAULT_STA_SA_QUERY_MAX_RETRIES_COUNT (5)
43#define DEFAULT_STA_SA_QUERY_RETRY_INTERVAL (200)
44
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045/* pdev vdev and peer stats*/
46#define FW_PDEV_STATS_SET 0x1
47#define FW_VDEV_STATS_SET 0x2
48#define FW_PEER_STATS_SET 0x4
Himanshu Agarwal37e42412016-07-21 14:35:09 +053049#define FW_RSSI_PER_CHAIN_STATS_SET 0x8
50#define FW_STATS_SET 0xf
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051
52/*AR9888/AR6320 noise floor approx value
53 * similar to the mentioned the WMA
54 */
55#define WMA_TGT_NOISE_FLOOR_DBM (-96)
Naveen Rawatf440a132017-05-05 12:27:39 -070056#define WMA_TGT_MAX_SNR (WMA_TGT_NOISE_FLOOR_DBM * (-1))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057
58/*
59 * Make sure that link monitor and keep alive
60 * default values should be in sync with CFG.
61 */
62#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
63#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
64
65#define AGC_DUMP 1
66#define CHAN_DUMP 2
67#define WD_DUMP 3
68#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
69#define PCIE_DUMP 4
70#endif
71
72/* conformance test limits */
73#define FCC 0x10
74#define MKK 0x40
75#define ETSI 0x30
76
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
78
79#define WMI_MCC_MIN_CHANNEL_QUOTA 20
80#define WMI_MCC_MAX_CHANNEL_QUOTA 80
81#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
82
83/* The maximum number of patterns that can be transmitted by the firmware
84 * and maximum patterns size.
85 */
jsreekumac44b922018-06-12 20:18:39 +053086#ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
jsreekumac44b922018-06-12 20:18:39 +053088#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089
90#define WMI_MAX_HOST_CREDITS 2
91#define WMI_WOW_REQUIRED_CREDITS 1
92
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080093#define WMI_MAX_MHF_ENTRIES 32
94
95
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080096#define MAX_HT_MCS_IDX 8
97#define MAX_VHT_MCS_IDX 10
98#define INVALID_MCS_IDX 255
99
100#define LINK_STATUS_LEGACY 0
101#define LINK_STATUS_VHT 0x1
102#define LINK_STATUS_MIMO 0x2
103#define LINK_SUPPORT_VHT 0x4
104#define LINK_SUPPORT_MIMO 0x8
105
106#define LINK_RATE_VHT 0x3
107
108#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -0700109#define MAX_ENTRY_VDEV_RESP_QUEUE 10
110
Krishna Kumaar Natarajanb7f9a352016-03-18 11:40:07 -0700111/* Time(in ms) to detect DOS attack */
112#define WMA_MGMT_FRAME_DETECT_DOS_TIMER 1000
113
Himanshu Agarwala1539d32017-10-11 18:08:56 +0530114#define MAX_NUM_HW_MODE 0xff
115#define MAX_NUM_PHY 0xff
116
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800117/**
118 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800119 * @mcs_index: mcs rate index
120 * @ht20_rate: HT20 supported rate table
121 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122 */
123struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800124 uint8_t mcs_index;
125 uint16_t ht20_rate[2];
126 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800127};
128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129/**
130 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800131 * @mcs_index: mcs rate index
132 * @ht20_rate: VHT20 supported rate table
133 * @ht40_rate: VHT40 supported rate table
134 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800135 */
136struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800137 uint8_t mcs_index;
138 uint16_t ht20_rate[2];
139 uint16_t ht40_rate[2];
140 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142
Jeff Johnsondab58602018-07-14 15:30:24 -0700143struct wifi_scan_cmd_req_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144/*
145 * wma_main.c functions declarations
146 */
147
148int
149wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
150 uint32_t param_value);
151
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530152/**
153 * wma_send_msg_by_priority() - Send wma message to PE with priority.
154 * @wma_handle: wma handle
155 * @msg_type: message type
156 * @body_ptr: message body ptr
157 * @body_val: message body value
158 * @is_high_priority: if msg is high priority
159 *
160 * Return: none
161 */
162void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
163 void *body_ptr, uint32_t body_val, bool is_high_priority);
164
165/**
166 * wma_send_msg() - Send wma message to PE.
167 * @wma_handle: wma handle
168 * @msg_type: message type
169 * @body_ptr: message body ptr
170 * @body_val: message body value
171 *
172 * Return: none
173 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
175 void *body_ptr, uint32_t body_val);
176
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530177/**
178 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
179 * @wma_handle: wma handle
180 * @msg_type: message type
181 * @body_ptr: message body ptr
182 * @body_val: message body value
183 *
184 * Return: none
185 */
186void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
187 void *body_ptr, uint32_t body_val);
188
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800189void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530190 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530192QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800193 int value);
194
195/*
196 * wma_scan_roam.c functions declarations
197 */
198
199#ifdef WLAN_FEATURE_ROAM_OFFLOAD
200void wma_process_roam_invoke(WMA_HANDLE handle,
201 struct wma_roam_invoke_cmd *roaminvoke);
202
203void wma_process_roam_synch_fail(WMA_HANDLE handle,
204 struct roam_offload_synch_fail *synch_fail);
205
206int wma_roam_synch_event_handler(void *handle, uint8_t *event,
207 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530208
209/**
210 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
211 * @handle: wma handle
212 * @event: event data
213 * @len: length of data
214 *
215 * This function is roam synch frame event handler.
216 *
217 * Return: Success or Failure status
218 */
219int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
220 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800221#endif
222
Kapil Gupta5cda2252016-12-29 18:44:26 +0530223/**
224 * wma_update_per_roam_config() -per roam config parameter updation to FW
225 * @handle: wma handle
226 * @req_buf: per roam config parameters
227 *
228 * Return: none
229 */
230void wma_update_per_roam_config(WMA_HANDLE handle,
231 struct wmi_per_roam_config_req *req_buf);
232
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530233QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 tSirUpdateChanList *chan_list);
235
236#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530237QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530238 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800239 roam_offload_params,
240 tSirRoamOffloadScanReq *roam_req);
241#endif
242
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530243QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244 wmi_start_scan_cmd_fixed_param *
245 scan_cmd_fp,
246 tSirRoamOffloadScanReq *roam_req,
247 uint32_t mode, uint32_t vdev_id);
248
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700249/**
250 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
251 * @wma_handle: wma handle
252 * @roam_req: roam request param
253 *
254 * Fill the MAWC roaming parameters and send
255 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
256 *
257 * Return: QDF status
258 */
259QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
260 tSirRoamOffloadScanReq *roam_req);
261
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530262QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263 tSirRoamOffloadScanReq *roam_req);
264
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530265QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 uint32_t scan_period,
267 uint32_t scan_age,
268 uint32_t vdev_id);
269
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530270QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 uint32_t vdev_id,
272 int32_t rssi_change_thresh,
273 uint32_t bcn_rssi_weight,
274 uint32_t hirssi_delay_btw_scans);
275
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530276QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 uint8_t chan_count,
278 uint8_t *chan_list,
279 uint8_t list_type, uint32_t vdev_id);
280
281A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
282 eCsrEncryptionType encr);
283
284A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
285
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800286void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
287 tpAniSirGlobal pMac,
288 tSirRoamOffloadScanReq *roam_req,
289 wmi_start_scan_cmd_fixed_param *
290 scan_params);
291
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530292QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293 A_INT32 first_bcnt,
294 A_UINT32 final_bcnt, uint32_t vdev_id);
295
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530296QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297 uint32_t command, uint32_t vdev_id);
298
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530299QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800300 tpSwitchChannelParams params,
301 uint8_t vdev_id);
302
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530303QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304 tpSwitchChannelParams params,
305 uint8_t vdev_id);
306
307void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
308 uint8_t vdev_id,
309 wmi_scan_event_fixed_param *
310 wmi_event);
311
312void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
313
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800314#ifdef WLAN_FEATURE_ROAM_OFFLOAD
315void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
316#endif
317
318#ifdef FEATURE_WLAN_EXTSCAN
319
320int wma_extscan_start_stop_event_handler(void *handle,
321 uint8_t *cmd_param_info,
322 uint32_t len);
323
324int wma_extscan_operations_event_handler(void *handle,
325 uint8_t *cmd_param_info,
326 uint32_t len);
327
328int wma_extscan_table_usage_event_handler(void *handle,
329 uint8_t *cmd_param_info,
330 uint32_t len);
331
332int wma_extscan_capabilities_event_handler(void *handle,
333 uint8_t *cmd_param_info,
334 uint32_t len);
335
336int wma_extscan_hotlist_match_event_handler(void *handle,
337 uint8_t *cmd_param_info,
338 uint32_t len);
339
340int wma_extscan_cached_results_event_handler(void *handle,
341 uint8_t *cmd_param_info,
342 uint32_t len);
343
344int wma_extscan_change_results_event_handler(void *handle,
345 uint8_t *cmd_param_info,
346 uint32_t len);
347
348int wma_passpoint_match_event_handler(void *handle,
349 uint8_t *cmd_param_info,
350 uint32_t len);
351
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#endif
353
Wen Gong7952fbd2018-04-18 11:27:23 +0800354#ifdef FEATURE_WLAN_EXTSCAN
355int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
356
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
358
Jeff Johnsondab58602018-07-14 15:30:24 -0700359/**
360 * wma_start_extscan() - start extscan command to fw.
361 * @wma: wma handle
362 * @params: extscan command request params
363 *
364 * This function sends start extscan request to fw.
365 *
366 * Return: QDF Status.
367 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530368QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Jeff Johnsondab58602018-07-14 15:30:24 -0700369 struct wifi_scan_cmd_req_params *pstart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800370
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530371QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800372 tSirExtScanStopReqParams *pstopcmd);
373
Jeff Johnson1148cb02018-07-13 23:14:32 -0700374/**
375 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
376 * @wma: wma handle
377 * @params: hotlist request params
378 *
379 * This function configures hotlist monitor in fw.
380 *
381 * Return: QDF status
382 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530383QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700384 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385
Jeff Johnson9743eb72018-07-14 10:30:04 -0700386/**
387 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
388 * @wma: wma handle
389 * @params: hotlist request params
390 *
391 * This function configures hotlist monitor to stop in fw.
392 *
393 * Return: QDF status
394 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530395QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700396 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800397
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700398/**
399 * wma_extscan_start_change_monitor() - send start change monitor cmd
400 * @wma: wma handle
401 * @params: change monitor request params
402 *
403 * This function sends start change monitor request to fw.
404 *
405 * Return: QDF status
406 */
407QDF_STATUS
408wma_extscan_start_change_monitor(tp_wma_handle wma,
409 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410
Jeff Johnson0c8dbc32018-07-16 22:10:48 -0700411/**
412 * wma_extscan_stop_change_monitor() - send stop change monitor cmd
413 * @wma: wma handle
414 * @params: change monitor request params
415 *
416 * This function sends stop change monitor request to fw.
417 *
418 * Return: QDF status
419 */
420QDF_STATUS
421wma_extscan_stop_change_monitor(tp_wma_handle wma,
422 struct extscan_capabilities_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423
Jeff Johnson2ba60092018-07-17 08:19:37 -0700424/**
425 * wma_extscan_get_cached_results() - extscan get cached results
426 * @wma: wma handle
427 * @params: cached results parameters
428 *
429 * This function send request to fw to get cached results.
430 *
431 * Return: QDF status
432 */
433QDF_STATUS
434wma_extscan_get_cached_results(tp_wma_handle wma,
435 struct extscan_cached_result_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800436
Jeff Johnsonfed9a732018-07-18 12:18:03 -0700437/**
438 * wma_extscan_get_capabilities() - extscan get capabilities
439 * @wma: wma handle
440 * @params: get capabilities params
441 *
442 * This function sends request to fw to get extscan capabilities.
443 *
444 * Return: QDF status
445 */
446QDF_STATUS
447wma_extscan_get_capabilities(tp_wma_handle wma,
448 struct extscan_capabilities_params *params);
449
Jeff Johnson360135b2018-07-18 20:51:47 -0700450/**
451 * wma_set_epno_network_list() - set epno network list
452 * @wma: WMA handle
453 * @req: epno config params request structure
454 *
455 * This function reads the incoming epno config request structure
456 * and constructs the WMI message to the firmware.
457 *
458 * Return: 0 on success, error number otherwise
459 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530460QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Jeff Johnson360135b2018-07-18 20:51:47 -0700461 struct wifi_enhanced_pno_params *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800462
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700463/**
464 * wma_set_passpoint_network_list() - set passpoint network list
465 * @wma: WMA handle
466 * @params: passpoint network request structure
467 *
468 * This function sends the passpoint configs down to the firmware
469 *
470 * Return: QDF_STATUS enumeration
471 */
472QDF_STATUS
473wma_set_passpoint_network_list(tp_wma_handle wma,
474 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800475
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700476/**
477 * wma_reset_passpoint_network_list() - reset passpoint network list
478 * @wma: WMA handle
479 * @params: passpoint network request structure
480 *
481 * This function sends down WMI command with network id set to wildcard id.
482 * firmware shall clear all the config entries
483 *
484 * Return: QDF_STATUS enumeration
485 */
486QDF_STATUS
487wma_reset_passpoint_network_list(tp_wma_handle wma,
488 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489#endif
490
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530491QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800492
493int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
494
495void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
496
497int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
498 uint32_t len);
499
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800500#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800501void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
502static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
503 uint8_t vdev_id)
504{
505 return wma->interfaces[vdev_id].roam_synch_in_progress;
506}
507#else
508static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
509 uint8_t vdev_id)
510{
511 return false;
512}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700513static inline uint32_t wma_roam_scan_get_cckm_mode(
514 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
515{
516 return WMI_AUTH_CCKM;
517}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800518#endif
519
520/*
521 * wma_dev_if.c functions declarations
522 */
523
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800524struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800525 uint8_t *vdev_id);
526
527/**
528 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
529 * @wma - wma handle
530 * @vdev_id - vdev ID
531 *
532 * Return: Returns vdev handle if given vdev id is valid.
533 * Otherwise returns NULL.
534 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800535static inline
536struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800537{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700538 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800539 return NULL;
540
541 return wma->interfaces[vdev_id].handle;
542}
543
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800544bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
545
546#ifdef QCA_IBSS_SUPPORT
547bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700548#else
549/**
550 * wma_is_vdev_in_ibss_mode(): dummy function
551 * @wma: wma handle
552 * @vdev_id: vdev id
553 *
554 * Return false since no vdev can be in ibss mode without ibss support
555 */
556static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700557bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700558{
559 return false;
560}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800561#endif
562
563/**
564 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
565 * @wma - wma handle
566 * @vdev_id - vdev ID
567 *
568 * Return: Returns pointer to bssid on success,
569 * otherwise returns NULL.
570 */
571static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
572 uint8_t vdev_id)
573{
574 if (vdev_id >= wma->max_bssid)
575 return NULL;
576
577 return wma->interfaces[vdev_id].bssid;
578}
579
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800580struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800581 uint8_t *vdev_id);
582
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530583QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800584 struct del_sta_self_params *pdel_sta_self_req_param,
585 uint8_t generateRsp);
586
587int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
588 uint32_t len);
589
Govind Singhd76a5b02016-03-08 15:12:14 +0530590QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800591 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800592void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700593 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800594 bool roam_synch_in_progress);
595
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800596QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
597 struct cdp_vdev *vdev,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700598 uint8_t peer_addr[IEEE80211_ADDR_LEN],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599 uint32_t peer_type, uint8_t vdev_id,
600 bool roam_synch_in_progress);
601
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530602/**
603 * wma_send_del_bss_response() - send delete bss resp
604 * @wma: wma handle
605 * @req: target request
606 *
607 * Return: none
608 */
609void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +0530610
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530611/**
Sandeep Puligilla2a7fa842018-10-02 01:00:56 -0700612 * wma_send_set_link_response() - send set link response
613 * @wma: wma handle
614 * @req: target request
615 *
616 * Return: none
617 */
618void wma_send_set_link_response(tp_wma_handle wma, struct wma_target_req *req);
619
620/**
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530621 * __wma_vdev_stop_resp_handler() - vdev stop response handler
622 * @handle: wma handle
623 * @cmd_param_info: event buffer
624 * @len: buffer length
625 *
626 * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code
627 */
628QDF_STATUS
629__wma_vdev_stop_resp_handler(wmi_vdev_stopped_event_fixed_param *resp_event);
630
631/**
632 * wma_vdev_stop_resp_handler() - vdev stop response handler
633 * @handle: wma handle
634 * @cmd_param_info: event buffer
635 * @len: buffer length
636 *
637 * Return: 0 for success or error code
638 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800639int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700640 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800641
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800642struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800643 struct add_sta_self_params *self_sta_req,
644 uint8_t generateRsp);
645
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700646QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
647 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800648
649void wma_vdev_resp_timer(void *data);
650
651struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
652 uint8_t vdev_id,
653 uint32_t msg_type, uint8_t type,
654 void *params, uint32_t timeout);
655
656void wma_hold_req_timer(void *data);
657struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
658 uint8_t vdev_id, uint32_t msg_type,
659 uint8_t type, void *params,
660 uint32_t timeout);
661
662void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
663 uint8_t type);
664
665void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
666
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800667void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
668
669void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
670
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800671void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
672
673int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
674
675void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
676 tpDisableIntraBssFwd pdis_intra_fwd);
677
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700678void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
679
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800680uint32_t wma_get_bcn_rate_code(uint16_t rate);
681
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800682/*
683 * wma_mgmt.c functions declarations
684 */
685
686int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
687
Krunal Sonibd7e8932018-10-03 11:14:51 -0700688int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
689 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800691int wma_unified_bcntx_status_event_handler(void *handle,
692 uint8_t *cmd_param_info,
693 uint32_t len);
694
mukul sharma72c8b222015-09-04 17:02:01 +0530695void wma_set_sta_sa_query_param(tp_wma_handle wma,
696 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697
698void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
699 uint32_t method, uint32_t timeperiod,
700 uint8_t *hostv4addr, uint8_t *destv4addr,
701 uint8_t *destmac);
702
703int wma_vdev_install_key_complete_event_handler(void *handle,
704 uint8_t *event,
705 uint32_t len);
706
Govind Singhb30d4c02016-03-24 11:01:23 +0530707QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 tSirNwType nw_type,
709 tpAddStaParams params);
710
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530711QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
712 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800713 gtx_config_t *gtx_info);
714
715void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
716 uint8_t llbcoexist);
717
718void wma_process_update_beacon_params(tp_wma_handle wma,
719 tUpdateBeaconParams *bcn_params);
720
Harprit Chhabadabec6de42018-09-10 10:21:15 -0700721void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
722
723void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800724
725void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
726
727void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
728 uint8_t vdev_id,
729 int8_t peer_num_delta);
730
731void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
732
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530733QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800734 tEdcaParams *edca_params);
735
736int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
737 uint32_t len);
738
739void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
740 tpSendProbeRespParams probe_rsp_info);
741
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530742/**
743 * wma_set_ap_vdev_up() - send vdev up req
744 * @wma: wma handle
745 * @vdev_id: vdev id
746 *
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530747 * Return: QDF_STATUS
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530748 */
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530749QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530750
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800751void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
752
753void wma_set_keepalive_req(tp_wma_handle wma,
754 tSirKeepAliveReq *keepalive);
755
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530756void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
757 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758
759void wma_process_update_opmode(tp_wma_handle wma_handle,
760 tUpdateVHTOpMode *update_vht_opmode);
761
762void wma_process_update_rx_nss(tp_wma_handle wma_handle,
763 tUpdateRxNss *update_rx_nss);
764
765void wma_process_update_membership(tp_wma_handle wma_handle,
766 tUpdateMembership *membership);
767
768void wma_process_update_userpos(tp_wma_handle wma_handle,
769 tUpdateUserPos *userpos);
770
771void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
772 tHalHiddenSsidVdevRestart *pReq);
773
774/*
775 * wma_power.c functions declarations
776 */
777
778void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
779
Govind Singhd76a5b02016-03-08 15:12:14 +0530780QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800781 uint32_t vdev_id, uint32_t param,
782 uint32_t value);
783
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530784QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800785wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
786
Govind Singhd76a5b02016-03-08 15:12:14 +0530787QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800788 uint8_t *peer_addr, uint8_t uapsd_value,
789 uint8_t max_sp);
790
791void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800792 struct wmi_host_wme_vparams *wmm_param,
793 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800794
795void wma_set_tx_power(WMA_HANDLE handle,
796 tMaxTxPowerParams *tx_pwr_params);
797
798void wma_set_max_tx_power(WMA_HANDLE handle,
799 tMaxTxPowerParams *tx_pwr_params);
800
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800801void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
802
803void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
804
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700805void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800806
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530807QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800808
809int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
810 uint32_t len);
811
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530812QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800813 tSirTxPowerLimit *ptxlim);
814
815void wma_update_noa(struct beacon_info *beacon,
816 struct p2p_sub_element_noa *noa_ie);
817
818void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
819 struct p2p_sub_element_noa *noa_ie);
820
821int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
822 uint32_t len);
823
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800824void wma_process_set_mimops_req(tp_wma_handle wma_handle,
825 tSetMIMOPS *mimops);
826
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530827QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800828
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530829QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830 tSirModemPowerStateInd *pReq);
831
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530832QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 int value);
834
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800835/*
836 * wma_data.c functions declarations
837 */
838
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700839void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
840 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800841
842int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
843
Jiachao Wu08719b02017-07-05 13:05:34 +0800844/**
845 * wma_check_txrx_chainmask() - check txrx chainmask
846 * @num_rf_chains: number of rf chains
847 * @cmd_value: command value
848 *
849 * Return: QDF_STATUS_SUCCESS for success or error code
850 */
851QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800852
853int wma_peer_state_change_event_handler(void *handle,
854 uint8_t *event_buff,
855 uint32_t len);
856
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530857QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800858 mcc_adaptive_scheduler);
859
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530860QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800861 (tp_wma_handle wma,
862 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
863
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530864QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800865 (tp_wma_handle wma,
866 uint32_t adapter_1_chan_number,
867 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
868
869void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
870
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530871QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800872 tSirRateUpdateInd *
873 pRateUpdateParams);
874
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530875QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800876
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530877QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800878
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530879#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
880 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
881
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800882int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
883 uint32_t len);
884#endif
885
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530886#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
887QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
888 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700889#else
890static inline QDF_STATUS
891wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
892 struct t_bad_peer_txtcl_config *config)
893{
894 return QDF_STATUS_E_FAILURE;
895}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530896#endif
897
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530898QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800899 t_thermal_mgmt *pThermalParams);
900
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530901QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800902 uint8_t thermal_level);
903
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530904QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800905 t_thermal_cmd_params thermal_info);
906
907int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
908 uint32_t len);
909
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800910int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
911 uint32_t len);
912
913int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
914 uint32_t len);
915
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800916/*
917 * wma_utils.c functions declarations
918 */
919
920#ifdef WLAN_FEATURE_STATS_EXT
921int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
922 uint32_t len);
923#endif
924
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700925enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800926int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800927
928#ifdef WLAN_FEATURE_LINK_LAYER_STATS
929void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
930
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530931QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800932 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
933
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530934QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
936
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530937QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700938 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800939
940int wma_unified_link_iface_stats_event_handler(void *handle,
941 uint8_t *cmd_param_info,
942 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800943void wma_config_stats_ext_threshold(tp_wma_handle wma,
944 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800945#endif
946
947void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
948 uint8_t link_status);
949
950int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
951 uint32_t len);
952
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530953/**
954 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
955 * @wmi_event: WMI event
956 *
957 * This function is used to send RSO command status to upper layer
958 *
959 * Return: 0 for success
960 */
961int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
962
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800963int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
964 uint32_t len);
965
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530966QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800967
968int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
969 uint32_t len);
970
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530971QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800972
973int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
974 uint32_t len);
975
976bool wma_is_sap_active(tp_wma_handle wma_handle);
977
978bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
979
980bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
981
982bool wma_is_sta_active(tp_wma_handle wma_handle);
983
984WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
985 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800986 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800987
988int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
989 uint8_t vdev_id, uint32_t value);
990
991int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
992 uint8_t vdev_id, uint32_t value);
993
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700994#ifdef QCA_SUPPORT_CP_STATS
995static inline void wma_get_stats_req(WMA_HANDLE handle,
996 struct sAniGetPEStatsReq *get_stats_param) {}
997#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800998void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700999 struct sAniGetPEStatsReq *get_stats_param);
1000#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001/*
1002 * wma_features.c functions declarations
1003 */
1004
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08001005/**
1006 * wma_sar_register_event_handlers() - Register SAR event handlers
1007 * @handle: WMA Handle
1008 *
1009 * Function to be called during WMA initialization to register SAR
1010 * event handlers with WMI
1011 *
1012 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
1013 * an error enumeration
1014 */
1015QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
1016
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001017void wma_process_link_status_req(tp_wma_handle wma,
1018 tAniGetLinkStatus *pGetLinkStatus);
1019
Will Huanga9814592017-05-24 15:47:58 +08001020QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
1021 struct sir_peer_info_req *peer_info_req);
1022
1023/**
1024 * wma_get_peer_info_ext() - get peer info
1025 * @handle: wma interface
1026 * @peer_info_req: get peer info request information
1027 *
1028 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
1029 *
1030 * Return: 0 on success, otherwise error value
1031 */
1032QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
1033 struct sir_peer_info_ext_req *peer_info_req);
1034
1035/**
1036 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
1037 * @handle: WMA global handle
1038 * @cmd_param_info: Command event data
1039 * @len: Length of cmd_param_info
1040 *
1041 * This function will handle WMI_PEER_STATS_INFO_EVENTID
1042 *
1043 * Return: 0 on success, error code otherwise
1044 */
1045int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
1046 u_int32_t len);
1047
Govind Singha471e5e2015-10-12 17:11:14 +05301048int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
1049 uint32_t len);
1050
Govind Singhf25a0f12016-03-08 16:09:48 +05301051QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +05301052 uint32_t cmd, uint32_t value1, uint32_t value2);
1053
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001054void wma_wow_tx_complete(void *wma);
1055
Govind Singhd76a5b02016-03-08 15:12:14 +05301056int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001057
1058#ifdef WLAN_FEATURE_NAN
1059int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
1060#endif
1061
1062#ifdef FEATURE_WLAN_TDLS
1063int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
1064#endif
1065
1066int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
1067
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001068#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -08001069int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1070 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001071#endif
1072
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301074QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001075 struct ath_pktlog_wmi_params *params);
1076#endif
1077
1078int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1079 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +08001080
1081int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
1082
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001083int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1084
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001085void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
1086
1087void wma_aggr_qos_req(tp_wma_handle wma,
1088 tAggrAddTsParams *pAggrQosRspMsg);
1089
1090void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
1091
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001092#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301093QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001094 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001095QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
1096QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
1097void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001098#endif
1099
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301100QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1101 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001102QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1103
1104QDF_STATUS wma_process_get_peer_info_req
1105 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1106
1107QDF_STATUS wma_process_tx_fail_monitor_ind
1108 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1109
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301110#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001111QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1112
1113QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1114
1115QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301116#else
1117static inline
1118QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1119{
1120 return QDF_STATUS_SUCCESS;
1121}
1122
1123static inline
1124QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1125{
1126 return QDF_STATUS_SUCCESS;
1127}
1128
1129static inline
1130QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1131{
1132 return QDF_STATUS_SUCCESS;
1133}
1134#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001135
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301136QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001137 tSirAddPeriodicTxPtrn *
1138 pAddPeriodicTxPtrnParams);
1139
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301140QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001141 tSirDelPeriodicTxPtrn *
1142 pDelPeriodicTxPtrnParams);
1143
1144#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301145QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001146#endif
1147
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301148QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1149 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001150
1151#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301152QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001153
1154int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1155 tpSirAppType1Params appType1Params);
1156
Himanshu Agarwal44195412016-03-09 13:03:54 +05301157QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001158 tpSirAppType2Params appType2Params);
1159#endif
1160
1161#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1162int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1163 uint32_t len);
1164
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301165QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001166 tSirAutoShutdownCmdParams *
1167 auto_sh_cmd);
1168#endif
1169
Manikandan Mohan976e7562016-03-15 16:33:31 -07001170#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001171int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1172QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1173QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001174QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1175#else
1176static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1177 uint32_t vdev_id)
1178{
1179 return QDF_STATUS_SUCCESS;
1180}
1181
1182static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1183 uint32_t vdev_id)
1184{
1185 return QDF_STATUS_SUCCESS;
1186}
1187
1188static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1189 uint32_t data_len)
1190{
1191 return 0;
1192}
1193
1194static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1195{
1196 return QDF_STATUS_E_INVAL;
1197}
1198#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001199QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001201#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301202QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001203#endif
1204
1205#ifdef DHCP_SERVER_OFFLOAD
1206int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1207 tSirDhcpSrvOffloadInfo *
1208 pDhcpSrvOffloadInfo);
1209#endif
1210
1211#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301212QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001213 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001214#endif
1215
Kabilan Kannancaa85502018-04-13 18:04:58 -07001216/**
1217 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001218 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001219 * @event: event buffer
1220 * @len: buffer length
1221 *
1222 * Return: 0 for success or error code
1223 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001224int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001225
Nirav Shaheb017be2018-02-15 11:20:58 +05301226#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301227QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001228 tSirChAvoidUpdateReq *
1229 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301230#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001231
1232#ifdef FEATURE_WLAN_TDLS
1233
Himanshu Agarwal44195412016-03-09 13:03:54 +05301234QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001235int wma_update_tdls_peer_state(WMA_HANDLE handle,
1236 tTdlsPeerStateParams *peerStateParams);
1237/**
1238 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1239 * @handle: wma handle
1240 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1241 *
1242 * This function sets tdls off channel mode
1243 *
1244 * Return: 0 on success; negative errno otherwise
1245 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301246QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001247 tdls_chan_switch_params *chan_switch_params);
1248#endif
1249
Hong Shib90718f2017-02-20 00:57:22 +08001250void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001251void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1252
Qiwei Caie689a262018-07-26 15:50:22 +08001253#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001254int wma_rssi_breached_event_handler(void *handle,
1255 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001256#else /* FEATURE_RSSI_MONITOR */
1257static inline
1258int wma_rssi_breached_event_handler(void *handle,
1259 u_int8_t *cmd_param_info, u_int32_t len)
1260{
1261 return 0;
1262}
1263#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301265QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001266 struct vdev_ie_info *ie_info);
1267int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1268 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001269int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1270 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001271
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001272int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1273 uint32_t len);
1274void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1275 uint8_t type);
Rachit Kankane026e77a2018-07-31 16:21:09 +05301276#ifdef FEATURE_P2P_LISTEN_OFFLOAD
Peng Xu8fdaa492016-06-22 10:20:47 -07001277int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1278 uint32_t len);
Rachit Kankane026e77a2018-07-31 16:21:09 +05301279#endif
Manjeet Singhf82ed072016-07-08 11:40:00 +05301280
1281QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1282 struct sir_mac_pwr_dbg_cmd *
1283 sir_pwr_dbg_params);
1284
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301285/**
1286 * wma_lost_link_info_handler() - collect lost link information and inform SME
1287 * @wma: WMA handle
1288 * @vdev_id: vdev ID
1289 * @rssi: rssi at disconnection time
1290 *
1291 * Return: none
1292 */
1293void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1294 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301295int wma_unified_power_debug_stats_event_handler(void *handle,
1296 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301297
1298#ifdef FEATURE_WLAN_DIAG_SUPPORT
1299/**
1300 * wma_sta_kickout_event()- send sta kickout event
1301 * @kickout_reason - reasoncode for kickout
1302 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1303 * @vdev_id: Unique id for identifying the VDEV
1304 *
1305 * This function sends sta kickout diag event
1306 *
1307 * Return: void.
1308 */
1309void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1310 uint8_t *macaddr);
1311#else
1312static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1313 uint8_t vdev_id, uint8_t *macaddr)
1314{
1315
1316};
1317#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1318
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001319/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301320 * wma_get_rcpi_req() - get rcpi request
1321 * @handle: wma handle
1322 * @rcpi_request: rcpi params
1323 *
1324 * Return: none
1325 */
1326QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1327 struct sme_rcpi_req *rcpi_request);
1328
1329/**
1330 * wma_rcpi_event_handler() - rcpi event handler
1331 * @handle: wma handle
1332 * @cmd_param_info: data from event
1333 * @len: length
1334 *
1335 * Return: 0 for success or error code
1336 */
1337int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1338 uint32_t len);
1339
1340/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001341 * wma_acquire_wakelock() - acquire the given wakelock
1342 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001343 * @msec: the wakelock duration in milliseconds
1344 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001345 * This also acquires the wma runtime pm lock.
1346 *
1347 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001348 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001349void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001350
1351/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001352 * wma_release_wakelock() - release the given wakelock
1353 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001354 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001355 * This also releases the wma runtime pm lock.
1356 *
1357 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001358 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001359void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001360
1361/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001362 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001363 * @wma: a reference to the global WMA handle
1364 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001365 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001366 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1367 * response from firmware to avoid power penalties. Alternatively, calling the
1368 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001369 *
1370 * Return: QDF_STATUS
1371 */
1372QDF_STATUS
1373wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1374
1375/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001376 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001377 * @wma: a reference to the global WMA handle
1378 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001379 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001380 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1381 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001382 *
1383 * Return: QDF_STATUS
1384 */
1385QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1386
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301387int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1388
Dustin Brownec2c92e2017-07-26 11:13:49 -07001389/**
1390 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1391 * @wma: a reference to the global WMA handle
1392 * @params: the vdev up params to send to firmware
1393 * @bssid: the BssId to send to firmware
1394 *
1395 * This also releases the vdev start wakelock.
1396 *
1397 * Return: QDF_STATUS
1398 */
1399QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1400 struct vdev_up_params *params,
1401 uint8_t bssid[IEEE80211_ADDR_LEN]);
1402
1403/**
1404 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1405 * @wma: a reference to the global WMA handle
1406 * @vdev_id: the Id of the vdev to down
1407 *
1408 * This also releases the vdev start wakelock.
1409 *
1410 * Return: QDF_STATUS
1411 */
1412QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1413
lifeng66831662017-05-19 16:01:35 +08001414/*
1415 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1416 * @handle: the wma handle
1417 * @event_buf: buffer with event
1418 * @len: buffer length
1419 *
1420 * This function receives rx aggregation failure event and then pass to upper
1421 * layer
1422 *
1423 * Return: 0 on success
1424 */
1425int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1426 u_int32_t len);
1427
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301428/**
1429 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1430 * @handle: the WMA handle
1431 * @event: buffer with the event parameters
1432 * @len: length of the buffer
1433 *
1434 * This function receives BT activity event from firmware and passes the event
1435 * information to upper layers
1436 *
1437 * Return: 0 on success
1438 */
1439int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1440 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001441
1442/**
lifengfe6c3e22018-04-03 12:10:04 +08001443 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001444 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001445 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001446 * @len: buffer length
1447 *
1448 * This function receives antenna info from firmware and passes the event
1449 * to upper layer
1450 *
1451 * Return: 0 on success
1452 */
lifengfe6c3e22018-04-03 12:10:04 +08001453int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001454 u_int32_t len);
1455
lifeng7c607dd2017-02-21 21:16:49 +08001456/**
1457 * wma_update_beacon_interval() - update beacon interval in fw
1458 * @wma: wma handle
1459 * @vdev_id: vdev id
1460 * @beaconInterval: becon interval
1461 *
1462 * Return: none
1463 */
1464void
1465wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1466 uint16_t beaconInterval);
1467
1468#define RESET_BEACON_INTERVAL_TIMEOUT 200
1469
1470struct wma_beacon_interval_reset_req {
1471 qdf_timer_t event_timeout;
1472 uint8_t vdev_id;
1473 uint16_t interval;
1474};
1475
1476/**
1477 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1478 * @wma: wma handle
1479 * @vdev_id: vdev id
1480 * @beacon_interval: beacon interval
1481 * @timeout: timeout val
1482 *
1483 * Return: status
1484 */
1485int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1486 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301487/*
1488 * wma_is_vdev_valid() - check the vdev status
1489 * @vdev_id: vdev identifier
1490 *
1491 * This function verifies the vdev validity
1492 *
1493 * Return: 'true' on valid vdev else 'false'
1494 */
1495bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001496
1497/**
1498 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1499 * @handle: the wma handle
1500 * @event: buffer with event
1501 * @len: buffer length
1502 *
1503 * This function receives obss detection info from firmware which is used to
1504 * decide obss protection.
1505 *
1506 * Return: 0 on success
1507 */
1508int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1509 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001510
1511/**
1512 * wma_vdev_bss_color_collision_info_handler - event handler to
1513 * handle obss color collision detection.
1514 * @handle: the wma handle
1515 * @event: buffer with event
1516 * @len: buffer length
1517 *
1518 * This function receives obss color collision detection info from firmware
1519 * which is used to select new bss color.
1520 *
1521 * Return: 0 on success
1522 */
1523int wma_vdev_bss_color_collision_info_handler(void *handle,
1524 uint8_t *event,
1525 uint32_t len);
1526
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001527int wma_twt_en_complete_event_handler(void *handle,
1528 uint8_t *event, uint32_t len);
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301529/**
1530 * wma_get_roam_scan_stats() - Get roam scan stats request
1531 * @handle: wma handle
1532 * @req: request details
1533 *
1534 * Return: QDF_STATUS
1535 */
1536QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
1537 struct sir_roam_scan_stats *req);
1538
1539/**
1540 * wma_roam_scan_stats_event_handler() - roam scan stats event handler
1541 * @handle: wma handle
1542 * @event: event data
1543 * @len: length of data
1544 *
1545 * Return: Success or Failure status
1546 */
1547int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event,
1548 uint32_t len);
1549
Abhishek Singhcaa61852018-09-12 15:50:04 +05301550/**
1551 * wma_send_del_bss_response() - send del bss resp to upper layer
1552 * @wma: wma handle.
1553 * @vdev_id: vdev ID of device for which MCC has to be checked
1554 *
1555 * This function sends del bss resp to upper layer
1556 *
1557 * Return: none
1558 */
1559void wma_send_vdev_down_bss(tp_wma_handle wma, struct wma_target_req *req);
1560
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001561/**
1562 * wma_sta_send_vdev_down_bss() - send vdev down to firmware
1563 * @wma: wma handle.
1564 * @req: vdev request
1565 *
1566 * This function sends vdev down to firmware
1567 *
1568 * Return: none
1569 */
1570void wma_sta_send_vdev_down_bss(tp_wma_handle wma, struct wma_target_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001571#endif