blob: 4b3086bbd9132cf631b5d9bde557102d95c961f5 [file] [log] [blame]
Krunal Soni4274f362016-12-14 19:55:25 -08001/*
Amar Singhalef59eee2018-01-02 12:46:35 -08002 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WMA_H
29#define WMA_H
30
31#include "a_types.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053032#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033#include "osapi_linux.h"
34#include "htc_packet.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053035#include "i_qdf_event.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036#include "wmi_services.h"
37#include "wmi_unified.h"
38#include "wmi_version.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053039#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040#include "cfg_api.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053041#include "qdf_status.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042#include "cds_sched.h"
Varun Reddy Yeturuba1942a2017-06-20 15:32:19 -070043#include "cds_config.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080044#include "sir_mac_prot_def.h"
45#include "wma_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080046#include <linux/workqueue.h>
47#include "utils_api.h"
48#include "lim_types.h"
49#include "wmi_unified_api.h"
Dhanashri Atre12a08392016-02-17 13:10:34 -080050#include "cdp_txrx_cmn.h"
Govind Singh8c46db92016-05-10 14:17:16 +053051#include "dbglog.h"
Leo Chang96464902016-10-28 11:10:54 -070052#include "cds_ieee80211_common.h"
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +053053#include "wlan_objmgr_psoc_obj.h"
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080054#include <cdp_txrx_handle.h>
Tushnim Bhattacharyya51258a72017-03-13 12:55:02 -070055#include <wlan_policy_mgr_api.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080056
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057/* Platform specific configuration for max. no. of fragments */
58#define QCA_OL_11AC_TX_MAX_FRAGS 2
59
60/* Private */
61
Rajeev Kumardaf1c612016-04-05 02:56:41 -070062#define WMA_READY_EVENTID_TIMEOUT 6000
63#define WMA_SERVICE_READY_EXT_TIMEOUT 6000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080064#define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
Dustin Brownd0a76562017-10-13 14:48:37 -070065#define WMA_WAKE_LOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
Yuanyuan Liuc7432032016-11-09 11:34:45 -080066#define WMA_RESUME_TIMEOUT 25000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080067#define MAX_MEM_CHUNKS 32
Sandeep Puligilla4a58f7f2017-05-16 16:36:56 -070068#define NAN_CLUSTER_ID_BYTES 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080069
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080070#define WMA_CRASH_INJECT_TIMEOUT 5000
71
Govind Singhefc5ccd2016-04-25 11:11:55 +053072/* MAC ID to PDEV ID mapping is as given below
73 * MAC_ID PDEV_ID
74 * 0 1
75 * 1 2
76 * SOC Level WMI_PDEV_ID_SOC
77 */
78#define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
79#define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
80
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081/* In prima 12 HW stations are supported including BCAST STA(staId 0)
82 * and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
83 * SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
84 */
85
86#ifdef WLAN_SOFTAP_VSTA_FEATURE
87#define WMA_MAX_SUPPORTED_STAS 38
88#else
89#define WMA_MAX_SUPPORTED_STAS 12
90#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080091#define WMA_MAX_SUPPORTED_BSS SIR_MAX_SUPPORTED_BSS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092
Vignesh Viswanathan56f26252017-08-31 15:26:01 +053093#define WMA_MAX_MGMT_MPDU_LEN 2000
94
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080095#define FRAGMENT_SIZE 3072
96
Kapil Gupta10800b92017-05-31 19:14:47 +053097#define MAX_PRINT_FAILURE_CNT 50
98
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099#define WMA_INVALID_VDEV_ID 0xFF
100#define MAX_MEM_CHUNKS 32
101#define WMA_MAX_VDEV_SIZE 20
102#define WMA_VDEV_TBL_ENTRY_ADD 1
103#define WMA_VDEV_TBL_ENTRY_DEL 0
104
105/* 11A/G channel boundary */
106#define WMA_11A_CHANNEL_BEGIN 34
107#define WMA_11A_CHANNEL_END 165
108#define WMA_11G_CHANNEL_BEGIN 1
109#define WMA_11G_CHANNEL_END 14
110
111#define WMA_11P_CHANNEL_BEGIN (170)
112#define WMA_11P_CHANNEL_END (184)
113
114#define WMA_LOGD(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530115 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800116#define WMA_LOGI(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530117 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800118#define WMA_LOGW(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530119 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_WARN, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120#define WMA_LOGE(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530121 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122#define WMA_LOGP(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530123 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800124
125#define WMA_DEBUG_ALWAYS
126
127#ifdef WMA_DEBUG_ALWAYS
128#define WMA_LOGA(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530129 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800130#else
131#define WMA_LOGA(args ...)
132#endif
133
134#define ALIGNED_WORD_SIZE 4
135#define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
Govind Singhd76a5b02016-03-08 15:12:14 +0530136#define WMA_WILDCARD_PDEV_ID 0x0
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800137
138/* Prefix used by scan req ids generated on the host */
139#define WMA_HOST_SCAN_REQID_PREFIX 0xA000
140/* Prefix used by roam scan req ids generated on the host */
141#define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
142/* Prefix used by scan requestor id on host */
143#define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
144
145#define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
146
147/* Max offchannel duration */
148#define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
149#define WMA_SCAN_NPROBES_DEFAULT (2)
150#define WMA_SCAN_IDLE_TIME_DEFAULT (25)
151#define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
152#define WMA_CTS_DURATION_MS_MAX (32)
153#define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
154#define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
155#define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
156#define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
157#define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
158
159#define WMA_SEC_TO_USEC (1000000)
160
161#define BEACON_TX_BUFFER_SIZE (512)
162
163/* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
164#define WMA_ETHER_TYPE_OFFSET (6 + 6)
165/* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
166#define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
167/* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
168#define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530169/* WMA_IPV4_PROTOCOL = sa(6) + da(6) + eth_type(2) + 9 */
170#define WMA_IPV4_PROTOCOL (6 + 6 + 2 + 9)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800171#define WMA_ICMP_V6_HEADER_TYPE (0x3A)
172#define WMA_ICMP_V6_RA_TYPE (0x86)
173#define WMA_ICMP_V6_NS_TYPE (0x87)
174#define WMA_ICMP_V6_NA_TYPE (0x88)
175#define WMA_BCAST_MAC_ADDR (0xFF)
176#define WMA_MCAST_IPV4_MAC_ADDR (0x01)
177#define WMA_MCAST_IPV6_MAC_ADDR (0x33)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530178#define WMA_ICMP_PROTOCOL (0x01)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800179
Himanshu Agarwal82de9042016-07-20 18:11:03 +0530180#define WMA_IS_EAPOL_GET_MIN_LEN 14
181#define WMA_EAPOL_SUBTYPE_GET_MIN_LEN 21
182#define WMA_EAPOL_INFO_GET_MIN_LEN 23
183#define WMA_IS_DHCP_GET_MIN_LEN 38
184#define WMA_DHCP_SUBTYPE_GET_MIN_LEN 0x11D
185#define WMA_DHCP_INFO_GET_MIN_LEN 50
186#define WMA_IS_ARP_GET_MIN_LEN 14
187#define WMA_ARP_SUBTYPE_GET_MIN_LEN 22
188#define WMA_IPV4_PROTO_GET_MIN_LEN 24
189#define WMA_IPV4_PKT_INFO_GET_MIN_LEN 42
190#define WMA_ICMP_SUBTYPE_GET_MIN_LEN 35
191#define WMA_IPV6_PROTO_GET_MIN_LEN 21
192#define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62
193#define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800194
195/* Beacon tx rate */
196#define WMA_BEACON_TX_RATE_1_M 10
197#define WMA_BEACON_TX_RATE_2_M 20
198#define WMA_BEACON_TX_RATE_5_5_M 55
199#define WMA_BEACON_TX_RATE_11_M 110
200#define WMA_BEACON_TX_RATE_6_M 60
201#define WMA_BEACON_TX_RATE_9_M 90
202#define WMA_BEACON_TX_RATE_12_M 120
203#define WMA_BEACON_TX_RATE_18_M 180
204#define WMA_BEACON_TX_RATE_24_M 240
205#define WMA_BEACON_TX_RATE_36_M 360
206#define WMA_BEACON_TX_RATE_48_M 480
207#define WMA_BEACON_TX_RATE_54_M 540
208
Himanshu Agarwaldd356df2016-07-20 19:04:39 +0530209/**
210 * ds_mode: distribution system mode
211 * @IEEE80211_NO_DS: NO DS at either side
212 * @IEEE80211_TO_DS: DS at receiver side
213 * @IEEE80211_FROM_DS: DS at sender side
214 * @IEEE80211_DS_TO_DS: DS at both sender and revceiver side
215 */
216enum ds_mode {
217 IEEE80211_NO_DS,
218 IEEE80211_TO_DS,
219 IEEE80211_FROM_DS,
220 IEEE80211_DS_TO_DS
221};
222
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800223/* Roaming default values
224 * All time and period values are in milliseconds.
225 * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
226 */
227
228#define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
229#define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
230#define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
231#define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
232#define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
233#define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
234#define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
235#define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
236#define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
237#define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
238#define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700239#define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT \
240 (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800241#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
242#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
243#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
244#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
245
246#define WMA_INVALID_KEY_IDX 0xff
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800247
248#define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
249#define WMA_MIN_RF_CHAINS (1)
Abhishek Singh9100cc82017-04-17 11:03:55 +0530250#define WMA_MAX_NSS (2)
251
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800252
253#ifdef FEATURE_WLAN_EXTSCAN
254#define WMA_MAX_EXTSCAN_MSG_SIZE 1536
255#define WMA_EXTSCAN_REST_TIME 100
256#define WMA_EXTSCAN_MAX_SCAN_TIME 50000
257#define WMA_EXTSCAN_BURST_DURATION 150
258#endif
259
gaoleze5108942017-03-31 16:56:42 +0800260#define WMA_CHAN_START_RESP 0
261#define WMA_CHAN_END_RESP 1
262
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263#define WMA_BCN_BUF_MAX_SIZE 2500
264#define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
265#define WMA_MAX_NOA_DESCRIPTORS 4
266
267#define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
268
269#define WMA_WOW_PTRN_MASK_VALID 0xFF
270#define WMA_NUM_BITS_IN_BYTE 8
271
272#define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
Arun Khandavallid454d422016-08-17 12:47:05 +0530273#define WMA_STA_WOW_DEFAULT_PTRN_MAX 5
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800274
275#define WMA_BSS_STATUS_STARTED 0x1
276#define WMA_BSS_STATUS_STOPPED 0x2
277
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800278#define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
279#define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
280#define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
281
282#define WMA_PEER_ASSOC_CNF_START 0x01
Sandeep Puligillaafa52892016-10-26 19:03:16 -0700283#define WMA_PEER_ASSOC_TIMEOUT (6000) /* 6 seconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800284
Sandeep Puligilla19ddda22016-01-05 12:18:02 -0800285#define WMA_DELETE_STA_RSP_START 0x02
286#define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
287
288#define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
Sandeep Puligillabbee8172017-04-07 19:26:33 -0700289#define WMA_SET_LINK_PEER_RSP 0x04
Abhishek Singhe8be9a62017-05-30 12:13:29 +0530290#define WMA_DELETE_PEER_RSP 0x05
Tushnim Bhattacharyya86294892017-10-25 16:29:11 -0700291
292#define WMA_PDEV_SET_HW_MODE_RESP 0x06
293
Dustin Brownd0a76562017-10-13 14:48:37 -0700294#define WMA_VDEV_START_REQUEST_TIMEOUT 6000 /* 6s */
295#define WMA_VDEV_STOP_REQUEST_TIMEOUT 6000 /* 6s */
296#define WMA_VDEV_HW_MODE_REQUEST_TIMEOUT 5000 /* 5s */
297#define WMA_VDEV_PLCY_MGR_CMD_TIMEOUT 3000 /* 3s */
298#define WMA_VDEV_SET_KEY_WAKELOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800299
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +0530300#define WMA_TGT_INVALID_SNR (0)
301
Naveen Rawatf440a132017-05-05 12:27:39 -0700302#define WMA_TGT_IS_VALID_SNR(x) ((x) >= 0 && (x) < WMA_TGT_MAX_SNR)
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +0530303#define WMA_TGT_IS_INVALID_SNR(x) (!WMA_TGT_IS_VALID_SNR(x))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304
305#define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
306#define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
307#define WMA_MAX_NUM_ARGS 8
308
309#define WMA_SMPS_MASK_LOWER_16BITS 0xFF
310#define WMA_SMPS_MASK_UPPER_3BITS 0x7
311#define WMA_SMPS_PARAM_VALUE_S 29
312
313#define WMA_MAX_SCAN_ID 0x00FF
314
315/*
316 * Setting the Tx Comp Timeout to 1 secs.
317 * TODO: Need to Revist the Timing
318 */
319#define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
320#define WMA_TX_FRAME_BUFFER_NO_FREE 0
321#define WMA_TX_FRAME_BUFFER_FREE 1
322
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800323/* Default InActivity Time is 200 ms */
324#define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
325
Mukul Sharmaed92f2f2017-04-20 00:06:28 +0530326/* Default WOW InActivity Time is 50 ms */
327#define WOW_POWERSAVE_DEFAULT_INACTIVITY_TIME 50
328
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329/* Default Listen Interval */
330#define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
331
332/*
333 * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
334 * instead of assigning it to the last valid wmi
335 * cmd+1 to avoid updating this when a command is
336 * added/deleted.
337 */
338#define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
339
340#define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
341#define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
342#define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
343
344/* Default rssi threshold defined in CFG80211 */
345#define WMA_RSSI_THOLD_DEFAULT -300
346
Dustin Brownd0a76562017-10-13 14:48:37 -0700347#define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
348#define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
349#define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
350#define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
yeshwanth sriram guntuka37c09822017-01-24 18:30:15 +0530351#define WMA_ROAM_HO_WAKE_LOCK_DURATION (500) /* in msec */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Dustin Brownd0a76562017-10-13 14:48:37 -0700353#define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800354#endif
Dustin Brownd0a76562017-10-13 14:48:37 -0700355#define WMA_BMISS_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
356#define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_MAX
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357
358#define WMA_TXMIC_LEN 8
359#define WMA_RXMIC_LEN 8
360
361/*
362 * Length = (2 octets for Index and CTWin/Opp PS) and
363 * (13 octets for each NOA Descriptors)
364 */
365
366#define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
367#define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
368
369#define WMA_P2P_IE_ID 0xdd
370#define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
371#define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
372#define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
373
374/* P2P Sub element defintions (according to table 5 of Wifi's P2P spec) */
375#define WMA_P2P_SUB_ELEMENT_STATUS 0
376#define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
377#define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
378#define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
379#define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
380#define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
381#define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
382#define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
383#define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
384#define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
385#define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
386#define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
387#define WMA_P2P_SUB_ELEMENT_NOA 12
388#define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
389#define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
390#define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
391#define WMA_P2P_SUB_ELEMENT_INTERFACE 16
392#define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
393#define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
394#define WMA_P2P_SUB_ELEMENT_VENDOR 221
395
396/* Macros for handling unaligned memory accesses */
397#define P2PIE_PUT_LE16(a, val) \
398 do { \
399 (a)[1] = ((u16) (val)) >> 8; \
400 (a)[0] = ((u16) (val)) & 0xff; \
401 } while (0)
402
403#define P2PIE_PUT_LE32(a, val) \
404 do { \
405 (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
406 (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
407 (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
408 (a)[0] = (u8) (((u32) (val)) & 0xff); \
409 } while (0)
410
411
412#define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
413
414#define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
415#define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
416#define WMA_DEFAULT_SIFS_BURST_DURATION 8160
417
418#define WMA_VHT_PPS_PAID_MATCH 1
419#define WMA_VHT_PPS_GID_MATCH 2
420#define WMA_VHT_PPS_DELIM_CRC_FAIL 3
421
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800422#define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +0530423#define TWO_THIRD (2/3)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424
425/**
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530426 * WMA hardware mode list bit-mask definitions.
427 * Bits 4:0, 31:29 are unused.
428 *
429 * The below definitions are added corresponding to WMI DBS HW mode
430 * list to make it independent of firmware changes for WMI definitions.
431 * Currently these definitions have dependency with BIT positions of
432 * the existing WMI macros. Thus, if the BIT positions are changed for
433 * WMI macros, then these macros' BIT definitions are also need to be
434 * changed.
435 */
436#define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
437#define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
438#define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
439#define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
440#define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
441#define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
442#define WMA_HW_MODE_DBS_MODE_BITPOS (7)
443#define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
444#define WMA_HW_MODE_SBS_MODE_BITPOS (5)
445
446#define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \
447 (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
448#define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \
449 (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
450#define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \
451 (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
452#define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \
453 (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
454#define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \
455 (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
456#define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \
457 (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
458#define WMA_HW_MODE_DBS_MODE_MASK \
459 (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS)
460#define WMA_HW_MODE_AGILE_DFS_MODE_MASK \
461 (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
462#define WMA_HW_MODE_SBS_MODE_MASK \
463 (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS)
464
465#define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
466 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value)
467#define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
468 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value)
469#define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
470 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value)
471#define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
472 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value)
473#define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
474 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value)
475#define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
476 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value)
477#define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \
478 WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value)
479#define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
480 WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value)
481#define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \
482 WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value)
483
484#define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
485 ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \
486 WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
487#define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
488 ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \
489 WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
490#define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
491 ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \
492 WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
493#define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
494 ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \
495 WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
496#define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
497 ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \
498 WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
499#define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
500 ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \
501 WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
502#define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \
503 ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \
504 WMA_HW_MODE_DBS_MODE_BITPOS)
505#define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \
506 ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \
507 WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
508#define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \
509 ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \
510 WMA_HW_MODE_SBS_MODE_BITPOS)
511
512
Nitesh Shah0f3fce52016-10-13 22:01:41 +0530513#define WMA_SCAN_END_EVENT (WMI_SCAN_EVENT_COMPLETED | \
514 WMI_SCAN_EVENT_DEQUEUED | \
515 WMI_SCAN_EVENT_START_FAILED)
Sridhar Selvaraj87309212017-06-28 17:41:50 +0530516/*
517 * PROBE_REQ_TX_DELAY
518 * param to specify probe request Tx delay for scans triggered on this VDEV
519 */
520#define PROBE_REQ_TX_DELAY 10
521
522/* PROBE_REQ_TX_TIME_GAP
523 * param to specify the time gap between each set of probe request transmission.
524 * The number of probe requests in each set depends on the ssid_list and,
525 * bssid_list in the scan request. This parameter will get applied only,
526 * for the scans triggered on this VDEV.
527 */
528#define PROBE_REQ_TX_TIME_GAP 20
Nitesh Shah0f3fce52016-10-13 22:01:41 +0530529
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530530/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800531 * struct probeTime_dwellTime - probe time, dwell time map
532 * @dwell_time: dwell time
533 * @probe_time: repeat probe time
534 */
535typedef struct probeTime_dwellTime {
536 uint8_t dwell_time;
537 uint8_t probe_time;
538} t_probeTime_dwellTime;
539
540static const t_probeTime_dwellTime
541 probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
Liangwei Dong271f92f2016-09-28 06:05:08 -0400542 {28, 11}, /* 0 SSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800543 {28, 20}, /* 1 SSID */
544 {28, 20}, /* 2 SSID */
545 {28, 20}, /* 3 SSID */
546 {28, 20}, /* 4 SSID */
547 {28, 20}, /* 5 SSID */
548 {28, 20}, /* 6 SSID */
549 {28, 11}, /* 7 SSID */
550 {28, 11}, /* 8 SSID */
551 {28, 11}, /* 9 SSID */
552 {28, 8} /* 10 SSID */
553};
554
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800555typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
556
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +0530557typedef void (*tp_wma_packetdump_cb)(qdf_nbuf_t netbuf,
558 uint8_t status, uint8_t vdev_id, uint8_t type);
559
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800560#ifdef FEATURE_WLAN_TDLS
561/**
Kabilan Kannan421714b2015-11-23 04:44:59 -0800562 * enum t_wma_tdls_mode - TDLS mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800563 * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
564 * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
565 * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
566 * but respond to the peer
567 * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
Kabilan Kannan421714b2015-11-23 04:44:59 -0800568 * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
569 * implicit trigger but only to a peer mac configured by user space.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800570 */
571typedef enum {
572 WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
573 WMA_TDLS_SUPPORT_DISABLED,
574 WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
575 WMA_TDLS_SUPPORT_ENABLED,
Kabilan Kannan421714b2015-11-23 04:44:59 -0800576 WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800577} t_wma_tdls_mode;
578
579/**
580 * enum wma_tdls_peer_notification - TDLS events
581 * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
582 * on tx bytes per second > tx_discover threshold
583 * NB: notification will be re-sent after
584 * discovery_request_interval_ms
585 * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
586 * due to tx bytes per second below
587 * tx_teardown_threshold
588 * NB: this notification sent once
589 * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
590 */
591enum wma_tdls_peer_notification {
592 WMA_TDLS_SHOULD_DISCOVER,
593 WMA_TDLS_SHOULD_TEARDOWN,
594 WMA_TDLS_PEER_DISCONNECTED,
595};
596
597/**
598 * enum wma_tdls_peer_reason - TDLS peer reason
599 * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
600 * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
601 * packet rates < AP rates
602 * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
603 * due to poor RSSI
604 * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
605 * due to offchannel scan
606 * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
607 * due to peer deletion
608 */
609enum wma_tdls_peer_reason {
610 WMA_TDLS_TEARDOWN_REASON_TX,
611 WMA_TDLS_TEARDOWN_REASON_RATE,
612 WMA_TDLS_TEARDOWN_REASON_RSSI,
613 WMA_TDLS_TEARDOWN_REASON_SCAN,
614 WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
615};
616#endif /* FEATURE_WLAN_TDLS */
617
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800618/**
Govind Singhd76a5b02016-03-08 15:12:14 +0530619 * enum wma_rx_exec_ctx - wma rx execution context
620 * @WMA_RX_WORK_CTX: work queue context execution
621 * @WMA_RX_TASKLET_CTX: tasklet context execution
622 * @WMA_RX_SERIALIZER_CTX: MC thread context execution
623 *
624 */
625enum wma_rx_exec_ctx {
626 WMA_RX_WORK_CTX,
627 WMA_RX_TASKLET_CTX,
628 WMA_RX_SERIALIZER_CTX
629};
Krunal Soni2e48d012016-05-02 16:55:26 -0700630
631/**
632 * enum wma_phy_idx
633 * @PHY1: to notify caller that PHY1 specific param needed
634 * @PHY2: to notify caller that PHY2 specific param needed
635 * @PHY1_PHY2: to notify caller that both PHY's param needed
636 * Note: Firmware sends phy map in terms of bitmask, so enum
637 * also needs to be defined that way.
638 *
639 * For example, 0x3 = 0011 = BIT0 corresponds to one phy and
640 * BIT1 coresponds to another phy. There is no direct relation between
641 * each bit to particular PHY (ex. PHYA or PHYB).
642 *
643 * In simple terms, 3 means referring both PHYs & 1 or 2 means
644 * referring to either PHYA or PHYB.
645 */
646enum wma_phy_idx {
647 PHY1 = 0x1, /* 0x1 */
648 PHY2, /* 0x2 */
649 PHY1_PHY2, /* 0x3 */
650};
651
Govind Singhd76a5b02016-03-08 15:12:14 +0530652/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800653 * struct wma_mem_chunk - memory chunks
654 * @vaddr: virtual address
655 * @paddr: physical address
656 * @memctx: dma mapped memory
657 * @len: length of data
658 * @req_id: request id
659 *
660 * memory chunck allocated by Host to be managed by FW
661 * used only for low latency interfaces like pcie
662 */
663struct wma_mem_chunk {
664 uint32_t *vaddr;
665 uint32_t paddr;
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700666
Anurag Chouhan6d760662016-02-20 16:05:43 +0530667 qdf_dma_mem_context(memctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800668 uint32_t len;
669 uint32_t req_id;
670};
671
672/**
673 * struct p2p_scan_param - p2p scan listen parameters
674 * @scan_id: scan id
675 * @p2p_scan_type: p2p scan type
676 */
677struct p2p_scan_param {
678 uint32_t scan_id;
679 tSirP2pScanType p2p_scan_type;
680};
681
682/**
683 * struct scan_param - scan parameters
684 * @scan_id: scan id
685 * @scan_requestor_id: scan requestor id
686 * @p2p_scan_type: p2p scan type
687 */
688struct scan_param {
689 uint32_t scan_id;
690 uint32_t scan_requestor_id;
691 tSirP2pScanType p2p_scan_type;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -0700692 uint32_t chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693};
694
695/**
696 * struct beacon_info - structure to store beacon template
697 * @buf: skb ptr
698 * @len: length
699 * @dma_mapped: is it dma mapped or not
700 * @tim_ie_offset: TIM IE offset
701 * @dtim_count: DTIM count
702 * @seq_no: sequence no
703 * @noa_sub_ie: NOA sub IE
704 * @noa_sub_ie_len: NOA sub IE length
705 * @noa_ie: NOA IE
706 * @p2p_ie_offset: p2p IE offset
707 * @lock: lock
708 */
709struct beacon_info {
Nirav Shahcbc6d722016-03-01 16:24:53 +0530710 qdf_nbuf_t buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800711 uint32_t len;
712 uint8_t dma_mapped;
713 uint32_t tim_ie_offset;
714 uint8_t dtim_count;
715 uint16_t seq_no;
716 uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
717 uint16_t noa_sub_ie_len;
718 uint8_t *noa_ie;
719 uint16_t p2p_ie_offset;
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530720 qdf_spinlock_t lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721};
722
723/**
724 * struct beacon_tim_ie - structure to store TIM IE of beacon
725 * @tim_ie: tim ie
726 * @tim_len: tim ie length
727 * @dtim_count: dtim count
728 * @dtim_period: dtim period
729 * @tim_bitctl: tim bit control
730 * @tim_bitmap: tim bitmap
731 */
732struct beacon_tim_ie {
733 uint8_t tim_ie;
734 uint8_t tim_len;
735 uint8_t dtim_count;
736 uint8_t dtim_period;
737 uint8_t tim_bitctl;
738 uint8_t tim_bitmap[1];
739} __ATTRIB_PACK;
740
741/**
742 * struct pps - packet power save parameter
743 * @paid_match_enable: paid match enable
744 * @gid_match_enable: gid match enable
745 * @tim_clear: time clear
746 * @dtim_clear: dtim clear
747 * @eof_delim: eof delim
748 * @mac_match: mac match
749 * @delim_fail: delim fail
750 * @nsts_zero: nsts zero
751 * @rssi_chk: RSSI check
752 * @ebt_5g: ebt 5GHz
753 */
754struct pps {
755 bool paid_match_enable;
756 bool gid_match_enable;
757 bool tim_clear;
758 bool dtim_clear;
759 bool eof_delim;
760 bool mac_match;
761 bool delim_fail;
762 bool nsts_zero;
763 bool rssi_chk;
764 bool ebt_5g;
765};
766
767/**
768 * struct qpower_params - qpower related parameters
769 * @max_ps_poll_cnt: max ps poll count
770 * @max_tx_before_wake: max tx before wake
771 * @spec_ps_poll_wake_interval: ps poll wake interval
772 * @max_spec_nodata_ps_poll: no data ps poll
773 */
774struct qpower_params {
775 uint32_t max_ps_poll_cnt;
776 uint32_t max_tx_before_wake;
777 uint32_t spec_ps_poll_wake_interval;
778 uint32_t max_spec_nodata_ps_poll;
779};
780
781
782/**
783 * struct gtx_config_t - GTX config
784 * @gtxRTMask: for HT and VHT rate masks
785 * @gtxUsrcfg: host request for GTX mask
786 * @gtxPERThreshold: PER Threshold (default: 10%)
787 * @gtxPERMargin: PER margin (default: 2%)
788 * @gtxTPCstep: TCP step (default: 1)
789 * @gtxTPCMin: TCP min (default: 5)
790 * @gtxBWMask: BW mask (20/40/80/160 Mhz)
791 */
792typedef struct {
793 uint32_t gtxRTMask[2];
794 uint32_t gtxUsrcfg;
795 uint32_t gtxPERThreshold;
796 uint32_t gtxPERMargin;
797 uint32_t gtxTPCstep;
798 uint32_t gtxTPCMin;
799 uint32_t gtxBWMask;
800} gtx_config_t;
801
802/**
803 * struct pdev_cli_config_t - store pdev parameters
804 * @ani_enable: ANI is enabled/disable on target
805 * @ani_poll_len: store ANI polling period
806 * @ani_listen_len: store ANI listening period
807 * @ani_ofdm_level: store ANI OFDM immunity level
808 * @ani_cck_level: store ANI CCK immunity level
809 * @cwmenable: Dynamic bw is enable/disable in fw
810 * @txchainmask: tx chain mask
811 * @rxchainmask: rx chain mask
812 * @txpow2g: tx power limit for 2GHz
813 * @txpow5g: tx power limit for 5GHz
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814 * @burst_enable: is burst enable/disable
815 * @burst_dur: burst duration
816 *
817 * This structure stores pdev parameters.
818 * Some of these parameters are set in fw and some
819 * parameters are only maintained in host.
820 */
821typedef struct {
822 uint32_t ani_enable;
823 uint32_t ani_poll_len;
824 uint32_t ani_listen_len;
825 uint32_t ani_ofdm_level;
826 uint32_t ani_cck_level;
827 uint32_t cwmenable;
828 uint32_t cts_cbw;
829 uint32_t txchainmask;
830 uint32_t rxchainmask;
831 uint32_t txpow2g;
832 uint32_t txpow5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 uint32_t burst_enable;
834 uint32_t burst_dur;
835} pdev_cli_config_t;
836
837/**
838 * struct vdev_cli_config_t - store vdev parameters
839 * @nss: nss width
840 * @ldpc: is ldpc is enable/disable
841 * @tx_stbc: TX STBC is enable/disable
842 * @rx_stbc: RX STBC is enable/disable
843 * @shortgi: short gi is enable/disable
844 * @rtscts_en: RTS/CTS is enable/disable
845 * @chwidth: channel width
846 * @tx_rate: tx rate
847 * @ampdu: ampdu size
848 * @amsdu: amsdu size
849 * @erx_adjust: enable/disable early rx enable
850 * @erx_bmiss_num: target bmiss number per sample
851 * @erx_bmiss_cycle: sample cycle
852 * @erx_slop_step: slop_step value
853 * @erx_init_slop: init slop
854 * @erx_adj_pause: pause adjust enable/disable
855 * @erx_dri_sample: enable/disable drift sample
856 * @pps_params: packet power save parameters
857 * @qpower_params: qpower parameters
858 * @gtx_info: GTX offload info
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700859 * @dcm: DCM enable/disable
Krishna Kumaar Natarajan150cd012017-03-23 12:29:10 -0700860 * @range_ext: HE range extension enable/disable
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800861 *
862 * This structure stores vdev parameters.
863 * Some of these parameters are set in fw and some
864 * parameters are only maintained in host.
865 */
866typedef struct {
867 uint32_t nss;
868 uint32_t ldpc;
869 uint32_t tx_stbc;
870 uint32_t rx_stbc;
871 uint32_t shortgi;
872 uint32_t rtscts_en;
873 uint32_t chwidth;
874 uint32_t tx_rate;
875 uint32_t ampdu;
876 uint32_t amsdu;
877 uint32_t erx_adjust;
878 uint32_t erx_bmiss_num;
879 uint32_t erx_bmiss_cycle;
880 uint32_t erx_slop_step;
881 uint32_t erx_init_slop;
882 uint32_t erx_adj_pause;
883 uint32_t erx_dri_sample;
884 struct pps pps_params;
885 struct qpower_params qpower_params;
886 gtx_config_t gtx_info;
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700887#ifdef WLAN_FEATURE_11AX
888 uint8_t dcm;
Krishna Kumaar Natarajan150cd012017-03-23 12:29:10 -0700889 uint8_t range_ext;
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700890#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800891} vdev_cli_config_t;
892
893/**
Mukul Sharma5ff3c582016-09-12 15:23:35 +0530894 * struct wma_version_info - Store wmi version info
895 * @major: wmi major version
896 * @minor: wmi minor version
897 * @revision: wmi revision number
898 */
899struct wma_version_info {
900 u_int32_t major;
901 u_int32_t minor;
902 u_int32_t revision;
903};
904
905/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800906 * struct wma_wow - store wow patterns
907 * @magic_ptrn_enable: magic pattern enable/disable
908 * @wow_enable: wow enable/disable
909 * @wow_enable_cmd_sent: is wow enable command sent to fw
910 * @deauth_enable: is deauth wakeup enable/disable
911 * @disassoc_enable: is disassoc wakeup enable/disable
912 * @bmiss_enable: is bmiss wakeup enable/disable
913 * @gtk_pdev_enable: is GTK based wakeup enable/disable
914 * @gtk_err_enable: is GTK error wakeup enable/disable
915 * @lphb_cache: lphb cache
916 *
917 * This structure stores wow patterns and
918 * wow related parameters in host.
919 */
920struct wma_wow {
921 bool magic_ptrn_enable;
922 bool wow_enable;
923 bool wow_enable_cmd_sent;
924 bool deauth_enable;
925 bool disassoc_enable;
926 bool bmiss_enable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800927 bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800928};
929
930#ifdef WLAN_FEATURE_11W
931#define CMAC_IPN_LEN (6)
932#define WMA_IGTK_KEY_INDEX_4 (4)
933#define WMA_IGTK_KEY_INDEX_5 (5)
934
935/**
936 * struct wma_igtk_ipn_t - GTK IPN info
937 * @ipn: IPN info
938 */
939typedef struct {
940 uint8_t ipn[CMAC_IPN_LEN];
941} wma_igtk_ipn_t;
942
943/**
944 * struct wma_igtk_key_t - GTK key
945 * @key_length: key length
946 * @key: key
947 * @key_id: key id
948 */
949typedef struct {
950 uint16_t key_length;
951 uint8_t key[CSR_AES_KEY_LEN];
952
953 /* IPN is maintained per iGTK keyID
954 * 0th index for iGTK keyID = 4;
955 * 1st index for iGTK KeyID = 5
956 */
957 wma_igtk_ipn_t key_id[2];
958} wma_igtk_key_t;
959#endif
960
961/**
962 * struct vdev_restart_params_t - vdev restart parameters
963 * @vdev_id: vdev id
964 * @ssid: ssid
965 * @flags: flags
966 * @requestor_id: requestor id
967 * @chan: channel
968 * @hidden_ssid_restart_in_progress: hidden ssid restart flag
969 * @ssidHidden: is ssid hidden or not
970 */
971typedef struct {
972 A_UINT32 vdev_id;
973 wmi_ssid ssid;
974 A_UINT32 flags;
975 A_UINT32 requestor_id;
976 A_UINT32 disable_hw_ack;
977 wmi_channel chan;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +0530978 qdf_atomic_t hidden_ssid_restart_in_progress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800979 uint8_t ssidHidden;
980} vdev_restart_params_t;
981
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530982struct roam_synch_frame_ind {
983 uint32_t bcn_probe_rsp_len;
984 uint8_t *bcn_probe_rsp;
985 uint8_t is_beacon;
986 uint32_t reassoc_req_len;
987 uint8_t *reassoc_req;
988 uint32_t reassoc_rsp_len;
989 uint8_t *reassoc_rsp;
990};
991
992
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800993/**
994 * struct wma_txrx_node - txrx node
995 * @addr: mac address
996 * @bssid: bssid
997 * @handle: wma handle
998 * @beacon: beacon info
999 * @vdev_restart_params: vdev restart parameters
1000 * @config: per vdev config parameters
1001 * @scan_info: scan info
1002 * @type: type
1003 * @sub_type: sub type
1004 * @nlo_match_evt_received: is nlo match event received or not
1005 * @pno_in_progress: is pno in progress or not
1006 * @plm_in_progress: is plm in progress or not
1007 * @ptrn_match_enable: is pattern match is enable or not
1008 * @num_wow_default_patterns: number of default wow patterns configured for vdev
1009 * @num_wow_user_patterns: number of user wow patterns configured for vdev
1010 * @conn_state: connection state
1011 * @beaconInterval: beacon interval
1012 * @llbCoexist: 11b coexist
1013 * @shortSlotTimeSupported: is short slot time supported or not
1014 * @dtimPeriod: DTIM period
1015 * @chanmode: channel mode
1016 * @vht_capable: VHT capablity flag
1017 * @ht_capable: HT capablity flag
1018 * @mhz: channel frequency in KHz
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -07001019 * @chan_width: channel bandwidth
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001020 * @vdev_up: is vdev up or not
1021 * @tsfadjust: TSF adjust
1022 * @addBssStaContext: add bss context
1023 * @aid: association id
1024 * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
1025 * @key: GTK key
1026 * @uapsd_cached_val: uapsd cached value
1027 * @stats_rsp: stats response
1028 * @fw_stats_set: fw stats value
1029 * @del_staself_req: delete sta self request
1030 * @bss_status: bss status
1031 * @rate_flags: rate flags
1032 * @nss: nss value
1033 * @is_channel_switch: is channel switch
1034 * @pause_bitmap: pause bitmap
1035 * @tx_power: tx power in dbm
1036 * @max_tx_power: max tx power in dbm
1037 * @nwType: network type (802.11a/b/g/n/ac)
1038 * @staKeyParams: sta key parameters
1039 * @ps_enabled: is powersave enable/disable
Kiran Kumar Lokere1e8e4f02017-02-02 18:08:44 -08001040 * @restore_dtim_setting: DTIM settings restore flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001041 * @peer_count: peer count
1042 * @roam_synch_in_progress: flag is in progress or not
1043 * @plink_status_req: link status request
1044 * @psnr_req: snr request
1045 * @delay_before_vdev_stop: delay
Mukul Sharma6398b252017-05-01 17:58:12 +05301046 * @override_li: dynamically user configured listen interval
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001047 * @tx_streams: number of tx streams can be used by the vdev
1048 * @rx_streams: number of rx streams can be used by the vdev
1049 * @chain_mask: chain mask can be used by the vdev
1050 * @mac_id: the mac on which vdev is on
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301051 * @wep_default_key_idx: wep default index for group key
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301052 * @arp_offload_req: cached arp offload request
1053 * @ns_offload_req: cached ns offload request
Dustin Brown9d797d62017-01-11 16:39:12 -08001054 * @wow_stats: stat counters for WoW related events
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301055 * @rcpi_req: rcpi request
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001056 * It stores parameters per vdev in wma.
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301057 * @in_bmps : Whether bmps for this interface has been enabled
Dustin Brownec2c92e2017-07-26 11:13:49 -07001058 * @vdev_start_wakelock: wakelock to protect vdev start op with firmware
1059 * @vdev_stop_wakelock: wakelock to protect vdev stop op with firmware
Rajeev Kumar155a3e42017-10-10 15:31:17 -07001060 * @vdev_set_key_wakelock: wakelock to protect vdev set key op with firmware
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061 */
1062struct wma_txrx_node {
1063 uint8_t addr[IEEE80211_ADDR_LEN];
1064 uint8_t bssid[IEEE80211_ADDR_LEN];
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -08001065 struct cdp_vdev *handle;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001066 struct beacon_info *beacon;
1067 vdev_restart_params_t vdev_restart_params;
1068 vdev_cli_config_t config;
1069 struct scan_param scan_info;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001070 uint32_t type;
1071 uint32_t sub_type;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001072#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073 bool plm_in_progress;
1074#endif
1075 bool ptrn_match_enable;
1076 uint8_t num_wow_default_patterns;
1077 uint8_t num_wow_user_patterns;
1078 bool conn_state;
1079 tSirMacBeaconInterval beaconInterval;
1080 uint8_t llbCoexist;
1081 uint8_t shortSlotTimeSupported;
1082 uint8_t dtimPeriod;
1083 WLAN_PHY_MODE chanmode;
1084 uint8_t vht_capable;
1085 uint8_t ht_capable;
1086 A_UINT32 mhz;
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -07001087 enum phy_ch_width chan_width;
Selvaraj, Sridhar171e2252016-06-22 22:33:26 +05301088 bool vdev_active;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001089 uint64_t tsfadjust;
1090 void *addBssStaContext;
1091 uint8_t aid;
1092 uint8_t rmfEnabled;
1093#ifdef WLAN_FEATURE_11W
1094 wma_igtk_key_t key;
1095#endif /* WLAN_FEATURE_11W */
1096 uint32_t uapsd_cached_val;
1097 tAniGetPEStatsRsp *stats_rsp;
1098 uint8_t fw_stats_set;
1099 void *del_staself_req;
Abhishek Singh0d74f9e2017-09-26 14:02:42 +05301100 bool is_del_sta_defered;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301101 qdf_atomic_t bss_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001102 uint8_t rate_flags;
1103 uint8_t nss;
1104 bool is_channel_switch;
1105 uint16_t pause_bitmap;
Amar Singhala297bfa2015-10-15 15:07:29 -07001106 int8_t tx_power;
1107 int8_t max_tx_power;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001108 uint32_t nwType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001109 void *staKeyParams;
Kiran Kumar Lokere1e8e4f02017-02-02 18:08:44 -08001110 bool restore_dtim_setting;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001111 uint32_t peer_count;
1112 bool roam_synch_in_progress;
1113 void *plink_status_req;
1114 void *psnr_req;
1115 uint8_t delay_before_vdev_stop;
1116#ifdef FEATURE_WLAN_EXTSCAN
1117 bool extscan_in_progress;
1118#endif
1119 uint32_t alt_modulated_dtim;
1120 bool alt_modulated_dtim_enabled;
Mukul Sharma6398b252017-05-01 17:58:12 +05301121 uint32_t override_li;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001122 uint32_t tx_streams;
1123 uint32_t rx_streams;
1124 uint32_t chain_mask;
1125 uint32_t mac_id;
Varun Reddy Yeturu30bc42c2016-02-04 10:07:30 -08001126 bool roaming_in_progress;
Varun Reddy Yeturu5ab47462016-05-08 18:08:11 -07001127 int32_t roam_synch_delay;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07001128 uint8_t nss_2g;
1129 uint8_t nss_5g;
Peng Xu8fdaa492016-06-22 10:20:47 -07001130 bool p2p_lo_in_progress;
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301131 uint8_t wep_default_key_idx;
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301132 tSirHostOffloadReq arp_offload_req;
1133 tSirHostOffloadReq ns_offload_req;
Bhargav Shaha89d3b42016-04-20 13:04:56 +05301134 bool is_vdev_valid;
Dustin Brown9d797d62017-01-11 16:39:12 -08001135 struct sir_vdev_wow_stats wow_stats;
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301136 struct sme_rcpi_req *rcpi_req;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001137#ifdef WLAN_FEATURE_11AX
1138 bool he_capable;
1139 uint32_t he_ops;
1140#endif
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301141 bool in_bmps;
Kiran Kumar Lokeref9dc7912017-06-28 18:10:58 -07001142 struct beacon_filter_param beacon_filter;
1143 bool beacon_filter_enabled;
Dustin Brownec2c92e2017-07-26 11:13:49 -07001144 qdf_wake_lock_t vdev_start_wakelock;
1145 qdf_wake_lock_t vdev_stop_wakelock;
Rajeev Kumar155a3e42017-10-10 15:31:17 -07001146 qdf_wake_lock_t vdev_set_key_wakelock;
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +05301147 struct roam_synch_frame_ind roam_synch_frame_ind;
Naveen Rawatd7734142017-10-27 10:02:40 -07001148 bool is_waiting_for_key;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001149};
1150
1151#if defined(QCA_WIFI_FTM)
1152#define MAX_UTF_EVENT_LENGTH 2048
1153#define MAX_WMI_UTF_LEN 252
1154
1155/**
1156 * struct SEG_HDR_INFO_STRUCT - header info
1157 * @len: length
1158 * @msgref: message refrence
1159 * @segmentInfo: segment info
1160 * @pad: padding
1161 */
1162typedef struct {
1163 A_UINT32 len;
1164 A_UINT32 msgref;
1165 A_UINT32 segmentInfo;
1166 A_UINT32 pad;
1167} SEG_HDR_INFO_STRUCT;
1168
1169/**
1170 * struct utf_event_info - UTF event info
1171 * @data: data ptr
1172 * @length: length
1173 * @offset: offset
1174 * @currentSeq: curent squence
1175 * @expectedSeq: expected sequence
1176 */
1177struct utf_event_info {
1178 uint8_t *data;
1179 uint32_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301180 qdf_size_t offset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001181 uint8_t currentSeq;
1182 uint8_t expectedSeq;
1183};
1184#endif
1185
1186/**
1187 * struct scan_timer_info - scan timer info
1188 * @vdev_id: vdev id
1189 * @scan_id: scan id
1190 */
1191typedef struct {
1192 uint8_t vdev_id;
1193 uint32_t scan_id;
1194} scan_timer_info;
1195
1196/**
1197 * struct ibss_power_save_params - IBSS power save parameters
1198 * @atimWindowLength: ATIM window length
1199 * @isPowerSaveAllowed: is power save allowed
1200 * @isPowerCollapseAllowed: is power collapsed allowed
1201 * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
1202 * @inactivityCount: inactivity count
1203 * @txSPEndInactivityTime: tx SP end inactivity time
1204 * @ibssPsWarmupTime: IBSS power save warm up time
1205 * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
1206 */
1207typedef struct {
1208 uint32_t atimWindowLength;
1209 uint32_t isPowerSaveAllowed;
1210 uint32_t isPowerCollapseAllowed;
1211 uint32_t isAwakeonTxRxEnabled;
1212 uint32_t inactivityCount;
1213 uint32_t txSPEndInactivityTime;
1214 uint32_t ibssPsWarmupTime;
1215 uint32_t ibssPs1RxChainInAtimEnable;
1216} ibss_power_save_params;
1217
1218/**
Nitesh Shah877ad5d2016-09-22 19:27:58 +05301219 * struct mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC
1220 * @mac_tx_stream: Max TX stream
1221 * @mac_rx_stream: Max RX stream
1222 * @mac_bw: Max bandwidth
1223 */
1224struct mac_ss_bw_info {
1225 uint32_t mac_tx_stream;
1226 uint32_t mac_rx_stream;
1227 uint32_t mac_bw;
1228};
1229
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001230/**
Komal Seelam02d09342016-02-23 18:03:19 +05301231 * struct wma_ini_config - Structure to hold wma ini configuration
1232 * @max_no_of_peers: Max Number of supported
1233 *
1234 * Placeholder for WMA ini parameters.
1235 */
1236struct wma_ini_config {
1237 uint8_t max_no_of_peers;
1238};
1239
1240/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301241 * struct wmi_valid_channels - Channel details part of WMI_SCAN_CHAN_LIST_CMDID
1242 * @num_channels: Number of channels
1243 * @channel_list: Channel list
1244 */
1245struct wma_valid_channels {
1246 uint8_t num_channels;
1247 uint8_t channel_list[MAX_NUM_CHAN];
1248};
1249
Krunal Soni2e48d012016-05-02 16:55:26 -07001250/**
1251 * struct hw_mode_idx_to_mac_cap_idx - map between hw_mode to capabilities
1252 * @num_of_macs: number of macs/PHYs for given hw_mode through hw_mode_id
1253 * @mac_cap_idx: index of the mac/PHY for given hw_mode through hw_mode_id
1254 * @hw_mode_id: given hw_mode id
1255 */
1256struct hw_mode_idx_to_mac_cap_idx {
1257 uint8_t num_of_macs;
1258 uint8_t mac_cap_idx;
1259 uint8_t hw_mode_id;
1260};
1261
1262/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001263 * struct t_wma_handle - wma context
1264 * @wmi_handle: wmi handle
1265 * @htc_handle: htc handle
1266 * @cds_context: cds handle
1267 * @mac_context: mac context
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301268 * @psoc: psoc context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001269 * @wma_ready_event: wma rx ready event
1270 * @wma_resume_event: wma resume event
1271 * @target_suspend: target suspend event
1272 * @recovery_event: wma FW recovery event
1273 * @max_station: max stations
1274 * @max_bssid: max bssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001275 * @driver_type: driver type
1276 * @myaddr: current mac address
1277 * @hwaddr: mac address from EEPROM
1278 * @target_abi_vers: target firmware version
1279 * @final_abi_vers: The final ABI version to be used for communicating
1280 * @target_fw_version: Target f/w build version
Sandeep Puligilla3d6a8e22016-10-11 18:57:14 -07001281 * @target_fw_vers_ext: Target f/w build version sub id
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001282 * @lpss_support: LPSS feature is supported in target or not
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08001283 * @egap_support: Enhanced Green AP support flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001284 * @wmi_ready: wmi status flag
1285 * @wlan_init_status: wlan init status
Anurag Chouhanf04e84f2016-03-03 10:12:12 +05301286 * @qdf_dev: qdf device
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001287 * @phy_capability: PHY Capability from Target
1288 * @max_frag_entry: Max number of Fragment entry
1289 * @wmi_service_bitmap: wmi services bitmap received from Target
1290 * @wlan_resource_config: resource config
1291 * @frameTransRequired: frame transmission required
1292 * @wmaGlobalSystemRole: global system role
1293 * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
1294 * @tx_frm_download_comp_event: Event to wait for tx download completion
1295 * @tx_queue_empty_event: wait for tx queue to get flushed
1296 * @umac_ota_ack_cb: Ack Complete Callback registered by umac
1297 * @umac_data_ota_ack_cb: ack complete callback
1298 * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
1299 * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
1300 * @needShutdown: is shutdown needed or not
1301 * @num_mem_chunks: number of memory chunk
1302 * @mem_chunks: memory chunks
1303 * @tgt_cfg_update_cb: configuration update callback
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001304 * @reg_cap: regulatory capablities
1305 * @scan_id: scan id
1306 * @interfaces: txrx nodes(per vdev)
1307 * @pdevconfig: pdev related configrations
1308 * @vdev_resp_queue: vdev response queue
1309 * @vdev_respq_lock: vdev response queue lock
1310 * @ht_cap_info: HT capablity info
1311 * @vht_cap_info: VHT capablity info
1312 * @vht_supp_mcs: VHT supported MCS
1313 * @num_rf_chains: number of RF chains
1314 * @utf_event_info: UTF event information
1315 * @is_fw_assert: is fw asserted
1316 * @wow: wow related patterns & parameters
1317 * @no_of_suspend_ind: number of suspend indications
1318 * @no_of_resume_ind: number of resume indications
1319 * @mArpInfo: arp info
1320 * @powersave_mode: power save mode
1321 * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
1322 * @pGetRssiReq: get RSSI request
1323 * @thermal_mgmt_info: Thermal mitigation related info
1324 * @roam_offload_enabled: is roam offload enable/disable
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001325 * @ol_ini_info: store ini status of arp offload, ns offload
1326 * @ssdp: ssdp flag
Komal Seelam9764a842016-05-24 11:07:23 +05301327 * @enable_mc_list : To Check if Multicast list filtering is enabled in FW
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001328 * @ibss_started: is IBSS started or not
1329 * @ibsskey_info: IBSS key info
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001330 * @hddTxFailCb: tx fail indication callback
1331 * @pno_wake_lock: PNO wake lock
1332 * @extscan_wake_lock: extscan wake lock
1333 * @wow_wake_lock: wow wake lock
Mukul Sharmae44d0542017-05-23 21:50:56 +05301334 * @wow_auth_req_wl: wow wake lock for auth req
1335 * @wow_assoc_req_wl: wow wake lock for assoc req
1336 * @wow_deauth_rec_wl: wow wake lock for deauth req
1337 * @wow_disassoc_rec_wl: wow wake lock for disassoc req
1338 * @wow_ap_assoc_lost_wl: wow wake lock for assoc lost req
1339 * @wow_auto_shutdown_wl: wow wake lock for shutdown req
1340 * @roam_ho_wl: wake lock for roam handoff req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001341 * @wow_nack: wow negative ack flag
1342 * @ap_client_cnt: ap client count
1343 * @is_wow_bus_suspended: is wow bus suspended flag
1344 * @wma_scan_comp_timer: scan completion timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001345 * @suitable_ap_hb_failure: better ap found
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301346 * @suitable_ap_hb_failure_rssi: record the RSSI when suitable_ap_hb_failure
1347 * for later usage to report RSSI at beacon miss scenario
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001348 * @wma_ibss_power_save_params: IBSS Power Save config Parameters
1349 * @IsRArateLimitEnabled: RA rate limiti s enabled or not
1350 * @RArateLimitInterval: RA rate limit interval
1351 * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
1352 * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
1353 * @staMaxLIModDtim: station max listen interval
1354 * @staModDtim: station mode DTIM
1355 * @staDynamicDtim: station dynamic DTIM
1356 * @enable_mhf_offload: is MHF offload enable/disable
1357 * @last_mhf_entries_timestamp: timestamp when last entries where set
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001358 * @hw_bd_id: hardware board id
1359 * @hw_bd_info: hardware board info
1360 * @in_d0wow: D0WOW is enable/disable
1361 * @miracast_value: miracast value
1362 * @log_completion_timer: log completion timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001363 * @num_dbs_hw_modes: Number of HW modes supported by the FW
1364 * @dbs_mode: DBS HW mode list
1365 * @old_hw_mode_index: Previous configured HW mode index
1366 * @new_hw_mode_index: Current configured HW mode index
Krunal Soni2e48d012016-05-02 16:55:26 -07001367 * @extended_caps phy_caps: extended caps per hw mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001368 * @peer_authorized_cb: peer authorized hdd callback
1369 * @ocb_callback: callback to OCB commands
1370 * @ocb_resp: response to OCB commands
1371 * @wow_pno_match_wake_up_count: PNO match wake up count
1372 * @wow_pno_complete_wake_up_count: PNO complete wake up count
1373 * @wow_gscan_wake_up_count: Gscan wake up count
1374 * @wow_low_rssi_wake_up_count: Low rssi wake up count
1375 * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
1376 * @wow_ucast_wake_up_count: WoW unicast packet wake up count
1377 * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
1378 * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
1379 * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
1380 * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
1381 * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
1382 * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05301383 * @wow_icmpv4_count: WoW ipv4 icmp packet wake up count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05301384 * @wow_icmpv6_count: WoW ipv6 icmp packet wake up count
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001385 * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
1386 *
1387 * @max_scan: maximum scan requests than can be queued
1388 * This structure is global wma context
1389 * It contains global wma module parameters and
1390 * handle of other modules.
Dustin Brown13995f02017-01-12 15:38:42 -08001391 * @bpf_packet_filter_enable: BPF filter enabled or not
Hanumanth Reddy Pothulae87621b2017-04-12 20:53:35 +05301392 * @active_uc_bpf_mode: Setting that determines how BPF is applied in active
1393 * mode for uc packets
1394 * @active_mc_bc_bpf_mode: Setting that determines how BPF is applied in
1395 * active mode for MC/BC packets
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001396 * @service_ready_ext_evt: Wait event for service ready ext
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001397 * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
1398 * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301399 * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
Arif Hussain759a0232017-03-20 13:17:18 -07001400 * @dfs_cac_offload: dfs and cac timer offload
Sandeep Puligilla819d94f2017-10-10 18:33:56 -07001401 * @bandcapability: band capability configured through ini
Ashish Kumar Dhanotiya9335d812017-06-30 16:57:20 +05301402 * @ito_repeat_count: Indicates ito repeated count
Dustin Brown05557182017-10-12 14:44:49 -07001403 * @critical_events_in_flight: number of suspend preventing events in flight
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001404 */
1405typedef struct {
1406 void *wmi_handle;
1407 void *htc_handle;
1408 void *cds_context;
1409 void *mac_context;
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301410 struct wlan_objmgr_psoc *psoc;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07001411 struct wlan_objmgr_pdev *pdev;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301412 qdf_event_t wma_ready_event;
1413 qdf_event_t wma_resume_event;
1414 qdf_event_t target_suspend;
1415 qdf_event_t runtime_suspend;
1416 qdf_event_t recovery_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001417 uint16_t max_station;
1418 uint16_t max_bssid;
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001419 enum qdf_driver_type driver_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001420 uint8_t myaddr[IEEE80211_ADDR_LEN];
1421 uint8_t hwaddr[IEEE80211_ADDR_LEN];
1422 wmi_abi_version target_abi_vers;
1423 wmi_abi_version final_abi_vers;
1424 uint32_t target_fw_version;
Sandeep Puligilla3d6a8e22016-10-11 18:57:14 -07001425 uint32_t target_fw_vers_ext;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001426#ifdef WLAN_FEATURE_LPSS
1427 uint8_t lpss_support;
1428#endif
1429 uint8_t ap_arpns_support;
Himanshu Agarwalb229a142017-12-21 10:16:45 +05301430#ifdef WLAN_SUPPORT_GREEN_AP
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08001431 bool egap_support;
1432#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001433 bool wmi_ready;
1434 uint32_t wlan_init_status;
Anurag Chouhandf2b2682016-02-29 14:15:27 +05301435 qdf_device_t qdf_dev;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001436 uint32_t phy_capability;
1437 uint32_t max_frag_entry;
1438 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
Vignesh Viswanathan731186f2017-09-18 13:47:37 +05301439 uint32_t wmi_service_ext_offset;
1440 uint32_t wmi_service_ext_bitmap[WMI_SERVICE_SEGMENT_BM_SIZE32];
Mukul Sharmab10c8c72017-11-02 17:25:59 +05301441 target_resource_config wlan_resource_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001442 uint32_t frameTransRequired;
1443 tBssSystemRole wmaGlobalSystemRole;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301444 wma_tx_dwnld_comp_callback tx_frm_download_comp_cb;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301445 qdf_event_t tx_frm_download_comp_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001446 /*
1447 * Dummy event to wait for draining MSDUs left in hardware tx
1448 * queue and before requesting VDEV_STOP. Nobody will set this
1449 * and wait will timeout, and code will poll the pending tx
1450 * descriptors number to be zero.
1451 */
Anurag Chouhance0dc992016-02-16 18:18:03 +05301452 qdf_event_t tx_queue_empty_event;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301453 wma_tx_ota_comp_callback umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
1454 wma_tx_ota_comp_callback umac_data_ota_ack_cb;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301455 unsigned long last_umac_data_ota_timestamp;
Nirav Shahcbc6d722016-03-01 16:24:53 +05301456 qdf_nbuf_t last_umac_data_nbuf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001457 bool needShutdown;
1458 uint32_t num_mem_chunks;
Govind Singhf25a0f12016-03-08 16:09:48 +05301459 struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001460 wma_tgt_cfg_cb tgt_cfg_update_cb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001461 HAL_REG_CAPABILITIES reg_cap;
1462 uint32_t scan_id;
1463 struct wma_txrx_node *interfaces;
1464 pdev_cli_config_t pdevconfig;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301465 qdf_list_t vdev_resp_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301466 qdf_spinlock_t vdev_respq_lock;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301467 qdf_list_t wma_hold_req_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301468 qdf_spinlock_t wma_hold_req_q_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001469 uint32_t ht_cap_info;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001470 uint32_t vht_cap_info;
1471 uint32_t vht_supp_mcs;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001472 uint32_t num_rf_chains;
1473#if defined(QCA_WIFI_FTM)
1474 struct utf_event_info utf_event_info;
1475#endif
1476 uint8_t is_fw_assert;
1477 struct wma_wow wow;
1478 uint8_t no_of_suspend_ind;
1479 uint8_t no_of_resume_ind;
1480 /* Have a back up of arp info to send along
1481 * with ns info suppose if ns also enabled
1482 */
1483 tSirHostOffloadReq mArpInfo;
1484 struct wma_tx_ack_work_ctx *ack_work_ctx;
1485 uint8_t powersave_mode;
1486 bool ptrn_match_enable_all_vdev;
1487 void *pGetRssiReq;
Will Huanga9814592017-05-24 15:47:58 +08001488 bool get_one_peer_info;
1489 bool get_sta_peer_info;
1490 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001491 t_thermal_mgmt thermal_mgmt_info;
1492 bool roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001493 /* Here ol_ini_info is used to store ini
1494 * status of arp offload, ns offload
1495 * and others. Currently 1st bit is used
1496 * for arp off load and 2nd bit for ns
1497 * offload currently, rest bits are unused
1498 */
1499 uint8_t ol_ini_info;
1500 bool ssdp;
Komal Seelam9764a842016-05-24 11:07:23 +05301501 bool enable_mc_list;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001502 uint8_t ibss_started;
1503 tSetBssKeyParams ibsskey_info;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001504 txFailIndCallback hddTxFailCb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001505#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301506 qdf_wake_lock_t extscan_wake_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001507#endif
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301508 qdf_wake_lock_t wow_wake_lock;
Mukul Sharmae44d0542017-05-23 21:50:56 +05301509 qdf_wake_lock_t wow_auth_req_wl;
1510 qdf_wake_lock_t wow_assoc_req_wl;
1511 qdf_wake_lock_t wow_deauth_rec_wl;
1512 qdf_wake_lock_t wow_disassoc_rec_wl;
1513 qdf_wake_lock_t wow_ap_assoc_lost_wl;
1514 qdf_wake_lock_t wow_auto_shutdown_wl;
1515 qdf_wake_lock_t roam_ho_wl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001516 int wow_nack;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301517 qdf_atomic_t is_wow_bus_suspended;
Anurag Chouhan210db072016-02-22 18:42:15 +05301518 qdf_mc_timer_t wma_scan_comp_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001519 bool suitable_ap_hb_failure;
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301520 uint32_t suitable_ap_hb_failure_rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001521 ibss_power_save_params wma_ibss_power_save_params;
1522#ifdef FEATURE_WLAN_RA_FILTERING
1523 bool IsRArateLimitEnabled;
1524 uint16_t RArateLimitInterval;
1525#endif
1526#ifdef WLAN_FEATURE_LPSS
1527 bool is_lpass_enabled;
1528#endif
1529#ifdef WLAN_FEATURE_NAN
1530 bool is_nan_enabled;
1531#endif
1532 uint8_t staMaxLIModDtim;
1533 uint8_t staModDtim;
1534 uint8_t staDynamicDtim;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001535 uint8_t enable_mhf_offload;
1536 unsigned long last_mhf_entries_timestamp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001537 uint32_t hw_bd_id;
1538 uint32_t hw_bd_info[HW_BD_INFO_SIZE];
1539 uint32_t miracast_value;
Anurag Chouhan210db072016-02-22 18:42:15 +05301540 qdf_mc_timer_t log_completion_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001541 uint32_t num_dbs_hw_modes;
1542 struct dbs_hw_mode_info hw_mode;
1543 uint32_t old_hw_mode_index;
1544 uint32_t new_hw_mode_index;
Krunal Soni2e48d012016-05-02 16:55:26 -07001545 struct extended_caps phy_caps;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301546 qdf_atomic_t scan_id_counter;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001547 wma_peer_authorized_fp peer_authorized_cb;
Dustin Brown9d797d62017-01-11 16:39:12 -08001548 uint32_t wow_unspecified_wake_count;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001549
1550 /* OCB request contexts */
1551 struct sir_ocb_config *ocb_config_req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001552 uint8_t max_scan;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001553 uint16_t self_gen_frm_pwr;
1554 bool tx_chain_mask_cck;
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +05301555 /* Going with a timer instead of wait event because on receiving the
1556 * service ready event, we will be waiting on the MC thread for the
1557 * service extended ready event which is also processed in MC thread.
1558 * This leads to MC thread being stuck. Alternative was to process
1559 * these events in tasklet/workqueue context. But, this leads to
1560 * race conditions when the events are processed in two different
1561 * context. So, processing ready event and extended ready event in
1562 * the serialized MC thread context with a timer.
1563 */
Anurag Chouhan210db072016-02-22 18:42:15 +05301564 qdf_mc_timer_t service_ready_ext_timer;
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -07001565
Varun Reddy Yeturu88f123c2017-03-14 18:24:32 -07001566 QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac,
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001567 roam_offload_synch_ind *roam_synch_data,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -07001568 tpSirBssDescription bss_desc_ptr,
1569 enum sir_roam_op_code reason);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301570 QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001571 roam_offload_synch_ind *roam_synch_data,
1572 tpSirBssDescription bss_desc_ptr);
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301573 qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
1574 qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
Krishna Kumaar Natarajan1ae49112015-11-24 21:43:22 -08001575 uint32_t fine_time_measurement_cap;
Rajeev Kumare5a16822016-07-27 13:11:42 -07001576 bool bpf_enabled;
Anurag Chouhan04dbf6d2016-09-08 15:32:52 +05301577 bool bpf_packet_filter_enable;
Hanumanth Reddy Pothulae87621b2017-04-12 20:53:35 +05301578 enum active_bpf_mode active_uc_bpf_mode;
1579 enum active_bpf_mode active_mc_bc_bpf_mode;
Komal Seelam02d09342016-02-23 18:03:19 +05301580 struct wma_ini_config ini_config;
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301581 struct wma_valid_channels saved_chan;
Deepak Dhamdhere13230d32016-05-26 00:46:53 -07001582 /* NAN datapath support enabled in firmware */
1583 bool nan_datapath_enabled;
Naveen Rawat0fc3f692016-06-22 14:30:54 -07001584 QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
Rajeev Kumarb60abe42017-01-21 15:39:31 -08001585 struct scheduler_msg *msg);
Sandeep Puligillaafa52892016-10-26 19:03:16 -07001586 bool fw_timeout_crash;
Naveen Rawat64e477e2016-05-20 10:34:56 -07001587 bool sub_20_support;
Arif Hussain759a0232017-03-20 13:17:18 -07001588 bool dfs_cac_offload;
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301589 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
1590 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301591 bool rcpi_enabled;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07001592 tSirLLStatsResults *link_stats_results;
Kapil Gupta10800b92017-05-31 19:14:47 +05301593 uint64_t tx_fail_cnt;
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08001594#ifdef WLAN_FEATURE_11AX
1595 struct he_capability he_cap;
1596#endif
Sandeep Puligilla819d94f2017-10-10 18:33:56 -07001597 uint8_t bandcapability;
Nachiket Kukade8b4bfd82017-05-25 18:34:48 +05301598 bool tx_bfee_8ss_enabled;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301599 bool in_imps;
Ashish Kumar Dhanotiya9335d812017-06-30 16:57:20 +05301600 uint8_t ito_repeat_count;
Dustin Brown05557182017-10-12 14:44:49 -07001601 qdf_atomic_t critical_events_in_flight;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602} t_wma_handle, *tp_wma_handle;
1603
1604/**
1605 * struct wma_target_cap - target capabality
1606 * @wmi_service_bitmap: wmi services bitmap
1607 * @wlan_resource_config: resource config
1608 */
1609struct wma_target_cap {
Anurag Chouhance0dc992016-02-16 18:18:03 +05301610 /* wmi services bitmap received from Target */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001611 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
Anurag Chouhance0dc992016-02-16 18:18:03 +05301612 /* default resource config,the os shim can overwrite it */
Mukul Sharmab10c8c72017-11-02 17:25:59 +05301613 target_resource_config wlan_resource_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001614};
1615
1616/**
1617 * struct t_wma_start_req - wma start request parameters
1618 * @pConfigBuffer: config buffer
1619 * @usConfigBufferLen: Length of the config buffer above
1620 * @driver_type: Production or FTM driver
1621 * @pUserData: user data
1622 * @pIndUserData: indication function pointer to send to UMAC
1623 *
1624 * The shared memory between WDI and HAL is 4K so maximum data can be
1625 * transferred from WDI to HAL is 4K
1626 */
1627typedef struct {
1628 void *pConfigBuffer;
1629 uint16_t usConfigBufferLen;
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001630 enum qdf_driver_type driver_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001631 void *pUserData;
1632 void *pIndUserData;
1633} t_wma_start_req;
1634
1635/* Enumeration for Version */
1636typedef enum {
1637 WLAN_HAL_MSG_VERSION0 = 0,
1638 WLAN_HAL_MSG_VERSION1 = 1,
1639 WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
1640 WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
1641} tHalHostMsgVersion;
1642
1643/**
1644 * struct sHalMacStartParameter - mac start request parameters
1645 * @driverType: driver type (production/FTM)
1646 * @uConfigBufferLen: length of config buffer
1647 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301648typedef struct qdf_packed sHalMacStartParameter {
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001649 enum qdf_driver_type driverType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001650 uint32_t uConfigBufferLen;
1651
1652 /* Following this there is a TLV formatted buffer of length
1653 * "uConfigBufferLen" bytes containing all config values.
1654 * The TLV is expected to be formatted like this:
1655 * 0 15 31 31+CFG_LEN-1 length-1
1656 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
1657 */
1658} tHalMacStartParameter, *tpHalMacStartParameter;
1659
Jeff Johnsonf7ab8142017-09-13 09:04:23 -07001660extern void cds_wma_complete_cback(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001661extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
Rajeev Kumar Sirasanagandla873b6d92017-06-06 13:11:17 +05301662 uint16_t regdmn5G, uint8_t ctl2G,
1663 uint8_t ctl5G);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001664/**
1665 * enum frame_index - Frame index
1666 * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
1667 * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
1668 * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
1669 * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
1670 * @FRAME_INDEX_MAX: maximum frame index
1671 */
1672enum frame_index {
1673 GENERIC_NODOWNLD_NOACK_COMP_INDEX,
1674 GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
1675 GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
1676 GENERIC_NODOWLOAD_ACK_COMP_INDEX,
1677 FRAME_INDEX_MAX
1678};
1679
1680/**
1681 * struct wma_tx_ack_work_ctx - tx ack work context
1682 * @wma_handle: wma handle
1683 * @sub_type: sub type
1684 * @status: status
1685 * @ack_cmp_work: work structure
1686 */
1687struct wma_tx_ack_work_ctx {
1688 tp_wma_handle wma_handle;
1689 uint16_t sub_type;
1690 int32_t status;
Anurag Chouhan42958bb2016-02-19 15:43:11 +05301691 qdf_work_t ack_cmp_work;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001692};
1693
1694/**
1695 * struct wma_target_req - target request parameters
1696 * @event_timeout: event timeout
1697 * @node: list
1698 * @user_data: user data
1699 * @msg_type: message type
1700 * @vdev_id: vdev id
1701 * @type: type
1702 */
1703struct wma_target_req {
Anurag Chouhan210db072016-02-22 18:42:15 +05301704 qdf_mc_timer_t event_timeout;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301705 qdf_list_node_t node;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001706 void *user_data;
1707 uint32_t msg_type;
1708 uint8_t vdev_id;
1709 uint8_t type;
1710};
1711
1712/**
1713 * struct wma_vdev_start_req - vdev start request parameters
1714 * @beacon_intval: beacon interval
1715 * @dtim_period: dtim period
1716 * @max_txpow: max tx power
1717 * @chan_offset: channel offset
1718 * @is_dfs: is dfs supported or not
1719 * @vdev_id: vdev id
1720 * @chan: channel
1721 * @oper_mode: operating mode
1722 * @ssid: ssid
1723 * @hidden_ssid: hidden ssid
1724 * @pmf_enabled: is pmf enabled or not
1725 * @vht_capable: VHT capabality
1726 * @ht_capable: HT capabality
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001727 * @dot11_mode: 802.11 mode
1728 * @is_half_rate: is the channel operating at 10MHz
1729 * @is_quarter_rate: is the channel operating at 5MHz
1730 * @preferred_tx_streams: policy manager indicates the preferred
1731 * number of transmit streams
1732 * @preferred_rx_streams: policy manager indicates the preferred
1733 * number of receive streams
Jiachao Wu712d4fd2017-08-23 16:52:34 +08001734 * @beacon_tx_rate: beacon tx rate
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -08001735 * @he_capable: HE capability
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001736 * @he_ops: HE operation
Arif Hussain671a1902017-03-17 09:08:32 -07001737 * @cac_duration_ms: cac duration in milliseconds
1738 * @dfs_regdomain: dfs region
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001739 */
1740struct wma_vdev_start_req {
1741 uint32_t beacon_intval;
1742 uint32_t dtim_period;
1743 int32_t max_txpow;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08001744 enum phy_ch_width chan_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001745 bool is_dfs;
1746 uint8_t vdev_id;
1747 uint8_t chan;
1748 uint8_t oper_mode;
1749 tSirMacSSid ssid;
1750 uint8_t hidden_ssid;
1751 uint8_t pmf_enabled;
1752 uint8_t vht_capable;
1753 uint8_t ch_center_freq_seg0;
1754 uint8_t ch_center_freq_seg1;
1755 uint8_t ht_capable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001756 uint8_t dot11_mode;
1757 bool is_half_rate;
1758 bool is_quarter_rate;
1759 uint32_t preferred_tx_streams;
1760 uint32_t preferred_rx_streams;
Jiachao Wu712d4fd2017-08-23 16:52:34 +08001761 uint16_t beacon_tx_rate;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001762#ifdef WLAN_FEATURE_11AX
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -08001763 bool he_capable;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001764 uint32_t he_ops;
1765#endif
Arif Hussain671a1902017-03-17 09:08:32 -07001766 uint32_t cac_duration_ms;
1767 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001768};
1769
1770/**
1771 * struct wma_set_key_params - set key parameters
1772 * @vdev_id: vdev id
1773 * @def_key_idx: used to see if we have to read the key from cfg
1774 * @key_len: key length
1775 * @peer_mac: peer mac address
1776 * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
1777 * @key_type: key type
1778 * @key_idx: key index
1779 * @unicast: unicast flag
1780 * @key_data: key data
1781 */
1782struct wma_set_key_params {
1783 uint8_t vdev_id;
1784 /* def_key_idx can be used to see if we have to read the key from cfg */
1785 uint32_t def_key_idx;
1786 uint16_t key_len;
1787 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1788 uint8_t singl_tid_rc;
1789 enum eAniEdType key_type;
1790 uint32_t key_idx;
1791 bool unicast;
1792 uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
Krunal Soni8afae9b2017-10-20 20:15:54 -07001793 uint8_t key_rsc[SIR_MAC_MAX_KEY_RSC_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001794};
1795
1796/**
1797 * struct t_thermal_cmd_params - thermal command parameters
1798 * @minTemp: minimum temprature
1799 * @maxTemp: maximum temprature
1800 * @thermalEnable: thermal enable
1801 */
1802typedef struct {
1803 uint16_t minTemp;
1804 uint16_t maxTemp;
1805 uint8_t thermalEnable;
1806} t_thermal_cmd_params, *tp_thermal_cmd_params;
1807
1808/**
1809 * enum wma_cfg_cmd_id - wma cmd ids
1810 * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
1811 * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
1812 * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
1813 * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
1814 * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
1815 * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
1816 * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
1817 * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
1818 * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
1819 * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
1820 * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
1821 * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001822 * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
Yun Park637d6482016-10-05 10:51:33 -07001823 * @WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID: get IPA uC wifi-sharing stats
1824 * @WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID: set IPA uC quota limit
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001825 *
1826 * wma command ids for configuration request which
1827 * does not involve sending a wmi command.
1828 */
1829enum wma_cfg_cmd_id {
1830 WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
1831 WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
1832 WMA_VDEV_MCC_SET_TIME_LATENCY,
1833 WMA_VDEV_MCC_SET_TIME_QUOTA,
1834 WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
1835 WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
1836 WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
1837 WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
1838 WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
1839 WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
1840 WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
1841 WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001842 WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
Yun Park637d6482016-10-05 10:51:33 -07001843 WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID,
1844 WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001845 WMA_CMD_ID_MAX
1846};
1847
1848/**
1849 * struct wma_trigger_uapsd_params - trigger uapsd parameters
1850 * @wmm_ac: wmm access catagory
1851 * @user_priority: user priority
1852 * @service_interval: service interval
1853 * @suspend_interval: suspend interval
1854 * @delay_interval: delay interval
1855 */
1856typedef struct wma_trigger_uapsd_params {
1857 uint32_t wmm_ac;
1858 uint32_t user_priority;
1859 uint32_t service_interval;
1860 uint32_t suspend_interval;
1861 uint32_t delay_interval;
1862} t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
1863
1864/**
1865 * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
1866 * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
1867 * @UAPSD_MAX_SP_LEN_2: max service period = 2
1868 * @UAPSD_MAX_SP_LEN_4: max service period = 4
1869 * @UAPSD_MAX_SP_LEN_6: max service period = 6
1870 */
1871enum uapsd_peer_param_max_sp {
1872 UAPSD_MAX_SP_LEN_UNLIMITED = 0,
1873 UAPSD_MAX_SP_LEN_2 = 2,
1874 UAPSD_MAX_SP_LEN_4 = 4,
1875 UAPSD_MAX_SP_LEN_6 = 6
1876};
1877
1878/**
1879 * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
1880 * @UAPSD_VO_ENABLED: enable uapsd for voice
1881 * @UAPSD_VI_ENABLED: enable uapsd for video
1882 * @UAPSD_BK_ENABLED: enable uapsd for background
1883 * @UAPSD_BE_ENABLED: enable uapsd for best effort
1884 */
1885enum uapsd_peer_param_enabled_ac {
1886 UAPSD_VO_ENABLED = 0x01,
1887 UAPSD_VI_ENABLED = 0x02,
1888 UAPSD_BK_ENABLED = 0x04,
1889 UAPSD_BE_ENABLED = 0x08
1890};
1891
1892/**
Govind Singha471e5e2015-10-12 17:11:14 +05301893 * enum profile_id_t - Firmware profiling index
1894 * @PROF_CPU_IDLE: cpu idle profile
1895 * @PROF_PPDU_PROC: ppdu processing profile
1896 * @PROF_PPDU_POST: ppdu post profile
1897 * @PROF_HTT_TX_INPUT: htt tx input profile
1898 * @PROF_MSDU_ENQ: msdu enqueue profile
1899 * @PROF_PPDU_POST_HAL: ppdu post profile
1900 * @PROF_COMPUTE_TX_TIME: tx time profile
1901 * @PROF_MAX_ID: max profile index
1902 */
1903enum profile_id_t {
1904 PROF_CPU_IDLE,
1905 PROF_PPDU_PROC,
1906 PROF_PPDU_POST,
1907 PROF_HTT_TX_INPUT,
1908 PROF_MSDU_ENQ,
1909 PROF_PPDU_POST_HAL,
1910 PROF_COMPUTE_TX_TIME,
1911 PROF_MAX_ID,
1912};
1913
1914/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001915 * struct p2p_ie - P2P IE structural definition.
1916 * @p2p_id: p2p id
1917 * @p2p_len: p2p length
1918 * @p2p_oui: p2p OUI
1919 * @p2p_oui_type: p2p OUI type
1920 */
1921struct p2p_ie {
1922 uint8_t p2p_id;
1923 uint8_t p2p_len;
1924 uint8_t p2p_oui[3];
1925 uint8_t p2p_oui_type;
1926} __packed;
1927
1928/**
1929 * struct p2p_noa_descriptor - noa descriptor
1930 * @type_count: 255: continuous schedule, 0: reserved
1931 * @duration: Absent period duration in micro seconds
1932 * @interval: Absent period interval in micro seconds
1933 * @start_time: 32 bit tsf time when in starts
1934 */
1935struct p2p_noa_descriptor {
1936 uint8_t type_count;
1937 uint32_t duration;
1938 uint32_t interval;
1939 uint32_t start_time;
1940} __packed;
1941
1942/**
1943 * struct p2p_sub_element_noa - p2p noa element
1944 * @p2p_sub_id: p2p sub id
1945 * @p2p_sub_len: p2p sub length
1946 * @index: identifies instance of NOA su element
1947 * @oppPS: oppPS state of the AP
1948 * @ctwindow: ctwindow in TUs
1949 * @num_descriptors: number of NOA descriptors
1950 * @noa_descriptors: noa descriptors
1951 */
1952struct p2p_sub_element_noa {
1953 uint8_t p2p_sub_id;
1954 uint8_t p2p_sub_len;
1955 uint8_t index; /* identifies instance of NOA su element */
1956 uint8_t oppPS:1, /* oppPS state of the AP */
1957 ctwindow:7; /* ctwindow in TUs */
1958 uint8_t num_descriptors; /* number of NOA descriptors */
1959 struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
1960};
1961
1962/**
1963 * struct wma_decap_info_t - decapsulation info
1964 * @hdr: header
1965 * @hdr_len: header length
1966 */
1967struct wma_decap_info_t {
1968 uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
1969 int32_t hdr_len;
1970};
1971
1972/**
1973 * enum packet_power_save - packet power save params
1974 * @WMI_VDEV_PPS_PAID_MATCH: paid match param
1975 * @WMI_VDEV_PPS_GID_MATCH: gid match param
1976 * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
1977 * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
1978 * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
1979 * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
1980 * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
1981 * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
1982 * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
1983 * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
1984 */
1985typedef enum {
1986 WMI_VDEV_PPS_PAID_MATCH = 0,
1987 WMI_VDEV_PPS_GID_MATCH = 1,
1988 WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
1989 WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
1990 WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
1991 WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
1992 WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
1993 WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
1994 WMI_VDEV_PPS_RSSI_CHECK = 8,
1995 WMI_VDEV_VHT_SET_GID_MGMT = 9,
1996 WMI_VDEV_PPS_5G_EBT = 10
1997} packet_power_save;
1998
1999/**
2000 * enum green_tx_param - green tx parameters
2001 * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
2002 * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
2003 * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
2004 * @WMI_VDEV_PARAM_GTX_THRE: thre param
2005 * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
2006 * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
2007 * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
2008 * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
2009 */
2010typedef enum {
2011 WMI_VDEV_PARAM_GTX_HT_MCS,
2012 WMI_VDEV_PARAM_GTX_VHT_MCS,
2013 WMI_VDEV_PARAM_GTX_USR_CFG,
2014 WMI_VDEV_PARAM_GTX_THRE,
2015 WMI_VDEV_PARAM_GTX_MARGIN,
2016 WMI_VDEV_PARAM_GTX_STEP,
2017 WMI_VDEV_PARAM_GTX_MINTPC,
2018 WMI_VDEV_PARAM_GTX_BW_MASK,
2019} green_tx_param;
2020
2021#ifdef FEATURE_WLAN_TDLS
2022/**
2023 * struct wma_tdls_params - TDLS parameters
2024 * @vdev_id: vdev id
2025 * @tdls_state: TDLS state
2026 * @notification_interval_ms: notification inerval
2027 * @tx_discovery_threshold: tx discovery threshold
2028 * @tx_teardown_threshold: tx teardown threashold
2029 * @rssi_teardown_threshold: RSSI teardown threshold
2030 * @rssi_delta: RSSI delta
2031 * @tdls_options: TDLS options
2032 * @peer_traffic_ind_window: raffic indication window
2033 * @peer_traffic_response_timeout: traffic response timeout
2034 * @puapsd_mask: uapsd mask
2035 * @puapsd_inactivity_time: uapsd inactivity time
2036 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
Kabilan Kannanca670be2015-11-23 01:56:12 -08002037 * @teardown_notification_ms: tdls teardown notification interval
Kabilan Kannan421714b2015-11-23 04:44:59 -08002038 * @tdls_peer_kickout_threshold: tdls packet threshold for
2039 * peer kickout operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002040 */
2041typedef struct wma_tdls_params {
2042 uint32_t vdev_id;
2043 uint32_t tdls_state;
2044 uint32_t notification_interval_ms;
2045 uint32_t tx_discovery_threshold;
2046 uint32_t tx_teardown_threshold;
2047 int32_t rssi_teardown_threshold;
2048 int32_t rssi_delta;
2049 uint32_t tdls_options;
2050 uint32_t peer_traffic_ind_window;
2051 uint32_t peer_traffic_response_timeout;
2052 uint32_t puapsd_mask;
2053 uint32_t puapsd_inactivity_time;
2054 uint32_t puapsd_rx_frame_threshold;
Kabilan Kannanca670be2015-11-23 01:56:12 -08002055 uint32_t teardown_notification_ms;
Kabilan Kannan421714b2015-11-23 04:44:59 -08002056 uint32_t tdls_peer_kickout_threshold;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002057} t_wma_tdls_params;
2058
2059/**
2060 * struct wma_tdls_peer_event - TDLS peer event
2061 * @vdev_id: vdev id
2062 * @peer_macaddr: peer MAC address
2063 * @peer_status: TDLS peer status
2064 * @peer_reason: TDLS peer reason
2065 */
2066typedef struct {
2067 A_UINT32 vdev_id;
2068 wmi_mac_addr peer_macaddr;
2069 A_UINT32 peer_status;
2070 A_UINT32 peer_reason;
2071} wma_tdls_peer_event;
2072
2073#endif /* FEATURE_WLAN_TDLS */
2074
2075/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002076 * enum uapsd_ac - U-APSD Access Categories
2077 * @UAPSD_BE: best effort
2078 * @UAPSD_BK: back ground
2079 * @UAPSD_VI: video
2080 * @UAPSD_VO: voice
2081 */
2082enum uapsd_ac {
2083 UAPSD_BE,
2084 UAPSD_BK,
2085 UAPSD_VI,
2086 UAPSD_VO
2087};
2088
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302089QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002090 uint32_t vdev_id, enum uapsd_ac ac);
2091
2092/**
2093 * enum uapsd_up - U-APSD User Priorities
2094 * @UAPSD_UP_BE: best effort
2095 * @UAPSD_UP_BK: back ground
2096 * @UAPSD_UP_RESV: reserve
2097 * @UAPSD_UP_EE: Excellent Effort
2098 * @UAPSD_UP_CL: Critical Applications
2099 * @UAPSD_UP_VI: video
2100 * @UAPSD_UP_VO: voice
2101 * @UAPSD_UP_NC: Network Control
2102 */
2103enum uapsd_up {
2104 UAPSD_UP_BE,
2105 UAPSD_UP_BK,
2106 UAPSD_UP_RESV,
2107 UAPSD_UP_EE,
2108 UAPSD_UP_CL,
2109 UAPSD_UP_VI,
2110 UAPSD_UP_VO,
2111 UAPSD_UP_NC,
2112 UAPSD_UP_MAX
2113};
2114
2115/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002116 * struct wma_roam_invoke_cmd - roam invoke command
2117 * @vdev_id: vdev id
2118 * @bssid: mac address
2119 * @channel: channel
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002120 * @frame_len: frame length, includs mac header, fixed params and ies
2121 * @frame_buf: buffer contaning probe response or beacon
Krunal Soni332f4af2017-06-01 14:36:17 -07002122 * @is_same_bssid: flag to indicate if roaming is requested for same bssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002123 */
2124struct wma_roam_invoke_cmd {
2125 uint32_t vdev_id;
2126 uint8_t bssid[IEEE80211_ADDR_LEN];
2127 uint32_t channel;
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002128 uint32_t frame_len;
2129 uint8_t *frame_buf;
Krunal Soni332f4af2017-06-01 14:36:17 -07002130 uint8_t is_same_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002131};
2132
2133/**
2134 * struct wma_process_fw_event_params - fw event parameters
2135 * @wmi_handle: wmi handle
2136 * @evt_buf: event buffer
2137 */
2138typedef struct {
2139 void *wmi_handle;
2140 void *evt_buf;
2141} wma_process_fw_event_params;
2142
Govind Singhd76a5b02016-03-08 15:12:14 +05302143int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002144
2145A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
2146 eCsrEncryptionType encr);
2147A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
2148
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302149QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002150 tp_wma_trigger_uapsd_params
2151 trigger_uapsd_params);
2152
2153/* added to get average snr for both data and beacon */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302154QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002155
2156
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302157QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
Leo Chang96464902016-10-28 11:10:54 -07002158 void *tx_rx_vdev_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002159 uint8_t *mac, uint32_t vdev_type, bool add_del);
2160
2161void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
2162void wma_log_completion_timeout(void *data);
2163
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302164QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002165 struct rssi_monitor_req *req);
2166
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302167QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
2168 struct wmi_pcl_chan_weights *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002169
Manishekar Chandrasekarand9640342016-04-27 12:28:26 +05302170QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
Tushnim Bhattacharyya51258a72017-03-13 12:55:02 -07002171 struct policy_mgr_hw_mode *msg);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302172QDF_STATUS wma_get_scan_id(uint32_t *scan_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002173
Manishekar Chandrasekaran5d46f702016-04-27 12:50:52 +05302174QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002175 struct sir_dual_mac_config *msg);
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002176QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
2177 struct sir_antenna_mode_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002178
2179struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
2180 uint8_t vdev_id,
2181 uint32_t msg_type, uint8_t type,
2182 void *params, uint32_t timeout);
2183struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
2184 uint8_t vdev_id, uint32_t msg_type,
2185 uint8_t type, void *params,
2186 uint32_t timeout);
2187
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302188QDF_STATUS wma_vdev_start(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002189 struct wma_vdev_start_req *req, bool isRestart);
2190
2191void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
2192 uint8_t type);
2193
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002194int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
2195 uint32_t len);
Nirav Shah20489972016-06-16 19:20:28 +05302196int wma_mgmt_tx_bundle_completion_handler(void *handle,
2197 uint8_t *cmpl_event_params, uint32_t len);
Naveen Rawatc0c91cd2015-11-05 14:27:37 -08002198uint32_t wma_get_vht_ch_width(void);
Govind Singhd76a5b02016-03-08 15:12:14 +05302199QDF_STATUS
2200wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
2201 A_UINT32 val, A_UINT32 *module_id_bitmap,
2202 A_UINT32 bitmap_len);
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002203#ifdef FEATURE_LFR_SUBNET_DETECTION
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302204QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002205 struct gateway_param_update_req *req);
2206#else
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302207static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002208 struct gateway_param_update_req *req)
2209{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302210 return QDF_STATUS_SUCCESS;
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002211}
2212#endif /* FEATURE_LFR_SUBNET_DETECTION */
2213
Dhanashri Atre09828f12016-11-13 10:36:58 -08002214QDF_STATUS wma_lro_config_cmd(void *handle,
2215 struct cdp_lro_hash_config *wma_lro_cmd);
2216
Dhanashri Atre1f0cbe42015-11-19 10:56:53 -08002217void
2218wma_indicate_err(enum ol_rx_err_type err_type,
2219 struct ol_error_info *err_info);
Sandeep Puligillae0875662016-02-12 16:09:21 -08002220
jiadcd49ec72017-12-05 13:33:11 +08002221/**
2222 * wma_rx_mic_error_ind() - indicate mic error to the protocol stack
2223 * @scn_handle: pdev handle from osif layer
2224 * @vdev_id: vdev id
2225 * @wh: pointer to ieee80211_frame structure
2226 *
2227 * This function indicates TKIP MIC errors encountered in the RX data path
2228 * to the protocol stack
2229 *
2230 * Return: none
2231 */
2232void wma_rx_mic_error_ind(void *scn_handle, uint16_t vdev_id, void *wh);
2233
Sandeep Puligillae0875662016-02-12 16:09:21 -08002234QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
2235 int32_t vdev_id);
Anurag Chouhanbf5e0e22016-09-12 12:54:09 +05302236
2237void wma_process_fw_test_cmd(WMA_HANDLE handle,
2238 struct set_fwtest_params *wma_fwtest);
2239
Sandeep Puligillae0875662016-02-12 16:09:21 -08002240QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
2241 struct obss_ht40_scanind *req);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05302242
2243int wma_get_bpf_caps_event_handler(void *handle,
2244 u_int8_t *cmd_param_info,
2245 u_int32_t len);
Krunal Soniaa664da2016-06-15 23:46:40 -07002246uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05302247QDF_STATUS wma_get_bpf_capabilities(tp_wma_handle wma);
2248QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma,
2249 struct sir_bpf_set_offload *bpf_set_offload);
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002250void wma_process_set_pdev_ie_req(tp_wma_handle wma,
2251 struct set_ie_param *ie_params);
2252void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
2253 struct set_ie_param *ie_params);
2254void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
2255 struct set_ie_param *ie_params);
Mukul Sharma3ba26b82017-01-12 21:59:41 +05302256
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002257void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -07002258 u_int8_t vdev_id, void *peer,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002259 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002260
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -08002261QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
Mukul Sharma00058692017-01-28 19:04:32 +05302262 struct cdp_vdev *vdev, u8 peer_addr[6],
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07002263 u_int32_t peer_type, u_int8_t vdev_id,
2264 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002265
Padma, Santhosh Kumar16dacfb2017-03-21 19:05:40 +05302266/**
2267 * wma_get_cca_stats() - send request to fw to get CCA
2268 * @wmi_hdl: wma handle
2269 * @vdev_id: vdev id
2270 *
2271 * Return: QDF status
2272 */
2273QDF_STATUS wma_get_cca_stats(tp_wma_handle wma_handle,
2274 uint8_t vdev_id);
2275
Komal Seelam02d09342016-02-23 18:03:19 +05302276struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
Abhishek Singh1c676222016-05-09 14:20:28 +05302277WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
2278 u8 dot11_mode);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002279
2280#ifdef FEATURE_OEM_DATA_SUPPORT
2281QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07002282 struct oem_data_req *oem_req);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002283#endif
Selvaraj, Sridharebda0f22016-08-29 16:05:23 +05302284
2285QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
2286 uint8_t val);
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05302287void wma_register_packetdump_callback(
2288 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb,
2289 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb);
2290void wma_deregister_packetdump_callback(void);
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302291void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
2292 struct sme_sta_inactivity_timeout *sta_inactivity_timer);
Leo Chang96464902016-10-28 11:10:54 -07002293void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
2294 uint8_t vdev_id, bool hash_based, uint8_t ring_num);
2295int wma_peer_rx_reorder_queue_setup(void *scn_handle,
2296 uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
2297 int tid, uint16_t queue_no);
2298int wma_peer_rx_reorder_queue_remove(void *scn_handle,
2299 uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302300
2301/**
2302 * wma_form_rx_packet() - form rx cds packet
2303 * @buf: buffer
2304 * @mgmt_rx_params: mgmt rx params
2305 * @rx_pkt: cds packet
2306 *
2307 * This functions forms a cds packet from the rx mgmt frame received.
2308 *
2309 * Return: 0 for success or error code
2310 */
2311int wma_form_rx_packet(qdf_nbuf_t buf,
Himanshu Agarwald2e6cde2017-01-10 14:47:04 +05302312 struct mgmt_rx_event_params *mgmt_rx_params,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302313 cds_pkt_t *rx_pkt);
2314
2315/**
2316 * wma_mgmt_unified_cmd_send() - send the mgmt tx packet
2317 * @vdev: objmgr vdev
2318 * @buf: buffer
2319 * @desc_id: desc id
2320 * @mgmt_tx_params: mgmt rx params
2321 *
2322 * This functions sends mgmt tx packet to WMI layer.
2323 *
2324 * Return: 0 for success or error code
2325 */
2326QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
2327 qdf_nbuf_t buf, uint32_t desc_id,
2328 void *mgmt_tx_params);
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05302329
2330/**
2331 * wma_chan_info_event_handler() - chan info event handler
2332 * @handle: wma handle
2333 * @event_buf: event handler data
2334 * @len: length of @event_buf
2335 *
2336 * this function will handle the WMI_CHAN_INFO_EVENTID
2337 *
2338 * Return: int
2339 */
2340int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
2341 uint32_t len);
Mukul Sharmaf9047232017-03-02 16:58:56 +05302342
2343/**
2344 * wma_vdev_set_mlme_state() - Set vdev mlme state
2345 * @wma: wma handle
2346 * @vdev_id: the Id of the vdev to configure
2347 * @state: vdev state
2348 *
2349 * Return: None
2350 */
2351static inline
2352void wma_vdev_set_mlme_state(tp_wma_handle wma, uint8_t vdev_id,
2353 enum wlan_vdev_state state)
2354{
2355 struct wlan_objmgr_vdev *vdev;
2356
2357 if (!wma) {
2358 WMA_LOGE("%s: WMA context is invald!", __func__);
2359 return;
2360 }
2361
2362 vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
2363 WLAN_LEGACY_WMA_ID);
2364 if (vdev) {
2365 wlan_vdev_obj_lock(vdev);
2366 wlan_vdev_mlme_set_state(vdev, state);
2367 wlan_vdev_obj_unlock(vdev);
2368 wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
2369 }
2370}
Mukul Sharma6411bb82017-03-01 15:57:07 +05302371
2372/**
2373 * wma_update_vdev_pause_bitmap() - update vdev pause bitmap
2374 * @vdev_id: the Id of the vdev to configure
2375 * @value: value pause bitmap value
2376 *
2377 * Return: None
2378 */
2379static inline
2380void wma_vdev_update_pause_bitmap(uint8_t vdev_id, uint16_t value)
2381{
2382 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2383 struct wma_txrx_node *iface;
2384
Mukul Sharma6411bb82017-03-01 15:57:07 +05302385 if (!wma) {
2386 WMA_LOGE("%s: WMA context is invald!", __func__);
2387 return;
2388 }
2389
Amar Singhalef59eee2018-01-02 12:46:35 -08002390 if (vdev_id >= wma->max_bssid) {
2391 WMA_LOGE("%s: Invalid vdev_id: %d", __func__, vdev_id);
2392 return;
2393 }
2394
Mukul Sharma6411bb82017-03-01 15:57:07 +05302395 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002396
2397 if (!iface) {
2398 WMA_LOGE("%s: Failed to get iface: NULL",
2399 __func__);
2400 return;
2401 }
2402
2403 if (!iface->handle) {
2404 WMA_LOGE("%s: Failed to get iface handle: NULL",
2405 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302406 return;
2407 }
2408
2409 iface->pause_bitmap = value;
2410}
2411
2412/**
2413 * wma_vdev_get_pause_bitmap() - Get vdev pause bitmap
2414 * @vdev_id: the Id of the vdev to configure
2415 *
2416 * Return: Vdev pause bitmap value else 0 on error
2417 */
2418static inline
2419uint16_t wma_vdev_get_pause_bitmap(uint8_t vdev_id)
2420{
2421 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2422 struct wma_txrx_node *iface;
2423
2424 if (!wma) {
2425 WMA_LOGE("%s: WMA context is invald!", __func__);
2426 return 0;
2427 }
2428
2429 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002430
2431 if (!iface) {
2432 WMA_LOGE("%s: Failed to get iface: NULL",
2433 __func__);
2434 return 0;
2435 }
2436
2437 if (!iface->handle) {
2438 WMA_LOGE("%s: Failed to get iface handle: NULL",
2439 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302440 return 0;
2441 }
2442
2443 return iface->pause_bitmap;
2444}
2445
2446/**
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302447 * wma_vdev_is_device_in_low_pwr_mode - is device in power save mode
2448 * @vdev_id: the Id of the vdev to configure
2449 *
2450 * Return: true if device is in low power mode else false
2451 */
2452static inline bool wma_vdev_is_device_in_low_pwr_mode(uint8_t vdev_id)
2453{
2454 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2455 struct wma_txrx_node *iface;
2456
2457 if (!wma) {
2458 WMA_LOGE("%s: WMA context is invald!", __func__);
2459 return 0;
2460 }
2461
2462 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002463
2464 if (!iface) {
2465 WMA_LOGE("%s: Failed to get iface: NULL",
2466 __func__);
2467 return 0;
2468 }
2469
2470 if (!iface->handle) {
2471 WMA_LOGE("%s: Failed to get iface handle:NULL",
2472 __func__);
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302473 return 0;
2474 }
2475
2476 return iface->in_bmps || wma->in_imps;
2477}
2478
2479/**
Mukul Sharma6411bb82017-03-01 15:57:07 +05302480 * wma_vdev_set_pause_bit() - Set a bit in vdev pause bitmap
2481 * @vdev_id: the Id of the vdev to configure
2482 * @bit_pos: set bit position in pause bitmap
2483 *
2484 * Return: None
2485 */
2486static inline
2487void wma_vdev_set_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
2488{
2489 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2490 struct wma_txrx_node *iface;
2491
2492 if (!wma) {
2493 WMA_LOGE("%s: WMA context is invald!", __func__);
2494 return;
2495 }
2496
2497 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002498
2499 if (!iface) {
2500 WMA_LOGE("%s: Failed to get iface: NULL",
2501 __func__);
2502 return;
2503 }
2504
2505 if (!iface->handle) {
2506 WMA_LOGE("%s: Failed to get iface handle: NULL",
2507 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302508 return;
2509 }
2510
2511 iface->pause_bitmap |= (1 << bit_pos);
2512}
2513
2514/**
2515 * wma_vdev_clear_pause_bit() - Clear a bit from vdev pause bitmap
2516 * @vdev_id: the Id of the vdev to configure
2517 * @bit_pos: set bit position in pause bitmap
2518 *
2519 * Return: None
2520 */
2521static inline
2522void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
2523{
2524 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2525 struct wma_txrx_node *iface;
2526
2527 if (!wma) {
2528 WMA_LOGE("%s: WMA context is invald!", __func__);
2529 return;
2530 }
2531
2532 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002533
2534 if (!iface) {
2535 WMA_LOGE("%s: Failed to get iface: NULL",
2536 __func__);
2537 return;
2538 }
2539
2540 if (!iface->handle) {
2541 WMA_LOGE("%s: Failed to get iface handle: NULL",
2542 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302543 return;
2544 }
2545
2546 iface->pause_bitmap &= ~(1 << bit_pos);
2547}
2548
Naveen Rawat5c35ae42017-04-18 15:35:07 -07002549/**
2550 * wma_process_roaming_config() - process roam request
2551 * @wma_handle: wma handle
2552 * @roam_req: roam request parameters
2553 *
2554 * Main routine to handle ROAM commands coming from CSR module.
2555 *
2556 * Return: QDF status
2557 */
2558QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
2559 tSirRoamOffloadScanReq *roam_req);
2560
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002561#ifdef WMI_INTERFACE_EVENT_LOGGING
2562static inline void wma_print_wmi_cmd_log(uint32_t count,
2563 qdf_abstract_print *print,
2564 void *print_priv)
2565{
2566 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2567
2568 if (wma)
2569 wmi_print_cmd_log(wma->wmi_handle, count, print, print_priv);
2570}
2571
2572static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
2573 qdf_abstract_print *print,
2574 void *print_priv)
2575{
2576 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2577
2578 if (wma)
2579 wmi_print_cmd_tx_cmp_log(wma->wmi_handle, count, print,
2580 print_priv);
2581}
2582
2583static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
2584 qdf_abstract_print *print,
2585 void *print_priv)
2586{
2587 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2588
2589 if (wma)
2590 wmi_print_mgmt_cmd_log(wma->wmi_handle, count, print,
2591 print_priv);
2592}
2593
2594static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
2595 qdf_abstract_print *print,
2596 void *print_priv)
2597{
2598 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2599
2600 if (wma)
2601 wmi_print_mgmt_cmd_tx_cmp_log(wma->wmi_handle, count, print,
2602 print_priv);
2603}
2604
2605static inline void wma_print_wmi_event_log(uint32_t count,
2606 qdf_abstract_print *print,
2607 void *print_priv)
2608{
2609 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2610
2611 if (wma)
2612 wmi_print_event_log(wma->wmi_handle, count, print, print_priv);
2613}
2614
2615static inline void wma_print_wmi_rx_event_log(uint32_t count,
2616 qdf_abstract_print *print,
2617 void *print_priv)
2618{
2619 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2620
2621 if (wma)
2622 wmi_print_rx_event_log(wma->wmi_handle, count, print,
2623 print_priv);
2624}
2625
2626static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
2627 qdf_abstract_print *print,
2628 void *print_priv)
2629{
2630 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2631
2632 if (wma)
2633 wmi_print_mgmt_event_log(wma->wmi_handle, count, print,
2634 print_priv);
2635}
2636#endif /* WMI_INTERFACE_EVENT_LOGGING */
2637
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07002638/**
2639 * wma_ipa_uc_stat_request() - set ipa config parameters
2640 * @privcmd: private command
2641 *
2642 * Return: None
2643 */
2644void wma_ipa_uc_stat_request(wma_cli_set_cmd_t *privcmd);
2645
lifeng66831662017-05-19 16:01:35 +08002646/**
2647 * wma_set_rx_reorder_timeout_val() - set rx recorder timeout value
2648 * @wma_handle: pointer to wma handle
2649 * @reorder_timeout: rx reorder timeout value
2650 *
2651 * Return: VOS_STATUS_SUCCESS for success or error code.
2652 */
2653QDF_STATUS wma_set_rx_reorder_timeout_val(tp_wma_handle wma_handle,
2654 struct sir_set_rx_reorder_timeout_val *reorder_timeout);
2655
2656/**
2657 * wma_set_rx_blocksize() - set rx blocksize
2658 * @wma_handle: pointer to wma handle
2659 * @peer_rx_blocksize: rx blocksize for peer mac
2660 *
2661 * Return: QDF_STATUS_SUCCESS for success or error code.
2662 */
2663QDF_STATUS wma_set_rx_blocksize(tp_wma_handle wma_handle,
2664 struct sir_peer_set_rx_blocksize *peer_rx_blocksize);
Ashish Kumar Dhanotiyab28338c2017-07-21 20:12:34 +05302665/**
2666 * wma_configure_smps_params() - Configures the smps parameters to set
2667 * @vdev_id: Virtual device for the command
2668 * @param_id: SMPS parameter ID
2669 * @param_val: Value to be set for the parameter
2670 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2671 */
2672QDF_STATUS wma_configure_smps_params(uint32_t vdev_id, uint32_t param_id,
2673 uint32_t param_val);
lifeng66831662017-05-19 16:01:35 +08002674
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302675/*
2676 * wma_chip_power_save_failure_detected_handler() - chip pwr save fail detected
2677 * event handler
2678 * @handle: wma handle
2679 * @cmd_param_info: event handler data
2680 * @len: length of @cmd_param_info
2681 *
2682 * Return: QDF_STATUS_SUCCESS on success; error code otherwise
2683 */
2684int wma_chip_power_save_failure_detected_handler(void *handle,
2685 uint8_t *cmd_param_info,
2686 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08002687
2688/**
2689 * wma_get_chain_rssi() - send wmi cmd to get chain rssi
2690 * @wma_handle: wma handler
2691 * @req_params: requset params
2692 *
2693 * Return: Return QDF_STATUS
2694 */
2695QDF_STATUS wma_get_chain_rssi(tp_wma_handle wma_handle,
2696 struct get_chain_rssi_req_params *req_params);
2697
Nachiket Kukadeaaf8a712017-07-27 19:15:36 +05302698/**
2699 * wma_config_bmiss_bcnt_params() - set bmiss config parameters
2700 * @vdev_id: virtual device for the command
2701 * @first_cnt: bmiss first value
2702 * @final_cnt: bmiss final value
2703 *
2704 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2705 */
2706QDF_STATUS wma_config_bmiss_bcnt_params(uint32_t vdev_id, uint32_t first_cnt,
2707 uint32_t final_cnt);
2708
Naveen Rawatd7734142017-10-27 10:02:40 -07002709/**
2710 * wma_check_and_set_wake_timer(): checks all interfaces and if any interface
2711 * has install_key pending, sets timer pattern in fw to wake up host after
2712 * specified time has elapsed.
2713 * @time: time after which host wants to be awaken.
2714 *
2715 * Return: None
2716 */
2717void wma_check_and_set_wake_timer(uint32_t time);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302718#endif