blob: faf5d1ec089b71828504fcb679acced036c25598 [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
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530155/**
156 * wma_send_msg_by_priority() - Send wma message to PE with priority.
157 * @wma_handle: wma handle
158 * @msg_type: message type
159 * @body_ptr: message body ptr
160 * @body_val: message body value
161 * @is_high_priority: if msg is high priority
162 *
163 * Return: none
164 */
165void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
166 void *body_ptr, uint32_t body_val, bool is_high_priority);
167
168/**
169 * wma_send_msg() - Send wma message to PE.
170 * @wma_handle: wma handle
171 * @msg_type: message type
172 * @body_ptr: message body ptr
173 * @body_val: message body value
174 *
175 * Return: none
176 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800177void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
178 void *body_ptr, uint32_t body_val);
179
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530180/**
181 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
182 * @wma_handle: wma handle
183 * @msg_type: message type
184 * @body_ptr: message body ptr
185 * @body_val: message body value
186 *
187 * Return: none
188 */
189void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
190 void *body_ptr, uint32_t body_val);
191
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800192void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530193 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530195QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800196 int value);
197
198/*
199 * wma_scan_roam.c functions declarations
200 */
201
202#ifdef WLAN_FEATURE_ROAM_OFFLOAD
203void wma_process_roam_invoke(WMA_HANDLE handle,
204 struct wma_roam_invoke_cmd *roaminvoke);
205
206void wma_process_roam_synch_fail(WMA_HANDLE handle,
207 struct roam_offload_synch_fail *synch_fail);
208
209int wma_roam_synch_event_handler(void *handle, uint8_t *event,
210 uint32_t len);
211#endif
212
Kapil Gupta5cda2252016-12-29 18:44:26 +0530213/**
214 * wma_update_per_roam_config() -per roam config parameter updation to FW
215 * @handle: wma handle
216 * @req_buf: per roam config parameters
217 *
218 * Return: none
219 */
220void wma_update_per_roam_config(WMA_HANDLE handle,
221 struct wmi_per_roam_config_req *req_buf);
222
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530223QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800224 tSirScanOffloadReq *scan_req,
Sandeep Puligilla1fcdb772017-02-22 21:14:59 -0800225 struct scan_req_params *cmd);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800226
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530227QDF_STATUS wma_get_buf_stop_scan_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800228 wmi_buf_t *buf,
229 int *buf_len,
230 tAbortScanParams *abort_scan_req);
231
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530232QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233 tSirScanOffloadReq *scan_req, uint16_t msg_type);
234
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530235QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800236 tAbortScanParams *abort_scan_req);
237
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530238QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800239 tSirUpdateChanList *chan_list);
240
241#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530242QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530243 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244 roam_offload_params,
245 tSirRoamOffloadScanReq *roam_req);
246#endif
247
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530248QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800249 wmi_start_scan_cmd_fixed_param *
250 scan_cmd_fp,
251 tSirRoamOffloadScanReq *roam_req,
252 uint32_t mode, uint32_t vdev_id);
253
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700254/**
255 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
256 * @wma_handle: wma handle
257 * @roam_req: roam request param
258 *
259 * Fill the MAWC roaming parameters and send
260 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
261 *
262 * Return: QDF status
263 */
264QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
265 tSirRoamOffloadScanReq *roam_req);
266
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530267QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800268 tSirRoamOffloadScanReq *roam_req);
269
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530270QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 uint32_t scan_period,
272 uint32_t scan_age,
273 uint32_t vdev_id);
274
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530275QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800276 uint32_t vdev_id,
277 int32_t rssi_change_thresh,
278 uint32_t bcn_rssi_weight,
279 uint32_t hirssi_delay_btw_scans);
280
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530281QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800282 uint8_t chan_count,
283 uint8_t *chan_list,
284 uint8_t list_type, uint32_t vdev_id);
285
286A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
287 eCsrEncryptionType encr);
288
289A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
290
291void wma_roam_scan_fill_ap_profile(tp_wma_handle wma_handle,
292 tpAniSirGlobal pMac,
293 tSirRoamOffloadScanReq *roam_req,
294 wmi_ap_profile *ap_profile_p);
295
296void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
297 tpAniSirGlobal pMac,
298 tSirRoamOffloadScanReq *roam_req,
299 wmi_start_scan_cmd_fixed_param *
300 scan_params);
301
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530302QDF_STATUS wma_roam_scan_offload_ap_profile(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303 wmi_ap_profile *ap_profile_p,
304 uint32_t vdev_id);
305
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530306QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800307 A_INT32 first_bcnt,
308 A_UINT32 final_bcnt, uint32_t vdev_id);
309
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530310QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800311 uint32_t command, uint32_t vdev_id);
312
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530313QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800314 tpSwitchChannelParams params,
315 uint8_t vdev_id);
316
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530317QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800318 tpSwitchChannelParams params,
319 uint8_t vdev_id);
320
321void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
322 uint8_t vdev_id,
323 wmi_scan_event_fixed_param *
324 wmi_event);
325
326void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
327
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800328#ifdef WLAN_FEATURE_ROAM_OFFLOAD
329void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
330#endif
331
332#ifdef FEATURE_WLAN_EXTSCAN
333
334int wma_extscan_start_stop_event_handler(void *handle,
335 uint8_t *cmd_param_info,
336 uint32_t len);
337
338int wma_extscan_operations_event_handler(void *handle,
339 uint8_t *cmd_param_info,
340 uint32_t len);
341
342int wma_extscan_table_usage_event_handler(void *handle,
343 uint8_t *cmd_param_info,
344 uint32_t len);
345
346int wma_extscan_capabilities_event_handler(void *handle,
347 uint8_t *cmd_param_info,
348 uint32_t len);
349
350int wma_extscan_hotlist_match_event_handler(void *handle,
351 uint8_t *cmd_param_info,
352 uint32_t len);
353
354int wma_extscan_cached_results_event_handler(void *handle,
355 uint8_t *cmd_param_info,
356 uint32_t len);
357
358int wma_extscan_change_results_event_handler(void *handle,
359 uint8_t *cmd_param_info,
360 uint32_t len);
361
362int wma_passpoint_match_event_handler(void *handle,
363 uint8_t *cmd_param_info,
364 uint32_t len);
365
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800366#endif
367
368void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
369
370#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530371QDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800372 tSirWifiScanCmdReqParams *pstart,
373 wmi_buf_t *buf, int *buf_len);
374
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530375QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376 tSirWifiScanCmdReqParams *pstart);
377
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530378QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379 tSirExtScanStopReqParams *pstopcmd);
380
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530381QDF_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800382 tSirExtScanSetBssidHotListReqParams *
383 photlist, int *buf_len);
384
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530385QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386 tSirExtScanSetBssidHotListReqParams
387 *photlist);
388
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530389QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700390 tSirExtScanResetBssidHotlistReqParams *photlist_reset);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800391
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530392QDF_STATUS wma_get_buf_extscan_change_monitor_cmd(tp_wma_handle wma_handle,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700393 tSirExtScanSetSigChangeReqParams *psigchange,
394 wmi_buf_t *buf, int *buf_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530396QDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800397 tSirExtScanSetSigChangeReqParams *
398 psigchange);
399
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530400QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700401 tSirExtScanResetSignificantChangeReqParams *pResetReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530403QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404 tSirExtScanGetCachedResultsReqParams *
405 pcached_results);
406
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530407QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800408 tSirGetExtScanCapabilitiesReqParams *
409 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530410QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800411 struct wifi_epno_params *req);
412
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530413QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800414 struct wifi_passpoint_req *req);
415
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530416QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800417 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800418#endif
419
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530420QDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800421 struct sir_ipa_offload_enable_disable *ipa_offload);
422
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423void wma_process_unit_test_cmd(WMA_HANDLE handle,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700424 t_wma_unit_test_cmd *wma_utest);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800425
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530426QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800427
428int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
429
430void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
431
432int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
433 uint32_t len);
434
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800435#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800436void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
437static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
438 uint8_t vdev_id)
439{
440 return wma->interfaces[vdev_id].roam_synch_in_progress;
441}
442#else
443static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
444 uint8_t vdev_id)
445{
446 return false;
447}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700448static inline uint32_t wma_roam_scan_get_cckm_mode(
449 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
450{
451 return WMI_AUTH_CCKM;
452}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800453#endif
454
455/*
456 * wma_dev_if.c functions declarations
457 */
458
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800459struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800460 uint8_t *vdev_id);
461
462/**
463 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
464 * @wma - wma handle
465 * @vdev_id - vdev ID
466 *
467 * Return: Returns vdev handle if given vdev id is valid.
468 * Otherwise returns NULL.
469 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800470static inline
471struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800472{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700473 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474 return NULL;
475
476 return wma->interfaces[vdev_id].handle;
477}
478
479/**
480 * wma_get_vdev_count() - Returns number of active vdev.
481 * @wma - wma handle
482 *
483 * Return: Returns valid vdev count.
484 */
485static inline uint8_t wma_get_vdev_count(tp_wma_handle wma)
486{
487 uint8_t vdev_count = 0, i;
488
489 for (i = 0; i < wma->max_bssid; i++) {
490 if (wma->interfaces[i].handle)
491 vdev_count++;
492 }
493 return vdev_count;
494}
495
496bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
497
498#ifdef QCA_IBSS_SUPPORT
499bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700500#else
501/**
502 * wma_is_vdev_in_ibss_mode(): dummy function
503 * @wma: wma handle
504 * @vdev_id: vdev id
505 *
506 * Return false since no vdev can be in ibss mode without ibss support
507 */
508static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700509bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700510{
511 return false;
512}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800513#endif
514
515/**
Houston Hoffman79b4af22015-10-06 12:01:08 -0700516 * wma_is_vdev_in_beaconning_mode() - check if vdev is in a beaconning mode
517 * @wma: wma handle
518 * @vdev_id: vdev id
519 *
520 * Helper function to know whether given vdev id
521 * is in a beaconning mode or not.
522 *
523 * Return: True if vdev needs to beacon.
524 */
525static inline
526bool wma_is_vdev_in_beaconning_mode(tp_wma_handle wma, uint8_t vdev_id)
527{
528 return wma_is_vdev_in_ap_mode(wma, vdev_id) ||
529 wma_is_vdev_in_ibss_mode(wma, vdev_id);
530}
531
532/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
534 * @wma - wma handle
535 * @vdev_id - vdev ID
536 *
537 * Return: Returns pointer to bssid on success,
538 * otherwise returns NULL.
539 */
540static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
541 uint8_t vdev_id)
542{
543 if (vdev_id >= wma->max_bssid)
544 return NULL;
545
546 return wma->interfaces[vdev_id].bssid;
547}
548
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800549struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550 uint8_t *vdev_id);
551
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530552QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800553 struct del_sta_self_params *pdel_sta_self_req_param,
554 uint8_t generateRsp);
555
556int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
557 uint32_t len);
558
Govind Singhd76a5b02016-03-08 15:12:14 +0530559QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800560 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800561void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700562 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800563 bool roam_synch_in_progress);
564
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800565QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
566 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800567 u8 peer_addr[IEEE80211_ADDR_LEN],
568 uint32_t peer_type, uint8_t vdev_id,
569 bool roam_synch_in_progress);
570
571int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
572 u32 len);
573
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800574struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800575 struct add_sta_self_params *self_sta_req,
576 uint8_t generateRsp);
577
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700578QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
579 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800580
581void wma_vdev_resp_timer(void *data);
582
583struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
584 uint8_t vdev_id,
585 uint32_t msg_type, uint8_t type,
586 void *params, uint32_t timeout);
587
588void wma_hold_req_timer(void *data);
589struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
590 uint8_t vdev_id, uint32_t msg_type,
591 uint8_t type, void *params,
592 uint32_t timeout);
593
594void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
595 uint8_t type);
596
597void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
598
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
600
601void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
602
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800603void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
604
605int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
606
607void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
608 tpDisableIntraBssFwd pdis_intra_fwd);
609
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700610void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
611
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800612uint32_t wma_get_bcn_rate_code(uint16_t rate);
613
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800614/*
615 * wma_mgmt.c functions declarations
616 */
617
618int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
619
620int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
621
Dustin Browne2206fb2017-04-20 13:39:25 -0700622int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800623
624int wma_unified_bcntx_status_event_handler(void *handle,
625 uint8_t *cmd_param_info,
626 uint32_t len);
627
mukul sharma72c8b222015-09-04 17:02:01 +0530628void wma_set_sta_sa_query_param(tp_wma_handle wma,
629 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800630
631void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
632 uint32_t method, uint32_t timeperiod,
633 uint8_t *hostv4addr, uint8_t *destv4addr,
634 uint8_t *destmac);
635
636int wma_vdev_install_key_complete_event_handler(void *handle,
637 uint8_t *event,
638 uint32_t len);
639
Govind Singhb30d4c02016-03-24 11:01:23 +0530640QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800641 tSirNwType nw_type,
642 tpAddStaParams params);
643
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530644QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
645 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646 gtx_config_t *gtx_info);
647
648void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
649 uint8_t llbcoexist);
650
651void wma_process_update_beacon_params(tp_wma_handle wma,
652 tUpdateBeaconParams *bcn_params);
653
Rajeev Kumar416b73f2017-01-21 16:45:21 -0800654void wma_update_cfg_params(tp_wma_handle wma, struct scheduler_msg *cfgParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655
656void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
657
658void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
659 uint8_t vdev_id,
660 int8_t peer_num_delta);
661
662void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
663
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530664QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800665 tEdcaParams *edca_params);
666
667int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
668 uint32_t len);
669
670void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
671 tpSendProbeRespParams probe_rsp_info);
672
673void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
674
675void wma_set_keepalive_req(tp_wma_handle wma,
676 tSirKeepAliveReq *keepalive);
677
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530678void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
679 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680
681void wma_process_update_opmode(tp_wma_handle wma_handle,
682 tUpdateVHTOpMode *update_vht_opmode);
683
684void wma_process_update_rx_nss(tp_wma_handle wma_handle,
685 tUpdateRxNss *update_rx_nss);
686
687void wma_process_update_membership(tp_wma_handle wma_handle,
688 tUpdateMembership *membership);
689
690void wma_process_update_userpos(tp_wma_handle wma_handle,
691 tUpdateUserPos *userpos);
692
693void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
694 tHalHiddenSsidVdevRestart *pReq);
695
696/*
697 * wma_power.c functions declarations
698 */
699
700void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
701
Govind Singhd76a5b02016-03-08 15:12:14 +0530702QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703 uint32_t vdev_id, uint32_t param,
704 uint32_t value);
705
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530706QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800707wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
708
Govind Singhd76a5b02016-03-08 15:12:14 +0530709QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800710 uint8_t *peer_addr, uint8_t uapsd_value,
711 uint8_t max_sp);
712
713void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Govind Singh19931aa2017-06-13 16:53:26 +0530714 struct wmi_host_wme_vparams *wmm_param, int ac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715
716void wma_set_tx_power(WMA_HANDLE handle,
717 tMaxTxPowerParams *tx_pwr_params);
718
719void wma_set_max_tx_power(WMA_HANDLE handle,
720 tMaxTxPowerParams *tx_pwr_params);
721
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800722void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
723
724void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
725
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700726void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800727
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530728QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800729
730int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
731 uint32_t len);
732
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530733QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800734 tSirTxPowerLimit *ptxlim);
735
736void wma_update_noa(struct beacon_info *beacon,
737 struct p2p_sub_element_noa *noa_ie);
738
739void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
740 struct p2p_sub_element_noa *noa_ie);
741
742int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
743 uint32_t len);
744
745void wma_process_set_p2pgo_noa_req(tp_wma_handle wma,
746 tP2pPsParams *ps_params);
747
748void wma_process_set_mimops_req(tp_wma_handle wma_handle,
749 tSetMIMOPS *mimops);
750
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530751QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800752
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530753QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754 tSirModemPowerStateInd *pReq);
755
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530756QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800757 int value);
758
759void wma_set_suspend_dtim(tp_wma_handle wma);
760
761void wma_set_resume_dtim(tp_wma_handle wma);
762
763/*
764 * wma_data.c functions declarations
765 */
766
767
768void wma_set_bss_rate_flags(struct wma_txrx_node *iface,
769 tpAddBssParams add_bss);
770
771int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
772
Jiachao Wu08719b02017-07-05 13:05:34 +0800773/**
774 * wma_check_txrx_chainmask() - check txrx chainmask
775 * @num_rf_chains: number of rf chains
776 * @cmd_value: command value
777 *
778 * Return: QDF_STATUS_SUCCESS for success or error code
779 */
780QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800781
782int wma_peer_state_change_event_handler(void *handle,
783 uint8_t *event_buff,
784 uint32_t len);
785
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530786QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800787 mcc_adaptive_scheduler);
788
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530789QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800790 (tp_wma_handle wma,
791 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
792
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530793QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800794 (tp_wma_handle wma,
795 uint32_t adapter_1_chan_number,
796 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
797
798void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
799
800void wma_unpause_vdev(tp_wma_handle wma);
801
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530802QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800803 tSirRateUpdateInd *
804 pRateUpdateParams);
805
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530806QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800807
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530808QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800809
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530810#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
811 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
812
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800813int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
814 uint32_t len);
815#endif
816
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530817#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
818QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
819 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700820#else
821static inline QDF_STATUS
822wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
823 struct t_bad_peer_txtcl_config *config)
824{
825 return QDF_STATUS_E_FAILURE;
826}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530827#endif
828
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530829QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830 t_thermal_mgmt *pThermalParams);
831
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530832QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 uint8_t thermal_level);
834
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530835QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836 t_thermal_cmd_params thermal_info);
837
838int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
839 uint32_t len);
840
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800841int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
842 uint32_t len);
843
844int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
845 uint32_t len);
846
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800847/*
848 * wma_utils.c functions declarations
849 */
850
851#ifdef WLAN_FEATURE_STATS_EXT
852int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
853 uint32_t len);
854#endif
855
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700856enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800857int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800858
859#ifdef WLAN_FEATURE_LINK_LAYER_STATS
860void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
861
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530862QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
864
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530865QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800866 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
867
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530868QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700869 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800870
871int wma_unified_link_iface_stats_event_handler(void *handle,
872 uint8_t *cmd_param_info,
873 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800874void wma_config_stats_ext_threshold(tp_wma_handle wma,
875 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800876#endif
877
878void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
879 uint8_t link_status);
880
881int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
882 uint32_t len);
883
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530884/**
885 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
886 * @wmi_event: WMI event
887 *
888 * This function is used to send RSO command status to upper layer
889 *
890 * Return: 0 for success
891 */
892int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
893
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800894int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
895 uint32_t len);
896
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530897QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800898
899int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
900 uint32_t len);
901
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530902QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800903
904int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
905 uint32_t len);
906
907bool wma_is_sap_active(tp_wma_handle wma_handle);
908
909bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
910
911bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
912
913bool wma_is_sta_active(tp_wma_handle wma_handle);
914
915WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
916 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800917 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800918
919int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
920 uint8_t vdev_id, uint32_t value);
921
922int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
923 uint8_t vdev_id, uint32_t value);
924
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800925void wma_get_stats_req(WMA_HANDLE handle,
926 tAniGetPEStatsReq *get_stats_param);
927
928#if defined(QCA_WIFI_FTM)
929void wma_utf_detach(tp_wma_handle wma_handle);
930
931void wma_utf_attach(tp_wma_handle wma_handle);
932
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530933QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800934wma_process_ftm_command(tp_wma_handle wma_handle,
935 struct ar6k_testmode_cmd_data *msg_buffer);
936#endif
937
938/*
939 * wma_features.c functions declarations
940 */
941
942void wma_process_link_status_req(tp_wma_handle wma,
943 tAniGetLinkStatus *pGetLinkStatus);
944
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530945QDF_STATUS wma_process_dhcp_ind(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800946 tAniDHCPInd *ta_dhcp_ind);
947
Will Huanga9814592017-05-24 15:47:58 +0800948QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
949 struct sir_peer_info_req *peer_info_req);
950
951/**
952 * wma_get_peer_info_ext() - get peer info
953 * @handle: wma interface
954 * @peer_info_req: get peer info request information
955 *
956 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
957 *
958 * Return: 0 on success, otherwise error value
959 */
960QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
961 struct sir_peer_info_ext_req *peer_info_req);
962
963/**
964 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
965 * @handle: WMA global handle
966 * @cmd_param_info: Command event data
967 * @len: Length of cmd_param_info
968 *
969 * This function will handle WMI_PEER_STATS_INFO_EVENTID
970 *
971 * Return: 0 on success, error code otherwise
972 */
973int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
974 u_int32_t len);
975
Govind Singha471e5e2015-10-12 17:11:14 +0530976int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
977 uint32_t len);
978
Govind Singhf25a0f12016-03-08 16:09:48 +0530979QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530980 uint32_t cmd, uint32_t value1, uint32_t value2);
981
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800982void wma_wow_tx_complete(void *wma);
983
984int wmi_unified_nat_keepalive_enable(tp_wma_handle wma, uint8_t vdev_id);
985
Govind Singhd76a5b02016-03-08 15:12:14 +0530986int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800987
988#ifdef WLAN_FEATURE_NAN
989int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
990#endif
991
992#ifdef FEATURE_WLAN_TDLS
993int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
994#endif
995
996int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
997
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800998#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -0800999int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1000 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001#endif
1002
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001003#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301004QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001005 struct ath_pktlog_wmi_params *params);
1006#endif
1007
1008int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1009 uint32_t len);
1010int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1011
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301012QDF_STATUS wma_wow_add_pattern(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013 struct wow_add_pattern *ptrn);
1014
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301015QDF_STATUS wma_wow_delete_user_pattern(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001016 struct wow_delete_pattern *pattern);
1017
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301018QDF_STATUS wma_wow_enter(tp_wma_handle wma, tpSirHalWowlEnterParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001019
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301020QDF_STATUS wma_wow_exit(tp_wma_handle wma, tpSirHalWowlExitParams info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001021
Houston Hoffmana76591b2015-11-10 16:52:05 -08001022void wma_calculate_and_update_conn_state(tp_wma_handle wma);
1023void wma_update_conn_state(tp_wma_handle wma, uint32_t conn_mask);
Houston Hoffman7260ecb2015-10-05 18:43:07 -07001024void wma_update_conn_state(tp_wma_handle wma, uint32_t conn_mask);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025
1026void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
1027
1028void wma_aggr_qos_req(tp_wma_handle wma,
1029 tAggrAddTsParams *pAggrQosRspMsg);
1030
1031void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
1032
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001033#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301034QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001035 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001036QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
1037QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
1038void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039#endif
1040
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301041QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1042 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001043QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1044
1045QDF_STATUS wma_process_get_peer_info_req
1046 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1047
1048QDF_STATUS wma_process_tx_fail_monitor_ind
1049 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1050
1051QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1052
1053QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1054
1055QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
1056
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301057QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058 tSirAddPeriodicTxPtrn *
1059 pAddPeriodicTxPtrnParams);
1060
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301061QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001062 tSirDelPeriodicTxPtrn *
1063 pDelPeriodicTxPtrnParams);
1064
1065#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301066QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001067#endif
1068
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301069QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1070 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001071
1072#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301073QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001074
1075int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1076 tpSirAppType1Params appType1Params);
1077
Himanshu Agarwal44195412016-03-09 13:03:54 +05301078QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001079 tpSirAppType2Params appType2Params);
1080#endif
1081
1082#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1083int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1084 uint32_t len);
1085
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301086QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001087 tSirAutoShutdownCmdParams *
1088 auto_sh_cmd);
1089#endif
1090
Manikandan Mohan976e7562016-03-15 16:33:31 -07001091#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001092int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1093QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1094QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001095QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1096#else
1097static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1098 uint32_t vdev_id)
1099{
1100 return QDF_STATUS_SUCCESS;
1101}
1102
1103static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1104 uint32_t vdev_id)
1105{
1106 return QDF_STATUS_SUCCESS;
1107}
1108
1109static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1110 uint32_t data_len)
1111{
1112 return 0;
1113}
1114
1115static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1116{
1117 return QDF_STATUS_E_INVAL;
1118}
1119#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001120QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001121
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001122#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301123QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001124#endif
1125
1126#ifdef DHCP_SERVER_OFFLOAD
1127int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1128 tSirDhcpSrvOffloadInfo *
1129 pDhcpSrvOffloadInfo);
1130#endif
1131
1132#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301133QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134 tSirLedFlashingReq *flashing);
1135#endif
1136
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001137
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301138QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001139 tSirChAvoidUpdateReq *
1140 ch_avoid_update_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001141
1142#ifdef FEATURE_WLAN_TDLS
1143
Himanshu Agarwal44195412016-03-09 13:03:54 +05301144QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001145int wma_update_tdls_peer_state(WMA_HANDLE handle,
1146 tTdlsPeerStateParams *peerStateParams);
1147/**
1148 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1149 * @handle: wma handle
1150 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1151 *
1152 * This function sets tdls off channel mode
1153 *
1154 * Return: 0 on success; negative errno otherwise
1155 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301156QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001157 tdls_chan_switch_params *chan_switch_params);
1158#endif
1159
Hong Shib90718f2017-02-20 00:57:22 +08001160void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001161void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1162
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001163int wma_rssi_breached_event_handler(void *handle,
1164 u_int8_t *cmd_param_info, u_int32_t len);
1165#ifdef WLAN_FEATURE_MEMDUMP
1166int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
1167 u_int32_t len);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301168QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001169 struct fw_dump_req *mem_dump_req);
1170#else
1171static inline int wma_fw_mem_dump_event_handler(void *handle,
1172 u_int8_t *cmd_param_info, u_int32_t len)
1173{
1174 return 0;
1175}
1176
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301177static inline QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178 void *mem_dump_req)
1179{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301180 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001181}
1182#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301183QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001184 struct vdev_ie_info *ie_info);
1185int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1186 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001187int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1188 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001189
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001190int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1191 uint32_t len);
1192void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1193 uint8_t type);
Peng Xu8fdaa492016-06-22 10:20:47 -07001194int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1195 uint32_t len);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301196
1197QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1198 struct sir_mac_pwr_dbg_cmd *
1199 sir_pwr_dbg_params);
1200
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301201#ifdef WLAN_FEATURE_DISA
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301202int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1203 uint32_t data_len);
Padma, Santhosh Kumar72e7aec2016-10-12 17:23:44 +05301204#else
1205static inline int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data,
1206 uint32_t data_len)
1207{
1208 return 0;
1209}
1210#endif
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05301211
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301212/**
1213 * wma_lost_link_info_handler() - collect lost link information and inform SME
1214 * @wma: WMA handle
1215 * @vdev_id: vdev ID
1216 * @rssi: rssi at disconnection time
1217 *
1218 * Return: none
1219 */
1220void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1221 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301222int wma_unified_power_debug_stats_event_handler(void *handle,
1223 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301224
1225#ifdef FEATURE_WLAN_DIAG_SUPPORT
1226/**
1227 * wma_sta_kickout_event()- send sta kickout event
1228 * @kickout_reason - reasoncode for kickout
1229 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1230 * @vdev_id: Unique id for identifying the VDEV
1231 *
1232 * This function sends sta kickout diag event
1233 *
1234 * Return: void.
1235 */
1236void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1237 uint8_t *macaddr);
1238#else
1239static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1240 uint8_t vdev_id, uint8_t *macaddr)
1241{
1242
1243};
1244#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1245
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001246/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001247 * wma_acquire_wakelock() - acquire the given wakelock
1248 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001249 * @msec: the wakelock duration in milliseconds
1250 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001251 * This also acquires the wma runtime pm lock.
1252 *
1253 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001254 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001255void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001256
1257/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001258 * wma_release_wakelock() - release the given wakelock
1259 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001260 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001261 * This also releases the wma runtime pm lock.
1262 *
1263 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001264 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001265void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001266
1267/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001268 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001269 * @wma: a reference to the global WMA handle
1270 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001271 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001272 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1273 * response from firmware to avoid power penalties. Alternatively, calling the
1274 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001275 *
1276 * Return: QDF_STATUS
1277 */
1278QDF_STATUS
1279wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1280
1281/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001282 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001283 * @wma: a reference to the global WMA handle
1284 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001285 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001286 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1287 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001288 *
1289 * Return: QDF_STATUS
1290 */
1291QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1292
Dustin Brownec2c92e2017-07-26 11:13:49 -07001293/**
1294 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1295 * @wma: a reference to the global WMA handle
1296 * @params: the vdev up params to send to firmware
1297 * @bssid: the BssId to send to firmware
1298 *
1299 * This also releases the vdev start wakelock.
1300 *
1301 * Return: QDF_STATUS
1302 */
1303QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1304 struct vdev_up_params *params,
1305 uint8_t bssid[IEEE80211_ADDR_LEN]);
1306
1307/**
1308 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1309 * @wma: a reference to the global WMA handle
1310 * @vdev_id: the Id of the vdev to down
1311 *
1312 * This also releases the vdev start wakelock.
1313 *
1314 * Return: QDF_STATUS
1315 */
1316QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1317
lifeng66831662017-05-19 16:01:35 +08001318/*
1319 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1320 * @handle: the wma handle
1321 * @event_buf: buffer with event
1322 * @len: buffer length
1323 *
1324 * This function receives rx aggregation failure event and then pass to upper
1325 * layer
1326 *
1327 * Return: 0 on success
1328 */
1329int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1330 u_int32_t len);
1331
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301332/**
1333 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1334 * @handle: the WMA handle
1335 * @event: buffer with the event parameters
1336 * @len: length of the buffer
1337 *
1338 * This function receives BT activity event from firmware and passes the event
1339 * information to upper layers
1340 *
1341 * Return: 0 on success
1342 */
1343int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1344 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001345
1346/**
1347 * wma_peer_ant_info_evt_handler - event handler to handle antenna info
1348 * @handle: the wma handle
1349 * @event: buffer with event
1350 * @len: buffer length
1351 *
1352 * This function receives antenna info from firmware and passes the event
1353 * to upper layer
1354 *
1355 * Return: 0 on success
1356 */
1357int wma_peer_ant_info_evt_handler(void *handle, u_int8_t *event,
1358 u_int32_t len);
1359
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001360#endif