blob: 5953d694f0cd6af6e93f6506123fd55769354e2c [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Harprit Chhabada98225f62018-12-11 15:29:55 -08002 * Copyright (c) 2013-2019 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))
Yeshwanth Sriram Guntuka14ab04c2018-09-21 15:06:49 +053057#define WMA_INVALID_PER_CHAIN_SNR (0x80)
58#define WMA_INVALID_PER_CHAIN_RSSI (0xFF)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080059
60/*
61 * Make sure that link monitor and keep alive
62 * default values should be in sync with CFG.
63 */
64#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
65#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
66
67#define AGC_DUMP 1
68#define CHAN_DUMP 2
69#define WD_DUMP 3
70#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
71#define PCIE_DUMP 4
72#endif
73
74/* conformance test limits */
75#define FCC 0x10
76#define MKK 0x40
77#define ETSI 0x30
78
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080079#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
80
81#define WMI_MCC_MIN_CHANNEL_QUOTA 20
82#define WMI_MCC_MAX_CHANNEL_QUOTA 80
83#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
84
85/* The maximum number of patterns that can be transmitted by the firmware
86 * and maximum patterns size.
87 */
jsreekumac44b922018-06-12 20:18:39 +053088#ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
jsreekumac44b922018-06-12 20:18:39 +053090#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080091
92#define WMI_MAX_HOST_CREDITS 2
93#define WMI_WOW_REQUIRED_CREDITS 1
94
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080095#define WMI_MAX_MHF_ENTRIES 32
96
Kiran Kumar Lokere80734c02018-12-16 22:48:14 -080097#define WMA_WMM_EXPO_TO_VAL(val) ((1 << (val)) - 1)
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080098
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099#define MAX_HT_MCS_IDX 8
100#define MAX_VHT_MCS_IDX 10
101#define INVALID_MCS_IDX 255
102
103#define LINK_STATUS_LEGACY 0
104#define LINK_STATUS_VHT 0x1
105#define LINK_STATUS_MIMO 0x2
106#define LINK_SUPPORT_VHT 0x4
107#define LINK_SUPPORT_MIMO 0x8
108
109#define LINK_RATE_VHT 0x3
110
111#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -0700112#define MAX_ENTRY_VDEV_RESP_QUEUE 10
113
Krishna Kumaar Natarajanb7f9a352016-03-18 11:40:07 -0700114/* Time(in ms) to detect DOS attack */
115#define WMA_MGMT_FRAME_DETECT_DOS_TIMER 1000
116
Himanshu Agarwala1539d32017-10-11 18:08:56 +0530117#define MAX_NUM_HW_MODE 0xff
118#define MAX_NUM_PHY 0xff
119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120/**
121 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800122 * @mcs_index: mcs rate index
123 * @ht20_rate: HT20 supported rate table
124 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800125 */
126struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800127 uint8_t mcs_index;
128 uint16_t ht20_rate[2];
129 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800130};
131
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800132/**
133 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800134 * @mcs_index: mcs rate index
135 * @ht20_rate: VHT20 supported rate table
136 * @ht40_rate: VHT40 supported rate table
137 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800138 */
139struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800140 uint8_t mcs_index;
141 uint16_t ht20_rate[2];
142 uint16_t ht40_rate[2];
143 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800145
Jeff Johnsondab58602018-07-14 15:30:24 -0700146struct wifi_scan_cmd_req_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800147/*
148 * wma_main.c functions declarations
149 */
150
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530151/**
152 * wma_send_msg_by_priority() - Send wma message to PE with priority.
153 * @wma_handle: wma handle
154 * @msg_type: message type
155 * @body_ptr: message body ptr
156 * @body_val: message body value
157 * @is_high_priority: if msg is high priority
158 *
159 * Return: none
160 */
161void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
162 void *body_ptr, uint32_t body_val, bool is_high_priority);
163
164/**
165 * wma_send_msg() - Send wma message to PE.
166 * @wma_handle: wma handle
167 * @msg_type: message type
168 * @body_ptr: message body ptr
169 * @body_val: message body value
170 *
171 * Return: none
172 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800173void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
174 void *body_ptr, uint32_t body_val);
175
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530176/**
177 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
178 * @wma_handle: wma handle
179 * @msg_type: message type
180 * @body_ptr: message body ptr
181 * @body_val: message body value
182 *
183 * Return: none
184 */
185void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
186 void *body_ptr, uint32_t body_val);
187
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800188void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530189 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800190
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530191QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800192 int value);
193
194/*
195 * wma_scan_roam.c functions declarations
196 */
197
198#ifdef WLAN_FEATURE_ROAM_OFFLOAD
199void wma_process_roam_invoke(WMA_HANDLE handle,
200 struct wma_roam_invoke_cmd *roaminvoke);
201
202void wma_process_roam_synch_fail(WMA_HANDLE handle,
203 struct roam_offload_synch_fail *synch_fail);
204
205int wma_roam_synch_event_handler(void *handle, uint8_t *event,
206 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530207
208/**
209 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
210 * @handle: wma handle
211 * @event: event data
212 * @len: length of data
213 *
214 * This function is roam synch frame event handler.
215 *
216 * Return: Success or Failure status
217 */
218int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
219 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800220#endif
221
Kapil Gupta5cda2252016-12-29 18:44:26 +0530222/**
223 * wma_update_per_roam_config() -per roam config parameter updation to FW
224 * @handle: wma handle
225 * @req_buf: per roam config parameters
226 *
227 * Return: none
228 */
229void wma_update_per_roam_config(WMA_HANDLE handle,
230 struct wmi_per_roam_config_req *req_buf);
231
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530232QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233 tSirUpdateChanList *chan_list);
234
235#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530236QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530237 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800238 roam_offload_params,
239 tSirRoamOffloadScanReq *roam_req);
240#endif
241
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530242QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800243 wmi_start_scan_cmd_fixed_param *
244 scan_cmd_fp,
245 tSirRoamOffloadScanReq *roam_req,
246 uint32_t mode, uint32_t vdev_id);
247
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700248/**
249 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
250 * @wma_handle: wma handle
251 * @roam_req: roam request param
252 *
253 * Fill the MAWC roaming parameters and send
254 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
255 *
256 * Return: QDF status
257 */
258QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
259 tSirRoamOffloadScanReq *roam_req);
260
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530261QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800262 tSirRoamOffloadScanReq *roam_req);
263
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530264QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265 uint32_t scan_period,
266 uint32_t scan_age,
267 uint32_t vdev_id);
268
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530269QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800270 uint32_t vdev_id,
271 int32_t rssi_change_thresh,
272 uint32_t bcn_rssi_weight,
273 uint32_t hirssi_delay_btw_scans);
274
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530275QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800276 uint8_t chan_count,
277 uint8_t *chan_list,
278 uint8_t list_type, uint32_t vdev_id);
279
280A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
281 eCsrEncryptionType encr);
282
283A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
284
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800285void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
Jeff Johnson9f18aa72018-12-02 12:05:12 -0800286 struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800287 tSirRoamOffloadScanReq *roam_req,
288 wmi_start_scan_cmd_fixed_param *
289 scan_params);
290
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530291QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800292 A_INT32 first_bcnt,
293 A_UINT32 final_bcnt, uint32_t vdev_id);
294
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530295QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800296 uint32_t command, uint32_t vdev_id);
297
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800298void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
299
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800300#ifdef WLAN_FEATURE_ROAM_OFFLOAD
301void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
302#endif
303
304#ifdef FEATURE_WLAN_EXTSCAN
305
306int wma_extscan_start_stop_event_handler(void *handle,
307 uint8_t *cmd_param_info,
308 uint32_t len);
309
310int wma_extscan_operations_event_handler(void *handle,
311 uint8_t *cmd_param_info,
312 uint32_t len);
313
314int wma_extscan_table_usage_event_handler(void *handle,
315 uint8_t *cmd_param_info,
316 uint32_t len);
317
318int wma_extscan_capabilities_event_handler(void *handle,
319 uint8_t *cmd_param_info,
320 uint32_t len);
321
322int wma_extscan_hotlist_match_event_handler(void *handle,
323 uint8_t *cmd_param_info,
324 uint32_t len);
325
326int wma_extscan_cached_results_event_handler(void *handle,
327 uint8_t *cmd_param_info,
328 uint32_t len);
329
330int wma_extscan_change_results_event_handler(void *handle,
331 uint8_t *cmd_param_info,
332 uint32_t len);
333
334int wma_passpoint_match_event_handler(void *handle,
335 uint8_t *cmd_param_info,
336 uint32_t len);
337
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800338#endif
339
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530340int wma_handle_btm_blacklist_event(void *handle, uint8_t *cmd_param_info,
341 uint32_t len);
342
Wen Gong7952fbd2018-04-18 11:27:23 +0800343#ifdef FEATURE_WLAN_EXTSCAN
344int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
345
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
347
Jeff Johnsondab58602018-07-14 15:30:24 -0700348/**
349 * wma_start_extscan() - start extscan command to fw.
350 * @wma: wma handle
351 * @params: extscan command request params
352 *
353 * This function sends start extscan request to fw.
354 *
355 * Return: QDF Status.
356 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530357QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Jeff Johnsondab58602018-07-14 15:30:24 -0700358 struct wifi_scan_cmd_req_params *pstart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800359
Jeff Johnson7272ea72018-07-15 17:22:27 -0700360/**
361 * wma_stop_extscan() - stop extscan command to fw.
362 * @wma: wma handle
363 * @params: stop scan command request params
364 *
365 * This function sends stop extscan request to fw.
366 *
367 * Return: QDF Status.
368 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530369QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Jeff Johnson7272ea72018-07-15 17:22:27 -0700370 struct extscan_stop_req_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371
Jeff Johnson1148cb02018-07-13 23:14:32 -0700372/**
373 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
374 * @wma: wma handle
375 * @params: hotlist request params
376 *
377 * This function configures hotlist monitor in fw.
378 *
379 * Return: QDF status
380 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530381QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700382 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383
Jeff Johnson9743eb72018-07-14 10:30:04 -0700384/**
385 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
386 * @wma: wma handle
387 * @params: hotlist request params
388 *
389 * This function configures hotlist monitor to stop in fw.
390 *
391 * Return: QDF status
392 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530393QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700394 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700396/**
397 * wma_extscan_start_change_monitor() - send start change monitor cmd
398 * @wma: wma handle
399 * @params: change monitor request params
400 *
401 * This function sends start change monitor request to fw.
402 *
403 * Return: QDF status
404 */
405QDF_STATUS
406wma_extscan_start_change_monitor(tp_wma_handle wma,
407 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800408
Jeff Johnson0c8dbc32018-07-16 22:10:48 -0700409/**
410 * wma_extscan_stop_change_monitor() - send stop change monitor cmd
411 * @wma: wma handle
412 * @params: change monitor request params
413 *
414 * This function sends stop change monitor request to fw.
415 *
416 * Return: QDF status
417 */
418QDF_STATUS
419wma_extscan_stop_change_monitor(tp_wma_handle wma,
420 struct extscan_capabilities_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800421
Jeff Johnson2ba60092018-07-17 08:19:37 -0700422/**
423 * wma_extscan_get_cached_results() - extscan get cached results
424 * @wma: wma handle
425 * @params: cached results parameters
426 *
427 * This function send request to fw to get cached results.
428 *
429 * Return: QDF status
430 */
431QDF_STATUS
432wma_extscan_get_cached_results(tp_wma_handle wma,
433 struct extscan_cached_result_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800434
Jeff Johnsonfed9a732018-07-18 12:18:03 -0700435/**
436 * wma_extscan_get_capabilities() - extscan get capabilities
437 * @wma: wma handle
438 * @params: get capabilities params
439 *
440 * This function sends request to fw to get extscan capabilities.
441 *
442 * Return: QDF status
443 */
444QDF_STATUS
445wma_extscan_get_capabilities(tp_wma_handle wma,
446 struct extscan_capabilities_params *params);
447
Jeff Johnson360135b2018-07-18 20:51:47 -0700448/**
449 * wma_set_epno_network_list() - set epno network list
450 * @wma: WMA handle
451 * @req: epno config params request structure
452 *
453 * This function reads the incoming epno config request structure
454 * and constructs the WMI message to the firmware.
455 *
456 * Return: 0 on success, error number otherwise
457 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530458QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Jeff Johnson360135b2018-07-18 20:51:47 -0700459 struct wifi_enhanced_pno_params *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800460
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700461/**
462 * wma_set_passpoint_network_list() - set passpoint network list
463 * @wma: WMA handle
464 * @params: passpoint network request structure
465 *
466 * This function sends the passpoint configs down to the firmware
467 *
468 * Return: QDF_STATUS enumeration
469 */
470QDF_STATUS
471wma_set_passpoint_network_list(tp_wma_handle wma,
472 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800473
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700474/**
475 * wma_reset_passpoint_network_list() - reset passpoint network list
476 * @wma: WMA handle
477 * @params: passpoint network request structure
478 *
479 * This function sends down WMI command with network id set to wildcard id.
480 * firmware shall clear all the config entries
481 *
482 * Return: QDF_STATUS enumeration
483 */
484QDF_STATUS
485wma_reset_passpoint_network_list(tp_wma_handle wma,
486 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487#endif
488
Jeff Johnson9d45f332019-01-29 08:42:00 -0800489/**
490 * wma_scan_probe_setoui() - set scan probe OUI
491 * @wma: wma handle
492 * @set_oui: OUI parameters
493 *
494 * set scan probe OUI parameters in firmware
495 *
496 * Return: QDF status
497 */
498QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma,
499 struct scan_mac_oui *set_oui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800500
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800501void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
502
503int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
504 uint32_t len);
505
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800506#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800507void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
508static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
509 uint8_t vdev_id)
510{
511 return wma->interfaces[vdev_id].roam_synch_in_progress;
512}
513#else
514static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
515 uint8_t vdev_id)
516{
517 return false;
518}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700519static inline uint32_t wma_roam_scan_get_cckm_mode(
520 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
521{
522 return WMI_AUTH_CCKM;
523}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800524#endif
525
526/*
527 * wma_dev_if.c functions declarations
528 */
529
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800530struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800531 uint8_t *vdev_id);
532
533/**
534 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
535 * @wma - wma handle
536 * @vdev_id - vdev ID
537 *
538 * Return: Returns vdev handle if given vdev id is valid.
539 * Otherwise returns NULL.
540 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800541static inline
542struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800543{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700544 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800545 return NULL;
546
547 return wma->interfaces[vdev_id].handle;
548}
549
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
551
552#ifdef QCA_IBSS_SUPPORT
553bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700554#else
555/**
556 * wma_is_vdev_in_ibss_mode(): dummy function
557 * @wma: wma handle
558 * @vdev_id: vdev id
559 *
560 * Return false since no vdev can be in ibss mode without ibss support
561 */
562static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700563bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700564{
565 return false;
566}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800567#endif
568
569/**
570 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
571 * @wma - wma handle
572 * @vdev_id - vdev ID
573 *
574 * Return: Returns pointer to bssid on success,
575 * otherwise returns NULL.
576 */
577static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
578 uint8_t vdev_id)
579{
580 if (vdev_id >= wma->max_bssid)
581 return NULL;
582
583 return wma->interfaces[vdev_id].bssid;
584}
585
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800586struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800587 uint8_t *vdev_id);
588
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530589QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800590 struct del_sta_self_params *pdel_sta_self_req_param,
591 uint8_t generateRsp);
592
593int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
594 uint32_t len);
595
Govind Singhd76a5b02016-03-08 15:12:14 +0530596QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597 uint32_t param_id, uint32_t param_value);
Rajeev Kumar Sirasanagandlae5787e22018-10-25 21:10:34 +0530598
599QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
600 uint8_t vdev_id, void *peer,
601 bool roam_synch_in_progress);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800602
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800603QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
604 struct cdp_vdev *vdev,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700605 uint8_t peer_addr[IEEE80211_ADDR_LEN],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800606 uint32_t peer_type, uint8_t vdev_id,
607 bool roam_synch_in_progress);
608
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530609/**
610 * wma_send_del_bss_response() - send delete bss resp
611 * @wma: wma handle
612 * @req: target request
613 *
614 * Return: none
615 */
616void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +0530617
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530618/**
Sandeep Puligilla2a7fa842018-10-02 01:00:56 -0700619 * wma_send_set_link_response() - send set link response
620 * @wma: wma handle
621 * @req: target request
622 *
623 * Return: none
624 */
625void wma_send_set_link_response(tp_wma_handle wma, struct wma_target_req *req);
626
627/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +0530628 * __wma_handle_vdev_stop_rsp() - vdev stop response handler
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530629 * @handle: wma handle
630 * @cmd_param_info: event buffer
631 * @len: buffer length
632 *
633 * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code
634 */
635QDF_STATUS
Abhishek Singhfb5b4d32018-12-06 11:53:08 +0530636__wma_handle_vdev_stop_rsp(wmi_vdev_stopped_event_fixed_param *resp_event);
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530637
638/**
639 * wma_vdev_stop_resp_handler() - vdev stop response handler
640 * @handle: wma handle
641 * @cmd_param_info: event buffer
642 * @len: buffer length
643 *
644 * Return: 0 for success or error code
645 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700647 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800648
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800649struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800650 struct add_sta_self_params *self_sta_req,
651 uint8_t generateRsp);
652
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700653QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
654 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655
656void wma_vdev_resp_timer(void *data);
657
658struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
659 uint8_t vdev_id,
660 uint32_t msg_type, uint8_t type,
661 void *params, uint32_t timeout);
662
663void wma_hold_req_timer(void *data);
664struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
665 uint8_t vdev_id, uint32_t msg_type,
666 uint8_t type, void *params,
667 uint32_t timeout);
668
669void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
670 uint8_t type);
671
672void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
673
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800674void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
675
676void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
677
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
679
680int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
681
682void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
683 tpDisableIntraBssFwd pdis_intra_fwd);
684
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700685void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
686
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800687uint32_t wma_get_bcn_rate_code(uint16_t rate);
688
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689/*
690 * wma_mgmt.c functions declarations
691 */
Harprit Chhabada98225f62018-12-11 15:29:55 -0800692#ifdef CONFIG_WMI_BCN_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
Harprit Chhabada98225f62018-12-11 15:29:55 -0800694#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800695
Krunal Sonibd7e8932018-10-03 11:14:51 -0700696int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
697 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800699int wma_unified_bcntx_status_event_handler(void *handle,
700 uint8_t *cmd_param_info,
701 uint32_t len);
702
mukul sharma72c8b222015-09-04 17:02:01 +0530703void wma_set_sta_sa_query_param(tp_wma_handle wma,
704 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705
706void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
707 uint32_t method, uint32_t timeperiod,
708 uint8_t *hostv4addr, uint8_t *destv4addr,
709 uint8_t *destmac);
710
711int wma_vdev_install_key_complete_event_handler(void *handle,
712 uint8_t *event,
713 uint32_t len);
714
Govind Singhb30d4c02016-03-24 11:01:23 +0530715QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800716 tSirNwType nw_type,
717 tpAddStaParams params);
718
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530719QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
720 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721 gtx_config_t *gtx_info);
722
723void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
724 uint8_t llbcoexist);
725
726void wma_process_update_beacon_params(tp_wma_handle wma,
727 tUpdateBeaconParams *bcn_params);
728
Harprit Chhabadabec6de42018-09-10 10:21:15 -0700729void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
730
731void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800733void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
734 uint8_t vdev_id,
735 int8_t peer_num_delta);
736
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -0700737#ifdef CRYPTO_SET_KEY_CONVERGED
738static inline void wma_set_stakey(tp_wma_handle wma_handle,
739 tpSetStaKeyParams key_info)
740{
741}
742
743static inline void wma_set_bsskey(tp_wma_handle wma_handle,
744 tpSetBssKeyParams key_info)
745{
746}
747#else
748/**
749 * wma_set_stakey() - set encryption key
750 * @wma_handle: wma handle
751 * @key_info: station key info
752 *
753 * This function sets encryption key for WEP/WPA/WPA2
754 * encryption mode in firmware and send response to upper layer.
755 *
756 * Return: none
757 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
759
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -0700760/**
761 * wma_set_bsskey() - set encryption key to fw.
762 * @wma_handle: wma handle
763 * @key_info: key info
764 *
765 * Return: none
766 */
767void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
768#endif
769
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530770QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800771 tEdcaParams *edca_params);
772
773int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
774 uint32_t len);
775
776void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
777 tpSendProbeRespParams probe_rsp_info);
778
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530779/**
780 * wma_set_ap_vdev_up() - send vdev up req
781 * @wma: wma handle
782 * @vdev_id: vdev id
783 *
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530784 * Return: QDF_STATUS
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530785 */
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530786QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530787
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800788void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
789
790void wma_set_keepalive_req(tp_wma_handle wma,
791 tSirKeepAliveReq *keepalive);
792
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530793void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
794 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800795
796void wma_process_update_opmode(tp_wma_handle wma_handle,
797 tUpdateVHTOpMode *update_vht_opmode);
798
799void wma_process_update_rx_nss(tp_wma_handle wma_handle,
800 tUpdateRxNss *update_rx_nss);
801
802void wma_process_update_membership(tp_wma_handle wma_handle,
803 tUpdateMembership *membership);
804
805void wma_process_update_userpos(tp_wma_handle wma_handle,
806 tUpdateUserPos *userpos);
807
808void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
809 tHalHiddenSsidVdevRestart *pReq);
810
811/*
812 * wma_power.c functions declarations
813 */
814
815void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
816
Govind Singhd76a5b02016-03-08 15:12:14 +0530817QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800818 uint32_t vdev_id, uint32_t param,
819 uint32_t value);
820
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530821QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800822wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
823
Govind Singhd76a5b02016-03-08 15:12:14 +0530824QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800825 uint8_t *peer_addr, uint8_t uapsd_value,
826 uint8_t max_sp);
827
828void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800829 struct wmi_host_wme_vparams *wmm_param,
830 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800831
832void wma_set_tx_power(WMA_HANDLE handle,
833 tMaxTxPowerParams *tx_pwr_params);
834
835void wma_set_max_tx_power(WMA_HANDLE handle,
836 tMaxTxPowerParams *tx_pwr_params);
837
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800838void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
839
840void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
841
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700842void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800843
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530844QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800845
846int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
847 uint32_t len);
848
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530849QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800850 tSirTxPowerLimit *ptxlim);
851
852void wma_update_noa(struct beacon_info *beacon,
853 struct p2p_sub_element_noa *noa_ie);
854
855void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
856 struct p2p_sub_element_noa *noa_ie);
857
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800858void wma_process_set_mimops_req(tp_wma_handle wma_handle,
859 tSetMIMOPS *mimops);
860
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530861QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800862
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530863QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800864 tSirModemPowerStateInd *pReq);
865
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530866QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800867 int value);
868
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800869/*
870 * wma_data.c functions declarations
871 */
872
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700873void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
874 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800875
876int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
877
Jiachao Wu08719b02017-07-05 13:05:34 +0800878/**
879 * wma_check_txrx_chainmask() - check txrx chainmask
880 * @num_rf_chains: number of rf chains
881 * @cmd_value: command value
882 *
883 * Return: QDF_STATUS_SUCCESS for success or error code
884 */
885QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800886
887int wma_peer_state_change_event_handler(void *handle,
888 uint8_t *event_buff,
889 uint32_t len);
890
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530891QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800892 mcc_adaptive_scheduler);
893
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530894QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800895 (tp_wma_handle wma,
896 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
897
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530898QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800899 (tp_wma_handle wma,
900 uint32_t adapter_1_chan_number,
901 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
902
903void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
904
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530905QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800906 tSirRateUpdateInd *
907 pRateUpdateParams);
908
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530909QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800910
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530911QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800912
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530913#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
914 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
915
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800916int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
917 uint32_t len);
918#endif
919
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530920#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
921QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
922 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700923#else
924static inline QDF_STATUS
925wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
926 struct t_bad_peer_txtcl_config *config)
927{
928 return QDF_STATUS_E_FAILURE;
929}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530930#endif
931
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530932QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800933 t_thermal_mgmt *pThermalParams);
934
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530935QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800936 uint8_t thermal_level);
937
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530938QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800939 t_thermal_cmd_params thermal_info);
940
941int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
942 uint32_t len);
943
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800944int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
945 uint32_t len);
946
947int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
948 uint32_t len);
949
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800950/*
951 * wma_utils.c functions declarations
952 */
953
954#ifdef WLAN_FEATURE_STATS_EXT
955int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
956 uint32_t len);
957#endif
958
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700959enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800960int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800961
962#ifdef WLAN_FEATURE_LINK_LAYER_STATS
963void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
964
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530965QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800966 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
967
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530968QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800969 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
970
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530971QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700972 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800973
974int wma_unified_link_iface_stats_event_handler(void *handle,
975 uint8_t *cmd_param_info,
976 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800977void wma_config_stats_ext_threshold(tp_wma_handle wma,
978 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800979#endif
980
981void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
982 uint8_t link_status);
983
984int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
985 uint32_t len);
986
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530987/**
988 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
989 * @wmi_event: WMI event
990 *
991 * This function is used to send RSO command status to upper layer
992 *
993 * Return: 0 for success
994 */
995int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
996
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
998 uint32_t len);
999
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301000QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001
1002int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
1003 uint32_t len);
1004
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301005QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001006
1007int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
1008 uint32_t len);
1009
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001010WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
1011 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001012 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013
1014int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
1015 uint8_t vdev_id, uint32_t value);
1016
1017int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
1018 uint8_t vdev_id, uint32_t value);
1019
Naveen Rawatfa2a1002018-05-17 16:06:37 -07001020#ifdef QCA_SUPPORT_CP_STATS
1021static inline void wma_get_stats_req(WMA_HANDLE handle,
1022 struct sAniGetPEStatsReq *get_stats_param) {}
1023#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -07001025 struct sAniGetPEStatsReq *get_stats_param);
1026#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001027/*
1028 * wma_features.c functions declarations
1029 */
1030
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08001031/**
1032 * wma_sar_register_event_handlers() - Register SAR event handlers
1033 * @handle: WMA Handle
1034 *
1035 * Function to be called during WMA initialization to register SAR
1036 * event handlers with WMI
1037 *
1038 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
1039 * an error enumeration
1040 */
1041QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
1042
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001043void wma_process_link_status_req(tp_wma_handle wma,
1044 tAniGetLinkStatus *pGetLinkStatus);
1045
Will Huanga9814592017-05-24 15:47:58 +08001046QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
1047 struct sir_peer_info_req *peer_info_req);
1048
1049/**
1050 * wma_get_peer_info_ext() - get peer info
1051 * @handle: wma interface
1052 * @peer_info_req: get peer info request information
1053 *
1054 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
1055 *
1056 * Return: 0 on success, otherwise error value
1057 */
1058QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
1059 struct sir_peer_info_ext_req *peer_info_req);
1060
1061/**
1062 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
1063 * @handle: WMA global handle
1064 * @cmd_param_info: Command event data
1065 * @len: Length of cmd_param_info
1066 *
1067 * This function will handle WMI_PEER_STATS_INFO_EVENTID
1068 *
1069 * Return: 0 on success, error code otherwise
1070 */
1071int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
1072 u_int32_t len);
1073
Govind Singha471e5e2015-10-12 17:11:14 +05301074int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
1075 uint32_t len);
1076
Govind Singhf25a0f12016-03-08 16:09:48 +05301077QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +05301078 uint32_t cmd, uint32_t value1, uint32_t value2);
1079
Govind Singhd76a5b02016-03-08 15:12:14 +05301080int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001081
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082#ifdef FEATURE_WLAN_TDLS
1083int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
1084#endif
1085
1086int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
1087
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001088#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -08001089int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1090 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001091#endif
1092
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001093#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301094QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001095 struct ath_pktlog_wmi_params *params);
1096#endif
1097
1098int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1099 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +08001100
1101int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
1102
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001103int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1104
Jeff Johnson256002f2018-12-22 17:53:19 -08001105void wma_del_ts_req(tp_wma_handle wma, struct del_ts_params *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001106
Jeff Johnson54024412018-12-22 12:07:06 -08001107/**
1108 * wma_aggr_qos_req() - send aggr qos request to fw
1109 * @wma: handle to wma
1110 * @pAggrQosRspMsg - combined struct for all ADD_TS requests.
1111 *
1112 * A function to handle WMA_AGGR_QOS_REQ. This will send out
1113 * ADD_TS requestes to firmware in loop for all the ACs with
1114 * active flow.
1115 *
1116 * Return: none
1117 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001118void wma_aggr_qos_req(tp_wma_handle wma,
Jeff Johnson54024412018-12-22 12:07:06 -08001119 struct aggr_add_ts_param *pAggrQosRspMsg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001120
Jeff Johnson9851fcc2018-12-22 17:29:58 -08001121void wma_add_ts_req(tp_wma_handle wma, struct add_ts_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001122
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001123#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301124QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001125 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001126QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
1127QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
1128void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001129#endif
1130
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301131QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1132 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001133QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1134
1135QDF_STATUS wma_process_get_peer_info_req
1136 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1137
1138QDF_STATUS wma_process_tx_fail_monitor_ind
1139 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1140
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301141#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001142QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1143
1144QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1145
1146QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301147#else
1148static inline
1149QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1150{
1151 return QDF_STATUS_SUCCESS;
1152}
1153
1154static inline
1155QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1156{
1157 return QDF_STATUS_SUCCESS;
1158}
1159
1160static inline
1161QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1162{
1163 return QDF_STATUS_SUCCESS;
1164}
1165#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001166
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301167QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Jeff Johnson6dcb44a2018-12-23 10:17:00 -08001168 tSirAddPeriodicTxPtrn *pattern);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001169
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301170QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001171 tSirDelPeriodicTxPtrn *
1172 pDelPeriodicTxPtrnParams);
1173
1174#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301175QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001176#endif
1177
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301179QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001180
1181int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1182 tpSirAppType1Params appType1Params);
1183
Himanshu Agarwal44195412016-03-09 13:03:54 +05301184QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001185 tpSirAppType2Params appType2Params);
1186#endif
1187
1188#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1189int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1190 uint32_t len);
1191
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301192QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001193 tSirAutoShutdownCmdParams *
1194 auto_sh_cmd);
1195#endif
1196
Manikandan Mohan976e7562016-03-15 16:33:31 -07001197#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001198int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1199QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1200QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001201QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1202#else
1203static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1204 uint32_t vdev_id)
1205{
1206 return QDF_STATUS_SUCCESS;
1207}
1208
1209static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1210 uint32_t vdev_id)
1211{
1212 return QDF_STATUS_SUCCESS;
1213}
1214
1215static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1216 uint32_t data_len)
1217{
1218 return 0;
1219}
1220
1221static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1222{
1223 return QDF_STATUS_E_INVAL;
1224}
1225#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001226QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001227
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001228#ifdef DHCP_SERVER_OFFLOAD
1229int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1230 tSirDhcpSrvOffloadInfo *
1231 pDhcpSrvOffloadInfo);
1232#endif
1233
1234#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301235QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001236 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001237#endif
1238
Kabilan Kannancaa85502018-04-13 18:04:58 -07001239/**
1240 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001241 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001242 * @event: event buffer
1243 * @len: buffer length
1244 *
1245 * Return: 0 for success or error code
1246 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001247int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001248
Nirav Shaheb017be2018-02-15 11:20:58 +05301249#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301250QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001251 tSirChAvoidUpdateReq *
1252 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301253#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001254
1255#ifdef FEATURE_WLAN_TDLS
1256
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001257int wma_update_tdls_peer_state(WMA_HANDLE handle,
1258 tTdlsPeerStateParams *peerStateParams);
1259/**
1260 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1261 * @handle: wma handle
1262 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1263 *
1264 * This function sets tdls off channel mode
1265 *
1266 * Return: 0 on success; negative errno otherwise
1267 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301268QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001269 tdls_chan_switch_params *chan_switch_params);
1270#endif
1271
Hong Shib90718f2017-02-20 00:57:22 +08001272void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001273void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1274
Qiwei Caie689a262018-07-26 15:50:22 +08001275#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001276int wma_rssi_breached_event_handler(void *handle,
1277 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001278#else /* FEATURE_RSSI_MONITOR */
1279static inline
1280int wma_rssi_breached_event_handler(void *handle,
1281 u_int8_t *cmd_param_info, u_int32_t len)
1282{
1283 return 0;
1284}
1285#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001286
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07001287QDF_STATUS wma_process_cfg_action_frm_tb_ppdu(tp_wma_handle wma,
1288 struct cfg_action_frm_tb_ppdu *cfg_info);
1289
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301290QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001291 struct vdev_ie_info *ie_info);
1292int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1293 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001294int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1295 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001296
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001297int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1298 uint32_t len);
1299void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1300 uint8_t type);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301301
1302QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1303 struct sir_mac_pwr_dbg_cmd *
1304 sir_pwr_dbg_params);
1305
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301306/**
1307 * wma_lost_link_info_handler() - collect lost link information and inform SME
1308 * @wma: WMA handle
1309 * @vdev_id: vdev ID
1310 * @rssi: rssi at disconnection time
1311 *
1312 * Return: none
1313 */
1314void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1315 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301316int wma_unified_power_debug_stats_event_handler(void *handle,
1317 uint8_t *cmd_param_info, uint32_t len);
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05301318/**
1319 * wma_unified_beacon_debug_stats_event_handler() - collect beacon debug stats
1320 * @handle: WMA handle
1321 * @cmd_param_info: data from event
1322 * @len: length
1323 *
1324 * Return: 0 for success or error code
1325 */
1326int wma_unified_beacon_debug_stats_event_handler(void *handle,
1327 uint8_t *cmd_param_info,
1328 uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301329
1330#ifdef FEATURE_WLAN_DIAG_SUPPORT
1331/**
1332 * wma_sta_kickout_event()- send sta kickout event
1333 * @kickout_reason - reasoncode for kickout
1334 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1335 * @vdev_id: Unique id for identifying the VDEV
1336 *
1337 * This function sends sta kickout diag event
1338 *
1339 * Return: void.
1340 */
1341void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1342 uint8_t *macaddr);
1343#else
1344static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1345 uint8_t vdev_id, uint8_t *macaddr)
1346{
1347
1348};
1349#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1350
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001351/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301352 * wma_get_rcpi_req() - get rcpi request
1353 * @handle: wma handle
1354 * @rcpi_request: rcpi params
1355 *
1356 * Return: none
1357 */
1358QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1359 struct sme_rcpi_req *rcpi_request);
1360
1361/**
1362 * wma_rcpi_event_handler() - rcpi event handler
1363 * @handle: wma handle
1364 * @cmd_param_info: data from event
1365 * @len: length
1366 *
1367 * Return: 0 for success or error code
1368 */
1369int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1370 uint32_t len);
1371
1372/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001373 * wma_acquire_wakelock() - acquire the given wakelock
1374 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001375 * @msec: the wakelock duration in milliseconds
1376 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001377 * This also acquires the wma runtime pm lock.
1378 *
1379 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001380 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001381void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001382
1383/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001384 * wma_release_wakelock() - release the given wakelock
1385 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001386 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001387 * This also releases the wma runtime pm lock.
1388 *
1389 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001390 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001391void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001392
1393/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001394 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001395 * @wma: a reference to the global WMA handle
1396 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001397 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001398 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1399 * response from firmware to avoid power penalties. Alternatively, calling the
1400 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001401 *
1402 * Return: QDF_STATUS
1403 */
1404QDF_STATUS
1405wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1406
1407/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001408 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001409 * @wma: a reference to the global WMA handle
1410 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001411 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001412 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1413 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001414 *
1415 * Return: QDF_STATUS
1416 */
1417QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1418
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301419int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1420
Dustin Brownec2c92e2017-07-26 11:13:49 -07001421/**
1422 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1423 * @wma: a reference to the global WMA handle
1424 * @params: the vdev up params to send to firmware
1425 * @bssid: the BssId to send to firmware
1426 *
1427 * This also releases the vdev start wakelock.
1428 *
1429 * Return: QDF_STATUS
1430 */
1431QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1432 struct vdev_up_params *params,
1433 uint8_t bssid[IEEE80211_ADDR_LEN]);
1434
1435/**
1436 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1437 * @wma: a reference to the global WMA handle
1438 * @vdev_id: the Id of the vdev to down
1439 *
1440 * This also releases the vdev start wakelock.
1441 *
1442 * Return: QDF_STATUS
1443 */
1444QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1445
lifeng66831662017-05-19 16:01:35 +08001446/*
1447 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1448 * @handle: the wma handle
1449 * @event_buf: buffer with event
1450 * @len: buffer length
1451 *
1452 * This function receives rx aggregation failure event and then pass to upper
1453 * layer
1454 *
1455 * Return: 0 on success
1456 */
1457int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1458 u_int32_t len);
1459
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301460/**
1461 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1462 * @handle: the WMA handle
1463 * @event: buffer with the event parameters
1464 * @len: length of the buffer
1465 *
1466 * This function receives BT activity event from firmware and passes the event
1467 * information to upper layers
1468 *
1469 * Return: 0 on success
1470 */
1471int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1472 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001473
1474/**
lifengfe6c3e22018-04-03 12:10:04 +08001475 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001476 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001477 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001478 * @len: buffer length
1479 *
1480 * This function receives antenna info from firmware and passes the event
1481 * to upper layer
1482 *
1483 * Return: 0 on success
1484 */
lifengfe6c3e22018-04-03 12:10:04 +08001485int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001486 u_int32_t len);
1487
lifeng7c607dd2017-02-21 21:16:49 +08001488/**
1489 * wma_update_beacon_interval() - update beacon interval in fw
1490 * @wma: wma handle
1491 * @vdev_id: vdev id
1492 * @beaconInterval: becon interval
1493 *
1494 * Return: none
1495 */
1496void
1497wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1498 uint16_t beaconInterval);
1499
1500#define RESET_BEACON_INTERVAL_TIMEOUT 200
1501
1502struct wma_beacon_interval_reset_req {
1503 qdf_timer_t event_timeout;
1504 uint8_t vdev_id;
1505 uint16_t interval;
1506};
1507
1508/**
1509 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1510 * @wma: wma handle
1511 * @vdev_id: vdev id
1512 * @beacon_interval: beacon interval
1513 * @timeout: timeout val
1514 *
1515 * Return: status
1516 */
1517int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1518 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301519/*
1520 * wma_is_vdev_valid() - check the vdev status
1521 * @vdev_id: vdev identifier
1522 *
1523 * This function verifies the vdev validity
1524 *
1525 * Return: 'true' on valid vdev else 'false'
1526 */
1527bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001528
1529/**
1530 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1531 * @handle: the wma handle
1532 * @event: buffer with event
1533 * @len: buffer length
1534 *
1535 * This function receives obss detection info from firmware which is used to
1536 * decide obss protection.
1537 *
1538 * Return: 0 on success
1539 */
1540int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1541 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001542
1543/**
1544 * wma_vdev_bss_color_collision_info_handler - event handler to
1545 * handle obss color collision detection.
1546 * @handle: the wma handle
1547 * @event: buffer with event
1548 * @len: buffer length
1549 *
1550 * This function receives obss color collision detection info from firmware
1551 * which is used to select new bss color.
1552 *
1553 * Return: 0 on success
1554 */
1555int wma_vdev_bss_color_collision_info_handler(void *handle,
1556 uint8_t *event,
1557 uint32_t len);
1558
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001559int wma_twt_en_complete_event_handler(void *handle,
1560 uint8_t *event, uint32_t len);
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301561/**
1562 * wma_get_roam_scan_stats() - Get roam scan stats request
1563 * @handle: wma handle
1564 * @req: request details
1565 *
1566 * Return: QDF_STATUS
1567 */
1568QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
1569 struct sir_roam_scan_stats *req);
1570
1571/**
Vignesh Viswanathan36358182018-10-25 17:36:35 +05301572 * wma_remove_peer_on_add_bss_failure() - remove the CDP peers in case of
1573 * ADD BSS request failed
1574 * @add_bss_params: Pointer to the Add BSS request params
1575 *
1576 * This API deletes the CDP peer created during ADD BSS in case of ADD BSS
1577 * request sent to the FW fails.
1578 *
1579 * Return: None;
1580 */
1581void wma_remove_peer_on_add_bss_failure(tpAddBssParams add_bss_params);
1582
1583/**
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301584 * wma_roam_scan_stats_event_handler() - roam scan stats event handler
1585 * @handle: wma handle
1586 * @event: event data
1587 * @len: length of data
1588 *
1589 * Return: Success or Failure status
1590 */
1591int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event,
1592 uint32_t len);
1593
Abhishek Singhcaa61852018-09-12 15:50:04 +05301594/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +05301595 * wma_send_vdev_down() - send del bss req to firmware
Abhishek Singhcaa61852018-09-12 15:50:04 +05301596 * @wma: wma handle.
1597 * @vdev_id: vdev ID of device for which MCC has to be checked
1598 *
1599 * This function sends del bss resp to upper layer
1600 *
1601 * Return: none
1602 */
Abhishek Singhfb5b4d32018-12-06 11:53:08 +05301603void wma_send_vdev_down(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +05301604
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001605#endif