blob: 929d20dbfaf1043b6cbd5eaab42c3c20d5d7eaaf [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
Jeff Johnson9743eb72018-07-14 10:30:04 -0700377/**
378 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
379 * @wma: wma handle
380 * @params: hotlist request params
381 *
382 * This function configures hotlist monitor to stop in fw.
383 *
384 * Return: QDF status
385 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530386QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700387 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700389/**
390 * wma_extscan_start_change_monitor() - send start change monitor cmd
391 * @wma: wma handle
392 * @params: change monitor request params
393 *
394 * This function sends start change monitor request to fw.
395 *
396 * Return: QDF status
397 */
398QDF_STATUS
399wma_extscan_start_change_monitor(tp_wma_handle wma,
400 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800401
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530402QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700403 tSirExtScanResetSignificantChangeReqParams *pResetReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530405QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406 tSirExtScanGetCachedResultsReqParams *
407 pcached_results);
408
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530409QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410 tSirGetExtScanCapabilitiesReqParams *
411 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530412QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800413 struct wifi_epno_params *req);
414
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530415QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800416 struct wifi_passpoint_req *req);
417
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530418QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800419 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800420#endif
421
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530422QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423
424int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
425
426void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
427
428int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
429 uint32_t len);
430
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800431#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800432void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
433static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
434 uint8_t vdev_id)
435{
436 return wma->interfaces[vdev_id].roam_synch_in_progress;
437}
438#else
439static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
440 uint8_t vdev_id)
441{
442 return false;
443}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700444static inline uint32_t wma_roam_scan_get_cckm_mode(
445 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
446{
447 return WMI_AUTH_CCKM;
448}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800449#endif
450
451/*
452 * wma_dev_if.c functions declarations
453 */
454
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800455struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800456 uint8_t *vdev_id);
457
458/**
459 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
460 * @wma - wma handle
461 * @vdev_id - vdev ID
462 *
463 * Return: Returns vdev handle if given vdev id is valid.
464 * Otherwise returns NULL.
465 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800466static inline
467struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800468{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700469 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800470 return NULL;
471
472 return wma->interfaces[vdev_id].handle;
473}
474
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800475bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
476
477#ifdef QCA_IBSS_SUPPORT
478bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700479#else
480/**
481 * wma_is_vdev_in_ibss_mode(): dummy function
482 * @wma: wma handle
483 * @vdev_id: vdev id
484 *
485 * Return false since no vdev can be in ibss mode without ibss support
486 */
487static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700488bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700489{
490 return false;
491}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800492#endif
493
494/**
495 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
496 * @wma - wma handle
497 * @vdev_id - vdev ID
498 *
499 * Return: Returns pointer to bssid on success,
500 * otherwise returns NULL.
501 */
502static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
503 uint8_t vdev_id)
504{
505 if (vdev_id >= wma->max_bssid)
506 return NULL;
507
508 return wma->interfaces[vdev_id].bssid;
509}
510
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800511struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800512 uint8_t *vdev_id);
513
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530514QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800515 struct del_sta_self_params *pdel_sta_self_req_param,
516 uint8_t generateRsp);
517
518int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
519 uint32_t len);
520
Govind Singhd76a5b02016-03-08 15:12:14 +0530521QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800523void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700524 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800525 bool roam_synch_in_progress);
526
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800527QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
528 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800529 u8 peer_addr[IEEE80211_ADDR_LEN],
530 uint32_t peer_type, uint8_t vdev_id,
531 bool roam_synch_in_progress);
532
533int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
534 u32 len);
535
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800536struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800537 struct add_sta_self_params *self_sta_req,
538 uint8_t generateRsp);
539
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700540QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
541 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800542
543void wma_vdev_resp_timer(void *data);
544
545struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
546 uint8_t vdev_id,
547 uint32_t msg_type, uint8_t type,
548 void *params, uint32_t timeout);
549
550void wma_hold_req_timer(void *data);
551struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
552 uint8_t vdev_id, uint32_t msg_type,
553 uint8_t type, void *params,
554 uint32_t timeout);
555
556void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
557 uint8_t type);
558
559void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
560
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800561void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
562
563void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
564
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800565void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
566
567int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
568
569void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
570 tpDisableIntraBssFwd pdis_intra_fwd);
571
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700572void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
573
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800574uint32_t wma_get_bcn_rate_code(uint16_t rate);
575
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800576/*
577 * wma_mgmt.c functions declarations
578 */
579
580int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
581
582int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
583
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800584int wma_unified_bcntx_status_event_handler(void *handle,
585 uint8_t *cmd_param_info,
586 uint32_t len);
587
mukul sharma72c8b222015-09-04 17:02:01 +0530588void wma_set_sta_sa_query_param(tp_wma_handle wma,
589 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800590
591void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
592 uint32_t method, uint32_t timeperiod,
593 uint8_t *hostv4addr, uint8_t *destv4addr,
594 uint8_t *destmac);
595
596int wma_vdev_install_key_complete_event_handler(void *handle,
597 uint8_t *event,
598 uint32_t len);
599
Govind Singhb30d4c02016-03-24 11:01:23 +0530600QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800601 tSirNwType nw_type,
602 tpAddStaParams params);
603
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530604QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
605 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800606 gtx_config_t *gtx_info);
607
608void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
609 uint8_t llbcoexist);
610
611void wma_process_update_beacon_params(tp_wma_handle wma,
612 tUpdateBeaconParams *bcn_params);
613
Rajeev Kumar416b73f2017-01-21 16:45:21 -0800614void wma_update_cfg_params(tp_wma_handle wma, struct scheduler_msg *cfgParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800615
616void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
617
618void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
619 uint8_t vdev_id,
620 int8_t peer_num_delta);
621
622void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
623
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530624QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800625 tEdcaParams *edca_params);
626
627int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
628 uint32_t len);
629
630void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
631 tpSendProbeRespParams probe_rsp_info);
632
633void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
634
635void wma_set_keepalive_req(tp_wma_handle wma,
636 tSirKeepAliveReq *keepalive);
637
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530638void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
639 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800640
641void wma_process_update_opmode(tp_wma_handle wma_handle,
642 tUpdateVHTOpMode *update_vht_opmode);
643
644void wma_process_update_rx_nss(tp_wma_handle wma_handle,
645 tUpdateRxNss *update_rx_nss);
646
647void wma_process_update_membership(tp_wma_handle wma_handle,
648 tUpdateMembership *membership);
649
650void wma_process_update_userpos(tp_wma_handle wma_handle,
651 tUpdateUserPos *userpos);
652
653void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
654 tHalHiddenSsidVdevRestart *pReq);
655
656/*
657 * wma_power.c functions declarations
658 */
659
660void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
661
Govind Singhd76a5b02016-03-08 15:12:14 +0530662QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800663 uint32_t vdev_id, uint32_t param,
664 uint32_t value);
665
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530666QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800667wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
668
Govind Singhd76a5b02016-03-08 15:12:14 +0530669QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800670 uint8_t *peer_addr, uint8_t uapsd_value,
671 uint8_t max_sp);
672
673void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800674 struct wmi_host_wme_vparams *wmm_param,
675 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800676
677void wma_set_tx_power(WMA_HANDLE handle,
678 tMaxTxPowerParams *tx_pwr_params);
679
680void wma_set_max_tx_power(WMA_HANDLE handle,
681 tMaxTxPowerParams *tx_pwr_params);
682
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800683void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
684
685void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
686
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700687void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800688
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530689QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690
691int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
692 uint32_t len);
693
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530694QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800695 tSirTxPowerLimit *ptxlim);
696
697void wma_update_noa(struct beacon_info *beacon,
698 struct p2p_sub_element_noa *noa_ie);
699
700void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
701 struct p2p_sub_element_noa *noa_ie);
702
703int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
704 uint32_t len);
705
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800706void wma_process_set_mimops_req(tp_wma_handle wma_handle,
707 tSetMIMOPS *mimops);
708
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530709QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800710
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530711QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800712 tSirModemPowerStateInd *pReq);
713
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530714QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715 int value);
716
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800717/*
718 * wma_data.c functions declarations
719 */
720
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700721void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
722 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800723
724int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
725
Jiachao Wu08719b02017-07-05 13:05:34 +0800726/**
727 * wma_check_txrx_chainmask() - check txrx chainmask
728 * @num_rf_chains: number of rf chains
729 * @cmd_value: command value
730 *
731 * Return: QDF_STATUS_SUCCESS for success or error code
732 */
733QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800734
735int wma_peer_state_change_event_handler(void *handle,
736 uint8_t *event_buff,
737 uint32_t len);
738
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530739QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800740 mcc_adaptive_scheduler);
741
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530742QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800743 (tp_wma_handle wma,
744 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
745
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530746QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800747 (tp_wma_handle wma,
748 uint32_t adapter_1_chan_number,
749 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
750
751void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
752
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530753QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754 tSirRateUpdateInd *
755 pRateUpdateParams);
756
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530757QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530759QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800760
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530761#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
762 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
763
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800764int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
765 uint32_t len);
766#endif
767
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530768#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
769QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
770 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700771#else
772static inline QDF_STATUS
773wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
774 struct t_bad_peer_txtcl_config *config)
775{
776 return QDF_STATUS_E_FAILURE;
777}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530778#endif
779
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530780QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800781 t_thermal_mgmt *pThermalParams);
782
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530783QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800784 uint8_t thermal_level);
785
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530786QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800787 t_thermal_cmd_params thermal_info);
788
789int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
790 uint32_t len);
791
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800792int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
793 uint32_t len);
794
795int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
796 uint32_t len);
797
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800798/*
799 * wma_utils.c functions declarations
800 */
801
802#ifdef WLAN_FEATURE_STATS_EXT
803int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
804 uint32_t len);
805#endif
806
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700807enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800808int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800809
810#ifdef WLAN_FEATURE_LINK_LAYER_STATS
811void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
812
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530813QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
815
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530816QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800817 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
818
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530819QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700820 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821
822int wma_unified_link_iface_stats_event_handler(void *handle,
823 uint8_t *cmd_param_info,
824 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800825void wma_config_stats_ext_threshold(tp_wma_handle wma,
826 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800827#endif
828
829void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
830 uint8_t link_status);
831
832int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
833 uint32_t len);
834
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530835/**
836 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
837 * @wmi_event: WMI event
838 *
839 * This function is used to send RSO command status to upper layer
840 *
841 * Return: 0 for success
842 */
843int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
844
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800845int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
846 uint32_t len);
847
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530848QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800849
850int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
851 uint32_t len);
852
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530853QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800854
855int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
856 uint32_t len);
857
858bool wma_is_sap_active(tp_wma_handle wma_handle);
859
860bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
861
862bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
863
864bool wma_is_sta_active(tp_wma_handle wma_handle);
865
866WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
867 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800868 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800869
870int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
871 uint8_t vdev_id, uint32_t value);
872
873int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
874 uint8_t vdev_id, uint32_t value);
875
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700876#ifdef QCA_SUPPORT_CP_STATS
877static inline void wma_get_stats_req(WMA_HANDLE handle,
878 struct sAniGetPEStatsReq *get_stats_param) {}
879#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800880void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700881 struct sAniGetPEStatsReq *get_stats_param);
882#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883/*
884 * wma_features.c functions declarations
885 */
886
Jeff Johnsonf0e54b02017-12-18 15:22:25 -0800887/**
888 * wma_sar_register_event_handlers() - Register SAR event handlers
889 * @handle: WMA Handle
890 *
891 * Function to be called during WMA initialization to register SAR
892 * event handlers with WMI
893 *
894 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
895 * an error enumeration
896 */
897QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
898
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800899void wma_process_link_status_req(tp_wma_handle wma,
900 tAniGetLinkStatus *pGetLinkStatus);
901
Will Huanga9814592017-05-24 15:47:58 +0800902QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
903 struct sir_peer_info_req *peer_info_req);
904
905/**
906 * wma_get_peer_info_ext() - get peer info
907 * @handle: wma interface
908 * @peer_info_req: get peer info request information
909 *
910 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
911 *
912 * Return: 0 on success, otherwise error value
913 */
914QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
915 struct sir_peer_info_ext_req *peer_info_req);
916
917/**
918 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
919 * @handle: WMA global handle
920 * @cmd_param_info: Command event data
921 * @len: Length of cmd_param_info
922 *
923 * This function will handle WMI_PEER_STATS_INFO_EVENTID
924 *
925 * Return: 0 on success, error code otherwise
926 */
927int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
928 u_int32_t len);
929
Govind Singha471e5e2015-10-12 17:11:14 +0530930int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
931 uint32_t len);
932
Govind Singhf25a0f12016-03-08 16:09:48 +0530933QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530934 uint32_t cmd, uint32_t value1, uint32_t value2);
935
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800936void wma_wow_tx_complete(void *wma);
937
Govind Singhd76a5b02016-03-08 15:12:14 +0530938int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800939
940#ifdef WLAN_FEATURE_NAN
941int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
942#endif
943
944#ifdef FEATURE_WLAN_TDLS
945int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
946#endif
947
948int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
949
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800950#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -0800951int wma_oem_data_response_handler(void *handle, uint8_t *datap,
952 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800953#endif
954
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800955#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530956QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800957 struct ath_pktlog_wmi_params *params);
958#endif
959
960int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
961 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +0800962
963int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
964
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800965int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
966
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800967void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
968
969void wma_aggr_qos_req(tp_wma_handle wma,
970 tAggrAddTsParams *pAggrQosRspMsg);
971
972void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
973
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800974#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530975QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800976 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800977QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
978QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
979void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800980#endif
981
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530982QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
983 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800984QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
985
986QDF_STATUS wma_process_get_peer_info_req
987 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
988
989QDF_STATUS wma_process_tx_fail_monitor_ind
990 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
991
Rachit Kankaneee1735c2018-08-02 13:19:34 +0530992#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800993QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
994
995QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
996
997QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +0530998#else
999static inline
1000QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1001{
1002 return QDF_STATUS_SUCCESS;
1003}
1004
1005static inline
1006QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1007{
1008 return QDF_STATUS_SUCCESS;
1009}
1010
1011static inline
1012QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1013{
1014 return QDF_STATUS_SUCCESS;
1015}
1016#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001017
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301018QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001019 tSirAddPeriodicTxPtrn *
1020 pAddPeriodicTxPtrnParams);
1021
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301022QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001023 tSirDelPeriodicTxPtrn *
1024 pDelPeriodicTxPtrnParams);
1025
1026#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301027QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001028#endif
1029
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301030QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1031 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032
1033#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301034QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001035
1036int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1037 tpSirAppType1Params appType1Params);
1038
Himanshu Agarwal44195412016-03-09 13:03:54 +05301039QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001040 tpSirAppType2Params appType2Params);
1041#endif
1042
1043#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1044int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1045 uint32_t len);
1046
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301047QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001048 tSirAutoShutdownCmdParams *
1049 auto_sh_cmd);
1050#endif
1051
Manikandan Mohan976e7562016-03-15 16:33:31 -07001052#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001053int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1054QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1055QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001056QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1057#else
1058static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1059 uint32_t vdev_id)
1060{
1061 return QDF_STATUS_SUCCESS;
1062}
1063
1064static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1065 uint32_t vdev_id)
1066{
1067 return QDF_STATUS_SUCCESS;
1068}
1069
1070static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1071 uint32_t data_len)
1072{
1073 return 0;
1074}
1075
1076static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1077{
1078 return QDF_STATUS_E_INVAL;
1079}
1080#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001081QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001082
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001083#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301084QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001085#endif
1086
1087#ifdef DHCP_SERVER_OFFLOAD
1088int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1089 tSirDhcpSrvOffloadInfo *
1090 pDhcpSrvOffloadInfo);
1091#endif
1092
1093#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301094QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001095 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001096#endif
1097
Kabilan Kannancaa85502018-04-13 18:04:58 -07001098/**
1099 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001100 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001101 * @event: event buffer
1102 * @len: buffer length
1103 *
1104 * Return: 0 for success or error code
1105 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001106int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001107
Nirav Shaheb017be2018-02-15 11:20:58 +05301108#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301109QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001110 tSirChAvoidUpdateReq *
1111 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301112#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001113
1114#ifdef FEATURE_WLAN_TDLS
1115
Himanshu Agarwal44195412016-03-09 13:03:54 +05301116QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001117int wma_update_tdls_peer_state(WMA_HANDLE handle,
1118 tTdlsPeerStateParams *peerStateParams);
1119/**
1120 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1121 * @handle: wma handle
1122 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1123 *
1124 * This function sets tdls off channel mode
1125 *
1126 * Return: 0 on success; negative errno otherwise
1127 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301128QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001129 tdls_chan_switch_params *chan_switch_params);
1130#endif
1131
Hong Shib90718f2017-02-20 00:57:22 +08001132void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001133void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1134
Qiwei Caie689a262018-07-26 15:50:22 +08001135#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001136int wma_rssi_breached_event_handler(void *handle,
1137 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001138#else /* FEATURE_RSSI_MONITOR */
1139static inline
1140int wma_rssi_breached_event_handler(void *handle,
1141 u_int8_t *cmd_param_info, u_int32_t len)
1142{
1143 return 0;
1144}
1145#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001146
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301147QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001148 struct vdev_ie_info *ie_info);
1149int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1150 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001151int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1152 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001153
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001154int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1155 uint32_t len);
1156void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1157 uint8_t type);
Peng Xu8fdaa492016-06-22 10:20:47 -07001158int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1159 uint32_t len);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301160
1161QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1162 struct sir_mac_pwr_dbg_cmd *
1163 sir_pwr_dbg_params);
1164
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301165/**
1166 * wma_lost_link_info_handler() - collect lost link information and inform SME
1167 * @wma: WMA handle
1168 * @vdev_id: vdev ID
1169 * @rssi: rssi at disconnection time
1170 *
1171 * Return: none
1172 */
1173void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1174 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301175int wma_unified_power_debug_stats_event_handler(void *handle,
1176 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301177
1178#ifdef FEATURE_WLAN_DIAG_SUPPORT
1179/**
1180 * wma_sta_kickout_event()- send sta kickout event
1181 * @kickout_reason - reasoncode for kickout
1182 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1183 * @vdev_id: Unique id for identifying the VDEV
1184 *
1185 * This function sends sta kickout diag event
1186 *
1187 * Return: void.
1188 */
1189void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1190 uint8_t *macaddr);
1191#else
1192static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1193 uint8_t vdev_id, uint8_t *macaddr)
1194{
1195
1196};
1197#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1198
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001199/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301200 * wma_get_rcpi_req() - get rcpi request
1201 * @handle: wma handle
1202 * @rcpi_request: rcpi params
1203 *
1204 * Return: none
1205 */
1206QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1207 struct sme_rcpi_req *rcpi_request);
1208
1209/**
1210 * wma_rcpi_event_handler() - rcpi event handler
1211 * @handle: wma handle
1212 * @cmd_param_info: data from event
1213 * @len: length
1214 *
1215 * Return: 0 for success or error code
1216 */
1217int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1218 uint32_t len);
1219
1220/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001221 * wma_acquire_wakelock() - acquire the given wakelock
1222 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001223 * @msec: the wakelock duration in milliseconds
1224 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001225 * This also acquires the wma runtime pm lock.
1226 *
1227 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001228 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001229void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001230
1231/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001232 * wma_release_wakelock() - release the given wakelock
1233 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001234 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001235 * This also releases the wma runtime pm lock.
1236 *
1237 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001238 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001239void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001240
1241/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001242 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001243 * @wma: a reference to the global WMA handle
1244 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001245 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001246 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1247 * response from firmware to avoid power penalties. Alternatively, calling the
1248 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001249 *
1250 * Return: QDF_STATUS
1251 */
1252QDF_STATUS
1253wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1254
1255/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001256 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001257 * @wma: a reference to the global WMA handle
1258 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001259 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001260 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1261 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001262 *
1263 * Return: QDF_STATUS
1264 */
1265QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1266
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301267int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1268
Dustin Brownec2c92e2017-07-26 11:13:49 -07001269/**
1270 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1271 * @wma: a reference to the global WMA handle
1272 * @params: the vdev up params to send to firmware
1273 * @bssid: the BssId to send to firmware
1274 *
1275 * This also releases the vdev start wakelock.
1276 *
1277 * Return: QDF_STATUS
1278 */
1279QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1280 struct vdev_up_params *params,
1281 uint8_t bssid[IEEE80211_ADDR_LEN]);
1282
1283/**
1284 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1285 * @wma: a reference to the global WMA handle
1286 * @vdev_id: the Id of the vdev to down
1287 *
1288 * This also releases the vdev start wakelock.
1289 *
1290 * Return: QDF_STATUS
1291 */
1292QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1293
lifeng66831662017-05-19 16:01:35 +08001294/*
1295 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1296 * @handle: the wma handle
1297 * @event_buf: buffer with event
1298 * @len: buffer length
1299 *
1300 * This function receives rx aggregation failure event and then pass to upper
1301 * layer
1302 *
1303 * Return: 0 on success
1304 */
1305int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1306 u_int32_t len);
1307
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301308/**
1309 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1310 * @handle: the WMA handle
1311 * @event: buffer with the event parameters
1312 * @len: length of the buffer
1313 *
1314 * This function receives BT activity event from firmware and passes the event
1315 * information to upper layers
1316 *
1317 * Return: 0 on success
1318 */
1319int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1320 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001321
1322/**
lifengfe6c3e22018-04-03 12:10:04 +08001323 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001324 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001325 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001326 * @len: buffer length
1327 *
1328 * This function receives antenna info from firmware and passes the event
1329 * to upper layer
1330 *
1331 * Return: 0 on success
1332 */
lifengfe6c3e22018-04-03 12:10:04 +08001333int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001334 u_int32_t len);
1335
lifeng7c607dd2017-02-21 21:16:49 +08001336/**
1337 * wma_update_beacon_interval() - update beacon interval in fw
1338 * @wma: wma handle
1339 * @vdev_id: vdev id
1340 * @beaconInterval: becon interval
1341 *
1342 * Return: none
1343 */
1344void
1345wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1346 uint16_t beaconInterval);
1347
1348#define RESET_BEACON_INTERVAL_TIMEOUT 200
1349
1350struct wma_beacon_interval_reset_req {
1351 qdf_timer_t event_timeout;
1352 uint8_t vdev_id;
1353 uint16_t interval;
1354};
1355
1356/**
1357 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1358 * @wma: wma handle
1359 * @vdev_id: vdev id
1360 * @beacon_interval: beacon interval
1361 * @timeout: timeout val
1362 *
1363 * Return: status
1364 */
1365int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1366 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301367/*
1368 * wma_is_vdev_valid() - check the vdev status
1369 * @vdev_id: vdev identifier
1370 *
1371 * This function verifies the vdev validity
1372 *
1373 * Return: 'true' on valid vdev else 'false'
1374 */
1375bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001376
1377/**
1378 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1379 * @handle: the wma handle
1380 * @event: buffer with event
1381 * @len: buffer length
1382 *
1383 * This function receives obss detection info from firmware which is used to
1384 * decide obss protection.
1385 *
1386 * Return: 0 on success
1387 */
1388int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1389 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001390
1391/**
1392 * wma_vdev_bss_color_collision_info_handler - event handler to
1393 * handle obss color collision detection.
1394 * @handle: the wma handle
1395 * @event: buffer with event
1396 * @len: buffer length
1397 *
1398 * This function receives obss color collision detection info from firmware
1399 * which is used to select new bss color.
1400 *
1401 * Return: 0 on success
1402 */
1403int wma_vdev_bss_color_collision_info_handler(void *handle,
1404 uint8_t *event,
1405 uint32_t len);
1406
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001407int wma_twt_en_complete_event_handler(void *handle,
1408 uint8_t *event, uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001409#endif