blob: 96d1cf41b7eaaaf8d2046fb91df7782f6fb30cb7 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Nachiket Kukade2c73ade2017-12-20 17:30:36 +05302 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef WMA_INTERNAL_H
20#define WMA_INTERNAL_H
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080021#include <cdp_txrx_handle.h>
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070022#if !defined(REMOVE_PKT_LOG)
23#include "pktlog_ac.h"
24#endif
25
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080026/* ################### defines ################### */
27/*
28 * TODO: Following constant should be shared by firwmare in
29 * wmi_unified.h. This will be done once wmi_unified.h is updated.
30 */
31#define WMI_PEER_STATE_AUTHORIZED 0x2
32
33#define WMA_2_4_GHZ_MAX_FREQ 3000
34#define WOW_CSA_EVENT_OFFSET 12
35
36#define WMA_DEFAULT_SCAN_REQUESTER_ID 1
37#define WMI_SCAN_FINISH_EVENTS (WMI_SCAN_EVENT_START_FAILED | \
38 WMI_SCAN_EVENT_COMPLETED | \
39 WMI_SCAN_EVENT_DEQUEUED)
40/* default value */
41#define DEFAULT_INFRA_STA_KEEP_ALIVE_PERIOD 20
mukul sharma72c8b222015-09-04 17:02:01 +053042#define DEFAULT_STA_SA_QUERY_MAX_RETRIES_COUNT (5)
43#define DEFAULT_STA_SA_QUERY_RETRY_INTERVAL (200)
44
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045/* pdev vdev and peer stats*/
46#define FW_PDEV_STATS_SET 0x1
47#define FW_VDEV_STATS_SET 0x2
48#define FW_PEER_STATS_SET 0x4
Himanshu Agarwal37e42412016-07-21 14:35:09 +053049#define FW_RSSI_PER_CHAIN_STATS_SET 0x8
50#define FW_STATS_SET 0xf
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051
52/*AR9888/AR6320 noise floor approx value
53 * similar to the mentioned the WMA
54 */
55#define WMA_TGT_NOISE_FLOOR_DBM (-96)
Naveen Rawatf440a132017-05-05 12:27:39 -070056#define WMA_TGT_MAX_SNR (WMA_TGT_NOISE_FLOOR_DBM * (-1))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057
58/*
59 * Make sure that link monitor and keep alive
60 * default values should be in sync with CFG.
61 */
62#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
63#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
64
65#define AGC_DUMP 1
66#define CHAN_DUMP 2
67#define WD_DUMP 3
68#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
69#define PCIE_DUMP 4
70#endif
71
72/* conformance test limits */
73#define FCC 0x10
74#define MKK 0x40
75#define ETSI 0x30
76
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
78
79#define WMI_MCC_MIN_CHANNEL_QUOTA 20
80#define WMI_MCC_MAX_CHANNEL_QUOTA 80
81#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
82
83/* The maximum number of patterns that can be transmitted by the firmware
84 * and maximum patterns size.
85 */
jsreekumac44b922018-06-12 20:18:39 +053086#ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
jsreekumac44b922018-06-12 20:18:39 +053088#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089
90#define WMI_MAX_HOST_CREDITS 2
91#define WMI_WOW_REQUIRED_CREDITS 1
92
Rajeev Kumar8e3e2832015-11-06 16:02:54 -080093#define WMI_MAX_MHF_ENTRIES 32
94
95
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080096#define MAX_HT_MCS_IDX 8
97#define MAX_VHT_MCS_IDX 10
98#define INVALID_MCS_IDX 255
99
100#define LINK_STATUS_LEGACY 0
101#define LINK_STATUS_VHT 0x1
102#define LINK_STATUS_MIMO 0x2
103#define LINK_SUPPORT_VHT 0x4
104#define LINK_SUPPORT_MIMO 0x8
105
106#define LINK_RATE_VHT 0x3
107
108#define MAX_ENTRY_HOLD_REQ_QUEUE 2
Krishna Kumaar Natarajana5c53bd2015-10-27 11:48:27 -0700109#define MAX_ENTRY_VDEV_RESP_QUEUE 10
110
Krishna Kumaar Natarajanb7f9a352016-03-18 11:40:07 -0700111/* Time(in ms) to detect DOS attack */
112#define WMA_MGMT_FRAME_DETECT_DOS_TIMER 1000
113
Himanshu Agarwala1539d32017-10-11 18:08:56 +0530114#define MAX_NUM_HW_MODE 0xff
115#define MAX_NUM_PHY 0xff
116
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800117/**
118 * struct index_data_rate_type - non vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800119 * @mcs_index: mcs rate index
120 * @ht20_rate: HT20 supported rate table
121 * @ht40_rate: HT40 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122 */
123struct index_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800124 uint8_t mcs_index;
125 uint16_t ht20_rate[2];
126 uint16_t ht40_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800127};
128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129/**
130 * struct index_vht_data_rate_type - vht data rate type
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800131 * @mcs_index: mcs rate index
132 * @ht20_rate: VHT20 supported rate table
133 * @ht40_rate: VHT40 supported rate table
134 * @ht80_rate: VHT80 supported rate table
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800135 */
136struct index_vht_data_rate_type {
Ryan Hsu6139d2d2015-11-04 17:29:00 -0800137 uint8_t mcs_index;
138 uint16_t ht20_rate[2];
139 uint16_t ht40_rate[2];
140 uint16_t ht80_rate[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142
Wen Gong7952fbd2018-04-18 11:27:23 +0800143struct tSirWifiScanCmdReqParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144/*
145 * wma_main.c functions declarations
146 */
147
148int
149wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
150 uint32_t param_value);
151
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530152/**
153 * wma_send_msg_by_priority() - Send wma message to PE with priority.
154 * @wma_handle: wma handle
155 * @msg_type: message type
156 * @body_ptr: message body ptr
157 * @body_val: message body value
158 * @is_high_priority: if msg is high priority
159 *
160 * Return: none
161 */
162void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type,
163 void *body_ptr, uint32_t body_val, bool is_high_priority);
164
165/**
166 * wma_send_msg() - Send wma message to PE.
167 * @wma_handle: wma handle
168 * @msg_type: message type
169 * @body_ptr: message body ptr
170 * @body_val: message body value
171 *
172 * Return: none
173 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
175 void *body_ptr, uint32_t body_val);
176
Abhishek Singh2d775fd2017-08-18 10:51:33 +0530177/**
178 * wma_send_msg_high_priority() - Send wma message to PE with high priority.
179 * @wma_handle: wma handle
180 * @msg_type: message type
181 * @body_ptr: message body ptr
182 * @body_val: message body value
183 *
184 * Return: none
185 */
186void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type,
187 void *body_ptr, uint32_t body_val);
188
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800189void wma_data_tx_ack_comp_hdlr(void *wma_context,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530190 qdf_nbuf_t netbuf, int32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530192QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800193 int value);
194
195/*
196 * wma_scan_roam.c functions declarations
197 */
198
199#ifdef WLAN_FEATURE_ROAM_OFFLOAD
200void wma_process_roam_invoke(WMA_HANDLE handle,
201 struct wma_roam_invoke_cmd *roaminvoke);
202
203void wma_process_roam_synch_fail(WMA_HANDLE handle,
204 struct roam_offload_synch_fail *synch_fail);
205
206int wma_roam_synch_event_handler(void *handle, uint8_t *event,
207 uint32_t len);
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530208
209/**
210 * wma_roam_synch_frame_event_handler() - roam synch frame event handler
211 * @handle: wma handle
212 * @event: event data
213 * @len: length of data
214 *
215 * This function is roam synch frame event handler.
216 *
217 * Return: Success or Failure status
218 */
219int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
220 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800221#endif
222
Kapil Gupta5cda2252016-12-29 18:44:26 +0530223/**
224 * wma_update_per_roam_config() -per roam config parameter updation to FW
225 * @handle: wma handle
226 * @req_buf: per roam config parameters
227 *
228 * Return: none
229 */
230void wma_update_per_roam_config(WMA_HANDLE handle,
231 struct wmi_per_roam_config_req *req_buf);
232
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530233QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 tSirUpdateChanList *chan_list);
235
236#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530237QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
Himanshu Agarwalb56ad2e2016-07-19 15:43:09 +0530238 roam_offload_param *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800239 roam_offload_params,
240 tSirRoamOffloadScanReq *roam_req);
241#endif
242
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530243QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244 wmi_start_scan_cmd_fixed_param *
245 scan_cmd_fp,
246 tSirRoamOffloadScanReq *roam_req,
247 uint32_t mode, uint32_t vdev_id);
248
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700249/**
250 * wma_roam_scan_mawc_params() - send roam scan mode request to fw
251 * @wma_handle: wma handle
252 * @roam_req: roam request param
253 *
254 * Fill the MAWC roaming parameters and send
255 * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware.
256 *
257 * Return: QDF status
258 */
259QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle,
260 tSirRoamOffloadScanReq *roam_req);
261
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530262QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263 tSirRoamOffloadScanReq *roam_req);
264
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530265QDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 uint32_t scan_period,
267 uint32_t scan_age,
268 uint32_t vdev_id);
269
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530270QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 uint32_t vdev_id,
272 int32_t rssi_change_thresh,
273 uint32_t bcn_rssi_weight,
274 uint32_t hirssi_delay_btw_scans);
275
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530276QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 uint8_t chan_count,
278 uint8_t *chan_list,
279 uint8_t list_type, uint32_t vdev_id);
280
281A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
282 eCsrEncryptionType encr);
283
284A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
285
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800286void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
287 tpAniSirGlobal pMac,
288 tSirRoamOffloadScanReq *roam_req,
289 wmi_start_scan_cmd_fixed_param *
290 scan_params);
291
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530292QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293 A_INT32 first_bcnt,
294 A_UINT32 final_bcnt, uint32_t vdev_id);
295
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530296QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297 uint32_t command, uint32_t vdev_id);
298
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530299QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800300 tpSwitchChannelParams params,
301 uint8_t vdev_id);
302
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530303QDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304 tpSwitchChannelParams params,
305 uint8_t vdev_id);
306
307void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
308 uint8_t vdev_id,
309 wmi_scan_event_fixed_param *
310 wmi_event);
311
312void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
313
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800314#ifdef WLAN_FEATURE_ROAM_OFFLOAD
315void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
316#endif
317
318#ifdef FEATURE_WLAN_EXTSCAN
319
320int wma_extscan_start_stop_event_handler(void *handle,
321 uint8_t *cmd_param_info,
322 uint32_t len);
323
324int wma_extscan_operations_event_handler(void *handle,
325 uint8_t *cmd_param_info,
326 uint32_t len);
327
328int wma_extscan_table_usage_event_handler(void *handle,
329 uint8_t *cmd_param_info,
330 uint32_t len);
331
332int wma_extscan_capabilities_event_handler(void *handle,
333 uint8_t *cmd_param_info,
334 uint32_t len);
335
336int wma_extscan_hotlist_match_event_handler(void *handle,
337 uint8_t *cmd_param_info,
338 uint32_t len);
339
340int wma_extscan_cached_results_event_handler(void *handle,
341 uint8_t *cmd_param_info,
342 uint32_t len);
343
344int wma_extscan_change_results_event_handler(void *handle,
345 uint8_t *cmd_param_info,
346 uint32_t len);
347
348int wma_passpoint_match_event_handler(void *handle,
349 uint8_t *cmd_param_info,
350 uint32_t len);
351
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#endif
353
Wen Gong7952fbd2018-04-18 11:27:23 +0800354#ifdef FEATURE_WLAN_EXTSCAN
355int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
356
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
358
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530359QDF_STATUS wma_start_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360 tSirWifiScanCmdReqParams *pstart);
361
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530362QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363 tSirExtScanStopReqParams *pstopcmd);
364
Jeff Johnson1148cb02018-07-13 23:14:32 -0700365/**
366 * wma_extscan_start_hotlist_monitor() - start hotlist monitor
367 * @wma: wma handle
368 * @params: hotlist request params
369 *
370 * This function configures hotlist monitor in fw.
371 *
372 * Return: QDF status
373 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530374QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson1148cb02018-07-13 23:14:32 -0700375 struct extscan_bssid_hotlist_set_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376
Jeff Johnson9743eb72018-07-14 10:30:04 -0700377/**
378 * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor
379 * @wma: wma handle
380 * @params: hotlist request params
381 *
382 * This function configures hotlist monitor to stop in fw.
383 *
384 * Return: QDF status
385 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530386QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
Jeff Johnson9743eb72018-07-14 10:30:04 -0700387 struct extscan_bssid_hotlist_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388
Jeff Johnsonb43ed032018-07-16 06:59:21 -0700389/**
390 * wma_extscan_start_change_monitor() - send start change monitor cmd
391 * @wma: wma handle
392 * @params: change monitor request params
393 *
394 * This function sends start change monitor request to fw.
395 *
396 * Return: QDF status
397 */
398QDF_STATUS
399wma_extscan_start_change_monitor(tp_wma_handle wma,
400 struct extscan_set_sig_changereq_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800401
Jeff Johnson0c8dbc32018-07-16 22:10:48 -0700402/**
403 * wma_extscan_stop_change_monitor() - send stop change monitor cmd
404 * @wma: wma handle
405 * @params: change monitor request params
406 *
407 * This function sends stop change monitor request to fw.
408 *
409 * Return: QDF status
410 */
411QDF_STATUS
412wma_extscan_stop_change_monitor(tp_wma_handle wma,
413 struct extscan_capabilities_reset_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800414
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530415QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800416 tSirExtScanGetCachedResultsReqParams *
417 pcached_results);
418
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530419QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800420 tSirGetExtScanCapabilitiesReqParams *
421 pgetcapab);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530422QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423 struct wifi_epno_params *req);
424
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530425QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800426 struct wifi_passpoint_req *req);
427
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530428QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800429 struct wifi_passpoint_req *req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800430#endif
431
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530432QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800433
434int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
435
436void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
437
438int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
439 uint32_t len);
440
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800441#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800442void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
443static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
444 uint8_t vdev_id)
445{
446 return wma->interfaces[vdev_id].roam_synch_in_progress;
447}
448#else
449static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
450 uint8_t vdev_id)
451{
452 return false;
453}
Varun Reddy Yeturu101f9542016-05-24 10:07:52 -0700454static inline uint32_t wma_roam_scan_get_cckm_mode(
455 struct sSirRoamOffloadScanReq *roam_req, uint32_t auth_mode)
456{
457 return WMI_AUTH_CCKM;
458}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800459#endif
460
461/*
462 * wma_dev_if.c functions declarations
463 */
464
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800465struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800466 uint8_t *vdev_id);
467
468/**
469 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
470 * @wma - wma handle
471 * @vdev_id - vdev ID
472 *
473 * Return: Returns vdev handle if given vdev id is valid.
474 * Otherwise returns NULL.
475 */
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800476static inline
477struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800478{
Naveen Rawatf2bd42d2017-06-29 14:51:43 -0700479 if (vdev_id >= wma->max_bssid)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800480 return NULL;
481
482 return wma->interfaces[vdev_id].handle;
483}
484
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
486
487#ifdef QCA_IBSS_SUPPORT
488bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
Houston Hoffman79b4af22015-10-06 12:01:08 -0700489#else
490/**
491 * wma_is_vdev_in_ibss_mode(): dummy function
492 * @wma: wma handle
493 * @vdev_id: vdev id
494 *
495 * Return false since no vdev can be in ibss mode without ibss support
496 */
497static inline
Mahesh Kumar Kalikot Veetil32e4fc72016-09-09 17:05:22 -0700498bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id)
Houston Hoffman79b4af22015-10-06 12:01:08 -0700499{
500 return false;
501}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800502#endif
503
504/**
505 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
506 * @wma - wma handle
507 * @vdev_id - vdev ID
508 *
509 * Return: Returns pointer to bssid on success,
510 * otherwise returns NULL.
511 */
512static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
513 uint8_t vdev_id)
514{
515 if (vdev_id >= wma->max_bssid)
516 return NULL;
517
518 return wma->interfaces[vdev_id].bssid;
519}
520
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800521struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522 uint8_t *vdev_id);
523
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530524QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800525 struct del_sta_self_params *pdel_sta_self_req_param,
526 uint8_t generateRsp);
527
528int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
529 uint32_t len);
530
Govind Singhd76a5b02016-03-08 15:12:14 +0530531QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800532 uint32_t param_id, uint32_t param_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -0700534 uint8_t vdev_id, void *peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800535 bool roam_synch_in_progress);
536
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800537QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
538 struct cdp_vdev *vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800539 u8 peer_addr[IEEE80211_ADDR_LEN],
540 uint32_t peer_type, uint8_t vdev_id,
541 bool roam_synch_in_progress);
542
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530543/**
544 * wma_send_del_bss_response() - send delete bss resp
545 * @wma: wma handle
546 * @req: target request
547 *
548 * Return: none
549 */
550void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req);
Abhishek Singhcaa61852018-09-12 15:50:04 +0530551
Abhishek Singh2904a6a2018-08-30 17:45:59 +0530552/**
553 * __wma_vdev_stop_resp_handler() - vdev stop response handler
554 * @handle: wma handle
555 * @cmd_param_info: event buffer
556 * @len: buffer length
557 *
558 * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code
559 */
560QDF_STATUS
561__wma_vdev_stop_resp_handler(wmi_vdev_stopped_event_fixed_param *resp_event);
562
563/**
564 * wma_vdev_stop_resp_handler() - vdev stop response handler
565 * @handle: wma handle
566 * @cmd_param_info: event buffer
567 * @len: buffer length
568 *
569 * Return: 0 for success or error code
570 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800571int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
572 u32 len);
573
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800574struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800575 struct add_sta_self_params *self_sta_req,
576 uint8_t generateRsp);
577
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700578QDF_STATUS wma_vdev_start(tp_wma_handle wma, struct wma_vdev_start_req *req,
579 bool isRestart);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800580
581void wma_vdev_resp_timer(void *data);
582
583struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
584 uint8_t vdev_id,
585 uint32_t msg_type, uint8_t type,
586 void *params, uint32_t timeout);
587
588void wma_hold_req_timer(void *data);
589struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
590 uint8_t vdev_id, uint32_t msg_type,
591 uint8_t type, void *params,
592 uint32_t timeout);
593
594void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
595 uint8_t type);
596
597void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
598
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
600
601void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
602
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800603void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
604
605int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
606
607void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
608 tpDisableIntraBssFwd pdis_intra_fwd);
609
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700610void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params);
611
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800612uint32_t wma_get_bcn_rate_code(uint16_t rate);
613
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800614/*
615 * wma_mgmt.c functions declarations
616 */
617
618int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
619
620int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
621
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800622int wma_unified_bcntx_status_event_handler(void *handle,
623 uint8_t *cmd_param_info,
624 uint32_t len);
625
mukul sharma72c8b222015-09-04 17:02:01 +0530626void wma_set_sta_sa_query_param(tp_wma_handle wma,
627 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800628
629void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
630 uint32_t method, uint32_t timeperiod,
631 uint8_t *hostv4addr, uint8_t *destv4addr,
632 uint8_t *destmac);
633
634int wma_vdev_install_key_complete_event_handler(void *handle,
635 uint8_t *event,
636 uint32_t len);
637
Govind Singhb30d4c02016-03-24 11:01:23 +0530638QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800639 tSirNwType nw_type,
640 tpAddStaParams params);
641
Himanshu Agarwal009f1572016-03-09 17:26:02 +0530642QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle,
643 uint32_t if_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800644 gtx_config_t *gtx_info);
645
646void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
647 uint8_t llbcoexist);
648
649void wma_process_update_beacon_params(tp_wma_handle wma,
650 tUpdateBeaconParams *bcn_params);
651
Harprit Chhabadabec6de42018-09-10 10:21:15 -0700652void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
653
654void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655
656void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
657
658void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
659 uint8_t vdev_id,
660 int8_t peer_num_delta);
661
662void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
663
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530664QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800665 tEdcaParams *edca_params);
666
667int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
668 uint32_t len);
669
670void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
671 tpSendProbeRespParams probe_rsp_info);
672
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530673/**
674 * wma_set_ap_vdev_up() - send vdev up req
675 * @wma: wma handle
676 * @vdev_id: vdev id
677 *
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530678 * Return: QDF_STATUS
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530679 */
Abhishek Singh3d30a3b2018-09-12 15:49:18 +0530680QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
Abhishek Singhdfa69c32018-08-30 15:39:34 +0530681
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800682void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
683
684void wma_set_keepalive_req(tp_wma_handle wma,
685 tSirKeepAliveReq *keepalive);
686
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530687void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
688 int32_t rssi);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689
690void wma_process_update_opmode(tp_wma_handle wma_handle,
691 tUpdateVHTOpMode *update_vht_opmode);
692
693void wma_process_update_rx_nss(tp_wma_handle wma_handle,
694 tUpdateRxNss *update_rx_nss);
695
696void wma_process_update_membership(tp_wma_handle wma_handle,
697 tUpdateMembership *membership);
698
699void wma_process_update_userpos(tp_wma_handle wma_handle,
700 tUpdateUserPos *userpos);
701
702void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
703 tHalHiddenSsidVdevRestart *pReq);
704
705/*
706 * wma_power.c functions declarations
707 */
708
709void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
710
Govind Singhd76a5b02016-03-08 15:12:14 +0530711QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800712 uint32_t vdev_id, uint32_t param,
713 uint32_t value);
714
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530715QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800716wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
717
Govind Singhd76a5b02016-03-08 15:12:14 +0530718QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719 uint8_t *peer_addr, uint8_t uapsd_value,
720 uint8_t max_sp);
721
722void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
Kiran Kumar Lokere27026ae2018-03-09 11:38:19 -0800723 struct wmi_host_wme_vparams *wmm_param,
724 int ac, bool mu_edca_param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800725
726void wma_set_tx_power(WMA_HANDLE handle,
727 tMaxTxPowerParams *tx_pwr_params);
728
729void wma_set_max_tx_power(WMA_HANDLE handle,
730 tMaxTxPowerParams *tx_pwr_params);
731
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
733
734void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
735
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700736void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800737
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530738QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800739
740int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
741 uint32_t len);
742
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530743QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800744 tSirTxPowerLimit *ptxlim);
745
746void wma_update_noa(struct beacon_info *beacon,
747 struct p2p_sub_element_noa *noa_ie);
748
749void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
750 struct p2p_sub_element_noa *noa_ie);
751
752int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
753 uint32_t len);
754
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800755void wma_process_set_mimops_req(tp_wma_handle wma_handle,
756 tSetMIMOPS *mimops);
757
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530758QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800759
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530760QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800761 tSirModemPowerStateInd *pReq);
762
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530763QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800764 int value);
765
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800766/*
767 * wma_data.c functions declarations
768 */
769
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700770void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
771 tpAddBssParams add_bss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800772
773int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
774
Jiachao Wu08719b02017-07-05 13:05:34 +0800775/**
776 * wma_check_txrx_chainmask() - check txrx chainmask
777 * @num_rf_chains: number of rf chains
778 * @cmd_value: command value
779 *
780 * Return: QDF_STATUS_SUCCESS for success or error code
781 */
782QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800783
784int wma_peer_state_change_event_handler(void *handle,
785 uint8_t *event_buff,
786 uint32_t len);
787
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530788QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800789 mcc_adaptive_scheduler);
790
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530791QDF_STATUS wma_set_mcc_channel_time_latency
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800792 (tp_wma_handle wma,
793 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
794
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530795QDF_STATUS wma_set_mcc_channel_time_quota
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800796 (tp_wma_handle wma,
797 uint32_t adapter_1_chan_number,
798 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
799
800void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
801
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530802QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800803 tSirRateUpdateInd *
804 pRateUpdateParams);
805
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530806QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800807
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530808QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800809
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530810#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
811 defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
812
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800813int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
814 uint32_t len);
815#endif
816
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530817#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL)
818QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
819 struct t_bad_peer_txtcl_config *config);
Mohit Khanna0fe61672016-05-19 16:53:39 -0700820#else
821static inline QDF_STATUS
822wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
823 struct t_bad_peer_txtcl_config *config)
824{
825 return QDF_STATUS_E_FAILURE;
826}
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +0530827#endif
828
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530829QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830 t_thermal_mgmt *pThermalParams);
831
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530832QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 uint8_t thermal_level);
834
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530835QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836 t_thermal_cmd_params thermal_info);
837
838int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
839 uint32_t len);
840
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800841int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
842 uint32_t len);
843
844int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
845 uint32_t len);
846
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800847/*
848 * wma_utils.c functions declarations
849 */
850
851#ifdef WLAN_FEATURE_STATS_EXT
852int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
853 uint32_t len);
854#endif
855
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700856enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800857int wma_smps_mode_to_force_mode_param(uint8_t smps_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800858
859#ifdef WLAN_FEATURE_LINK_LAYER_STATS
860void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
861
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530862QDF_STATUS wma_process_ll_stats_clear_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
864
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530865QDF_STATUS wma_process_ll_stats_set_req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800866 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
867
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530868QDF_STATUS wma_process_ll_stats_get_req
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700869 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800870
871int wma_unified_link_iface_stats_event_handler(void *handle,
872 uint8_t *cmd_param_info,
873 uint32_t len);
Zhang Qian73c348a2017-03-13 16:15:55 +0800874void wma_config_stats_ext_threshold(tp_wma_handle wma,
875 struct sir_ll_ext_stats_threshold *thresh);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800876#endif
877
878void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
879 uint8_t link_status);
880
881int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
882 uint32_t len);
883
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530884/**
885 * wma_rso_cmd_status_event_handler() - RSO Command status event handler
886 * @wmi_event: WMI event
887 *
888 * This function is used to send RSO command status to upper layer
889 *
890 * Return: 0 for success
891 */
892int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event);
893
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800894int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
895 uint32_t len);
896
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530897QDF_STATUS wma_send_link_speed(uint32_t link_speed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800898
899int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
900 uint32_t len);
901
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530902QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800903
904int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
905 uint32_t len);
906
907bool wma_is_sap_active(tp_wma_handle wma_handle);
908
909bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
910
911bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
912
913bool wma_is_sta_active(tp_wma_handle wma_handle);
914
915WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
916 uint8_t is_ht, uint8_t ch_width,
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800917 uint8_t is_vht, bool is_he);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800918
919int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
920 uint8_t vdev_id, uint32_t value);
921
922int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
923 uint8_t vdev_id, uint32_t value);
924
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700925#ifdef QCA_SUPPORT_CP_STATS
926static inline void wma_get_stats_req(WMA_HANDLE handle,
927 struct sAniGetPEStatsReq *get_stats_param) {}
928#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800929void wma_get_stats_req(WMA_HANDLE handle,
Naveen Rawatfa2a1002018-05-17 16:06:37 -0700930 struct sAniGetPEStatsReq *get_stats_param);
931#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800932/*
933 * wma_features.c functions declarations
934 */
935
Jeff Johnsonf0e54b02017-12-18 15:22:25 -0800936/**
937 * wma_sar_register_event_handlers() - Register SAR event handlers
938 * @handle: WMA Handle
939 *
940 * Function to be called during WMA initialization to register SAR
941 * event handlers with WMI
942 *
943 * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise
944 * an error enumeration
945 */
946QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle);
947
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948void wma_process_link_status_req(tp_wma_handle wma,
949 tAniGetLinkStatus *pGetLinkStatus);
950
Will Huanga9814592017-05-24 15:47:58 +0800951QDF_STATUS wma_get_peer_info(WMA_HANDLE handle,
952 struct sir_peer_info_req *peer_info_req);
953
954/**
955 * wma_get_peer_info_ext() - get peer info
956 * @handle: wma interface
957 * @peer_info_req: get peer info request information
958 *
959 * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW
960 *
961 * Return: 0 on success, otherwise error value
962 */
963QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle,
964 struct sir_peer_info_ext_req *peer_info_req);
965
966/**
967 * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID
968 * @handle: WMA global handle
969 * @cmd_param_info: Command event data
970 * @len: Length of cmd_param_info
971 *
972 * This function will handle WMI_PEER_STATS_INFO_EVENTID
973 *
974 * Return: 0 on success, error code otherwise
975 */
976int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info,
977 u_int32_t len);
978
Govind Singha471e5e2015-10-12 17:11:14 +0530979int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
980 uint32_t len);
981
Govind Singhf25a0f12016-03-08 16:09:48 +0530982QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
Govind Singha471e5e2015-10-12 17:11:14 +0530983 uint32_t cmd, uint32_t value1, uint32_t value2);
984
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800985void wma_wow_tx_complete(void *wma);
986
Govind Singhd76a5b02016-03-08 15:12:14 +0530987int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800988
989#ifdef WLAN_FEATURE_NAN
990int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
991#endif
992
993#ifdef FEATURE_WLAN_TDLS
994int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
995#endif
996
997int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
998
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800999#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajan4e9cf392015-11-20 13:35:05 -08001000int wma_oem_data_response_handler(void *handle, uint8_t *datap,
1001 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001002#endif
1003
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001004#if !defined(REMOVE_PKT_LOG)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301005QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001006 struct ath_pktlog_wmi_params *params);
1007#endif
1008
1009int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
1010 uint32_t len);
Will Huang3cd2b7c2017-11-17 13:16:56 +08001011
1012int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len);
1013
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001014int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
1015
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001016void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
1017
1018void wma_aggr_qos_req(tp_wma_handle wma,
1019 tAggrAddTsParams *pAggrQosRspMsg);
1020
1021void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
1022
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001023#ifdef FEATURE_WLAN_ESE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301024QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025 void *pTsmStatsMsg);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001026QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
1027QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
1028void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001029#endif
1030
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301031QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
1032 tSirRcvFltMcAddrList * mcbc_param);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001033QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma);
1034
1035QDF_STATUS wma_process_get_peer_info_req
1036 (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq);
1037
1038QDF_STATUS wma_process_tx_fail_monitor_ind
1039 (tp_wma_handle wma, tAniTXFailMonitorInd *pReq);
1040
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301041#ifdef FEATURE_WLAN_RMC
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001042QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma);
1043
1044QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma);
1045
1046QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301047#else
1048static inline
1049QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma)
1050{
1051 return QDF_STATUS_SUCCESS;
1052}
1053
1054static inline
1055QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma)
1056{
1057 return QDF_STATUS_SUCCESS;
1058}
1059
1060static inline
1061QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma)
1062{
1063 return QDF_STATUS_SUCCESS;
1064}
1065#endif
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001066
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301067QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001068 tSirAddPeriodicTxPtrn *
1069 pAddPeriodicTxPtrnParams);
1070
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301071QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001072 tSirDelPeriodicTxPtrn *
1073 pDelPeriodicTxPtrnParams);
1074
1075#ifdef WLAN_FEATURE_STATS_EXT
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301076QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001077#endif
1078
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301079QDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
1080 tAniIbssRouteTable * pData);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001081
1082#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Himanshu Agarwal44195412016-03-09 13:03:54 +05301083QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001084
1085int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
1086 tpSirAppType1Params appType1Params);
1087
Himanshu Agarwal44195412016-03-09 13:03:54 +05301088QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001089 tpSirAppType2Params appType2Params);
1090#endif
1091
1092#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1093int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1094 uint32_t len);
1095
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301096QDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001097 tSirAutoShutdownCmdParams *
1098 auto_sh_cmd);
1099#endif
1100
Manikandan Mohan976e7562016-03-15 16:33:31 -07001101#ifdef WLAN_FEATURE_TSF
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001102int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len);
1103QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id);
1104QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001105QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin);
1106#else
1107static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle,
1108 uint32_t vdev_id)
1109{
1110 return QDF_STATUS_SUCCESS;
1111}
1112
1113static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle,
1114 uint32_t vdev_id)
1115{
1116 return QDF_STATUS_SUCCESS;
1117}
1118
1119static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data,
1120 uint32_t data_len)
1121{
1122 return 0;
1123}
1124
1125static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
1126{
1127 return QDF_STATUS_E_INVAL;
1128}
1129#endif
Manikandan Mohan80dea792016-04-28 16:36:48 -07001130QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa);
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001131
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001132#ifdef WLAN_FEATURE_NAN
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301133QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134#endif
1135
1136#ifdef DHCP_SERVER_OFFLOAD
1137int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1138 tSirDhcpSrvOffloadInfo *
1139 pDhcpSrvOffloadInfo);
1140#endif
1141
1142#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301143QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
Jeff Johnson5a6b6602017-10-04 14:44:30 -07001144 struct flashing_req_params *flashing);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001145#endif
1146
Kabilan Kannancaa85502018-04-13 18:04:58 -07001147/**
1148 * wma_sar_rsp_evt_handler() - process sar response event from FW.
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001149 * @handle: ol scn handle
Kabilan Kannancaa85502018-04-13 18:04:58 -07001150 * @event: event buffer
1151 * @len: buffer length
1152 *
1153 * Return: 0 for success or error code
1154 */
Kabilan Kannanebe01e72018-06-13 01:13:46 -07001155int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len);
Kabilan Kannancaa85502018-04-13 18:04:58 -07001156
Nirav Shaheb017be2018-02-15 11:20:58 +05301157#ifdef FEATURE_WLAN_CH_AVOID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301158QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001159 tSirChAvoidUpdateReq *
1160 ch_avoid_update_req);
Nirav Shaheb017be2018-02-15 11:20:58 +05301161#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001162
1163#ifdef FEATURE_WLAN_TDLS
1164
Himanshu Agarwal44195412016-03-09 13:03:54 +05301165QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001166int wma_update_tdls_peer_state(WMA_HANDLE handle,
1167 tTdlsPeerStateParams *peerStateParams);
1168/**
1169 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1170 * @handle: wma handle
1171 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1172 *
1173 * This function sets tdls off channel mode
1174 *
1175 * Return: 0 on success; negative errno otherwise
1176 */
Himanshu Agarwal44195412016-03-09 13:03:54 +05301177QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178 tdls_chan_switch_params *chan_switch_params);
1179#endif
1180
Hong Shib90718f2017-02-20 00:57:22 +08001181void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001182void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1183
Qiwei Caie689a262018-07-26 15:50:22 +08001184#ifdef FEATURE_RSSI_MONITOR
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001185int wma_rssi_breached_event_handler(void *handle,
1186 u_int8_t *cmd_param_info, u_int32_t len);
Qiwei Caie689a262018-07-26 15:50:22 +08001187#else /* FEATURE_RSSI_MONITOR */
1188static inline
1189int wma_rssi_breached_event_handler(void *handle,
1190 u_int8_t *cmd_param_info, u_int32_t len)
1191{
1192 return 0;
1193}
1194#endif /* FEATURE_RSSI_MONITOR */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001195
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301196QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001197 struct vdev_ie_info *ie_info);
1198int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1199 uint32_t len);
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001200int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info,
1201 uint32_t len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001202
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001203int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
1204 uint32_t len);
1205void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
1206 uint8_t type);
Rachit Kankane026e77a2018-07-31 16:21:09 +05301207#ifdef FEATURE_P2P_LISTEN_OFFLOAD
Peng Xu8fdaa492016-06-22 10:20:47 -07001208int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
1209 uint32_t len);
Rachit Kankane026e77a2018-07-31 16:21:09 +05301210#endif
Manjeet Singhf82ed072016-07-08 11:40:00 +05301211
1212QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
1213 struct sir_mac_pwr_dbg_cmd *
1214 sir_pwr_dbg_params);
1215
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301216/**
1217 * wma_lost_link_info_handler() - collect lost link information and inform SME
1218 * @wma: WMA handle
1219 * @vdev_id: vdev ID
1220 * @rssi: rssi at disconnection time
1221 *
1222 * Return: none
1223 */
1224void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
1225 int32_t rssi);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05301226int wma_unified_power_debug_stats_event_handler(void *handle,
1227 uint8_t *cmd_param_info, uint32_t len);
Sen, Devendra154b3c42017-02-13 20:44:15 +05301228
1229#ifdef FEATURE_WLAN_DIAG_SUPPORT
1230/**
1231 * wma_sta_kickout_event()- send sta kickout event
1232 * @kickout_reason - reasoncode for kickout
1233 * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
1234 * @vdev_id: Unique id for identifying the VDEV
1235 *
1236 * This function sends sta kickout diag event
1237 *
1238 * Return: void.
1239 */
1240void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
1241 uint8_t *macaddr);
1242#else
1243static inline void wma_sta_kickout_event(uint32_t kickout_reason,
1244 uint8_t vdev_id, uint8_t *macaddr)
1245{
1246
1247};
1248#endif /* FEATURE_WLAN_DIAG_SUPPORT */
1249
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001250/**
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301251 * wma_get_rcpi_req() - get rcpi request
1252 * @handle: wma handle
1253 * @rcpi_request: rcpi params
1254 *
1255 * Return: none
1256 */
1257QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle,
1258 struct sme_rcpi_req *rcpi_request);
1259
1260/**
1261 * wma_rcpi_event_handler() - rcpi event handler
1262 * @handle: wma handle
1263 * @cmd_param_info: data from event
1264 * @len: length
1265 *
1266 * Return: 0 for success or error code
1267 */
1268int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
1269 uint32_t len);
1270
1271/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001272 * wma_acquire_wakelock() - acquire the given wakelock
1273 * @wl: the wakelock to acquire
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001274 * @msec: the wakelock duration in milliseconds
1275 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001276 * This also acquires the wma runtime pm lock.
1277 *
1278 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001279 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001280void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001281
1282/**
Dustin Brownec2c92e2017-07-26 11:13:49 -07001283 * wma_release_wakelock() - release the given wakelock
1284 * @wl: the wakelock to release
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001285 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001286 * This also releases the wma runtime pm lock.
1287 *
1288 * Return: None
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001289 */
Dustin Brownec2c92e2017-07-26 11:13:49 -07001290void wma_release_wakelock(qdf_wake_lock_t *wl);
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001291
1292/**
Dustin Brownd5f12942017-03-10 11:06:25 -08001293 * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001294 * @wma: a reference to the global WMA handle
1295 * @params: the vdev start params to send to firmware
Dustin Brownd5f12942017-03-10 11:06:25 -08001296 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001297 * Consumers should call wma_release_wakelock() upon receipt of the vdev start
1298 * response from firmware to avoid power penalties. Alternatively, calling the
1299 * matching vdev_up or vdev_down APIs will also release this lock.
Dustin Brownd5f12942017-03-10 11:06:25 -08001300 *
1301 * Return: QDF_STATUS
1302 */
1303QDF_STATUS
1304wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
1305
1306/**
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001307 * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
Dustin Brownec2c92e2017-07-26 11:13:49 -07001308 * @wma: a reference to the global WMA handle
1309 * @vdev_id: the Id of the vdev to stop
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001310 *
Dustin Brownec2c92e2017-07-26 11:13:49 -07001311 * Consumers should call wma_release_wakelock() upon receipt of the vdev stop
1312 * response from firmware to avoid power penalties.
Dustin Brownbf6d16b2017-03-03 11:41:05 -08001313 *
1314 * Return: QDF_STATUS
1315 */
1316QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1317
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05301318int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len);
1319
Dustin Brownec2c92e2017-07-26 11:13:49 -07001320/**
1321 * wma_send_vdev_up_to_fw() - send the vdev up command to firmware
1322 * @wma: a reference to the global WMA handle
1323 * @params: the vdev up params to send to firmware
1324 * @bssid: the BssId to send to firmware
1325 *
1326 * This also releases the vdev start wakelock.
1327 *
1328 * Return: QDF_STATUS
1329 */
1330QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
1331 struct vdev_up_params *params,
1332 uint8_t bssid[IEEE80211_ADDR_LEN]);
1333
1334/**
1335 * wma_send_vdev_down_to_fw() - send the vdev down command to firmware
1336 * @wma: a reference to the global WMA handle
1337 * @vdev_id: the Id of the vdev to down
1338 *
1339 * This also releases the vdev start wakelock.
1340 *
1341 * Return: QDF_STATUS
1342 */
1343QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id);
1344
lifeng66831662017-05-19 16:01:35 +08001345/*
1346 * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure
1347 * @handle: the wma handle
1348 * @event_buf: buffer with event
1349 * @len: buffer length
1350 *
1351 * This function receives rx aggregation failure event and then pass to upper
1352 * layer
1353 *
1354 * Return: 0 on success
1355 */
1356int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf,
1357 u_int32_t len);
1358
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05301359/**
1360 * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity
1361 * @handle: the WMA handle
1362 * @event: buffer with the event parameters
1363 * @len: length of the buffer
1364 *
1365 * This function receives BT activity event from firmware and passes the event
1366 * information to upper layers
1367 *
1368 * Return: 0 on success
1369 */
1370int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event,
1371 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08001372
1373/**
lifengfe6c3e22018-04-03 12:10:04 +08001374 * wma_pdev_div_info_evt_handler - event handler to handle antenna info
lifengd217d192017-05-09 19:44:16 +08001375 * @handle: the wma handle
lifengfe6c3e22018-04-03 12:10:04 +08001376 * @event_buf: buffer with event
lifengd217d192017-05-09 19:44:16 +08001377 * @len: buffer length
1378 *
1379 * This function receives antenna info from firmware and passes the event
1380 * to upper layer
1381 *
1382 * Return: 0 on success
1383 */
lifengfe6c3e22018-04-03 12:10:04 +08001384int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
lifengd217d192017-05-09 19:44:16 +08001385 u_int32_t len);
1386
lifeng7c607dd2017-02-21 21:16:49 +08001387/**
1388 * wma_update_beacon_interval() - update beacon interval in fw
1389 * @wma: wma handle
1390 * @vdev_id: vdev id
1391 * @beaconInterval: becon interval
1392 *
1393 * Return: none
1394 */
1395void
1396wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id,
1397 uint16_t beaconInterval);
1398
1399#define RESET_BEACON_INTERVAL_TIMEOUT 200
1400
1401struct wma_beacon_interval_reset_req {
1402 qdf_timer_t event_timeout;
1403 uint8_t vdev_id;
1404 uint16_t interval;
1405};
1406
1407/**
1408 * wma_fill_beacon_interval_reset_req() - req to reset beacon interval
1409 * @wma: wma handle
1410 * @vdev_id: vdev id
1411 * @beacon_interval: beacon interval
1412 * @timeout: timeout val
1413 *
1414 * Return: status
1415 */
1416int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
1417 uint16_t beacon_interval, uint32_t timeout);
Yeshwanth Sriram Guntukad5aae7f2017-11-27 14:33:51 +05301418/*
1419 * wma_is_vdev_valid() - check the vdev status
1420 * @vdev_id: vdev identifier
1421 *
1422 * This function verifies the vdev validity
1423 *
1424 * Return: 'true' on valid vdev else 'false'
1425 */
1426bool wma_is_vdev_valid(uint32_t vdev_id);
Arif Hussainee10f902017-12-27 16:30:17 -08001427
1428/**
1429 * wma_vdev_obss_detection_info_handler - event handler to handle obss detection
1430 * @handle: the wma handle
1431 * @event: buffer with event
1432 * @len: buffer length
1433 *
1434 * This function receives obss detection info from firmware which is used to
1435 * decide obss protection.
1436 *
1437 * Return: 0 on success
1438 */
1439int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event,
1440 uint32_t len);
Arif Hussain05fb4872018-01-03 16:02:55 -08001441
1442/**
1443 * wma_vdev_bss_color_collision_info_handler - event handler to
1444 * handle obss color collision detection.
1445 * @handle: the wma handle
1446 * @event: buffer with event
1447 * @len: buffer length
1448 *
1449 * This function receives obss color collision detection info from firmware
1450 * which is used to select new bss color.
1451 *
1452 * Return: 0 on success
1453 */
1454int wma_vdev_bss_color_collision_info_handler(void *handle,
1455 uint8_t *event,
1456 uint32_t len);
1457
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07001458int wma_twt_en_complete_event_handler(void *handle,
1459 uint8_t *event, uint32_t len);
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05301460/**
1461 * wma_get_roam_scan_stats() - Get roam scan stats request
1462 * @handle: wma handle
1463 * @req: request details
1464 *
1465 * Return: QDF_STATUS
1466 */
1467QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
1468 struct sir_roam_scan_stats *req);
1469
1470/**
1471 * wma_roam_scan_stats_event_handler() - roam scan stats event handler
1472 * @handle: wma handle
1473 * @event: event data
1474 * @len: length of data
1475 *
1476 * Return: Success or Failure status
1477 */
1478int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event,
1479 uint32_t len);
1480
Abhishek Singhcaa61852018-09-12 15:50:04 +05301481/**
1482 * wma_send_del_bss_response() - send del bss resp to upper layer
1483 * @wma: wma handle.
1484 * @vdev_id: vdev ID of device for which MCC has to be checked
1485 *
1486 * This function sends del bss resp to upper layer
1487 *
1488 * Return: none
1489 */
1490void wma_send_vdev_down_bss(tp_wma_handle wma, struct wma_target_req *req);
1491
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001492#endif