blob: 8de38dd7e105c19743ea1815027559e1f8fd6e4b [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 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef WMA_H
20#define WMA_H
21
22#include "a_types.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053023#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080024#include "osapi_linux.h"
25#include "htc_packet.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053026#include "i_qdf_event.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080027#include "wmi_services.h"
28#include "wmi_unified.h"
29#include "wmi_version.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053030#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080031#include "cfg_api.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053032#include "qdf_status.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033#include "cds_sched.h"
Varun Reddy Yeturuba1942a2017-06-20 15:32:19 -070034#include "cds_config.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035#include "sir_mac_prot_def.h"
36#include "wma_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080037#include <linux/workqueue.h>
38#include "utils_api.h"
39#include "lim_types.h"
40#include "wmi_unified_api.h"
Dhanashri Atre12a08392016-02-17 13:10:34 -080041#include "cdp_txrx_cmn.h"
Govind Singh8c46db92016-05-10 14:17:16 +053042#include "dbglog.h"
Leo Chang96464902016-10-28 11:10:54 -070043#include "cds_ieee80211_common.h"
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +053044#include "wlan_objmgr_psoc_obj.h"
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080045#include <cdp_txrx_handle.h>
Tushnim Bhattacharyya51258a72017-03-13 12:55:02 -070046#include <wlan_policy_mgr_api.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080047
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080048/* Platform specific configuration for max. no. of fragments */
49#define QCA_OL_11AC_TX_MAX_FRAGS 2
50
51/* Private */
52
Rajeev Kumardaf1c612016-04-05 02:56:41 -070053#define WMA_READY_EVENTID_TIMEOUT 6000
54#define WMA_SERVICE_READY_EXT_TIMEOUT 6000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080055#define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
Dustin Brownd0a76562017-10-13 14:48:37 -070056#define WMA_WAKE_LOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
Yuanyuan Liuc7432032016-11-09 11:34:45 -080057#define WMA_RESUME_TIMEOUT 25000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058#define MAX_MEM_CHUNKS 32
Sandeep Puligilla4a58f7f2017-05-16 16:36:56 -070059#define NAN_CLUSTER_ID_BYTES 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061#define WMA_CRASH_INJECT_TIMEOUT 5000
62
Govind Singhefc5ccd2016-04-25 11:11:55 +053063/* MAC ID to PDEV ID mapping is as given below
64 * MAC_ID PDEV_ID
65 * 0 1
66 * 1 2
67 * SOC Level WMI_PDEV_ID_SOC
68 */
69#define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
70#define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
71
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080072#define WMA_MAX_SUPPORTED_BSS SIR_MAX_SUPPORTED_BSS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080073
Vignesh Viswanathan56f26252017-08-31 15:26:01 +053074#define WMA_MAX_MGMT_MPDU_LEN 2000
75
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080076#define FRAGMENT_SIZE 3072
77
Kapil Gupta10800b92017-05-31 19:14:47 +053078#define MAX_PRINT_FAILURE_CNT 50
79
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080080#define WMA_INVALID_VDEV_ID 0xFF
81#define MAX_MEM_CHUNKS 32
82#define WMA_MAX_VDEV_SIZE 20
83#define WMA_VDEV_TBL_ENTRY_ADD 1
84#define WMA_VDEV_TBL_ENTRY_DEL 0
85
86/* 11A/G channel boundary */
87#define WMA_11A_CHANNEL_BEGIN 34
88#define WMA_11A_CHANNEL_END 165
89#define WMA_11G_CHANNEL_BEGIN 1
90#define WMA_11G_CHANNEL_END 14
91
92#define WMA_11P_CHANNEL_BEGIN (170)
93#define WMA_11P_CHANNEL_END (184)
94
95#define WMA_LOGD(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053096 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097#define WMA_LOGI(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053098 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099#define WMA_LOGW(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530100 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_WARN, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800101#define WMA_LOGE(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530102 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800103#define WMA_LOGP(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530104 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800105
106#define WMA_DEBUG_ALWAYS
107
108#ifdef WMA_DEBUG_ALWAYS
109#define WMA_LOGA(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530110 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800111#else
112#define WMA_LOGA(args ...)
113#endif
114
115#define ALIGNED_WORD_SIZE 4
116#define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
Govind Singhd76a5b02016-03-08 15:12:14 +0530117#define WMA_WILDCARD_PDEV_ID 0x0
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800118
119/* Prefix used by scan req ids generated on the host */
120#define WMA_HOST_SCAN_REQID_PREFIX 0xA000
121/* Prefix used by roam scan req ids generated on the host */
122#define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
123/* Prefix used by scan requestor id on host */
124#define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
125
126#define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
127
128/* Max offchannel duration */
129#define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
130#define WMA_SCAN_NPROBES_DEFAULT (2)
131#define WMA_SCAN_IDLE_TIME_DEFAULT (25)
132#define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
133#define WMA_CTS_DURATION_MS_MAX (32)
134#define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
135#define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
136#define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
137#define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
138#define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
139
140#define WMA_SEC_TO_USEC (1000000)
141
142#define BEACON_TX_BUFFER_SIZE (512)
143
144/* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
145#define WMA_ETHER_TYPE_OFFSET (6 + 6)
146/* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
147#define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
148/* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
149#define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530150/* WMA_IPV4_PROTOCOL = sa(6) + da(6) + eth_type(2) + 9 */
151#define WMA_IPV4_PROTOCOL (6 + 6 + 2 + 9)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800152#define WMA_ICMP_V6_HEADER_TYPE (0x3A)
153#define WMA_ICMP_V6_RA_TYPE (0x86)
154#define WMA_ICMP_V6_NS_TYPE (0x87)
155#define WMA_ICMP_V6_NA_TYPE (0x88)
156#define WMA_BCAST_MAC_ADDR (0xFF)
157#define WMA_MCAST_IPV4_MAC_ADDR (0x01)
158#define WMA_MCAST_IPV6_MAC_ADDR (0x33)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530159#define WMA_ICMP_PROTOCOL (0x01)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160
Himanshu Agarwal82de9042016-07-20 18:11:03 +0530161#define WMA_IS_EAPOL_GET_MIN_LEN 14
162#define WMA_EAPOL_SUBTYPE_GET_MIN_LEN 21
163#define WMA_EAPOL_INFO_GET_MIN_LEN 23
164#define WMA_IS_DHCP_GET_MIN_LEN 38
165#define WMA_DHCP_SUBTYPE_GET_MIN_LEN 0x11D
166#define WMA_DHCP_INFO_GET_MIN_LEN 50
167#define WMA_IS_ARP_GET_MIN_LEN 14
168#define WMA_ARP_SUBTYPE_GET_MIN_LEN 22
169#define WMA_IPV4_PROTO_GET_MIN_LEN 24
170#define WMA_IPV4_PKT_INFO_GET_MIN_LEN 42
171#define WMA_ICMP_SUBTYPE_GET_MIN_LEN 35
172#define WMA_IPV6_PROTO_GET_MIN_LEN 21
173#define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62
174#define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800175
176/* Beacon tx rate */
177#define WMA_BEACON_TX_RATE_1_M 10
178#define WMA_BEACON_TX_RATE_2_M 20
179#define WMA_BEACON_TX_RATE_5_5_M 55
180#define WMA_BEACON_TX_RATE_11_M 110
181#define WMA_BEACON_TX_RATE_6_M 60
182#define WMA_BEACON_TX_RATE_9_M 90
183#define WMA_BEACON_TX_RATE_12_M 120
184#define WMA_BEACON_TX_RATE_18_M 180
185#define WMA_BEACON_TX_RATE_24_M 240
186#define WMA_BEACON_TX_RATE_36_M 360
187#define WMA_BEACON_TX_RATE_48_M 480
188#define WMA_BEACON_TX_RATE_54_M 540
189
Himanshu Agarwaldd356df2016-07-20 19:04:39 +0530190/**
191 * ds_mode: distribution system mode
192 * @IEEE80211_NO_DS: NO DS at either side
193 * @IEEE80211_TO_DS: DS at receiver side
194 * @IEEE80211_FROM_DS: DS at sender side
195 * @IEEE80211_DS_TO_DS: DS at both sender and revceiver side
196 */
197enum ds_mode {
198 IEEE80211_NO_DS,
199 IEEE80211_TO_DS,
200 IEEE80211_FROM_DS,
201 IEEE80211_DS_TO_DS
202};
203
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800204/* Roaming default values
205 * All time and period values are in milliseconds.
206 * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
207 */
208
209#define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
210#define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
211#define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
212#define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
213#define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
214#define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
215#define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
216#define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
217#define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
218#define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
219#define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700220#define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT \
221 (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800222#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
223#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
224#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
225#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
226
227#define WMA_INVALID_KEY_IDX 0xff
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800228
229#define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
230#define WMA_MIN_RF_CHAINS (1)
Abhishek Singh9100cc82017-04-17 11:03:55 +0530231#define WMA_MAX_NSS (2)
232
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233
234#ifdef FEATURE_WLAN_EXTSCAN
235#define WMA_MAX_EXTSCAN_MSG_SIZE 1536
236#define WMA_EXTSCAN_REST_TIME 100
237#define WMA_EXTSCAN_MAX_SCAN_TIME 50000
238#define WMA_EXTSCAN_BURST_DURATION 150
239#endif
240
gaoleze5108942017-03-31 16:56:42 +0800241#define WMA_CHAN_START_RESP 0
242#define WMA_CHAN_END_RESP 1
243
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800244#define WMA_BCN_BUF_MAX_SIZE 2500
245#define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
246#define WMA_MAX_NOA_DESCRIPTORS 4
247
248#define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
249
250#define WMA_WOW_PTRN_MASK_VALID 0xFF
251#define WMA_NUM_BITS_IN_BYTE 8
252
253#define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800254
255#define WMA_BSS_STATUS_STARTED 0x1
256#define WMA_BSS_STATUS_STOPPED 0x2
257
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800258#define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
259#define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
260#define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
261
262#define WMA_PEER_ASSOC_CNF_START 0x01
Sandeep Puligillaafa52892016-10-26 19:03:16 -0700263#define WMA_PEER_ASSOC_TIMEOUT (6000) /* 6 seconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800264
Sandeep Puligilla19ddda22016-01-05 12:18:02 -0800265#define WMA_DELETE_STA_RSP_START 0x02
266#define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
267
268#define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
Sandeep Puligillabbee8172017-04-07 19:26:33 -0700269#define WMA_SET_LINK_PEER_RSP 0x04
Abhishek Singhe8be9a62017-05-30 12:13:29 +0530270#define WMA_DELETE_PEER_RSP 0x05
Tushnim Bhattacharyya86294892017-10-25 16:29:11 -0700271
272#define WMA_PDEV_SET_HW_MODE_RESP 0x06
273
Dustin Brownd0a76562017-10-13 14:48:37 -0700274#define WMA_VDEV_START_REQUEST_TIMEOUT 6000 /* 6s */
275#define WMA_VDEV_STOP_REQUEST_TIMEOUT 6000 /* 6s */
276#define WMA_VDEV_HW_MODE_REQUEST_TIMEOUT 5000 /* 5s */
277#define WMA_VDEV_PLCY_MGR_CMD_TIMEOUT 3000 /* 3s */
278#define WMA_VDEV_SET_KEY_WAKELOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800279
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +0530280#define WMA_TGT_INVALID_SNR (0)
281
Naveen Rawatf440a132017-05-05 12:27:39 -0700282#define WMA_TGT_IS_VALID_SNR(x) ((x) >= 0 && (x) < WMA_TGT_MAX_SNR)
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +0530283#define WMA_TGT_IS_INVALID_SNR(x) (!WMA_TGT_IS_VALID_SNR(x))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800284
285#define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
286#define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
287#define WMA_MAX_NUM_ARGS 8
288
289#define WMA_SMPS_MASK_LOWER_16BITS 0xFF
290#define WMA_SMPS_MASK_UPPER_3BITS 0x7
291#define WMA_SMPS_PARAM_VALUE_S 29
292
293#define WMA_MAX_SCAN_ID 0x00FF
294
295/*
296 * Setting the Tx Comp Timeout to 1 secs.
297 * TODO: Need to Revist the Timing
298 */
299#define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
300#define WMA_TX_FRAME_BUFFER_NO_FREE 0
301#define WMA_TX_FRAME_BUFFER_FREE 1
302
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303/* Default InActivity Time is 200 ms */
304#define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
305
Mukul Sharmaed92f2f2017-04-20 00:06:28 +0530306/* Default WOW InActivity Time is 50 ms */
307#define WOW_POWERSAVE_DEFAULT_INACTIVITY_TIME 50
308
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800309/* Default Listen Interval */
310#define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
311
312/*
313 * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
314 * instead of assigning it to the last valid wmi
315 * cmd+1 to avoid updating this when a command is
316 * added/deleted.
317 */
318#define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
319
320#define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
321#define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
322#define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
323
324/* Default rssi threshold defined in CFG80211 */
325#define WMA_RSSI_THOLD_DEFAULT -300
326
Dustin Brownd0a76562017-10-13 14:48:37 -0700327#define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
328#define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
329#define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
330#define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
yeshwanth sriram guntuka37c09822017-01-24 18:30:15 +0530331#define WMA_ROAM_HO_WAKE_LOCK_DURATION (500) /* in msec */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800332#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Dustin Brownd0a76562017-10-13 14:48:37 -0700333#define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800334#endif
Dustin Brownd0a76562017-10-13 14:48:37 -0700335#define WMA_BMISS_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
336#define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_MAX
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337
338#define WMA_TXMIC_LEN 8
339#define WMA_RXMIC_LEN 8
340
341/*
342 * Length = (2 octets for Index and CTWin/Opp PS) and
343 * (13 octets for each NOA Descriptors)
344 */
345
346#define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
347#define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
348
349#define WMA_P2P_IE_ID 0xdd
350#define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
351#define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
352#define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
353
Jeff Johnsonc97816c2018-05-12 17:13:23 -0700354/* P2P Sub element definitions (according to table 5 of Wifi's P2P spec) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800355#define WMA_P2P_SUB_ELEMENT_STATUS 0
356#define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
357#define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
358#define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
359#define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
360#define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
361#define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
362#define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
363#define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
364#define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
365#define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
366#define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
367#define WMA_P2P_SUB_ELEMENT_NOA 12
368#define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
369#define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
370#define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
371#define WMA_P2P_SUB_ELEMENT_INTERFACE 16
372#define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
373#define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
374#define WMA_P2P_SUB_ELEMENT_VENDOR 221
375
376/* Macros for handling unaligned memory accesses */
377#define P2PIE_PUT_LE16(a, val) \
378 do { \
379 (a)[1] = ((u16) (val)) >> 8; \
380 (a)[0] = ((u16) (val)) & 0xff; \
381 } while (0)
382
383#define P2PIE_PUT_LE32(a, val) \
384 do { \
385 (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
386 (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
387 (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
388 (a)[0] = (u8) (((u32) (val)) & 0xff); \
389 } while (0)
390
391
392#define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
393
394#define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
395#define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800396
397#define WMA_VHT_PPS_PAID_MATCH 1
398#define WMA_VHT_PPS_GID_MATCH 2
399#define WMA_VHT_PPS_DELIM_CRC_FAIL 3
400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800401#define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +0530402#define TWO_THIRD (2/3)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800403
404/**
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530405 * WMA hardware mode list bit-mask definitions.
406 * Bits 4:0, 31:29 are unused.
407 *
408 * The below definitions are added corresponding to WMI DBS HW mode
409 * list to make it independent of firmware changes for WMI definitions.
410 * Currently these definitions have dependency with BIT positions of
411 * the existing WMI macros. Thus, if the BIT positions are changed for
412 * WMI macros, then these macros' BIT definitions are also need to be
413 * changed.
414 */
415#define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
416#define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
417#define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
418#define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
419#define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
420#define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
421#define WMA_HW_MODE_DBS_MODE_BITPOS (7)
422#define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
423#define WMA_HW_MODE_SBS_MODE_BITPOS (5)
424
425#define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \
426 (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
427#define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \
428 (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
429#define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \
430 (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
431#define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \
432 (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
433#define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \
434 (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
435#define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \
436 (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
437#define WMA_HW_MODE_DBS_MODE_MASK \
438 (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS)
439#define WMA_HW_MODE_AGILE_DFS_MODE_MASK \
440 (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
441#define WMA_HW_MODE_SBS_MODE_MASK \
442 (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS)
443
444#define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
445 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value)
446#define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
447 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value)
448#define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
449 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value)
450#define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
451 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value)
452#define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
453 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value)
454#define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
455 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value)
456#define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \
457 WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value)
458#define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
459 WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value)
460#define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \
461 WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value)
462
463#define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
464 ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \
465 WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
466#define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
467 ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \
468 WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
469#define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
470 ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \
471 WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
472#define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
473 ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \
474 WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
475#define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
476 ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \
477 WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
478#define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
479 ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \
480 WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
481#define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \
482 ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \
483 WMA_HW_MODE_DBS_MODE_BITPOS)
484#define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \
485 ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \
486 WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
487#define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \
488 ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \
489 WMA_HW_MODE_SBS_MODE_BITPOS)
490
491
Nitesh Shah0f3fce52016-10-13 22:01:41 +0530492#define WMA_SCAN_END_EVENT (WMI_SCAN_EVENT_COMPLETED | \
493 WMI_SCAN_EVENT_DEQUEUED | \
494 WMI_SCAN_EVENT_START_FAILED)
Sridhar Selvaraj87309212017-06-28 17:41:50 +0530495/*
496 * PROBE_REQ_TX_DELAY
497 * param to specify probe request Tx delay for scans triggered on this VDEV
498 */
499#define PROBE_REQ_TX_DELAY 10
500
501/* PROBE_REQ_TX_TIME_GAP
502 * param to specify the time gap between each set of probe request transmission.
503 * The number of probe requests in each set depends on the ssid_list and,
504 * bssid_list in the scan request. This parameter will get applied only,
505 * for the scans triggered on this VDEV.
506 */
507#define PROBE_REQ_TX_TIME_GAP 20
Nitesh Shah0f3fce52016-10-13 22:01:41 +0530508
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530509/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800510 * struct probeTime_dwellTime - probe time, dwell time map
511 * @dwell_time: dwell time
512 * @probe_time: repeat probe time
513 */
514typedef struct probeTime_dwellTime {
515 uint8_t dwell_time;
516 uint8_t probe_time;
517} t_probeTime_dwellTime;
518
519static const t_probeTime_dwellTime
520 probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
Liangwei Dong271f92f2016-09-28 06:05:08 -0400521 {28, 11}, /* 0 SSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522 {28, 20}, /* 1 SSID */
523 {28, 20}, /* 2 SSID */
524 {28, 20}, /* 3 SSID */
525 {28, 20}, /* 4 SSID */
526 {28, 20}, /* 5 SSID */
527 {28, 20}, /* 6 SSID */
528 {28, 11}, /* 7 SSID */
529 {28, 11}, /* 8 SSID */
530 {28, 11}, /* 9 SSID */
531 {28, 8} /* 10 SSID */
532};
533
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800534typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
535
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +0530536typedef void (*tp_wma_packetdump_cb)(qdf_nbuf_t netbuf,
537 uint8_t status, uint8_t vdev_id, uint8_t type);
538
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800539#ifdef FEATURE_WLAN_TDLS
540/**
Kabilan Kannan421714b2015-11-23 04:44:59 -0800541 * enum t_wma_tdls_mode - TDLS mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800542 * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
543 * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
544 * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
545 * but respond to the peer
546 * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
Kabilan Kannan421714b2015-11-23 04:44:59 -0800547 * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
548 * implicit trigger but only to a peer mac configured by user space.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800549 */
550typedef enum {
551 WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
552 WMA_TDLS_SUPPORT_DISABLED,
553 WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
554 WMA_TDLS_SUPPORT_ENABLED,
Kabilan Kannan421714b2015-11-23 04:44:59 -0800555 WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800556} t_wma_tdls_mode;
557
558/**
559 * enum wma_tdls_peer_notification - TDLS events
560 * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
561 * on tx bytes per second > tx_discover threshold
562 * NB: notification will be re-sent after
563 * discovery_request_interval_ms
564 * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
565 * due to tx bytes per second below
566 * tx_teardown_threshold
567 * NB: this notification sent once
568 * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
569 */
570enum wma_tdls_peer_notification {
571 WMA_TDLS_SHOULD_DISCOVER,
572 WMA_TDLS_SHOULD_TEARDOWN,
573 WMA_TDLS_PEER_DISCONNECTED,
574};
575
576/**
577 * enum wma_tdls_peer_reason - TDLS peer reason
578 * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
579 * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
580 * packet rates < AP rates
581 * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
582 * due to poor RSSI
583 * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
584 * due to offchannel scan
585 * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
586 * due to peer deletion
587 */
588enum wma_tdls_peer_reason {
589 WMA_TDLS_TEARDOWN_REASON_TX,
590 WMA_TDLS_TEARDOWN_REASON_RATE,
591 WMA_TDLS_TEARDOWN_REASON_RSSI,
592 WMA_TDLS_TEARDOWN_REASON_SCAN,
593 WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
594};
595#endif /* FEATURE_WLAN_TDLS */
596
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597/**
Govind Singhd76a5b02016-03-08 15:12:14 +0530598 * enum wma_rx_exec_ctx - wma rx execution context
599 * @WMA_RX_WORK_CTX: work queue context execution
600 * @WMA_RX_TASKLET_CTX: tasklet context execution
601 * @WMA_RX_SERIALIZER_CTX: MC thread context execution
602 *
603 */
604enum wma_rx_exec_ctx {
605 WMA_RX_WORK_CTX,
606 WMA_RX_TASKLET_CTX,
607 WMA_RX_SERIALIZER_CTX
608};
Krunal Soni2e48d012016-05-02 16:55:26 -0700609
610/**
611 * enum wma_phy_idx
612 * @PHY1: to notify caller that PHY1 specific param needed
613 * @PHY2: to notify caller that PHY2 specific param needed
614 * @PHY1_PHY2: to notify caller that both PHY's param needed
615 * Note: Firmware sends phy map in terms of bitmask, so enum
616 * also needs to be defined that way.
617 *
618 * For example, 0x3 = 0011 = BIT0 corresponds to one phy and
619 * BIT1 coresponds to another phy. There is no direct relation between
620 * each bit to particular PHY (ex. PHYA or PHYB).
621 *
622 * In simple terms, 3 means referring both PHYs & 1 or 2 means
623 * referring to either PHYA or PHYB.
624 */
625enum wma_phy_idx {
626 PHY1 = 0x1, /* 0x1 */
627 PHY2, /* 0x2 */
628 PHY1_PHY2, /* 0x3 */
629};
630
Govind Singhd76a5b02016-03-08 15:12:14 +0530631/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800632 * struct wma_mem_chunk - memory chunks
633 * @vaddr: virtual address
634 * @paddr: physical address
635 * @memctx: dma mapped memory
636 * @len: length of data
637 * @req_id: request id
638 *
639 * memory chunck allocated by Host to be managed by FW
640 * used only for low latency interfaces like pcie
641 */
642struct wma_mem_chunk {
643 uint32_t *vaddr;
644 uint32_t paddr;
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -0700645
Anurag Chouhan6d760662016-02-20 16:05:43 +0530646 qdf_dma_mem_context(memctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800647 uint32_t len;
648 uint32_t req_id;
649};
650
651/**
652 * struct p2p_scan_param - p2p scan listen parameters
653 * @scan_id: scan id
654 * @p2p_scan_type: p2p scan type
655 */
656struct p2p_scan_param {
657 uint32_t scan_id;
658 tSirP2pScanType p2p_scan_type;
659};
660
661/**
662 * struct scan_param - scan parameters
663 * @scan_id: scan id
664 * @scan_requestor_id: scan requestor id
665 * @p2p_scan_type: p2p scan type
666 */
667struct scan_param {
668 uint32_t scan_id;
669 uint32_t scan_requestor_id;
670 tSirP2pScanType p2p_scan_type;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -0700671 uint32_t chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800672};
673
674/**
675 * struct beacon_info - structure to store beacon template
676 * @buf: skb ptr
677 * @len: length
678 * @dma_mapped: is it dma mapped or not
679 * @tim_ie_offset: TIM IE offset
680 * @dtim_count: DTIM count
681 * @seq_no: sequence no
682 * @noa_sub_ie: NOA sub IE
683 * @noa_sub_ie_len: NOA sub IE length
684 * @noa_ie: NOA IE
685 * @p2p_ie_offset: p2p IE offset
686 * @lock: lock
687 */
688struct beacon_info {
Nirav Shahcbc6d722016-03-01 16:24:53 +0530689 qdf_nbuf_t buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690 uint32_t len;
691 uint8_t dma_mapped;
692 uint32_t tim_ie_offset;
693 uint8_t dtim_count;
694 uint16_t seq_no;
695 uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
696 uint16_t noa_sub_ie_len;
697 uint8_t *noa_ie;
698 uint16_t p2p_ie_offset;
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530699 qdf_spinlock_t lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800700};
701
702/**
703 * struct beacon_tim_ie - structure to store TIM IE of beacon
704 * @tim_ie: tim ie
705 * @tim_len: tim ie length
706 * @dtim_count: dtim count
707 * @dtim_period: dtim period
708 * @tim_bitctl: tim bit control
709 * @tim_bitmap: tim bitmap
710 */
711struct beacon_tim_ie {
712 uint8_t tim_ie;
713 uint8_t tim_len;
714 uint8_t dtim_count;
715 uint8_t dtim_period;
716 uint8_t tim_bitctl;
717 uint8_t tim_bitmap[1];
718} __ATTRIB_PACK;
719
720/**
721 * struct pps - packet power save parameter
722 * @paid_match_enable: paid match enable
723 * @gid_match_enable: gid match enable
724 * @tim_clear: time clear
725 * @dtim_clear: dtim clear
726 * @eof_delim: eof delim
727 * @mac_match: mac match
728 * @delim_fail: delim fail
729 * @nsts_zero: nsts zero
730 * @rssi_chk: RSSI check
731 * @ebt_5g: ebt 5GHz
732 */
733struct pps {
734 bool paid_match_enable;
735 bool gid_match_enable;
736 bool tim_clear;
737 bool dtim_clear;
738 bool eof_delim;
739 bool mac_match;
740 bool delim_fail;
741 bool nsts_zero;
742 bool rssi_chk;
743 bool ebt_5g;
744};
745
746/**
747 * struct qpower_params - qpower related parameters
748 * @max_ps_poll_cnt: max ps poll count
749 * @max_tx_before_wake: max tx before wake
750 * @spec_ps_poll_wake_interval: ps poll wake interval
751 * @max_spec_nodata_ps_poll: no data ps poll
752 */
753struct qpower_params {
754 uint32_t max_ps_poll_cnt;
755 uint32_t max_tx_before_wake;
756 uint32_t spec_ps_poll_wake_interval;
757 uint32_t max_spec_nodata_ps_poll;
758};
759
760
761/**
762 * struct gtx_config_t - GTX config
763 * @gtxRTMask: for HT and VHT rate masks
764 * @gtxUsrcfg: host request for GTX mask
765 * @gtxPERThreshold: PER Threshold (default: 10%)
766 * @gtxPERMargin: PER margin (default: 2%)
767 * @gtxTPCstep: TCP step (default: 1)
768 * @gtxTPCMin: TCP min (default: 5)
769 * @gtxBWMask: BW mask (20/40/80/160 Mhz)
770 */
771typedef struct {
772 uint32_t gtxRTMask[2];
773 uint32_t gtxUsrcfg;
774 uint32_t gtxPERThreshold;
775 uint32_t gtxPERMargin;
776 uint32_t gtxTPCstep;
777 uint32_t gtxTPCMin;
778 uint32_t gtxBWMask;
779} gtx_config_t;
780
781/**
782 * struct pdev_cli_config_t - store pdev parameters
783 * @ani_enable: ANI is enabled/disable on target
784 * @ani_poll_len: store ANI polling period
785 * @ani_listen_len: store ANI listening period
786 * @ani_ofdm_level: store ANI OFDM immunity level
787 * @ani_cck_level: store ANI CCK immunity level
788 * @cwmenable: Dynamic bw is enable/disable in fw
789 * @txchainmask: tx chain mask
790 * @rxchainmask: rx chain mask
791 * @txpow2g: tx power limit for 2GHz
792 * @txpow5g: tx power limit for 5GHz
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800793 *
794 * This structure stores pdev parameters.
795 * Some of these parameters are set in fw and some
796 * parameters are only maintained in host.
797 */
798typedef struct {
799 uint32_t ani_enable;
800 uint32_t ani_poll_len;
801 uint32_t ani_listen_len;
802 uint32_t ani_ofdm_level;
803 uint32_t ani_cck_level;
804 uint32_t cwmenable;
805 uint32_t cts_cbw;
806 uint32_t txchainmask;
807 uint32_t rxchainmask;
808 uint32_t txpow2g;
809 uint32_t txpow5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800810} pdev_cli_config_t;
811
812/**
813 * struct vdev_cli_config_t - store vdev parameters
814 * @nss: nss width
815 * @ldpc: is ldpc is enable/disable
816 * @tx_stbc: TX STBC is enable/disable
817 * @rx_stbc: RX STBC is enable/disable
818 * @shortgi: short gi is enable/disable
819 * @rtscts_en: RTS/CTS is enable/disable
820 * @chwidth: channel width
821 * @tx_rate: tx rate
822 * @ampdu: ampdu size
823 * @amsdu: amsdu size
824 * @erx_adjust: enable/disable early rx enable
825 * @erx_bmiss_num: target bmiss number per sample
826 * @erx_bmiss_cycle: sample cycle
827 * @erx_slop_step: slop_step value
828 * @erx_init_slop: init slop
829 * @erx_adj_pause: pause adjust enable/disable
830 * @erx_dri_sample: enable/disable drift sample
831 * @pps_params: packet power save parameters
832 * @qpower_params: qpower parameters
833 * @gtx_info: GTX offload info
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700834 * @dcm: DCM enable/disable
Krishna Kumaar Natarajan150cd012017-03-23 12:29:10 -0700835 * @range_ext: HE range extension enable/disable
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836 *
837 * This structure stores vdev parameters.
838 * Some of these parameters are set in fw and some
839 * parameters are only maintained in host.
840 */
841typedef struct {
842 uint32_t nss;
843 uint32_t ldpc;
844 uint32_t tx_stbc;
845 uint32_t rx_stbc;
846 uint32_t shortgi;
847 uint32_t rtscts_en;
848 uint32_t chwidth;
849 uint32_t tx_rate;
850 uint32_t ampdu;
851 uint32_t amsdu;
852 uint32_t erx_adjust;
853 uint32_t erx_bmiss_num;
854 uint32_t erx_bmiss_cycle;
855 uint32_t erx_slop_step;
856 uint32_t erx_init_slop;
857 uint32_t erx_adj_pause;
858 uint32_t erx_dri_sample;
859 struct pps pps_params;
860 struct qpower_params qpower_params;
861 gtx_config_t gtx_info;
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700862#ifdef WLAN_FEATURE_11AX
863 uint8_t dcm;
Krishna Kumaar Natarajan150cd012017-03-23 12:29:10 -0700864 uint8_t range_ext;
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700865#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800866} vdev_cli_config_t;
867
868/**
Mukul Sharma5ff3c582016-09-12 15:23:35 +0530869 * struct wma_version_info - Store wmi version info
870 * @major: wmi major version
871 * @minor: wmi minor version
872 * @revision: wmi revision number
873 */
874struct wma_version_info {
875 u_int32_t major;
876 u_int32_t minor;
877 u_int32_t revision;
878};
879
880/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800881 * struct wma_wow - store wow patterns
882 * @magic_ptrn_enable: magic pattern enable/disable
883 * @wow_enable: wow enable/disable
884 * @wow_enable_cmd_sent: is wow enable command sent to fw
885 * @deauth_enable: is deauth wakeup enable/disable
886 * @disassoc_enable: is disassoc wakeup enable/disable
887 * @bmiss_enable: is bmiss wakeup enable/disable
888 * @gtk_pdev_enable: is GTK based wakeup enable/disable
889 * @gtk_err_enable: is GTK error wakeup enable/disable
890 * @lphb_cache: lphb cache
891 *
892 * This structure stores wow patterns and
893 * wow related parameters in host.
894 */
895struct wma_wow {
896 bool magic_ptrn_enable;
897 bool wow_enable;
898 bool wow_enable_cmd_sent;
899 bool deauth_enable;
900 bool disassoc_enable;
901 bool bmiss_enable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800902 bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800903};
904
905#ifdef WLAN_FEATURE_11W
906#define CMAC_IPN_LEN (6)
907#define WMA_IGTK_KEY_INDEX_4 (4)
908#define WMA_IGTK_KEY_INDEX_5 (5)
909
910/**
911 * struct wma_igtk_ipn_t - GTK IPN info
912 * @ipn: IPN info
913 */
914typedef struct {
915 uint8_t ipn[CMAC_IPN_LEN];
916} wma_igtk_ipn_t;
917
918/**
919 * struct wma_igtk_key_t - GTK key
920 * @key_length: key length
921 * @key: key
922 * @key_id: key id
Himanshu Agarwalfc5d6602018-04-06 17:39:37 +0530923 * @key_cipher: key type
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800924 */
925typedef struct {
926 uint16_t key_length;
Padma, Santhosh Kumar0ab78172017-12-18 19:26:17 +0530927 uint8_t key[CSR_AES_GMAC_256_KEY_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800928
929 /* IPN is maintained per iGTK keyID
930 * 0th index for iGTK keyID = 4;
931 * 1st index for iGTK KeyID = 5
932 */
933 wma_igtk_ipn_t key_id[2];
Padma, Santhosh Kumar0ab78172017-12-18 19:26:17 +0530934 uint32_t key_cipher;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935} wma_igtk_key_t;
936#endif
937
938/**
939 * struct vdev_restart_params_t - vdev restart parameters
940 * @vdev_id: vdev id
941 * @ssid: ssid
942 * @flags: flags
943 * @requestor_id: requestor id
944 * @chan: channel
945 * @hidden_ssid_restart_in_progress: hidden ssid restart flag
946 * @ssidHidden: is ssid hidden or not
947 */
948typedef struct {
949 A_UINT32 vdev_id;
950 wmi_ssid ssid;
951 A_UINT32 flags;
952 A_UINT32 requestor_id;
953 A_UINT32 disable_hw_ack;
954 wmi_channel chan;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +0530955 qdf_atomic_t hidden_ssid_restart_in_progress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800956 uint8_t ssidHidden;
957} vdev_restart_params_t;
958
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +0530959struct roam_synch_frame_ind {
960 uint32_t bcn_probe_rsp_len;
961 uint8_t *bcn_probe_rsp;
962 uint8_t is_beacon;
963 uint32_t reassoc_req_len;
964 uint8_t *reassoc_req;
965 uint32_t reassoc_rsp_len;
966 uint8_t *reassoc_rsp;
967};
968
969
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970/**
971 * struct wma_txrx_node - txrx node
972 * @addr: mac address
973 * @bssid: bssid
974 * @handle: wma handle
975 * @beacon: beacon info
976 * @vdev_restart_params: vdev restart parameters
977 * @config: per vdev config parameters
978 * @scan_info: scan info
979 * @type: type
980 * @sub_type: sub type
981 * @nlo_match_evt_received: is nlo match event received or not
982 * @pno_in_progress: is pno in progress or not
983 * @plm_in_progress: is plm in progress or not
984 * @ptrn_match_enable: is pattern match is enable or not
985 * @num_wow_default_patterns: number of default wow patterns configured for vdev
986 * @num_wow_user_patterns: number of user wow patterns configured for vdev
987 * @conn_state: connection state
988 * @beaconInterval: beacon interval
989 * @llbCoexist: 11b coexist
990 * @shortSlotTimeSupported: is short slot time supported or not
991 * @dtimPeriod: DTIM period
992 * @chanmode: channel mode
993 * @vht_capable: VHT capablity flag
994 * @ht_capable: HT capablity flag
995 * @mhz: channel frequency in KHz
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -0700996 * @chan_width: channel bandwidth
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997 * @vdev_up: is vdev up or not
998 * @tsfadjust: TSF adjust
999 * @addBssStaContext: add bss context
1000 * @aid: association id
1001 * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
1002 * @key: GTK key
1003 * @uapsd_cached_val: uapsd cached value
1004 * @stats_rsp: stats response
1005 * @fw_stats_set: fw stats value
1006 * @del_staself_req: delete sta self request
1007 * @bss_status: bss status
1008 * @rate_flags: rate flags
1009 * @nss: nss value
1010 * @is_channel_switch: is channel switch
1011 * @pause_bitmap: pause bitmap
1012 * @tx_power: tx power in dbm
1013 * @max_tx_power: max tx power in dbm
1014 * @nwType: network type (802.11a/b/g/n/ac)
1015 * @staKeyParams: sta key parameters
1016 * @ps_enabled: is powersave enable/disable
Kiran Kumar Lokere1e8e4f02017-02-02 18:08:44 -08001017 * @restore_dtim_setting: DTIM settings restore flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001018 * @peer_count: peer count
1019 * @roam_synch_in_progress: flag is in progress or not
1020 * @plink_status_req: link status request
1021 * @psnr_req: snr request
1022 * @delay_before_vdev_stop: delay
Mukul Sharma6398b252017-05-01 17:58:12 +05301023 * @override_li: dynamically user configured listen interval
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024 * @tx_streams: number of tx streams can be used by the vdev
1025 * @rx_streams: number of rx streams can be used by the vdev
1026 * @chain_mask: chain mask can be used by the vdev
1027 * @mac_id: the mac on which vdev is on
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301028 * @wep_default_key_idx: wep default index for group key
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301029 * @arp_offload_req: cached arp offload request
1030 * @ns_offload_req: cached ns offload request
Dustin Brown9d797d62017-01-11 16:39:12 -08001031 * @wow_stats: stat counters for WoW related events
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301032 * @rcpi_req: rcpi request
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001033 * It stores parameters per vdev in wma.
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301034 * @in_bmps : Whether bmps for this interface has been enabled
Dustin Brownec2c92e2017-07-26 11:13:49 -07001035 * @vdev_start_wakelock: wakelock to protect vdev start op with firmware
1036 * @vdev_stop_wakelock: wakelock to protect vdev stop op with firmware
Rajeev Kumar155a3e42017-10-10 15:31:17 -07001037 * @vdev_set_key_wakelock: wakelock to protect vdev set key op with firmware
Yeshwanth Sriram Guntukaa3f8d572018-03-14 11:10:23 +05301038 * @channel: channel
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039 */
1040struct wma_txrx_node {
1041 uint8_t addr[IEEE80211_ADDR_LEN];
1042 uint8_t bssid[IEEE80211_ADDR_LEN];
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -08001043 struct cdp_vdev *handle;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001044 struct beacon_info *beacon;
1045 vdev_restart_params_t vdev_restart_params;
1046 vdev_cli_config_t config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001047 uint32_t type;
1048 uint32_t sub_type;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001049#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001050 bool plm_in_progress;
1051#endif
1052 bool ptrn_match_enable;
1053 uint8_t num_wow_default_patterns;
1054 uint8_t num_wow_user_patterns;
1055 bool conn_state;
1056 tSirMacBeaconInterval beaconInterval;
1057 uint8_t llbCoexist;
1058 uint8_t shortSlotTimeSupported;
1059 uint8_t dtimPeriod;
Tushnim Bhattacharyya89710e32018-05-04 13:35:59 -07001060 WMI_HOST_WLAN_PHY_MODE chanmode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061 uint8_t vht_capable;
1062 uint8_t ht_capable;
1063 A_UINT32 mhz;
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -07001064 enum phy_ch_width chan_width;
Selvaraj, Sridhar171e2252016-06-22 22:33:26 +05301065 bool vdev_active;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001066 uint64_t tsfadjust;
1067 void *addBssStaContext;
1068 uint8_t aid;
1069 uint8_t rmfEnabled;
1070#ifdef WLAN_FEATURE_11W
1071 wma_igtk_key_t key;
Himanshu Agarwalfc5d6602018-04-06 17:39:37 +05301072 uint32_t ucast_key_cipher;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073#endif /* WLAN_FEATURE_11W */
1074 uint32_t uapsd_cached_val;
1075 tAniGetPEStatsRsp *stats_rsp;
1076 uint8_t fw_stats_set;
1077 void *del_staself_req;
Abhishek Singh0d74f9e2017-09-26 14:02:42 +05301078 bool is_del_sta_defered;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301079 qdf_atomic_t bss_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001080 uint8_t rate_flags;
1081 uint8_t nss;
1082 bool is_channel_switch;
1083 uint16_t pause_bitmap;
Amar Singhala297bfa2015-10-15 15:07:29 -07001084 int8_t tx_power;
1085 int8_t max_tx_power;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001086 uint32_t nwType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001087 void *staKeyParams;
Kiran Kumar Lokere1e8e4f02017-02-02 18:08:44 -08001088 bool restore_dtim_setting;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001089 uint32_t peer_count;
Min Liua9df1ff2018-02-09 02:44:13 +08001090 qdf_atomic_t fw_peer_count;
Min Liu22202b72018-02-12 14:01:24 +08001091 qdf_event_t fw_peer_delete_completion;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001092 bool roam_synch_in_progress;
1093 void *plink_status_req;
1094 void *psnr_req;
1095 uint8_t delay_before_vdev_stop;
1096#ifdef FEATURE_WLAN_EXTSCAN
1097 bool extscan_in_progress;
1098#endif
1099 uint32_t alt_modulated_dtim;
1100 bool alt_modulated_dtim_enabled;
Mukul Sharma6398b252017-05-01 17:58:12 +05301101 uint32_t override_li;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001102 uint32_t tx_streams;
1103 uint32_t rx_streams;
1104 uint32_t chain_mask;
1105 uint32_t mac_id;
Varun Reddy Yeturu30bc42c2016-02-04 10:07:30 -08001106 bool roaming_in_progress;
Varun Reddy Yeturu5ab47462016-05-08 18:08:11 -07001107 int32_t roam_synch_delay;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07001108 uint8_t nss_2g;
1109 uint8_t nss_5g;
Peng Xu8fdaa492016-06-22 10:20:47 -07001110 bool p2p_lo_in_progress;
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301111 uint8_t wep_default_key_idx;
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301112 tSirHostOffloadReq arp_offload_req;
1113 tSirHostOffloadReq ns_offload_req;
Bhargav Shaha89d3b42016-04-20 13:04:56 +05301114 bool is_vdev_valid;
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08001115#ifndef QCA_SUPPORT_CP_STATS
Dustin Brown9d797d62017-01-11 16:39:12 -08001116 struct sir_vdev_wow_stats wow_stats;
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08001117#endif
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301118 struct sme_rcpi_req *rcpi_req;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001119#ifdef WLAN_FEATURE_11AX
1120 bool he_capable;
1121 uint32_t he_ops;
1122#endif
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301123 bool in_bmps;
Kiran Kumar Lokeref9dc7912017-06-28 18:10:58 -07001124 struct beacon_filter_param beacon_filter;
1125 bool beacon_filter_enabled;
Dustin Brownec2c92e2017-07-26 11:13:49 -07001126 qdf_wake_lock_t vdev_start_wakelock;
1127 qdf_wake_lock_t vdev_stop_wakelock;
Rajeev Kumar155a3e42017-10-10 15:31:17 -07001128 qdf_wake_lock_t vdev_set_key_wakelock;
Padma, Santhosh Kumaraa2433e2017-10-06 14:34:46 +05301129 struct roam_synch_frame_ind roam_synch_frame_ind;
Naveen Rawatd7734142017-10-27 10:02:40 -07001130 bool is_waiting_for_key;
Yeshwanth Sriram Guntukaa3f8d572018-03-14 11:10:23 +05301131 uint8_t channel;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001132};
1133
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134/**
1135 * struct scan_timer_info - scan timer info
1136 * @vdev_id: vdev id
1137 * @scan_id: scan id
1138 */
1139typedef struct {
1140 uint8_t vdev_id;
1141 uint32_t scan_id;
1142} scan_timer_info;
1143
1144/**
1145 * struct ibss_power_save_params - IBSS power save parameters
1146 * @atimWindowLength: ATIM window length
1147 * @isPowerSaveAllowed: is power save allowed
1148 * @isPowerCollapseAllowed: is power collapsed allowed
1149 * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
1150 * @inactivityCount: inactivity count
1151 * @txSPEndInactivityTime: tx SP end inactivity time
1152 * @ibssPsWarmupTime: IBSS power save warm up time
1153 * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
1154 */
1155typedef struct {
1156 uint32_t atimWindowLength;
1157 uint32_t isPowerSaveAllowed;
1158 uint32_t isPowerCollapseAllowed;
1159 uint32_t isAwakeonTxRxEnabled;
1160 uint32_t inactivityCount;
1161 uint32_t txSPEndInactivityTime;
1162 uint32_t ibssPsWarmupTime;
1163 uint32_t ibssPs1RxChainInAtimEnable;
1164} ibss_power_save_params;
1165
1166/**
Nitesh Shah877ad5d2016-09-22 19:27:58 +05301167 * struct mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC
1168 * @mac_tx_stream: Max TX stream
1169 * @mac_rx_stream: Max RX stream
1170 * @mac_bw: Max bandwidth
1171 */
1172struct mac_ss_bw_info {
1173 uint32_t mac_tx_stream;
1174 uint32_t mac_rx_stream;
1175 uint32_t mac_bw;
1176};
1177
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178/**
Komal Seelam02d09342016-02-23 18:03:19 +05301179 * struct wma_ini_config - Structure to hold wma ini configuration
1180 * @max_no_of_peers: Max Number of supported
1181 *
1182 * Placeholder for WMA ini parameters.
1183 */
1184struct wma_ini_config {
1185 uint8_t max_no_of_peers;
1186};
1187
1188/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301189 * struct wmi_valid_channels - Channel details part of WMI_SCAN_CHAN_LIST_CMDID
1190 * @num_channels: Number of channels
1191 * @channel_list: Channel list
1192 */
1193struct wma_valid_channels {
1194 uint8_t num_channels;
1195 uint8_t channel_list[MAX_NUM_CHAN];
1196};
1197
Krunal Soni2e48d012016-05-02 16:55:26 -07001198/**
1199 * struct hw_mode_idx_to_mac_cap_idx - map between hw_mode to capabilities
1200 * @num_of_macs: number of macs/PHYs for given hw_mode through hw_mode_id
1201 * @mac_cap_idx: index of the mac/PHY for given hw_mode through hw_mode_id
1202 * @hw_mode_id: given hw_mode id
1203 */
1204struct hw_mode_idx_to_mac_cap_idx {
1205 uint8_t num_of_macs;
1206 uint8_t mac_cap_idx;
1207 uint8_t hw_mode_id;
1208};
1209
1210/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001211 * struct t_wma_handle - wma context
1212 * @wmi_handle: wmi handle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001213 * @cds_context: cds handle
1214 * @mac_context: mac context
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301215 * @psoc: psoc context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001216 * @wma_resume_event: wma resume event
1217 * @target_suspend: target suspend event
1218 * @recovery_event: wma FW recovery event
1219 * @max_station: max stations
1220 * @max_bssid: max bssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001221 * @driver_type: driver type
1222 * @myaddr: current mac address
1223 * @hwaddr: mac address from EEPROM
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001224 * @lpss_support: LPSS feature is supported in target or not
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08001225 * @egap_support: Enhanced Green AP support flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001226 * @wmi_ready: wmi status flag
1227 * @wlan_init_status: wlan init status
Anurag Chouhanf04e84f2016-03-03 10:12:12 +05301228 * @qdf_dev: qdf device
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001229 * @wmi_service_bitmap: wmi services bitmap received from Target
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001230 * @frameTransRequired: frame transmission required
1231 * @wmaGlobalSystemRole: global system role
1232 * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
1233 * @tx_frm_download_comp_event: Event to wait for tx download completion
1234 * @tx_queue_empty_event: wait for tx queue to get flushed
1235 * @umac_ota_ack_cb: Ack Complete Callback registered by umac
1236 * @umac_data_ota_ack_cb: ack complete callback
1237 * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
1238 * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
1239 * @needShutdown: is shutdown needed or not
1240 * @num_mem_chunks: number of memory chunk
1241 * @mem_chunks: memory chunks
1242 * @tgt_cfg_update_cb: configuration update callback
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001243 * @reg_cap: regulatory capablities
1244 * @scan_id: scan id
1245 * @interfaces: txrx nodes(per vdev)
1246 * @pdevconfig: pdev related configrations
1247 * @vdev_resp_queue: vdev response queue
1248 * @vdev_respq_lock: vdev response queue lock
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001249 * @vht_supp_mcs: VHT supported MCS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001250 * @is_fw_assert: is fw asserted
1251 * @wow: wow related patterns & parameters
1252 * @no_of_suspend_ind: number of suspend indications
1253 * @no_of_resume_ind: number of resume indications
1254 * @mArpInfo: arp info
1255 * @powersave_mode: power save mode
1256 * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
1257 * @pGetRssiReq: get RSSI request
1258 * @thermal_mgmt_info: Thermal mitigation related info
1259 * @roam_offload_enabled: is roam offload enable/disable
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001260 * @ssdp: ssdp flag
Komal Seelam9764a842016-05-24 11:07:23 +05301261 * @enable_mc_list : To Check if Multicast list filtering is enabled in FW
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001262 * @ibss_started: is IBSS started or not
1263 * @ibsskey_info: IBSS key info
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264 * @hddTxFailCb: tx fail indication callback
1265 * @pno_wake_lock: PNO wake lock
1266 * @extscan_wake_lock: extscan wake lock
1267 * @wow_wake_lock: wow wake lock
Mukul Sharmae44d0542017-05-23 21:50:56 +05301268 * @wow_auth_req_wl: wow wake lock for auth req
1269 * @wow_assoc_req_wl: wow wake lock for assoc req
1270 * @wow_deauth_rec_wl: wow wake lock for deauth req
1271 * @wow_disassoc_rec_wl: wow wake lock for disassoc req
1272 * @wow_ap_assoc_lost_wl: wow wake lock for assoc lost req
1273 * @wow_auto_shutdown_wl: wow wake lock for shutdown req
1274 * @roam_ho_wl: wake lock for roam handoff req
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001275 * @wow_nack: wow negative ack flag
1276 * @ap_client_cnt: ap client count
1277 * @is_wow_bus_suspended: is wow bus suspended flag
1278 * @wma_scan_comp_timer: scan completion timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001279 * @suitable_ap_hb_failure: better ap found
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301280 * @suitable_ap_hb_failure_rssi: record the RSSI when suitable_ap_hb_failure
1281 * for later usage to report RSSI at beacon miss scenario
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001282 * @wma_ibss_power_save_params: IBSS Power Save config Parameters
1283 * @IsRArateLimitEnabled: RA rate limiti s enabled or not
1284 * @RArateLimitInterval: RA rate limit interval
1285 * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
1286 * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
1287 * @staMaxLIModDtim: station max listen interval
1288 * @staModDtim: station mode DTIM
1289 * @staDynamicDtim: station dynamic DTIM
1290 * @enable_mhf_offload: is MHF offload enable/disable
1291 * @last_mhf_entries_timestamp: timestamp when last entries where set
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001292 * @hw_bd_id: hardware board id
1293 * @hw_bd_info: hardware board info
1294 * @in_d0wow: D0WOW is enable/disable
1295 * @miracast_value: miracast value
1296 * @log_completion_timer: log completion timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001297 * @num_dbs_hw_modes: Number of HW modes supported by the FW
1298 * @dbs_mode: DBS HW mode list
1299 * @old_hw_mode_index: Previous configured HW mode index
1300 * @new_hw_mode_index: Current configured HW mode index
Krunal Soni2e48d012016-05-02 16:55:26 -07001301 * @extended_caps phy_caps: extended caps per hw mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001302 * @peer_authorized_cb: peer authorized hdd callback
1303 * @ocb_callback: callback to OCB commands
1304 * @ocb_resp: response to OCB commands
1305 * @wow_pno_match_wake_up_count: PNO match wake up count
1306 * @wow_pno_complete_wake_up_count: PNO complete wake up count
1307 * @wow_gscan_wake_up_count: Gscan wake up count
1308 * @wow_low_rssi_wake_up_count: Low rssi wake up count
1309 * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
1310 * @wow_ucast_wake_up_count: WoW unicast packet wake up count
1311 * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
1312 * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
1313 * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
1314 * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
1315 * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
1316 * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05301317 * @wow_icmpv4_count: WoW ipv4 icmp packet wake up count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05301318 * @wow_icmpv6_count: WoW ipv6 icmp packet wake up count
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001319 * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
1320 *
1321 * @max_scan: maximum scan requests than can be queued
1322 * This structure is global wma context
1323 * It contains global wma module parameters and
1324 * handle of other modules.
Nachiket Kukadee547a482018-05-22 16:43:30 +05301325 * @apf_packet_filter_enable: APF filter enabled or not
1326 * @active_uc_apf_mode: Setting that determines how APF is applied in active
Hanumanth Reddy Pothulae87621b2017-04-12 20:53:35 +05301327 * mode for uc packets
Nachiket Kukadee547a482018-05-22 16:43:30 +05301328 * @active_mc_bc_apf_mode: Setting that determines how APF is applied in
Hanumanth Reddy Pothulae87621b2017-04-12 20:53:35 +05301329 * active mode for MC/BC packets
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001330 * @service_ready_ext_evt: Wait event for service ready ext
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001331 * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
1332 * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301333 * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
Arif Hussaind54b62c2018-03-01 13:31:37 -08001334 * @is_dfs_offloaded: dfs and cac timer offload
Sandeep Puligilla819d94f2017-10-10 18:33:56 -07001335 * @bandcapability: band capability configured through ini
Ashish Kumar Dhanotiya9335d812017-06-30 16:57:20 +05301336 * @ito_repeat_count: Indicates ito repeated count
Dustin Brown05557182017-10-12 14:44:49 -07001337 * @critical_events_in_flight: number of suspend preventing events in flight
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001338 */
1339typedef struct {
1340 void *wmi_handle;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001341 void *cds_context;
1342 void *mac_context;
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301343 struct wlan_objmgr_psoc *psoc;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07001344 struct wlan_objmgr_pdev *pdev;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301345 qdf_event_t wma_resume_event;
1346 qdf_event_t target_suspend;
1347 qdf_event_t runtime_suspend;
1348 qdf_event_t recovery_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001349 uint16_t max_station;
1350 uint16_t max_bssid;
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001351 enum qdf_driver_type driver_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001352 uint8_t myaddr[IEEE80211_ADDR_LEN];
1353 uint8_t hwaddr[IEEE80211_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001354#ifdef WLAN_FEATURE_LPSS
1355 uint8_t lpss_support;
1356#endif
1357 uint8_t ap_arpns_support;
1358 bool wmi_ready;
1359 uint32_t wlan_init_status;
Anurag Chouhandf2b2682016-02-29 14:15:27 +05301360 qdf_device_t qdf_dev;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001361 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
Vignesh Viswanathan731186f2017-09-18 13:47:37 +05301362 uint32_t wmi_service_ext_offset;
1363 uint32_t wmi_service_ext_bitmap[WMI_SERVICE_SEGMENT_BM_SIZE32];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001364 uint32_t frameTransRequired;
1365 tBssSystemRole wmaGlobalSystemRole;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301366 wma_tx_dwnld_comp_callback tx_frm_download_comp_cb;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301367 qdf_event_t tx_frm_download_comp_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001368 /*
1369 * Dummy event to wait for draining MSDUs left in hardware tx
1370 * queue and before requesting VDEV_STOP. Nobody will set this
1371 * and wait will timeout, and code will poll the pending tx
1372 * descriptors number to be zero.
1373 */
Anurag Chouhance0dc992016-02-16 18:18:03 +05301374 qdf_event_t tx_queue_empty_event;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301375 wma_tx_ota_comp_callback umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
1376 wma_tx_ota_comp_callback umac_data_ota_ack_cb;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301377 unsigned long last_umac_data_ota_timestamp;
Nirav Shahcbc6d722016-03-01 16:24:53 +05301378 qdf_nbuf_t last_umac_data_nbuf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001379 bool needShutdown;
1380 uint32_t num_mem_chunks;
Govind Singhf25a0f12016-03-08 16:09:48 +05301381 struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001382 wma_tgt_cfg_cb tgt_cfg_update_cb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001383 HAL_REG_CAPABILITIES reg_cap;
1384 uint32_t scan_id;
1385 struct wma_txrx_node *interfaces;
1386 pdev_cli_config_t pdevconfig;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301387 qdf_list_t vdev_resp_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301388 qdf_spinlock_t vdev_respq_lock;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301389 qdf_list_t wma_hold_req_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301390 qdf_spinlock_t wma_hold_req_q_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001391 uint32_t vht_supp_mcs;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001392 uint8_t is_fw_assert;
1393 struct wma_wow wow;
1394 uint8_t no_of_suspend_ind;
1395 uint8_t no_of_resume_ind;
1396 /* Have a back up of arp info to send along
1397 * with ns info suppose if ns also enabled
1398 */
1399 tSirHostOffloadReq mArpInfo;
1400 struct wma_tx_ack_work_ctx *ack_work_ctx;
1401 uint8_t powersave_mode;
1402 bool ptrn_match_enable_all_vdev;
1403 void *pGetRssiReq;
Will Huanga9814592017-05-24 15:47:58 +08001404 bool get_one_peer_info;
1405 bool get_sta_peer_info;
1406 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001407 t_thermal_mgmt thermal_mgmt_info;
1408 bool roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001409 bool ssdp;
Komal Seelam9764a842016-05-24 11:07:23 +05301410 bool enable_mc_list;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001411 uint8_t ibss_started;
1412 tSetBssKeyParams ibsskey_info;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001413 txFailIndCallback hddTxFailCb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001414#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301415 qdf_wake_lock_t extscan_wake_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001416#endif
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301417 qdf_wake_lock_t wow_wake_lock;
Mukul Sharmae44d0542017-05-23 21:50:56 +05301418 qdf_wake_lock_t wow_auth_req_wl;
1419 qdf_wake_lock_t wow_assoc_req_wl;
1420 qdf_wake_lock_t wow_deauth_rec_wl;
1421 qdf_wake_lock_t wow_disassoc_rec_wl;
1422 qdf_wake_lock_t wow_ap_assoc_lost_wl;
1423 qdf_wake_lock_t wow_auto_shutdown_wl;
1424 qdf_wake_lock_t roam_ho_wl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001425 int wow_nack;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301426 qdf_atomic_t is_wow_bus_suspended;
Anurag Chouhan210db072016-02-22 18:42:15 +05301427 qdf_mc_timer_t wma_scan_comp_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001428 bool suitable_ap_hb_failure;
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301429 uint32_t suitable_ap_hb_failure_rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001430 ibss_power_save_params wma_ibss_power_save_params;
1431#ifdef FEATURE_WLAN_RA_FILTERING
1432 bool IsRArateLimitEnabled;
1433 uint16_t RArateLimitInterval;
1434#endif
1435#ifdef WLAN_FEATURE_LPSS
1436 bool is_lpass_enabled;
1437#endif
1438#ifdef WLAN_FEATURE_NAN
1439 bool is_nan_enabled;
1440#endif
1441 uint8_t staMaxLIModDtim;
1442 uint8_t staModDtim;
1443 uint8_t staDynamicDtim;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001444 uint8_t enable_mhf_offload;
1445 unsigned long last_mhf_entries_timestamp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001446 uint32_t hw_bd_id;
1447 uint32_t hw_bd_info[HW_BD_INFO_SIZE];
1448 uint32_t miracast_value;
Anurag Chouhan210db072016-02-22 18:42:15 +05301449 qdf_mc_timer_t log_completion_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001450 uint32_t num_dbs_hw_modes;
1451 struct dbs_hw_mode_info hw_mode;
1452 uint32_t old_hw_mode_index;
1453 uint32_t new_hw_mode_index;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301454 qdf_atomic_t scan_id_counter;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001455 wma_peer_authorized_fp peer_authorized_cb;
Dustin Brown9d797d62017-01-11 16:39:12 -08001456 uint32_t wow_unspecified_wake_count;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001457
1458 /* OCB request contexts */
1459 struct sir_ocb_config *ocb_config_req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001460 uint8_t max_scan;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001461 uint16_t self_gen_frm_pwr;
1462 bool tx_chain_mask_cck;
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +05301463 /* Going with a timer instead of wait event because on receiving the
1464 * service ready event, we will be waiting on the MC thread for the
1465 * service extended ready event which is also processed in MC thread.
1466 * This leads to MC thread being stuck. Alternative was to process
1467 * these events in tasklet/workqueue context. But, this leads to
1468 * race conditions when the events are processed in two different
1469 * context. So, processing ready event and extended ready event in
1470 * the serialized MC thread context with a timer.
1471 */
Anurag Chouhan210db072016-02-22 18:42:15 +05301472 qdf_mc_timer_t service_ready_ext_timer;
Manikandan Mohan1dd8b5d2017-04-18 15:54:09 -07001473
Varun Reddy Yeturu88f123c2017-03-14 18:24:32 -07001474 QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac,
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001475 roam_offload_synch_ind *roam_synch_data,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -07001476 tpSirBssDescription bss_desc_ptr,
1477 enum sir_roam_op_code reason);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301478 QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001479 roam_offload_synch_ind *roam_synch_data,
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -08001480 tpSirBssDescription bss_desc_ptr,
1481 enum sir_roam_op_code reason);
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301482 qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
1483 qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
Nachiket Kukadee547a482018-05-22 16:43:30 +05301484 bool apf_enabled;
1485 bool apf_packet_filter_enable;
1486 enum active_apf_mode active_uc_apf_mode;
1487 enum active_apf_mode active_mc_bc_apf_mode;
Komal Seelam02d09342016-02-23 18:03:19 +05301488 struct wma_ini_config ini_config;
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301489 struct wma_valid_channels saved_chan;
Deepak Dhamdhere13230d32016-05-26 00:46:53 -07001490 /* NAN datapath support enabled in firmware */
1491 bool nan_datapath_enabled;
Naveen Rawat0fc3f692016-06-22 14:30:54 -07001492 QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
Rajeev Kumarb60abe42017-01-21 15:39:31 -08001493 struct scheduler_msg *msg);
Sandeep Puligillaafa52892016-10-26 19:03:16 -07001494 bool fw_timeout_crash;
Naveen Rawat64e477e2016-05-20 10:34:56 -07001495 bool sub_20_support;
Arif Hussaind54b62c2018-03-01 13:31:37 -08001496 bool is_dfs_offloaded;
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301497 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
1498 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05301499 bool rcpi_enabled;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07001500 tSirLLStatsResults *link_stats_results;
Kapil Gupta10800b92017-05-31 19:14:47 +05301501 uint64_t tx_fail_cnt;
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08001502#ifdef WLAN_FEATURE_11AX
1503 struct he_capability he_cap;
1504#endif
Sandeep Puligilla819d94f2017-10-10 18:33:56 -07001505 uint8_t bandcapability;
Nachiket Kukade8b4bfd82017-05-25 18:34:48 +05301506 bool tx_bfee_8ss_enabled;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05301507 bool in_imps;
Ashish Kumar Dhanotiya9335d812017-06-30 16:57:20 +05301508 uint8_t ito_repeat_count;
gaurank kathpalia85f8a612018-02-21 18:55:24 +05301509 qdf_mc_timer_t wma_fw_time_sync_timer;
Dustin Brown05557182017-10-12 14:44:49 -07001510 qdf_atomic_t critical_events_in_flight;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001511} t_wma_handle, *tp_wma_handle;
1512
1513/**
1514 * struct wma_target_cap - target capabality
1515 * @wmi_service_bitmap: wmi services bitmap
1516 * @wlan_resource_config: resource config
1517 */
1518struct wma_target_cap {
Anurag Chouhance0dc992016-02-16 18:18:03 +05301519 /* wmi services bitmap received from Target */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001520 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
Anurag Chouhance0dc992016-02-16 18:18:03 +05301521 /* default resource config,the os shim can overwrite it */
Mukul Sharmab10c8c72017-11-02 17:25:59 +05301522 target_resource_config wlan_resource_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001523};
1524
1525/**
1526 * struct t_wma_start_req - wma start request parameters
1527 * @pConfigBuffer: config buffer
1528 * @usConfigBufferLen: Length of the config buffer above
1529 * @driver_type: Production or FTM driver
1530 * @pUserData: user data
1531 * @pIndUserData: indication function pointer to send to UMAC
1532 *
1533 * The shared memory between WDI and HAL is 4K so maximum data can be
1534 * transferred from WDI to HAL is 4K
1535 */
1536typedef struct {
1537 void *pConfigBuffer;
1538 uint16_t usConfigBufferLen;
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001539 enum qdf_driver_type driver_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001540 void *pUserData;
1541 void *pIndUserData;
1542} t_wma_start_req;
1543
1544/* Enumeration for Version */
1545typedef enum {
1546 WLAN_HAL_MSG_VERSION0 = 0,
1547 WLAN_HAL_MSG_VERSION1 = 1,
1548 WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
1549 WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
1550} tHalHostMsgVersion;
1551
1552/**
1553 * struct sHalMacStartParameter - mac start request parameters
1554 * @driverType: driver type (production/FTM)
1555 * @uConfigBufferLen: length of config buffer
1556 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301557typedef struct qdf_packed sHalMacStartParameter {
Srinivas Girigowda35b00312017-06-27 21:52:03 -07001558 enum qdf_driver_type driverType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001559 uint32_t uConfigBufferLen;
1560
1561 /* Following this there is a TLV formatted buffer of length
1562 * "uConfigBufferLen" bytes containing all config values.
1563 * The TLV is expected to be formatted like this:
1564 * 0 15 31 31+CFG_LEN-1 length-1
1565 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
1566 */
1567} tHalMacStartParameter, *tpHalMacStartParameter;
1568
Jeff Johnsonf7ab8142017-09-13 09:04:23 -07001569extern void cds_wma_complete_cback(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001570extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
Rajeev Kumar Sirasanagandla873b6d92017-06-06 13:11:17 +05301571 uint16_t regdmn5G, uint8_t ctl2G,
1572 uint8_t ctl5G);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001573/**
1574 * enum frame_index - Frame index
1575 * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
1576 * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
1577 * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
1578 * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
1579 * @FRAME_INDEX_MAX: maximum frame index
1580 */
1581enum frame_index {
1582 GENERIC_NODOWNLD_NOACK_COMP_INDEX,
1583 GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
1584 GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
1585 GENERIC_NODOWLOAD_ACK_COMP_INDEX,
1586 FRAME_INDEX_MAX
1587};
1588
1589/**
1590 * struct wma_tx_ack_work_ctx - tx ack work context
1591 * @wma_handle: wma handle
1592 * @sub_type: sub type
1593 * @status: status
1594 * @ack_cmp_work: work structure
1595 */
1596struct wma_tx_ack_work_ctx {
1597 tp_wma_handle wma_handle;
1598 uint16_t sub_type;
1599 int32_t status;
Anurag Chouhan42958bb2016-02-19 15:43:11 +05301600 qdf_work_t ack_cmp_work;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001601};
1602
1603/**
1604 * struct wma_target_req - target request parameters
1605 * @event_timeout: event timeout
1606 * @node: list
1607 * @user_data: user data
1608 * @msg_type: message type
1609 * @vdev_id: vdev id
1610 * @type: type
1611 */
1612struct wma_target_req {
Anurag Chouhan210db072016-02-22 18:42:15 +05301613 qdf_mc_timer_t event_timeout;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301614 qdf_list_node_t node;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001615 void *user_data;
1616 uint32_t msg_type;
1617 uint8_t vdev_id;
1618 uint8_t type;
1619};
1620
1621/**
1622 * struct wma_vdev_start_req - vdev start request parameters
1623 * @beacon_intval: beacon interval
1624 * @dtim_period: dtim period
1625 * @max_txpow: max tx power
1626 * @chan_offset: channel offset
1627 * @is_dfs: is dfs supported or not
1628 * @vdev_id: vdev id
1629 * @chan: channel
1630 * @oper_mode: operating mode
1631 * @ssid: ssid
1632 * @hidden_ssid: hidden ssid
1633 * @pmf_enabled: is pmf enabled or not
1634 * @vht_capable: VHT capabality
1635 * @ht_capable: HT capabality
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001636 * @dot11_mode: 802.11 mode
1637 * @is_half_rate: is the channel operating at 10MHz
1638 * @is_quarter_rate: is the channel operating at 5MHz
1639 * @preferred_tx_streams: policy manager indicates the preferred
1640 * number of transmit streams
1641 * @preferred_rx_streams: policy manager indicates the preferred
1642 * number of receive streams
Jiachao Wu712d4fd2017-08-23 16:52:34 +08001643 * @beacon_tx_rate: beacon tx rate
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -08001644 * @he_capable: HE capability
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001645 * @he_ops: HE operation
Arif Hussain671a1902017-03-17 09:08:32 -07001646 * @cac_duration_ms: cac duration in milliseconds
1647 * @dfs_regdomain: dfs region
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001648 */
1649struct wma_vdev_start_req {
1650 uint32_t beacon_intval;
1651 uint32_t dtim_period;
1652 int32_t max_txpow;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08001653 enum phy_ch_width chan_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001654 bool is_dfs;
1655 uint8_t vdev_id;
1656 uint8_t chan;
1657 uint8_t oper_mode;
1658 tSirMacSSid ssid;
1659 uint8_t hidden_ssid;
1660 uint8_t pmf_enabled;
1661 uint8_t vht_capable;
1662 uint8_t ch_center_freq_seg0;
1663 uint8_t ch_center_freq_seg1;
1664 uint8_t ht_capable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001665 uint8_t dot11_mode;
1666 bool is_half_rate;
1667 bool is_quarter_rate;
1668 uint32_t preferred_tx_streams;
1669 uint32_t preferred_rx_streams;
Jiachao Wu712d4fd2017-08-23 16:52:34 +08001670 uint16_t beacon_tx_rate;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001671#ifdef WLAN_FEATURE_11AX
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -08001672 bool he_capable;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001673 uint32_t he_ops;
1674#endif
Arif Hussain671a1902017-03-17 09:08:32 -07001675 uint32_t cac_duration_ms;
1676 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001677};
1678
1679/**
1680 * struct wma_set_key_params - set key parameters
1681 * @vdev_id: vdev id
1682 * @def_key_idx: used to see if we have to read the key from cfg
1683 * @key_len: key length
1684 * @peer_mac: peer mac address
1685 * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
1686 * @key_type: key type
1687 * @key_idx: key index
1688 * @unicast: unicast flag
1689 * @key_data: key data
1690 */
1691struct wma_set_key_params {
1692 uint8_t vdev_id;
1693 /* def_key_idx can be used to see if we have to read the key from cfg */
1694 uint32_t def_key_idx;
1695 uint16_t key_len;
1696 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1697 uint8_t singl_tid_rc;
1698 enum eAniEdType key_type;
1699 uint32_t key_idx;
1700 bool unicast;
1701 uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
Krunal Soni8afae9b2017-10-20 20:15:54 -07001702 uint8_t key_rsc[SIR_MAC_MAX_KEY_RSC_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001703};
1704
1705/**
1706 * struct t_thermal_cmd_params - thermal command parameters
1707 * @minTemp: minimum temprature
1708 * @maxTemp: maximum temprature
1709 * @thermalEnable: thermal enable
1710 */
1711typedef struct {
1712 uint16_t minTemp;
1713 uint16_t maxTemp;
1714 uint8_t thermalEnable;
1715} t_thermal_cmd_params, *tp_thermal_cmd_params;
1716
1717/**
1718 * enum wma_cfg_cmd_id - wma cmd ids
1719 * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
1720 * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
1721 * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
1722 * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
1723 * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
1724 * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
1725 * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
1726 * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
1727 * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
1728 * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
1729 * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
1730 * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001731 * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
Yun Park637d6482016-10-05 10:51:33 -07001732 * @WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID: get IPA uC wifi-sharing stats
1733 * @WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID: set IPA uC quota limit
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001734 *
1735 * wma command ids for configuration request which
1736 * does not involve sending a wmi command.
1737 */
1738enum wma_cfg_cmd_id {
1739 WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
1740 WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
1741 WMA_VDEV_MCC_SET_TIME_LATENCY,
1742 WMA_VDEV_MCC_SET_TIME_QUOTA,
1743 WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
1744 WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
1745 WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
1746 WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
1747 WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
1748 WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
1749 WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
1750 WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001751 WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
Yun Park637d6482016-10-05 10:51:33 -07001752 WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID,
1753 WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001754 WMA_CMD_ID_MAX
1755};
1756
1757/**
1758 * struct wma_trigger_uapsd_params - trigger uapsd parameters
Jeff Johnsonc97816c2018-05-12 17:13:23 -07001759 * @wmm_ac: wmm access category
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001760 * @user_priority: user priority
1761 * @service_interval: service interval
1762 * @suspend_interval: suspend interval
1763 * @delay_interval: delay interval
1764 */
1765typedef struct wma_trigger_uapsd_params {
1766 uint32_t wmm_ac;
1767 uint32_t user_priority;
1768 uint32_t service_interval;
1769 uint32_t suspend_interval;
1770 uint32_t delay_interval;
1771} t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
1772
1773/**
1774 * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
1775 * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
1776 * @UAPSD_MAX_SP_LEN_2: max service period = 2
1777 * @UAPSD_MAX_SP_LEN_4: max service period = 4
1778 * @UAPSD_MAX_SP_LEN_6: max service period = 6
1779 */
1780enum uapsd_peer_param_max_sp {
1781 UAPSD_MAX_SP_LEN_UNLIMITED = 0,
1782 UAPSD_MAX_SP_LEN_2 = 2,
1783 UAPSD_MAX_SP_LEN_4 = 4,
1784 UAPSD_MAX_SP_LEN_6 = 6
1785};
1786
1787/**
1788 * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
1789 * @UAPSD_VO_ENABLED: enable uapsd for voice
1790 * @UAPSD_VI_ENABLED: enable uapsd for video
1791 * @UAPSD_BK_ENABLED: enable uapsd for background
1792 * @UAPSD_BE_ENABLED: enable uapsd for best effort
1793 */
1794enum uapsd_peer_param_enabled_ac {
1795 UAPSD_VO_ENABLED = 0x01,
1796 UAPSD_VI_ENABLED = 0x02,
1797 UAPSD_BK_ENABLED = 0x04,
1798 UAPSD_BE_ENABLED = 0x08
1799};
1800
1801/**
Govind Singha471e5e2015-10-12 17:11:14 +05301802 * enum profile_id_t - Firmware profiling index
1803 * @PROF_CPU_IDLE: cpu idle profile
1804 * @PROF_PPDU_PROC: ppdu processing profile
1805 * @PROF_PPDU_POST: ppdu post profile
1806 * @PROF_HTT_TX_INPUT: htt tx input profile
1807 * @PROF_MSDU_ENQ: msdu enqueue profile
1808 * @PROF_PPDU_POST_HAL: ppdu post profile
1809 * @PROF_COMPUTE_TX_TIME: tx time profile
1810 * @PROF_MAX_ID: max profile index
1811 */
1812enum profile_id_t {
1813 PROF_CPU_IDLE,
1814 PROF_PPDU_PROC,
1815 PROF_PPDU_POST,
1816 PROF_HTT_TX_INPUT,
1817 PROF_MSDU_ENQ,
1818 PROF_PPDU_POST_HAL,
1819 PROF_COMPUTE_TX_TIME,
1820 PROF_MAX_ID,
1821};
1822
1823/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001824 * struct p2p_ie - P2P IE structural definition.
1825 * @p2p_id: p2p id
1826 * @p2p_len: p2p length
1827 * @p2p_oui: p2p OUI
1828 * @p2p_oui_type: p2p OUI type
1829 */
1830struct p2p_ie {
1831 uint8_t p2p_id;
1832 uint8_t p2p_len;
1833 uint8_t p2p_oui[3];
1834 uint8_t p2p_oui_type;
1835} __packed;
1836
1837/**
1838 * struct p2p_noa_descriptor - noa descriptor
1839 * @type_count: 255: continuous schedule, 0: reserved
1840 * @duration: Absent period duration in micro seconds
1841 * @interval: Absent period interval in micro seconds
1842 * @start_time: 32 bit tsf time when in starts
1843 */
1844struct p2p_noa_descriptor {
1845 uint8_t type_count;
1846 uint32_t duration;
1847 uint32_t interval;
1848 uint32_t start_time;
1849} __packed;
1850
1851/**
1852 * struct p2p_sub_element_noa - p2p noa element
1853 * @p2p_sub_id: p2p sub id
1854 * @p2p_sub_len: p2p sub length
1855 * @index: identifies instance of NOA su element
1856 * @oppPS: oppPS state of the AP
1857 * @ctwindow: ctwindow in TUs
1858 * @num_descriptors: number of NOA descriptors
1859 * @noa_descriptors: noa descriptors
1860 */
1861struct p2p_sub_element_noa {
1862 uint8_t p2p_sub_id;
1863 uint8_t p2p_sub_len;
1864 uint8_t index; /* identifies instance of NOA su element */
1865 uint8_t oppPS:1, /* oppPS state of the AP */
1866 ctwindow:7; /* ctwindow in TUs */
1867 uint8_t num_descriptors; /* number of NOA descriptors */
1868 struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
1869};
1870
1871/**
1872 * struct wma_decap_info_t - decapsulation info
1873 * @hdr: header
1874 * @hdr_len: header length
1875 */
1876struct wma_decap_info_t {
1877 uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
1878 int32_t hdr_len;
1879};
1880
1881/**
1882 * enum packet_power_save - packet power save params
1883 * @WMI_VDEV_PPS_PAID_MATCH: paid match param
1884 * @WMI_VDEV_PPS_GID_MATCH: gid match param
1885 * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
1886 * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
1887 * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
1888 * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
1889 * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
1890 * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
1891 * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
1892 * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
1893 */
1894typedef enum {
1895 WMI_VDEV_PPS_PAID_MATCH = 0,
1896 WMI_VDEV_PPS_GID_MATCH = 1,
1897 WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
1898 WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
1899 WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
1900 WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
1901 WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
1902 WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
1903 WMI_VDEV_PPS_RSSI_CHECK = 8,
1904 WMI_VDEV_VHT_SET_GID_MGMT = 9,
1905 WMI_VDEV_PPS_5G_EBT = 10
1906} packet_power_save;
1907
1908/**
1909 * enum green_tx_param - green tx parameters
1910 * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
1911 * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
1912 * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
1913 * @WMI_VDEV_PARAM_GTX_THRE: thre param
1914 * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
1915 * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
1916 * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
1917 * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
1918 */
1919typedef enum {
1920 WMI_VDEV_PARAM_GTX_HT_MCS,
1921 WMI_VDEV_PARAM_GTX_VHT_MCS,
1922 WMI_VDEV_PARAM_GTX_USR_CFG,
1923 WMI_VDEV_PARAM_GTX_THRE,
1924 WMI_VDEV_PARAM_GTX_MARGIN,
1925 WMI_VDEV_PARAM_GTX_STEP,
1926 WMI_VDEV_PARAM_GTX_MINTPC,
1927 WMI_VDEV_PARAM_GTX_BW_MASK,
1928} green_tx_param;
1929
1930#ifdef FEATURE_WLAN_TDLS
1931/**
1932 * struct wma_tdls_params - TDLS parameters
1933 * @vdev_id: vdev id
1934 * @tdls_state: TDLS state
1935 * @notification_interval_ms: notification inerval
1936 * @tx_discovery_threshold: tx discovery threshold
1937 * @tx_teardown_threshold: tx teardown threashold
1938 * @rssi_teardown_threshold: RSSI teardown threshold
1939 * @rssi_delta: RSSI delta
1940 * @tdls_options: TDLS options
1941 * @peer_traffic_ind_window: raffic indication window
1942 * @peer_traffic_response_timeout: traffic response timeout
1943 * @puapsd_mask: uapsd mask
1944 * @puapsd_inactivity_time: uapsd inactivity time
1945 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
Kabilan Kannanca670be2015-11-23 01:56:12 -08001946 * @teardown_notification_ms: tdls teardown notification interval
Kabilan Kannan421714b2015-11-23 04:44:59 -08001947 * @tdls_peer_kickout_threshold: tdls packet threshold for
1948 * peer kickout operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001949 */
1950typedef struct wma_tdls_params {
1951 uint32_t vdev_id;
1952 uint32_t tdls_state;
1953 uint32_t notification_interval_ms;
1954 uint32_t tx_discovery_threshold;
1955 uint32_t tx_teardown_threshold;
1956 int32_t rssi_teardown_threshold;
1957 int32_t rssi_delta;
1958 uint32_t tdls_options;
1959 uint32_t peer_traffic_ind_window;
1960 uint32_t peer_traffic_response_timeout;
1961 uint32_t puapsd_mask;
1962 uint32_t puapsd_inactivity_time;
1963 uint32_t puapsd_rx_frame_threshold;
Kabilan Kannanca670be2015-11-23 01:56:12 -08001964 uint32_t teardown_notification_ms;
Kabilan Kannan421714b2015-11-23 04:44:59 -08001965 uint32_t tdls_peer_kickout_threshold;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001966} t_wma_tdls_params;
1967
1968/**
1969 * struct wma_tdls_peer_event - TDLS peer event
1970 * @vdev_id: vdev id
1971 * @peer_macaddr: peer MAC address
1972 * @peer_status: TDLS peer status
1973 * @peer_reason: TDLS peer reason
1974 */
1975typedef struct {
1976 A_UINT32 vdev_id;
1977 wmi_mac_addr peer_macaddr;
1978 A_UINT32 peer_status;
1979 A_UINT32 peer_reason;
1980} wma_tdls_peer_event;
1981
1982#endif /* FEATURE_WLAN_TDLS */
1983
1984/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001985 * enum uapsd_ac - U-APSD Access Categories
1986 * @UAPSD_BE: best effort
1987 * @UAPSD_BK: back ground
1988 * @UAPSD_VI: video
1989 * @UAPSD_VO: voice
1990 */
1991enum uapsd_ac {
1992 UAPSD_BE,
1993 UAPSD_BK,
1994 UAPSD_VI,
1995 UAPSD_VO
1996};
1997
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301998QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001999 uint32_t vdev_id, enum uapsd_ac ac);
2000
2001/**
2002 * enum uapsd_up - U-APSD User Priorities
2003 * @UAPSD_UP_BE: best effort
2004 * @UAPSD_UP_BK: back ground
2005 * @UAPSD_UP_RESV: reserve
2006 * @UAPSD_UP_EE: Excellent Effort
2007 * @UAPSD_UP_CL: Critical Applications
2008 * @UAPSD_UP_VI: video
2009 * @UAPSD_UP_VO: voice
2010 * @UAPSD_UP_NC: Network Control
2011 */
2012enum uapsd_up {
2013 UAPSD_UP_BE,
2014 UAPSD_UP_BK,
2015 UAPSD_UP_RESV,
2016 UAPSD_UP_EE,
2017 UAPSD_UP_CL,
2018 UAPSD_UP_VI,
2019 UAPSD_UP_VO,
2020 UAPSD_UP_NC,
2021 UAPSD_UP_MAX
2022};
2023
2024/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002025 * struct wma_roam_invoke_cmd - roam invoke command
2026 * @vdev_id: vdev id
2027 * @bssid: mac address
2028 * @channel: channel
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002029 * @frame_len: frame length, includs mac header, fixed params and ies
2030 * @frame_buf: buffer contaning probe response or beacon
Krunal Soni332f4af2017-06-01 14:36:17 -07002031 * @is_same_bssid: flag to indicate if roaming is requested for same bssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002032 */
2033struct wma_roam_invoke_cmd {
2034 uint32_t vdev_id;
2035 uint8_t bssid[IEEE80211_ADDR_LEN];
2036 uint32_t channel;
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002037 uint32_t frame_len;
2038 uint8_t *frame_buf;
Krunal Soni332f4af2017-06-01 14:36:17 -07002039 uint8_t is_same_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002040};
2041
2042/**
2043 * struct wma_process_fw_event_params - fw event parameters
2044 * @wmi_handle: wmi handle
2045 * @evt_buf: event buffer
2046 */
2047typedef struct {
2048 void *wmi_handle;
2049 void *evt_buf;
2050} wma_process_fw_event_params;
2051
Govind Singhd76a5b02016-03-08 15:12:14 +05302052int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002053
2054A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
2055 eCsrEncryptionType encr);
2056A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
2057
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302058QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002059 tp_wma_trigger_uapsd_params
2060 trigger_uapsd_params);
2061
2062/* added to get average snr for both data and beacon */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302063QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002064
2065
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302066QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
Leo Chang96464902016-10-28 11:10:54 -07002067 void *tx_rx_vdev_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002068 uint8_t *mac, uint32_t vdev_type, bool add_del);
2069
2070void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
2071void wma_log_completion_timeout(void *data);
2072
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302073QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002074 struct rssi_monitor_req *req);
2075
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302076QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
2077 struct wmi_pcl_chan_weights *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002078
Manishekar Chandrasekarand9640342016-04-27 12:28:26 +05302079QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
Tushnim Bhattacharyya51258a72017-03-13 12:55:02 -07002080 struct policy_mgr_hw_mode *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002081
Manishekar Chandrasekaran5d46f702016-04-27 12:50:52 +05302082QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle,
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -08002083 struct policy_mgr_dual_mac_config *msg);
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002084QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
2085 struct sir_antenna_mode_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002086
2087struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
2088 uint8_t vdev_id,
2089 uint32_t msg_type, uint8_t type,
2090 void *params, uint32_t timeout);
2091struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
2092 uint8_t vdev_id, uint32_t msg_type,
2093 uint8_t type, void *params,
2094 uint32_t timeout);
2095
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302096QDF_STATUS wma_vdev_start(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002097 struct wma_vdev_start_req *req, bool isRestart);
2098
2099void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
2100 uint8_t type);
2101
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002102int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
2103 uint32_t len);
Nirav Shah20489972016-06-16 19:20:28 +05302104int wma_mgmt_tx_bundle_completion_handler(void *handle,
2105 uint8_t *cmpl_event_params, uint32_t len);
Naveen Rawatc0c91cd2015-11-05 14:27:37 -08002106uint32_t wma_get_vht_ch_width(void);
Govind Singhd76a5b02016-03-08 15:12:14 +05302107QDF_STATUS
2108wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
2109 A_UINT32 val, A_UINT32 *module_id_bitmap,
2110 A_UINT32 bitmap_len);
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002111#ifdef FEATURE_LFR_SUBNET_DETECTION
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302112QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002113 struct gateway_param_update_req *req);
2114#else
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302115static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002116 struct gateway_param_update_req *req)
2117{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302118 return QDF_STATUS_SUCCESS;
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002119}
2120#endif /* FEATURE_LFR_SUBNET_DETECTION */
2121
Dhanashri Atre09828f12016-11-13 10:36:58 -08002122QDF_STATUS wma_lro_config_cmd(void *handle,
2123 struct cdp_lro_hash_config *wma_lro_cmd);
2124
Dhanashri Atre1f0cbe42015-11-19 10:56:53 -08002125void
2126wma_indicate_err(enum ol_rx_err_type err_type,
2127 struct ol_error_info *err_info);
Sandeep Puligillae0875662016-02-12 16:09:21 -08002128
jiadcd49ec72017-12-05 13:33:11 +08002129/**
2130 * wma_rx_mic_error_ind() - indicate mic error to the protocol stack
2131 * @scn_handle: pdev handle from osif layer
2132 * @vdev_id: vdev id
2133 * @wh: pointer to ieee80211_frame structure
2134 *
2135 * This function indicates TKIP MIC errors encountered in the RX data path
2136 * to the protocol stack
2137 *
2138 * Return: none
2139 */
2140void wma_rx_mic_error_ind(void *scn_handle, uint16_t vdev_id, void *wh);
2141
Sandeep Puligillae0875662016-02-12 16:09:21 -08002142QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
2143 int32_t vdev_id);
Anurag Chouhanbf5e0e22016-09-12 12:54:09 +05302144
2145void wma_process_fw_test_cmd(WMA_HANDLE handle,
2146 struct set_fwtest_params *wma_fwtest);
2147
Sandeep Puligillae0875662016-02-12 16:09:21 -08002148QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
2149 struct obss_ht40_scanind *req);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05302150
Nachiket Kukadee547a482018-05-22 16:43:30 +05302151int wma_get_apf_caps_event_handler(void *handle,
2152 u_int8_t *cmd_param_info,
2153 u_int32_t len);
Krunal Soniaa664da2016-06-15 23:46:40 -07002154uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask);
Nachiket Kukadee547a482018-05-22 16:43:30 +05302155QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma);
2156QDF_STATUS
2157wma_set_apf_instructions(tp_wma_handle wma,
2158 struct sir_apf_set_offload *apf_set_offload);
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002159void wma_process_set_pdev_ie_req(tp_wma_handle wma,
2160 struct set_ie_param *ie_params);
2161void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
2162 struct set_ie_param *ie_params);
2163void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
2164 struct set_ie_param *ie_params);
Mukul Sharma3ba26b82017-01-12 21:59:41 +05302165
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002166void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -07002167 u_int8_t vdev_id, void *peer,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002168 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002169
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -08002170QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
Mukul Sharma00058692017-01-28 19:04:32 +05302171 struct cdp_vdev *vdev, u8 peer_addr[6],
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07002172 u_int32_t peer_type, u_int8_t vdev_id,
2173 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002174
Padma, Santhosh Kumar16dacfb2017-03-21 19:05:40 +05302175/**
2176 * wma_get_cca_stats() - send request to fw to get CCA
2177 * @wmi_hdl: wma handle
2178 * @vdev_id: vdev id
2179 *
2180 * Return: QDF status
2181 */
2182QDF_STATUS wma_get_cca_stats(tp_wma_handle wma_handle,
2183 uint8_t vdev_id);
2184
Komal Seelam02d09342016-02-23 18:03:19 +05302185struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
Abhishek Singh1c676222016-05-09 14:20:28 +05302186WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
2187 u8 dot11_mode);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002188
2189#ifdef FEATURE_OEM_DATA_SUPPORT
2190QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07002191 struct oem_data_req *oem_req);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002192#endif
Selvaraj, Sridharebda0f22016-08-29 16:05:23 +05302193
2194QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
2195 uint8_t val);
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05302196void wma_register_packetdump_callback(
2197 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb,
2198 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb);
2199void wma_deregister_packetdump_callback(void);
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302200void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
2201 struct sme_sta_inactivity_timeout *sta_inactivity_timer);
Leo Chang96464902016-10-28 11:10:54 -07002202void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
2203 uint8_t vdev_id, bool hash_based, uint8_t ring_num);
2204int wma_peer_rx_reorder_queue_setup(void *scn_handle,
2205 uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
2206 int tid, uint16_t queue_no);
2207int wma_peer_rx_reorder_queue_remove(void *scn_handle,
2208 uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302209
2210/**
2211 * wma_form_rx_packet() - form rx cds packet
2212 * @buf: buffer
2213 * @mgmt_rx_params: mgmt rx params
2214 * @rx_pkt: cds packet
2215 *
2216 * This functions forms a cds packet from the rx mgmt frame received.
2217 *
2218 * Return: 0 for success or error code
2219 */
2220int wma_form_rx_packet(qdf_nbuf_t buf,
Himanshu Agarwald2e6cde2017-01-10 14:47:04 +05302221 struct mgmt_rx_event_params *mgmt_rx_params,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302222 cds_pkt_t *rx_pkt);
2223
2224/**
2225 * wma_mgmt_unified_cmd_send() - send the mgmt tx packet
2226 * @vdev: objmgr vdev
2227 * @buf: buffer
2228 * @desc_id: desc id
2229 * @mgmt_tx_params: mgmt rx params
2230 *
2231 * This functions sends mgmt tx packet to WMI layer.
2232 *
2233 * Return: 0 for success or error code
2234 */
2235QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
2236 qdf_nbuf_t buf, uint32_t desc_id,
2237 void *mgmt_tx_params);
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05302238
2239/**
2240 * wma_chan_info_event_handler() - chan info event handler
2241 * @handle: wma handle
2242 * @event_buf: event handler data
2243 * @len: length of @event_buf
2244 *
2245 * this function will handle the WMI_CHAN_INFO_EVENTID
2246 *
2247 * Return: int
2248 */
2249int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
2250 uint32_t len);
Mukul Sharmaf9047232017-03-02 16:58:56 +05302251
2252/**
2253 * wma_vdev_set_mlme_state() - Set vdev mlme state
2254 * @wma: wma handle
2255 * @vdev_id: the Id of the vdev to configure
2256 * @state: vdev state
2257 *
2258 * Return: None
2259 */
2260static inline
2261void wma_vdev_set_mlme_state(tp_wma_handle wma, uint8_t vdev_id,
2262 enum wlan_vdev_state state)
2263{
2264 struct wlan_objmgr_vdev *vdev;
2265
2266 if (!wma) {
2267 WMA_LOGE("%s: WMA context is invald!", __func__);
2268 return;
2269 }
2270
2271 vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
2272 WLAN_LEGACY_WMA_ID);
2273 if (vdev) {
2274 wlan_vdev_obj_lock(vdev);
2275 wlan_vdev_mlme_set_state(vdev, state);
2276 wlan_vdev_obj_unlock(vdev);
2277 wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
2278 }
2279}
Mukul Sharma6411bb82017-03-01 15:57:07 +05302280
2281/**
2282 * wma_update_vdev_pause_bitmap() - update vdev pause bitmap
2283 * @vdev_id: the Id of the vdev to configure
2284 * @value: value pause bitmap value
2285 *
2286 * Return: None
2287 */
2288static inline
2289void wma_vdev_update_pause_bitmap(uint8_t vdev_id, uint16_t value)
2290{
2291 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2292 struct wma_txrx_node *iface;
2293
Mukul Sharma6411bb82017-03-01 15:57:07 +05302294 if (!wma) {
2295 WMA_LOGE("%s: WMA context is invald!", __func__);
2296 return;
2297 }
2298
Amar Singhalef59eee2018-01-02 12:46:35 -08002299 if (vdev_id >= wma->max_bssid) {
2300 WMA_LOGE("%s: Invalid vdev_id: %d", __func__, vdev_id);
2301 return;
2302 }
2303
Mukul Sharma6411bb82017-03-01 15:57:07 +05302304 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002305
2306 if (!iface) {
2307 WMA_LOGE("%s: Failed to get iface: NULL",
2308 __func__);
2309 return;
2310 }
2311
2312 if (!iface->handle) {
2313 WMA_LOGE("%s: Failed to get iface handle: NULL",
2314 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302315 return;
2316 }
2317
2318 iface->pause_bitmap = value;
2319}
2320
2321/**
2322 * wma_vdev_get_pause_bitmap() - Get vdev pause bitmap
2323 * @vdev_id: the Id of the vdev to configure
2324 *
2325 * Return: Vdev pause bitmap value else 0 on error
2326 */
2327static inline
2328uint16_t wma_vdev_get_pause_bitmap(uint8_t vdev_id)
2329{
2330 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2331 struct wma_txrx_node *iface;
2332
2333 if (!wma) {
2334 WMA_LOGE("%s: WMA context is invald!", __func__);
2335 return 0;
2336 }
2337
2338 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002339
2340 if (!iface) {
2341 WMA_LOGE("%s: Failed to get iface: NULL",
2342 __func__);
2343 return 0;
2344 }
2345
2346 if (!iface->handle) {
2347 WMA_LOGE("%s: Failed to get iface handle: NULL",
2348 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302349 return 0;
2350 }
2351
2352 return iface->pause_bitmap;
2353}
2354
2355/**
Will Huangad015772018-06-15 11:27:50 +08002356 * wma_vdev_get_dp_handle() - Get vdev datapth handle
2357 * @vdev_id: the Id of the vdev to configure
2358 *
2359 * Return: Vdev datapath handle else NULL on error
2360 */
2361static inline
2362struct cdp_vdev *wma_vdev_get_vdev_dp_handle(uint8_t vdev_id)
2363{
2364 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2365 struct wma_txrx_node *iface;
2366
2367 if (!wma) {
2368 WMA_LOGE("%s: WMA context is invald!", __func__);
2369 return NULL;
2370 }
2371
2372 if (vdev_id >= wma->max_bssid)
2373 return NULL;
2374
2375 iface = &wma->interfaces[vdev_id];
2376
2377 if (!iface) {
2378 WMA_LOGE("%s: Failed to get iface: NULL",
2379 __func__);
2380 return NULL;
2381 }
2382
2383 return iface->handle;
2384}
2385
2386/**
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302387 * wma_vdev_is_device_in_low_pwr_mode - is device in power save mode
2388 * @vdev_id: the Id of the vdev to configure
2389 *
2390 * Return: true if device is in low power mode else false
2391 */
2392static inline bool wma_vdev_is_device_in_low_pwr_mode(uint8_t vdev_id)
2393{
2394 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2395 struct wma_txrx_node *iface;
2396
2397 if (!wma) {
2398 WMA_LOGE("%s: WMA context is invald!", __func__);
2399 return 0;
2400 }
2401
2402 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002403
2404 if (!iface) {
2405 WMA_LOGE("%s: Failed to get iface: NULL",
2406 __func__);
2407 return 0;
2408 }
2409
2410 if (!iface->handle) {
2411 WMA_LOGE("%s: Failed to get iface handle:NULL",
2412 __func__);
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302413 return 0;
2414 }
2415
2416 return iface->in_bmps || wma->in_imps;
2417}
2418
2419/**
Mukul Sharma44746042018-05-24 17:30:52 +05302420 * wma_vdev_get_cfg_int - Get cfg integer value
2421 * @cfg_id: cfg item number
2422 * @value: fill the out value
2423 *
2424 * Note caller must verify return status before using value
2425 *
2426 * Return: QDF_STATUS_SUCCESS when got item from cfg else QDF_STATUS_E_FAILURE
2427 */
2428static inline
2429QDF_STATUS wma_vdev_get_cfg_int(int cfg_id, int *value)
2430{
2431 struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE);
2432 /* set value to zero */
2433 *value = 0;
2434
Nachiket Kukade37b4e6d2018-06-01 18:44:42 +05302435 if (!mac)
Mukul Sharma44746042018-05-24 17:30:52 +05302436 return QDF_STATUS_E_FAILURE;
Mukul Sharma44746042018-05-24 17:30:52 +05302437
Nachiket Kukade37b4e6d2018-06-01 18:44:42 +05302438 if (wlan_cfg_get_int(mac, cfg_id, value) != eSIR_SUCCESS)
Mukul Sharma44746042018-05-24 17:30:52 +05302439 return QDF_STATUS_E_FAILURE;
Mukul Sharma44746042018-05-24 17:30:52 +05302440
2441 return QDF_STATUS_SUCCESS;
2442}
2443
2444/**
Nachiket Kukade37b4e6d2018-06-01 18:44:42 +05302445 * wma_vdev_get_dtim_period - Get dtim period value from mlme
2446 * @vdev_id: vdev index number
2447 * @value: pointer to the value to fill out
2448 *
2449 * Note caller must verify return status before using value
2450 *
2451 * Return: QDF_STATUS_SUCCESS when fetched a valid value from cfg else
2452 * QDF_STATUS_E_FAILURE
2453 */
2454static inline
2455QDF_STATUS wma_vdev_get_dtim_period(uint8_t vdev_id, uint8_t *value)
2456{
2457 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2458 struct wma_txrx_node *iface;
2459 /* set value to zero */
2460 *value = 0;
2461
2462 if (!wma)
2463 return QDF_STATUS_E_FAILURE;
2464
2465 iface = &wma->interfaces[vdev_id];
2466
2467 if (!iface || !iface->handle)
2468 return QDF_STATUS_E_FAILURE;
2469
2470 *value = iface->dtimPeriod;
2471 return QDF_STATUS_SUCCESS;
2472}
2473
2474/**
2475 * wma_vdev_get_beacon_interval - Get beacon interval from mlme
2476 * @vdev_id: vdev index number
2477 * @value: pointer to the value to fill out
2478 *
2479 * Note caller must verify return status before using value
2480 *
2481 * Return: QDF_STATUS_SUCCESS when fetched a valid value from cfg else
2482 * QDF_STATUS_E_FAILURE
2483 */
2484static inline
2485QDF_STATUS wma_vdev_get_beacon_interval(uint8_t vdev_id, uint16_t *value)
2486{
2487 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2488 struct wma_txrx_node *iface;
2489 /* set value to zero */
2490 *value = 0;
2491
2492 if (!wma)
2493 return QDF_STATUS_E_FAILURE;
2494
2495 iface = &wma->interfaces[vdev_id];
2496
2497 if (!iface || !iface->handle)
2498 return QDF_STATUS_E_FAILURE;
2499
2500 *value = iface->beaconInterval;
2501 return QDF_STATUS_SUCCESS;
2502}
2503
2504/**
Mukul Sharma6411bb82017-03-01 15:57:07 +05302505 * wma_vdev_set_pause_bit() - Set a bit in vdev pause bitmap
2506 * @vdev_id: the Id of the vdev to configure
2507 * @bit_pos: set bit position in pause bitmap
2508 *
2509 * Return: None
2510 */
2511static inline
2512void wma_vdev_set_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
2513{
2514 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2515 struct wma_txrx_node *iface;
2516
2517 if (!wma) {
2518 WMA_LOGE("%s: WMA context is invald!", __func__);
2519 return;
2520 }
2521
2522 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002523
2524 if (!iface) {
2525 WMA_LOGE("%s: Failed to get iface: NULL",
2526 __func__);
2527 return;
2528 }
2529
2530 if (!iface->handle) {
2531 WMA_LOGE("%s: Failed to get iface handle: NULL",
2532 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302533 return;
2534 }
2535
2536 iface->pause_bitmap |= (1 << bit_pos);
2537}
2538
2539/**
2540 * wma_vdev_clear_pause_bit() - Clear a bit from vdev pause bitmap
2541 * @vdev_id: the Id of the vdev to configure
2542 * @bit_pos: set bit position in pause bitmap
2543 *
2544 * Return: None
2545 */
2546static inline
2547void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
2548{
2549 tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
2550 struct wma_txrx_node *iface;
2551
2552 if (!wma) {
2553 WMA_LOGE("%s: WMA context is invald!", __func__);
2554 return;
2555 }
2556
2557 iface = &wma->interfaces[vdev_id];
Amar Singhalef59eee2018-01-02 12:46:35 -08002558
2559 if (!iface) {
2560 WMA_LOGE("%s: Failed to get iface: NULL",
2561 __func__);
2562 return;
2563 }
2564
2565 if (!iface->handle) {
2566 WMA_LOGE("%s: Failed to get iface handle: NULL",
2567 __func__);
Mukul Sharma6411bb82017-03-01 15:57:07 +05302568 return;
2569 }
2570
2571 iface->pause_bitmap &= ~(1 << bit_pos);
2572}
2573
Naveen Rawat5c35ae42017-04-18 15:35:07 -07002574/**
2575 * wma_process_roaming_config() - process roam request
2576 * @wma_handle: wma handle
2577 * @roam_req: roam request parameters
2578 *
2579 * Main routine to handle ROAM commands coming from CSR module.
2580 *
2581 * Return: QDF status
2582 */
2583QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
2584 tSirRoamOffloadScanReq *roam_req);
2585
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002586#ifdef WMI_INTERFACE_EVENT_LOGGING
2587static inline void wma_print_wmi_cmd_log(uint32_t count,
2588 qdf_abstract_print *print,
2589 void *print_priv)
2590{
2591 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2592
Rachit Kankaneb1035622018-01-24 18:41:35 +05302593 if (wma) {
2594 print(print_priv, "Command Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002595 wmi_print_cmd_log(wma->wmi_handle, count, print, print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302596 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002597}
2598
2599static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
2600 qdf_abstract_print *print,
2601 void *print_priv)
2602{
2603 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2604
Rachit Kankaneb1035622018-01-24 18:41:35 +05302605 if (wma) {
2606 print(print_priv, "Command Tx Complete Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002607 wmi_print_cmd_tx_cmp_log(wma->wmi_handle, count, print,
2608 print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302609 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002610}
2611
2612static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
2613 qdf_abstract_print *print,
2614 void *print_priv)
2615{
2616 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2617
Rachit Kankaneb1035622018-01-24 18:41:35 +05302618 if (wma) {
2619 print(print_priv, "Management Command Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002620 wmi_print_mgmt_cmd_log(wma->wmi_handle, count, print,
2621 print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302622 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002623}
2624
2625static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
2626 qdf_abstract_print *print,
2627 void *print_priv)
2628{
2629 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2630
Rachit Kankaneb1035622018-01-24 18:41:35 +05302631 if (wma) {
2632 print(print_priv,
2633 "Management Command Tx Complete Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002634 wmi_print_mgmt_cmd_tx_cmp_log(wma->wmi_handle, count, print,
2635 print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302636 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002637}
2638
2639static inline void wma_print_wmi_event_log(uint32_t count,
2640 qdf_abstract_print *print,
2641 void *print_priv)
2642{
2643 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2644
Rachit Kankaneb1035622018-01-24 18:41:35 +05302645 if (wma) {
2646 print(print_priv, "Event Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002647 wmi_print_event_log(wma->wmi_handle, count, print, print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302648 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002649}
2650
2651static inline void wma_print_wmi_rx_event_log(uint32_t count,
2652 qdf_abstract_print *print,
2653 void *print_priv)
2654{
2655 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2656
Rachit Kankaneb1035622018-01-24 18:41:35 +05302657 if (wma) {
2658 print(print_priv, "Rx Event Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002659 wmi_print_rx_event_log(wma->wmi_handle, count, print,
2660 print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302661 }
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002662}
2663
2664static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
2665 qdf_abstract_print *print,
2666 void *print_priv)
2667{
2668 t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
2669
Rachit Kankaneb1035622018-01-24 18:41:35 +05302670 if (wma) {
2671 print(print_priv, "Management Event Log (count %u)", count);
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002672 wmi_print_mgmt_event_log(wma->wmi_handle, count, print,
2673 print_priv);
Rachit Kankaneb1035622018-01-24 18:41:35 +05302674 }
2675}
2676#else
2677
2678static inline void wma_print_wmi_cmd_log(uint32_t count,
2679 qdf_abstract_print *print,
2680 void *print_priv)
2681{
2682}
2683
2684static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
2685 qdf_abstract_print *print,
2686 void *print_priv)
2687{
2688}
2689
2690static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
2691 qdf_abstract_print *print,
2692 void *print_priv)
2693{
2694}
2695
2696static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
2697 qdf_abstract_print *print,
2698 void *print_priv)
2699{
2700}
2701
2702static inline void wma_print_wmi_event_log(uint32_t count,
2703 qdf_abstract_print *print,
2704 void *print_priv)
2705{
2706}
2707
2708static inline void wma_print_wmi_rx_event_log(uint32_t count,
2709 qdf_abstract_print *print,
2710 void *print_priv)
2711{
2712}
2713
2714static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
2715 qdf_abstract_print *print,
2716 void *print_priv)
2717{
Dustin Brown8d2d0f52017-04-03 17:02:08 -07002718}
2719#endif /* WMI_INTERFACE_EVENT_LOGGING */
2720
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07002721/**
2722 * wma_ipa_uc_stat_request() - set ipa config parameters
2723 * @privcmd: private command
2724 *
2725 * Return: None
2726 */
2727void wma_ipa_uc_stat_request(wma_cli_set_cmd_t *privcmd);
2728
lifeng66831662017-05-19 16:01:35 +08002729/**
2730 * wma_set_rx_reorder_timeout_val() - set rx recorder timeout value
2731 * @wma_handle: pointer to wma handle
2732 * @reorder_timeout: rx reorder timeout value
2733 *
2734 * Return: VOS_STATUS_SUCCESS for success or error code.
2735 */
2736QDF_STATUS wma_set_rx_reorder_timeout_val(tp_wma_handle wma_handle,
2737 struct sir_set_rx_reorder_timeout_val *reorder_timeout);
2738
2739/**
2740 * wma_set_rx_blocksize() - set rx blocksize
2741 * @wma_handle: pointer to wma handle
2742 * @peer_rx_blocksize: rx blocksize for peer mac
2743 *
2744 * Return: QDF_STATUS_SUCCESS for success or error code.
2745 */
2746QDF_STATUS wma_set_rx_blocksize(tp_wma_handle wma_handle,
2747 struct sir_peer_set_rx_blocksize *peer_rx_blocksize);
Ashish Kumar Dhanotiyab28338c2017-07-21 20:12:34 +05302748/**
2749 * wma_configure_smps_params() - Configures the smps parameters to set
2750 * @vdev_id: Virtual device for the command
2751 * @param_id: SMPS parameter ID
2752 * @param_val: Value to be set for the parameter
2753 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2754 */
2755QDF_STATUS wma_configure_smps_params(uint32_t vdev_id, uint32_t param_id,
2756 uint32_t param_val);
lifeng66831662017-05-19 16:01:35 +08002757
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302758/*
2759 * wma_chip_power_save_failure_detected_handler() - chip pwr save fail detected
2760 * event handler
2761 * @handle: wma handle
2762 * @cmd_param_info: event handler data
2763 * @len: length of @cmd_param_info
2764 *
2765 * Return: QDF_STATUS_SUCCESS on success; error code otherwise
2766 */
2767int wma_chip_power_save_failure_detected_handler(void *handle,
2768 uint8_t *cmd_param_info,
2769 uint32_t len);
lifengd217d192017-05-09 19:44:16 +08002770
2771/**
2772 * wma_get_chain_rssi() - send wmi cmd to get chain rssi
2773 * @wma_handle: wma handler
2774 * @req_params: requset params
2775 *
2776 * Return: Return QDF_STATUS
2777 */
2778QDF_STATUS wma_get_chain_rssi(tp_wma_handle wma_handle,
2779 struct get_chain_rssi_req_params *req_params);
2780
Nachiket Kukadeaaf8a712017-07-27 19:15:36 +05302781/**
2782 * wma_config_bmiss_bcnt_params() - set bmiss config parameters
2783 * @vdev_id: virtual device for the command
2784 * @first_cnt: bmiss first value
2785 * @final_cnt: bmiss final value
2786 *
2787 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2788 */
2789QDF_STATUS wma_config_bmiss_bcnt_params(uint32_t vdev_id, uint32_t first_cnt,
2790 uint32_t final_cnt);
2791
Naveen Rawatd7734142017-10-27 10:02:40 -07002792/**
2793 * wma_check_and_set_wake_timer(): checks all interfaces and if any interface
2794 * has install_key pending, sets timer pattern in fw to wake up host after
2795 * specified time has elapsed.
2796 * @time: time after which host wants to be awaken.
2797 *
2798 * Return: None
2799 */
2800void wma_check_and_set_wake_timer(uint32_t time);
Min Liu22202b72018-02-12 14:01:24 +08002801
2802/**
2803 * wma_vdev_wait_for_peer_delete_completion() - wait for all peers of the vdev
2804 * to be deleted.
2805 * @wma_handle: wma handle
2806 * @vdev_id: vdev id
2807 *
2808 * Return: None
2809 */
2810void wma_vdev_wait_for_peer_delete_completion(tp_wma_handle wma_handle,
2811 uint8_t vdev_id);
2812
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302813#endif