blob: bba583ef49402e645dd1c73c2c37eac4dce56338 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Nachiket Kukade2c73ade2017-12-20 17:30:36 +05302 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef WMA_INTERNAL_H
20#define WMA_INTERNAL_H
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080021#include <cdp_txrx_handle.h>
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070022#if !defined(REMOVE_PKT_LOG)
23#include "pktlog_ac.h"
24#endif
25
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080026/* ################### defines ################### */
27/*
28 * TODO: Following constant should be shared by firwmare in
29 * wmi_unified.h. This will be done once wmi_unified.h is updated.
30 */
31#define WMI_PEER_STATE_AUTHORIZED 0x2
32
33#define WMA_2_4_GHZ_MAX_FREQ 3000
34#define WOW_CSA_EVENT_OFFSET 12
35
36#define WMA_DEFAULT_SCAN_REQUESTER_ID 1
37#define WMI_SCAN_FINISH_EVENTS (WMI_SCAN_EVENT_START_FAILED | \
38 WMI_SCAN_EVENT_COMPLETED | \
39 WMI_SCAN_EVENT_DEQUEUED)
40/* default value */
41#define DEFAULT_INFRA_STA_KEEP_ALIVE_PERIOD 20
mukul sharma72c8b222015-09-04 17:02:01 +053042#define DEFAULT_STA_SA_QUERY_MAX_RETRIES_COUNT (5)
43#define DEFAULT_STA_SA_QUERY_RETRY_INTERVAL (200)
44
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045/* pdev vdev and peer stats*/
46#define FW_PDEV_STATS_SET 0x1
47#define FW_VDEV_STATS_SET 0x2
48#define FW_PEER_STATS_SET 0x4
Himanshu Agarwal37e42412016-07-21 14:35:09 +053049#define FW_RSSI_PER_CHAIN_STATS_SET 0x8
50#define FW_STATS_SET 0xf
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051
52/*AR9888/AR6320 noise floor approx value
53 * similar to the mentioned the WMA
54 */
55#define WMA_TGT_NOISE_FLOOR_DBM (-96)
Naveen Rawatf440a132017-05-05 12:27:39 -070056#define WMA_TGT_MAX_SNR (WMA_TGT_NOISE_FLOOR_DBM * (-1))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057
58/*
59 * Make sure that link monitor and keep alive
60 * default values should be in sync with CFG.
61 */
62#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
63#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
64
65#define AGC_DUMP 1
66#define CHAN_DUMP 2
67#define WD_DUMP 3
68#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
69#define PCIE_DUMP 4
70#endif
71
72/* conformance test limits */
73#define FCC 0x10
74#define MKK 0x40
75#define ETSI 0x30
76
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
78
79#define WMI_MCC_MIN_CHANNEL_QUOTA 20
80#define WMI_MCC_MAX_CHANNEL_QUOTA 80
81#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
82
83/* The maximum number of patterns that can be transmitted by the firmware
84 * and maximum patterns size.
85 */
jsreekumac44b922018-06-12 20:18:39 +053086#ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
jsreekumac44b922018-06-12 20:18:39 +053088#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089
90#define WMI_MAX_HOST_CREDITS 2
91#define WMI_WOW_REQUIRED_CREDITS 1
92
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080093#define WMI_MAX_MHF_ENTRIES 32
94
95
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080096#define MAX_HT_MCS_IDX 8
97#define MAX_VHT_MCS_IDX 10
98#define INVALID_MCS_IDX 255
99
100#define LINK_STATUS_LEGACY 0
101#define LINK_STATUS_VHT 0x1
102#define LINK_STATUS_MIMO 0x2
103#define LINK_SUPPORT_VHT 0x4
104#define LINK_SUPPORT_MIMO 0x8
105
106#define LINK_RATE_VHT 0x3
107
108#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -0700109#define MAX_ENTRY_VDEV_RESP_QUEUE 10
110
Krishna Kumaar Natarajanb7f9a352016-03-18 11:40:07 -0700111/* Time(in ms) to detect DOS attack */
112#define WMA_MGMT_FRAME_DETECT_DOS_TIMER 1000
113
Himanshu Agarwala1539d32017-10-11 18:08:56 +0530114#define MAX_NUM_HW_MODE 0xff
115#define MAX_NUM_PHY 0xff
116
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800117/**
118 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800119 * @mcs_index: mcs rate index
120 * @ht20_rate: HT20 supported rate table
121 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122 */
123struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800124 uint8_t mcs_index;
125 uint16_t ht20_rate[2];
126 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800127};
128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129/**
130 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800131 * @mcs_index: mcs rate index
132 * @ht20_rate: VHT20 supported rate table
133 * @ht40_rate: VHT40 supported rate table
134 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800135 */
136struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800137 uint8_t mcs_index;
138 uint16_t ht20_rate[2];
139 uint16_t ht40_rate[2];
140 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142
Wen Gong7952fbd2018-04-18 11:27:23 +0800143struct tSirWifiScanCmdReqParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144/*
145 * wma_main.c functions declarations
146 */
147
148int
149wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
150 uint32_t param_value);
151
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530152/**
153 * wma_send_msg_by_priority() - Send wma message to PE with priority.
154 * @wma_handle: wma handle
155 * @msg_type: message type
156 * @body_ptr: message body ptr
157 * @body_val: message body value
158 * @is_high_priority: if msg is high priority
159 *
160 * Return: none
161 */
162void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
163 void *body_ptr, uint32_t body_val, bool is_high_priority);
164
165/**
166 * wma_send_msg() - Send wma message to PE.
167 * @wma_handle: wma handle
168 * @msg_type: message type
169 * @body_ptr: message body ptr
170 * @body_val: message body value
171 *
172 * Return: none
173 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
175 void *body_ptr, uint32_t body_val);
176
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530177/**
178 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
179 * @wma_handle: wma handle
180 * @msg_type: message type
181 * @body_ptr: message body ptr
182 * @body_val: message body value
183 *
184 * Return: none
185 */
186void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
187 void *body_ptr, uint32_t body_val);
188
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800189void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530190 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530192QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800193 int value);
194
195/*
196 * wma_scan_roam.c functions declarations
197 */
198
199#ifdef WLAN_FEATURE_ROAM_OFFLOAD
200void wma_process_roam_invoke(WMA_HANDLE handle,
201 struct wma_roam_invoke_cmd *roaminvoke);
202
203void wma_process_roam_synch_fail(WMA_HANDLE handle,
204 struct roam_offload_synch_fail *synch_fail);
205
206int wma_roam_synch_event_handler(void *handle, uint8_t *event,
207 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530208
209/**
210 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
211 * @handle: wma handle
212 * @event: event data
213 * @len: length of data
214 *
215 * This function is roam synch frame event handler.
216 *
217 * Return: Success or Failure status
218 */
219int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
220 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800221#endif
222
Kapil Gupta5cda2252016-12-29 18:44:26 +0530223/**
224 * wma_update_per_roam_config() -per roam config parameter updation to FW
225 * @handle: wma handle
226 * @req_buf: per roam config parameters
227 *
228 * Return: none
229 */
230void wma_update_per_roam_config(WMA_HANDLE handle,
231 struct wmi_per_roam_config_req *req_buf);
232
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530233QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 tSirUpdateChanList *chan_list);
235
236#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530237QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530238 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800239 roam_offload_params,
240 tSirRoamOffloadScanReq *roam_req);
241#endif
242
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530243QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244 wmi_start_scan_cmd_fixed_param *
245 scan_cmd_fp,
246 tSirRoamOffloadScanReq *roam_req,
247 uint32_t mode, uint32_t vdev_id);
248
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700249/**
250 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
251 * @wma_handle: wma handle
252 * @roam_req: roam request param
253 *
254 * Fill the MAWC roaming parameters and send
255 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
256 *
257 * Return: QDF status
258 */
259QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
260 tSirRoamOffloadScanReq *roam_req);
261
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530262QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263 tSirRoamOffloadScanReq *roam_req);
264
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530265QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 uint32_t scan_period,
267 uint32_t scan_age,
268 uint32_t vdev_id);
269
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530270QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 uint32_t vdev_id,
272 int32_t rssi_change_thresh,
273 uint32_t bcn_rssi_weight,
274 uint32_t hirssi_delay_btw_scans);
275
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530276QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 uint8_t chan_count,
278 uint8_t *chan_list,
279 uint8_t list_type, uint32_t vdev_id);
280
281A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
282 eCsrEncryptionType encr);
283
284A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
285
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800286void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
287 tpAniSirGlobal pMac,
288 tSirRoamOffloadScanReq *roam_req,
289 wmi_start_scan_cmd_fixed_param *
290 scan_params);
291
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530292QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293 A_INT32 first_bcnt,
294 A_UINT32 final_bcnt, uint32_t vdev_id);
295
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530296QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297 uint32_t command, uint32_t vdev_id);
298
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530299QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800300 tpSwitchChannelParams params,
301 uint8_t vdev_id);
302
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530303QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304 tpSwitchChannelParams params,
305 uint8_t vdev_id);
306
307void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
308 uint8_t vdev_id,
309 wmi_scan_event_fixed_param *
310 wmi_event);
311
312void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
313
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800314#ifdef WLAN_FEATURE_ROAM_OFFLOAD
315void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
316#endif
317
318#ifdef FEATURE_WLAN_EXTSCAN
319
320int wma_extscan_start_stop_event_handler(void *handle,
321 uint8_t *cmd_param_info,
322 uint32_t len);
323
324int wma_extscan_operations_event_handler(void *handle,
325 uint8_t *cmd_param_info,
326 uint32_t len);
327
328int wma_extscan_table_usage_event_handler(void *handle,
329 uint8_t *cmd_param_info,
330 uint32_t len);
331
332int wma_extscan_capabilities_event_handler(void *handle,
333 uint8_t *cmd_param_info,
334 uint32_t len);
335
336int wma_extscan_hotlist_match_event_handler(void *handle,
337 uint8_t *cmd_param_info,
338 uint32_t len);
339
340int wma_extscan_cached_results_event_handler(void *handle,
341 uint8_t *cmd_param_info,
342 uint32_t len);
343
344int wma_extscan_change_results_event_handler(void *handle,
345 uint8_t *cmd_param_info,
346 uint32_t len);
347
348int wma_passpoint_match_event_handler(void *handle,
349 uint8_t *cmd_param_info,
350 uint32_t len);
351
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#endif
353
Wen Gong7952fbd2018-04-18 11:27:23 +0800354#ifdef FEATURE_WLAN_EXTSCAN
355int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
356
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
358
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530359QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360 tSirWifiScanCmdReqParams *pstart);
361
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530362QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363 tSirExtScanStopReqParams *pstopcmd);
364
Jeff Johnson1148cb02018-07-13 23:14:32 -0700365/**
366 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
367 * @wma: wma handle
368 * @params: hotlist request params
369 *
370 * This function configures hotlist monitor in fw.
371 *
372 * Return: QDF status
373 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530374QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700375 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530377QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700378 tSirExtScanResetBssidHotlistReqParams *photlist_reset);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530380QDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381 tSirExtScanSetSigChangeReqParams *
382 psigchange);
383
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530384QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700385 tSirExtScanResetSignificantChangeReqParams *pResetReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530387QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388 tSirExtScanGetCachedResultsReqParams *
389 pcached_results);
390
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530391QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800392 tSirGetExtScanCapabilitiesReqParams *
393 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530394QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395 struct wifi_epno_params *req);
396
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530397QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398 struct wifi_passpoint_req *req);
399
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530400QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800401 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402#endif
403
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530404QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800405
406int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
407
408void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
409
410int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
411 uint32_t len);
412
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800413#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800414void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
415static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
416 uint8_t vdev_id)
417{
418 return wma->interfaces[vdev_id].roam_synch_in_progress;
419}
420#else
421static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
422 uint8_t vdev_id)
423{
424 return false;
425}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700426static inline uint32_t wma_roam_scan_get_cckm_mode(
427 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
428{
429 return WMI_AUTH_CCKM;
430}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800431#endif
432
433/*
434 * wma_dev_if.c functions declarations
435 */
436
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800437struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800438 uint8_t *vdev_id);
439
440/**
441 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
442 * @wma - wma handle
443 * @vdev_id - vdev ID
444 *
445 * Return: Returns vdev handle if given vdev id is valid.
446 * Otherwise returns NULL.
447 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800448static inline
449struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800450{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700451 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800452 return NULL;
453
454 return wma->interfaces[vdev_id].handle;
455}
456
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800457bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
458
459#ifdef QCA_IBSS_SUPPORT
460bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700461#else
462/**
463 * wma_is_vdev_in_ibss_mode(): dummy function
464 * @wma: wma handle
465 * @vdev_id: vdev id
466 *
467 * Return false since no vdev can be in ibss mode without ibss support
468 */
469static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700470bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700471{
472 return false;
473}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474#endif
475
476/**
477 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
478 * @wma - wma handle
479 * @vdev_id - vdev ID
480 *
481 * Return: Returns pointer to bssid on success,
482 * otherwise returns NULL.
483 */
484static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
485 uint8_t vdev_id)
486{
487 if (vdev_id >= wma->max_bssid)
488 return NULL;
489
490 return wma->interfaces[vdev_id].bssid;
491}
492
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800493struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800494 uint8_t *vdev_id);
495
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530496QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800497 struct del_sta_self_params *pdel_sta_self_req_param,
498 uint8_t generateRsp);
499
500int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
501 uint32_t len);
502
Govind Singhd76a5b02016-03-08 15:12:14 +0530503QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800504 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800505void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700506 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800507 bool roam_synch_in_progress);
508
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800509QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
510 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800511 u8 peer_addr[IEEE80211_ADDR_LEN],
512 uint32_t peer_type, uint8_t vdev_id,
513 bool roam_synch_in_progress);
514
515int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
516 u32 len);
517
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800518struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519 struct add_sta_self_params *self_sta_req,
520 uint8_t generateRsp);
521
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700522QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
523 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800524
525void wma_vdev_resp_timer(void *data);
526
527struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
528 uint8_t vdev_id,
529 uint32_t msg_type, uint8_t type,
530 void *params, uint32_t timeout);
531
532void wma_hold_req_timer(void *data);
533struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
534 uint8_t vdev_id, uint32_t msg_type,
535 uint8_t type, void *params,
536 uint32_t timeout);
537
538void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
539 uint8_t type);
540
541void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
542
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800543void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
544
545void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
546
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800547void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
548
549int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
550
551void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
552 tpDisableIntraBssFwd pdis_intra_fwd);
553
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700554void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
555
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800556uint32_t wma_get_bcn_rate_code(uint16_t rate);
557
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800558/*
559 * wma_mgmt.c functions declarations
560 */
561
562int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
563
564int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
565
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800566int wma_unified_bcntx_status_event_handler(void *handle,
567 uint8_t *cmd_param_info,
568 uint32_t len);
569
mukul sharma72c8b222015-09-04 17:02:01 +0530570void wma_set_sta_sa_query_param(tp_wma_handle wma,
571 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800572
573void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
574 uint32_t method, uint32_t timeperiod,
575 uint8_t *hostv4addr, uint8_t *destv4addr,
576 uint8_t *destmac);
577
578int wma_vdev_install_key_complete_event_handler(void *handle,
579 uint8_t *event,
580 uint32_t len);
581
Govind Singhb30d4c02016-03-24 11:01:23 +0530582QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800583 tSirNwType nw_type,
584 tpAddStaParams params);
585
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530586QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
587 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800588 gtx_config_t *gtx_info);
589
590void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
591 uint8_t llbcoexist);
592
593void wma_process_update_beacon_params(tp_wma_handle wma,
594 tUpdateBeaconParams *bcn_params);
595
Rajeev Kumar416b73f2017-01-21 16:45:21 -0800596void wma_update_cfg_params(tp_wma_handle wma, struct scheduler_msg *cfgParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597
598void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
599
600void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
601 uint8_t vdev_id,
602 int8_t peer_num_delta);
603
604void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
605
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530606QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800607 tEdcaParams *edca_params);
608
609int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
610 uint32_t len);
611
612void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
613 tpSendProbeRespParams probe_rsp_info);
614
615void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
616
617void wma_set_keepalive_req(tp_wma_handle wma,
618 tSirKeepAliveReq *keepalive);
619
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530620void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
621 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800622
623void wma_process_update_opmode(tp_wma_handle wma_handle,
624 tUpdateVHTOpMode *update_vht_opmode);
625
626void wma_process_update_rx_nss(tp_wma_handle wma_handle,
627 tUpdateRxNss *update_rx_nss);
628
629void wma_process_update_membership(tp_wma_handle wma_handle,
630 tUpdateMembership *membership);
631
632void wma_process_update_userpos(tp_wma_handle wma_handle,
633 tUpdateUserPos *userpos);
634
635void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
636 tHalHiddenSsidVdevRestart *pReq);
637
638/*
639 * wma_power.c functions declarations
640 */
641
642void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
643
Govind Singhd76a5b02016-03-08 15:12:14 +0530644QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800645 uint32_t vdev_id, uint32_t param,
646 uint32_t value);
647
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530648QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800649wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
650
Govind Singhd76a5b02016-03-08 15:12:14 +0530651QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800652 uint8_t *peer_addr, uint8_t uapsd_value,
653 uint8_t max_sp);
654
655void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800656 struct wmi_host_wme_vparams *wmm_param,
657 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800658
659void wma_set_tx_power(WMA_HANDLE handle,
660 tMaxTxPowerParams *tx_pwr_params);
661
662void wma_set_max_tx_power(WMA_HANDLE handle,
663 tMaxTxPowerParams *tx_pwr_params);
664
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800665void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
666
667void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
668
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700669void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800670
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530671QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800672
673int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
674 uint32_t len);
675
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530676QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800677 tSirTxPowerLimit *ptxlim);
678
679void wma_update_noa(struct beacon_info *beacon,
680 struct p2p_sub_element_noa *noa_ie);
681
682void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
683 struct p2p_sub_element_noa *noa_ie);
684
685int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
686 uint32_t len);
687
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800688void wma_process_set_mimops_req(tp_wma_handle wma_handle,
689 tSetMIMOPS *mimops);
690
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530691QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800692
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530693QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694 tSirModemPowerStateInd *pReq);
695
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530696QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697 int value);
698
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800699/*
700 * wma_data.c functions declarations
701 */
702
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700703void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
704 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705
706int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
707
Jiachao Wu08719b02017-07-05 13:05:34 +0800708/**
709 * wma_check_txrx_chainmask() - check txrx chainmask
710 * @num_rf_chains: number of rf chains
711 * @cmd_value: command value
712 *
713 * Return: QDF_STATUS_SUCCESS for success or error code
714 */
715QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800716
717int wma_peer_state_change_event_handler(void *handle,
718 uint8_t *event_buff,
719 uint32_t len);
720
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530721QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800722 mcc_adaptive_scheduler);
723
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530724QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800725 (tp_wma_handle wma,
726 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
727
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530728QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800729 (tp_wma_handle wma,
730 uint32_t adapter_1_chan_number,
731 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
732
733void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
734
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530735QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800736 tSirRateUpdateInd *
737 pRateUpdateParams);
738
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530739QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800740
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530741QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800742
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530743#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
744 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
745
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
747 uint32_t len);
748#endif
749
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530750#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
751QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
752 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700753#else
754static inline QDF_STATUS
755wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
756 struct t_bad_peer_txtcl_config *config)
757{
758 return QDF_STATUS_E_FAILURE;
759}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530760#endif
761
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530762QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800763 t_thermal_mgmt *pThermalParams);
764
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530765QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800766 uint8_t thermal_level);
767
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530768QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800769 t_thermal_cmd_params thermal_info);
770
771int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
772 uint32_t len);
773
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800774int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
775 uint32_t len);
776
777int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
778 uint32_t len);
779
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800780/*
781 * wma_utils.c functions declarations
782 */
783
784#ifdef WLAN_FEATURE_STATS_EXT
785int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
786 uint32_t len);
787#endif
788
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700789enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800790int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800791
792#ifdef WLAN_FEATURE_LINK_LAYER_STATS
793void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
794
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530795QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800796 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
797
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530798QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800799 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
800
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530801QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700802 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800803
804int wma_unified_link_iface_stats_event_handler(void *handle,
805 uint8_t *cmd_param_info,
806 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800807void wma_config_stats_ext_threshold(tp_wma_handle wma,
808 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800809#endif
810
811void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
812 uint8_t link_status);
813
814int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
815 uint32_t len);
816
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530817/**
818 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
819 * @wmi_event: WMI event
820 *
821 * This function is used to send RSO command status to upper layer
822 *
823 * Return: 0 for success
824 */
825int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
826
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800827int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
828 uint32_t len);
829
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530830QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800831
832int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
833 uint32_t len);
834
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530835QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836
837int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
838 uint32_t len);
839
840bool wma_is_sap_active(tp_wma_handle wma_handle);
841
842bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
843
844bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
845
846bool wma_is_sta_active(tp_wma_handle wma_handle);
847
848WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
849 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800850 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800851
852int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
853 uint8_t vdev_id, uint32_t value);
854
855int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
856 uint8_t vdev_id, uint32_t value);
857
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700858#ifdef QCA_SUPPORT_CP_STATS
859static inline void wma_get_stats_req(WMA_HANDLE handle,
860 struct sAniGetPEStatsReq *get_stats_param) {}
861#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800862void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700863 struct sAniGetPEStatsReq *get_stats_param);
864#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800865/*
866 * wma_features.c functions declarations
867 */
868
Jeff Johnsonf0e54b02017-12-18 15:22:25 -0800869/**
870 * wma_sar_register_event_handlers() - Register SAR event handlers
871 * @handle: WMA Handle
872 *
873 * Function to be called during WMA initialization to register SAR
874 * event handlers with WMI
875 *
876 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
877 * an error enumeration
878 */
879QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
880
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800881void wma_process_link_status_req(tp_wma_handle wma,
882 tAniGetLinkStatus *pGetLinkStatus);
883
Will Huanga9814592017-05-24 15:47:58 +0800884QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
885 struct sir_peer_info_req *peer_info_req);
886
887/**
888 * wma_get_peer_info_ext() - get peer info
889 * @handle: wma interface
890 * @peer_info_req: get peer info request information
891 *
892 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
893 *
894 * Return: 0 on success, otherwise error value
895 */
896QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
897 struct sir_peer_info_ext_req *peer_info_req);
898
899/**
900 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
901 * @handle: WMA global handle
902 * @cmd_param_info: Command event data
903 * @len: Length of cmd_param_info
904 *
905 * This function will handle WMI_PEER_STATS_INFO_EVENTID
906 *
907 * Return: 0 on success, error code otherwise
908 */
909int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
910 u_int32_t len);
911
Govind Singha471e5e2015-10-12 17:11:14 +0530912int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
913 uint32_t len);
914
Govind Singhf25a0f12016-03-08 16:09:48 +0530915QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530916 uint32_t cmd, uint32_t value1, uint32_t value2);
917
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800918void wma_wow_tx_complete(void *wma);
919
Govind Singhd76a5b02016-03-08 15:12:14 +0530920int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800921
922#ifdef WLAN_FEATURE_NAN
923int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
924#endif
925
926#ifdef FEATURE_WLAN_TDLS
927int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
928#endif
929
930int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
931
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800932#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -0800933int wma_oem_data_response_handler(void *handle, uint8_t *datap,
934 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935#endif
936
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800937#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530938QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800939 struct ath_pktlog_wmi_params *params);
940#endif
941
942int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
943 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +0800944
945int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
946
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800947int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
948
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800949void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
950
951void wma_aggr_qos_req(tp_wma_handle wma,
952 tAggrAddTsParams *pAggrQosRspMsg);
953
954void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
955
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800956#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530957QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800958 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800959QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
960QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
961void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800962#endif
963
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530964QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
965 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800966QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
967
968QDF_STATUS wma_process_get_peer_info_req
969 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
970
971QDF_STATUS wma_process_tx_fail_monitor_ind
972 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
973
974QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
975
976QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
977
978QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
979
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530980QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800981 tSirAddPeriodicTxPtrn *
982 pAddPeriodicTxPtrnParams);
983
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530984QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800985 tSirDelPeriodicTxPtrn *
986 pDelPeriodicTxPtrnParams);
987
988#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530989QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990#endif
991
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530992QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
993 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800994
995#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +0530996QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997
998int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
999 tpSirAppType1Params appType1Params);
1000
Himanshu Agarwal44195412016-03-09 13:03:54 +05301001QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001002 tpSirAppType2Params appType2Params);
1003#endif
1004
1005#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1006int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1007 uint32_t len);
1008
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301009QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001010 tSirAutoShutdownCmdParams *
1011 auto_sh_cmd);
1012#endif
1013
Manikandan Mohan976e7562016-03-15 16:33:31 -07001014#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001015int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1016QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1017QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001018QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1019#else
1020static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1021 uint32_t vdev_id)
1022{
1023 return QDF_STATUS_SUCCESS;
1024}
1025
1026static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1027 uint32_t vdev_id)
1028{
1029 return QDF_STATUS_SUCCESS;
1030}
1031
1032static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1033 uint32_t data_len)
1034{
1035 return 0;
1036}
1037
1038static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1039{
1040 return QDF_STATUS_E_INVAL;
1041}
1042#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001043QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001044
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001045#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301046QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001047#endif
1048
1049#ifdef DHCP_SERVER_OFFLOAD
1050int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1051 tSirDhcpSrvOffloadInfo *
1052 pDhcpSrvOffloadInfo);
1053#endif
1054
1055#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301056QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001057 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058#endif
1059
Kabilan Kannancaa85502018-04-13 18:04:58 -07001060/**
1061 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001062 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001063 * @event: event buffer
1064 * @len: buffer length
1065 *
1066 * Return: 0 for success or error code
1067 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001068int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001069
Nirav Shaheb017be2018-02-15 11:20:58 +05301070#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301071QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001072 tSirChAvoidUpdateReq *
1073 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301074#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001075
1076#ifdef FEATURE_WLAN_TDLS
1077
Himanshu Agarwal44195412016-03-09 13:03:54 +05301078QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001079int wma_update_tdls_peer_state(WMA_HANDLE handle,
1080 tTdlsPeerStateParams *peerStateParams);
1081/**
1082 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1083 * @handle: wma handle
1084 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1085 *
1086 * This function sets tdls off channel mode
1087 *
1088 * Return: 0 on success; negative errno otherwise
1089 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301090QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001091 tdls_chan_switch_params *chan_switch_params);
1092#endif
1093
Hong Shib90718f2017-02-20 00:57:22 +08001094void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001095void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1096
Qiwei Caie689a262018-07-26 15:50:22 +08001097#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001098int wma_rssi_breached_event_handler(void *handle,
1099 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001100#else /* FEATURE_RSSI_MONITOR */
1101static inline
1102int wma_rssi_breached_event_handler(void *handle,
1103 u_int8_t *cmd_param_info, u_int32_t len)
1104{
1105 return 0;
1106}
1107#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001108
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301109QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001110 struct vdev_ie_info *ie_info);
1111int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1112 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001113int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1114 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001115
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001116int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1117 uint32_t len);
1118void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1119 uint8_t type);
Peng Xu8fdaa492016-06-22 10:20:47 -07001120int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1121 uint32_t len);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301122
1123QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1124 struct sir_mac_pwr_dbg_cmd *
1125 sir_pwr_dbg_params);
1126
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301127/**
1128 * wma_lost_link_info_handler() - collect lost link information and inform SME
1129 * @wma: WMA handle
1130 * @vdev_id: vdev ID
1131 * @rssi: rssi at disconnection time
1132 *
1133 * Return: none
1134 */
1135void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1136 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301137int wma_unified_power_debug_stats_event_handler(void *handle,
1138 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301139
1140#ifdef FEATURE_WLAN_DIAG_SUPPORT
1141/**
1142 * wma_sta_kickout_event()- send sta kickout event
1143 * @kickout_reason - reasoncode for kickout
1144 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1145 * @vdev_id: Unique id for identifying the VDEV
1146 *
1147 * This function sends sta kickout diag event
1148 *
1149 * Return: void.
1150 */
1151void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1152 uint8_t *macaddr);
1153#else
1154static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1155 uint8_t vdev_id, uint8_t *macaddr)
1156{
1157
1158};
1159#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1160
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001161/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301162 * wma_get_rcpi_req() - get rcpi request
1163 * @handle: wma handle
1164 * @rcpi_request: rcpi params
1165 *
1166 * Return: none
1167 */
1168QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1169 struct sme_rcpi_req *rcpi_request);
1170
1171/**
1172 * wma_rcpi_event_handler() - rcpi event handler
1173 * @handle: wma handle
1174 * @cmd_param_info: data from event
1175 * @len: length
1176 *
1177 * Return: 0 for success or error code
1178 */
1179int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1180 uint32_t len);
1181
1182/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001183 * wma_acquire_wakelock() - acquire the given wakelock
1184 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001185 * @msec: the wakelock duration in milliseconds
1186 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001187 * This also acquires the wma runtime pm lock.
1188 *
1189 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001190 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001191void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001192
1193/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001194 * wma_release_wakelock() - release the given wakelock
1195 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001196 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001197 * This also releases the wma runtime pm lock.
1198 *
1199 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001200 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001201void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001202
1203/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001204 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001205 * @wma: a reference to the global WMA handle
1206 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001207 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001208 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1209 * response from firmware to avoid power penalties. Alternatively, calling the
1210 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001211 *
1212 * Return: QDF_STATUS
1213 */
1214QDF_STATUS
1215wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1216
1217/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001218 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001219 * @wma: a reference to the global WMA handle
1220 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001221 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001222 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1223 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001224 *
1225 * Return: QDF_STATUS
1226 */
1227QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1228
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301229int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1230
Dustin Brownec2c92e2017-07-26 11:13:49 -07001231/**
1232 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1233 * @wma: a reference to the global WMA handle
1234 * @params: the vdev up params to send to firmware
1235 * @bssid: the BssId to send to firmware
1236 *
1237 * This also releases the vdev start wakelock.
1238 *
1239 * Return: QDF_STATUS
1240 */
1241QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1242 struct vdev_up_params *params,
1243 uint8_t bssid[IEEE80211_ADDR_LEN]);
1244
1245/**
1246 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1247 * @wma: a reference to the global WMA handle
1248 * @vdev_id: the Id of the vdev to down
1249 *
1250 * This also releases the vdev start wakelock.
1251 *
1252 * Return: QDF_STATUS
1253 */
1254QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1255
lifeng66831662017-05-19 16:01:35 +08001256/*
1257 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1258 * @handle: the wma handle
1259 * @event_buf: buffer with event
1260 * @len: buffer length
1261 *
1262 * This function receives rx aggregation failure event and then pass to upper
1263 * layer
1264 *
1265 * Return: 0 on success
1266 */
1267int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1268 u_int32_t len);
1269
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301270/**
1271 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1272 * @handle: the WMA handle
1273 * @event: buffer with the event parameters
1274 * @len: length of the buffer
1275 *
1276 * This function receives BT activity event from firmware and passes the event
1277 * information to upper layers
1278 *
1279 * Return: 0 on success
1280 */
1281int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1282 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001283
1284/**
lifengfe6c3e22018-04-03 12:10:04 +08001285 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001286 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001287 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001288 * @len: buffer length
1289 *
1290 * This function receives antenna info from firmware and passes the event
1291 * to upper layer
1292 *
1293 * Return: 0 on success
1294 */
lifengfe6c3e22018-04-03 12:10:04 +08001295int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001296 u_int32_t len);
1297
lifeng7c607dd2017-02-21 21:16:49 +08001298/**
1299 * wma_update_beacon_interval() - update beacon interval in fw
1300 * @wma: wma handle
1301 * @vdev_id: vdev id
1302 * @beaconInterval: becon interval
1303 *
1304 * Return: none
1305 */
1306void
1307wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1308 uint16_t beaconInterval);
1309
1310#define RESET_BEACON_INTERVAL_TIMEOUT 200
1311
1312struct wma_beacon_interval_reset_req {
1313 qdf_timer_t event_timeout;
1314 uint8_t vdev_id;
1315 uint16_t interval;
1316};
1317
1318/**
1319 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1320 * @wma: wma handle
1321 * @vdev_id: vdev id
1322 * @beacon_interval: beacon interval
1323 * @timeout: timeout val
1324 *
1325 * Return: status
1326 */
1327int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1328 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301329/*
1330 * wma_is_vdev_valid() - check the vdev status
1331 * @vdev_id: vdev identifier
1332 *
1333 * This function verifies the vdev validity
1334 *
1335 * Return: 'true' on valid vdev else 'false'
1336 */
1337bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001338
1339/**
1340 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1341 * @handle: the wma handle
1342 * @event: buffer with event
1343 * @len: buffer length
1344 *
1345 * This function receives obss detection info from firmware which is used to
1346 * decide obss protection.
1347 *
1348 * Return: 0 on success
1349 */
1350int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1351 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001352
1353/**
1354 * wma_vdev_bss_color_collision_info_handler - event handler to
1355 * handle obss color collision detection.
1356 * @handle: the wma handle
1357 * @event: buffer with event
1358 * @len: buffer length
1359 *
1360 * This function receives obss color collision detection info from firmware
1361 * which is used to select new bss color.
1362 *
1363 * Return: 0 on success
1364 */
1365int wma_vdev_bss_color_collision_info_handler(void *handle,
1366 uint8_t *event,
1367 uint32_t len);
1368
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001369int wma_twt_en_complete_event_handler(void *handle,
1370 uint8_t *event, uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001371#endif