blob: 8e6e05455734d02d0fa26057ee6b49823d9cc0ac [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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800121/**
122 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800123 * @mcs_index: mcs rate index
124 * @ht20_rate: HT20 supported rate table
125 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800126 */
127struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800128 uint8_t mcs_index;
129 uint16_t ht20_rate[2];
130 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800131};
132
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800133/**
134 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800135 * @mcs_index: mcs rate index
136 * @ht20_rate: VHT20 supported rate table
137 * @ht40_rate: VHT40 supported rate table
138 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800139 */
140struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800141 uint8_t mcs_index;
142 uint16_t ht20_rate[2];
143 uint16_t ht40_rate[2];
144 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800145};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800146
147/*
148 * wma_main.c functions declarations
149 */
150
151int
152wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
153 uint32_t param_value);
154
155void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
156 void *body_ptr, uint32_t body_val);
157
158void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530159 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530161QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800162 int value);
163
164/*
165 * wma_scan_roam.c functions declarations
166 */
167
168#ifdef WLAN_FEATURE_ROAM_OFFLOAD
169void wma_process_roam_invoke(WMA_HANDLE handle,
170 struct wma_roam_invoke_cmd *roaminvoke);
171
172void wma_process_roam_synch_fail(WMA_HANDLE handle,
173 struct roam_offload_synch_fail *synch_fail);
174
175int wma_roam_synch_event_handler(void *handle, uint8_t *event,
176 uint32_t len);
177#endif
178
Kapil Gupta5cda2252016-12-29 18:44:26 +0530179/**
180 * wma_update_per_roam_config() -per roam config parameter updation to FW
181 * @handle: wma handle
182 * @req_buf: per roam config parameters
183 *
184 * Return: none
185 */
186void wma_update_per_roam_config(WMA_HANDLE handle,
187 struct wmi_per_roam_config_req *req_buf);
188
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530189QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800190 tSirScanOffloadReq *scan_req,
Sandeep Puligilla1fcdb772017-02-22 21:14:59 -0800191 struct scan_req_params *cmd);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800192
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530193QDF_STATUS wma_get_buf_stop_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194 wmi_buf_t *buf,
195 int *buf_len,
196 tAbortScanParams *abort_scan_req);
197
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530198QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199 tSirScanOffloadReq *scan_req, uint16_t msg_type);
200
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530201QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800202 tAbortScanParams *abort_scan_req);
203
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530204QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800205 tSirUpdateChanList *chan_list);
206
207#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530208QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530209 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800210 roam_offload_params,
211 tSirRoamOffloadScanReq *roam_req);
212#endif
213
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530214QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800215 wmi_start_scan_cmd_fixed_param *
216 scan_cmd_fp,
217 tSirRoamOffloadScanReq *roam_req,
218 uint32_t mode, uint32_t vdev_id);
219
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530220QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800221 tSirRoamOffloadScanReq *roam_req);
222
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530223QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800224 uint32_t scan_period,
225 uint32_t scan_age,
226 uint32_t vdev_id);
227
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530228QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800229 uint32_t vdev_id,
230 int32_t rssi_change_thresh,
231 uint32_t bcn_rssi_weight,
232 uint32_t hirssi_delay_btw_scans);
233
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530234QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800235 uint8_t chan_count,
236 uint8_t *chan_list,
237 uint8_t list_type, uint32_t vdev_id);
238
239A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
240 eCsrEncryptionType encr);
241
242A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
243
244void wma_roam_scan_fill_ap_profile(tp_wma_handle wma_handle,
245 tpAniSirGlobal pMac,
246 tSirRoamOffloadScanReq *roam_req,
247 wmi_ap_profile *ap_profile_p);
248
249void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
250 tpAniSirGlobal pMac,
251 tSirRoamOffloadScanReq *roam_req,
252 wmi_start_scan_cmd_fixed_param *
253 scan_params);
254
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530255QDF_STATUS wma_roam_scan_offload_ap_profile(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800256 wmi_ap_profile *ap_profile_p,
257 uint32_t vdev_id);
258
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530259QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800260 A_INT32 first_bcnt,
261 A_UINT32 final_bcnt, uint32_t vdev_id);
262
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530263QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800264 uint32_t command, uint32_t vdev_id);
265
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530266QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800267 tpSwitchChannelParams params,
268 uint8_t vdev_id);
269
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530270QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 tpSwitchChannelParams params,
272 uint8_t vdev_id);
273
274void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
275 uint8_t vdev_id,
276 wmi_scan_event_fixed_param *
277 wmi_event);
278
279void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
280
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800281#ifdef WLAN_FEATURE_ROAM_OFFLOAD
282void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
283#endif
284
285#ifdef FEATURE_WLAN_EXTSCAN
286
287int wma_extscan_start_stop_event_handler(void *handle,
288 uint8_t *cmd_param_info,
289 uint32_t len);
290
291int wma_extscan_operations_event_handler(void *handle,
292 uint8_t *cmd_param_info,
293 uint32_t len);
294
295int wma_extscan_table_usage_event_handler(void *handle,
296 uint8_t *cmd_param_info,
297 uint32_t len);
298
299int wma_extscan_capabilities_event_handler(void *handle,
300 uint8_t *cmd_param_info,
301 uint32_t len);
302
303int wma_extscan_hotlist_match_event_handler(void *handle,
304 uint8_t *cmd_param_info,
305 uint32_t len);
306
307int wma_extscan_cached_results_event_handler(void *handle,
308 uint8_t *cmd_param_info,
309 uint32_t len);
310
311int wma_extscan_change_results_event_handler(void *handle,
312 uint8_t *cmd_param_info,
313 uint32_t len);
314
315int wma_passpoint_match_event_handler(void *handle,
316 uint8_t *cmd_param_info,
317 uint32_t len);
318
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800319#endif
320
321void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
322
323#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530324QDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800325 tSirWifiScanCmdReqParams *pstart,
326 wmi_buf_t *buf, int *buf_len);
327
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530328QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329 tSirWifiScanCmdReqParams *pstart);
330
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530331QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800332 tSirExtScanStopReqParams *pstopcmd);
333
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530334QDF_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 tSirExtScanSetBssidHotListReqParams *
336 photlist, int *buf_len);
337
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530338QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800339 tSirExtScanSetBssidHotListReqParams
340 *photlist);
341
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530342QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700343 tSirExtScanResetBssidHotlistReqParams *photlist_reset);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530345QDF_STATUS wma_get_buf_extscan_change_monitor_cmd(tp_wma_handle wma_handle,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700346 tSirExtScanSetSigChangeReqParams *psigchange,
347 wmi_buf_t *buf, int *buf_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530349QDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800350 tSirExtScanSetSigChangeReqParams *
351 psigchange);
352
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530353QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700354 tSirExtScanResetSignificantChangeReqParams *pResetReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800355
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530356QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357 tSirExtScanGetCachedResultsReqParams *
358 pcached_results);
359
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530360QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800361 tSirGetExtScanCapabilitiesReqParams *
362 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530363QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364 struct wifi_epno_params *req);
365
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530366QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367 struct wifi_passpoint_req *req);
368
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530369QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800370 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371#endif
372
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530373QDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800374 struct sir_ipa_offload_enable_disable *ipa_offload);
375
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376void wma_process_unit_test_cmd(WMA_HANDLE handle,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700377 t_wma_unit_test_cmd *wma_utest);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800378
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530379QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800380
381int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
382
383void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
384
385int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
386 uint32_t len);
387
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800389void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
390static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
391 uint8_t vdev_id)
392{
393 return wma->interfaces[vdev_id].roam_synch_in_progress;
394}
395#else
396static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
397 uint8_t vdev_id)
398{
399 return false;
400}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700401static inline uint32_t wma_roam_scan_get_cckm_mode(
402 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
403{
404 return WMI_AUTH_CCKM;
405}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406#endif
407
408/*
409 * wma_dev_if.c functions declarations
410 */
411
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800412struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800413 uint8_t *vdev_id);
414
415/**
416 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
417 * @wma - wma handle
418 * @vdev_id - vdev ID
419 *
420 * Return: Returns vdev handle if given vdev id is valid.
421 * Otherwise returns NULL.
422 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800423static inline
424struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800425{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700426 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800427 return NULL;
428
429 return wma->interfaces[vdev_id].handle;
430}
431
432/**
433 * wma_get_vdev_count() - Returns number of active vdev.
434 * @wma - wma handle
435 *
436 * Return: Returns valid vdev count.
437 */
438static inline uint8_t wma_get_vdev_count(tp_wma_handle wma)
439{
440 uint8_t vdev_count = 0, i;
441
442 for (i = 0; i < wma->max_bssid; i++) {
443 if (wma->interfaces[i].handle)
444 vdev_count++;
445 }
446 return vdev_count;
447}
448
449bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
450
451#ifdef QCA_IBSS_SUPPORT
452bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700453#else
454/**
455 * wma_is_vdev_in_ibss_mode(): dummy function
456 * @wma: wma handle
457 * @vdev_id: vdev id
458 *
459 * Return false since no vdev can be in ibss mode without ibss support
460 */
461static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700462bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700463{
464 return false;
465}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800466#endif
467
468/**
Houston Hoffman79b4af22015-10-06 12:01:08 -0700469 * wma_is_vdev_in_beaconning_mode() - check if vdev is in a beaconning mode
470 * @wma: wma handle
471 * @vdev_id: vdev id
472 *
473 * Helper function to know whether given vdev id
474 * is in a beaconning mode or not.
475 *
476 * Return: True if vdev needs to beacon.
477 */
478static inline
479bool wma_is_vdev_in_beaconning_mode(tp_wma_handle wma, uint8_t vdev_id)
480{
481 return wma_is_vdev_in_ap_mode(wma, vdev_id) ||
482 wma_is_vdev_in_ibss_mode(wma, vdev_id);
483}
484
485/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
487 * @wma - wma handle
488 * @vdev_id - vdev ID
489 *
490 * Return: Returns pointer to bssid on success,
491 * otherwise returns NULL.
492 */
493static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
494 uint8_t vdev_id)
495{
496 if (vdev_id >= wma->max_bssid)
497 return NULL;
498
499 return wma->interfaces[vdev_id].bssid;
500}
501
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800502struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800503 uint8_t *vdev_id);
504
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530505QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800506 struct del_sta_self_params *pdel_sta_self_req_param,
507 uint8_t generateRsp);
508
509int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
510 uint32_t len);
511
Govind Singhd76a5b02016-03-08 15:12:14 +0530512QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800513 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800514void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700515 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516 bool roam_synch_in_progress);
517
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800518QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
519 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800520 u8 peer_addr[IEEE80211_ADDR_LEN],
521 uint32_t peer_type, uint8_t vdev_id,
522 bool roam_synch_in_progress);
523
524int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
525 u32 len);
526
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800527struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800528 struct add_sta_self_params *self_sta_req,
529 uint8_t generateRsp);
530
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700531QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
532 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533
534void wma_vdev_resp_timer(void *data);
535
536struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
537 uint8_t vdev_id,
538 uint32_t msg_type, uint8_t type,
539 void *params, uint32_t timeout);
540
541void wma_hold_req_timer(void *data);
542struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
543 uint8_t vdev_id, uint32_t msg_type,
544 uint8_t type, void *params,
545 uint32_t timeout);
546
547void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
548 uint8_t type);
549
550void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
551
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800552void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
553
554void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
555
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800556void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
557
558int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
559
560void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
561 tpDisableIntraBssFwd pdis_intra_fwd);
562
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700563void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
564
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800565/*
566 * wma_mgmt.c functions declarations
567 */
568
569int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
570
571int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
572
Dustin Browne2206fb2017-04-20 13:39:25 -0700573int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800574
575int wma_unified_bcntx_status_event_handler(void *handle,
576 uint8_t *cmd_param_info,
577 uint32_t len);
578
mukul sharma72c8b222015-09-04 17:02:01 +0530579void wma_set_sta_sa_query_param(tp_wma_handle wma,
580 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800581
582void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
583 uint32_t method, uint32_t timeperiod,
584 uint8_t *hostv4addr, uint8_t *destv4addr,
585 uint8_t *destmac);
586
587int wma_vdev_install_key_complete_event_handler(void *handle,
588 uint8_t *event,
589 uint32_t len);
590
Govind Singhb30d4c02016-03-24 11:01:23 +0530591QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800592 tSirNwType nw_type,
593 tpAddStaParams params);
594
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530595QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
596 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597 gtx_config_t *gtx_info);
598
599void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
600 uint8_t llbcoexist);
601
602void wma_process_update_beacon_params(tp_wma_handle wma,
603 tUpdateBeaconParams *bcn_params);
604
Rajeev Kumar416b73f2017-01-21 16:45:21 -0800605void wma_update_cfg_params(tp_wma_handle wma, struct scheduler_msg *cfgParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800606
607void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
608
609void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
610 uint8_t vdev_id,
611 int8_t peer_num_delta);
612
613void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
614
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530615QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616 tEdcaParams *edca_params);
617
618int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
619 uint32_t len);
620
621void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
622 tpSendProbeRespParams probe_rsp_info);
623
624void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
625
626void wma_set_keepalive_req(tp_wma_handle wma,
627 tSirKeepAliveReq *keepalive);
628
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530629void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
630 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800631
632void wma_process_update_opmode(tp_wma_handle wma_handle,
633 tUpdateVHTOpMode *update_vht_opmode);
634
635void wma_process_update_rx_nss(tp_wma_handle wma_handle,
636 tUpdateRxNss *update_rx_nss);
637
638void wma_process_update_membership(tp_wma_handle wma_handle,
639 tUpdateMembership *membership);
640
641void wma_process_update_userpos(tp_wma_handle wma_handle,
642 tUpdateUserPos *userpos);
643
644void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
645 tHalHiddenSsidVdevRestart *pReq);
646
647/*
648 * wma_power.c functions declarations
649 */
650
651void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
652
Govind Singhd76a5b02016-03-08 15:12:14 +0530653QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654 uint32_t vdev_id, uint32_t param,
655 uint32_t value);
656
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530657QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800658wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
659
Govind Singhd76a5b02016-03-08 15:12:14 +0530660QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800661 uint8_t *peer_addr, uint8_t uapsd_value,
662 uint8_t max_sp);
663
664void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
665 wmi_wmm_vparams *wmm_param, int ac);
666
667void wma_set_tx_power(WMA_HANDLE handle,
668 tMaxTxPowerParams *tx_pwr_params);
669
670void wma_set_max_tx_power(WMA_HANDLE handle,
671 tMaxTxPowerParams *tx_pwr_params);
672
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800673void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
674
675void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
676
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700677void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530679QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680
681int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
682 uint32_t len);
683
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530684QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800685 tSirTxPowerLimit *ptxlim);
686
687void wma_update_noa(struct beacon_info *beacon,
688 struct p2p_sub_element_noa *noa_ie);
689
690void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
691 struct p2p_sub_element_noa *noa_ie);
692
693int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
694 uint32_t len);
695
696void wma_process_set_p2pgo_noa_req(tp_wma_handle wma,
697 tP2pPsParams *ps_params);
698
699void wma_process_set_mimops_req(tp_wma_handle wma_handle,
700 tSetMIMOPS *mimops);
701
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530702QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530704QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705 tSirModemPowerStateInd *pReq);
706
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530707QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 int value);
709
710void wma_set_suspend_dtim(tp_wma_handle wma);
711
712void wma_set_resume_dtim(tp_wma_handle wma);
713
714/*
715 * wma_data.c functions declarations
716 */
717
718
719void wma_set_bss_rate_flags(struct wma_txrx_node *iface,
720 tpAddBssParams add_bss);
721
722int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
723
Jiachao Wu08719b02017-07-05 13:05:34 +0800724/**
725 * wma_check_txrx_chainmask() - check txrx chainmask
726 * @num_rf_chains: number of rf chains
727 * @cmd_value: command value
728 *
729 * Return: QDF_STATUS_SUCCESS for success or error code
730 */
731QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732
733int wma_peer_state_change_event_handler(void *handle,
734 uint8_t *event_buff,
735 uint32_t len);
736
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530737QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800738 mcc_adaptive_scheduler);
739
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530740QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800741 (tp_wma_handle wma,
742 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
743
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530744QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800745 (tp_wma_handle wma,
746 uint32_t adapter_1_chan_number,
747 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
748
749void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
750
751void wma_unpause_vdev(tp_wma_handle wma);
752
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530753QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754 tSirRateUpdateInd *
755 pRateUpdateParams);
756
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530757QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530759QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800760
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530761#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
762 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
763
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800764int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
765 uint32_t len);
766#endif
767
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530768#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
769QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
770 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700771#else
772static inline QDF_STATUS
773wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
774 struct t_bad_peer_txtcl_config *config)
775{
776 return QDF_STATUS_E_FAILURE;
777}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530778#endif
779
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530780QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800781 t_thermal_mgmt *pThermalParams);
782
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530783QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800784 uint8_t thermal_level);
785
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530786QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800787 t_thermal_cmd_params thermal_info);
788
789int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
790 uint32_t len);
791
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800792int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
793 uint32_t len);
794
795int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
796 uint32_t len);
797
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800798/*
799 * wma_utils.c functions declarations
800 */
801
802#ifdef WLAN_FEATURE_STATS_EXT
803int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
804 uint32_t len);
805#endif
806
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700807enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800808int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800809
810#ifdef WLAN_FEATURE_LINK_LAYER_STATS
811void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
812
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530813QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
815
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530816QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800817 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
818
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530819QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700820 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821
822int wma_unified_link_iface_stats_event_handler(void *handle,
823 uint8_t *cmd_param_info,
824 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800825void wma_config_stats_ext_threshold(tp_wma_handle wma,
826 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800827#endif
828
829void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
830 uint8_t link_status);
831
832int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
833 uint32_t len);
834
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530835/**
836 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
837 * @wmi_event: WMI event
838 *
839 * This function is used to send RSO command status to upper layer
840 *
841 * Return: 0 for success
842 */
843int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
844
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800845int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
846 uint32_t len);
847
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530848QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800849
850int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
851 uint32_t len);
852
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530853QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800854
855int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
856 uint32_t len);
857
858bool wma_is_sap_active(tp_wma_handle wma_handle);
859
860bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
861
862bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
863
864bool wma_is_sta_active(tp_wma_handle wma_handle);
865
866WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
867 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800868 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800869
870int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
871 uint8_t vdev_id, uint32_t value);
872
873int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
874 uint8_t vdev_id, uint32_t value);
875
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800876void wma_get_stats_req(WMA_HANDLE handle,
877 tAniGetPEStatsReq *get_stats_param);
878
879#if defined(QCA_WIFI_FTM)
880void wma_utf_detach(tp_wma_handle wma_handle);
881
882void wma_utf_attach(tp_wma_handle wma_handle);
883
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530884QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800885wma_process_ftm_command(tp_wma_handle wma_handle,
886 struct ar6k_testmode_cmd_data *msg_buffer);
887#endif
888
889/*
890 * wma_features.c functions declarations
891 */
892
893void wma_process_link_status_req(tp_wma_handle wma,
894 tAniGetLinkStatus *pGetLinkStatus);
895
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530896QDF_STATUS wma_process_dhcp_ind(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800897 tAniDHCPInd *ta_dhcp_ind);
898
Will Huanga9814592017-05-24 15:47:58 +0800899QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
900 struct sir_peer_info_req *peer_info_req);
901
902/**
903 * wma_get_peer_info_ext() - get peer info
904 * @handle: wma interface
905 * @peer_info_req: get peer info request information
906 *
907 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
908 *
909 * Return: 0 on success, otherwise error value
910 */
911QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
912 struct sir_peer_info_ext_req *peer_info_req);
913
914/**
915 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
916 * @handle: WMA global handle
917 * @cmd_param_info: Command event data
918 * @len: Length of cmd_param_info
919 *
920 * This function will handle WMI_PEER_STATS_INFO_EVENTID
921 *
922 * Return: 0 on success, error code otherwise
923 */
924int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
925 u_int32_t len);
926
Govind Singha471e5e2015-10-12 17:11:14 +0530927int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
928 uint32_t len);
929
Govind Singhf25a0f12016-03-08 16:09:48 +0530930QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530931 uint32_t cmd, uint32_t value1, uint32_t value2);
932
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800933void wma_wow_tx_complete(void *wma);
934
935int wmi_unified_nat_keepalive_enable(tp_wma_handle wma, uint8_t vdev_id);
936
Govind Singhd76a5b02016-03-08 15:12:14 +0530937int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800938
939#ifdef WLAN_FEATURE_NAN
940int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
941#endif
942
943#ifdef FEATURE_WLAN_TDLS
944int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
945#endif
946
947int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
948
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800949#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -0800950int wma_oem_data_response_handler(void *handle, uint8_t *datap,
951 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800952#endif
953
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800954#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530955QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800956 struct ath_pktlog_wmi_params *params);
957#endif
958
959int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
960 uint32_t len);
961int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
962
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530963QDF_STATUS wma_wow_add_pattern(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800964 struct wow_add_pattern *ptrn);
965
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530966QDF_STATUS wma_wow_delete_user_pattern(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800967 struct wow_delete_pattern *pattern);
968
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530969QDF_STATUS wma_wow_enter(tp_wma_handle wma, tpSirHalWowlEnterParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530971QDF_STATUS wma_wow_exit(tp_wma_handle wma, tpSirHalWowlExitParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800972
Houston Hoffmana76591b2015-11-10 16:52:05 -0800973void wma_calculate_and_update_conn_state(tp_wma_handle wma);
974void wma_update_conn_state(tp_wma_handle wma, uint32_t conn_mask);
Houston Hoffman7260ecb2015-10-05 18:43:07 -0700975void wma_update_conn_state(tp_wma_handle wma, uint32_t conn_mask);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800976
977void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
978
979void wma_aggr_qos_req(tp_wma_handle wma,
980 tAggrAddTsParams *pAggrQosRspMsg);
981
982void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
983
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800984#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530985QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800986 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800987QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
988QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
989void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990#endif
991
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530992QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
993 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800994QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
995
996QDF_STATUS wma_process_get_peer_info_req
997 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
998
999QDF_STATUS wma_process_tx_fail_monitor_ind
1000 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1001
1002QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1003
1004QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1005
1006QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
1007
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301008QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 tSirAddPeriodicTxPtrn *
1010 pAddPeriodicTxPtrnParams);
1011
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301012QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013 tSirDelPeriodicTxPtrn *
1014 pDelPeriodicTxPtrnParams);
1015
1016#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301017QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001018#endif
1019
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301020QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1021 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001022
1023#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301024QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025
1026int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1027 tpSirAppType1Params appType1Params);
1028
Himanshu Agarwal44195412016-03-09 13:03:54 +05301029QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001030 tpSirAppType2Params appType2Params);
1031#endif
1032
1033#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1034int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1035 uint32_t len);
1036
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301037QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001038 tSirAutoShutdownCmdParams *
1039 auto_sh_cmd);
1040#endif
1041
Manikandan Mohan976e7562016-03-15 16:33:31 -07001042#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001043int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1044QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1045QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001046QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1047#else
1048static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1049 uint32_t vdev_id)
1050{
1051 return QDF_STATUS_SUCCESS;
1052}
1053
1054static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1055 uint32_t vdev_id)
1056{
1057 return QDF_STATUS_SUCCESS;
1058}
1059
1060static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1061 uint32_t data_len)
1062{
1063 return 0;
1064}
1065
1066static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1067{
1068 return QDF_STATUS_E_INVAL;
1069}
1070#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001071QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001072
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301074QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001075#endif
1076
1077#ifdef DHCP_SERVER_OFFLOAD
1078int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1079 tSirDhcpSrvOffloadInfo *
1080 pDhcpSrvOffloadInfo);
1081#endif
1082
1083#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301084QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001085 tSirLedFlashingReq *flashing);
1086#endif
1087
1088#ifdef FEATURE_WLAN_CH_AVOID
1089int wma_channel_avoid_evt_handler(void *handle, uint8_t *event,
1090 uint32_t len);
1091
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301092QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001093 tSirChAvoidUpdateReq *
1094 ch_avoid_update_req);
1095#endif
1096
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001097
1098#ifdef FEATURE_WLAN_TDLS
1099
Himanshu Agarwal44195412016-03-09 13:03:54 +05301100QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001101int wma_update_tdls_peer_state(WMA_HANDLE handle,
1102 tTdlsPeerStateParams *peerStateParams);
1103/**
1104 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1105 * @handle: wma handle
1106 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1107 *
1108 * This function sets tdls off channel mode
1109 *
1110 * Return: 0 on success; negative errno otherwise
1111 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301112QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001113 tdls_chan_switch_params *chan_switch_params);
1114#endif
1115
Hong Shib90718f2017-02-20 00:57:22 +08001116void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001117void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1118
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001119int wma_rssi_breached_event_handler(void *handle,
1120 u_int8_t *cmd_param_info, u_int32_t len);
1121#ifdef WLAN_FEATURE_MEMDUMP
1122int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
1123 u_int32_t len);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301124QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001125 struct fw_dump_req *mem_dump_req);
1126#else
1127static inline int wma_fw_mem_dump_event_handler(void *handle,
1128 u_int8_t *cmd_param_info, u_int32_t len)
1129{
1130 return 0;
1131}
1132
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301133static inline QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134 void *mem_dump_req)
1135{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301136 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001137}
1138#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301139QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001140 struct vdev_ie_info *ie_info);
1141int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1142 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001143int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1144 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001145
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001146int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1147 uint32_t len);
1148void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1149 uint8_t type);
Peng Xu8fdaa492016-06-22 10:20:47 -07001150int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1151 uint32_t len);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301152
1153QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1154 struct sir_mac_pwr_dbg_cmd *
1155 sir_pwr_dbg_params);
1156
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301157#ifdef WLAN_FEATURE_DISA
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301158int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1159 uint32_t data_len);
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301160#else
1161static inline int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1162 uint32_t data_len)
1163{
1164 return 0;
1165}
1166#endif
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301167
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301168/**
1169 * wma_lost_link_info_handler() - collect lost link information and inform SME
1170 * @wma: WMA handle
1171 * @vdev_id: vdev ID
1172 * @rssi: rssi at disconnection time
1173 *
1174 * Return: none
1175 */
1176void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1177 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301178int wma_unified_power_debug_stats_event_handler(void *handle,
1179 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301180
1181#ifdef FEATURE_WLAN_DIAG_SUPPORT
1182/**
1183 * wma_sta_kickout_event()- send sta kickout event
1184 * @kickout_reason - reasoncode for kickout
1185 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1186 * @vdev_id: Unique id for identifying the VDEV
1187 *
1188 * This function sends sta kickout diag event
1189 *
1190 * Return: void.
1191 */
1192void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1193 uint8_t *macaddr);
1194#else
1195static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1196 uint8_t vdev_id, uint8_t *macaddr)
1197{
1198
1199};
1200#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1201
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001202/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001203 * wma_acquire_wakelock() - acquire the given wakelock
1204 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001205 * @msec: the wakelock duration in milliseconds
1206 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001207 * This also acquires the wma runtime pm lock.
1208 *
1209 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001210 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001211void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001212
1213/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001214 * wma_release_wakelock() - release the given wakelock
1215 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001216 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001217 * This also releases the wma runtime pm lock.
1218 *
1219 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001220 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001221void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001222
1223/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001224 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001225 * @wma: a reference to the global WMA handle
1226 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001227 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001228 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1229 * response from firmware to avoid power penalties. Alternatively, calling the
1230 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001231 *
1232 * Return: QDF_STATUS
1233 */
1234QDF_STATUS
1235wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1236
1237/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001238 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001239 * @wma: a reference to the global WMA handle
1240 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001241 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001242 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1243 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001244 *
1245 * Return: QDF_STATUS
1246 */
1247QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1248
Dustin Brownec2c92e2017-07-26 11:13:49 -07001249/**
1250 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1251 * @wma: a reference to the global WMA handle
1252 * @params: the vdev up params to send to firmware
1253 * @bssid: the BssId to send to firmware
1254 *
1255 * This also releases the vdev start wakelock.
1256 *
1257 * Return: QDF_STATUS
1258 */
1259QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1260 struct vdev_up_params *params,
1261 uint8_t bssid[IEEE80211_ADDR_LEN]);
1262
1263/**
1264 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1265 * @wma: a reference to the global WMA handle
1266 * @vdev_id: the Id of the vdev to down
1267 *
1268 * This also releases the vdev start wakelock.
1269 *
1270 * Return: QDF_STATUS
1271 */
1272QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1273
lifeng66831662017-05-19 16:01:35 +08001274/*
1275 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1276 * @handle: the wma handle
1277 * @event_buf: buffer with event
1278 * @len: buffer length
1279 *
1280 * This function receives rx aggregation failure event and then pass to upper
1281 * layer
1282 *
1283 * Return: 0 on success
1284 */
1285int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1286 u_int32_t len);
1287
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301288/**
1289 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1290 * @handle: the WMA handle
1291 * @event: buffer with the event parameters
1292 * @len: length of the buffer
1293 *
1294 * This function receives BT activity event from firmware and passes the event
1295 * information to upper layers
1296 *
1297 * Return: 0 on success
1298 */
1299int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1300 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001301#endif