blob: 491908693445a7f73d25ad7e9346368b4742165e [file] [log] [blame]
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07001 /*
Jeff Johnsond9f08602016-12-02 11:31:30 -08002 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WMA_H
29#define WMA_H
30
31#include "a_types.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053032#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033#include "osapi_linux.h"
34#include "htc_packet.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053035#include "i_qdf_event.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036#include "wmi_services.h"
37#include "wmi_unified.h"
38#include "wmi_version.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053039#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040#include "cfg_api.h"
Anurag Chouhance0dc992016-02-16 18:18:03 +053041#include "qdf_status.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042#include "cds_sched.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043#include "sir_mac_prot_def.h"
44#include "wma_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045#include <linux/workqueue.h>
46#include "utils_api.h"
47#include "lim_types.h"
48#include "wmi_unified_api.h"
Dhanashri Atre12a08392016-02-17 13:10:34 -080049#include "cdp_txrx_cmn.h"
Govind Singh8c46db92016-05-10 14:17:16 +053050#include "dbglog.h"
Leo Chang96464902016-10-28 11:10:54 -070051#include "cds_ieee80211_common.h"
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +053052#include "wlan_objmgr_psoc_obj.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080053/* Platform specific configuration for max. no. of fragments */
54#define QCA_OL_11AC_TX_MAX_FRAGS 2
55
56/* Private */
57
Rajeev Kumardaf1c612016-04-05 02:56:41 -070058#define WMA_READY_EVENTID_TIMEOUT 6000
59#define WMA_SERVICE_READY_EXT_TIMEOUT 6000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060#define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
61#define WMA_WAKE_LOCK_TIMEOUT 1000
Yuanyuan Liuc7432032016-11-09 11:34:45 -080062#define WMA_RESUME_TIMEOUT 25000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063#define MAX_MEM_CHUNKS 32
64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080065#define WMA_CRASH_INJECT_TIMEOUT 5000
66
Govind Singhefc5ccd2016-04-25 11:11:55 +053067/* MAC ID to PDEV ID mapping is as given below
68 * MAC_ID PDEV_ID
69 * 0 1
70 * 1 2
71 * SOC Level WMI_PDEV_ID_SOC
72 */
73#define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
74#define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
75
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080076/* In prima 12 HW stations are supported including BCAST STA(staId 0)
77 * and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
78 * SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
79 */
80
81#ifdef WLAN_SOFTAP_VSTA_FEATURE
82#define WMA_MAX_SUPPORTED_STAS 38
83#else
84#define WMA_MAX_SUPPORTED_STAS 12
85#endif
86#define WMA_MAX_SUPPORTED_BSS 5
87
88#define FRAGMENT_SIZE 3072
89
90#define WMA_INVALID_VDEV_ID 0xFF
91#define MAX_MEM_CHUNKS 32
92#define WMA_MAX_VDEV_SIZE 20
93#define WMA_VDEV_TBL_ENTRY_ADD 1
94#define WMA_VDEV_TBL_ENTRY_DEL 0
95
96/* 11A/G channel boundary */
97#define WMA_11A_CHANNEL_BEGIN 34
98#define WMA_11A_CHANNEL_END 165
99#define WMA_11G_CHANNEL_BEGIN 1
100#define WMA_11G_CHANNEL_END 14
101
102#define WMA_11P_CHANNEL_BEGIN (170)
103#define WMA_11P_CHANNEL_END (184)
104
105#define WMA_LOGD(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530106 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800107#define WMA_LOGI(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530108 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800109#define WMA_LOGW(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530110 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_WARN, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800111#define WMA_LOGE(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530112 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800113#define WMA_LOGP(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530114 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115
116#define WMA_DEBUG_ALWAYS
117
118#ifdef WMA_DEBUG_ALWAYS
119#define WMA_LOGA(args ...) \
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530120 QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800121#else
122#define WMA_LOGA(args ...)
123#endif
124
125#define ALIGNED_WORD_SIZE 4
126#define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
Govind Singhd76a5b02016-03-08 15:12:14 +0530127#define WMA_WILDCARD_PDEV_ID 0x0
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800128
129/* Prefix used by scan req ids generated on the host */
130#define WMA_HOST_SCAN_REQID_PREFIX 0xA000
131/* Prefix used by roam scan req ids generated on the host */
132#define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
133/* Prefix used by scan requestor id on host */
134#define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
135
136#define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
137
138/* Max offchannel duration */
139#define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
140#define WMA_SCAN_NPROBES_DEFAULT (2)
141#define WMA_SCAN_IDLE_TIME_DEFAULT (25)
142#define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
143#define WMA_CTS_DURATION_MS_MAX (32)
144#define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
145#define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
146#define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
147#define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
148#define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
149
150#define WMA_SEC_TO_USEC (1000000)
151
152#define BEACON_TX_BUFFER_SIZE (512)
153
154/* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
155#define WMA_ETHER_TYPE_OFFSET (6 + 6)
156/* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
157#define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
158/* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
159#define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530160/* WMA_IPV4_PROTOCOL = sa(6) + da(6) + eth_type(2) + 9 */
161#define WMA_IPV4_PROTOCOL (6 + 6 + 2 + 9)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800162#define WMA_ICMP_V6_HEADER_TYPE (0x3A)
163#define WMA_ICMP_V6_RA_TYPE (0x86)
164#define WMA_ICMP_V6_NS_TYPE (0x87)
165#define WMA_ICMP_V6_NA_TYPE (0x88)
166#define WMA_BCAST_MAC_ADDR (0xFF)
167#define WMA_MCAST_IPV4_MAC_ADDR (0x01)
168#define WMA_MCAST_IPV6_MAC_ADDR (0x33)
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +0530169#define WMA_ICMP_PROTOCOL (0x01)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800170
Himanshu Agarwal82de9042016-07-20 18:11:03 +0530171#define WMA_IS_EAPOL_GET_MIN_LEN 14
172#define WMA_EAPOL_SUBTYPE_GET_MIN_LEN 21
173#define WMA_EAPOL_INFO_GET_MIN_LEN 23
174#define WMA_IS_DHCP_GET_MIN_LEN 38
175#define WMA_DHCP_SUBTYPE_GET_MIN_LEN 0x11D
176#define WMA_DHCP_INFO_GET_MIN_LEN 50
177#define WMA_IS_ARP_GET_MIN_LEN 14
178#define WMA_ARP_SUBTYPE_GET_MIN_LEN 22
179#define WMA_IPV4_PROTO_GET_MIN_LEN 24
180#define WMA_IPV4_PKT_INFO_GET_MIN_LEN 42
181#define WMA_ICMP_SUBTYPE_GET_MIN_LEN 35
182#define WMA_IPV6_PROTO_GET_MIN_LEN 21
183#define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62
184#define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55
Himanshu Agarwaldd356df2016-07-20 19:04:39 +0530185/**
186 * ds_mode: distribution system mode
187 * @IEEE80211_NO_DS: NO DS at either side
188 * @IEEE80211_TO_DS: DS at receiver side
189 * @IEEE80211_FROM_DS: DS at sender side
190 * @IEEE80211_DS_TO_DS: DS at both sender and revceiver side
191 */
192enum ds_mode {
193 IEEE80211_NO_DS,
194 IEEE80211_TO_DS,
195 IEEE80211_FROM_DS,
196 IEEE80211_DS_TO_DS
197};
198
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199/* Roaming default values
200 * All time and period values are in milliseconds.
201 * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
202 */
203
204#define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
205#define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
206#define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
207#define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
208#define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
209#define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
210#define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
211#define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
212#define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
213#define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
214#define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
215#define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800216#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
217#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
218#define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
219#define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
220
221#define WMA_INVALID_KEY_IDX 0xff
222#define WMA_DFS_RADAR_FOUND 1
223
224#define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
225#define WMA_MIN_RF_CHAINS (1)
226
227#ifdef FEATURE_WLAN_EXTSCAN
228#define WMA_MAX_EXTSCAN_MSG_SIZE 1536
229#define WMA_EXTSCAN_REST_TIME 100
230#define WMA_EXTSCAN_MAX_SCAN_TIME 50000
231#define WMA_EXTSCAN_BURST_DURATION 150
232#endif
233
234#define WMA_BCN_BUF_MAX_SIZE 2500
235#define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
236#define WMA_MAX_NOA_DESCRIPTORS 4
237
238#define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
239
240#define WMA_WOW_PTRN_MASK_VALID 0xFF
241#define WMA_NUM_BITS_IN_BYTE 8
242
243#define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
Arun Khandavallid454d422016-08-17 12:47:05 +0530244#define WMA_STA_WOW_DEFAULT_PTRN_MAX 5
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800245
246#define WMA_BSS_STATUS_STARTED 0x1
247#define WMA_BSS_STATUS_STOPPED 0x2
248
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800249#define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
250#define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
251#define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
252
253#define WMA_PEER_ASSOC_CNF_START 0x01
Sandeep Puligillaafa52892016-10-26 19:03:16 -0700254#define WMA_PEER_ASSOC_TIMEOUT (6000) /* 6 seconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800255
Sandeep Puligilla19ddda22016-01-05 12:18:02 -0800256#define WMA_DELETE_STA_RSP_START 0x02
257#define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
258
259#define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
260
Sandeep Puligillaafa52892016-10-26 19:03:16 -0700261#define WMA_VDEV_START_REQUEST_TIMEOUT (6000) /* 6 seconds */
262#define WMA_VDEV_STOP_REQUEST_TIMEOUT (6000) /* 6 seconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263
Varun Reddy Yeturu83ccb9b2016-06-29 11:55:41 -0700264#define WMA_TGT_INVALID_SNR 0x127
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265
266#define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
267#define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
268#define WMA_MAX_NUM_ARGS 8
269
270#define WMA_SMPS_MASK_LOWER_16BITS 0xFF
271#define WMA_SMPS_MASK_UPPER_3BITS 0x7
272#define WMA_SMPS_PARAM_VALUE_S 29
273
274#define WMA_MAX_SCAN_ID 0x00FF
275
276/*
277 * Setting the Tx Comp Timeout to 1 secs.
278 * TODO: Need to Revist the Timing
279 */
280#define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
281#define WMA_TX_FRAME_BUFFER_NO_FREE 0
282#define WMA_TX_FRAME_BUFFER_FREE 1
283
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800284/* Default InActivity Time is 200 ms */
285#define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
286
287/* Default Listen Interval */
288#define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
289
290/*
291 * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
292 * instead of assigning it to the last valid wmi
293 * cmd+1 to avoid updating this when a command is
294 * added/deleted.
295 */
296#define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
297
298#define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
299#define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
300#define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
301
302/* Default rssi threshold defined in CFG80211 */
303#define WMA_RSSI_THOLD_DEFAULT -300
304
305#ifdef FEATURE_WLAN_SCAN_PNO
306#define WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
307#define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */
308#endif
309#define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
310#define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
311#define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
312#define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
313#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
314#define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
315#endif
316#define WMA_BMISS_EVENT_WAKE_LOCK_DURATION (4 * 1000) /* in msec */
Sandeep Puligilla19ddda22016-01-05 12:18:02 -0800317#define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION (3 * 1000) /* in msec */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800318
319#define WMA_TXMIC_LEN 8
320#define WMA_RXMIC_LEN 8
321
322/*
323 * Length = (2 octets for Index and CTWin/Opp PS) and
324 * (13 octets for each NOA Descriptors)
325 */
326
327#define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
328#define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
329
330#define WMA_P2P_IE_ID 0xdd
331#define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
332#define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
333#define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
334
335/* P2P Sub element defintions (according to table 5 of Wifi's P2P spec) */
336#define WMA_P2P_SUB_ELEMENT_STATUS 0
337#define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
338#define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
339#define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
340#define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
341#define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
342#define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
343#define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
344#define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
345#define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
346#define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
347#define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
348#define WMA_P2P_SUB_ELEMENT_NOA 12
349#define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
350#define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
351#define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
352#define WMA_P2P_SUB_ELEMENT_INTERFACE 16
353#define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
354#define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
355#define WMA_P2P_SUB_ELEMENT_VENDOR 221
356
357/* Macros for handling unaligned memory accesses */
358#define P2PIE_PUT_LE16(a, val) \
359 do { \
360 (a)[1] = ((u16) (val)) >> 8; \
361 (a)[0] = ((u16) (val)) & 0xff; \
362 } while (0)
363
364#define P2PIE_PUT_LE32(a, val) \
365 do { \
366 (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
367 (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
368 (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
369 (a)[0] = (u8) (((u32) (val)) & 0xff); \
370 } while (0)
371
372
373#define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
374
375#define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
376#define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
377#define WMA_DEFAULT_SIFS_BURST_DURATION 8160
378
379#define WMA_VHT_PPS_PAID_MATCH 1
380#define WMA_VHT_PPS_GID_MATCH 2
381#define WMA_VHT_PPS_DELIM_CRC_FAIL 3
382
383#define WMA_DFS_MAX_20M_SUB_CH 8
Vishwajith Upendrabf673e72016-01-19 16:05:40 -0800384#define WMA_80MHZ_START_CENTER_CH_DIFF 6
385#define WMA_160MHZ_START_CENTER_CH_DIFF 14
386#define WMA_NEXT_20MHZ_START_CH_DIFF 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800387
388#define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +0530389#define TWO_THIRD (2/3)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800390
391/**
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530392 * WMA hardware mode list bit-mask definitions.
393 * Bits 4:0, 31:29 are unused.
394 *
395 * The below definitions are added corresponding to WMI DBS HW mode
396 * list to make it independent of firmware changes for WMI definitions.
397 * Currently these definitions have dependency with BIT positions of
398 * the existing WMI macros. Thus, if the BIT positions are changed for
399 * WMI macros, then these macros' BIT definitions are also need to be
400 * changed.
401 */
402#define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
403#define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
404#define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
405#define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
406#define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
407#define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
408#define WMA_HW_MODE_DBS_MODE_BITPOS (7)
409#define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
410#define WMA_HW_MODE_SBS_MODE_BITPOS (5)
411
412#define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \
413 (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
414#define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \
415 (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
416#define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \
417 (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
418#define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \
419 (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
420#define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \
421 (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
422#define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \
423 (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
424#define WMA_HW_MODE_DBS_MODE_MASK \
425 (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS)
426#define WMA_HW_MODE_AGILE_DFS_MODE_MASK \
427 (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
428#define WMA_HW_MODE_SBS_MODE_MASK \
429 (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS)
430
431#define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
432 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value)
433#define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
434 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value)
435#define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
436 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value)
437#define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
438 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value)
439#define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
440 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value)
441#define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
442 WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value)
443#define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \
444 WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value)
445#define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
446 WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value)
447#define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \
448 WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value)
449
450#define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
451 ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \
452 WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
453#define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
454 ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \
455 WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
456#define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
457 ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \
458 WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
459#define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
460 ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \
461 WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
462#define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
463 ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \
464 WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
465#define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
466 ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \
467 WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
468#define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \
469 ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \
470 WMA_HW_MODE_DBS_MODE_BITPOS)
471#define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \
472 ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \
473 WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
474#define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \
475 ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \
476 WMA_HW_MODE_SBS_MODE_BITPOS)
477
478
Nitesh Shah0f3fce52016-10-13 22:01:41 +0530479#define WMA_SCAN_END_EVENT (WMI_SCAN_EVENT_COMPLETED | \
480 WMI_SCAN_EVENT_DEQUEUED | \
481 WMI_SCAN_EVENT_START_FAILED)
482
Nitesh Shah5b7bae02016-09-28 18:58:33 +0530483/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800484 * struct probeTime_dwellTime - probe time, dwell time map
485 * @dwell_time: dwell time
486 * @probe_time: repeat probe time
487 */
488typedef struct probeTime_dwellTime {
489 uint8_t dwell_time;
490 uint8_t probe_time;
491} t_probeTime_dwellTime;
492
493static const t_probeTime_dwellTime
494 probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
Liangwei Dong271f92f2016-09-28 06:05:08 -0400495 {28, 11}, /* 0 SSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800496 {28, 20}, /* 1 SSID */
497 {28, 20}, /* 2 SSID */
498 {28, 20}, /* 3 SSID */
499 {28, 20}, /* 4 SSID */
500 {28, 20}, /* 5 SSID */
501 {28, 20}, /* 6 SSID */
502 {28, 11}, /* 7 SSID */
503 {28, 11}, /* 8 SSID */
504 {28, 11}, /* 9 SSID */
505 {28, 8} /* 10 SSID */
506};
507
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800508typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +0530509typedef void (*encrypt_decrypt_cb)(struct sir_encrypt_decrypt_rsp_params
510 *encrypt_decrypt_rsp_params);
511
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800512
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +0530513typedef void (*tp_wma_packetdump_cb)(qdf_nbuf_t netbuf,
514 uint8_t status, uint8_t vdev_id, uint8_t type);
515
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516/**
517 * enum t_wma_drv_type - wma driver type
518 * @WMA_DRIVER_TYPE_PRODUCTION: production driver type
519 * @WMA_DRIVER_TYPE_MFG: manufacture driver type
520 * @WMA_DRIVER_TYPE_INVALID: invalid driver type
521 */
522typedef enum {
523 WMA_DRIVER_TYPE_PRODUCTION = 0,
524 WMA_DRIVER_TYPE_MFG = 1,
525 WMA_DRIVER_TYPE_INVALID = 0x7FFFFFFF
526} t_wma_drv_type;
527
528#ifdef FEATURE_WLAN_TDLS
529/**
Kabilan Kannan421714b2015-11-23 04:44:59 -0800530 * enum t_wma_tdls_mode - TDLS mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800531 * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
532 * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
533 * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
534 * but respond to the peer
535 * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
Kabilan Kannan421714b2015-11-23 04:44:59 -0800536 * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
537 * implicit trigger but only to a peer mac configured by user space.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800538 */
539typedef enum {
540 WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
541 WMA_TDLS_SUPPORT_DISABLED,
542 WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
543 WMA_TDLS_SUPPORT_ENABLED,
Kabilan Kannan421714b2015-11-23 04:44:59 -0800544 WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800545} t_wma_tdls_mode;
546
547/**
548 * enum wma_tdls_peer_notification - TDLS events
549 * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
550 * on tx bytes per second > tx_discover threshold
551 * NB: notification will be re-sent after
552 * discovery_request_interval_ms
553 * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
554 * due to tx bytes per second below
555 * tx_teardown_threshold
556 * NB: this notification sent once
557 * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
558 */
559enum wma_tdls_peer_notification {
560 WMA_TDLS_SHOULD_DISCOVER,
561 WMA_TDLS_SHOULD_TEARDOWN,
562 WMA_TDLS_PEER_DISCONNECTED,
563};
564
565/**
566 * enum wma_tdls_peer_reason - TDLS peer reason
567 * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
568 * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
569 * packet rates < AP rates
570 * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
571 * due to poor RSSI
572 * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
573 * due to offchannel scan
574 * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
575 * due to peer deletion
576 */
577enum wma_tdls_peer_reason {
578 WMA_TDLS_TEARDOWN_REASON_TX,
579 WMA_TDLS_TEARDOWN_REASON_RATE,
580 WMA_TDLS_TEARDOWN_REASON_RSSI,
581 WMA_TDLS_TEARDOWN_REASON_SCAN,
582 WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
583};
584#endif /* FEATURE_WLAN_TDLS */
585
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800586/**
Govind Singhd76a5b02016-03-08 15:12:14 +0530587 * enum wma_rx_exec_ctx - wma rx execution context
588 * @WMA_RX_WORK_CTX: work queue context execution
589 * @WMA_RX_TASKLET_CTX: tasklet context execution
590 * @WMA_RX_SERIALIZER_CTX: MC thread context execution
591 *
592 */
593enum wma_rx_exec_ctx {
594 WMA_RX_WORK_CTX,
595 WMA_RX_TASKLET_CTX,
596 WMA_RX_SERIALIZER_CTX
597};
Krunal Soni2e48d012016-05-02 16:55:26 -0700598
599/**
600 * enum wma_phy_idx
601 * @PHY1: to notify caller that PHY1 specific param needed
602 * @PHY2: to notify caller that PHY2 specific param needed
603 * @PHY1_PHY2: to notify caller that both PHY's param needed
604 * Note: Firmware sends phy map in terms of bitmask, so enum
605 * also needs to be defined that way.
606 *
607 * For example, 0x3 = 0011 = BIT0 corresponds to one phy and
608 * BIT1 coresponds to another phy. There is no direct relation between
609 * each bit to particular PHY (ex. PHYA or PHYB).
610 *
611 * In simple terms, 3 means referring both PHYs & 1 or 2 means
612 * referring to either PHYA or PHYB.
613 */
614enum wma_phy_idx {
615 PHY1 = 0x1, /* 0x1 */
616 PHY2, /* 0x2 */
617 PHY1_PHY2, /* 0x3 */
618};
619
Govind Singhd76a5b02016-03-08 15:12:14 +0530620/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800621 * struct wma_mem_chunk - memory chunks
622 * @vaddr: virtual address
623 * @paddr: physical address
624 * @memctx: dma mapped memory
625 * @len: length of data
626 * @req_id: request id
627 *
628 * memory chunck allocated by Host to be managed by FW
629 * used only for low latency interfaces like pcie
630 */
631struct wma_mem_chunk {
632 uint32_t *vaddr;
633 uint32_t paddr;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530634 qdf_dma_mem_context(memctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800635 uint32_t len;
636 uint32_t req_id;
637};
638
639/**
640 * struct p2p_scan_param - p2p scan listen parameters
641 * @scan_id: scan id
642 * @p2p_scan_type: p2p scan type
643 */
644struct p2p_scan_param {
645 uint32_t scan_id;
646 tSirP2pScanType p2p_scan_type;
647};
648
649/**
650 * struct scan_param - scan parameters
651 * @scan_id: scan id
652 * @scan_requestor_id: scan requestor id
653 * @p2p_scan_type: p2p scan type
654 */
655struct scan_param {
656 uint32_t scan_id;
657 uint32_t scan_requestor_id;
658 tSirP2pScanType p2p_scan_type;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -0700659 uint32_t chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800660};
661
662/**
663 * struct beacon_info - structure to store beacon template
664 * @buf: skb ptr
665 * @len: length
666 * @dma_mapped: is it dma mapped or not
667 * @tim_ie_offset: TIM IE offset
668 * @dtim_count: DTIM count
669 * @seq_no: sequence no
670 * @noa_sub_ie: NOA sub IE
671 * @noa_sub_ie_len: NOA sub IE length
672 * @noa_ie: NOA IE
673 * @p2p_ie_offset: p2p IE offset
674 * @lock: lock
675 */
676struct beacon_info {
Nirav Shahcbc6d722016-03-01 16:24:53 +0530677 qdf_nbuf_t buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678 uint32_t len;
679 uint8_t dma_mapped;
680 uint32_t tim_ie_offset;
681 uint8_t dtim_count;
682 uint16_t seq_no;
683 uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
684 uint16_t noa_sub_ie_len;
685 uint8_t *noa_ie;
686 uint16_t p2p_ie_offset;
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530687 qdf_spinlock_t lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800688};
689
690/**
691 * struct beacon_tim_ie - structure to store TIM IE of beacon
692 * @tim_ie: tim ie
693 * @tim_len: tim ie length
694 * @dtim_count: dtim count
695 * @dtim_period: dtim period
696 * @tim_bitctl: tim bit control
697 * @tim_bitmap: tim bitmap
698 */
699struct beacon_tim_ie {
700 uint8_t tim_ie;
701 uint8_t tim_len;
702 uint8_t dtim_count;
703 uint8_t dtim_period;
704 uint8_t tim_bitctl;
705 uint8_t tim_bitmap[1];
706} __ATTRIB_PACK;
707
708/**
709 * struct pps - packet power save parameter
710 * @paid_match_enable: paid match enable
711 * @gid_match_enable: gid match enable
712 * @tim_clear: time clear
713 * @dtim_clear: dtim clear
714 * @eof_delim: eof delim
715 * @mac_match: mac match
716 * @delim_fail: delim fail
717 * @nsts_zero: nsts zero
718 * @rssi_chk: RSSI check
719 * @ebt_5g: ebt 5GHz
720 */
721struct pps {
722 bool paid_match_enable;
723 bool gid_match_enable;
724 bool tim_clear;
725 bool dtim_clear;
726 bool eof_delim;
727 bool mac_match;
728 bool delim_fail;
729 bool nsts_zero;
730 bool rssi_chk;
731 bool ebt_5g;
732};
733
734/**
735 * struct qpower_params - qpower related parameters
736 * @max_ps_poll_cnt: max ps poll count
737 * @max_tx_before_wake: max tx before wake
738 * @spec_ps_poll_wake_interval: ps poll wake interval
739 * @max_spec_nodata_ps_poll: no data ps poll
740 */
741struct qpower_params {
742 uint32_t max_ps_poll_cnt;
743 uint32_t max_tx_before_wake;
744 uint32_t spec_ps_poll_wake_interval;
745 uint32_t max_spec_nodata_ps_poll;
746};
747
748
749/**
750 * struct gtx_config_t - GTX config
751 * @gtxRTMask: for HT and VHT rate masks
752 * @gtxUsrcfg: host request for GTX mask
753 * @gtxPERThreshold: PER Threshold (default: 10%)
754 * @gtxPERMargin: PER margin (default: 2%)
755 * @gtxTPCstep: TCP step (default: 1)
756 * @gtxTPCMin: TCP min (default: 5)
757 * @gtxBWMask: BW mask (20/40/80/160 Mhz)
758 */
759typedef struct {
760 uint32_t gtxRTMask[2];
761 uint32_t gtxUsrcfg;
762 uint32_t gtxPERThreshold;
763 uint32_t gtxPERMargin;
764 uint32_t gtxTPCstep;
765 uint32_t gtxTPCMin;
766 uint32_t gtxBWMask;
767} gtx_config_t;
768
769/**
770 * struct pdev_cli_config_t - store pdev parameters
771 * @ani_enable: ANI is enabled/disable on target
772 * @ani_poll_len: store ANI polling period
773 * @ani_listen_len: store ANI listening period
774 * @ani_ofdm_level: store ANI OFDM immunity level
775 * @ani_cck_level: store ANI CCK immunity level
776 * @cwmenable: Dynamic bw is enable/disable in fw
777 * @txchainmask: tx chain mask
778 * @rxchainmask: rx chain mask
779 * @txpow2g: tx power limit for 2GHz
780 * @txpow5g: tx power limit for 5GHz
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800781 * @burst_enable: is burst enable/disable
782 * @burst_dur: burst duration
783 *
784 * This structure stores pdev parameters.
785 * Some of these parameters are set in fw and some
786 * parameters are only maintained in host.
787 */
788typedef struct {
789 uint32_t ani_enable;
790 uint32_t ani_poll_len;
791 uint32_t ani_listen_len;
792 uint32_t ani_ofdm_level;
793 uint32_t ani_cck_level;
794 uint32_t cwmenable;
795 uint32_t cts_cbw;
796 uint32_t txchainmask;
797 uint32_t rxchainmask;
798 uint32_t txpow2g;
799 uint32_t txpow5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800800 uint32_t burst_enable;
801 uint32_t burst_dur;
802} pdev_cli_config_t;
803
804/**
805 * struct vdev_cli_config_t - store vdev parameters
806 * @nss: nss width
807 * @ldpc: is ldpc is enable/disable
808 * @tx_stbc: TX STBC is enable/disable
809 * @rx_stbc: RX STBC is enable/disable
810 * @shortgi: short gi is enable/disable
811 * @rtscts_en: RTS/CTS is enable/disable
812 * @chwidth: channel width
813 * @tx_rate: tx rate
814 * @ampdu: ampdu size
815 * @amsdu: amsdu size
816 * @erx_adjust: enable/disable early rx enable
817 * @erx_bmiss_num: target bmiss number per sample
818 * @erx_bmiss_cycle: sample cycle
819 * @erx_slop_step: slop_step value
820 * @erx_init_slop: init slop
821 * @erx_adj_pause: pause adjust enable/disable
822 * @erx_dri_sample: enable/disable drift sample
823 * @pps_params: packet power save parameters
824 * @qpower_params: qpower parameters
825 * @gtx_info: GTX offload info
826 *
827 * This structure stores vdev parameters.
828 * Some of these parameters are set in fw and some
829 * parameters are only maintained in host.
830 */
831typedef struct {
832 uint32_t nss;
833 uint32_t ldpc;
834 uint32_t tx_stbc;
835 uint32_t rx_stbc;
836 uint32_t shortgi;
837 uint32_t rtscts_en;
838 uint32_t chwidth;
839 uint32_t tx_rate;
840 uint32_t ampdu;
841 uint32_t amsdu;
842 uint32_t erx_adjust;
843 uint32_t erx_bmiss_num;
844 uint32_t erx_bmiss_cycle;
845 uint32_t erx_slop_step;
846 uint32_t erx_init_slop;
847 uint32_t erx_adj_pause;
848 uint32_t erx_dri_sample;
849 struct pps pps_params;
850 struct qpower_params qpower_params;
851 gtx_config_t gtx_info;
852} vdev_cli_config_t;
853
854/**
Mukul Sharma5ff3c582016-09-12 15:23:35 +0530855 * struct wma_version_info - Store wmi version info
856 * @major: wmi major version
857 * @minor: wmi minor version
858 * @revision: wmi revision number
859 */
860struct wma_version_info {
861 u_int32_t major;
862 u_int32_t minor;
863 u_int32_t revision;
864};
865
866/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800867 * struct wma_wow - store wow patterns
868 * @magic_ptrn_enable: magic pattern enable/disable
869 * @wow_enable: wow enable/disable
870 * @wow_enable_cmd_sent: is wow enable command sent to fw
871 * @deauth_enable: is deauth wakeup enable/disable
872 * @disassoc_enable: is disassoc wakeup enable/disable
873 * @bmiss_enable: is bmiss wakeup enable/disable
874 * @gtk_pdev_enable: is GTK based wakeup enable/disable
875 * @gtk_err_enable: is GTK error wakeup enable/disable
876 * @lphb_cache: lphb cache
877 *
878 * This structure stores wow patterns and
879 * wow related parameters in host.
880 */
881struct wma_wow {
882 bool magic_ptrn_enable;
883 bool wow_enable;
884 bool wow_enable_cmd_sent;
885 bool deauth_enable;
886 bool disassoc_enable;
887 bool bmiss_enable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800888 bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
889#ifdef FEATURE_WLAN_LPHB
890 /* currently supports only vdev 0.
891 * cache has two entries: one for TCP and one for UDP.
892 */
893 tSirLPHBReq lphb_cache[2];
894#endif
895};
896
897#ifdef WLAN_FEATURE_11W
898#define CMAC_IPN_LEN (6)
899#define WMA_IGTK_KEY_INDEX_4 (4)
900#define WMA_IGTK_KEY_INDEX_5 (5)
901
902/**
903 * struct wma_igtk_ipn_t - GTK IPN info
904 * @ipn: IPN info
905 */
906typedef struct {
907 uint8_t ipn[CMAC_IPN_LEN];
908} wma_igtk_ipn_t;
909
910/**
911 * struct wma_igtk_key_t - GTK key
912 * @key_length: key length
913 * @key: key
914 * @key_id: key id
915 */
916typedef struct {
917 uint16_t key_length;
918 uint8_t key[CSR_AES_KEY_LEN];
919
920 /* IPN is maintained per iGTK keyID
921 * 0th index for iGTK keyID = 4;
922 * 1st index for iGTK KeyID = 5
923 */
924 wma_igtk_ipn_t key_id[2];
925} wma_igtk_key_t;
926#endif
927
928/**
929 * struct vdev_restart_params_t - vdev restart parameters
930 * @vdev_id: vdev id
931 * @ssid: ssid
932 * @flags: flags
933 * @requestor_id: requestor id
934 * @chan: channel
935 * @hidden_ssid_restart_in_progress: hidden ssid restart flag
936 * @ssidHidden: is ssid hidden or not
937 */
938typedef struct {
939 A_UINT32 vdev_id;
940 wmi_ssid ssid;
941 A_UINT32 flags;
942 A_UINT32 requestor_id;
943 A_UINT32 disable_hw_ack;
944 wmi_channel chan;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +0530945 qdf_atomic_t hidden_ssid_restart_in_progress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800946 uint8_t ssidHidden;
947} vdev_restart_params_t;
948
949/**
950 * struct wma_txrx_node - txrx node
951 * @addr: mac address
952 * @bssid: bssid
953 * @handle: wma handle
954 * @beacon: beacon info
955 * @vdev_restart_params: vdev restart parameters
956 * @config: per vdev config parameters
957 * @scan_info: scan info
958 * @type: type
959 * @sub_type: sub type
960 * @nlo_match_evt_received: is nlo match event received or not
961 * @pno_in_progress: is pno in progress or not
962 * @plm_in_progress: is plm in progress or not
963 * @ptrn_match_enable: is pattern match is enable or not
964 * @num_wow_default_patterns: number of default wow patterns configured for vdev
965 * @num_wow_user_patterns: number of user wow patterns configured for vdev
966 * @conn_state: connection state
967 * @beaconInterval: beacon interval
968 * @llbCoexist: 11b coexist
969 * @shortSlotTimeSupported: is short slot time supported or not
970 * @dtimPeriod: DTIM period
971 * @chanmode: channel mode
972 * @vht_capable: VHT capablity flag
973 * @ht_capable: HT capablity flag
974 * @mhz: channel frequency in KHz
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -0700975 * @chan_width: channel bandwidth
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800976 * @vdev_up: is vdev up or not
977 * @tsfadjust: TSF adjust
978 * @addBssStaContext: add bss context
979 * @aid: association id
980 * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
981 * @key: GTK key
982 * @uapsd_cached_val: uapsd cached value
983 * @stats_rsp: stats response
984 * @fw_stats_set: fw stats value
985 * @del_staself_req: delete sta self request
986 * @bss_status: bss status
987 * @rate_flags: rate flags
988 * @nss: nss value
989 * @is_channel_switch: is channel switch
990 * @pause_bitmap: pause bitmap
991 * @tx_power: tx power in dbm
992 * @max_tx_power: max tx power in dbm
993 * @nwType: network type (802.11a/b/g/n/ac)
994 * @staKeyParams: sta key parameters
995 * @ps_enabled: is powersave enable/disable
996 * @dtim_policy: DTIM policy
997 * @peer_count: peer count
998 * @roam_synch_in_progress: flag is in progress or not
999 * @plink_status_req: link status request
1000 * @psnr_req: snr request
1001 * @delay_before_vdev_stop: delay
1002 * @tx_streams: number of tx streams can be used by the vdev
1003 * @rx_streams: number of rx streams can be used by the vdev
1004 * @chain_mask: chain mask can be used by the vdev
1005 * @mac_id: the mac on which vdev is on
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301006 * @wep_default_key_idx: wep default index for group key
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301007 * @arp_offload_req: cached arp offload request
1008 * @ns_offload_req: cached ns offload request
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 * It stores parameters per vdev in wma.
1010 */
1011struct wma_txrx_node {
1012 uint8_t addr[IEEE80211_ADDR_LEN];
1013 uint8_t bssid[IEEE80211_ADDR_LEN];
1014 void *handle;
1015 struct beacon_info *beacon;
1016 vdev_restart_params_t vdev_restart_params;
1017 vdev_cli_config_t config;
1018 struct scan_param scan_info;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001019 uint32_t type;
1020 uint32_t sub_type;
1021#ifdef FEATURE_WLAN_SCAN_PNO
1022 bool nlo_match_evt_received;
1023 bool pno_in_progress;
1024#endif
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001025#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001026 bool plm_in_progress;
1027#endif
1028 bool ptrn_match_enable;
1029 uint8_t num_wow_default_patterns;
1030 uint8_t num_wow_user_patterns;
1031 bool conn_state;
1032 tSirMacBeaconInterval beaconInterval;
1033 uint8_t llbCoexist;
1034 uint8_t shortSlotTimeSupported;
1035 uint8_t dtimPeriod;
1036 WLAN_PHY_MODE chanmode;
1037 uint8_t vht_capable;
1038 uint8_t ht_capable;
1039 A_UINT32 mhz;
Tushnim Bhattacharyya7624a182016-03-30 13:30:46 -07001040 enum phy_ch_width chan_width;
Selvaraj, Sridhar171e2252016-06-22 22:33:26 +05301041 bool vdev_active;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001042 bool vdev_up;
1043 uint64_t tsfadjust;
1044 void *addBssStaContext;
1045 uint8_t aid;
1046 uint8_t rmfEnabled;
1047#ifdef WLAN_FEATURE_11W
1048 wma_igtk_key_t key;
1049#endif /* WLAN_FEATURE_11W */
1050 uint32_t uapsd_cached_val;
1051 tAniGetPEStatsRsp *stats_rsp;
1052 uint8_t fw_stats_set;
1053 void *del_staself_req;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301054 qdf_atomic_t bss_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001055 uint8_t rate_flags;
1056 uint8_t nss;
1057 bool is_channel_switch;
1058 uint16_t pause_bitmap;
Amar Singhala297bfa2015-10-15 15:07:29 -07001059 int8_t tx_power;
1060 int8_t max_tx_power;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061 uint32_t nwType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001062 void *staKeyParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001063 uint32_t dtim_policy;
1064 uint32_t peer_count;
1065 bool roam_synch_in_progress;
1066 void *plink_status_req;
1067 void *psnr_req;
1068 uint8_t delay_before_vdev_stop;
1069#ifdef FEATURE_WLAN_EXTSCAN
1070 bool extscan_in_progress;
1071#endif
1072 uint32_t alt_modulated_dtim;
1073 bool alt_modulated_dtim_enabled;
1074 uint32_t tx_streams;
1075 uint32_t rx_streams;
1076 uint32_t chain_mask;
1077 uint32_t mac_id;
Varun Reddy Yeturu30bc42c2016-02-04 10:07:30 -08001078 bool roaming_in_progress;
Varun Reddy Yeturu5ab47462016-05-08 18:08:11 -07001079 int32_t roam_synch_delay;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07001080 uint8_t nss_2g;
1081 uint8_t nss_5g;
Peng Xu8fdaa492016-06-22 10:20:47 -07001082 bool p2p_lo_in_progress;
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301083 uint8_t wep_default_key_idx;
Mukul Sharma8d2d9ec2016-09-08 13:05:35 +05301084 tSirHostOffloadReq arp_offload_req;
1085 tSirHostOffloadReq ns_offload_req;
Bhargav Shaha89d3b42016-04-20 13:04:56 +05301086 bool is_vdev_valid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001087};
1088
1089#if defined(QCA_WIFI_FTM)
1090#define MAX_UTF_EVENT_LENGTH 2048
1091#define MAX_WMI_UTF_LEN 252
1092
1093/**
1094 * struct SEG_HDR_INFO_STRUCT - header info
1095 * @len: length
1096 * @msgref: message refrence
1097 * @segmentInfo: segment info
1098 * @pad: padding
1099 */
1100typedef struct {
1101 A_UINT32 len;
1102 A_UINT32 msgref;
1103 A_UINT32 segmentInfo;
1104 A_UINT32 pad;
1105} SEG_HDR_INFO_STRUCT;
1106
1107/**
1108 * struct utf_event_info - UTF event info
1109 * @data: data ptr
1110 * @length: length
1111 * @offset: offset
1112 * @currentSeq: curent squence
1113 * @expectedSeq: expected sequence
1114 */
1115struct utf_event_info {
1116 uint8_t *data;
1117 uint32_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301118 qdf_size_t offset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001119 uint8_t currentSeq;
1120 uint8_t expectedSeq;
1121};
1122#endif
1123
1124/**
1125 * struct scan_timer_info - scan timer info
1126 * @vdev_id: vdev id
1127 * @scan_id: scan id
1128 */
1129typedef struct {
1130 uint8_t vdev_id;
1131 uint32_t scan_id;
1132} scan_timer_info;
1133
1134/**
1135 * struct ibss_power_save_params - IBSS power save parameters
1136 * @atimWindowLength: ATIM window length
1137 * @isPowerSaveAllowed: is power save allowed
1138 * @isPowerCollapseAllowed: is power collapsed allowed
1139 * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
1140 * @inactivityCount: inactivity count
1141 * @txSPEndInactivityTime: tx SP end inactivity time
1142 * @ibssPsWarmupTime: IBSS power save warm up time
1143 * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
1144 */
1145typedef struct {
1146 uint32_t atimWindowLength;
1147 uint32_t isPowerSaveAllowed;
1148 uint32_t isPowerCollapseAllowed;
1149 uint32_t isAwakeonTxRxEnabled;
1150 uint32_t inactivityCount;
1151 uint32_t txSPEndInactivityTime;
1152 uint32_t ibssPsWarmupTime;
1153 uint32_t ibssPs1RxChainInAtimEnable;
1154} ibss_power_save_params;
1155
1156/**
1157 * struct dbs_hw_mode_info - WLAN_DBS_HW_MODES_TLV Format
1158 * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
1159 * @hw_mode_list: WLAN_DBS_HW_MODE_LIST entries
1160 */
1161struct dbs_hw_mode_info {
1162 uint32_t tlv_header;
1163 uint32_t *hw_mode_list;
1164};
1165
Nitesh Shah877ad5d2016-09-22 19:27:58 +05301166/**
1167 * 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/* Current HTC credit is 2, pool size of 50 is sufficient */
1179#define WMI_DESC_POOL_MAX 50
1180
1181/**
1182 * struct wmi_desc_t - wmi management Tx descriptor.
1183 * @tx_cmpl_cb_func: completion callback function, when DL completion and
1184 * OTA done.
1185 * @ota_post_proc_func: Post process callback function registered.
1186 * @nbuf: Network buffer to be freed.
1187 * @desc_id: WMI descriptor.
1188 */
1189
1190struct wmi_desc_t {
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301191 wma_tx_dwnld_comp_callback tx_cmpl_cb;
1192 wma_tx_ota_comp_callback ota_post_proc_cb;
Nirav Shahcbc6d722016-03-01 16:24:53 +05301193 qdf_nbuf_t nbuf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001194 uint32_t desc_id;
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301195 uint8_t vdev_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001196};
1197
1198/**
1199 * union wmi_desc_elem_t - linked list wmi desc pool.
1200 * @next: Pointer next descritor in the pool.
1201 * @wmi_desc: wmi descriptor element.
1202 */
1203union wmi_desc_elem_t {
1204 union wmi_desc_elem_t *next;
1205 struct wmi_desc_t wmi_desc;
1206};
1207
1208/**
1209 * struct dual_mac_config - Dual MAC configurations
1210 * @prev_scan_config: Previous scan configuration
1211 * @prev_fw_mode_config: Previous FW mode configuration
1212 * @cur_scan_config: Current scan configuration
1213 * @cur_fw_mode_config: Current FW mode configuration
1214 * @req_scan_config: Requested scan configuration
1215 * @req_fw_mode_config: Requested FW mode configuration
1216 */
1217struct dual_mac_config {
1218 uint32_t prev_scan_config;
1219 uint32_t prev_fw_mode_config;
1220 uint32_t cur_scan_config;
1221 uint32_t cur_fw_mode_config;
1222 uint32_t req_scan_config;
1223 uint32_t req_fw_mode_config;
1224
1225};
1226
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001227
1228/**
Komal Seelam02d09342016-02-23 18:03:19 +05301229 * struct wma_ini_config - Structure to hold wma ini configuration
1230 * @max_no_of_peers: Max Number of supported
1231 *
1232 * Placeholder for WMA ini parameters.
1233 */
1234struct wma_ini_config {
1235 uint8_t max_no_of_peers;
1236};
1237
1238/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301239 * struct wmi_valid_channels - Channel details part of WMI_SCAN_CHAN_LIST_CMDID
1240 * @num_channels: Number of channels
1241 * @channel_list: Channel list
1242 */
1243struct wma_valid_channels {
1244 uint8_t num_channels;
1245 uint8_t channel_list[MAX_NUM_CHAN];
1246};
1247
Krunal Soni2e48d012016-05-02 16:55:26 -07001248/**
1249 * struct hw_mode_idx_to_mac_cap_idx - map between hw_mode to capabilities
1250 * @num_of_macs: number of macs/PHYs for given hw_mode through hw_mode_id
1251 * @mac_cap_idx: index of the mac/PHY for given hw_mode through hw_mode_id
1252 * @hw_mode_id: given hw_mode id
1253 */
1254struct hw_mode_idx_to_mac_cap_idx {
1255 uint8_t num_of_macs;
1256 uint8_t mac_cap_idx;
1257 uint8_t hw_mode_id;
1258};
1259
1260/**
1261 * struct extended_caps - new extended caps given by firmware
1262 * @num_hw_modes: number of hardware modes for current SOC
1263 * @each_hw_mode_cap: hw mode id to phy id mapping
1264 * @each_phy_cap_per_hwmode: PHY's caps for each hw mode
1265 * @num_phy_for_hal_reg_cap: number of phy for hal reg cap
1266 * @hw_mode_to_mac_cap_map: map between hw_mode to capabilities
1267 */
1268struct extended_caps {
1269 WMI_SOC_MAC_PHY_HW_MODE_CAPS num_hw_modes;
1270 WMI_HW_MODE_CAPABILITIES *each_hw_mode_cap;
1271 WMI_MAC_PHY_CAPABILITIES *each_phy_cap_per_hwmode;
1272 WMI_SOC_HAL_REG_CAPABILITIES num_phy_for_hal_reg_cap;
1273 WMI_HAL_REG_CAPABILITIES_EXT *each_phy_hal_reg_cap;
1274 struct hw_mode_idx_to_mac_cap_idx *hw_mode_to_mac_cap_map;
1275};
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301276
1277/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001278 * struct t_wma_handle - wma context
1279 * @wmi_handle: wmi handle
1280 * @htc_handle: htc handle
1281 * @cds_context: cds handle
1282 * @mac_context: mac context
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301283 * @psoc: psoc context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001284 * @wma_ready_event: wma rx ready event
1285 * @wma_resume_event: wma resume event
1286 * @target_suspend: target suspend event
1287 * @recovery_event: wma FW recovery event
1288 * @max_station: max stations
1289 * @max_bssid: max bssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001290 * @driver_type: driver type
1291 * @myaddr: current mac address
1292 * @hwaddr: mac address from EEPROM
1293 * @target_abi_vers: target firmware version
1294 * @final_abi_vers: The final ABI version to be used for communicating
1295 * @target_fw_version: Target f/w build version
Sandeep Puligilla3d6a8e22016-10-11 18:57:14 -07001296 * @target_fw_vers_ext: Target f/w build version sub id
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001297 * @lpss_support: LPSS feature is supported in target or not
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08001298 * @egap_support: Enhanced Green AP support flag
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001299 * @wmi_ready: wmi status flag
1300 * @wlan_init_status: wlan init status
Anurag Chouhanf04e84f2016-03-03 10:12:12 +05301301 * @qdf_dev: qdf device
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001302 * @phy_capability: PHY Capability from Target
1303 * @max_frag_entry: Max number of Fragment entry
1304 * @wmi_service_bitmap: wmi services bitmap received from Target
1305 * @wlan_resource_config: resource config
1306 * @frameTransRequired: frame transmission required
1307 * @wmaGlobalSystemRole: global system role
1308 * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
1309 * @tx_frm_download_comp_event: Event to wait for tx download completion
1310 * @tx_queue_empty_event: wait for tx queue to get flushed
1311 * @umac_ota_ack_cb: Ack Complete Callback registered by umac
1312 * @umac_data_ota_ack_cb: ack complete callback
1313 * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
1314 * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
1315 * @needShutdown: is shutdown needed or not
1316 * @num_mem_chunks: number of memory chunk
1317 * @mem_chunks: memory chunks
1318 * @tgt_cfg_update_cb: configuration update callback
1319 * @dfs_radar_indication_cb: Callback to indicate radar to HDD
1320 * @reg_cap: regulatory capablities
1321 * @scan_id: scan id
1322 * @interfaces: txrx nodes(per vdev)
1323 * @pdevconfig: pdev related configrations
1324 * @vdev_resp_queue: vdev response queue
1325 * @vdev_respq_lock: vdev response queue lock
1326 * @ht_cap_info: HT capablity info
1327 * @vht_cap_info: VHT capablity info
1328 * @vht_supp_mcs: VHT supported MCS
1329 * @num_rf_chains: number of RF chains
1330 * @utf_event_info: UTF event information
1331 * @is_fw_assert: is fw asserted
1332 * @wow: wow related patterns & parameters
1333 * @no_of_suspend_ind: number of suspend indications
1334 * @no_of_resume_ind: number of resume indications
1335 * @mArpInfo: arp info
1336 * @powersave_mode: power save mode
1337 * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
1338 * @pGetRssiReq: get RSSI request
1339 * @thermal_mgmt_info: Thermal mitigation related info
1340 * @roam_offload_enabled: is roam offload enable/disable
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001341 * @ol_ini_info: store ini status of arp offload, ns offload
1342 * @ssdp: ssdp flag
Komal Seelam9764a842016-05-24 11:07:23 +05301343 * @enable_mc_list : To Check if Multicast list filtering is enabled in FW
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001344 * @ibss_started: is IBSS started or not
1345 * @ibsskey_info: IBSS key info
1346 * @dfs_ic: DFS umac interface information
1347 * @hddTxFailCb: tx fail indication callback
1348 * @pno_wake_lock: PNO wake lock
1349 * @extscan_wake_lock: extscan wake lock
1350 * @wow_wake_lock: wow wake lock
1351 * @wow_nack: wow negative ack flag
1352 * @ap_client_cnt: ap client count
1353 * @is_wow_bus_suspended: is wow bus suspended flag
1354 * @wma_scan_comp_timer: scan completion timer
1355 * @dfs_phyerr_filter_offload: dfs phy error filter is offloaded or not
1356 * @suitable_ap_hb_failure: better ap found
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301357 * @suitable_ap_hb_failure_rssi: record the RSSI when suitable_ap_hb_failure
1358 * for later usage to report RSSI at beacon miss scenario
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001359 * @wma_ibss_power_save_params: IBSS Power Save config Parameters
1360 * @IsRArateLimitEnabled: RA rate limiti s enabled or not
1361 * @RArateLimitInterval: RA rate limit interval
1362 * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
1363 * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
1364 * @staMaxLIModDtim: station max listen interval
1365 * @staModDtim: station mode DTIM
1366 * @staDynamicDtim: station dynamic DTIM
1367 * @enable_mhf_offload: is MHF offload enable/disable
1368 * @last_mhf_entries_timestamp: timestamp when last entries where set
1369 * @dfs_pri_multiplier: DFS multiplier
1370 * @hw_bd_id: hardware board id
1371 * @hw_bd_info: hardware board info
1372 * @in_d0wow: D0WOW is enable/disable
1373 * @miracast_value: miracast value
1374 * @log_completion_timer: log completion timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001375 * @num_dbs_hw_modes: Number of HW modes supported by the FW
1376 * @dbs_mode: DBS HW mode list
1377 * @old_hw_mode_index: Previous configured HW mode index
1378 * @new_hw_mode_index: Current configured HW mode index
Krunal Soni2e48d012016-05-02 16:55:26 -07001379 * @extended_caps phy_caps: extended caps per hw mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001380 * @peer_authorized_cb: peer authorized hdd callback
1381 * @ocb_callback: callback to OCB commands
1382 * @ocb_resp: response to OCB commands
1383 * @wow_pno_match_wake_up_count: PNO match wake up count
1384 * @wow_pno_complete_wake_up_count: PNO complete wake up count
1385 * @wow_gscan_wake_up_count: Gscan wake up count
1386 * @wow_low_rssi_wake_up_count: Low rssi wake up count
1387 * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
1388 * @wow_ucast_wake_up_count: WoW unicast packet wake up count
1389 * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
1390 * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
1391 * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
1392 * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
1393 * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
1394 * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05301395 * @wow_icmpv4_count: WoW ipv4 icmp packet wake up count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05301396 * @wow_icmpv6_count: WoW ipv6 icmp packet wake up count
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001397 * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
1398 *
1399 * @max_scan: maximum scan requests than can be queued
1400 * This structure is global wma context
1401 * It contains global wma module parameters and
1402 * handle of other modules.
1403 * @saved_wmi_init_cmd: Saved WMI INIT command
Anurag Chouhan04dbf6d2016-09-08 15:32:52 +05301404 * @bool bpf_packet_filter_enable: BPF filter enabled or not
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001405 * @service_ready_ext_evt: Wait event for service ready ext
Sandeep Puligilla19ddda22016-01-05 12:18:02 -08001406 * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
1407 * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301408 * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001409 */
1410typedef struct {
1411 void *wmi_handle;
1412 void *htc_handle;
1413 void *cds_context;
1414 void *mac_context;
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +05301415 struct wlan_objmgr_psoc *psoc;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301416 qdf_event_t wma_ready_event;
1417 qdf_event_t wma_resume_event;
1418 qdf_event_t target_suspend;
1419 qdf_event_t runtime_suspend;
1420 qdf_event_t recovery_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001421 uint16_t max_station;
1422 uint16_t max_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001423 t_wma_drv_type driver_type;
1424 uint8_t myaddr[IEEE80211_ADDR_LEN];
1425 uint8_t hwaddr[IEEE80211_ADDR_LEN];
1426 wmi_abi_version target_abi_vers;
1427 wmi_abi_version final_abi_vers;
1428 uint32_t target_fw_version;
Sandeep Puligilla3d6a8e22016-10-11 18:57:14 -07001429 uint32_t target_fw_vers_ext;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001430#ifdef WLAN_FEATURE_LPSS
1431 uint8_t lpss_support;
1432#endif
1433 uint8_t ap_arpns_support;
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08001434#ifdef FEATURE_GREEN_AP
1435 bool egap_support;
1436#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001437 bool wmi_ready;
1438 uint32_t wlan_init_status;
Anurag Chouhandf2b2682016-02-29 14:15:27 +05301439 qdf_device_t qdf_dev;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001440 uint32_t phy_capability;
1441 uint32_t max_frag_entry;
1442 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1443 wmi_resource_config wlan_resource_config;
1444 uint32_t frameTransRequired;
1445 tBssSystemRole wmaGlobalSystemRole;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301446 wma_tx_dwnld_comp_callback tx_frm_download_comp_cb;
Anurag Chouhance0dc992016-02-16 18:18:03 +05301447 qdf_event_t tx_frm_download_comp_event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001448 /*
1449 * Dummy event to wait for draining MSDUs left in hardware tx
1450 * queue and before requesting VDEV_STOP. Nobody will set this
1451 * and wait will timeout, and code will poll the pending tx
1452 * descriptors number to be zero.
1453 */
Anurag Chouhance0dc992016-02-16 18:18:03 +05301454 qdf_event_t tx_queue_empty_event;
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05301455 wma_tx_ota_comp_callback umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
1456 wma_tx_ota_comp_callback umac_data_ota_ack_cb;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301457 unsigned long last_umac_data_ota_timestamp;
Nirav Shahcbc6d722016-03-01 16:24:53 +05301458 qdf_nbuf_t last_umac_data_nbuf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001459 bool needShutdown;
1460 uint32_t num_mem_chunks;
Govind Singhf25a0f12016-03-08 16:09:48 +05301461 struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001462 wma_tgt_cfg_cb tgt_cfg_update_cb;
1463 wma_dfs_radar_indication_cb dfs_radar_indication_cb;
1464 HAL_REG_CAPABILITIES reg_cap;
1465 uint32_t scan_id;
1466 struct wma_txrx_node *interfaces;
1467 pdev_cli_config_t pdevconfig;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301468 qdf_list_t vdev_resp_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301469 qdf_spinlock_t vdev_respq_lock;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301470 qdf_list_t wma_hold_req_queue;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301471 qdf_spinlock_t wma_hold_req_q_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001472 uint32_t ht_cap_info;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001473 uint32_t vht_cap_info;
1474 uint32_t vht_supp_mcs;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001475 uint32_t num_rf_chains;
1476#if defined(QCA_WIFI_FTM)
1477 struct utf_event_info utf_event_info;
1478#endif
1479 uint8_t is_fw_assert;
1480 struct wma_wow wow;
1481 uint8_t no_of_suspend_ind;
1482 uint8_t no_of_resume_ind;
1483 /* Have a back up of arp info to send along
1484 * with ns info suppose if ns also enabled
1485 */
1486 tSirHostOffloadReq mArpInfo;
1487 struct wma_tx_ack_work_ctx *ack_work_ctx;
1488 uint8_t powersave_mode;
1489 bool ptrn_match_enable_all_vdev;
1490 void *pGetRssiReq;
1491 t_thermal_mgmt thermal_mgmt_info;
1492 bool roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001493 /* Here ol_ini_info is used to store ini
1494 * status of arp offload, ns offload
1495 * and others. Currently 1st bit is used
1496 * for arp off load and 2nd bit for ns
1497 * offload currently, rest bits are unused
1498 */
1499 uint8_t ol_ini_info;
1500 bool ssdp;
Komal Seelam9764a842016-05-24 11:07:23 +05301501 bool enable_mc_list;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001502 uint8_t ibss_started;
1503 tSetBssKeyParams ibsskey_info;
1504 struct ieee80211com *dfs_ic;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001505 txFailIndCallback hddTxFailCb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001506#ifdef FEATURE_WLAN_SCAN_PNO
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301507 qdf_wake_lock_t pno_wake_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001508#endif
1509#ifdef FEATURE_WLAN_EXTSCAN
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301510 qdf_wake_lock_t extscan_wake_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001511#endif
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301512 qdf_wake_lock_t wow_wake_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001513 int wow_nack;
Rajeev Kumar4c426622016-08-25 14:51:42 -07001514 bool wow_initial_wake_up;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301515 qdf_atomic_t is_wow_bus_suspended;
Anurag Chouhan210db072016-02-22 18:42:15 +05301516 qdf_mc_timer_t wma_scan_comp_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001517 uint8_t dfs_phyerr_filter_offload;
1518 bool suitable_ap_hb_failure;
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05301519 uint32_t suitable_ap_hb_failure_rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001520 ibss_power_save_params wma_ibss_power_save_params;
1521#ifdef FEATURE_WLAN_RA_FILTERING
1522 bool IsRArateLimitEnabled;
1523 uint16_t RArateLimitInterval;
1524#endif
1525#ifdef WLAN_FEATURE_LPSS
1526 bool is_lpass_enabled;
1527#endif
1528#ifdef WLAN_FEATURE_NAN
1529 bool is_nan_enabled;
1530#endif
1531 uint8_t staMaxLIModDtim;
1532 uint8_t staModDtim;
1533 uint8_t staDynamicDtim;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001534 uint8_t enable_mhf_offload;
1535 unsigned long last_mhf_entries_timestamp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001536 int32_t dfs_pri_multiplier;
1537 uint32_t hw_bd_id;
1538 uint32_t hw_bd_info[HW_BD_INFO_SIZE];
1539 uint32_t miracast_value;
Anurag Chouhan210db072016-02-22 18:42:15 +05301540 qdf_mc_timer_t log_completion_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001541 uint32_t num_dbs_hw_modes;
1542 struct dbs_hw_mode_info hw_mode;
1543 uint32_t old_hw_mode_index;
1544 uint32_t new_hw_mode_index;
Krunal Soni2e48d012016-05-02 16:55:26 -07001545 struct extended_caps phy_caps;
Anurag Chouhan8e0ccd32016-02-19 15:30:20 +05301546 qdf_atomic_t scan_id_counter;
Nitesh Shah0f3fce52016-10-13 22:01:41 +05301547 qdf_atomic_t num_pending_scans;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001548 wma_peer_authorized_fp peer_authorized_cb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001549 uint32_t wow_pno_match_wake_up_count;
1550 uint32_t wow_pno_complete_wake_up_count;
1551 uint32_t wow_gscan_wake_up_count;
1552 uint32_t wow_low_rssi_wake_up_count;
1553 uint32_t wow_rssi_breach_wake_up_count;
1554 uint32_t wow_ucast_wake_up_count;
1555 uint32_t wow_bcast_wake_up_count;
1556 uint32_t wow_ipv4_mcast_wake_up_count;
1557 uint32_t wow_ipv6_mcast_wake_up_count;
1558 uint32_t wow_ipv6_mcast_ra_stats;
1559 uint32_t wow_ipv6_mcast_ns_stats;
1560 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05301561 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05301562 uint32_t wow_icmpv6_count;
Selvaraj, Sridhar172cabc2016-07-05 15:19:24 +05301563 uint32_t wow_oem_response_wake_up_count;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001564
1565 /* OCB request contexts */
1566 struct sir_ocb_config *ocb_config_req;
1567 struct dual_mac_config dual_mac_cfg;
1568 struct {
1569 uint16_t pool_size;
1570 uint16_t num_free;
1571 union wmi_desc_elem_t *array;
1572 union wmi_desc_elem_t *freelist;
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301573 qdf_spinlock_t wmi_desc_pool_lock;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001574 } wmi_desc_pool;
1575 uint8_t max_scan;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001576 uint16_t self_gen_frm_pwr;
1577 bool tx_chain_mask_cck;
Chandrasekaran, Manishekarc8416922015-10-14 11:19:00 +05301578 /* Going with a timer instead of wait event because on receiving the
1579 * service ready event, we will be waiting on the MC thread for the
1580 * service extended ready event which is also processed in MC thread.
1581 * This leads to MC thread being stuck. Alternative was to process
1582 * these events in tasklet/workqueue context. But, this leads to
1583 * race conditions when the events are processed in two different
1584 * context. So, processing ready event and extended ready event in
1585 * the serialized MC thread context with a timer.
1586 */
Anurag Chouhan210db072016-02-22 18:42:15 +05301587 qdf_mc_timer_t service_ready_ext_timer;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001588 void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
1589 roam_offload_synch_ind *roam_synch_data,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -07001590 tpSirBssDescription bss_desc_ptr,
1591 enum sir_roam_op_code reason);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301592 QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001593 roam_offload_synch_ind *roam_synch_data,
1594 tpSirBssDescription bss_desc_ptr);
Anurag Chouhana37b5b72016-02-21 14:53:42 +05301595 qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
1596 qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
Houston Hoffmanc45db892015-11-13 19:59:25 -08001597 qdf_runtime_lock_t wma_runtime_resume_lock;
Krishna Kumaar Natarajan1ae49112015-11-24 21:43:22 -08001598 uint32_t fine_time_measurement_cap;
Rajeev Kumare5a16822016-07-27 13:11:42 -07001599 bool bpf_enabled;
Anurag Chouhan04dbf6d2016-09-08 15:32:52 +05301600 bool bpf_packet_filter_enable;
Komal Seelam02d09342016-02-23 18:03:19 +05301601 struct wma_ini_config ini_config;
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05301602 struct wma_valid_channels saved_chan;
Deepak Dhamdhere13230d32016-05-26 00:46:53 -07001603 /* NAN datapath support enabled in firmware */
1604 bool nan_datapath_enabled;
Naveen Rawat0fc3f692016-06-22 14:30:54 -07001605 QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07001606 cds_msg_t *msg);
Sandeep Puligillaafa52892016-10-26 19:03:16 -07001607 bool fw_timeout_crash;
Naveen Rawat64e477e2016-05-20 10:34:56 -07001608 bool sub_20_support;
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301609 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
1610 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07001611 tSirLLStatsResults *link_stats_results;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001612} t_wma_handle, *tp_wma_handle;
1613
1614/**
1615 * struct wma_target_cap - target capabality
1616 * @wmi_service_bitmap: wmi services bitmap
1617 * @wlan_resource_config: resource config
1618 */
1619struct wma_target_cap {
Anurag Chouhance0dc992016-02-16 18:18:03 +05301620 /* wmi services bitmap received from Target */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001621 uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
Anurag Chouhance0dc992016-02-16 18:18:03 +05301622 /* default resource config,the os shim can overwrite it */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001623 wmi_resource_config wlan_resource_config;
1624};
1625
1626/**
1627 * struct t_wma_start_req - wma start request parameters
1628 * @pConfigBuffer: config buffer
1629 * @usConfigBufferLen: Length of the config buffer above
1630 * @driver_type: Production or FTM driver
1631 * @pUserData: user data
1632 * @pIndUserData: indication function pointer to send to UMAC
1633 *
1634 * The shared memory between WDI and HAL is 4K so maximum data can be
1635 * transferred from WDI to HAL is 4K
1636 */
1637typedef struct {
1638 void *pConfigBuffer;
1639 uint16_t usConfigBufferLen;
1640 t_wma_drv_type driver_type;
1641 void *pUserData;
1642 void *pIndUserData;
1643} t_wma_start_req;
1644
1645/* Enumeration for Version */
1646typedef enum {
1647 WLAN_HAL_MSG_VERSION0 = 0,
1648 WLAN_HAL_MSG_VERSION1 = 1,
1649 WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
1650 WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
1651} tHalHostMsgVersion;
1652
1653/**
1654 * struct sHalMacStartParameter - mac start request parameters
1655 * @driverType: driver type (production/FTM)
1656 * @uConfigBufferLen: length of config buffer
1657 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301658typedef struct qdf_packed sHalMacStartParameter {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001659 tDriverType driverType;
1660 uint32_t uConfigBufferLen;
1661
1662 /* Following this there is a TLV formatted buffer of length
1663 * "uConfigBufferLen" bytes containing all config values.
1664 * The TLV is expected to be formatted like this:
1665 * 0 15 31 31+CFG_LEN-1 length-1
1666 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
1667 */
1668} tHalMacStartParameter, *tpHalMacStartParameter;
1669
1670extern void cds_wma_complete_cback(void *p_cds_context);
1671extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
1672 uint16_t regdmn5G, int8_t ctl2G,
1673 int8_t ctl5G);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001674/**
1675 * enum frame_index - Frame index
1676 * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
1677 * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
1678 * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
1679 * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
1680 * @FRAME_INDEX_MAX: maximum frame index
1681 */
1682enum frame_index {
1683 GENERIC_NODOWNLD_NOACK_COMP_INDEX,
1684 GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
1685 GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
1686 GENERIC_NODOWLOAD_ACK_COMP_INDEX,
1687 FRAME_INDEX_MAX
1688};
1689
1690/**
1691 * struct wma_tx_ack_work_ctx - tx ack work context
1692 * @wma_handle: wma handle
1693 * @sub_type: sub type
1694 * @status: status
1695 * @ack_cmp_work: work structure
1696 */
1697struct wma_tx_ack_work_ctx {
1698 tp_wma_handle wma_handle;
1699 uint16_t sub_type;
1700 int32_t status;
Anurag Chouhan42958bb2016-02-19 15:43:11 +05301701 qdf_work_t ack_cmp_work;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001702};
1703
1704/**
1705 * struct wma_target_req - target request parameters
1706 * @event_timeout: event timeout
1707 * @node: list
1708 * @user_data: user data
1709 * @msg_type: message type
1710 * @vdev_id: vdev id
1711 * @type: type
1712 */
1713struct wma_target_req {
Anurag Chouhan210db072016-02-22 18:42:15 +05301714 qdf_mc_timer_t event_timeout;
Anurag Chouhanffb21542016-02-17 14:33:03 +05301715 qdf_list_node_t node;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001716 void *user_data;
1717 uint32_t msg_type;
1718 uint8_t vdev_id;
1719 uint8_t type;
1720};
1721
1722/**
1723 * struct wma_vdev_start_req - vdev start request parameters
1724 * @beacon_intval: beacon interval
1725 * @dtim_period: dtim period
1726 * @max_txpow: max tx power
1727 * @chan_offset: channel offset
1728 * @is_dfs: is dfs supported or not
1729 * @vdev_id: vdev id
1730 * @chan: channel
1731 * @oper_mode: operating mode
1732 * @ssid: ssid
1733 * @hidden_ssid: hidden ssid
1734 * @pmf_enabled: is pmf enabled or not
1735 * @vht_capable: VHT capabality
1736 * @ht_capable: HT capabality
1737 * @dfs_pri_multiplier: DFS multiplier
1738 * @dot11_mode: 802.11 mode
1739 * @is_half_rate: is the channel operating at 10MHz
1740 * @is_quarter_rate: is the channel operating at 5MHz
1741 * @preferred_tx_streams: policy manager indicates the preferred
1742 * number of transmit streams
1743 * @preferred_rx_streams: policy manager indicates the preferred
1744 * number of receive streams
1745 */
1746struct wma_vdev_start_req {
1747 uint32_t beacon_intval;
1748 uint32_t dtim_period;
1749 int32_t max_txpow;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08001750 enum phy_ch_width chan_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001751 bool is_dfs;
1752 uint8_t vdev_id;
1753 uint8_t chan;
1754 uint8_t oper_mode;
1755 tSirMacSSid ssid;
1756 uint8_t hidden_ssid;
1757 uint8_t pmf_enabled;
1758 uint8_t vht_capable;
1759 uint8_t ch_center_freq_seg0;
1760 uint8_t ch_center_freq_seg1;
1761 uint8_t ht_capable;
1762 int32_t dfs_pri_multiplier;
1763 uint8_t dot11_mode;
1764 bool is_half_rate;
1765 bool is_quarter_rate;
1766 uint32_t preferred_tx_streams;
1767 uint32_t preferred_rx_streams;
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +05301768 uint8_t beacon_tx_rate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001769};
1770
1771/**
1772 * struct wma_set_key_params - set key parameters
1773 * @vdev_id: vdev id
1774 * @def_key_idx: used to see if we have to read the key from cfg
1775 * @key_len: key length
1776 * @peer_mac: peer mac address
1777 * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
1778 * @key_type: key type
1779 * @key_idx: key index
1780 * @unicast: unicast flag
1781 * @key_data: key data
1782 */
1783struct wma_set_key_params {
1784 uint8_t vdev_id;
1785 /* def_key_idx can be used to see if we have to read the key from cfg */
1786 uint32_t def_key_idx;
1787 uint16_t key_len;
1788 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1789 uint8_t singl_tid_rc;
1790 enum eAniEdType key_type;
1791 uint32_t key_idx;
1792 bool unicast;
1793 uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
1794};
1795
1796/**
1797 * struct t_thermal_cmd_params - thermal command parameters
1798 * @minTemp: minimum temprature
1799 * @maxTemp: maximum temprature
1800 * @thermalEnable: thermal enable
1801 */
1802typedef struct {
1803 uint16_t minTemp;
1804 uint16_t maxTemp;
1805 uint8_t thermalEnable;
1806} t_thermal_cmd_params, *tp_thermal_cmd_params;
1807
1808/**
1809 * enum wma_cfg_cmd_id - wma cmd ids
1810 * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
1811 * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
1812 * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
1813 * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
1814 * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
1815 * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
1816 * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
1817 * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
1818 * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
1819 * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
1820 * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
1821 * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
1822 * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
1823 * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
1824 *
1825 * wma command ids for configuration request which
1826 * does not involve sending a wmi command.
1827 */
1828enum wma_cfg_cmd_id {
1829 WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
1830 WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
1831 WMA_VDEV_MCC_SET_TIME_LATENCY,
1832 WMA_VDEV_MCC_SET_TIME_QUOTA,
1833 WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
1834 WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
1835 WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
1836 WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
1837 WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
1838 WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
1839 WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
1840 WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
1841 WMA_VDEV_DFS_CONTROL_CMDID,
1842 WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
1843 WMA_CMD_ID_MAX
1844};
1845
1846/**
1847 * struct wma_trigger_uapsd_params - trigger uapsd parameters
1848 * @wmm_ac: wmm access catagory
1849 * @user_priority: user priority
1850 * @service_interval: service interval
1851 * @suspend_interval: suspend interval
1852 * @delay_interval: delay interval
1853 */
1854typedef struct wma_trigger_uapsd_params {
1855 uint32_t wmm_ac;
1856 uint32_t user_priority;
1857 uint32_t service_interval;
1858 uint32_t suspend_interval;
1859 uint32_t delay_interval;
1860} t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
1861
1862/**
1863 * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
1864 * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
1865 * @UAPSD_MAX_SP_LEN_2: max service period = 2
1866 * @UAPSD_MAX_SP_LEN_4: max service period = 4
1867 * @UAPSD_MAX_SP_LEN_6: max service period = 6
1868 */
1869enum uapsd_peer_param_max_sp {
1870 UAPSD_MAX_SP_LEN_UNLIMITED = 0,
1871 UAPSD_MAX_SP_LEN_2 = 2,
1872 UAPSD_MAX_SP_LEN_4 = 4,
1873 UAPSD_MAX_SP_LEN_6 = 6
1874};
1875
1876/**
1877 * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
1878 * @UAPSD_VO_ENABLED: enable uapsd for voice
1879 * @UAPSD_VI_ENABLED: enable uapsd for video
1880 * @UAPSD_BK_ENABLED: enable uapsd for background
1881 * @UAPSD_BE_ENABLED: enable uapsd for best effort
1882 */
1883enum uapsd_peer_param_enabled_ac {
1884 UAPSD_VO_ENABLED = 0x01,
1885 UAPSD_VI_ENABLED = 0x02,
1886 UAPSD_BK_ENABLED = 0x04,
1887 UAPSD_BE_ENABLED = 0x08
1888};
1889
1890/**
Govind Singha471e5e2015-10-12 17:11:14 +05301891 * enum profile_id_t - Firmware profiling index
1892 * @PROF_CPU_IDLE: cpu idle profile
1893 * @PROF_PPDU_PROC: ppdu processing profile
1894 * @PROF_PPDU_POST: ppdu post profile
1895 * @PROF_HTT_TX_INPUT: htt tx input profile
1896 * @PROF_MSDU_ENQ: msdu enqueue profile
1897 * @PROF_PPDU_POST_HAL: ppdu post profile
1898 * @PROF_COMPUTE_TX_TIME: tx time profile
1899 * @PROF_MAX_ID: max profile index
1900 */
1901enum profile_id_t {
1902 PROF_CPU_IDLE,
1903 PROF_PPDU_PROC,
1904 PROF_PPDU_POST,
1905 PROF_HTT_TX_INPUT,
1906 PROF_MSDU_ENQ,
1907 PROF_PPDU_POST_HAL,
1908 PROF_COMPUTE_TX_TIME,
1909 PROF_MAX_ID,
1910};
1911
1912/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001913 * struct p2p_ie - P2P IE structural definition.
1914 * @p2p_id: p2p id
1915 * @p2p_len: p2p length
1916 * @p2p_oui: p2p OUI
1917 * @p2p_oui_type: p2p OUI type
1918 */
1919struct p2p_ie {
1920 uint8_t p2p_id;
1921 uint8_t p2p_len;
1922 uint8_t p2p_oui[3];
1923 uint8_t p2p_oui_type;
1924} __packed;
1925
1926/**
1927 * struct p2p_noa_descriptor - noa descriptor
1928 * @type_count: 255: continuous schedule, 0: reserved
1929 * @duration: Absent period duration in micro seconds
1930 * @interval: Absent period interval in micro seconds
1931 * @start_time: 32 bit tsf time when in starts
1932 */
1933struct p2p_noa_descriptor {
1934 uint8_t type_count;
1935 uint32_t duration;
1936 uint32_t interval;
1937 uint32_t start_time;
1938} __packed;
1939
1940/**
1941 * struct p2p_sub_element_noa - p2p noa element
1942 * @p2p_sub_id: p2p sub id
1943 * @p2p_sub_len: p2p sub length
1944 * @index: identifies instance of NOA su element
1945 * @oppPS: oppPS state of the AP
1946 * @ctwindow: ctwindow in TUs
1947 * @num_descriptors: number of NOA descriptors
1948 * @noa_descriptors: noa descriptors
1949 */
1950struct p2p_sub_element_noa {
1951 uint8_t p2p_sub_id;
1952 uint8_t p2p_sub_len;
1953 uint8_t index; /* identifies instance of NOA su element */
1954 uint8_t oppPS:1, /* oppPS state of the AP */
1955 ctwindow:7; /* ctwindow in TUs */
1956 uint8_t num_descriptors; /* number of NOA descriptors */
1957 struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
1958};
1959
1960/**
1961 * struct wma_decap_info_t - decapsulation info
1962 * @hdr: header
1963 * @hdr_len: header length
1964 */
1965struct wma_decap_info_t {
1966 uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
1967 int32_t hdr_len;
1968};
1969
1970/**
1971 * enum packet_power_save - packet power save params
1972 * @WMI_VDEV_PPS_PAID_MATCH: paid match param
1973 * @WMI_VDEV_PPS_GID_MATCH: gid match param
1974 * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
1975 * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
1976 * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
1977 * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
1978 * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
1979 * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
1980 * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
1981 * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
1982 */
1983typedef enum {
1984 WMI_VDEV_PPS_PAID_MATCH = 0,
1985 WMI_VDEV_PPS_GID_MATCH = 1,
1986 WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
1987 WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
1988 WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
1989 WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
1990 WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
1991 WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
1992 WMI_VDEV_PPS_RSSI_CHECK = 8,
1993 WMI_VDEV_VHT_SET_GID_MGMT = 9,
1994 WMI_VDEV_PPS_5G_EBT = 10
1995} packet_power_save;
1996
1997/**
1998 * enum green_tx_param - green tx parameters
1999 * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
2000 * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
2001 * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
2002 * @WMI_VDEV_PARAM_GTX_THRE: thre param
2003 * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
2004 * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
2005 * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
2006 * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
2007 */
2008typedef enum {
2009 WMI_VDEV_PARAM_GTX_HT_MCS,
2010 WMI_VDEV_PARAM_GTX_VHT_MCS,
2011 WMI_VDEV_PARAM_GTX_USR_CFG,
2012 WMI_VDEV_PARAM_GTX_THRE,
2013 WMI_VDEV_PARAM_GTX_MARGIN,
2014 WMI_VDEV_PARAM_GTX_STEP,
2015 WMI_VDEV_PARAM_GTX_MINTPC,
2016 WMI_VDEV_PARAM_GTX_BW_MASK,
2017} green_tx_param;
2018
2019#ifdef FEATURE_WLAN_TDLS
2020/**
2021 * struct wma_tdls_params - TDLS parameters
2022 * @vdev_id: vdev id
2023 * @tdls_state: TDLS state
2024 * @notification_interval_ms: notification inerval
2025 * @tx_discovery_threshold: tx discovery threshold
2026 * @tx_teardown_threshold: tx teardown threashold
2027 * @rssi_teardown_threshold: RSSI teardown threshold
2028 * @rssi_delta: RSSI delta
2029 * @tdls_options: TDLS options
2030 * @peer_traffic_ind_window: raffic indication window
2031 * @peer_traffic_response_timeout: traffic response timeout
2032 * @puapsd_mask: uapsd mask
2033 * @puapsd_inactivity_time: uapsd inactivity time
2034 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
Kabilan Kannanca670be2015-11-23 01:56:12 -08002035 * @teardown_notification_ms: tdls teardown notification interval
Kabilan Kannan421714b2015-11-23 04:44:59 -08002036 * @tdls_peer_kickout_threshold: tdls packet threshold for
2037 * peer kickout operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002038 */
2039typedef struct wma_tdls_params {
2040 uint32_t vdev_id;
2041 uint32_t tdls_state;
2042 uint32_t notification_interval_ms;
2043 uint32_t tx_discovery_threshold;
2044 uint32_t tx_teardown_threshold;
2045 int32_t rssi_teardown_threshold;
2046 int32_t rssi_delta;
2047 uint32_t tdls_options;
2048 uint32_t peer_traffic_ind_window;
2049 uint32_t peer_traffic_response_timeout;
2050 uint32_t puapsd_mask;
2051 uint32_t puapsd_inactivity_time;
2052 uint32_t puapsd_rx_frame_threshold;
Kabilan Kannanca670be2015-11-23 01:56:12 -08002053 uint32_t teardown_notification_ms;
Kabilan Kannan421714b2015-11-23 04:44:59 -08002054 uint32_t tdls_peer_kickout_threshold;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002055} t_wma_tdls_params;
2056
2057/**
2058 * struct wma_tdls_peer_event - TDLS peer event
2059 * @vdev_id: vdev id
2060 * @peer_macaddr: peer MAC address
2061 * @peer_status: TDLS peer status
2062 * @peer_reason: TDLS peer reason
2063 */
2064typedef struct {
2065 A_UINT32 vdev_id;
2066 wmi_mac_addr peer_macaddr;
2067 A_UINT32 peer_status;
2068 A_UINT32 peer_reason;
2069} wma_tdls_peer_event;
2070
2071#endif /* FEATURE_WLAN_TDLS */
2072
2073/**
2074 * struct wma_dfs_radar_channel_list - dfs radar channel list
2075 * @nchannels: nuber of channels
2076 * @channels: Channel number including bonded channels on which
2077 * radar is present
2078 */
2079struct wma_dfs_radar_channel_list {
2080 A_UINT32 nchannels;
2081 uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
2082};
2083
2084/**
2085 * struct wma_dfs_radar_indication - Structure to indicate RADAR
2086 * @vdev_id: vdev id
2087 * @chan_list: Channel list on which RADAR is detected
2088 * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
2089 * @use_nol: Flag to indicate use NOL
2090 */
2091struct wma_dfs_radar_indication {
2092 A_UINT32 vdev_id;
2093 struct wma_dfs_radar_channel_list chan_list;
2094 uint32_t dfs_radar_status;
2095 int use_nol;
2096};
2097
2098/**
2099 * enum uapsd_ac - U-APSD Access Categories
2100 * @UAPSD_BE: best effort
2101 * @UAPSD_BK: back ground
2102 * @UAPSD_VI: video
2103 * @UAPSD_VO: voice
2104 */
2105enum uapsd_ac {
2106 UAPSD_BE,
2107 UAPSD_BK,
2108 UAPSD_VI,
2109 UAPSD_VO
2110};
2111
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302112QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002113 uint32_t vdev_id, enum uapsd_ac ac);
2114
2115/**
2116 * enum uapsd_up - U-APSD User Priorities
2117 * @UAPSD_UP_BE: best effort
2118 * @UAPSD_UP_BK: back ground
2119 * @UAPSD_UP_RESV: reserve
2120 * @UAPSD_UP_EE: Excellent Effort
2121 * @UAPSD_UP_CL: Critical Applications
2122 * @UAPSD_UP_VI: video
2123 * @UAPSD_UP_VO: voice
2124 * @UAPSD_UP_NC: Network Control
2125 */
2126enum uapsd_up {
2127 UAPSD_UP_BE,
2128 UAPSD_UP_BK,
2129 UAPSD_UP_RESV,
2130 UAPSD_UP_EE,
2131 UAPSD_UP_CL,
2132 UAPSD_UP_VI,
2133 UAPSD_UP_VO,
2134 UAPSD_UP_NC,
2135 UAPSD_UP_MAX
2136};
2137
2138/**
2139 * struct wma_unit_test_cmd - unit test command parameters
2140 * @vdev_id: vdev id
2141 * @module_id: module id
2142 * @num_args: number of arguments
2143 * @args: arguments
2144 */
2145typedef struct wma_unit_test_cmd {
2146 uint32_t vdev_id;
2147 WLAN_MODULE_ID module_id;
2148 uint32_t num_args;
2149 uint32_t args[WMA_MAX_NUM_ARGS];
2150} t_wma_unit_test_cmd;
2151
2152/**
2153 * struct wma_roam_invoke_cmd - roam invoke command
2154 * @vdev_id: vdev id
2155 * @bssid: mac address
2156 * @channel: channel
2157 */
2158struct wma_roam_invoke_cmd {
2159 uint32_t vdev_id;
2160 uint8_t bssid[IEEE80211_ADDR_LEN];
2161 uint32_t channel;
2162};
2163
2164/**
2165 * struct wma_process_fw_event_params - fw event parameters
2166 * @wmi_handle: wmi handle
2167 * @evt_buf: event buffer
2168 */
2169typedef struct {
2170 void *wmi_handle;
2171 void *evt_buf;
2172} wma_process_fw_event_params;
2173
Govind Singhd76a5b02016-03-08 15:12:14 +05302174int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002175
2176A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
2177 eCsrEncryptionType encr);
2178A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
2179
2180/*
2181 * WMA-DFS Hooks
2182 */
2183int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
2184uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
2185int ol_if_dfs_disable(struct ieee80211com *ic);
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05302186struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002187 int freq, uint32_t flags);
2188int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
2189uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
2190int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
2191int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
2192 uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
2193 uint32_t *txf_pcnt);
2194uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
2195void ieee80211_mark_dfs(struct ieee80211com *ic,
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05302196 struct dfs_ieee80211_channel *ichan);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002197int wma_dfs_indicate_radar(struct ieee80211com *ic,
Chandrasekaran, Manishekar22a7e1e2015-11-05 10:38:49 +05302198 struct dfs_ieee80211_channel *ichan);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002199
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302200QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002201 tp_wma_trigger_uapsd_params
2202 trigger_uapsd_params);
2203
2204/* added to get average snr for both data and beacon */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302205QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002206
2207
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302208QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
Leo Chang96464902016-10-28 11:10:54 -07002209 void *tx_rx_vdev_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002210 uint8_t *mac, uint32_t vdev_type, bool add_del);
2211
2212void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
2213void wma_log_completion_timeout(void *data);
2214
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302215QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002216 struct rssi_monitor_req *req);
2217
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302218QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
2219 struct wmi_pcl_chan_weights *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002220
Manishekar Chandrasekarand9640342016-04-27 12:28:26 +05302221QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002222 struct sir_hw_mode *msg);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302223QDF_STATUS wma_get_scan_id(uint32_t *scan_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002224
Manishekar Chandrasekaran5d46f702016-04-27 12:50:52 +05302225QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002226 struct sir_dual_mac_config *msg);
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002227QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
2228 struct sir_antenna_mode_param *msg);
Govind Singhd76a5b02016-03-08 15:12:14 +05302229QDF_STATUS wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002230 uint32_t delay_time_ms);
2231
2232struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
2233 uint8_t vdev_id,
2234 uint32_t msg_type, uint8_t type,
2235 void *params, uint32_t timeout);
2236struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
2237 uint8_t vdev_id, uint32_t msg_type,
2238 uint8_t type, void *params,
2239 uint32_t timeout);
2240
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302241QDF_STATUS wma_vdev_start(tp_wma_handle wma,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002242 struct wma_vdev_start_req *req, bool isRestart);
2243
2244void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
2245 uint8_t type);
2246
2247int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
2248void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
2249struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
2250void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
2251int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
2252 uint32_t len);
Nirav Shah20489972016-06-16 19:20:28 +05302253int wma_mgmt_tx_bundle_completion_handler(void *handle,
2254 uint8_t *cmpl_event_params, uint32_t len);
Amar Singhal604ba6cf2016-07-27 15:29:51 -07002255void wma_set_dfs_region(tp_wma_handle wma, enum dfs_region dfs_region);
Naveen Rawatc0c91cd2015-11-05 14:27:37 -08002256uint32_t wma_get_vht_ch_width(void);
Govind Singhd76a5b02016-03-08 15:12:14 +05302257QDF_STATUS
2258wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
2259 A_UINT32 val, A_UINT32 *module_id_bitmap,
2260 A_UINT32 bitmap_len);
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002261#ifdef FEATURE_LFR_SUBNET_DETECTION
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302262QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002263 struct gateway_param_update_req *req);
2264#else
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302265static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002266 struct gateway_param_update_req *req)
2267{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302268 return QDF_STATUS_SUCCESS;
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08002269}
2270#endif /* FEATURE_LFR_SUBNET_DETECTION */
2271
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002272#if defined(FEATURE_LRO)
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302273QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002274 struct wma_lro_config_cmd_t *wma_lro_cmd);
2275#else
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302276static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002277 struct wma_lro_config_cmd_t *wma_lro_cmd)
2278{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302279 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002280}
2281#endif
Dhanashri Atre1f0cbe42015-11-19 10:56:53 -08002282void
2283wma_indicate_err(enum ol_rx_err_type err_type,
2284 struct ol_error_info *err_info);
Sandeep Puligillae0875662016-02-12 16:09:21 -08002285
2286QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
2287 int32_t vdev_id);
Anurag Chouhanbf5e0e22016-09-12 12:54:09 +05302288
2289void wma_process_fw_test_cmd(WMA_HANDLE handle,
2290 struct set_fwtest_params *wma_fwtest);
2291
Sandeep Puligillae0875662016-02-12 16:09:21 -08002292QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
2293 struct obss_ht40_scanind *req);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05302294
2295int wma_get_bpf_caps_event_handler(void *handle,
2296 u_int8_t *cmd_param_info,
2297 u_int32_t len);
Krunal Soniaa664da2016-06-15 23:46:40 -07002298uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05302299QDF_STATUS wma_get_bpf_capabilities(tp_wma_handle wma);
2300QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma,
2301 struct sir_bpf_set_offload *bpf_set_offload);
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002302void wma_process_set_pdev_ie_req(tp_wma_handle wma,
2303 struct set_ie_param *ie_params);
2304void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
2305 struct set_ie_param *ie_params);
2306void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
2307 struct set_ie_param *ie_params);
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002308void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
Leo Chang96464902016-10-28 11:10:54 -07002309 u_int8_t vdev_id, void *peer,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -07002310 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002311
2312QDF_STATUS wma_add_wow_wakeup_event(tp_wma_handle wma,
2313 uint32_t vdev_id,
2314 uint32_t bitmap,
2315 bool enable);
Leo Chang96464902016-10-28 11:10:54 -07002316QDF_STATUS wma_create_peer(tp_wma_handle wma, void *pdev,
2317 void *vdev, u8 peer_addr[6],
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07002318 u_int32_t peer_type, u_int8_t vdev_id,
2319 bool roam_synch_in_progress);
Naveen Rawate82c1f32016-06-22 15:34:36 -07002320
Komal Seelam02d09342016-02-23 18:03:19 +05302321struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
Abhishek Singh1c676222016-05-09 14:20:28 +05302322WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
2323 u8 dot11_mode);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002324
2325#ifdef FEATURE_OEM_DATA_SUPPORT
2326QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07002327 struct oem_data_req *oem_req);
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -07002328#endif
Selvaraj, Sridharebda0f22016-08-29 16:05:23 +05302329
2330QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
2331 uint8_t val);
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05302332void wma_register_packetdump_callback(
2333 tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb,
2334 tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb);
2335void wma_deregister_packetdump_callback(void);
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302336void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
2337 struct sme_sta_inactivity_timeout *sta_inactivity_timer);
Leo Chang96464902016-10-28 11:10:54 -07002338void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
2339 uint8_t vdev_id, bool hash_based, uint8_t ring_num);
2340int wma_peer_rx_reorder_queue_setup(void *scn_handle,
2341 uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
2342 int tid, uint16_t queue_no);
2343int wma_peer_rx_reorder_queue_remove(void *scn_handle,
2344 uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302345
2346/**
2347 * wma_form_rx_packet() - form rx cds packet
2348 * @buf: buffer
2349 * @mgmt_rx_params: mgmt rx params
2350 * @rx_pkt: cds packet
2351 *
2352 * This functions forms a cds packet from the rx mgmt frame received.
2353 *
2354 * Return: 0 for success or error code
2355 */
2356int wma_form_rx_packet(qdf_nbuf_t buf,
2357 void *mgmt_rx_params,
2358 cds_pkt_t *rx_pkt);
2359
2360/**
2361 * wma_mgmt_unified_cmd_send() - send the mgmt tx packet
2362 * @vdev: objmgr vdev
2363 * @buf: buffer
2364 * @desc_id: desc id
2365 * @mgmt_tx_params: mgmt rx params
2366 *
2367 * This functions sends mgmt tx packet to WMI layer.
2368 *
2369 * Return: 0 for success or error code
2370 */
2371QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
2372 qdf_nbuf_t buf, uint32_t desc_id,
2373 void *mgmt_tx_params);
2374#endif