blob: da8285071dc2687059837e04e9fade8cc449eff9 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Rajeev Kumar416b73f2017-01-21 16:45:21 -08002 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WMA_INTERNAL_H
29#define WMA_INTERNAL_H
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080030#include <cdp_txrx_handle.h>
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070031#if !defined(REMOVE_PKT_LOG)
32#include "pktlog_ac.h"
33#endif
34
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035/* ################### defines ################### */
36/*
37 * TODO: Following constant should be shared by firwmare in
38 * wmi_unified.h. This will be done once wmi_unified.h is updated.
39 */
40#define WMI_PEER_STATE_AUTHORIZED 0x2
41
42#define WMA_2_4_GHZ_MAX_FREQ 3000
43#define WOW_CSA_EVENT_OFFSET 12
44
45#define WMA_DEFAULT_SCAN_REQUESTER_ID 1
46#define WMI_SCAN_FINISH_EVENTS (WMI_SCAN_EVENT_START_FAILED | \
47 WMI_SCAN_EVENT_COMPLETED | \
48 WMI_SCAN_EVENT_DEQUEUED)
49/* default value */
50#define DEFAULT_INFRA_STA_KEEP_ALIVE_PERIOD 20
mukul sharma72c8b222015-09-04 17:02:01 +053051#define DEFAULT_STA_SA_QUERY_MAX_RETRIES_COUNT (5)
52#define DEFAULT_STA_SA_QUERY_RETRY_INTERVAL (200)
53
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054/* pdev vdev and peer stats*/
55#define FW_PDEV_STATS_SET 0x1
56#define FW_VDEV_STATS_SET 0x2
57#define FW_PEER_STATS_SET 0x4
Himanshu Agarwal37e42412016-07-21 14:35:09 +053058#define FW_RSSI_PER_CHAIN_STATS_SET 0x8
59#define FW_STATS_SET 0xf
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060
61/*AR9888/AR6320 noise floor approx value
62 * similar to the mentioned the WMA
63 */
64#define WMA_TGT_NOISE_FLOOR_DBM (-96)
Naveen Rawatf440a132017-05-05 12:27:39 -070065#define WMA_TGT_MAX_SNR (WMA_TGT_NOISE_FLOOR_DBM * (-1))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080066
67/*
68 * Make sure that link monitor and keep alive
69 * default values should be in sync with CFG.
70 */
71#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
72#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
73
74#define AGC_DUMP 1
75#define CHAN_DUMP 2
76#define WD_DUMP 3
77#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
78#define PCIE_DUMP 4
79#endif
80
81/* conformance test limits */
82#define FCC 0x10
83#define MKK 0x40
84#define ETSI 0x30
85
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080086#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
87
88#define WMI_MCC_MIN_CHANNEL_QUOTA 20
89#define WMI_MCC_MAX_CHANNEL_QUOTA 80
90#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
91
92/* The maximum number of patterns that can be transmitted by the firmware
93 * and maximum patterns size.
94 */
95#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
96
97#define WMI_MAX_HOST_CREDITS 2
98#define WMI_WOW_REQUIRED_CREDITS 1
99
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800100#define WMI_MAX_MHF_ENTRIES 32
101
102
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800103#define MAX_HT_MCS_IDX 8
104#define MAX_VHT_MCS_IDX 10
105#define INVALID_MCS_IDX 255
106
107#define LINK_STATUS_LEGACY 0
108#define LINK_STATUS_VHT 0x1
109#define LINK_STATUS_MIMO 0x2
110#define LINK_SUPPORT_VHT 0x4
111#define LINK_SUPPORT_MIMO 0x8
112
113#define LINK_RATE_VHT 0x3
114
115#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -0700116#define MAX_ENTRY_VDEV_RESP_QUEUE 10
117
Krishna Kumaar Natarajanb7f9a352016-03-18 11:40:07 -0700118/* Time(in ms) to detect DOS attack */
119#define WMA_MGMT_FRAME_DETECT_DOS_TIMER 1000
120
Himanshu Agarwala1539d32017-10-11 18:08:56 +0530121#define MAX_NUM_HW_MODE 0xff
122#define MAX_NUM_PHY 0xff
123
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800124/**
125 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800126 * @mcs_index: mcs rate index
127 * @ht20_rate: HT20 supported rate table
128 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129 */
130struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800131 uint8_t mcs_index;
132 uint16_t ht20_rate[2];
133 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800134};
135
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800136/**
137 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800138 * @mcs_index: mcs rate index
139 * @ht20_rate: VHT20 supported rate table
140 * @ht40_rate: VHT40 supported rate table
141 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142 */
143struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800144 uint8_t mcs_index;
145 uint16_t ht20_rate[2];
146 uint16_t ht40_rate[2];
147 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800148};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800149
150/*
151 * wma_main.c functions declarations
152 */
153
154int
155wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
156 uint32_t param_value);
157
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530158/**
159 * wma_send_msg_by_priority() - Send wma message to PE with priority.
160 * @wma_handle: wma handle
161 * @msg_type: message type
162 * @body_ptr: message body ptr
163 * @body_val: message body value
164 * @is_high_priority: if msg is high priority
165 *
166 * Return: none
167 */
168void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
169 void *body_ptr, uint32_t body_val, bool is_high_priority);
170
171/**
172 * wma_send_msg() - Send wma message to PE.
173 * @wma_handle: wma handle
174 * @msg_type: message type
175 * @body_ptr: message body ptr
176 * @body_val: message body value
177 *
178 * Return: none
179 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800180void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
181 void *body_ptr, uint32_t body_val);
182
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530183/**
184 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
185 * @wma_handle: wma handle
186 * @msg_type: message type
187 * @body_ptr: message body ptr
188 * @body_val: message body value
189 *
190 * Return: none
191 */
192void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
193 void *body_ptr, uint32_t body_val);
194
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800195void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530196 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800197
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530198QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199 int value);
200
201/*
202 * wma_scan_roam.c functions declarations
203 */
204
205#ifdef WLAN_FEATURE_ROAM_OFFLOAD
206void wma_process_roam_invoke(WMA_HANDLE handle,
207 struct wma_roam_invoke_cmd *roaminvoke);
208
209void wma_process_roam_synch_fail(WMA_HANDLE handle,
210 struct roam_offload_synch_fail *synch_fail);
211
212int wma_roam_synch_event_handler(void *handle, uint8_t *event,
213 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530214
215/**
216 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
217 * @handle: wma handle
218 * @event: event data
219 * @len: length of data
220 *
221 * This function is roam synch frame event handler.
222 *
223 * Return: Success or Failure status
224 */
225int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
226 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800227#endif
228
Kapil Gupta5cda2252016-12-29 18:44:26 +0530229/**
230 * wma_update_per_roam_config() -per roam config parameter updation to FW
231 * @handle: wma handle
232 * @req_buf: per roam config parameters
233 *
234 * Return: none
235 */
236void wma_update_per_roam_config(WMA_HANDLE handle,
237 struct wmi_per_roam_config_req *req_buf);
238
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530239QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800240 tSirScanOffloadReq *scan_req,
Sandeep Puligilla1fcdb772017-02-22 21:14:59 -0800241 struct scan_req_params *cmd);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800242
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530243QDF_STATUS wma_get_buf_stop_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244 wmi_buf_t *buf,
245 int *buf_len,
246 tAbortScanParams *abort_scan_req);
247
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530248QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800249 tSirScanOffloadReq *scan_req, uint16_t msg_type);
250
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530251QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800252 tAbortScanParams *abort_scan_req);
253
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530254QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800255 tSirUpdateChanList *chan_list);
256
257#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530258QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530259 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800260 roam_offload_params,
261 tSirRoamOffloadScanReq *roam_req);
262#endif
263
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530264QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265 wmi_start_scan_cmd_fixed_param *
266 scan_cmd_fp,
267 tSirRoamOffloadScanReq *roam_req,
268 uint32_t mode, uint32_t vdev_id);
269
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700270/**
271 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
272 * @wma_handle: wma handle
273 * @roam_req: roam request param
274 *
275 * Fill the MAWC roaming parameters and send
276 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
277 *
278 * Return: QDF status
279 */
280QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
281 tSirRoamOffloadScanReq *roam_req);
282
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530283QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800284 tSirRoamOffloadScanReq *roam_req);
285
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530286QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800287 uint32_t scan_period,
288 uint32_t scan_age,
289 uint32_t vdev_id);
290
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530291QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800292 uint32_t vdev_id,
293 int32_t rssi_change_thresh,
294 uint32_t bcn_rssi_weight,
295 uint32_t hirssi_delay_btw_scans);
296
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530297QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800298 uint8_t chan_count,
299 uint8_t *chan_list,
300 uint8_t list_type, uint32_t vdev_id);
301
302A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
303 eCsrEncryptionType encr);
304
305A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
306
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800307void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
308 tpAniSirGlobal pMac,
309 tSirRoamOffloadScanReq *roam_req,
310 wmi_start_scan_cmd_fixed_param *
311 scan_params);
312
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530313QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800314 A_INT32 first_bcnt,
315 A_UINT32 final_bcnt, uint32_t vdev_id);
316
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530317QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800318 uint32_t command, uint32_t vdev_id);
319
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530320QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800321 tpSwitchChannelParams params,
322 uint8_t vdev_id);
323
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530324QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800325 tpSwitchChannelParams params,
326 uint8_t vdev_id);
327
328void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
329 uint8_t vdev_id,
330 wmi_scan_event_fixed_param *
331 wmi_event);
332
333void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
334
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335#ifdef WLAN_FEATURE_ROAM_OFFLOAD
336void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
337#endif
338
339#ifdef FEATURE_WLAN_EXTSCAN
340
341int wma_extscan_start_stop_event_handler(void *handle,
342 uint8_t *cmd_param_info,
343 uint32_t len);
344
345int wma_extscan_operations_event_handler(void *handle,
346 uint8_t *cmd_param_info,
347 uint32_t len);
348
349int wma_extscan_table_usage_event_handler(void *handle,
350 uint8_t *cmd_param_info,
351 uint32_t len);
352
353int wma_extscan_capabilities_event_handler(void *handle,
354 uint8_t *cmd_param_info,
355 uint32_t len);
356
357int wma_extscan_hotlist_match_event_handler(void *handle,
358 uint8_t *cmd_param_info,
359 uint32_t len);
360
361int wma_extscan_cached_results_event_handler(void *handle,
362 uint8_t *cmd_param_info,
363 uint32_t len);
364
365int wma_extscan_change_results_event_handler(void *handle,
366 uint8_t *cmd_param_info,
367 uint32_t len);
368
369int wma_passpoint_match_event_handler(void *handle,
370 uint8_t *cmd_param_info,
371 uint32_t len);
372
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373#endif
374
375void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
376
377#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530378QDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379 tSirWifiScanCmdReqParams *pstart,
380 wmi_buf_t *buf, int *buf_len);
381
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530382QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383 tSirWifiScanCmdReqParams *pstart);
384
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530385QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386 tSirExtScanStopReqParams *pstopcmd);
387
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530388QDF_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800389 tSirExtScanSetBssidHotListReqParams *
390 photlist, int *buf_len);
391
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530392QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393 tSirExtScanSetBssidHotListReqParams
394 *photlist);
395
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530396QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700397 tSirExtScanResetBssidHotlistReqParams *photlist_reset);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530399QDF_STATUS wma_get_buf_extscan_change_monitor_cmd(tp_wma_handle wma_handle,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700400 tSirExtScanSetSigChangeReqParams *psigchange,
401 wmi_buf_t *buf, int *buf_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530403QDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404 tSirExtScanSetSigChangeReqParams *
405 psigchange);
406
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530407QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700408 tSirExtScanResetSignificantChangeReqParams *pResetReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800409
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530410QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800411 tSirExtScanGetCachedResultsReqParams *
412 pcached_results);
413
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530414QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800415 tSirGetExtScanCapabilitiesReqParams *
416 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530417QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800418 struct wifi_epno_params *req);
419
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530420QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800421 struct wifi_passpoint_req *req);
422
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530423QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800425#endif
426
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530427QDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800428 struct sir_ipa_offload_enable_disable *ipa_offload);
429
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530430QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800431
432int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
433
434void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
435
436int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
437 uint32_t len);
438
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800439#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800440void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
441static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
442 uint8_t vdev_id)
443{
444 return wma->interfaces[vdev_id].roam_synch_in_progress;
445}
446#else
447static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
448 uint8_t vdev_id)
449{
450 return false;
451}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700452static inline uint32_t wma_roam_scan_get_cckm_mode(
453 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
454{
455 return WMI_AUTH_CCKM;
456}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800457#endif
458
459/*
460 * wma_dev_if.c functions declarations
461 */
462
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800463struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800464 uint8_t *vdev_id);
465
466/**
467 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
468 * @wma - wma handle
469 * @vdev_id - vdev ID
470 *
471 * Return: Returns vdev handle if given vdev id is valid.
472 * Otherwise returns NULL.
473 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800474static inline
475struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800476{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700477 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800478 return NULL;
479
480 return wma->interfaces[vdev_id].handle;
481}
482
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
484
485#ifdef QCA_IBSS_SUPPORT
486bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700487#else
488/**
489 * wma_is_vdev_in_ibss_mode(): dummy function
490 * @wma: wma handle
491 * @vdev_id: vdev id
492 *
493 * Return false since no vdev can be in ibss mode without ibss support
494 */
495static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700496bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700497{
498 return false;
499}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800500#endif
501
502/**
503 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
504 * @wma - wma handle
505 * @vdev_id - vdev ID
506 *
507 * Return: Returns pointer to bssid on success,
508 * otherwise returns NULL.
509 */
510static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
511 uint8_t vdev_id)
512{
513 if (vdev_id >= wma->max_bssid)
514 return NULL;
515
516 return wma->interfaces[vdev_id].bssid;
517}
518
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800519struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800520 uint8_t *vdev_id);
521
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530522QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800523 struct del_sta_self_params *pdel_sta_self_req_param,
524 uint8_t generateRsp);
525
526int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
527 uint32_t len);
528
Govind Singhd76a5b02016-03-08 15:12:14 +0530529QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800530 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800531void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700532 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533 bool roam_synch_in_progress);
534
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800535QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
536 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800537 u8 peer_addr[IEEE80211_ADDR_LEN],
538 uint32_t peer_type, uint8_t vdev_id,
539 bool roam_synch_in_progress);
540
541int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
542 u32 len);
543
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800544struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800545 struct add_sta_self_params *self_sta_req,
546 uint8_t generateRsp);
547
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700548QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
549 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550
551void wma_vdev_resp_timer(void *data);
552
553struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
554 uint8_t vdev_id,
555 uint32_t msg_type, uint8_t type,
556 void *params, uint32_t timeout);
557
558void wma_hold_req_timer(void *data);
559struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
560 uint8_t vdev_id, uint32_t msg_type,
561 uint8_t type, void *params,
562 uint32_t timeout);
563
564void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
565 uint8_t type);
566
567void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
568
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
570
571void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
572
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800573void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
574
575int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
576
577void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
578 tpDisableIntraBssFwd pdis_intra_fwd);
579
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700580void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
581
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800582uint32_t wma_get_bcn_rate_code(uint16_t rate);
583
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800584/*
585 * wma_mgmt.c functions declarations
586 */
587
588int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
589
590int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
591
Dustin Browne2206fb2017-04-20 13:39:25 -0700592int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800593
594int wma_unified_bcntx_status_event_handler(void *handle,
595 uint8_t *cmd_param_info,
596 uint32_t len);
597
mukul sharma72c8b222015-09-04 17:02:01 +0530598void wma_set_sta_sa_query_param(tp_wma_handle wma,
599 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800600
601void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
602 uint32_t method, uint32_t timeperiod,
603 uint8_t *hostv4addr, uint8_t *destv4addr,
604 uint8_t *destmac);
605
606int wma_vdev_install_key_complete_event_handler(void *handle,
607 uint8_t *event,
608 uint32_t len);
609
Govind Singhb30d4c02016-03-24 11:01:23 +0530610QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800611 tSirNwType nw_type,
612 tpAddStaParams params);
613
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530614QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
615 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616 gtx_config_t *gtx_info);
617
618void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
619 uint8_t llbcoexist);
620
621void wma_process_update_beacon_params(tp_wma_handle wma,
622 tUpdateBeaconParams *bcn_params);
623
Rajeev Kumar416b73f2017-01-21 16:45:21 -0800624void wma_update_cfg_params(tp_wma_handle wma, struct scheduler_msg *cfgParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800625
626void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
627
628void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
629 uint8_t vdev_id,
630 int8_t peer_num_delta);
631
632void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
633
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530634QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800635 tEdcaParams *edca_params);
636
637int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
638 uint32_t len);
639
640void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
641 tpSendProbeRespParams probe_rsp_info);
642
643void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
644
645void wma_set_keepalive_req(tp_wma_handle wma,
646 tSirKeepAliveReq *keepalive);
647
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530648void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
649 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800650
651void wma_process_update_opmode(tp_wma_handle wma_handle,
652 tUpdateVHTOpMode *update_vht_opmode);
653
654void wma_process_update_rx_nss(tp_wma_handle wma_handle,
655 tUpdateRxNss *update_rx_nss);
656
657void wma_process_update_membership(tp_wma_handle wma_handle,
658 tUpdateMembership *membership);
659
660void wma_process_update_userpos(tp_wma_handle wma_handle,
661 tUpdateUserPos *userpos);
662
663void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
664 tHalHiddenSsidVdevRestart *pReq);
665
666/*
667 * wma_power.c functions declarations
668 */
669
670void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
671
Govind Singhd76a5b02016-03-08 15:12:14 +0530672QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800673 uint32_t vdev_id, uint32_t param,
674 uint32_t value);
675
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530676QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800677wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
678
Govind Singhd76a5b02016-03-08 15:12:14 +0530679QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680 uint8_t *peer_addr, uint8_t uapsd_value,
681 uint8_t max_sp);
682
683void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Govind Singh19931aa2017-06-13 16:53:26 +0530684 struct wmi_host_wme_vparams *wmm_param, int ac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800685
686void wma_set_tx_power(WMA_HANDLE handle,
687 tMaxTxPowerParams *tx_pwr_params);
688
689void wma_set_max_tx_power(WMA_HANDLE handle,
690 tMaxTxPowerParams *tx_pwr_params);
691
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800692void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
693
694void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
695
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700696void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530698QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800699
700int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
701 uint32_t len);
702
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530703QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704 tSirTxPowerLimit *ptxlim);
705
706void wma_update_noa(struct beacon_info *beacon,
707 struct p2p_sub_element_noa *noa_ie);
708
709void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
710 struct p2p_sub_element_noa *noa_ie);
711
712int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
713 uint32_t len);
714
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715void wma_process_set_mimops_req(tp_wma_handle wma_handle,
716 tSetMIMOPS *mimops);
717
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530718QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530720QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721 tSirModemPowerStateInd *pReq);
722
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530723QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800724 int value);
725
726void wma_set_suspend_dtim(tp_wma_handle wma);
727
728void wma_set_resume_dtim(tp_wma_handle wma);
729
730/*
731 * wma_data.c functions declarations
732 */
733
734
735void wma_set_bss_rate_flags(struct wma_txrx_node *iface,
736 tpAddBssParams add_bss);
737
738int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
739
Jiachao Wu08719b02017-07-05 13:05:34 +0800740/**
741 * wma_check_txrx_chainmask() - check txrx chainmask
742 * @num_rf_chains: number of rf chains
743 * @cmd_value: command value
744 *
745 * Return: QDF_STATUS_SUCCESS for success or error code
746 */
747QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800748
749int wma_peer_state_change_event_handler(void *handle,
750 uint8_t *event_buff,
751 uint32_t len);
752
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530753QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754 mcc_adaptive_scheduler);
755
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530756QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800757 (tp_wma_handle wma,
758 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
759
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530760QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800761 (tp_wma_handle wma,
762 uint32_t adapter_1_chan_number,
763 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
764
765void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
766
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530767QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800768 tSirRateUpdateInd *
769 pRateUpdateParams);
770
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530771QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800772
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530773QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800774
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530775#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
776 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
777
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800778int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
779 uint32_t len);
780#endif
781
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530782#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
783QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
784 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700785#else
786static inline QDF_STATUS
787wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
788 struct t_bad_peer_txtcl_config *config)
789{
790 return QDF_STATUS_E_FAILURE;
791}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530792#endif
793
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530794QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800795 t_thermal_mgmt *pThermalParams);
796
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530797QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800798 uint8_t thermal_level);
799
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530800QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800801 t_thermal_cmd_params thermal_info);
802
803int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
804 uint32_t len);
805
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800806int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
807 uint32_t len);
808
809int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
810 uint32_t len);
811
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800812/*
813 * wma_utils.c functions declarations
814 */
815
816#ifdef WLAN_FEATURE_STATS_EXT
817int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
818 uint32_t len);
819#endif
820
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700821enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800822int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800823
824#ifdef WLAN_FEATURE_LINK_LAYER_STATS
825void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
826
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530827QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800828 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
829
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530830QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800831 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
832
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530833QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700834 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800835
836int wma_unified_link_iface_stats_event_handler(void *handle,
837 uint8_t *cmd_param_info,
838 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800839void wma_config_stats_ext_threshold(tp_wma_handle wma,
840 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800841#endif
842
843void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
844 uint8_t link_status);
845
846int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
847 uint32_t len);
848
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530849/**
850 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
851 * @wmi_event: WMI event
852 *
853 * This function is used to send RSO command status to upper layer
854 *
855 * Return: 0 for success
856 */
857int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
858
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800859int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
860 uint32_t len);
861
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530862QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863
864int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
865 uint32_t len);
866
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530867QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800868
869int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
870 uint32_t len);
871
872bool wma_is_sap_active(tp_wma_handle wma_handle);
873
874bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
875
876bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
877
878bool wma_is_sta_active(tp_wma_handle wma_handle);
879
880WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
881 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800882 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883
884int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
885 uint8_t vdev_id, uint32_t value);
886
887int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
888 uint8_t vdev_id, uint32_t value);
889
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800890void wma_get_stats_req(WMA_HANDLE handle,
891 tAniGetPEStatsReq *get_stats_param);
892
893#if defined(QCA_WIFI_FTM)
894void wma_utf_detach(tp_wma_handle wma_handle);
895
896void wma_utf_attach(tp_wma_handle wma_handle);
897
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530898QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800899wma_process_ftm_command(tp_wma_handle wma_handle,
900 struct ar6k_testmode_cmd_data *msg_buffer);
901#endif
902
903/*
904 * wma_features.c functions declarations
905 */
906
907void wma_process_link_status_req(tp_wma_handle wma,
908 tAniGetLinkStatus *pGetLinkStatus);
909
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530910QDF_STATUS wma_process_dhcp_ind(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800911 tAniDHCPInd *ta_dhcp_ind);
912
Will Huanga9814592017-05-24 15:47:58 +0800913QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
914 struct sir_peer_info_req *peer_info_req);
915
916/**
917 * wma_get_peer_info_ext() - get peer info
918 * @handle: wma interface
919 * @peer_info_req: get peer info request information
920 *
921 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
922 *
923 * Return: 0 on success, otherwise error value
924 */
925QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
926 struct sir_peer_info_ext_req *peer_info_req);
927
928/**
929 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
930 * @handle: WMA global handle
931 * @cmd_param_info: Command event data
932 * @len: Length of cmd_param_info
933 *
934 * This function will handle WMI_PEER_STATS_INFO_EVENTID
935 *
936 * Return: 0 on success, error code otherwise
937 */
938int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
939 u_int32_t len);
940
Govind Singha471e5e2015-10-12 17:11:14 +0530941int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
942 uint32_t len);
943
Govind Singhf25a0f12016-03-08 16:09:48 +0530944QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530945 uint32_t cmd, uint32_t value1, uint32_t value2);
946
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800947void wma_wow_tx_complete(void *wma);
948
949int wmi_unified_nat_keepalive_enable(tp_wma_handle wma, uint8_t vdev_id);
950
Govind Singhd76a5b02016-03-08 15:12:14 +0530951int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800952
953#ifdef WLAN_FEATURE_NAN
954int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
955#endif
956
957#ifdef FEATURE_WLAN_TDLS
958int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
959#endif
960
961int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
962
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800963#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -0800964int wma_oem_data_response_handler(void *handle, uint8_t *datap,
965 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800966#endif
967
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800968#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530969QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970 struct ath_pktlog_wmi_params *params);
971#endif
972
973int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
974 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +0800975
976int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
977
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800978int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
979
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530980QDF_STATUS wma_wow_enter(tp_wma_handle wma, tpSirHalWowlEnterParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800981
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530982QDF_STATUS wma_wow_exit(tp_wma_handle wma, tpSirHalWowlExitParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800984void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
985
986void wma_aggr_qos_req(tp_wma_handle wma,
987 tAggrAddTsParams *pAggrQosRspMsg);
988
989void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
990
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800991#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530992QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800993 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800994QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
995QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
996void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997#endif
998
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530999QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1000 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001001QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1002
1003QDF_STATUS wma_process_get_peer_info_req
1004 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1005
1006QDF_STATUS wma_process_tx_fail_monitor_ind
1007 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1008
1009QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1010
1011QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1012
1013QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
1014
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301015QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001016 tSirAddPeriodicTxPtrn *
1017 pAddPeriodicTxPtrnParams);
1018
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301019QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001020 tSirDelPeriodicTxPtrn *
1021 pDelPeriodicTxPtrnParams);
1022
1023#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301024QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025#endif
1026
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301027QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1028 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001029
1030#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301031QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032
1033int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1034 tpSirAppType1Params appType1Params);
1035
Himanshu Agarwal44195412016-03-09 13:03:54 +05301036QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001037 tpSirAppType2Params appType2Params);
1038#endif
1039
1040#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1041int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1042 uint32_t len);
1043
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301044QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001045 tSirAutoShutdownCmdParams *
1046 auto_sh_cmd);
1047#endif
1048
Manikandan Mohan976e7562016-03-15 16:33:31 -07001049#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001050int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1051QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1052QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001053QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1054#else
1055static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1056 uint32_t vdev_id)
1057{
1058 return QDF_STATUS_SUCCESS;
1059}
1060
1061static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1062 uint32_t vdev_id)
1063{
1064 return QDF_STATUS_SUCCESS;
1065}
1066
1067static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1068 uint32_t data_len)
1069{
1070 return 0;
1071}
1072
1073static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1074{
1075 return QDF_STATUS_E_INVAL;
1076}
1077#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001078QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001079
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001080#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301081QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082#endif
1083
1084#ifdef DHCP_SERVER_OFFLOAD
1085int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1086 tSirDhcpSrvOffloadInfo *
1087 pDhcpSrvOffloadInfo);
1088#endif
1089
1090#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301091QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001092 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001093#endif
1094
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001095
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301096QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001097 tSirChAvoidUpdateReq *
1098 ch_avoid_update_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001099
1100#ifdef FEATURE_WLAN_TDLS
1101
Himanshu Agarwal44195412016-03-09 13:03:54 +05301102QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001103int wma_update_tdls_peer_state(WMA_HANDLE handle,
1104 tTdlsPeerStateParams *peerStateParams);
1105/**
1106 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1107 * @handle: wma handle
1108 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1109 *
1110 * This function sets tdls off channel mode
1111 *
1112 * Return: 0 on success; negative errno otherwise
1113 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301114QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001115 tdls_chan_switch_params *chan_switch_params);
1116#endif
1117
Hong Shib90718f2017-02-20 00:57:22 +08001118void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001119void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1120
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001121int wma_rssi_breached_event_handler(void *handle,
1122 u_int8_t *cmd_param_info, u_int32_t len);
1123#ifdef WLAN_FEATURE_MEMDUMP
1124int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
1125 u_int32_t len);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301126QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001127 struct fw_dump_req *mem_dump_req);
1128#else
1129static inline int wma_fw_mem_dump_event_handler(void *handle,
1130 u_int8_t *cmd_param_info, u_int32_t len)
1131{
1132 return 0;
1133}
1134
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301135static inline QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001136 void *mem_dump_req)
1137{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301138 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001139}
1140#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301141QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001142 struct vdev_ie_info *ie_info);
1143int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1144 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001145int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1146 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001147
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001148int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1149 uint32_t len);
1150void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1151 uint8_t type);
Peng Xu8fdaa492016-06-22 10:20:47 -07001152int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1153 uint32_t len);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301154
1155QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1156 struct sir_mac_pwr_dbg_cmd *
1157 sir_pwr_dbg_params);
1158
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301159#ifdef WLAN_FEATURE_DISA
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301160int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1161 uint32_t data_len);
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301162#else
1163static inline int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1164 uint32_t data_len)
1165{
1166 return 0;
1167}
1168#endif
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301169
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301170/**
1171 * wma_lost_link_info_handler() - collect lost link information and inform SME
1172 * @wma: WMA handle
1173 * @vdev_id: vdev ID
1174 * @rssi: rssi at disconnection time
1175 *
1176 * Return: none
1177 */
1178void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1179 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301180int wma_unified_power_debug_stats_event_handler(void *handle,
1181 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301182
1183#ifdef FEATURE_WLAN_DIAG_SUPPORT
1184/**
1185 * wma_sta_kickout_event()- send sta kickout event
1186 * @kickout_reason - reasoncode for kickout
1187 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1188 * @vdev_id: Unique id for identifying the VDEV
1189 *
1190 * This function sends sta kickout diag event
1191 *
1192 * Return: void.
1193 */
1194void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1195 uint8_t *macaddr);
1196#else
1197static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1198 uint8_t vdev_id, uint8_t *macaddr)
1199{
1200
1201};
1202#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1203
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001204/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301205 * wma_get_rcpi_req() - get rcpi request
1206 * @handle: wma handle
1207 * @rcpi_request: rcpi params
1208 *
1209 * Return: none
1210 */
1211QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1212 struct sme_rcpi_req *rcpi_request);
1213
1214/**
1215 * wma_rcpi_event_handler() - rcpi event handler
1216 * @handle: wma handle
1217 * @cmd_param_info: data from event
1218 * @len: length
1219 *
1220 * Return: 0 for success or error code
1221 */
1222int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1223 uint32_t len);
1224
1225/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001226 * wma_acquire_wakelock() - acquire the given wakelock
1227 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001228 * @msec: the wakelock duration in milliseconds
1229 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001230 * This also acquires the wma runtime pm lock.
1231 *
1232 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001233 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001234void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001235
1236/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001237 * wma_release_wakelock() - release the given wakelock
1238 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001239 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001240 * This also releases the wma runtime pm lock.
1241 *
1242 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001243 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001244void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001245
1246/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001247 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001248 * @wma: a reference to the global WMA handle
1249 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001250 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001251 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1252 * response from firmware to avoid power penalties. Alternatively, calling the
1253 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001254 *
1255 * Return: QDF_STATUS
1256 */
1257QDF_STATUS
1258wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1259
1260/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001261 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001262 * @wma: a reference to the global WMA handle
1263 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001264 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001265 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1266 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001267 *
1268 * Return: QDF_STATUS
1269 */
1270QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1271
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301272int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1273
Dustin Brownec2c92e2017-07-26 11:13:49 -07001274/**
1275 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1276 * @wma: a reference to the global WMA handle
1277 * @params: the vdev up params to send to firmware
1278 * @bssid: the BssId to send to firmware
1279 *
1280 * This also releases the vdev start wakelock.
1281 *
1282 * Return: QDF_STATUS
1283 */
1284QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1285 struct vdev_up_params *params,
1286 uint8_t bssid[IEEE80211_ADDR_LEN]);
1287
1288/**
1289 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1290 * @wma: a reference to the global WMA handle
1291 * @vdev_id: the Id of the vdev to down
1292 *
1293 * This also releases the vdev start wakelock.
1294 *
1295 * Return: QDF_STATUS
1296 */
1297QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1298
lifeng66831662017-05-19 16:01:35 +08001299/*
1300 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1301 * @handle: the wma handle
1302 * @event_buf: buffer with event
1303 * @len: buffer length
1304 *
1305 * This function receives rx aggregation failure event and then pass to upper
1306 * layer
1307 *
1308 * Return: 0 on success
1309 */
1310int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1311 u_int32_t len);
1312
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301313/**
1314 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1315 * @handle: the WMA handle
1316 * @event: buffer with the event parameters
1317 * @len: length of the buffer
1318 *
1319 * This function receives BT activity event from firmware and passes the event
1320 * information to upper layers
1321 *
1322 * Return: 0 on success
1323 */
1324int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1325 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001326
1327/**
1328 * wma_peer_ant_info_evt_handler - event handler to handle antenna info
1329 * @handle: the wma handle
1330 * @event: buffer with event
1331 * @len: buffer length
1332 *
1333 * This function receives antenna info from firmware and passes the event
1334 * to upper layer
1335 *
1336 * Return: 0 on success
1337 */
1338int wma_peer_ant_info_evt_handler(void *handle, u_int8_t *event,
1339 u_int32_t len);
1340
lifeng7c607dd2017-02-21 21:16:49 +08001341/**
1342 * wma_update_beacon_interval() - update beacon interval in fw
1343 * @wma: wma handle
1344 * @vdev_id: vdev id
1345 * @beaconInterval: becon interval
1346 *
1347 * Return: none
1348 */
1349void
1350wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1351 uint16_t beaconInterval);
1352
1353#define RESET_BEACON_INTERVAL_TIMEOUT 200
1354
1355struct wma_beacon_interval_reset_req {
1356 qdf_timer_t event_timeout;
1357 uint8_t vdev_id;
1358 uint16_t interval;
1359};
1360
1361/**
1362 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1363 * @wma: wma handle
1364 * @vdev_id: vdev id
1365 * @beacon_interval: beacon interval
1366 * @timeout: timeout val
1367 *
1368 * Return: status
1369 */
1370int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1371 uint16_t beacon_interval, uint32_t timeout);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001372#endif