blob: 02c180ecccac3a9751190033d4d85d48720d627a [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,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800239 struct roam_offload_scan_req *roam_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800240#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,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800245 struct roam_offload_scan_req *roam_req,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800246 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,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800259 struct roam_offload_scan_req *roam_req);
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700260
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800261/**
262 * wma_roam_scan_offload_rssi_threshold() - set scan offload rssi threashold
263 * @wma_handle: wma handle
264 * @roam_req: Roaming request buffer
265 *
266 * Send WMI_ROAM_SCAN_RSSI_THRESHOLD TLV to firmware
267 *
268 * Return: QDF status
269 */
270QDF_STATUS
271wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
272 struct roam_offload_scan_req *roam_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800273
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530274QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800275 uint32_t scan_period,
276 uint32_t scan_age,
277 uint32_t vdev_id);
278
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530279QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800280 uint32_t vdev_id,
281 int32_t rssi_change_thresh,
282 uint32_t bcn_rssi_weight,
283 uint32_t hirssi_delay_btw_scans);
284
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530285QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800286 uint8_t chan_count,
287 uint8_t *chan_list,
288 uint8_t list_type, uint32_t vdev_id);
289
290A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
291 eCsrEncryptionType encr);
292
293A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
294
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800295void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
Jeff Johnson9f18aa72018-12-02 12:05:12 -0800296 struct mac_context *mac,
Jeff Johnsone6da4b02019-02-06 22:22:04 -0800297 struct roam_offload_scan_req *roam_req,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800298 wmi_start_scan_cmd_fixed_param *
299 scan_params);
300
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530301QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800302 A_INT32 first_bcnt,
303 A_UINT32 final_bcnt, uint32_t vdev_id);
304
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530305QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800306 uint32_t command, uint32_t vdev_id);
307
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800308void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
309
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800310#ifdef WLAN_FEATURE_ROAM_OFFLOAD
311void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
312#endif
313
314#ifdef FEATURE_WLAN_EXTSCAN
315
316int wma_extscan_start_stop_event_handler(void *handle,
317 uint8_t *cmd_param_info,
318 uint32_t len);
319
320int wma_extscan_operations_event_handler(void *handle,
321 uint8_t *cmd_param_info,
322 uint32_t len);
323
324int wma_extscan_table_usage_event_handler(void *handle,
325 uint8_t *cmd_param_info,
326 uint32_t len);
327
328int wma_extscan_capabilities_event_handler(void *handle,
329 uint8_t *cmd_param_info,
330 uint32_t len);
331
332int wma_extscan_hotlist_match_event_handler(void *handle,
333 uint8_t *cmd_param_info,
334 uint32_t len);
335
336int wma_extscan_cached_results_event_handler(void *handle,
337 uint8_t *cmd_param_info,
338 uint32_t len);
339
340int wma_extscan_change_results_event_handler(void *handle,
341 uint8_t *cmd_param_info,
342 uint32_t len);
343
344int wma_passpoint_match_event_handler(void *handle,
345 uint8_t *cmd_param_info,
346 uint32_t len);
347
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348#endif
349
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530350int wma_handle_btm_blacklist_event(void *handle, uint8_t *cmd_param_info,
351 uint32_t len);
352
Wen Gong7952fbd2018-04-18 11:27:23 +0800353#ifdef FEATURE_WLAN_EXTSCAN
354int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
355
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
357
Jeff Johnsondab58602018-07-14 15:30:24 -0700358/**
359 * wma_start_extscan() - start extscan command to fw.
360 * @wma: wma handle
361 * @params: extscan command request params
362 *
363 * This function sends start extscan request to fw.
364 *
365 * Return: QDF Status.
366 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530367QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Jeff Johnsondab58602018-07-14 15:30:24 -0700368 struct wifi_scan_cmd_req_params *pstart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800369
Jeff Johnson7272ea72018-07-15 17:22:27 -0700370/**
371 * wma_stop_extscan() - stop extscan command to fw.
372 * @wma: wma handle
373 * @params: stop scan command request params
374 *
375 * This function sends stop extscan request to fw.
376 *
377 * Return: QDF Status.
378 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530379QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Jeff Johnson7272ea72018-07-15 17:22:27 -0700380 struct extscan_stop_req_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381
Jeff Johnson1148cb02018-07-13 23:14:32 -0700382/**
383 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
384 * @wma: wma handle
385 * @params: hotlist request params
386 *
387 * This function configures hotlist monitor in fw.
388 *
389 * Return: QDF status
390 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530391QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700392 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393
Jeff Johnson9743eb72018-07-14 10:30:04 -0700394/**
395 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
396 * @wma: wma handle
397 * @params: hotlist request params
398 *
399 * This function configures hotlist monitor to stop in fw.
400 *
401 * Return: QDF status
402 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530403QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700404 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800405
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700406/**
407 * wma_extscan_start_change_monitor() - send start change monitor cmd
408 * @wma: wma handle
409 * @params: change monitor request params
410 *
411 * This function sends start change monitor request to fw.
412 *
413 * Return: QDF status
414 */
415QDF_STATUS
416wma_extscan_start_change_monitor(tp_wma_handle wma,
417 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800418
Jeff Johnson0c8dbc32018-07-16 22:10:48 -0700419/**
420 * wma_extscan_stop_change_monitor() - send stop change monitor cmd
421 * @wma: wma handle
422 * @params: change monitor request params
423 *
424 * This function sends stop change monitor request to fw.
425 *
426 * Return: QDF status
427 */
428QDF_STATUS
429wma_extscan_stop_change_monitor(tp_wma_handle wma,
430 struct extscan_capabilities_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800431
Jeff Johnson2ba60092018-07-17 08:19:37 -0700432/**
433 * wma_extscan_get_cached_results() - extscan get cached results
434 * @wma: wma handle
435 * @params: cached results parameters
436 *
437 * This function send request to fw to get cached results.
438 *
439 * Return: QDF status
440 */
441QDF_STATUS
442wma_extscan_get_cached_results(tp_wma_handle wma,
443 struct extscan_cached_result_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800444
Jeff Johnsonfed9a732018-07-18 12:18:03 -0700445/**
446 * wma_extscan_get_capabilities() - extscan get capabilities
447 * @wma: wma handle
448 * @params: get capabilities params
449 *
450 * This function sends request to fw to get extscan capabilities.
451 *
452 * Return: QDF status
453 */
454QDF_STATUS
455wma_extscan_get_capabilities(tp_wma_handle wma,
456 struct extscan_capabilities_params *params);
457
Jeff Johnson360135b2018-07-18 20:51:47 -0700458/**
459 * wma_set_epno_network_list() - set epno network list
460 * @wma: WMA handle
461 * @req: epno config params request structure
462 *
463 * This function reads the incoming epno config request structure
464 * and constructs the WMI message to the firmware.
465 *
466 * Return: 0 on success, error number otherwise
467 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530468QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Jeff Johnson360135b2018-07-18 20:51:47 -0700469 struct wifi_enhanced_pno_params *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800470
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700471/**
472 * wma_set_passpoint_network_list() - set passpoint network list
473 * @wma: WMA handle
474 * @params: passpoint network request structure
475 *
476 * This function sends the passpoint configs down to the firmware
477 *
478 * Return: QDF_STATUS enumeration
479 */
480QDF_STATUS
481wma_set_passpoint_network_list(tp_wma_handle wma,
482 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483
Jeff Johnson2a7f1012018-07-19 07:21:06 -0700484/**
485 * wma_reset_passpoint_network_list() - reset passpoint network list
486 * @wma: WMA handle
487 * @params: passpoint network request structure
488 *
489 * This function sends down WMI command with network id set to wildcard id.
490 * firmware shall clear all the config entries
491 *
492 * Return: QDF_STATUS enumeration
493 */
494QDF_STATUS
495wma_reset_passpoint_network_list(tp_wma_handle wma,
496 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800497#endif
498
Jeff Johnson9d45f332019-01-29 08:42:00 -0800499/**
500 * wma_scan_probe_setoui() - set scan probe OUI
501 * @wma: wma handle
502 * @set_oui: OUI parameters
503 *
504 * set scan probe OUI parameters in firmware
505 *
506 * Return: QDF status
507 */
508QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma,
509 struct scan_mac_oui *set_oui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800510
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800511void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
512
513int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
514 uint32_t len);
515
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800517void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
518static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
519 uint8_t vdev_id)
520{
521 return wma->interfaces[vdev_id].roam_synch_in_progress;
522}
523#else
524static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
525 uint8_t vdev_id)
526{
527 return false;
528}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800529#endif
530
531/*
532 * wma_dev_if.c functions declarations
533 */
534
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800535struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800536 uint8_t *vdev_id);
537
538/**
539 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
540 * @wma - wma handle
541 * @vdev_id - vdev ID
542 *
543 * Return: Returns vdev handle if given vdev id is valid.
544 * Otherwise returns NULL.
545 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800546static inline
547struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800548{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700549 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550 return NULL;
551
552 return wma->interfaces[vdev_id].handle;
553}
554
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800555bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
556
557#ifdef QCA_IBSS_SUPPORT
558bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700559#else
560/**
561 * wma_is_vdev_in_ibss_mode(): dummy function
562 * @wma: wma handle
563 * @vdev_id: vdev id
564 *
565 * Return false since no vdev can be in ibss mode without ibss support
566 */
567static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700568bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700569{
570 return false;
571}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800572#endif
573
574/**
575 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
576 * @wma - wma handle
577 * @vdev_id - vdev ID
578 *
579 * Return: Returns pointer to bssid on success,
580 * otherwise returns NULL.
581 */
582static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
583 uint8_t vdev_id)
584{
585 if (vdev_id >= wma->max_bssid)
586 return NULL;
587
588 return wma->interfaces[vdev_id].bssid;
589}
590
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800591struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800592 uint8_t *vdev_id);
593
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530594QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800595 struct del_sta_self_params *pdel_sta_self_req_param,
596 uint8_t generateRsp);
597
598int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
599 uint32_t len);
600
Govind Singhd76a5b02016-03-08 15:12:14 +0530601QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800602 uint32_t param_id, uint32_t param_value);
Rajeev Kumar Sirasanagandlae5787e22018-10-25 21:10:34 +0530603
604QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
605 uint8_t vdev_id, void *peer,
606 bool roam_synch_in_progress);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800607
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800608QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
609 struct cdp_vdev *vdev,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700610 uint8_t peer_addr[IEEE80211_ADDR_LEN],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800611 uint32_t peer_type, uint8_t vdev_id,
612 bool roam_synch_in_progress);
613
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530614/**
615 * wma_send_del_bss_response() - send delete bss resp
616 * @wma: wma handle
617 * @req: target request
618 *
619 * Return: none
620 */
621void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +0530622
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530623/**
Sandeep Puligilla2a7fa842018-10-02 01:00:56 -0700624 * wma_send_set_link_response() - send set link response
625 * @wma: wma handle
626 * @req: target request
627 *
628 * Return: none
629 */
630void wma_send_set_link_response(tp_wma_handle wma, struct wma_target_req *req);
631
632/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +0530633 * __wma_handle_vdev_stop_rsp() - vdev stop response handler
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530634 * @handle: wma handle
635 * @cmd_param_info: event buffer
636 * @len: buffer length
637 *
638 * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code
639 */
640QDF_STATUS
Abhishek Singhfb5b4d32018-12-06 11:53:08 +0530641__wma_handle_vdev_stop_rsp(wmi_vdev_stopped_event_fixed_param *resp_event);
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530642
643/**
644 * wma_vdev_stop_resp_handler() - vdev stop response handler
645 * @handle: wma handle
646 * @cmd_param_info: event buffer
647 * @len: buffer length
648 *
649 * Return: 0 for success or error code
650 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800651int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
Krunal Sonibd7e8932018-10-03 11:14:51 -0700652 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800653
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800654struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655 struct add_sta_self_params *self_sta_req,
656 uint8_t generateRsp);
657
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700658QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
659 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800660
661void wma_vdev_resp_timer(void *data);
662
663struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
664 uint8_t vdev_id,
665 uint32_t msg_type, uint8_t type,
666 void *params, uint32_t timeout);
667
668void wma_hold_req_timer(void *data);
669struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
670 uint8_t vdev_id, uint32_t msg_type,
671 uint8_t type, void *params,
672 uint32_t timeout);
673
674void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
675 uint8_t type);
676
677void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
678
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800679void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
680
681void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
682
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800683void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
684
685int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
686
687void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
688 tpDisableIntraBssFwd pdis_intra_fwd);
689
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700690void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
691
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800692uint32_t wma_get_bcn_rate_code(uint16_t rate);
693
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694/*
695 * wma_mgmt.c functions declarations
696 */
Harprit Chhabada98225f62018-12-11 15:29:55 -0800697#ifdef CONFIG_WMI_BCN_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
Harprit Chhabada98225f62018-12-11 15:29:55 -0800699#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800700
Krunal Sonibd7e8932018-10-03 11:14:51 -0700701int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
702 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704int wma_unified_bcntx_status_event_handler(void *handle,
705 uint8_t *cmd_param_info,
706 uint32_t len);
707
mukul sharma72c8b222015-09-04 17:02:01 +0530708void wma_set_sta_sa_query_param(tp_wma_handle wma,
709 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800710
711void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
712 uint32_t method, uint32_t timeperiod,
713 uint8_t *hostv4addr, uint8_t *destv4addr,
714 uint8_t *destmac);
715
716int wma_vdev_install_key_complete_event_handler(void *handle,
717 uint8_t *event,
718 uint32_t len);
719
Govind Singhb30d4c02016-03-24 11:01:23 +0530720QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721 tSirNwType nw_type,
722 tpAddStaParams params);
723
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530724QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
725 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800726 gtx_config_t *gtx_info);
727
728void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
729 uint8_t llbcoexist);
730
731void wma_process_update_beacon_params(tp_wma_handle wma,
732 tUpdateBeaconParams *bcn_params);
733
Harprit Chhabadabec6de42018-09-10 10:21:15 -0700734void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
735
736void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800737
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800738void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
739 uint8_t vdev_id,
740 int8_t peer_num_delta);
741
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -0700742#ifdef CRYPTO_SET_KEY_CONVERGED
743static inline void wma_set_stakey(tp_wma_handle wma_handle,
744 tpSetStaKeyParams key_info)
745{
746}
747
748static inline void wma_set_bsskey(tp_wma_handle wma_handle,
749 tpSetBssKeyParams key_info)
750{
751}
752#else
753/**
754 * wma_set_stakey() - set encryption key
755 * @wma_handle: wma handle
756 * @key_info: station key info
757 *
758 * This function sets encryption key for WEP/WPA/WPA2
759 * encryption mode in firmware and send response to upper layer.
760 *
761 * Return: none
762 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800763void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
764
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -0700765/**
766 * wma_set_bsskey() - set encryption key to fw.
767 * @wma_handle: wma handle
768 * @key_info: key info
769 *
770 * Return: none
771 */
772void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
773#endif
774
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530775QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800776 tEdcaParams *edca_params);
777
778int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
779 uint32_t len);
780
781void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
782 tpSendProbeRespParams probe_rsp_info);
783
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530784/**
785 * wma_set_ap_vdev_up() - send vdev up req
786 * @wma: wma handle
787 * @vdev_id: vdev id
788 *
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530789 * Return: QDF_STATUS
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530790 */
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530791QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530792
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800793void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
794
795void wma_set_keepalive_req(tp_wma_handle wma,
Jeff Johnson562ccad2019-02-06 22:10:24 -0800796 struct keep_alive_req *keepalive);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800797
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530798void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
799 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800800
801void wma_process_update_opmode(tp_wma_handle wma_handle,
802 tUpdateVHTOpMode *update_vht_opmode);
803
804void wma_process_update_rx_nss(tp_wma_handle wma_handle,
805 tUpdateRxNss *update_rx_nss);
806
807void wma_process_update_membership(tp_wma_handle wma_handle,
808 tUpdateMembership *membership);
809
810void wma_process_update_userpos(tp_wma_handle wma_handle,
811 tUpdateUserPos *userpos);
812
813void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
814 tHalHiddenSsidVdevRestart *pReq);
815
816/*
817 * wma_power.c functions declarations
818 */
819
820void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
821
Govind Singhd76a5b02016-03-08 15:12:14 +0530822QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800823 uint32_t vdev_id, uint32_t param,
824 uint32_t value);
825
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530826QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800827wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
828
Govind Singhd76a5b02016-03-08 15:12:14 +0530829QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830 uint8_t *peer_addr, uint8_t uapsd_value,
831 uint8_t max_sp);
832
833void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800834 struct wmi_host_wme_vparams *wmm_param,
835 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836
837void wma_set_tx_power(WMA_HANDLE handle,
838 tMaxTxPowerParams *tx_pwr_params);
839
840void wma_set_max_tx_power(WMA_HANDLE handle,
841 tMaxTxPowerParams *tx_pwr_params);
842
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800843void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
844
845void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
846
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700847void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800848
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530849QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800850
851int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
852 uint32_t len);
853
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530854QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Jeff Johnson19ce8d02019-02-08 22:56:23 -0800855 struct tx_power_limit *ptxlim);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800856
857void wma_update_noa(struct beacon_info *beacon,
858 struct p2p_sub_element_noa *noa_ie);
859
860void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
861 struct p2p_sub_element_noa *noa_ie);
862
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863void wma_process_set_mimops_req(tp_wma_handle wma_handle,
864 tSetMIMOPS *mimops);
865
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530866QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800867
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530868QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800869 tSirModemPowerStateInd *pReq);
870
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530871QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800872 int value);
873
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800874/*
875 * wma_data.c functions declarations
876 */
877
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700878void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
879 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800880
881int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
882
Jiachao Wu08719b02017-07-05 13:05:34 +0800883/**
884 * wma_check_txrx_chainmask() - check txrx chainmask
885 * @num_rf_chains: number of rf chains
886 * @cmd_value: command value
887 *
888 * Return: QDF_STATUS_SUCCESS for success or error code
889 */
890QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800891
892int wma_peer_state_change_event_handler(void *handle,
893 uint8_t *event_buff,
894 uint32_t len);
895
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530896QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800897 mcc_adaptive_scheduler);
898
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530899QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800900 (tp_wma_handle wma,
901 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
902
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530903QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800904 (tp_wma_handle wma,
905 uint32_t adapter_1_chan_number,
906 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
907
908void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
909
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530910QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800911 tSirRateUpdateInd *
912 pRateUpdateParams);
913
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530914QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800915
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530916QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800917
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530918#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
919 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
920
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800921int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
922 uint32_t len);
923#endif
924
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530925#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
926QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
927 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700928#else
929static inline QDF_STATUS
930wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
931 struct t_bad_peer_txtcl_config *config)
932{
933 return QDF_STATUS_E_FAILURE;
934}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530935#endif
936
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530937QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800938 t_thermal_mgmt *pThermalParams);
939
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530940QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800941 uint8_t thermal_level);
942
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530943QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800944 t_thermal_cmd_params thermal_info);
945
946int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
947 uint32_t len);
948
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800949int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
950 uint32_t len);
951
952int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
953 uint32_t len);
954
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800955/*
956 * wma_utils.c functions declarations
957 */
958
959#ifdef WLAN_FEATURE_STATS_EXT
960int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
961 uint32_t len);
962#endif
963
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700964enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800965int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800966
967#ifdef WLAN_FEATURE_LINK_LAYER_STATS
968void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
969
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530970QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800971 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
972
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530973QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800974 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
975
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530976QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700977 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800978
979int wma_unified_link_iface_stats_event_handler(void *handle,
980 uint8_t *cmd_param_info,
981 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800982void wma_config_stats_ext_threshold(tp_wma_handle wma,
983 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800984#endif
985
986void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
987 uint8_t link_status);
988
989int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
990 uint32_t len);
991
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530992/**
993 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
994 * @wmi_event: WMI event
995 *
996 * This function is used to send RSO command status to upper layer
997 *
998 * Return: 0 for success
999 */
1000int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
1001
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001002int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
1003 uint32_t len);
1004
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301005QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001006
1007int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
1008 uint32_t len);
1009
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301010QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001011
1012int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
1013 uint32_t len);
1014
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001015WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
1016 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001017 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001018
1019int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
1020 uint8_t vdev_id, uint32_t value);
1021
1022int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
1023 uint8_t vdev_id, uint32_t value);
1024
Naveen Rawatfa2a1002018-05-17 16:06:37 -07001025#ifdef QCA_SUPPORT_CP_STATS
1026static inline void wma_get_stats_req(WMA_HANDLE handle,
1027 struct sAniGetPEStatsReq *get_stats_param) {}
1028#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001029void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -07001030 struct sAniGetPEStatsReq *get_stats_param);
1031#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032/*
1033 * wma_features.c functions declarations
1034 */
1035
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08001036/**
1037 * wma_sar_register_event_handlers() - Register SAR event handlers
1038 * @handle: WMA Handle
1039 *
1040 * Function to be called during WMA initialization to register SAR
1041 * event handlers with WMI
1042 *
1043 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
1044 * an error enumeration
1045 */
1046QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
1047
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001048void wma_process_link_status_req(tp_wma_handle wma,
1049 tAniGetLinkStatus *pGetLinkStatus);
1050
Will Huanga9814592017-05-24 15:47:58 +08001051QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
1052 struct sir_peer_info_req *peer_info_req);
1053
1054/**
1055 * wma_get_peer_info_ext() - get peer info
1056 * @handle: wma interface
1057 * @peer_info_req: get peer info request information
1058 *
1059 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
1060 *
1061 * Return: 0 on success, otherwise error value
1062 */
1063QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
1064 struct sir_peer_info_ext_req *peer_info_req);
1065
1066/**
1067 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
1068 * @handle: WMA global handle
1069 * @cmd_param_info: Command event data
1070 * @len: Length of cmd_param_info
1071 *
1072 * This function will handle WMI_PEER_STATS_INFO_EVENTID
1073 *
1074 * Return: 0 on success, error code otherwise
1075 */
1076int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
1077 u_int32_t len);
1078
Govind Singha471e5e2015-10-12 17:11:14 +05301079int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
1080 uint32_t len);
1081
Govind Singhf25a0f12016-03-08 16:09:48 +05301082QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +05301083 uint32_t cmd, uint32_t value1, uint32_t value2);
1084
Govind Singhd76a5b02016-03-08 15:12:14 +05301085int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001086
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001087#ifdef FEATURE_WLAN_TDLS
1088int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
1089#endif
1090
1091int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
1092
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001093#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -08001094int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1095 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001096#endif
1097
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001098#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301099QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001100 struct ath_pktlog_wmi_params *params);
1101#endif
1102
1103int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1104 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +08001105
1106int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
1107
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001108int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1109
Jeff Johnson256002f2018-12-22 17:53:19 -08001110void wma_del_ts_req(tp_wma_handle wma, struct del_ts_params *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001111
Jeff Johnson54024412018-12-22 12:07:06 -08001112/**
1113 * wma_aggr_qos_req() - send aggr qos request to fw
1114 * @wma: handle to wma
1115 * @pAggrQosRspMsg - combined struct for all ADD_TS requests.
1116 *
1117 * A function to handle WMA_AGGR_QOS_REQ. This will send out
1118 * ADD_TS requestes to firmware in loop for all the ACs with
1119 * active flow.
1120 *
1121 * Return: none
1122 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001123void wma_aggr_qos_req(tp_wma_handle wma,
Jeff Johnson54024412018-12-22 12:07:06 -08001124 struct aggr_add_ts_param *pAggrQosRspMsg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001125
Jeff Johnson9851fcc2018-12-22 17:29:58 -08001126void wma_add_ts_req(tp_wma_handle wma, struct add_ts_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001127
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001128#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301129QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001130 void *pTsmStatsMsg);
Jeff Johnsonb120a822019-02-02 22:15:55 -08001131QDF_STATUS wma_plm_start(tp_wma_handle wma, const struct plm_req *plm);
1132QDF_STATUS wma_plm_stop(tp_wma_handle wma, const struct plm_req *plm);
1133void wma_config_plm(tp_wma_handle wma, struct plm_req *plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134#endif
1135
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301136QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1137 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001138QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1139
1140QDF_STATUS wma_process_get_peer_info_req
1141 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1142
1143QDF_STATUS wma_process_tx_fail_monitor_ind
1144 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1145
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301146#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001147QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1148
1149QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1150
1151QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301152#else
1153static inline
1154QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1155{
1156 return QDF_STATUS_SUCCESS;
1157}
1158
1159static inline
1160QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1161{
1162 return QDF_STATUS_SUCCESS;
1163}
1164
1165static inline
1166QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1167{
1168 return QDF_STATUS_SUCCESS;
1169}
1170#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001171
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301172QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Jeff Johnson6dcb44a2018-12-23 10:17:00 -08001173 tSirAddPeriodicTxPtrn *pattern);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001174
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301175QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001176 tSirDelPeriodicTxPtrn *
1177 pDelPeriodicTxPtrnParams);
1178
1179#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301180QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001181#endif
1182
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001183#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301184QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001185
1186int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1187 tpSirAppType1Params appType1Params);
1188
Himanshu Agarwal44195412016-03-09 13:03:54 +05301189QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001190 tpSirAppType2Params appType2Params);
1191#endif
1192
1193#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1194int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1195 uint32_t len);
1196
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301197QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001198 tSirAutoShutdownCmdParams *
1199 auto_sh_cmd);
1200#endif
1201
Manikandan Mohan976e7562016-03-15 16:33:31 -07001202#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001203int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1204QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1205QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001206QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1207#else
1208static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1209 uint32_t vdev_id)
1210{
1211 return QDF_STATUS_SUCCESS;
1212}
1213
1214static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1215 uint32_t vdev_id)
1216{
1217 return QDF_STATUS_SUCCESS;
1218}
1219
1220static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1221 uint32_t data_len)
1222{
1223 return 0;
1224}
1225
1226static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1227{
1228 return QDF_STATUS_E_INVAL;
1229}
1230#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001231QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001232
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001233#ifdef DHCP_SERVER_OFFLOAD
Jeff Johnsone77641e2019-02-15 09:00:41 -08001234QDF_STATUS wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1235 tSirDhcpSrvOffloadInfo *
1236 pDhcpSrvOffloadInfo);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001237#endif
1238
1239#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301240QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001241 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001242#endif
1243
Kabilan Kannancaa85502018-04-13 18:04:58 -07001244/**
1245 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001246 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001247 * @event: event buffer
1248 * @len: buffer length
1249 *
1250 * Return: 0 for success or error code
1251 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001252int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001253
Nirav Shaheb017be2018-02-15 11:20:58 +05301254#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301255QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001256 tSirChAvoidUpdateReq *
1257 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301258#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001259
1260#ifdef FEATURE_WLAN_TDLS
1261
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001262int wma_update_tdls_peer_state(WMA_HANDLE handle,
1263 tTdlsPeerStateParams *peerStateParams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264#endif
1265
Hong Shib90718f2017-02-20 00:57:22 +08001266void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001267void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1268
Qiwei Caie689a262018-07-26 15:50:22 +08001269#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001270int wma_rssi_breached_event_handler(void *handle,
1271 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001272#else /* FEATURE_RSSI_MONITOR */
1273static inline
1274int wma_rssi_breached_event_handler(void *handle,
1275 u_int8_t *cmd_param_info, u_int32_t len)
1276{
1277 return 0;
1278}
1279#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001280
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07001281QDF_STATUS wma_process_cfg_action_frm_tb_ppdu(tp_wma_handle wma,
1282 struct cfg_action_frm_tb_ppdu *cfg_info);
1283
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301284QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001285 struct vdev_ie_info *ie_info);
1286int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1287 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001288int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1289 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001290
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001291int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1292 uint32_t len);
1293void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1294 uint8_t type);
Manjeet Singhf82ed072016-07-08 11:40:00 +05301295
1296QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1297 struct sir_mac_pwr_dbg_cmd *
1298 sir_pwr_dbg_params);
1299
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301300/**
1301 * wma_lost_link_info_handler() - collect lost link information and inform SME
1302 * @wma: WMA handle
1303 * @vdev_id: vdev ID
1304 * @rssi: rssi at disconnection time
1305 *
1306 * Return: none
1307 */
1308void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1309 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301310int wma_unified_power_debug_stats_event_handler(void *handle,
1311 uint8_t *cmd_param_info, uint32_t len);
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05301312/**
1313 * wma_unified_beacon_debug_stats_event_handler() - collect beacon debug stats
1314 * @handle: WMA handle
1315 * @cmd_param_info: data from event
1316 * @len: length
1317 *
1318 * Return: 0 for success or error code
1319 */
1320int wma_unified_beacon_debug_stats_event_handler(void *handle,
1321 uint8_t *cmd_param_info,
1322 uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301323
1324#ifdef FEATURE_WLAN_DIAG_SUPPORT
1325/**
1326 * wma_sta_kickout_event()- send sta kickout event
1327 * @kickout_reason - reasoncode for kickout
1328 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1329 * @vdev_id: Unique id for identifying the VDEV
1330 *
1331 * This function sends sta kickout diag event
1332 *
1333 * Return: void.
1334 */
1335void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1336 uint8_t *macaddr);
1337#else
1338static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1339 uint8_t vdev_id, uint8_t *macaddr)
1340{
1341
1342};
1343#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1344
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001345/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301346 * wma_get_rcpi_req() - get rcpi request
1347 * @handle: wma handle
1348 * @rcpi_request: rcpi params
1349 *
1350 * Return: none
1351 */
1352QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1353 struct sme_rcpi_req *rcpi_request);
1354
1355/**
1356 * wma_rcpi_event_handler() - rcpi event handler
1357 * @handle: wma handle
1358 * @cmd_param_info: data from event
1359 * @len: length
1360 *
1361 * Return: 0 for success or error code
1362 */
1363int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1364 uint32_t len);
1365
1366/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001367 * wma_acquire_wakelock() - acquire the given wakelock
1368 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001369 * @msec: the wakelock duration in milliseconds
1370 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001371 * This also acquires the wma runtime pm lock.
1372 *
1373 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001374 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001375void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001376
1377/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001378 * wma_release_wakelock() - release the given wakelock
1379 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001380 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001381 * This also releases the wma runtime pm lock.
1382 *
1383 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001384 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001385void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001386
1387/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001388 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001389 * @wma: a reference to the global WMA handle
1390 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001391 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001392 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1393 * response from firmware to avoid power penalties. Alternatively, calling the
1394 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001395 *
1396 * Return: QDF_STATUS
1397 */
1398QDF_STATUS
1399wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1400
1401/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001402 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001403 * @wma: a reference to the global WMA handle
1404 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001405 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001406 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1407 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001408 *
1409 * Return: QDF_STATUS
1410 */
1411QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1412
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301413int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1414
Dustin Brownec2c92e2017-07-26 11:13:49 -07001415/**
1416 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1417 * @wma: a reference to the global WMA handle
1418 * @params: the vdev up params to send to firmware
1419 * @bssid: the BssId to send to firmware
1420 *
1421 * This also releases the vdev start wakelock.
1422 *
1423 * Return: QDF_STATUS
1424 */
1425QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1426 struct vdev_up_params *params,
1427 uint8_t bssid[IEEE80211_ADDR_LEN]);
1428
1429/**
1430 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1431 * @wma: a reference to the global WMA handle
1432 * @vdev_id: the Id of the vdev to down
1433 *
1434 * This also releases the vdev start wakelock.
1435 *
1436 * Return: QDF_STATUS
1437 */
1438QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1439
lifeng66831662017-05-19 16:01:35 +08001440/*
1441 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1442 * @handle: the wma handle
1443 * @event_buf: buffer with event
1444 * @len: buffer length
1445 *
1446 * This function receives rx aggregation failure event and then pass to upper
1447 * layer
1448 *
1449 * Return: 0 on success
1450 */
1451int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1452 u_int32_t len);
1453
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301454/**
1455 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1456 * @handle: the WMA handle
1457 * @event: buffer with the event parameters
1458 * @len: length of the buffer
1459 *
1460 * This function receives BT activity event from firmware and passes the event
1461 * information to upper layers
1462 *
1463 * Return: 0 on success
1464 */
1465int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1466 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001467
1468/**
lifengfe6c3e22018-04-03 12:10:04 +08001469 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001470 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001471 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001472 * @len: buffer length
1473 *
1474 * This function receives antenna info from firmware and passes the event
1475 * to upper layer
1476 *
1477 * Return: 0 on success
1478 */
lifengfe6c3e22018-04-03 12:10:04 +08001479int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001480 u_int32_t len);
1481
lifeng7c607dd2017-02-21 21:16:49 +08001482/**
1483 * wma_update_beacon_interval() - update beacon interval in fw
1484 * @wma: wma handle
1485 * @vdev_id: vdev id
1486 * @beaconInterval: becon interval
1487 *
1488 * Return: none
1489 */
1490void
1491wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1492 uint16_t beaconInterval);
1493
1494#define RESET_BEACON_INTERVAL_TIMEOUT 200
1495
1496struct wma_beacon_interval_reset_req {
1497 qdf_timer_t event_timeout;
1498 uint8_t vdev_id;
1499 uint16_t interval;
1500};
1501
1502/**
1503 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1504 * @wma: wma handle
1505 * @vdev_id: vdev id
1506 * @beacon_interval: beacon interval
1507 * @timeout: timeout val
1508 *
1509 * Return: status
1510 */
1511int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1512 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301513/*
1514 * wma_is_vdev_valid() - check the vdev status
1515 * @vdev_id: vdev identifier
1516 *
1517 * This function verifies the vdev validity
1518 *
1519 * Return: 'true' on valid vdev else 'false'
1520 */
1521bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001522
1523/**
1524 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1525 * @handle: the wma handle
1526 * @event: buffer with event
1527 * @len: buffer length
1528 *
1529 * This function receives obss detection info from firmware which is used to
1530 * decide obss protection.
1531 *
1532 * Return: 0 on success
1533 */
1534int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1535 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001536
1537/**
1538 * wma_vdev_bss_color_collision_info_handler - event handler to
1539 * handle obss color collision detection.
1540 * @handle: the wma handle
1541 * @event: buffer with event
1542 * @len: buffer length
1543 *
1544 * This function receives obss color collision detection info from firmware
1545 * which is used to select new bss color.
1546 *
1547 * Return: 0 on success
1548 */
1549int wma_vdev_bss_color_collision_info_handler(void *handle,
1550 uint8_t *event,
1551 uint32_t len);
1552
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001553int wma_twt_en_complete_event_handler(void *handle,
1554 uint8_t *event, uint32_t len);
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301555/**
1556 * wma_get_roam_scan_stats() - Get roam scan stats request
1557 * @handle: wma handle
1558 * @req: request details
1559 *
1560 * Return: QDF_STATUS
1561 */
1562QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
1563 struct sir_roam_scan_stats *req);
1564
1565/**
Vignesh Viswanathan36358182018-10-25 17:36:35 +05301566 * wma_remove_peer_on_add_bss_failure() - remove the CDP peers in case of
1567 * ADD BSS request failed
1568 * @add_bss_params: Pointer to the Add BSS request params
1569 *
1570 * This API deletes the CDP peer created during ADD BSS in case of ADD BSS
1571 * request sent to the FW fails.
1572 *
1573 * Return: None;
1574 */
1575void wma_remove_peer_on_add_bss_failure(tpAddBssParams add_bss_params);
1576
1577/**
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301578 * wma_roam_scan_stats_event_handler() - roam scan stats event handler
1579 * @handle: wma handle
1580 * @event: event data
1581 * @len: length of data
1582 *
1583 * Return: Success or Failure status
1584 */
1585int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event,
1586 uint32_t len);
1587
Abhishek Singhcaa61852018-09-12 15:50:04 +05301588/**
Abhishek Singhfb5b4d32018-12-06 11:53:08 +05301589 * wma_send_vdev_down() - send del bss req to firmware
Abhishek Singhcaa61852018-09-12 15:50:04 +05301590 * @wma: wma handle.
1591 * @vdev_id: vdev ID of device for which MCC has to be checked
1592 *
1593 * This function sends del bss resp to upper layer
1594 *
1595 * Return: none
1596 */
Abhishek Singhfb5b4d32018-12-06 11:53:08 +05301597void wma_send_vdev_down(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +05301598
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001599#endif