blob: 9bb8deeefdcd0f05fbf39aea07925321ed4bc440 [file] [log] [blame]
Govind Singh3ddda1f2016-03-09 11:34:12 +05301/*
2 * Copyright (c) 2016 The Linux Foundation. All rights reserved.
3 *
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/*
29 * This file contains the API definitions for the Unified Wireless Module
30 * Interface (WMI).
31 */
32
33#ifndef _WMI_UNIFIED_PARAM_H_
34#define _WMI_UNIFIED_PARAM_H_
35#include "wmi_unified.h"
36#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
Govind Singh3ddda1f2016-03-09 11:34:12 +053037#define WMI_MAC_MAX_SSID_LENGTH 32
38#define WMI_SCAN_MAX_NUM_SSID 0x0A
39#define mgmt_tx_dl_frm_len 64
40#define WMI_SMPS_MASK_LOWER_16BITS 0xFF
41#define WMI_SMPS_MASK_UPPER_3BITS 0x7
42#define WMI_SMPS_PARAM_VALUE_S 29
Govind Singhae855362016-03-07 14:24:22 +053043#define WMI_MAX_NUM_ARGS 8
Govind Singhe7b800c2016-03-01 15:30:53 +053044/* The size of the utc time in bytes. */
45#define WMI_SIZE_UTC_TIME (10)
46/* The size of the utc time error in bytes. */
47#define WMI_SIZE_UTC_TIME_ERROR (5)
Govind Singh9bad0002016-03-01 15:54:59 +053048#define WMI_MCC_MIN_CHANNEL_QUOTA 20
49#define WMI_MCC_MAX_CHANNEL_QUOTA 80
50#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
51#define WMI_BEACON_TX_BUFFER_SIZE (512)
52#define WMI_WIFI_SCANNING_MAC_OUI_LENGTH 3
53#define WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
54#define WMI_RSSI_THOLD_DEFAULT -300
55#define WMI_NLO_FREQ_THRESH 1000
56#define WMI_SEC_TO_MSEC(sec) (sec * 1000)
57#define WMI_MSEC_TO_USEC(msec) (msec * 1000)
58#define WMI_ETH_LEN 64
59#define WMI_QOS_NUM_TSPEC_MAX 2
60#define WMI_QOS_NUM_AC_MAX 4
Govind Singhae855362016-03-07 14:24:22 +053061#define WMI_IPV4_ADDR_LEN 4
62#define WMI_KEEP_ALIVE_NULL_PKT 1
63#define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +053064#define WMI_MAC_MAX_KEY_LENGTH 32
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +053065#define WMI_KRK_KEY_LEN 16
66#ifdef WLAN_FEATURE_ROAM_OFFLOAD
67#define WMI_BTK_KEY_LEN 32
68#define WMI_ROAM_R0KH_ID_MAX_LEN 48
69#define WMI_ROAM_SCAN_PSK_SIZE 32
70#endif
71#define WMI_NOISE_FLOOR_DBM_DEFAULT (-96)
Govind Singh89727882016-04-15 13:58:27 +053072#define WMI_MAC_IPV6_ADDR_LEN 16
Govind Singhae855362016-03-07 14:24:22 +053073#ifdef WLAN_NS_OFFLOAD
Govind Singhc7cd2d62016-06-21 14:33:26 +053074#define WMI_OFFLOAD_DISABLE 0
75#define WMI_OFFLOAD_ENABLE 1
Govind Singhae855362016-03-07 14:24:22 +053076/* support only one IPv6 offload */
77#define WMI_MAC_NS_OFFLOAD_SIZE 1
78/* Number of target IP V6 addresses for NS offload */
79#define WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16
Govind Singhae855362016-03-07 14:24:22 +053080#define WMI_IPV6_ADDR_VALID 1
81#endif /* WLAN_NS_OFFLOAD */
82#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
83#define WMI_ROAM_MAX_CHANNELS 80
Govind Singhd7468a52016-03-09 14:32:57 +053084#ifdef FEATURE_WLAN_EXTSCAN
85#define WMI_MAX_EXTSCAN_MSG_SIZE 1536
86#define WMI_EXTSCAN_REST_TIME 100
87#define WMI_EXTSCAN_MAX_SCAN_TIME 50000
88#define WMI_EXTSCAN_BURST_DURATION 150
89#endif
90#define WMI_SCAN_NPROBES_DEFAULT (2)
91#define WMI_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
92#define WMI_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
93#define WMI_NLO_FREQ_THRESH 1000 /* in MHz */
Govind Singh89727882016-04-15 13:58:27 +053094
95#define MAX_UTF_EVENT_LENGTH 2048
96#define MAX_WMI_UTF_LEN 252
97#define MAX_WMI_QVIT_LEN 252
98#define THERMAL_LEVELS 4
99#define WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES 256
100#define WMI_HOST_BCN_FLT_MAX_ELEMS_IE_LIST \
101 (WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES/32)
102#define LTEU_MAX_BINS 10
103#define ATF_ACTIVED_MAX_CLIENTS 50
104#define ATF_ACTIVED_MAX_ATFGROUPS 8
105#define CTL_5G_SIZE 1536
106#define CTL_2G_SIZE 684
107#define MAX_CTL_SIZE (CTL_5G_SIZE > CTL_2G_SIZE ? CTL_5G_SIZE : CTL_2G_SIZE)
108#define IEEE80211_MICBUF_SIZE (8+8)
109#define IEEE80211_TID_SIZE 17
110#define WME_NUM_AC 4
111#define SMART_ANT_MODE_SERIAL 0
112#define SMART_ANT_MODE_PARALLEL 1
113#define IEEE80211_WEP_NKID 4 /* number of key ids */
114#define WPI_IV_LEN 16
115#define WMI_SCAN_MAX_NUM_BSSID 10
116#define MAX_CHANS 1023
117#define TARGET_OEM_CONFIGURE_LCI 0x0A
118#define RTT_LCI_ALTITUDE_MASK 0x3FFFFFFF
119#define TARGET_OEM_CONFIGURE_LCR 0x09
120#define RTT_TIMEOUT_MS 180
121#define MAX_SUPPORTED_RATES 128
122#define WMI_HOST_MAX_BUFFER_SIZE 1712
Govind Singh41da3152016-05-06 20:20:25 +0530123#define WMI_HAL_MAX_SANTENNA 4
Govind Singh89727882016-04-15 13:58:27 +0530124
125#define WMI_HOST_F_MS(_v, _f) \
126 (((_v) & (_f)) >> (_f##_S))
127
128#define WMI_HOST_F_RMW(_var, _v, _f) \
129 do { \
130 (_var) &= ~(_f); \
131 (_var) |= (((_v) << (_f##_S)) & (_f)); \
132 } while (0)
133
134/* TXBF capabilities masks */
135#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_S 0
136#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_M 0x1
137#define WMI_HOST_TXBF_CONF_SU_TX_BFEE \
138 (WMI_HOST_TXBF_CONF_SU_TX_BFEE_M << WMI_HOST_TXBF_CONF_SU_TX_BFEE_S)
139#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_GET(x) \
140 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
141#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_SET(x, z) \
142 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
143
144#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_S 1
145#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_M 0x1
146#define WMI_HOST_TXBF_CONF_MU_TX_BFEE \
147 (WMI_HOST_TXBF_CONF_MU_TX_BFEE_M << WMI_HOST_TXBF_CONF_MU_TX_BFEE_S)
148#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_GET(x) \
149 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
150#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_SET(x, z) \
151 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
152
153#define WMI_HOST_TXBF_CONF_SU_TX_BFER_S 2
154#define WMI_HOST_TXBF_CONF_SU_TX_BFER_M 0x1
155#define WMI_HOST_TXBF_CONF_SU_TX_BFER \
156 (WMI_HOST_TXBF_CONF_SU_TX_BFER_M << WMI_HOST_TXBF_CONF_SU_TX_BFER_S)
157#define WMI_HOST_TXBF_CONF_SU_TX_BFER_GET(x) \
158 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFER)
159#define WMI_HOST_TXBF_CONF_SU_TX_BFER_SET(x, z) \
160 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFER)
161
162#define WMI_HOST_TXBF_CONF_MU_TX_BFER_S 3
163#define WMI_HOST_TXBF_CONF_MU_TX_BFER_M 0x1
164#define WMI_HOST_TXBF_CONF_MU_TX_BFER \
165 (WMI_HOST_TXBF_CONF_MU_TX_BFER_M << WMI_HOST_TXBF_CONF_MU_TX_BFER_S)
166#define WMI_HOST_TXBF_CONF_MU_TX_BFER_GET(x) \
167 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFER)
168#define WMI_HOST_TXBF_CONF_MU_TX_BFER_SET(x, z) \
169 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFER)
170
171#define WMI_HOST_TXBF_CONF_STS_CAP_S 4
172#define WMI_HOST_TXBF_CONF_STS_CAP_M 0x7
173#define WMI_HOST_TXBF_CONF_STS_CAP \
174 (WMI_HOST_TXBF_CONF_STS_CAP_M << WMI_HOST_TXBF_CONF_STS_CAP_S)
175#define WMI_HOST_TXBF_CONF_STS_CAP_GET(x) \
176 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_STS_CAP);
177#define WMI_HOST_TXBF_CONF_STS_CAP_SET(x, z) \
178 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_STS_CAP)
179
180#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_S 7
181#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_M 0x1
182#define WMI_HOST_TXBF_CONF_IMPLICIT_BF \
183 (WMI_HOST_TXBF_CONF_IMPLICIT_BF_M << WMI_HOST_TXBF_CONF_IMPLICIT_BF_S)
184#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_GET(x) \
185 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
186#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_SET(x, z) \
187 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
188
189#define WMI_HOST_TXBF_CONF_BF_SND_DIM_S 8
190#define WMI_HOST_TXBF_CONF_BF_SND_DIM_M 0x7
191#define WMI_HOST_TXBF_CONF_BF_SND_DIM \
192 (WMI_HOST_TXBF_CONF_BF_SND_DIM_M << WMI_HOST_TXBF_CONF_BF_SND_DIM_S)
193#define WMI_HOST_TXBF_CONF_BF_SND_DIM_GET(x) \
194 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_BF_SND_DIM)
195#define WMI_HOST_TXBF_CONF_BF_SND_DIM_SET(x, z) \
196 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_BF_SND_DIM)
197
198#define WMI_HOST_TPC_RATE_MAX 160
199#define WMI_HOST_TPC_TX_NUM_CHAIN 4
200#define WMI_HOST_RXG_CAL_CHAN_MAX 4
201#define WMI_HOST_MAX_NUM_CHAINS 4
Poddar, Siddarth794b9962016-04-28 15:49:11 +0530202#define WMI_MAX_NUM_OF_RATE_THRESH 4
Govind Singh89727882016-04-15 13:58:27 +0530203
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530204#include "qdf_atomic.h"
Govind Singhd7468a52016-03-09 14:32:57 +0530205
Govind Singh89727882016-04-15 13:58:27 +0530206#ifdef BIG_ENDIAN_HOST
207 /* This API is used in copying in elements to WMI message,
208 since WMI message uses multilpes of 4 bytes, This API
209 converts length into multiples of 4 bytes, and performs copy
210 */
211#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) do { \
212 int j; \
213 u_int32_t *src, *dest; \
214 src = (u_int32_t *)srcp; \
215 dest = (u_int32_t *)destp; \
216 for (j = 0; j < roundup(len, sizeof(u_int32_t))/4; j++) { \
217 *(dest+j) = qdf_le32_to_cpu(*(src+j)); \
218 } \
219} while (0)
220#else
221
222#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) OS_MEMCPY(destp,\
223 srcp, len)
224
225#endif
226
227/** macro to convert MAC address from WMI word format to char array */
228#define WMI_HOST_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
229 (c_macaddr)[0] = ((pwmi_mac_addr)->mac_addr31to0) & 0xff; \
230 (c_macaddr)[1] = (((pwmi_mac_addr)->mac_addr31to0) >> 8) & 0xff; \
231 (c_macaddr)[2] = (((pwmi_mac_addr)->mac_addr31to0) >> 16) & 0xff; \
232 (c_macaddr)[3] = (((pwmi_mac_addr)->mac_addr31to0) >> 24) & 0xff; \
233 (c_macaddr)[4] = ((pwmi_mac_addr)->mac_addr47to32) & 0xff; \
234 (c_macaddr)[5] = (((pwmi_mac_addr)->mac_addr47to32) >> 8) & 0xff; \
235 } while (0)
236
237#define TARGET_INIT_STATUS_SUCCESS 0x0
238#define TARGET_INIT_STATUS_GEN_FAILED 0x1
239#define TARGET_GET_INIT_STATUS_REASON(status) ((status) & 0xffff)
240#define TARGET_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff)
241typedef uint32_t TARGET_INIT_STATUS;
242
243typedef enum {
244 WMI_HOST_MODE_11A = 0, /* 11a Mode */
245 WMI_HOST_MODE_11G = 1, /* 11b/g Mode */
246 WMI_HOST_MODE_11B = 2, /* 11b Mode */
247 WMI_HOST_MODE_11GONLY = 3, /* 11g only Mode */
248 WMI_HOST_MODE_11NA_HT20 = 4, /* 11a HT20 mode */
249 WMI_HOST_MODE_11NG_HT20 = 5, /* 11g HT20 mode */
250 WMI_HOST_MODE_11NA_HT40 = 6, /* 11a HT40 mode */
251 WMI_HOST_MODE_11NG_HT40 = 7, /* 11g HT40 mode */
252 WMI_HOST_MODE_11AC_VHT20 = 8,
253 WMI_HOST_MODE_11AC_VHT40 = 9,
254 WMI_HOST_MODE_11AC_VHT80 = 10,
255 WMI_HOST_MODE_11AC_VHT20_2G = 11,
256 WMI_HOST_MODE_11AC_VHT40_2G = 12,
257 WMI_HOST_MODE_11AC_VHT80_2G = 13,
258 WMI_HOST_MODE_11AC_VHT80_80 = 14,
259 WMI_HOST_MODE_11AC_VHT160 = 15,
260 WMI_HOST_MODE_UNKNOWN = 16,
261 WMI_HOST_MODE_MAX = 16
262} WMI_HOST_WLAN_PHY_MODE;
263
264
Gupta, Kapil7b768002016-04-25 19:14:19 +0530265/**
266 * enum wmi_dwelltime_adaptive_mode: dwelltime_mode
267 * @WMI_DWELL_MODE_DEFAULT: Use firmware default mode
268 * @WMI_DWELL_MODE_CONSERVATIVE: Conservative adaptive mode
269 * @WMI_DWELL_MODE_MODERATE: Moderate adaptive mode
270 * @WMI_DWELL_MODE_AGGRESSIVE: Aggressive adaptive mode
271 * @WMI_DWELL_MODE_STATIC: static adaptive mode
272 */
273enum wmi_dwelltime_adaptive_mode {
274 WMI_DWELL_MODE_DEFAULT = 0,
275 WMI_DWELL_MODE_CONSERVATIVE = 1,
276 WMI_DWELL_MODE_MODERATE = 2,
277 WMI_DWELL_MODE_AGGRESSIVE = 3,
278 WMI_DWELL_MODE_STATIC = 4
279};
280
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +0530281#define MAX_NUM_CHAN 128
282
Govind Singhc7cd2d62016-06-21 14:33:26 +0530283/* WME stream classes */
284#define WMI_AC_BE 0 /* best effort */
285#define WMI_AC_BK 1 /* background */
286#define WMI_AC_VI 2 /* video */
287#define WMI_AC_VO 3 /* voice */
288#define WMI_TID_TO_AC(_tid) (\
289 (((_tid) == 0) || ((_tid) == 3)) ? WMI_AC_BE : \
290 (((_tid) == 1) || ((_tid) == 2)) ? WMI_AC_BK : \
291 (((_tid) == 4) || ((_tid) == 5)) ? WMI_AC_VI : \
292 WMI_AC_VO)
293
Govind Singh3ddda1f2016-03-09 11:34:12 +0530294/**
295 * struct vdev_create_params - vdev create cmd parameter
296 * @if_id: interface id
297 * @type: interface type
298 * @subtype: interface subtype
299 */
300struct vdev_create_params {
301 uint8_t if_id;
302 uint32_t type;
303 uint32_t subtype;
Kiran Kumar Lokere0ae9fb92016-05-02 12:32:27 -0700304 uint8_t nss_2g;
305 uint8_t nss_5g;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530306};
307
308/**
309 * struct vdev_delete_params - vdev delete cmd parameter
310 * @if_id: interface id
311 */
312struct vdev_delete_params {
313 uint8_t if_id;
314};
315
316/**
Govind Singh89727882016-04-15 13:58:27 +0530317 * struct channel_param - Channel paramters with all
318 * info required by target.
319 * @chan_id: channel id
320 * @pwr: channel power
321 * @mhz: channel frequency
322 * @half_rate: is half rate
323 * @quarter_rate: is quarter rate
324 * @dfs_set: is dfs channel
325 * @dfs_set_cfreq2: is secondary freq dfs channel
326 * @is_chan_passive: is this passive channel
327 * @allow_ht: HT allowed in chan
328 * @allow_vht: VHT allowed on chan
329 * @phy_mode: phymode (vht80 or ht40 or ...)
330 * @cfreq1: centre frequency on primary
331 * @cfreq2: centre frequency on secondary
332 * @maxpower: max power for channel
333 * @minpower: min power for channel
334 * @maxreqpower: Max regulatory power
335 * @antennamac: Max antenna
336 * @reg_class_id: Regulatory class id.
337 */
338
339struct channel_param {
340 uint8_t chan_id;
341 uint8_t pwr;
342 uint32_t mhz;
343 uint32_t half_rate:1,
344 quarter_rate:1,
345 dfs_set:1,
346 dfs_set_cfreq2:1,
347 is_chan_passive:1,
348 allow_ht:1,
349 allow_vht:1;
350 uint32_t phy_mode;
351 uint32_t cfreq1;
352 uint32_t cfreq2;
353 int8_t maxpower;
354 int8_t minpower;
355 int8_t maxregpower;
356 uint8_t antennamax;
357 uint8_t reg_class_id;
358};
359
360/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530361 * struct vdev_stop_params - vdev stop cmd parameter
362 * @vdev_id: vdev id
363 */
364struct vdev_stop_params {
365 uint8_t vdev_id;
366};
367
368/**
369 * struct vdev_up_params - vdev up cmd parameter
370 * @vdev_id: vdev id
371 * @assoc_id: association id
372 */
373struct vdev_up_params {
374 uint8_t vdev_id;
375 uint16_t assoc_id;
376};
377
378/**
379 * struct vdev_down_params - vdev down cmd parameter
380 * @vdev_id: vdev id
381 */
382struct vdev_down_params {
383 uint8_t vdev_id;
384};
385
386/**
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530387 * struct mac_ssid - mac ssid structure
388 * @length:
389 * @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
390 */
391struct mac_ssid {
392 uint8_t length;
393 uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
394} qdf_packed;
395
396/**
397 * struct vdev_start_params - vdev start cmd parameter
398 * @vdev_id: vdev id
399 * @chan_freq: channel frequency
400 * @chan_mode: channel mode
401 * @band_center_freq1: center freq 1
402 * @band_center_freq2: center freq 2
403 * @flags: flags to set like pmf_enabled etc.
404 * @is_dfs: flag to check if dfs enabled
405 * @beacon_intval: beacon interval
406 * @dtim_period: dtim period
407 * @max_txpow: max tx power
408 * @is_restart: flag to check if it is vdev
409 * @ssid: ssid and ssid length info
410 * @preferred_tx_streams: preferred tx streams
411 * @preferred_rx_streams: preferred rx streams
412 * @intr_update: flag to check if need to update
413 * required wma interface params
414 * @intr_ssid: pointer to wma interface ssid
415 * @intr_flags: poiter to wma interface flags
416 * @requestor_id: to update requestor id
417 * @disable_hw_ack: to update disable hw ack flag
418 * @info: to update channel info
419 * @reg_info_1: to update min power, max power,
420 * reg power and reg class id
421 * @reg_info_2: to update antennamax
Govind Singh89727882016-04-15 13:58:27 +0530422 * @oper_mode: Operating mode
423 * @dfs_pri_multiplier: DFS primary multiplier
424 * allow pulse if they are within multiple of PRI for the radar type
425 * @dot11_mode: Phy mode (VHT20/VHT80...)
426 * @disable_hw_ack: Disable hw ack if chan is dfs channel for cac
427 * @channel_param: Channel params required by target.
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530428 */
429struct vdev_start_params {
430 uint8_t vdev_id;
431 uint32_t chan_freq;
432 uint32_t chan_mode;
433 uint32_t band_center_freq1;
434 uint32_t band_center_freq2;
435 uint32_t flags;
436 bool is_dfs;
437 uint32_t beacon_intval;
438 uint32_t dtim_period;
439 int32_t max_txpow;
440 bool is_restart;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530441 bool is_half_rate;
442 bool is_quarter_rate;
443 uint32_t dis_hw_ack;
444 uint32_t flag_dfs;
445 uint8_t hidden_ssid;
446 uint8_t pmf_enabled;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530447 struct mac_ssid ssid;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530448 uint32_t num_noa_descriptors;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530449 uint32_t preferred_rx_streams;
450 uint32_t preferred_tx_streams;
Govind Singh89727882016-04-15 13:58:27 +0530451#ifdef WMI_NON_TLV_SUPPORT
452 uint8_t oper_mode;
453 int32_t dfs_pri_multiplier;
454 uint8_t dot11_mode;
455 uint8_t disable_hw_ack;
456 struct channel_param channel;
457#endif
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530458};
459
460/**
461 * struct hidden_ssid_vdev_restart_params -
462 * vdev restart cmd parameter
463 * @session_id: session id
464 * @ssid_len: ssid length
465 * @ssid: ssid
466 * @flags: flags
467 * @requestor_id: requestor id
468 * @disable_hw_ack: flag to disable hw ack feature
469 * @mhz: channel frequency
470 * @band_center_freq1: center freq 1
471 * @band_center_freq2: center freq 2
472 * @info: channel info
473 * @reg_info_1: contains min power, max power,
474 * reg power and reg class id
475 * @reg_info_2: contains antennamax
476 * @hidden_ssid_restart_in_progress:
477 * flag to check if restart is in progress
478 */
479struct hidden_ssid_vdev_restart_params {
480 uint8_t session_id;
481 uint32_t ssid_len;
482 uint32_t ssid[8];
483 uint32_t flags;
484 uint32_t requestor_id;
485 uint32_t disable_hw_ack;
486 uint32_t mhz;
487 uint32_t band_center_freq1;
488 uint32_t band_center_freq2;
489 uint32_t info;
490 uint32_t reg_info_1;
491 uint32_t reg_info_2;
492 qdf_atomic_t hidden_ssid_restart_in_progress;
493};
494
495/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530496 * struct vdev_set_params - vdev set cmd parameter
497 * @if_id: vdev id
498 * @param_id: parameter id
499 * @param_value: parameter value
500 */
501struct vdev_set_params {
502 uint32_t if_id;
503 uint32_t param_id;
504 uint32_t param_value;
505};
506
507/**
Govind Singh89727882016-04-15 13:58:27 +0530508 * struct vdev_install_key_params - vdev key set cmd parameter
509 * @wk_keylen: key length
510 * @wk_flags: key flags
511 * @ic_cipher: cipher
512 * @if_id: vdev id
513 * @is_group_key: Group key
514 * @wk_keyix: key index
515 * @def_keyid: default key index
516 * @wk_keytsc: Key TSC
517 * @wk_keyrsc: key RSC
518 * @key_data: pounter to key data
519 * @force_none: force
520 * @is_host_based_crypt: Host based encrypt
521 * @is_xmit_or_recv_key: xmit or recieve key
522 * @wk_recviv: WAPI recv IV
523 * @wk_txiv: WAPI TX IV
524 */
525struct vdev_install_key_params {
526 uint8_t wk_keylen;
527 uint16_t wk_flags;
528 uint8_t ic_cipher;
529 uint8_t if_id;
530 bool is_group_key;
531 uint16_t wk_keyix;
532 uint8_t def_keyid;
533 uint64_t wk_keytsc;
534 uint64_t *wk_keyrsc;
535 uint8_t *key_data;
536 uint8_t force_none;
537 bool is_host_based_crypt;
538 bool is_xmit_or_recv_key;
539#if ATH_SUPPORT_WAPI
540 uint8_t *wk_recviv;
541 uint32_t *wk_txiv;
542#endif
543};
544
545/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530546 * struct peer_delete_params - peer delete cmd parameter
547 * @vdev_id: vdev id
548 */
549struct peer_delete_params {
550 uint8_t vdev_id;
551};
552
553/**
554 * struct peer_flush_params - peer flush cmd parameter
555 * @peer_tid_bitmap: peer tid bitmap
556 * @vdev_id: vdev id
557 */
558struct peer_flush_params {
559 uint32_t peer_tid_bitmap;
560 uint8_t vdev_id;
561};
562
563/**
564 * struct peer_set_params - peer set cmd parameter
565 * @param_id: parameter id
566 * @param_value: parameter value
567 * @vdev_id: vdev id
568 */
569struct peer_set_params {
570 uint32_t param_id;
571 uint32_t param_value;
572 uint32_t vdev_id;
573};
574
575/**
576 * struct peer_create_params - peer create cmd parameter
577 * @peer_addr: peer mac addr
578 * @peer_type: peer type
579 * @vdev_id: vdev id
580 */
581struct peer_create_params {
582 const uint8_t *peer_addr;
583 uint32_t peer_type;
584 uint32_t vdev_id;
585};
586
587/**
588 * struct peer_remove_params - peer remove cmd parameter
589 * @bssid: bss id
590 * @vdev_id: vdev id
591 * @roam_synch_in_progress: flag to indicate if roaming is in progress
592 */
593struct peer_remove_params {
594 uint8_t *bssid;
595 uint8_t vdev_id;
596 bool roam_synch_in_progress;
597};
598
599/**
Govind Singh89727882016-04-15 13:58:27 +0530600 * Stats ID enums defined in host
601 */
602typedef enum {
603 WMI_HOST_REQUEST_PEER_STAT = 0x01,
604 WMI_HOST_REQUEST_AP_STAT = 0x02,
605 WMI_HOST_REQUEST_PDEV_STAT = 0x04,
606 WMI_HOST_REQUEST_VDEV_STAT = 0x08,
607 WMI_HOST_REQUEST_BCNFLT_STAT = 0x10,
608 WMI_HOST_REQUEST_VDEV_RATE_STAT = 0x20,
609 WMI_HOST_REQUEST_INST_STAT = 0x40,
610 WMI_HOST_REQUEST_PEER_EXTD_STAT = 0x80,
611 WMI_HOST_REQUEST_VDEV_EXTD_STAT = 0x100,
612} wmi_host_stats_id;
613
614typedef struct {
615 uint16_t cfg_retry_count;
616 uint16_t retry_count;
617} wmi_host_inst_rssi_args;
618
619/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530620 * struct stats_request_params - stats_request cmd parameter
621 * @stats_id: statistics id
622 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +0530623 * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
Govind Singh3ddda1f2016-03-09 11:34:12 +0530624 */
625struct stats_request_params {
626 uint32_t stats_id;
627 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +0530628#ifdef WMI_NON_TLV_SUPPORT
629 wmi_host_inst_rssi_args rssi_args;
630#endif
631};
632
633/**
634 * struct bss_chan_info_request_params - BSS chan info params
635 * @param: parameter value
636 */
637struct bss_chan_info_request_params {
638 uint32_t param;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530639};
640
641/**
642 * struct green_ap_ps_params - green ap ps cmd parameter
643 * @value: parameter value
644 */
645struct green_ap_ps_params {
646 uint32_t value;
647};
648
649/**
650 * struct wow_cmd_params - wow cmd parameter
651 * @enable: wow enable or disable flag
652 * @can_suspend_link: flag to indicate if link can be suspended
653 * @pause_iface_config: interface config
654 */
655struct wow_cmd_params {
656 bool enable;
657 bool can_suspend_link;
658 uint8_t pause_iface_config;
659};
660
661/**
Govind Singh89727882016-04-15 13:58:27 +0530662 * struct wow_add_wakeup_params - wow wakeup parameter
663 * @type: param type
664 */
665struct wow_add_wakeup_params {
666 uint32_t type;
667};
668
669/**
670 * struct wow_add_wakeup_pattern_params - Add WoW pattern params
671 * @pattern_bytes: pointer to pattern bytes
672 * @mask_bytes: pointer to mask bytes
673 * @pattern_len: pattern length
674 * @pattern_id: pattern id
675 */
676struct wow_add_wakeup_pattern_params {
677 uint8_t *pattern_bytes;
678 uint8_t *mask_bytes;
679 uint32_t pattern_len;
680 uint32_t pattern_id;
681};
682
683/**
684 * struct wow_remove_wakeup_pattern params - WoW remove pattern param
685 * @pattern_bytes: pointer to pattern bytes
686 * @mask_bytes: Mask bytes
687 * @pattern_id: pattern identifier
688 */
689struct wow_remove_wakeup_pattern_params {
690 uint32_t *pattern_bytes;
691 uint32_t *mask_bytes;
692 uint32_t pattern_id;
693};
694
695
696/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530697 * struct packet_enable_params - packet enable cmd parameter
698 * @vdev_id: vdev id
699 * @enable: flag to indicate if parameter can be enabled or disabled
700 */
701struct packet_enable_params {
702 uint8_t vdev_id;
703 bool enable;
704};
705
706/**
707 * struct suspend_params - suspend cmd parameter
708 * @disable_target_intr: disable target interrupt
709 */
710struct suspend_params {
711 uint8_t disable_target_intr;
712};
713
714/**
715 * struct pdev_params - pdev set cmd parameter
716 * @param_id: parameter id
717 * @param_value: parameter value
718 */
719struct pdev_params {
720 uint32_t param_id;
721 uint32_t param_value;
722};
723
724/**
Govind Singh89727882016-04-15 13:58:27 +0530725 * struct beacon_tmpl_params - beacon template cmd parameter
726 * @vdev_id: vdev id
727 * @tim_ie_offset: tim ie offset
728 * @tmpl_len: beacon template length
729 * @tmpl_len_aligned: beacon template alignment
730 * @frm: beacon template parameter
731 */
732struct beacon_tmpl_params {
733 uint8_t vdev_id;
734 uint32_t tim_ie_offset;
735 uint32_t tmpl_len;
736 uint32_t tmpl_len_aligned;
737 uint8_t *frm;
738};
739
740#ifndef WMI_NON_TLV_SUPPORT
741/**
742 * struct beacon_params - beacon cmd parameter
Govind Singh3ddda1f2016-03-09 11:34:12 +0530743 * @vdev_id: vdev id
744 * @tim_ie_offset: tim ie offset
745 * @tmpl_len: beacon template length
746 * @tmpl_len_aligned: beacon template alignment
747 * @frm: beacon template parameter
748 */
749struct beacon_params {
750 uint8_t vdev_id;
751 uint32_t tim_ie_offset;
752 uint32_t tmpl_len;
753 uint32_t tmpl_len_aligned;
754 uint8_t *frm;
755};
Govind Singh89727882016-04-15 13:58:27 +0530756#else
757/**
758 * struct beacon_params - beacon cmd parameter
759 * @vdev_id: vdev id
760 * @beaconInterval: Beacon interval
761 * @wbuf: beacon buffer
762 * @frame_ctrl: frame control field
763 * @bcn_txant: beacon antenna
764 * @is_dtim_count_zero: is it dtim beacon
765 * @is_bitctl_reqd: is Bit control required
766 * @is_high_latency: Is this high latency target
767 */
768struct beacon_params {
769 uint8_t vdev_id;
770 uint16_t beaconInterval;
771 qdf_nbuf_t wbuf;
772 uint16_t frame_ctrl;
773 uint32_t bcn_txant;
774 bool is_dtim_count_zero;
775 bool is_bitctl_reqd;
776 bool is_high_latency;
777};
778#endif
779
780/**
781 * struct bcn_prb_template_params - beacon probe template parameter
782 * @vdev_id: vdev id
783 * @buf_len: Template length
784 * @caps: capabilities field
785 * @erp: ERP field
786 */
787struct bcn_prb_template_params {
788 uint8_t vdev_id;
789 int buf_len;
790 uint16_t caps;
791 uint8_t erp;
792};
793
794#define WMI_MAX_SUPPORTED_RATES 128
795/**
796 * struct target_rate_set - Rate set bitmap
797 * @num_rate: number of rates in rates bitmap
798 * @rates: rates (each 8bit value) packed into a 32 bit word.
799 * the rates are filled from least significant byte to most
800 * significant byte.
801 */
802typedef struct {
803 uint32_t num_rates;
804 uint32_t rates[(WMI_MAX_SUPPORTED_RATES / 4) + 1];
805} target_rate_set;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530806
807/**
808 * struct peer_assoc_params - peer assoc cmd parameter
809 * @peer_macaddr: peer mac address
810 * @vdev_id: vdev id
811 * @peer_new_assoc: peer association type
812 * @peer_associd: peer association id
813 * @peer_flags: peer flags
814 * @peer_caps: peer capabalities
815 * @peer_listen_intval: peer listen interval
816 * @peer_ht_caps: HT capabalities
817 * @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
818 * @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
819 * @peer_rate_caps: peer rate capabalities
820 * @peer_nss: peer nss
821 * @peer_phymode: peer phymode
822 * @peer_ht_info: peer HT info
823 * @peer_legacy_rates: peer legacy rates
824 * @peer_ht_rates: peer ht rates
Govind Singh3ddda1f2016-03-09 11:34:12 +0530825 * @rx_max_rate: max rx rates
826 * @rx_mcs_set: rx mcs
827 * @tx_max_rate: max tx rates
828 * @tx_mcs_set: tx mcs
829 * @vht_capable: VHT capabalities
Govind Singh89727882016-04-15 13:58:27 +0530830 * @tx_max_mcs_nss: max tx MCS and NSS
831 * @peer_bw_rxnss_override: Peer BW RX NSS overriden or not.
832 * @is_pmf_enabled: PMF enabled
833 * @is_wme_set: WME enabled
834 * @qos_flag: QoS Flags
835 * @apsd_flag: APSD flags
836 * @ht_flag: HT flags
837 * @bw_40: 40 capabale
838 * @bw_80: 80 capabale
839 * @bw_160: 160 capabale
840 * @stbc_flag: STBC flag
841 * @ldpc_flag: LDPC flag
842 * @static_mimops_flag: statis MIMO PS flags
843 * @dynamic_mimops_flag: Dynamic MIMO PS flags
844 * @spatial_mux_flag: spatial MUX flags
845 * @vht_flag: VHT flags
846 * @vht_ng_flag: VHT on 11N/G flags
847 * @need_ptk_4_way: Needs 4 way handshake
848 * @need_gtk_2_way: Needs 2 way GTK
849 * @auth_flag: Is peer authenticated
850 * @safe_mode_enabled: Safe enabled for this peer
851 * @amsdu_disable: AMSDU disble
852 * @peer_mac: Peer mac address
Govind Singh3ddda1f2016-03-09 11:34:12 +0530853 */
854struct peer_assoc_params {
855 wmi_mac_addr peer_macaddr;
856 uint32_t vdev_id;
857 uint32_t peer_new_assoc;
858 uint32_t peer_associd;
859 uint32_t peer_flags;
860 uint32_t peer_caps;
861 uint32_t peer_listen_intval;
862 uint32_t peer_ht_caps;
863 uint32_t peer_max_mpdu;
864 uint32_t peer_mpdu_density;
865 uint32_t peer_rate_caps;
866 uint32_t peer_nss;
867 uint32_t peer_vht_caps;
868 uint32_t peer_phymode;
869 uint32_t peer_ht_info[2];
Govind Singh89727882016-04-15 13:58:27 +0530870#ifndef WMI_NON_TLV_SUPPORT
Govind Singh3ddda1f2016-03-09 11:34:12 +0530871 wmi_rate_set peer_legacy_rates;
872 wmi_rate_set peer_ht_rates;
Govind Singh89727882016-04-15 13:58:27 +0530873#else
874 target_rate_set peer_legacy_rates;
875 target_rate_set peer_ht_rates;
876#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +0530877 uint32_t rx_max_rate;
878 uint32_t rx_mcs_set;
879 uint32_t tx_max_rate;
880 uint32_t tx_mcs_set;
881 uint8_t vht_capable;
Govind Singh89727882016-04-15 13:58:27 +0530882#ifdef WMI_NON_TLV_SUPPORT
883 uint32_t tx_max_mcs_nss;
884 uint32_t peer_bw_rxnss_override;
885 bool is_pmf_enabled;
886 bool is_wme_set;
887 bool qos_flag;
888 bool apsd_flag;
889 bool ht_flag;
890 bool bw_40;
891 bool bw_80;
892 bool bw_160;
893 bool stbc_flag;
894 bool ldpc_flag;
895 bool static_mimops_flag;
896 bool dynamic_mimops_flag;
897 bool spatial_mux_flag;
898 bool vht_flag;
899 bool vht_ng_flag;
900 bool need_ptk_4_way;
901 bool need_gtk_2_way;
902 bool auth_flag;
903 bool safe_mode_enabled;
904 bool amsdu_disable;
905 /* Use common structure */
906 uint8_t peer_mac[IEEE80211_ADDR_LEN];
907#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +0530908};
909
910/**
911 * struct sta_ps_params - sta ps cmd parameter
912 * @vdev_id: vdev id
913 * @param: sta ps paramter
914 * @value: sta ps parameter value
915 */
916struct sta_ps_params {
917 uint32_t vdev_id;
918 uint32_t param;
919 uint32_t value;
920};
921
922/**
923 * struct ap_ps_params - ap ps cmd parameter
924 * @vdev_id: vdev id
925 * @param: ap ps paramter
926 * @value: ap ps paramter value
927 */
928struct ap_ps_params {
929 uint32_t vdev_id;
930 uint32_t param;
931 uint32_t value;
932};
933
Govind Singh89727882016-04-15 13:58:27 +0530934#define WMI_HOST_SCAN_CHAN_FREQ_SHIFT 0
935#define WMI_HOST_SCAN_CHAN_FREQ_MASK 0xffff
936#define WMI_HOST_SCAN_CHAN_MODE_SHIFT 16
937#define WMI_HOST_SCAN_CHAN_MODE_MASK 0xff
938
Govind Singh3ddda1f2016-03-09 11:34:12 +0530939/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530940 * struct scan_start_params - start scan cmd parameter
941 * @scan_id: scan id
942 * @scan_req_id: requeted scan id
943 * @vdev_id: vdev id
944 * @scan_priority: scan priority
945 * @notify_scan_events: flag to indicate if scan to be notified
946 * @dwell_time_active: active dwell time
947 * @dwell_time_passive: passive dwell time
948 * @min_rest_time: min rest time
949 * @max_rest_time: max rest time
950 * @repeat_probe_time: repeat probe time
951 * @probe_spacing_time: probe spacing time
952 * @idle_time: idle time
953 * @max_scan_time: max scan time
954 * @probe_delay: probe delay
955 * @scan_ctrl_flags: scan control flag
956 * @burst_duration: burst duration
957 * @num_chan: no of channel
958 * @num_bssid: no of bssid
959 * @num_ssids: no of ssid
960 * @ie_len: ie length
961 * @n_probes: no of probe
962 * @chan_list: channel list
963 * @ie_len_with_pad: ie length with padding
964 * @num_ssid: no of ssid
965 * @sid: pointer to mac_ssid structure
966 * @uie_fieldOffset: ie field offset
967 * @mac_add_bytes: mac address bytes
Govind Singh89727882016-04-15 13:58:27 +0530968 * @is_strict_pscan_en: Is this a strict passive scan
969 * @is_promiscous_mode: Is promiscous mode
970 * @is_phy_error: is Phy error
971 * @add_cck_rates: Add cck rates
972 * @chan_stat_enable: channel stats enabled
973 * @offchan_tx_mgmt: Offchan tx scan
974 * @offchan_tx_data: offchan tx data
975 * @add_bcast_probe_reqd: Add bcast probe request
976 * @bssid_list: Lisst of bssid to scan
977 * @ie_data: IE data buffer pointer
978 * @passive_flag: Is this passive scan
Govind Singh3ddda1f2016-03-09 11:34:12 +0530979 */
980struct scan_start_params {
981 uint32_t scan_id;
982 uint32_t scan_req_id;
983 uint32_t vdev_id;
984 uint32_t scan_priority;
985 uint32_t notify_scan_events;
986 uint32_t dwell_time_active;
987 uint32_t dwell_time_passive;
988 uint32_t min_rest_time;
989 uint32_t max_rest_time;
990 uint32_t repeat_probe_time;
991 uint32_t probe_spacing_time;
992 uint32_t idle_time;
993 uint32_t max_scan_time;
994 uint32_t probe_delay;
995 uint32_t scan_ctrl_flags;
996 uint32_t burst_duration;
997 uint32_t num_chan;
998 uint32_t num_bssid;
999 uint32_t num_ssids;
1000 uint32_t ie_len;
1001 uint32_t n_probes;
1002 uint32_t *chan_list;
1003 uint32_t ie_len_with_pad;
1004 struct mac_ssid ssid[WMI_SCAN_MAX_NUM_SSID];
1005 uint8_t *ie_base;
1006 uint16_t uie_fieldOffset;
1007 uint8_t mac_add_bytes[IEEE80211_ADDR_LEN];
Govind Singh89727882016-04-15 13:58:27 +05301008#ifdef WMI_NON_TLV_SUPPORT
1009 bool is_strict_pscan_en;
1010 bool is_promiscous_mode;
1011 bool is_phy_error;
1012 bool add_cck_rates;
1013 bool chan_stat_enable;
1014 bool offchan_tx_mgmt;
1015 bool offchan_tx_data;
1016 bool add_bcast_probe_reqd;
1017 uint8_t bssid_list[WMI_SCAN_MAX_NUM_BSSID][IEEE80211_ADDR_LEN];
1018 uint8_t *ie_data;
1019 int passive_flag;
1020#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301021};
1022
1023/**
1024 * struct scan_stop_params - stop scan cmd parameter
1025 * @requestor: scan requestor
1026 * @scan_id: scan id
1027 * @req_type: scan request type
1028 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +05301029 * @all_scans: Stop all scans
1030 * @vap_scans: stop vap scans
1031 * @specific_scan: specific scan
1032 * @flags: scan flags
1033 * @ss_scan_id: ss scan id
Govind Singh3ddda1f2016-03-09 11:34:12 +05301034 */
1035struct scan_stop_params {
1036 uint32_t requestor;
1037 uint32_t scan_id;
1038 uint32_t req_type;
1039 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05301040#ifdef WMI_NON_TLV_SUPPORT
1041 bool all_scans;
1042 bool vap_scans;
1043 bool specific_scan;
1044 uint32_t flags;
1045 uint32_t ss_scan_id;
1046#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301047};
1048
1049/**
1050 * struct scan_chan_list_params - scan channel list cmd parameter
1051 * @num_scan_chans: no of scan channels
1052 * @chan_info: pointer to wmi channel info
1053 */
Govind Singh89727882016-04-15 13:58:27 +05301054#ifndef WMI_NON_TLV_SUPPORT
Govind Singh3ddda1f2016-03-09 11:34:12 +05301055struct scan_chan_list_params {
1056 uint8_t num_scan_chans;
1057 wmi_channel *chan_info;
1058};
Govind Singh89727882016-04-15 13:58:27 +05301059#else
1060/**
1061 * struct scan_chan_list_params - scan channel list cmd parameter
1062 * @num_chan: no of scan channels
1063 * @nallchans: nall chans
1064 * @ch_param: pointer to channel_paramw
1065 */
1066struct scan_chan_list_params {
1067 uint8_t num_chan;
1068 uint16_t nallchans;
1069 struct channel_param ch_param[1];
1070};
1071#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301072
1073/**
1074 * struct fw_hang_params - fw hang command parameters
1075 * @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
1076 * @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
1077 */
1078struct fw_hang_params {
1079 uint32_t type;
1080 uint32_t delay_time_ms;
1081};
1082
1083/**
1084 * struct pdev_utf_params - pdev utf command parameters
1085 * @utf_payload:
1086 * @len:
Govind Singh89727882016-04-15 13:58:27 +05301087 * @is_ar900b: is it 900b target
Govind Singh3ddda1f2016-03-09 11:34:12 +05301088 */
1089struct pdev_utf_params {
1090 uint8_t *utf_payload;
1091 uint32_t len;
Govind Singh89727882016-04-15 13:58:27 +05301092#ifdef WMI_NON_TLV_SUPPORT
1093 bool is_ar900b;
1094#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301095};
1096
Govind Singh89727882016-04-15 13:58:27 +05301097/*Adding this due to dependency on wmi_unified.h
1098 */
1099typedef struct {
1100 uint32_t len;
1101 uint32_t msgref;
1102 uint32_t segmentInfo;
1103} QVIT_SEG_HDR_INFO_STRUCT;
1104
1105struct pdev_qvit_params {
1106 uint8_t *utf_payload;
1107 uint32_t len;
1108};
Govind Singh3ddda1f2016-03-09 11:34:12 +05301109/**
1110 * struct crash_inject - crash inject command parameters
1111 * @type: crash inject type
1112 * @delay_time_ms: time in milliseconds for FW to delay the crash
1113 */
1114struct crash_inject {
1115 uint32_t type;
1116 uint32_t delay_time_ms;
1117};
1118
1119/**
1120 * struct dbglog_params - fw deboglog command parameters
1121 * @param: command parameter
1122 * @val: parameter value
1123 * @module_id_bitmap: fixed length module id bitmap
1124 * @bitmap_len: module id bitmap length
Govind Singh89727882016-04-15 13:58:27 +05301125 * @cfgvalid: cfgvalid
Govind Singh3ddda1f2016-03-09 11:34:12 +05301126 */
1127struct dbglog_params {
1128 uint32_t param;
1129 uint32_t val;
1130 uint32_t *module_id_bitmap;
1131 uint32_t bitmap_len;
Govind Singh89727882016-04-15 13:58:27 +05301132#ifdef WMI_NON_TLV_SUPPORT
1133 uint32_t cfgvalid[2];
1134#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301135};
1136
1137/**
1138 * struct seg_hdr_info - header info
1139 * @len: length
1140 * @msgref: message refrence
1141 * @segmentInfo: segment info
1142 * @pad: padding
1143 */
1144struct seg_hdr_info {
1145 uint32_t len;
1146 uint32_t msgref;
1147 uint32_t segmentInfo;
1148 uint32_t pad;
1149};
1150
1151/**
1152 * struct wmi_mgmt_params - wmi mgmt cmd paramters
1153 * @tx_frame: management tx frame
Govind Singh89727882016-04-15 13:58:27 +05301154 * @frm_len: frame length
Govind Singh3ddda1f2016-03-09 11:34:12 +05301155 * @vdev_id: vdev id
1156 * @tx_complete_cb: tx download callback handler
1157 * @tx_ota_post_proc_cb: OTA complition handler
1158 * @chanfreq: channel frequency
1159 * @pdata: frame data
1160 * @wmi_desc: command descriptor
Govind Singh89727882016-04-15 13:58:27 +05301161 * @desc_id: descriptor id relyaed back by target
1162 * @macaddr - macaddr of peer
Govind Singh3ddda1f2016-03-09 11:34:12 +05301163 */
1164struct wmi_mgmt_params {
1165 void *tx_frame;
1166 uint16_t frm_len;
1167 uint8_t vdev_id;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301168 uint16_t chanfreq;
1169 void *pdata;
Govind Singh89727882016-04-15 13:58:27 +05301170 uint16_t desc_id;
1171 uint8_t *macaddr;
Govind Singhd7468a52016-03-09 14:32:57 +05301172 void *qdf_ctx;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301173};
Govind Singhbffe4de2016-02-26 17:50:39 +05301174
1175/**
1176 * struct p2p_ps_params - P2P powersave related params
1177 * @opp_ps: opportunistic power save
1178 * @ctwindow: CT window
1179 * @count: count
1180 * @duration: duration
1181 * @interval: interval
1182 * @single_noa_duration: single shot noa duration
1183 * @ps_selection: power save selection
1184 * @session_id: session id
1185 */
1186struct p2p_ps_params {
1187 uint8_t opp_ps;
1188 uint32_t ctwindow;
1189 uint8_t count;
1190 uint32_t duration;
1191 uint32_t interval;
1192 uint32_t single_noa_duration;
1193 uint8_t ps_selection;
1194 uint8_t session_id;
1195};
1196
1197
1198/**
1199 * struct ta_uapsd_trig_params - uapsd trigger parameter
1200 * @vdevid: vdev id
1201 * @peer_addr: peer address
1202 * @auto_triggerparam: trigger parameters
1203 * @num_ac: no of access category
1204 */
1205struct sta_uapsd_trig_params {
1206 uint32_t vdevid;
1207 uint8_t peer_addr[IEEE80211_ADDR_LEN];
1208 uint8_t *auto_triggerparam;
1209 uint32_t num_ac;
1210};
Govind Singhe7b800c2016-03-01 15:30:53 +05301211
1212/**
1213 * struct ocb_utc_param
1214 * @vdev_id: session id
1215 * @utc_time: number of nanoseconds from Jan 1st 1958
1216 * @time_error: the error in the UTC time. All 1's for unknown
1217 */
1218struct ocb_utc_param {
1219 uint32_t vdev_id;
1220 uint8_t utc_time[WMI_SIZE_UTC_TIME];
1221 uint8_t time_error[WMI_SIZE_UTC_TIME_ERROR];
1222};
1223
1224/**
1225 * struct ocb_timing_advert_param
1226 * @vdev_id: session id
1227 * @chan_freq: frequency on which to advertise
1228 * @repeat_rate: the number of times it will send TA in 5 seconds
1229 * @timestamp_offset: offset of the timestamp field in the TA frame
1230 * @time_value_offset: offset of the time_value field in the TA frame
1231 * @template_length: size in bytes of the TA frame
1232 * @template_value: the TA frame
1233 */
1234struct ocb_timing_advert_param {
1235 uint32_t vdev_id;
1236 uint32_t chan_freq;
1237 uint32_t repeat_rate;
1238 uint32_t timestamp_offset;
1239 uint32_t time_value_offset;
1240 uint32_t template_length;
1241 uint8_t *template_value;
1242};
1243
1244/**
1245 * struct dcc_get_stats_param
1246 * @vdev_id: session id
1247 * @channel_count: number of dcc channels
1248 * @request_array_len: size in bytes of the request array
1249 * @request_array: the request array
1250 */
1251struct dcc_get_stats_param {
1252 uint32_t vdev_id;
1253 uint32_t channel_count;
1254 uint32_t request_array_len;
1255 void *request_array;
1256};
1257
1258/**
1259 * struct dcc_update_ndl_param
1260 * @vdev_id: session id
1261 * @channel_count: number of channels to be updated
1262 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
1263 * @dcc_ndl_chan_list: the ndl_chan array
1264 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
1265 * @dcc_ndl_active_state_list: the active state array
1266 */
1267struct dcc_update_ndl_param {
1268 uint32_t vdev_id;
1269 uint32_t channel_count;
1270 uint32_t dcc_ndl_chan_list_len;
1271 void *dcc_ndl_chan_list;
1272 uint32_t dcc_ndl_active_state_list_len;
1273 void *dcc_ndl_active_state_list;
1274};
1275
1276/**
1277 * struct ocb_config_sched
1278 * @chan_freq: frequency of the channel
1279 * @total_duration: duration of the schedule
1280 * @guard_interval: guard interval on the start of the schedule
1281 */
1282struct ocb_config_sched {
1283 uint32_t chan_freq;
1284 uint32_t total_duration;
1285 uint32_t guard_interval;
1286};
1287
1288/**
1289 * OCB structures
1290 */
1291
1292#define WMI_NUM_AC (4)
1293#define WMI_OCB_CHANNEL_MAX (5)
1294#define WMI_MAX_NUM_AC 4
1295struct wmi_ocb_qos_params {
1296 uint8_t aifsn;
1297 uint8_t cwmin;
1298 uint8_t cwmax;
1299};
1300/**
1301 * struct ocb_config_channel
1302 * @chan_freq: frequency of the channel
1303 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
1304 * @mac_address: MAC address assigned to this channel
1305 * @qos_params: QoS parameters
1306 * @max_pwr: maximum transmit power of the channel (dBm)
1307 * @min_pwr: minimum transmit power of the channel (dBm)
1308 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
1309 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
1310 */
1311struct ocb_config_channel {
1312 uint32_t chan_freq;
1313 uint32_t bandwidth;
Govind Singhd7468a52016-03-09 14:32:57 +05301314 struct qdf_mac_addr mac_address;
Govind Singhe7b800c2016-03-01 15:30:53 +05301315 struct wmi_ocb_qos_params qos_params[WMI_MAX_NUM_AC];
1316 uint32_t max_pwr;
1317 uint32_t min_pwr;
1318 uint8_t reg_pwr;
1319 uint8_t antenna_max;
1320 uint16_t flags;
1321};
1322
1323/**
1324 * struct ocb_config_param
1325 * @session_id: session id
1326 * @channel_count: number of channels
1327 * @schedule_size: size of the channel schedule
1328 * @flags: reserved
1329 * @channels: array of OCB channels
1330 * @schedule: array of OCB schedule elements
1331 * @dcc_ndl_chan_list_len: size of the ndl_chan array
1332 * @dcc_ndl_chan_list: array of dcc channel info
1333 * @dcc_ndl_active_state_list_len: size of the active state array
1334 * @dcc_ndl_active_state_list: array of active states
1335 * @adapter: the OCB adapter
1336 * @dcc_stats_callback: callback for the response event
1337 */
1338struct ocb_config_param {
1339 uint8_t session_id;
1340 uint32_t channel_count;
1341 uint32_t schedule_size;
1342 uint32_t flags;
1343 struct ocb_config_channel *channels;
1344 struct ocb_config_sched *schedule;
1345 uint32_t dcc_ndl_chan_list_len;
1346 void *dcc_ndl_chan_list;
1347 uint32_t dcc_ndl_active_state_list_len;
1348 void *dcc_ndl_active_state_list;
1349};
Govind Singh9bad0002016-03-01 15:54:59 +05301350
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301351enum wmi_peer_rate_report_cond_phy_type {
1352 WMI_PEER_RATE_REPORT_COND_11B = 0,
1353 WMI_PEER_RATE_REPORT_COND_11A_G,
1354 WMI_PEER_RATE_REPORT_COND_11N,
1355 WMI_PEER_RATE_REPORT_COND_11AC,
1356 WMI_PEER_RATE_REPORT_COND_MAX_NUM
1357};
1358
1359/**
1360 * struct report_rate_delta - peer specific parameters
1361 * @percent: percentage
1362 * @delta_min: rate min delta
1363 */
1364struct report_rate_delta {
1365 A_UINT32 percent; /* in unit of 12.5% */
1366 A_UINT32 delta_min; /* in unit of Mbps */
1367};
1368
1369/**
1370 * struct report_rate_per_phy - per phy report parameters
1371 * @cond_flags: condition flag val
1372 * @delta: rate delta
1373 * @report_rate_threshold: rate threshold
1374 */
1375struct report_rate_per_phy {
1376 /*
1377 * PEER_RATE_REPORT_COND_FLAG_DELTA,
1378 * PEER_RATE_REPORT_COND_FLAG_THRESHOLD
1379 * Any of these two conditions or both of
1380 * them can be set.
1381 */
1382 A_UINT32 cond_flags;
1383 struct report_rate_delta delta;
1384 /*
1385 * In unit of Mbps. There are at most 4 thresholds
1386 * If the threshold count is less than 4, set zero to
1387 * the one following the last threshold
1388 */
1389 A_UINT32 report_rate_threshold[WMI_MAX_NUM_OF_RATE_THRESH];
1390};
1391
1392/**
1393 * struct peer_rate_report_params - peer rate report parameters
1394 * @rate_report_enable: enable rate report param
1395 * @backoff_time: backoff time
1396 * @timer_period: timer
1397 * @report_per_phy: report per phy type
1398 */
1399struct wmi_peer_rate_report_params {
1400 A_UINT32 rate_report_enable;
1401 A_UINT32 backoff_time; /* in unit of msecond */
1402 A_UINT32 timer_period; /* in unit of msecond */
1403 /*
1404 *In the following field, the array index means the phy type,
1405 * please see enum wmi_peer_rate_report_cond_phy_type for detail
1406 */
1407 struct report_rate_per_phy report_per_phy[
1408 WMI_PEER_RATE_REPORT_COND_MAX_NUM];
1409
1410};
1411
Govind Singh9bad0002016-03-01 15:54:59 +05301412/**
1413 * struct t_thermal_cmd_params - thermal command parameters
1414 * @min_temp: minimum temprature
1415 * @max_temp: maximum temprature
1416 * @thermal_enable: thermal enable
1417 */
1418struct thermal_cmd_params {
1419 uint16_t min_temp;
1420 uint16_t max_temp;
1421 uint8_t thermal_enable;
1422};
1423
1424#define WMI_LRO_IPV4_SEED_ARR_SZ 5
1425#define WMI_LRO_IPV6_SEED_ARR_SZ 11
1426
1427/**
1428 * struct wmi_lro_config_cmd_t - set LRO init parameters
1429 * @lro_enable: indicates whether lro is enabled
1430 * @tcp_flag: If the TCP flags from the packet do not match
1431 * the values in this field after masking with TCP flags mask
1432 * below, packet is not LRO eligible
1433 * @tcp_flag_mask: field for comparing the TCP values provided
1434 * above with the TCP flags field in the received packet
1435 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
1436 * 5-tuple toeplitz hash for ipv4 packets
1437 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
1438 * 5-tuple toeplitz hash for ipv6 packets
1439 */
1440struct wmi_lro_config_cmd_t {
1441 uint32_t lro_enable;
1442 uint32_t tcp_flag:9,
1443 tcp_flag_mask:9;
1444 uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ];
1445 uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ];
1446};
Govind Singhae855362016-03-07 14:24:22 +05301447
1448/**
1449 * struct gtx_config_t - GTX config
1450 * @gtx_rt_mask: for HT and VHT rate masks
1451 * @gtx_usrcfg: host request for GTX mask
1452 * @gtx_threshold: PER Threshold (default: 10%)
1453 * @gtx_margin: PER margin (default: 2%)
1454 * @gtx_tcpstep: TCP step (default: 1)
1455 * @gtx_tpcMin: TCP min (default: 5)
1456 * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
1457 */
1458struct wmi_gtx_config {
1459 uint32_t gtx_rt_mask[2];
1460 uint32_t gtx_usrcfg;
1461 uint32_t gtx_threshold;
1462 uint32_t gtx_margin;
1463 uint32_t gtx_tpcstep;
1464 uint32_t gtx_tpcmin;
1465 uint32_t gtx_bwmask;
1466};
1467
1468/**
1469 * struct wmi_probe_resp_params - send probe response parameters
1470 * @bssId: BSSID
1471 * @pProbeRespTemplate: probe response template
1472 * @probeRespTemplateLen: probe response template length
1473 * @ucProxyProbeReqValidIEBmap: valid IE bitmap
1474 */
1475struct wmi_probe_resp_params {
Govind Singh8675b862016-03-28 22:09:18 +05301476 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05301477 uint8_t *pProbeRespTemplate;
1478 uint32_t probeRespTemplateLen;
1479 uint32_t ucProxyProbeReqValidIEBmap[8];
1480};
1481
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +05301482/* struct set_key_params: structure containing
1483 * installation key parameters
1484 * @vdev_id: vdev id
1485 * @key_len: key length
1486 * @key_idx: key index
1487 * @peer_mac: peer mac address
1488 * @key_flags: key flags, 0:pairwise key, 1:group key, 2:static key
1489 * @key_cipher: key cipher based on security mode
1490 * @key_txmic_len: tx mic length
1491 * @key_rxmic_len: rx mic length
1492 * @rx_iv: receive IV, applicable only in case of WAPI
1493 * @tx_iv: transmit IV, applicable only in case of WAPI
1494 * @key_data: key data
1495 */
1496struct set_key_params {
1497 uint8_t vdev_id;
1498 uint16_t key_len;
1499 uint32_t key_idx;
1500 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1501 uint32_t key_flags;
1502 uint32_t key_cipher;
1503 uint32_t key_txmic_len;
1504 uint32_t key_rxmic_len;
1505#ifdef FEATURE_WLAN_WAPI
1506 uint8_t rx_iv[16];
1507 uint8_t tx_iv[16];
1508#endif
1509 uint8_t key_data[WMI_MAC_MAX_KEY_LENGTH];
1510};
1511
Govind Singhae855362016-03-07 14:24:22 +05301512/**
1513 * struct sta_params - sta keep alive parameters
1514 * @vdev_id: vdev id
1515 * @method: keep alive method
1516 * @timeperiod: time to keep alive
1517 * @hostv4addr: host ipv4 address
1518 * @destv4addr: destination ipv4 address
1519 * @destmac: destination mac address
1520 */
1521struct sta_params {
1522 uint8_t vdev_id;
1523 uint32_t method;
1524 uint32_t timeperiod;
1525 uint8_t *hostv4addr;
1526 uint8_t *destv4addr;
1527 uint8_t *destmac;
1528};
1529
1530/**
1531 * struct gateway_update_req_param - gateway parameter update request
1532 * @request_id: request id
1533 * @session_id: session id
1534 * @max_retries: Max ARP/NS retry attempts
1535 * @timeout: Retry interval
1536 * @ipv4_addr_type: on ipv4 network
1537 * @ipv6_addr_type: on ipv6 network
1538 * @gw_mac_addr: gateway mac addr
1539 * @ipv4_addr: ipv4 addr
1540 * @ipv6_addr: ipv6 addr
1541 */
1542struct gateway_update_req_param {
1543 uint32_t request_id;
1544 uint32_t session_id;
1545 uint32_t max_retries;
1546 uint32_t timeout;
1547 uint32_t ipv4_addr_type;
1548 uint32_t ipv6_addr_type;
Govind Singhd7468a52016-03-09 14:32:57 +05301549 struct qdf_mac_addr gw_mac_addr;
1550 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
1551 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Govind Singhae855362016-03-07 14:24:22 +05301552};
1553
1554/**
1555 * struct rssi_monitor_param - rssi monitoring
1556 * @request_id: request id
1557 * @session_id: session id
1558 * @min_rssi: minimum rssi
1559 * @max_rssi: maximum rssi
1560 * @control: flag to indicate start or stop
1561 */
1562struct rssi_monitor_param {
1563 uint32_t request_id;
1564 uint32_t session_id;
1565 int8_t min_rssi;
1566 int8_t max_rssi;
1567 bool control;
1568};
1569
1570/**
1571 * struct scan_mac_oui - oui paramters
1572 * @oui: oui parameters
1573 */
1574struct scan_mac_oui {
1575 uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
1576};
1577
1578#define WMI_PASSPOINT_REALM_LEN 256
1579#define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
1580#define WMI_PASSPOINT_PLMN_LEN 3
1581/**
1582 * struct wifi_passpoint_network_param - passpoint network block
1583 * @id: identifier of this network block
1584 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
1585 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
1586 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
1587 */
1588struct wifi_passpoint_network_param {
1589 uint32_t id;
1590 uint8_t realm[WMI_PASSPOINT_REALM_LEN];
1591 int64_t roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
1592 uint8_t plmn[WMI_PASSPOINT_PLMN_LEN];
1593};
1594
1595/**
1596 * struct wifi_passpoint_req_param - passpoint request
1597 * @request_id: request identifier
1598 * @num_networks: number of networks
1599 * @networks: passpoint networks
1600 */
1601struct wifi_passpoint_req_param {
1602 uint32_t request_id;
1603 uint32_t session_id;
1604 uint32_t num_networks;
1605 struct wifi_passpoint_network_param networks[];
1606};
1607
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301608/* struct mobility_domain_info - structure containing
1609 * mobility domain info
1610 * @mdie_present: mobility domain present or not
1611 * @mobility_domain: mobility domain
1612 */
1613struct mobility_domain_info {
1614 uint8_t mdie_present;
1615 uint16_t mobility_domain;
1616};
1617
1618/* struct roam_offload_scan_params - structure
1619 * containing roaming offload scan parameters
1620 * @is_roam_req_valid: flag to tell whether roam req
1621 * is valid or NULL
1622 * @mode: stores flags for scan
1623 * @vdev_id: vdev id
1624 * @roam_offload_enabled: flag for offload enable
1625 * @psk_pmk: pre shared key/pairwise master key
1626 * @pmk_len: length of PMK
1627 * @prefer_5ghz: prefer select 5G candidate
1628 * @roam_rssi_cat_gap: gap for every category bucket
1629 * @select_5ghz_margin: select 5 Ghz margin
1630 * @krk: KRK
1631 * @btk: BTK
1632 * @reassoc_failure_timeout: reassoc failure timeout
1633 * @rokh_id_length: r0kh id length
1634 * @rokh_id: r0kh id
1635 * @roam_key_mgmt_offload_enabled: roam offload flag
1636 * @auth_mode: authentication mode
1637 * @is_ese_assoc: flag to determine ese assoc
1638 * @mdid: mobility domain info
1639 * @roam_offload_params: roam offload tlv params
1640 */
1641struct roam_offload_scan_params {
1642 uint8_t is_roam_req_valid;
1643 uint32_t mode;
1644 uint32_t vdev_id;
1645#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1646 uint8_t roam_offload_enabled;
1647 uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
1648 uint32_t pmk_len;
1649 uint8_t prefer_5ghz;
1650 uint8_t roam_rssi_cat_gap;
1651 uint8_t select_5ghz_margin;
1652 uint8_t krk[WMI_KRK_KEY_LEN];
1653 uint8_t btk[WMI_BTK_KEY_LEN];
1654 uint32_t reassoc_failure_timeout;
1655 uint32_t rokh_id_length;
1656 uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN];
1657 uint8_t roam_key_mgmt_offload_enabled;
1658 int auth_mode;
1659#endif
1660 bool is_ese_assoc;
1661 struct mobility_domain_info mdid;
Govind Singh89727882016-04-15 13:58:27 +05301662#ifndef WMI_NON_TLV_SUPPORT
1663 /* THis is not available in non tlv target.
1664 * please remove this and replace with a host based
1665 * structure */
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301666 wmi_roam_offload_tlv_param roam_offload_params;
Govind Singh89727882016-04-15 13:58:27 +05301667#endif
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301668};
1669
1670/* struct roam_offload_scan_rssi_params - structure containing
1671 * parameters for roam offload scan based on RSSI
1672 * @rssi_thresh: rssi threshold
1673 * @rssi_thresh_diff: difference in rssi threshold
1674 * @hi_rssi_scan_max_count: 5G scan max count
1675 * @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
1676 * @hi_rssi_scan_rssi_ub: 5G scan upper bound
1677 * @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
1678 * @session_id: vdev id
1679 * @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
1680 * @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
1681 * @raise_factor_5g: factor by which 5GHz RSSI is boosted
1682 * @drop_factor_5g: factor by which 5GHz RSSI is penalized
1683 * @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
1684 * @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
1685 * @good_rssi_threshold: RSSI below which roam is kicked in by background
1686 * scan although rssi is still good
1687 * @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
1688 * unit is dB above NF
1689 * @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
1690 * unit is dB above NF
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301691 * @dense_rssi_thresh_offset: dense roam RSSI threshold difference
1692 * @dense_min_aps_cnt: dense roam minimum APs
1693 * @initial_dense_status: dense status detected by host
1694 * @traffic_threshold: dense roam RSSI threshold
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301695 */
1696struct roam_offload_scan_rssi_params {
1697 int8_t rssi_thresh;
1698 uint8_t rssi_thresh_diff;
1699 uint32_t hi_rssi_scan_max_count;
1700 uint32_t hi_rssi_scan_rssi_delta;
1701 int32_t hi_rssi_scan_rssi_ub;
1702 int raise_rssi_thresh_5g;
1703 uint8_t session_id;
1704 uint32_t penalty_threshold_5g;
1705 uint32_t boost_threshold_5g;
1706 uint8_t raise_factor_5g;
1707 uint8_t drop_factor_5g;
1708 int max_raise_rssi_5g;
1709 int max_drop_rssi_5g;
1710 uint32_t good_rssi_threshold;
1711 uint32_t roam_earlystop_thres_min;
1712 uint32_t roam_earlystop_thres_max;
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301713 int dense_rssi_thresh_offset;
1714 int dense_min_aps_cnt;
1715 int initial_dense_status;
1716 int traffic_threshold;
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301717};
1718
Govind Singhae855362016-03-07 14:24:22 +05301719/**
1720 * struct wifi_epno_network - enhanced pno network block
1721 * @ssid: ssid
1722 * @rssi_threshold: threshold for considering this SSID as found, required
1723 * granularity for this threshold is 4dBm to 8dBm
1724 * @flags: WIFI_PNO_FLAG_XXX
1725 * @auth_bit_field: auth bit field for matching WPA IE
1726 */
1727struct wifi_epno_network_params {
1728 struct mac_ssid ssid;
1729 int8_t rssi_threshold;
1730 uint8_t flags;
1731 uint8_t auth_bit_field;
1732};
1733
1734/**
1735 * struct wifi_enhanched_pno_params - enhanced pno network params
1736 * @num_networks: number of ssids
1737 * @networks: PNO networks
1738 */
1739struct wifi_enhanched_pno_params {
1740 uint32_t request_id;
1741 uint32_t session_id;
1742 uint32_t num_networks;
1743 struct wifi_epno_network_params networks[];
1744};
1745
1746enum {
1747 WMI_AP_RX_DATA_OFFLOAD = 0x00,
1748 WMI_STA_RX_DATA_OFFLOAD = 0x01,
1749};
1750
1751/**
Govind Singhc7cd2d62016-06-21 14:33:26 +05301752 * enum extscan_configuration_flags - extscan config flags
1753 * @WMI_EXTSCAN_LP_EXTENDED_BATCHING: extended batching
1754 */
1755enum wmi_extscan_configuration_flags {
1756 WMI_EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
1757};
1758
1759/**
Govind Singhae855362016-03-07 14:24:22 +05301760 * enum extscan_report_events_type - extscan report events type
1761 * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full
1762 * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan
1763 * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results
1764 * (beacons/probe responses + IEs)
1765 * in real time to HAL, in addition to completion events.
1766 * Note: To keep backward compatibility,
1767 * fire completion events regardless of REPORT_EVENTS_EACH_SCAN.
1768 * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching,
1769 * 0 => batching, 1 => no batching
1770 */
1771enum wmi_extscan_report_events_type {
1772 WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL = 0x00,
1773 WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN = 0x01,
1774 WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS = 0x02,
1775 WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH = 0x04,
1776};
1777
1778/**
1779 * struct ipa_offload_control_params - ipa offload parameters
1780 * @offload_type: ipa offload type
1781 * @vdev_id: vdev id
1782 * @enable: ipa offload enable/disable
1783 */
1784struct ipa_offload_control_params {
1785 uint32_t offload_type;
1786 uint32_t vdev_id;
1787 uint32_t enable;
1788};
1789
1790/**
1791 * struct extscan_capabilities_params - ext scan capablities
1792 * @request_id: request_id
1793 * @session_id: session_id
1794 */
1795struct extscan_capabilities_params {
1796 uint32_t request_id;
1797 uint8_t session_id;
1798};
1799
1800/**
1801 * struct extscan_capabilities_reset_params - ext scan capablities reset parameter
1802 * @request_id: request_id
1803 * @session_id: session_id
1804 */
1805struct extscan_capabilities_reset_params {
1806 uint32_t request_id;
1807 uint8_t session_id;
1808};
1809
1810/**
1811 * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter
1812 * @request_id: request_id
1813 * @session_id: session_id
1814 */
1815struct extscan_bssid_hotlist_reset_params {
1816 uint32_t request_id;
1817 uint8_t session_id;
1818};
1819
1820/**
1821 * struct extscan_stop_req_params - ext scan stop parameter
1822 * @request_id: request_id
1823 * @session_id: session_id
1824 */
1825struct extscan_stop_req_params {
1826 uint32_t request_id;
1827 uint8_t session_id;
1828};
1829
1830/**
1831 * struct ap_threshold_params - ap threshold parameter
1832 * @bssid: mac address
1833 * @low: low threshold
1834 * @high: high threshold
1835 */
1836struct ap_threshold_params {
Govind Singhd7468a52016-03-09 14:32:57 +05301837 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05301838 int32_t low;
1839 int32_t high;
1840};
1841
1842/**
1843 * struct extscan_set_sig_changereq_params - ext scan channel parameter
1844 * @request_id: mac address
1845 * @session_id: low threshold
1846 * @rssi_sample_size: Number of samples for averaging RSSI
1847 * @lostap_sample_size: Number of missed samples to confirm AP loss
1848 * @min_breaching: Number of APs breaching threshold required for firmware
1849 * @num_ap: no of scanned ap
1850 * @ap: ap threshold parameter
1851 */
1852struct extscan_set_sig_changereq_params {
1853 uint32_t request_id;
1854 uint8_t session_id;
1855 uint32_t rssi_sample_size;
1856 uint32_t lostap_sample_size;
1857 uint32_t min_breaching;
1858 uint32_t num_ap;
1859 struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
1860};
1861
1862/**
1863 * struct extscan_cached_result_params - ext scan cached parameter
1864 * @request_id: mac address
1865 * @session_id: low threshold
1866 * @flush: cached results flush
1867 */
1868struct extscan_cached_result_params {
1869 uint32_t request_id;
1870 uint8_t session_id;
1871 bool flush;
1872};
1873
1874#ifdef FEATURE_WLAN_SCAN_PNO
1875/* Set PNO */
1876#define WMI_PNO_MAX_NETW_CHANNELS 26
1877#define WMI_PNO_MAX_NETW_CHANNELS_EX 60
1878#define WMI_PNO_MAX_SUPP_NETWORKS 16
1879
1880/*
1881 * size based of dot11 declaration without extra IEs as we will not carry those
1882 * for PNO
1883 */
1884#define WMI_PNO_MAX_PB_REQ_SIZE 450
1885
1886#define WMI_PNO_24G_DEFAULT_CH 1
1887#define WMI_PNO_5G_DEFAULT_CH 36
1888
1889/**
1890 * enum pno_mode - pno mode types
1891 * @WMI_PNO_MODE_IMMEDIATE: immidiate mode
1892 * @WMI_PNO_MODE_ON_SUSPEND: suspend on mode
1893 * @WMI_PNO_MODE_ON_RESUME: resume on mode
1894 * @WMI_PNO_MODE_MAX: max range
1895 */
1896enum pno_mode {
1897 WMI_PNO_MODE_IMMEDIATE,
1898 WMI_PNO_MODE_ON_SUSPEND,
1899 WMI_PNO_MODE_ON_RESUME,
1900 WMI_PNO_MODE_MAX
1901};
1902
1903/**
1904 * struct pno_nw_type - pno nw type
1905 * @ssid: mac ssid
1906 * @authentication: authentication type
1907 * @encryption: encryption type
1908 * @bcastNetwType: broadcast nw type
1909 * @ucChannelCount: uc channel count
1910 * @aChannels: pno channel
1911 * @rssiThreshold: rssi threshold
1912 */
1913struct pno_nw_type {
1914 struct mac_ssid ssid;
1915 uint32_t authentication;
1916 uint32_t encryption;
1917 uint32_t bcastNetwType;
1918 uint8_t ucChannelCount;
1919 uint8_t aChannels[WMI_PNO_MAX_NETW_CHANNELS_EX];
1920 int32_t rssiThreshold;
1921};
1922
1923/**
1924 * struct pno_scan_req_params - PNO Scan request structure
1925 * @enable: flag to enable or disable
1926 * @modePNO: PNO Mode
1927 * @ucNetworksCount: Number of networks
1928 * @aNetworks: Preferred network list
1929 * @sessionId: Session identifier
1930 * @fast_scan_period: Fast Scan period
1931 * @slow_scan_period: Slow scan period
1932 * @fast_scan_max_cycles: Fast scan max cycles
1933 * @us24GProbeTemplateLen: 2.4G probe template length
1934 * @p24GProbeTemplate: 2.4G probe template
1935 * @us5GProbeTemplateLen: 5G probe template length
1936 * @p5GProbeTemplate: 5G probe template
Gupta, Kapil7b768002016-04-25 19:14:19 +05301937 * @pno_channel_prediction: PNO channel prediction feature status
1938 * @top_k_num_of_channels: top K number of channels are used for tanimoto
1939 * distance calculation.
1940 * @stationary_thresh: threshold value to determine that the STA is stationary.
1941 * @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan
1942 * @channel_prediction_full_scan: periodic timer upon which a full scan needs
1943 * to be triggered.
Govind Singhae855362016-03-07 14:24:22 +05301944 */
1945struct pno_scan_req_params {
1946 uint8_t enable;
1947 enum pno_mode modePNO;
1948 uint8_t ucNetworksCount;
1949 struct pno_nw_type aNetworks[WMI_PNO_MAX_SUPP_NETWORKS];
1950 uint8_t sessionId;
1951 uint32_t fast_scan_period;
1952 uint32_t slow_scan_period;
1953 uint8_t fast_scan_max_cycles;
1954 uint32_t active_min_time;
1955 uint32_t active_max_time;
1956 uint32_t passive_min_time;
1957 uint32_t passive_max_time;
1958 uint16_t us24GProbeTemplateLen;
1959 uint8_t p24GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
1960 uint16_t us5GProbeTemplateLen;
1961 uint8_t p5GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
1962#ifdef FEATURE_WLAN_SCAN_PNO
1963 bool pno_channel_prediction;
1964 uint8_t top_k_num_of_channels;
1965 uint8_t stationary_thresh;
Gupta, Kapil7b768002016-04-25 19:14:19 +05301966 enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05301967 uint32_t channel_prediction_full_scan;
1968#endif
1969};
1970
1971#endif /* FEATURE_WLAN_SCAN_PNO */
1972
1973#define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36
1974#define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16
1975#define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128
1976#define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
1977#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
1978
1979/**
1980 * struct wifi_scan_channelspec_params - wifi scan channel parameter
1981 * @channel: Frequency in MHz
1982 * @dwellTimeMs: dwell time
1983 * @flush: cached results flush
1984 * @passive: passive scan
1985 * @chnlClass: channel class
1986 */
1987struct wifi_scan_channelspec_params {
1988 uint32_t channel;
1989 uint32_t dwellTimeMs;
1990 bool passive;
1991 uint8_t chnlClass;
1992};
1993
1994/**
1995 * enum wmi_wifi_band - wifi band
1996 * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band
1997 * @WMI_WIFI_BAND_BG: 2.4 GHz
1998 * @WMI_WIFI_BAND_A: 5 GHz without DFS
1999 * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS
2000 * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only
2001 * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS
2002 * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS
2003 * @WMI_WIFI_BAND_MAX: max range
2004 */
2005enum wmi_wifi_band {
2006 WMI_WIFI_BAND_UNSPECIFIED,
2007 WMI_WIFI_BAND_BG = 1,
2008 WMI_WIFI_BAND_A = 2,
2009 WMI_WIFI_BAND_ABG = 3,
2010 WMI_WIFI_BAND_A_DFS_ONLY = 4,
2011 /* 5 is reserved */
2012 WMI_WIFI_BAND_A_WITH_DFS = 6,
2013 WMI_WIFI_BAND_ABG_WITH_DFS = 7,
2014 /* Keep it last */
2015 WMI_WIFI_BAND_MAX
2016};
2017
2018/**
2019 * struct wifi_scan_bucket_params - wifi scan bucket spec
2020 * @bucket: bucket identifier
2021 * @band: wifi band
2022 * @period: Desired period, in millisecond; if this is too
2023 * low, the firmware should choose to generate results as fast as
2024 * it can instead of failing the command byte
2025 * for exponential backoff bucket this is the min_period
2026 * @reportEvents: 0 => normal reporting (reporting rssi history
2027 * only, when rssi history buffer is % full)
2028 * 1 => same as 0 + report a scan completion event after scanning
2029 * this bucket
2030 * 2 => same as 1 + forward scan results
2031 * (beacons/probe responses + IEs) in real time to HAL
2032 * @max_period: if max_period is non zero or different than period,
2033 * then this bucket is an exponential backoff bucket and
2034 * the scan period will grow exponentially as per formula:
2035 * actual_period(N) = period ^ (N/(step_count+1)) to a
2036 * maximum period of max_period
2037 * @exponent: for exponential back off bucket: multiplier:
2038 * new_period = old_period * exponent
2039 * @step_count: for exponential back off bucket, number of scans performed
2040 * at a given period and until the exponent is applied
2041 * @numChannels: channels to scan; these may include DFS channels
2042 * Note that a given channel may appear in multiple buckets
2043 * @min_dwell_time_active: per bucket minimum active dwell time
2044 * @max_dwell_time_active: per bucket maximum active dwell time
2045 * @min_dwell_time_passive: per bucket minimum passive dwell time
2046 * @max_dwell_time_passive: per bucket maximum passive dwell time
2047 * @channels: Channel list
2048 */
2049struct wifi_scan_bucket_params {
2050 uint8_t bucket;
2051 enum wmi_wifi_band band;
2052 uint32_t period;
2053 uint32_t reportEvents;
2054 uint32_t max_period;
2055 uint32_t exponent;
2056 uint32_t step_count;
2057 uint32_t numChannels;
2058 uint32_t min_dwell_time_active;
2059 uint32_t max_dwell_time_active;
2060 uint32_t min_dwell_time_passive;
2061 uint32_t max_dwell_time_passive;
2062 struct wifi_scan_channelspec_params channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS];
2063};
2064
2065/**
2066 * struct wifi_scan_cmd_req_params - wifi scan command request params
2067 * @basePeriod: base timer period
2068 * @maxAPperScan: max ap per scan
2069 * @report_threshold_percent: report threshold
2070 * in %, when buffer is this much full, wake up host
2071 * @report_threshold_num_scans: report threshold number of scans
2072 * in number of scans, wake up host after these many scans
2073 * @requestId: request id
2074 * @sessionId: session id
2075 * @numBuckets: number of buckets
2076 * @min_dwell_time_active: per bucket minimum active dwell time
2077 * @max_dwell_time_active: per bucket maximum active dwell time
2078 * @min_dwell_time_passive: per bucket minimum passive dwell time
2079 * @max_dwell_time_passive: per bucket maximum passive dwell time
2080 * @configuration_flags: configuration flags
Gupta, Kapil7b768002016-04-25 19:14:19 +05302081 * @extscan_adaptive_dwell_mode: adaptive dwelltime mode for extscan
Govind Singhae855362016-03-07 14:24:22 +05302082 * @buckets: buckets array
2083 */
2084struct wifi_scan_cmd_req_params {
2085 uint32_t basePeriod;
2086 uint32_t maxAPperScan;
2087
2088 uint32_t report_threshold_percent;
2089 uint32_t report_threshold_num_scans;
2090
2091 uint32_t requestId;
2092 uint8_t sessionId;
2093 uint32_t numBuckets;
2094
2095 uint32_t min_dwell_time_active;
2096 uint32_t max_dwell_time_active;
2097 uint32_t min_dwell_time_passive;
2098 uint32_t max_dwell_time_passive;
2099 uint32_t configuration_flags;
Gupta, Kapil7b768002016-04-25 19:14:19 +05302100 enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05302101 struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS];
2102};
2103
Govind Singhae855362016-03-07 14:24:22 +05302104#define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
Govind Singhc7cd2d62016-06-21 14:33:26 +05302105/* Occupied channel list remains static */
2106#define WMI_CHANNEL_LIST_STATIC 1
2107/* Occupied channel list can be learnt after init */
2108#define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
2109/* Occupied channel list can be learnt after flush */
2110#define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
2111/* Occupied channel list can be learnt after update */
2112#define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
Govind Singhae855362016-03-07 14:24:22 +05302113
2114/**
2115 * struct plm_req_params - plm req parameter
2116 * @diag_token: Dialog token
2117 * @meas_token: measurement token
2118 * @num_bursts: total number of bursts
2119 * @burst_int: burst interval in seconds
2120 * @meas_duration:in TU's,STA goes off-ch
2121 * @burst_len: no of times the STA should cycle through PLM ch list
2122 * @desired_tx_pwr: desired tx power
2123 * @mac_addr: MC dest addr
2124 * @plm_num_ch: channel numbers
2125 * @plm_ch_list: channel list
2126 * @session_id: session id
2127 * @enable: enable/disable
2128 */
2129struct plm_req_params {
2130 uint16_t diag_token;
2131 uint16_t meas_token;
2132 uint16_t num_bursts;
2133 uint16_t burst_int;
2134 uint16_t meas_duration;
2135 /* no of times the STA should cycle through PLM ch list */
2136 uint8_t burst_len;
2137 int8_t desired_tx_pwr;
Govind Singhd7468a52016-03-09 14:32:57 +05302138 struct qdf_mac_addr mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05302139 /* no of channels */
2140 uint8_t plm_num_ch;
2141 /* channel numbers */
2142 uint8_t plm_ch_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
2143 uint8_t session_id;
2144 bool enable;
2145};
Naveen Rawatd5ffe152016-04-14 23:42:46 -07002146
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05302147#define MAX_SSID_ALLOWED_LIST 4
2148#define MAX_BSSID_AVOID_LIST 16
2149#define MAX_BSSID_FAVORED 16
Govind Singhae855362016-03-07 14:24:22 +05302150
2151
2152/**
2153 * struct mac_ts_info_tfc - mac ts info parameters
2154 * @burstSizeDefn: burst size
2155 * @reserved: reserved
2156 * @ackPolicy: ack policy
2157 * @psb: psb
2158 * @aggregation: aggregation
2159 * @accessPolicy: access policy
2160 * @direction: direction
2161 * @tsid: direction
2162 * @trafficType: traffic type
2163 */
2164struct mac_ts_info_tfc {
2165#ifndef ANI_LITTLE_BIT_ENDIAN
2166 uint8_t burstSizeDefn:1;
2167 uint8_t reserved:7;
2168#else
2169 uint8_t reserved:7;
2170 uint8_t burstSizeDefn:1;
2171#endif
2172
2173#ifndef ANI_LITTLE_BIT_ENDIAN
2174 uint16_t ackPolicy:2;
2175 uint16_t userPrio:3;
2176 uint16_t psb:1;
2177 uint16_t aggregation:1;
2178 uint16_t accessPolicy:2;
2179 uint16_t direction:2;
2180 uint16_t tsid:4;
2181 uint16_t trafficType:1;
2182#else
2183 uint16_t trafficType:1;
2184 uint16_t tsid:4;
2185 uint16_t direction:2;
2186 uint16_t accessPolicy:2;
2187 uint16_t aggregation:1;
2188 uint16_t psb:1;
2189 uint16_t userPrio:3;
2190 uint16_t ackPolicy:2;
2191#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302192} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302193
2194/**
2195 * struct mac_ts_info_sch - mac ts info schedule parameters
2196 * @rsvd: reserved
2197 * @schedule: schedule bit
2198 */
2199struct mac_ts_info_sch {
2200#ifndef ANI_LITTLE_BIT_ENDIAN
2201 uint8_t rsvd:7;
2202 uint8_t schedule:1;
2203#else
2204 uint8_t schedule:1;
2205 uint8_t rsvd:7;
2206#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302207} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302208
2209/**
2210 * struct mac_ts_info_sch - mac ts info schedule parameters
2211 * @traffic: mac tfc parameter
2212 * @schedule: mac schedule parameters
2213 */
2214struct mac_ts_info {
2215 struct mac_ts_info_tfc traffic;
2216 struct mac_ts_info_sch schedule;
Govind Singhd7468a52016-03-09 14:32:57 +05302217} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302218
2219/**
2220 * struct mac_tspec_ie - mac ts spec
2221 * @type: type
2222 * @length: length
2223 * @tsinfo: tsinfo
2224 * @nomMsduSz: nomMsduSz
2225 * @maxMsduSz: maxMsduSz
2226 * @minSvcInterval: minSvcInterval
2227 * @maxSvcInterval: maxSvcInterval
2228 * @inactInterval: inactInterval
2229 * @suspendInterval: suspendInterval
2230 * @svcStartTime: svcStartTime
2231 * @minDataRate: minDataRate
2232 * @meanDataRate: meanDataRate
2233 * @peakDataRate: peakDataRate
2234 * @maxBurstSz: maxBurstSz
2235 * @delayBound: delayBound
2236 * @minPhyRate: minPhyRate
2237 * @surplusBw: surplusBw
2238 * @mediumTime: mediumTime
2239 */
2240struct mac_tspec_ie {
2241 uint8_t type;
2242 uint8_t length;
2243 struct mac_ts_info tsinfo;
2244 uint16_t nomMsduSz;
2245 uint16_t maxMsduSz;
2246 uint32_t minSvcInterval;
2247 uint32_t maxSvcInterval;
2248 uint32_t inactInterval;
2249 uint32_t suspendInterval;
2250 uint32_t svcStartTime;
2251 uint32_t minDataRate;
2252 uint32_t meanDataRate;
2253 uint32_t peakDataRate;
2254 uint32_t maxBurstSz;
2255 uint32_t delayBound;
2256 uint32_t minPhyRate;
2257 uint16_t surplusBw;
2258 uint16_t mediumTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302259} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302260
2261/**
2262 * struct add_ts_param - ADDTS related parameters
2263 * @staIdx: station index
2264 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2265 * @tspec: tspec value
2266 * @status: CDF status
2267 * @sessionId: session id
Govind Singhd7468a52016-03-09 14:32:57 +05302268 * @tsm_interval: TSM interval period passed from UMAC to WMI
Govind Singhae855362016-03-07 14:24:22 +05302269 * @setRICparams: RIC parameters
2270 * @sme_session_id: sme session id
2271 */
2272struct add_ts_param {
2273 uint16_t staIdx;
2274 uint16_t tspecIdx;
2275 struct mac_tspec_ie tspec;
Govind Singhd7468a52016-03-09 14:32:57 +05302276 QDF_STATUS status;
Govind Singhae855362016-03-07 14:24:22 +05302277 uint8_t sessionId;
2278#ifdef FEATURE_WLAN_ESE
2279 uint16_t tsm_interval;
2280#endif /* FEATURE_WLAN_ESE */
2281#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2282 uint8_t setRICparams;
2283#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2284 uint8_t sme_session_id;
2285};
2286
2287/**
2288 * struct delts_req_info - DELTS request parameter
2289 * @tsinfo: ts info
2290 * @tspec: ts spec
2291 * @wmeTspecPresent: wme ts spec flag
2292 * @wsmTspecPresent: wsm ts spec flag
2293 * @lleTspecPresent: lle ts spec flag
2294 */
2295struct delts_req_info {
2296 struct mac_ts_info tsinfo;
2297 struct mac_tspec_ie tspec;
2298 uint8_t wmeTspecPresent:1;
2299 uint8_t wsmTspecPresent:1;
2300 uint8_t lleTspecPresent:1;
2301};
2302
2303/**
2304 * struct del_ts_params - DELTS related parameters
2305 * @staIdx: station index
2306 * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS
2307 * @bssId: BSSID
2308 * @sessionId: session id
2309 * @userPrio: user priority
2310 * @delTsInfo: DELTS info
2311 * @setRICparams: RIC parameters
2312 */
2313struct del_ts_params {
2314 uint16_t staIdx;
2315 uint16_t tspecIdx;
Govind Singh8675b862016-03-28 22:09:18 +05302316 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302317 uint8_t sessionId;
2318 uint8_t userPrio;
2319#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2320 struct delts_req_info delTsInfo;
2321 uint8_t setRICparams;
2322#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2323};
2324
2325/**
2326 * struct ll_stats_clear_params - ll stats clear parameter
2327 * @req_id: request id
2328 * @sta_id: sta id
2329 * @stats_clear_mask: stats clear mask
2330 * @stop_req: stop request
2331 */
2332struct ll_stats_clear_params {
2333 uint32_t req_id;
2334 uint8_t sta_id;
2335 uint32_t stats_clear_mask;
2336 uint8_t stop_req;
2337};
2338
2339/**
2340 * struct ll_stats_set_params - ll stats get parameter
2341 * @req_id: request id
2342 * @sta_id: sta id
2343 * @mpdu_size_threshold: mpdu sixe threshold
2344 * @aggressive_statistics_gathering: aggressive_statistics_gathering
2345 */
2346struct ll_stats_set_params {
2347 uint32_t req_id;
2348 uint8_t sta_id;
2349 uint32_t mpdu_size_threshold;
2350 uint32_t aggressive_statistics_gathering;
2351};
2352
2353/**
2354 * struct ll_stats_get_params - ll stats parameter
2355 * @req_id: request id
2356 * @sta_id: sta id
2357 * @param_id_mask: param is mask
2358 */
2359struct ll_stats_get_params {
2360 uint32_t req_id;
2361 uint8_t sta_id;
2362 uint32_t param_id_mask;
2363};
2364
2365/**
2366 * struct pe_stats_req - pe stats parameter
2367 * @msg_type: message type is same as the request type
2368 * @msg_len: length of the entire request
2369 * @sta_id: Per STA stats request must contain valid
2370 * @stats_mask: categories of stats requested
2371 * @session_id: wsm ts spec flag
2372 */
2373struct pe_stats_req {
2374 /* Common for all types are requests */
2375 uint16_t msg_type;
2376 uint16_t msg_len;
2377 uint32_t sta_id;
2378 /* categories of stats requested. look at ePEStatsMask */
2379 uint32_t stats_mask;
2380 uint8_t session_id;
2381};
2382
2383/**
2384 * struct link_status_params - link stats parameter
2385 * @msg_type: message type is same as the request type
2386 * @msg_len: length of the entire request
2387 * @link_status: wme ts spec flag
2388 * @session_id: wsm ts spec flag
2389 */
2390struct link_status_params {
2391 uint16_t msg_type;
2392 uint16_t msg_len;
2393 uint8_t link_status;
2394 uint8_t session_id;
2395};
2396
2397/**
2398 * struct dhcp_stop_ind_params - DHCP Stop indication message
2399 * @msgtype: message type is same as the request type
2400 * @msglen: length of the entire request
2401 * @device_mode: Mode of the device(ex:STA, AP)
2402 * @adapter_macaddr: MAC address of the adapter
2403 * @peer_macaddr: MAC address of the connected peer
2404 */
2405struct dhcp_stop_ind_params {
2406 uint16_t msgtype;
2407 uint16_t msglen;
2408 uint8_t device_mode;
Govind Singhd7468a52016-03-09 14:32:57 +05302409 struct qdf_mac_addr adapter_macaddr;
2410 struct qdf_mac_addr peer_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05302411};
2412
2413/**
2414 * struct aggr_add_ts_param - ADDTS parameters
2415 * @staIdx: station index
2416 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2417 * @tspec: tspec value
2418 * @status: CDF status
2419 * @sessionId: session id
2420 */
2421struct aggr_add_ts_param {
2422 uint16_t staIdx;
2423 uint16_t tspecIdx;
2424 struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
Govind Singhd7468a52016-03-09 14:32:57 +05302425 QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
Govind Singhae855362016-03-07 14:24:22 +05302426 uint8_t sessionId;
2427};
2428
2429#define WMI_MAX_FILTER_TEST_DATA_LEN 8
2430#define WMI_MAX_NUM_MULTICAST_ADDRESS 240
2431#define WMI_MAX_NUM_FILTERS 20
2432#define WMI_MAX_NUM_TESTS_PER_FILTER 10
2433
2434/**
2435 * enum packet_filter_type - packet filter type
2436 * @WMI_RCV_FILTER_TYPE_INVALID: invalid type
2437 * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type
2438 * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type
2439 * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size
2440 */
2441enum packet_filter_type {
2442 WMI_RCV_FILTER_TYPE_INVALID,
2443 WMI_RCV_FILTER_TYPE_FILTER_PKT,
2444 WMI_RCV_FILTER_TYPE_BUFFER_PKT,
2445 WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE
2446};
2447
2448/**
2449 * enum packet_protocol_type - packet protocol type
2450 * @WMI_FILTER_HDR_TYPE_INVALID: invalid type
2451 * @WMI_FILTER_HDR_TYPE_MAC: mac type
2452 * @WMI_FILTER_HDR_TYPE_ARP: trp type
2453 * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type
2454 * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type
2455 * @WMI_FILTER_HDR_TYPE_UDP: udp type
2456 * @WMI_FILTER_HDR_TYPE_MAX: max type
2457 */
2458enum packet_protocol_type {
2459 WMI_FILTER_HDR_TYPE_INVALID,
2460 WMI_FILTER_HDR_TYPE_MAC,
2461 WMI_FILTER_HDR_TYPE_ARP,
2462 WMI_FILTER_HDR_TYPE_IPV4,
2463 WMI_FILTER_HDR_TYPE_IPV6,
2464 WMI_FILTER_HDR_TYPE_UDP,
2465 WMI_FILTER_HDR_TYPE_MAX
2466};
2467
2468/**
2469 * enum packet_filter_comp_type - packet filter comparison type
2470 * @WMI_FILTER_CMP_TYPE_INVALID: invalid type
2471 * @WMI_FILTER_CMP_TYPE_EQUAL: type equal
2472 * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal
2473 * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal
2474 * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
2475 * @WMI_FILTER_CMP_TYPE_MAX: max type
2476 */
2477enum packet_filter_comp_type {
2478 WMI_FILTER_CMP_TYPE_INVALID,
2479 WMI_FILTER_CMP_TYPE_EQUAL,
2480 WMI_FILTER_CMP_TYPE_MASK_EQUAL,
2481 WMI_FILTER_CMP_TYPE_NOT_EQUAL,
2482 WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
2483 WMI_FILTER_CMP_TYPE_MAX
2484};
2485
2486/**
2487 * struct rcv_pkt_filter_params - recieve packet filter parameters
2488 * @protocolLayer - protocol layer
2489 * @cmpFlag - comparison flag
2490 * @dataLength - data length
2491 * @dataOffset - data offset
2492 * @reserved - resserved
2493 * @compareData - compare data
2494 * @dataMask - data mask
2495 */
2496struct rcv_pkt_filter_params {
2497 enum packet_protocol_type protocolLayer;
2498 enum packet_filter_comp_type cmpFlag;
2499 uint16_t dataLength;
2500 uint8_t dataOffset;
2501 uint8_t reserved;
2502 uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN];
2503 uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN];
2504};
2505
2506/**
2507 * struct rcv_pkt_filter_config - recieve packet filter info
2508 * @filterId - filter id
2509 * @filterType - filter type
2510 * @numFieldParams - no of fields
2511 * @coalesceTime - reserved parameter
2512 * @self_macaddr - self mac address
2513 * @bssid - Bssid of the connected AP
2514 * @paramsData - data parameter
2515 */
2516struct rcv_pkt_filter_config {
2517 uint8_t filterId;
2518 enum packet_filter_type filterType;
2519 uint32_t numFieldParams;
2520 uint32_t coalesceTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302521 struct qdf_mac_addr self_macaddr;
2522 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302523 struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER];
2524};
2525
2526/**
2527 * struct vdev_ie_info_param - IE info
2528 * @vdev_id - vdev for which the IE is being sent
2529 * @ie_id - ID of the IE
2530 * @length - length of the IE data
2531 * @data - IE data
2532 *
2533 * This structure is used to store the IE information.
2534 */
2535struct vdev_ie_info_param {
2536 uint32_t vdev_id;
2537 uint32_t ie_id;
2538 uint32_t length;
2539 uint8_t *data;
2540};
2541
2542#define WMI_MAX_NUM_FW_SEGMENTS 4
2543
2544/**
2545 * struct fw_dump_seg_req_param - individual segment details
2546 * @seg_id - segment id.
2547 * @seg_start_addr_lo - lower address of the segment.
2548 * @seg_start_addr_hi - higher address of the segment.
2549 * @seg_length - length of the segment.
2550 * @dst_addr_lo - lower address of the destination buffer.
2551 * @dst_addr_hi - higher address of the destination buffer.
2552 *
2553 * This structure carries the information to firmware about the
2554 * individual segments. This structure is part of firmware memory
2555 * dump request.
2556 */
2557struct fw_dump_seg_req_param {
2558 uint8_t seg_id;
2559 uint32_t seg_start_addr_lo;
2560 uint32_t seg_start_addr_hi;
2561 uint32_t seg_length;
2562 uint32_t dst_addr_lo;
2563 uint32_t dst_addr_hi;
2564};
2565
2566/**
2567 * struct fw_dump_req_param - firmware memory dump request details.
2568 * @request_id - request id.
2569 * @num_seg - requested number of segments.
2570 * @fw_dump_seg_req - individual segment information.
2571 *
2572 * This structure carries information about the firmware
2573 * memory dump request.
2574 */
2575struct fw_dump_req_param {
2576 uint32_t request_id;
2577 uint32_t num_seg;
2578 struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS];
2579};
2580
2581#define WMI_TDLS_MAX_SUPP_CHANNELS 128
2582#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
2583#define WMI_2_4_GHZ_MAX_FREQ 3000
2584
2585/**
2586 * struct tdls_update_ch_params - channel parameters
2587 * @chanId: ID of the channel
2588 * @pwr: power level
2589 * @dfsSet: is dfs supported or not
2590 * @half_rate: is the channel operating at 10MHz
2591 * @quarter_rate: is the channel operating at 5MHz
2592 */
2593struct tdls_update_ch_params {
2594 uint8_t chanId;
2595 uint8_t pwr;
2596 bool dfsSet;
2597 bool half_rate;
2598 bool quarter_rate;
2599};
2600
2601/**
2602 * struct tdls_peer_cap_params - TDLS peer capablities parameters
2603 * @isPeerResponder: is peer responder or not
2604 * @peerUapsdQueue: peer uapsd queue
2605 * @peerMaxSp: peer max SP value
2606 * @peerBuffStaSupport: peer buffer sta supported or not
2607 * @peerOffChanSupport: peer offchannel support
2608 * @peerCurrOperClass: peer current operating class
2609 * @selfCurrOperClass: self current operating class
2610 * @peerChanLen: peer channel length
2611 * @peerChan: peer channel list
2612 * @peerOperClassLen: peer operating class length
2613 * @peerOperClass: peer operating class
2614 * @prefOffChanNum: peer offchannel number
2615 * @prefOffChanBandwidth: peer offchannel bandwidth
2616 * @opClassForPrefOffChan: operating class for offchannel
2617 */
2618struct tdls_peer_cap_params {
2619 uint8_t isPeerResponder;
2620 uint8_t peerUapsdQueue;
2621 uint8_t peerMaxSp;
2622 uint8_t peerBuffStaSupport;
2623 uint8_t peerOffChanSupport;
2624 uint8_t peerCurrOperClass;
2625 uint8_t selfCurrOperClass;
2626 uint8_t peerChanLen;
2627 struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
2628 uint8_t peerOperClassLen;
2629 uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
2630 uint8_t prefOffChanNum;
2631 uint8_t prefOffChanBandwidth;
2632 uint8_t opClassForPrefOffChan;
2633};
2634
2635/**
2636 * struct tdls_peer_state_params - TDLS peer state parameters
2637 * @vdevId: vdev id
2638 * @peerMacAddr: peer mac address
2639 * @peerCap: peer capabality
2640 */
2641struct tdls_peer_state_params {
2642 uint32_t vdevId;
Govind Singh8675b862016-03-28 22:09:18 +05302643 uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302644 uint32_t peerState;
2645 struct tdls_peer_cap_params peerCap;
2646};
2647
2648/**
2649 * struct wmi_tdls_params - TDLS parameters
2650 * @vdev_id: vdev id
2651 * @tdls_state: TDLS state
2652 * @notification_interval_ms: notification inerval
2653 * @tx_discovery_threshold: tx discovery threshold
2654 * @tx_teardown_threshold: tx teardown threashold
2655 * @rssi_teardown_threshold: RSSI teardown threshold
2656 * @rssi_delta: RSSI delta
2657 * @tdls_options: TDLS options
2658 * @peer_traffic_ind_window: raffic indication window
2659 * @peer_traffic_response_timeout: traffic response timeout
2660 * @puapsd_mask: uapsd mask
2661 * @puapsd_inactivity_time: uapsd inactivity time
2662 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
2663 * @teardown_notification_ms: tdls teardown notification interval
2664 * @tdls_peer_kickout_threshold: tdls packet threshold for
2665 * peer kickout operation
2666 */
2667struct wmi_tdls_params {
2668 uint32_t vdev_id;
2669 uint32_t tdls_state;
2670 uint32_t notification_interval_ms;
2671 uint32_t tx_discovery_threshold;
2672 uint32_t tx_teardown_threshold;
2673 int32_t rssi_teardown_threshold;
2674 int32_t rssi_delta;
2675 uint32_t tdls_options;
2676 uint32_t peer_traffic_ind_window;
2677 uint32_t peer_traffic_response_timeout;
2678 uint32_t puapsd_mask;
2679 uint32_t puapsd_inactivity_time;
2680 uint32_t puapsd_rx_frame_threshold;
2681 uint32_t teardown_notification_ms;
2682 uint32_t tdls_peer_kickout_threshold;
2683};
2684
2685/**
2686 * struct tdls_chan_switch_params - channel switch parameter structure
2687 * @vdev_id: vdev ID
2688 * @peer_mac_addr: Peer mac address
2689 * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
2690 * @tdls_off_ch: Target Off Channel
2691 * @oper_class: Operating class for target channel
2692 * @is_responder: Responder or initiator
2693 */
2694struct tdls_channel_switch_params {
2695 uint32_t vdev_id;
Govind Singh8675b862016-03-28 22:09:18 +05302696 uint8_t peer_mac_addr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302697 uint16_t tdls_off_ch_bw_offset;
2698 uint8_t tdls_off_ch;
2699 uint8_t tdls_sw_mode;
2700 uint8_t oper_class;
2701 uint8_t is_responder;
2702};
2703
2704/**
2705 * struct dhcp_offload_info_params - dhcp offload parameters
2706 * @vdev_id: request data length
2707 * @dhcpSrvOffloadEnabled: dhcp offload enabled
2708 * @dhcpClientNum: dhcp client no
2709 * @dhcpSrvIP: dhcp server ip
2710 */
2711struct dhcp_offload_info_params {
2712 uint32_t vdev_id;
2713 uint32_t dhcpSrvOffloadEnabled;
2714 uint32_t dhcpClientNum;
2715 uint32_t dhcpSrvIP;
2716};
2717
2718/**
2719 * struct nan_req_params - NAN request params
2720 * @request_data_len: request data length
2721 * @request_data: request data
2722 */
2723struct nan_req_params {
2724 uint16_t request_data_len;
2725 uint8_t request_data[];
2726};
2727
2728
2729/**
2730 * struct app_type2_params - app type2parameter
2731 * @vdev_id: vdev id
2732 * @rc4_key: rc4 key
2733 * @rc4_key_len: rc4 key length
2734 * @ip_id: NC id
2735 * @ip_device_ip: NC IP addres
2736 * @ip_server_ip: Push server IP address
2737 * @tcp_src_port: NC TCP port
2738 * @tcp_dst_port: Push server TCP port
2739 * @tcp_seq: tcp sequence
2740 * @tcp_ack_seq: tcp ack sequence
2741 * @keepalive_init: Initial ping interval
2742 * @keepalive_min: Minimum ping interval
2743 * @keepalive_max: Maximum ping interval
2744 * @keepalive_inc: Increment of ping interval
2745 * @gateway_mac: gateway mac address
2746 * @tcp_tx_timeout_val: tcp tx timeout value
2747 * @tcp_rx_timeout_val: tcp rx timeout value
2748 */
2749struct app_type2_params {
2750 uint8_t vdev_id;
2751 uint8_t rc4_key[16];
2752 uint32_t rc4_key_len;
2753 /** ip header parameter */
2754 uint32_t ip_id;
2755 uint32_t ip_device_ip;
2756 uint32_t ip_server_ip;
2757 /** tcp header parameter */
2758 uint16_t tcp_src_port;
2759 uint16_t tcp_dst_port;
2760 uint32_t tcp_seq;
2761 uint32_t tcp_ack_seq;
2762 uint32_t keepalive_init;
2763 uint32_t keepalive_min;
2764 uint32_t keepalive_max;
2765 uint32_t keepalive_inc;
Govind Singhd7468a52016-03-09 14:32:57 +05302766 struct qdf_mac_addr gateway_mac;
Govind Singhae855362016-03-07 14:24:22 +05302767 uint32_t tcp_tx_timeout_val;
2768 uint32_t tcp_rx_timeout_val;
2769};
2770
2771/**
2772 * struct app_type1_params - app type1 parameter
2773 * @vdev_id: vdev id
2774 * @wakee_mac_addr: mac address
2775 * @identification_id: identification id
2776 * @password: password
2777 * @id_length: id length
2778 * @pass_length: password length
2779 */
2780struct app_type1_params {
2781 uint8_t vdev_id;
Govind Singhd7468a52016-03-09 14:32:57 +05302782 struct qdf_mac_addr wakee_mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05302783 uint8_t identification_id[8];
2784 uint8_t password[16];
2785 uint32_t id_length;
2786 uint32_t pass_length;
2787};
2788
2789/**
2790 * enum wmi_ext_wow_type - wow type
2791 * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1
2792 * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2
2793 * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2
2794 */
2795enum wmi_ext_wow_type {
2796 WMI_EXT_WOW_TYPE_APP_TYPE1,
2797 WMI_EXT_WOW_TYPE_APP_TYPE2,
2798 WMI_EXT_WOW_TYPE_APP_TYPE1_2,
2799};
2800
2801/**
2802 * struct ext_wow_params - ext wow parameters
2803 * @vdev_id: vdev id
2804 * @type: wow type
2805 * @wakeup_pin_num: wake up gpio no
2806 */
2807struct ext_wow_params {
2808 uint8_t vdev_id;
2809 enum wmi_ext_wow_type type;
2810 uint32_t wakeup_pin_num;
2811};
2812
2813/**
2814 * struct stats_ext_params - ext stats request
2815 * @vdev_id: vdev id
2816 * @request_data_len: request data length
2817 * @request_data: request data
2818 */
2819struct stats_ext_params {
2820 uint32_t vdev_id;
2821 uint32_t request_data_len;
2822 uint8_t request_data[];
2823};
2824
2825#define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
2826/**
2827 * struct periodic_tx_pattern - periodic tx pattern
2828 * @mac_address: MAC Address for the adapter
2829 * @ucPtrnId: Pattern ID
2830 * @ucPtrnSize: Pattern size
2831 * @usPtrnIntervalMs: in ms
2832 * @ucPattern: Pattern buffer
2833 */
2834struct periodic_tx_pattern {
Govind Singhd7468a52016-03-09 14:32:57 +05302835 struct qdf_mac_addr mac_address;
Govind Singhae855362016-03-07 14:24:22 +05302836 uint8_t ucPtrnId;
2837 uint16_t ucPtrnSize;
2838 uint32_t usPtrnIntervalMs;
2839 uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
2840};
2841
2842#define WMI_GTK_OFFLOAD_KEK_BYTES 16
2843#define WMI_GTK_OFFLOAD_KCK_BYTES 16
Siddarth Poddard9221542016-04-01 17:45:06 +05302844#define WMI_GTK_OFFLOAD_ENABLE 0
2845#define WMI_GTK_OFFLOAD_DISABLE 1
Govind Singhae855362016-03-07 14:24:22 +05302846
2847/**
2848 * struct gtk_offload_params - gtk offload parameters
2849 * @ulFlags: optional flags
2850 * @aKCK: Key confirmation key
2851 * @aKEK: key encryption key
2852 * @ullKeyReplayCounter: replay counter
2853 * @bssid: bss id
2854 */
2855struct gtk_offload_params {
2856 uint32_t ulFlags;
2857 uint8_t aKCK[WMI_GTK_OFFLOAD_KCK_BYTES];
2858 uint8_t aKEK[WMI_GTK_OFFLOAD_KEK_BYTES];
2859 uint64_t ullKeyReplayCounter;
Govind Singhd7468a52016-03-09 14:32:57 +05302860 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302861};
2862
2863/**
2864 * struct flashing_req_params - led flashing parameter
2865 * @reqId: request id
2866 * @pattern_id: pattern identifier. 0: disconnected 1: connected
2867 * @led_x0: led flashing parameter0
2868 * @led_x1: led flashing parameter1
2869 */
2870struct flashing_req_params {
2871 uint32_t req_id;
2872 uint32_t pattern_id;
2873 uint32_t led_x0;
2874 uint32_t led_x1;
2875};
2876
Govind Singh89727882016-04-15 13:58:27 +05302877#define MAX_MEM_CHUNKS 32
2878/**
2879 * struct wmi_host_mem_chunk - host memory chunk structure
2880 * @vaddr: Pointer to virtual address
2881 * @paddr: Physical address
2882 * @memctx: qdf memory context for mapped address.
2883 * @len: length of chunk
2884 * @req_id: request id from target
2885 */
Govind Singhae855362016-03-07 14:24:22 +05302886struct wmi_host_mem_chunk {
2887 uint32_t *vaddr;
2888 uint32_t paddr;
Govind Singhd7468a52016-03-09 14:32:57 +05302889 qdf_dma_mem_context(memctx);
Govind Singhae855362016-03-07 14:24:22 +05302890 uint32_t len;
2891 uint32_t req_id;
2892};
2893
Govind Singh89727882016-04-15 13:58:27 +05302894/**
2895 * struct target_resource_config - Resource config given to target
2896 * This structure is union of wmi_resource_config defined
2897 * by both TLV and non-TLV target.
2898 */
Govind Singhae855362016-03-07 14:24:22 +05302899struct target_resource_config {
2900 uint32_t num_vdevs;
2901 uint32_t num_peers;
2902 uint32_t num_active_peers;
2903 uint32_t num_offload_peers;
2904 uint32_t num_offload_reorder_buffs;
2905 uint32_t num_peer_keys;
2906 uint32_t num_tids;
2907 uint32_t ast_skid_limit;
2908 uint32_t tx_chain_mask;
2909 uint32_t rx_chain_mask;
2910 uint32_t rx_timeout_pri[4];
2911 uint32_t rx_decap_mode;
2912 uint32_t scan_max_pending_req;
2913 uint32_t bmiss_offload_max_vdev;
2914 uint32_t roam_offload_max_vdev;
2915 uint32_t roam_offload_max_ap_profiles;
2916 uint32_t num_mcast_groups;
2917 uint32_t num_mcast_table_elems;
2918 uint32_t mcast2ucast_mode;
2919 uint32_t tx_dbg_log_size;
2920 uint32_t num_wds_entries;
2921 uint32_t dma_burst_size;
2922 uint32_t mac_aggr_delim;
2923 uint32_t rx_skip_defrag_timeout_dup_detection_check;
2924 uint32_t vow_config;
2925 uint32_t gtk_offload_max_vdev;
2926 uint32_t num_msdu_desc; /* Number of msdu desc */
2927 uint32_t max_frag_entries;
2928 /* End common */
2929
2930 /* Added in MCL */
2931 uint32_t num_tdls_vdevs;
2932 uint32_t num_tdls_conn_table_entries;
2933 uint32_t beacon_tx_offload_max_vdev;
2934 uint32_t num_multicast_filter_entries;
2935 uint32_t num_wow_filters;
2936 uint32_t num_keep_alive_pattern;
2937 uint32_t keep_alive_pattern_size;
2938 uint32_t max_tdls_concurrent_sleep_sta;
2939 uint32_t max_tdls_concurrent_buffer_sta;
2940 uint32_t wmi_send_separate;
2941 uint32_t num_ocb_vdevs;
2942 uint32_t num_ocb_channels;
2943 uint32_t num_ocb_schedules;
2944};
2945
2946/**
2947 * struct wmi_wifi_start_log - Structure to store the params sent to start/
2948 * stop logging
2949 * @name: Attribute which indicates the type of logging like per packet
2950 * statistics, connectivity etc.
2951 * @verbose_level: Verbose level which can be 0,1,2,3
2952 * @flag: Flag field for future use
2953 */
2954struct wmi_wifi_start_log {
2955 uint32_t ring_id;
2956 uint32_t verbose_level;
2957 uint32_t flag;
2958};
2959
2960/**
2961 * struct wmi_pcl_list - Format of PCL
2962 * @pcl_list: List of preferred channels
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05302963 * @weight_list: Weights of the PCL
Govind Singhae855362016-03-07 14:24:22 +05302964 * @pcl_len: Number of channels in the PCL
2965 */
2966struct wmi_pcl_list {
2967 uint8_t pcl_list[128];
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05302968 uint8_t weight_list[128];
Govind Singhae855362016-03-07 14:24:22 +05302969 uint32_t pcl_len;
2970};
2971
2972/**
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05302973 * struct wmi_pcl_chan_weights - Params to get the valid weighed list
2974 * @pcl_list: Preferred channel list already sorted in the order of preference
2975 * @pcl_len: Length of the PCL
2976 * @saved_chan_list: Valid channel list updated as part of
2977 * WMA_UPDATE_CHAN_LIST_REQ
2978 * @saved_num_chan: Length of the valid channel list
2979 * @weighed_valid_list: Weights of the valid channel list. This will have one
2980 * to one mapping with valid_chan_list. FW expects channel order and size to be
2981 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2982 * @weight_list: Weights assigned by policy manager
2983 */
2984struct wmi_pcl_chan_weights {
2985 uint8_t pcl_list[MAX_NUM_CHAN];
2986 uint32_t pcl_len;
2987 uint8_t saved_chan_list[MAX_NUM_CHAN];
2988 uint32_t saved_num_chan;
2989 uint8_t weighed_valid_list[MAX_NUM_CHAN];
2990 uint8_t weight_list[MAX_NUM_CHAN];
2991};
2992
2993/**
Govind Singhae855362016-03-07 14:24:22 +05302994 * struct wmi_hw_mode_params - HW mode params
2995 * @mac0_tx_ss: MAC0 Tx spatial stream
2996 * @mac0_rx_ss: MAC0 Rx spatial stream
2997 * @mac1_tx_ss: MAC1 Tx spatial stream
2998 * @mac1_rx_ss: MAC1 Rx spatial stream
2999 * @mac0_bw: MAC0 bandwidth
3000 * @mac1_bw: MAC1 bandwidth
3001 * @dbs_cap: DBS capabality
3002 * @agile_dfs_cap: Agile DFS capabality
3003 */
3004struct wmi_hw_mode_params {
3005 uint8_t mac0_tx_ss;
3006 uint8_t mac0_rx_ss;
3007 uint8_t mac1_tx_ss;
3008 uint8_t mac1_rx_ss;
3009 uint8_t mac0_bw;
3010 uint8_t mac1_bw;
3011 uint8_t dbs_cap;
3012 uint8_t agile_dfs_cap;
3013};
3014
3015/**
3016 * struct wmi_dual_mac_config - Dual MAC configuration
3017 * @scan_config: Scan configuration
3018 * @fw_mode_config: FW mode configuration
3019 * @set_dual_mac_cb: Callback function to be executed on response to the command
3020 */
3021struct wmi_dual_mac_config {
3022 uint32_t scan_config;
3023 uint32_t fw_mode_config;
3024 void *set_dual_mac_cb;
3025};
3026
3027#ifdef WLAN_NS_OFFLOAD
3028/**
3029 * struct ns_offload_req_params - ns offload request paramter
3030 * @srcIPv6Addr: src ipv6 address
3031 * @selfIPv6Addr: self ipv6 address
3032 * @targetIPv6Addr: target ipv6 address
3033 * @self_macaddr: self mac address
3034 * @srcIPv6AddrValid: src ipv6 address valid flag
3035 * @targetIPv6AddrValid: target ipv6 address valid flag
3036 * @slotIdx: slot index
3037 */
3038struct ns_offload_req_params {
3039 uint8_t srcIPv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3040 uint8_t selfIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
3041 uint8_t targetIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
Govind Singhd7468a52016-03-09 14:32:57 +05303042 struct qdf_mac_addr self_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05303043 uint8_t srcIPv6AddrValid;
3044 uint8_t targetIPv6AddrValid[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
3045 uint8_t slotIdx;
3046};
3047#endif /* WLAN_NS_OFFLOAD */
3048
3049/**
3050 * struct host_offload_req_param - arp offload parameter
3051 * @offloadType: offload type
3052 * @enableOrDisable: enable or disable
3053 * @num_ns_offload_count: offload count
3054 */
3055struct host_offload_req_param {
3056 uint8_t offloadType;
3057 uint8_t enableOrDisable;
3058 uint32_t num_ns_offload_count;
3059 union {
3060 uint8_t hostIpv4Addr[WMI_IPV4_ADDR_LEN];
3061 uint8_t hostIpv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3062 } params;
3063#ifdef WLAN_NS_OFFLOAD
3064 struct ns_offload_req_params nsOffloadInfo;
3065#endif /* WLAN_NS_OFFLOAD */
Govind Singhd7468a52016-03-09 14:32:57 +05303066 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05303067};
3068
3069/**
3070 * struct ssid_hotlist_param - param for SSID Hotlist
3071 * @ssid: SSID which is being hotlisted
3072 * @band: Band in which the given SSID should be scanned
3073 * @rssi_low: Low bound on RSSI
3074 * @rssi_high: High bound on RSSI
3075 */
3076struct ssid_hotlist_param {
3077 struct mac_ssid ssid;
3078 uint8_t band;
3079 int32_t rssi_low;
3080 int32_t rssi_high;
3081};
3082
3083/**
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05303084 * struct roam_scan_filter_params - Structure holding roaming scan
3085 * parameters
3086 * @len: length
3087 * @op_bitmap: bitmap to determine reason of roaming
3088 * @session_id: vdev id
3089 * @num_bssid_black_list: The number of BSSID's that we should
3090 * avoid connecting to. It is like a
3091 * blacklist of BSSID's.
3092 * @num_ssid_white_list: The number of SSID profiles that are
3093 * in the Whitelist. When roaming, we
3094 * consider the BSSID's with this SSID
3095 * also for roaming apart from the connected one's
3096 * @num_bssid_preferred_list: Number of BSSID's which have a preference over
3097 * others
3098 * @bssid_avoid_list: Blacklist SSID's
3099 * @ssid_allowed_list: Whitelist SSID's
3100 * @bssid_favored: Favorable BSSID's
3101 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
3102 *
3103 * This structure holds all the key parameters related to
3104 * initial connection and roaming connections.
3105 */
3106
3107struct roam_scan_filter_params {
3108 uint32_t len;
3109 uint32_t op_bitmap;
3110 uint8_t session_id;
3111 uint32_t num_bssid_black_list;
3112 uint32_t num_ssid_white_list;
3113 uint32_t num_bssid_preferred_list;
3114 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
3115 struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
3116 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
3117 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
3118};
3119
3120/**
Govind Singhae855362016-03-07 14:24:22 +05303121 * struct ssid_hotlist_request_params - set SSID hotlist request struct
3122 * @request_id: ID of the request
3123 * @session_id: ID of the session
3124 * @lost_ssid_sample_size: Number of consecutive scans in which the SSID
3125 * must not be seen in order to consider the SSID "lost"
3126 * @ssid_count: Number of valid entries in the @ssids array
3127 * @ssids: Array that defines the SSIDs that are in the hotlist
3128 */
3129struct ssid_hotlist_request_params {
3130 uint32_t request_id;
3131 uint8_t session_id;
3132 uint32_t lost_ssid_sample_size;
3133 uint32_t ssid_count;
3134 struct ssid_hotlist_param ssids[WMI_EXTSCAN_MAX_HOTLIST_SSIDS];
3135};
3136
3137/**
3138 * struct wmi_unit_test_cmd - unit test command parameters
3139 * @vdev_id: vdev id
3140 * @module_id: module id
3141 * @num_args: number of arguments
3142 * @args: arguments
3143 */
3144struct wmi_unit_test_cmd {
3145 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05303146 uint32_t module_id;
Govind Singhae855362016-03-07 14:24:22 +05303147 uint32_t num_args;
3148 uint32_t args[WMI_MAX_NUM_ARGS];
3149};
3150
3151/**
3152 * struct wmi_roam_invoke_cmd - roam invoke command
3153 * @vdev_id: vdev id
3154 * @bssid: mac address
3155 * @channel: channel
3156 */
3157struct wmi_roam_invoke_cmd {
3158 uint32_t vdev_id;
3159 uint8_t bssid[IEEE80211_ADDR_LEN];
3160 uint32_t channel;
3161};
3162
3163/**
3164 * struct ext_scan_setbssi_hotlist_params - set hotlist request
3165 * @requestId: request identifier
3166 * @sessionId: session identifier
3167 * @lost_ap_sample_size: number of samples to confirm AP loss
3168 * @numAp: Number of hotlist APs
3169 * @ap: hotlist APs
3170 */
3171struct ext_scan_setbssi_hotlist_params {
3172 uint32_t requestId;
3173 uint8_t sessionId;
3174
3175 uint32_t lost_ap_sample_size;
3176 uint32_t numAp;
3177 struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS];
3178};
Govind Singh89727882016-04-15 13:58:27 +05303179
3180/**
3181 * struct TARGET_HAL_REG_CAPABILITIES - This is replication of REG table
3182 * structure defined by target. This is added here to remove dependency
3183 * on FW headers so that host can be agnostic to different defintions in
3184 * both the targets.
3185 */
3186typedef struct {
3187 uint32_t eeprom_rd; /* regdomain value specified in EEPROM */
3188 uint32_t eeprom_rd_ext; /* regdomain */
3189 uint32_t regcap1; /* CAP1 capabilities bit map */
3190 uint32_t regcap2; /* REGDMN EEPROM CAP */
3191 uint32_t wireless_modes; /* REGDMN MODE */
3192 uint32_t low_2ghz_chan;
3193 uint32_t high_2ghz_chan;
3194 uint32_t low_5ghz_chan;
3195 uint32_t high_5ghz_chan;
3196} TARGET_HAL_REG_CAPABILITIES;
3197
3198/**
3199 * struct host_mem_req - Host memory request paramseters request by target
3200 * @req_id: Request id to identify the request.
3201 * @unit_size: Size of single unit requested.
3202 * @num_unit_info: Memory chunk info
3203 * @num_units: number of units requested.
3204 */
3205typedef struct {
3206 uint32_t req_id;
3207 uint32_t unit_size;
3208 uint32_t num_unit_info;
3209 uint32_t num_units;
3210} host_mem_req;
3211
3212#define WMI_HOST_DSCP_MAP_MAX (64)
3213
3214/**
3215 * struct wmi_host_ext_resource_config - Extended resource config
3216 * @host_platform_config: Host plaform configuration.
3217 * @fw_featuew_bitmap: FW feature requested bitmap.
3218 */
3219typedef struct {
3220 uint32_t host_platform_config;
3221
3222#define WMI_HOST_FW_FEATURE_LTEU_SUPPORT 0x0001
3223#define WMI_HOST_FW_FEATURE_COEX_GPIO_SUPPORT 0x0002
3224#define WMI_HOST_FW_FEATURE_AUX_RADIO_SPECTRAL_INTF 0x0004
3225#define WMI_HOST_FW_FEATURE_AUX_RADIO_CHAN_LOAD_INTF 0x0008
3226#define WMI_HOST_FW_FEATURE_BSS_CHANNEL_INFO_64 0x0010
3227#define WMI_HOST_FW_FEATURE_PEER_STATS 0x0020
3228#define WMI_HOST_FW_FEATURE_VDEV_STATS 0x0040
3229 /**
3230 * @brief fw_feature_bitmask - Enable/Disable features in FW
3231 * @details
3232 * The bits in fw_feature_bitmask are used as shown by the masks below:
3233 * 0x0001 - LTEU Config enable/disable
3234 * 0x0002 - COEX GPIO Config enable/disable
3235 * 0x0004 - Aux Radio enhancement for spectral scan enable/disable
3236 * 0x0008 - Aux Radio enhancement for chan load scan enable/disable
3237 * 0x0010 - BSS channel info stats enable/disable
3238 * The features in question are enabled by setting
3239 * the feature's bit to 1,
3240 * or disabled by setting the feature's bit to 0.
3241 */
3242 uint32_t fw_feature_bitmap;
3243
3244 /* add new members here */
3245} wmi_host_ext_resource_config;
3246
3247/**
3248 * struct set_neighbour_rx_params - Neighbour RX params
3249 * @vdev_id: vdev id
3250 * @idx: index of param
3251 * @action: action
3252 * @type: Type of param
3253 */
3254struct set_neighbour_rx_params {
3255 uint8_t vdev_id;
3256 uint32_t idx;
3257 uint32_t action;
3258 uint32_t type;
3259};
3260
3261/**
3262 * struct set_fwtest_params - FW test params
3263 * @arg: FW param id
3264 * @value: value
3265 */
3266struct set_fwtest_params {
3267 uint32_t arg;
3268 uint32_t value;
3269};
3270
3271/**
3272 * struct config_ratemask_params - ratemask config parameters
3273 * @vdev_id: vdev id
3274 * @type: Type
3275 * @lower32: Lower 32 bits
3276 * @higher32: Hogher 32 bits
3277 */
3278struct config_ratemask_params {
3279 uint8_t vdev_id;
3280 uint8_t type;
3281 uint32_t lower32;
3282 uint32_t higher32;
3283};
3284
3285/**
3286 * struct peer_add_wds_entry_params - WDS peer entry add params
3287 * @dest_addr: Pointer to destination macaddr
3288 * @peer_addr: Pointer to peer mac addr
3289 * @flags: flags
3290 */
3291struct peer_add_wds_entry_params {
3292 const uint8_t *dest_addr;
3293 uint8_t *peer_addr;
3294 uint32_t flags;
3295};
3296
3297/**
3298 * struct peer_del_wds_entry_params - WDS peer entry del params
3299 * @dest_addr: Pointer to destination macaddr
3300 */
3301struct peer_del_wds_entry_params {
3302 uint8_t *dest_addr;
3303};
3304
3305/**
3306 * struct peer_updatewds_entry_params - WDS peer entry update params
3307 * @wds_macaddr: Pointer to destination macaddr
3308 * @peer_add: Pointer to peer mac addr
3309 * @flags: flags
3310 */
3311struct peer_update_wds_entry_params {
3312 uint8_t *wds_macaddr;
3313 uint8_t *peer_macaddr;
3314 uint32_t flags;
3315};
3316
3317/**
3318 * struct set_ps_mode_params - PS mode params
3319 * @vdev_id: vdev id
3320 * @psmode: PS mode
3321 */
3322struct set_ps_mode_params {
3323 uint8_t vdev_id;
3324 uint8_t psmode;
3325};
3326
3327/**
3328 * @struct tt_level_config - Set Thermal throttlling config
3329 * @tmplwm: Temperature low water mark
3330 * @tmphwm: Temperature high water mark
3331 * @dcoffpercent: dc off percentage
3332 * @priority: priority
3333 */
3334typedef struct {
3335 uint32_t tmplwm;
3336 uint32_t tmphwm;
3337 uint32_t dcoffpercent;
3338 uint32_t priority;
3339} tt_level_config;
3340
3341/**
3342 * struct thermal_mitigation_params - Thermal mitigation params
3343 * @enable: Enable/Disable Thermal mitigation
3344 * @dc: DC
3345 * @dc_per_event: DC per event
3346 * @tt_level_config: TT level config params
3347 */
3348struct thermal_mitigation_params {
3349 uint32_t enable;
3350 uint32_t dc;
3351 uint32_t dc_per_event;
3352 tt_level_config levelconf[THERMAL_LEVELS];
3353};
3354
3355/**
3356 * struct smart_ant_enable_params - Smart antenna params
3357 * @enable: Enable/Disable
3358 * @mode: SA mode
3359 * @rx_antenna: RX antenna config
Govind Singh41da3152016-05-06 20:20:25 +05303360 * @gpio_pin : GPIO pin config
3361 * @gpio_func : GPIO function config
Govind Singh89727882016-04-15 13:58:27 +05303362 */
3363struct smart_ant_enable_params {
3364 uint32_t enable;
3365 uint32_t mode;
3366 uint32_t rx_antenna;
Govind Singh41da3152016-05-06 20:20:25 +05303367 uint32_t gpio_pin[WMI_HAL_MAX_SANTENNA];
3368 uint32_t gpio_func[WMI_HAL_MAX_SANTENNA];
Govind Singh89727882016-04-15 13:58:27 +05303369};
3370
3371/**
3372 * struct smart_ant_rx_ant_params - RX antenna params
3373 * @antenna: RX antenna
3374 */
3375struct smart_ant_rx_ant_params {
3376 uint32_t antenna;
3377};
3378
3379/**
3380 * struct smart_ant_tx_ant_params - TX antenna param
3381 * @antenna_array: Antenna arry
3382 * @vdev_id: VDEV id
3383 */
3384struct smart_ant_tx_ant_params {
3385 uint32_t *antenna_array;
3386 uint8_t vdev_id;
3387};
3388
3389/**
3390 * struct smart_ant_training_info_params - SA training params
3391 * @vdev_id: VDEV id
3392 * @rate_array: Rates array
3393 * @antenna_array: Antenna array
3394 * @numpkts: num packets for training
3395 */
3396struct smart_ant_training_info_params {
3397 uint8_t vdev_id;
3398 uint32_t *rate_array;
3399 uint32_t *antenna_array;
3400 uint32_t numpkts;
3401};
3402
3403/**
3404 * struct smart_ant_node_config_params - SA node config params
3405 * @vdev_id: VDEV id
3406 * @cmd_id: Command id
3407 * @args_count: Arguments count
3408 */
3409struct smart_ant_node_config_params {
3410 uint8_t vdev_id;
3411 uint32_t cmd_id;
3412 uint16_t args_count;
3413 uint32_t *args_arr;
3414};
3415/**
3416 * struct smart_ant_enable_tx_feedback_params - SA tx feeback params
3417 * @enable: Enable TX feedback for SA
3418 */
3419struct smart_ant_enable_tx_feedback_params {
3420 int enable;
3421};
3422
3423/**
3424 * struct vdev_spectral_configure_params - SPectral config params
3425 * @vdev_id: VDEV id
3426 * @count: count
3427 * @period: period
3428 * @spectral_pri: Spectral priority
3429 * @fft_size: FFT size
3430 * @gc_enable: GC enable
3431 * @restart_enable: restart enabled
3432 * @noise_floor_ref: Noise floor reference
3433 * @init_delay: Init delays
3434 * @nb_tone_thr: NB tone threshold
3435 * @str_bin_thr: STR BIN threshold
3436 * @wb_rpt_mode: WB BIN threshold
3437 * @rssi_rpt_mode: RSSI report mode
3438 * @rssi_thr: RSSI threshold
3439 * @pwr_format: Power format
3440 * @rpt_mode: Report mdoe
3441 * @bin_scale: BIN scale
3442 * @dBm_adj: DBM adjust
3443 * @chn_mask: chain mask
3444 */
3445struct vdev_spectral_configure_params {
3446 uint8_t vdev_id;
3447 uint16_t count;
3448 uint16_t period;
3449 uint16_t spectral_pri;
3450 uint16_t fft_size;
3451 uint16_t gc_enable;
3452 uint16_t restart_enable;
3453 uint16_t noise_floor_ref;
3454 uint16_t init_delay;
3455 uint16_t nb_tone_thr;
3456 uint16_t str_bin_thr;
3457 uint16_t wb_rpt_mode;
3458 uint16_t rssi_rpt_mode;
3459 uint16_t rssi_thr;
3460 uint16_t pwr_format;
3461 uint16_t rpt_mode;
3462 uint16_t bin_scale;
3463 uint16_t dBm_adj;
3464 uint16_t chn_mask;
3465};
3466
3467/**
3468 * struct vdev_spectral_enable_params - Spectral enabled params
3469 * @vdev_id: VDEV id
3470 * @active_valid: Active valid
3471 * @active: active
3472 * @enabled_valid: Enabled valid
3473 * @enabled: enabled
3474 */
3475struct vdev_spectral_enable_params {
3476 uint8_t vdev_id;
3477 uint8_t active_valid;
3478 uint8_t active;
3479 uint8_t enabled_valid;
3480 uint8_t enabled;
3481};
3482
3483/**
3484 * struct pdev_set_regdomain_params - PDEV set reg domain params
3485 * @currentRDinuse: Current Reg domain
3486 * @currentRD2G: Current Reg domain 2G
3487 * @currentRD5G: Current Reg domain 5G
3488 * @ctl_2G: CTL 2G
3489 * @ctl_5G: CTL 5G
3490 * @dfsDomain: DFS domain
3491 */
3492struct pdev_set_regdomain_params {
3493 uint16_t currentRDinuse;
3494 uint16_t currentRD2G;
3495 uint16_t currentRD5G;
3496 uint32_t ctl_2G;
3497 uint32_t ctl_5G;
3498 uint8_t dfsDomain;
3499};
3500
3501/**
3502 * struct set_quiet_mode_params - Set quiet mode params
3503 * @enabled: Enabled
3504 * @period: Quite period
3505 * @intval: Quite interval
3506 * @duration: Quite duration
3507 * @offset: offset
3508 */
3509struct set_quiet_mode_params {
3510 uint8_t enabled;
3511 uint8_t period;
3512 uint16_t intval;
3513 uint16_t duration;
3514 uint16_t offset;
3515};
3516
3517/**
3518 * struct set_beacon_filter_params - Set beacon filter params
3519 * @vdev_id: VDEV id
3520 * @ie: Pointer to IE fields
3521 */
3522struct set_beacon_filter_params {
3523 uint8_t vdev_id;
3524 uint32_t *ie;
3525};
3526
3527/**
3528 * struct remove_beacon_filter_params - Remove beacon filter params
3529 * @vdev_id: VDEV id
3530 */
3531struct remove_beacon_filter_params {
3532 uint8_t vdev_id;
3533};
3534
3535/**
3536 * struct mgmt_params - Mgmt params
3537 * @vdev_id: vdev id
3538 * @buf_len: lenght of frame buffer
3539 * @wbuf: frame buffer
3540 */
3541struct mgmt_params {
3542 int vdev_id;
3543 uint32_t buf_len;
3544 qdf_nbuf_t wbuf;
3545};
3546
3547/**
3548 * struct addba_clearresponse_params - Addba clear response params
3549 * @vdev_id: VDEV id
3550 */
3551struct addba_clearresponse_params {
3552 uint8_t vdev_id;
3553};
3554
3555/**
3556 * struct addba_send_params - ADDBA send params
3557 * @vdev_id: vdev id
3558 * @tidno: TID
3559 * @buffersize: buffer size
3560 */
3561struct addba_send_params {
3562 uint8_t vdev_id;
3563 uint8_t tidno;
3564 uint16_t buffersize;
3565};
3566
3567/**
3568 * struct delba_send_params - DELBA send params
3569 * @vdev_id: vdev id
3570 * @tidno: TID
3571 * @initiator: initiator
3572 * @reasoncode: reason code
3573 */
3574struct delba_send_params {
3575 uint8_t vdev_id;
3576 uint8_t tidno;
3577 uint8_t initiator;
3578 uint16_t reasoncode;
3579};
3580/**
3581 * struct addba_setresponse_arams - Set ADDBA response params
3582 * @vdev_id: vdev id
3583 * @tidno: TID
3584 * @statuscode: status code in response
3585 */
3586struct addba_setresponse_params {
3587 uint8_t vdev_id;
3588 uint8_t tidno;
3589 uint16_t statuscode;
3590};
3591
3592/**
3593 * struct singleamsdu_params - Single AMSDU params
3594 * @vdev_id: vdev is
3595 * @tidno: TID
3596 */
3597struct singleamsdu_params {
3598 uint8_t vdev_id;
3599 uint8_t tidno;
3600};
3601
3602/**
3603 * struct set_qbosst_params - Set QBOOST params
3604 * @vdev_id: vdev id
3605 * @value: value
3606 */
3607struct set_qboost_params {
3608 uint8_t vdev_id;
3609 uint32_t value;
3610};
3611
3612/**
3613 * struct mu_scan_params - MU scan params
3614 * @id: id
3615 * @type: type
3616 * @duration: Duration
3617 * @lteu_tx_power: LTEU tx power
3618 */
3619struct mu_scan_params {
3620 uint8_t id;
3621 uint8_t type;
3622 uint32_t duration;
3623 uint32_t lteu_tx_power;
3624};
3625
3626/**
3627 * struct lteu_config_params - LTEU config params
3628 * @lteu_gpio_start: start MU/AP scan after GPIO toggle
3629 * @lteu_num_bins: no. of elements in the following arrays
3630 * @use_actual_nf: whether to use the actual NF obtained or a hardcoded one
3631 * @lteu_weight: weights for MU algo
3632 * @lteu_thresh: thresholds for MU algo
3633 * @lteu_gamma: gamma's for MU algo
3634 * @lteu_scan_timeout: timeout in ms to gpio toggle
3635 * @alpha_num_ssid: alpha for num active bssid calculation
3636 * @wifi_tx_power: Wifi Tx power
3637 */
3638struct lteu_config_params {
3639 uint8_t lteu_gpio_start;
3640 uint8_t lteu_num_bins;
3641 uint8_t use_actual_nf;
3642 uint32_t lteu_weight[LTEU_MAX_BINS];
3643 uint32_t lteu_thresh[LTEU_MAX_BINS];
3644 uint32_t lteu_gamma[LTEU_MAX_BINS];
3645 uint32_t lteu_scan_timeout;
3646 uint32_t alpha_num_bssid;
3647 uint32_t wifi_tx_power;
3648};
3649
3650struct wmi_macaddr_t {
3651 /** upper 4 bytes of MAC address */
3652 uint32_t mac_addr31to0;
3653 /** lower 2 bytes of MAC address */
3654 uint32_t mac_addr47to32;
3655};
3656
3657/**
3658 * struct atf_peer_info - ATF peer info params
3659 * @peer_macaddr: peer mac addr
3660 * @percentage_peer: percentage of air time for this peer
3661 */
3662typedef struct {
3663 struct wmi_macaddr_t peer_macaddr;
3664 uint32_t percentage_peer;
3665} atf_peer_info;
3666
3667/**
3668 * struct set_atf_params - ATF params
3669 * @num_peers: number of peers
3670 * @atf_peer_info: ATF peer info
3671 */
3672struct set_atf_params {
3673 uint32_t num_peers;
3674 atf_peer_info peer_info[ATF_ACTIVED_MAX_CLIENTS];
3675};
3676
3677/**
3678 * struct atf_peer_ext_info - ATF peer ext info params
3679 * @peer_macaddr: peer mac address
3680 * @group_index: group index
3681 * @atf_index_reserved: ATF index rsvd
3682 */
3683typedef struct {
3684 struct wmi_macaddr_t peer_macaddr;
3685 uint32_t group_index;
3686 uint32_t atf_index_reserved;
3687} atf_peer_ext_info;
3688
3689/**
3690 * struct atf_peer_request_params - ATF peer req params
3691 * @num_peers: number of peers
3692 * @atf_peer_ext_info: ATF peer ext info
3693 */
3694struct atf_peer_request_params {
3695 uint32_t num_peers;
3696 atf_peer_ext_info peer_ext_info[ATF_ACTIVED_MAX_CLIENTS];
3697};
3698
3699/**
3700 * struct atf_group_info - ATF group info params
3701 * @percentage_group: Percentage AT for group
3702 * @atf_group_units_reserved: ATF group information
3703 */
3704typedef struct {
3705 uint32_t percentage_group;
3706 uint32_t atf_group_units_reserved;
3707} atf_group_info;
3708
3709/**
3710 * struct atf_grouping_params - ATF grouping params
3711 * @num_groups: number of groups
3712 * @group_inf: Group informaition
3713 */
3714struct atf_grouping_params {
3715 uint32_t num_groups;
3716 atf_group_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
3717};
3718
3719/**
3720 * struct wlan_profile_params - WLAN profile params
3721 * @param_id: param id
3722 * @profile_id: profile id
3723 * @enable: enable
3724 */
3725struct wlan_profile_params {
3726 uint32_t param_id;
3727 uint32_t profile_id;
3728 uint32_t enable;
3729};
3730
3731/* struct ht_ie_params - HT IE params
3732 * @ie_len: IE length
3733 * @ie_data: pointer to IE data
3734 */
3735struct ht_ie_params {
3736 uint32_t ie_len;
3737 uint8_t *ie_data;
3738};
3739
3740/* struct vht_ie_params - VHT IE params
3741 * @ie_len: IE length
3742 * @ie_data: pointer to IE data
3743 */
3744struct vht_ie_params {
3745 uint32_t ie_len;
3746 uint8_t *ie_data;
3747};
3748
3749/**
3750 * struct wmi_host_wmeParams - WME params
3751 * @wmep_acm: ACM paramete
3752 * @wmep_aifsn: AIFSN parameters
3753 * @wmep_logcwmin: cwmin in exponential form
3754 * @wmep_logcwmax: cwmax in exponential form
3755 * @wmep_txopLimit: txopLimit
3756 * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
3757 */
3758struct wmi_host_wmeParams {
3759 u_int8_t wmep_acm;
3760 u_int8_t wmep_aifsn;
3761 u_int8_t wmep_logcwmin;
3762 u_int8_t wmep_logcwmax;
3763 u_int16_t wmep_txopLimit;
3764 u_int8_t wmep_noackPolicy;
3765};
3766
3767/**
3768 * struct wmm_update_params - WMM update params
3769 * @wmep_array: WME params for each AC
3770 */
3771struct wmm_update_params {
3772 struct wmi_host_wmeParams *wmep_array;
3773};
3774
3775/**
3776 * struct ant_switch_tbl_params - Antenna switch table params
3777 * @ant_ctrl_common1: ANtenna control common param 1
3778 * @ant_ctrl_common2: Antenna control commn param 2
3779 */
3780struct ant_switch_tbl_params {
3781 uint32_t ant_ctrl_common1;
3782 uint32_t ant_ctrl_common2;
3783};
3784
3785/**
3786 * struct ratepwr_table_params - Rate power table params
3787 * @ratepwr_tbl: pointer to rate power table
3788 * @ratepwr_len: rate power table len
3789 */
3790struct ratepwr_table_params {
3791 uint8_t *ratepwr_tbl;
3792 uint16_t ratepwr_len;
3793};
3794
3795/**
3796 * struct ctl_table_params - Ctl table params
3797 * @ctl_array: pointer to ctl array
3798 * @ctl_len: ctl length
3799 * @is_acfg_ctl: is acfg_ctl table
3800 */
3801struct ctl_table_params {
3802 uint8_t *ctl_array;
3803 uint16_t ctl_len;
3804 bool is_acfg_ctl;
3805};
3806
3807/**
3808 * struct mimogain_table_params - MIMO gain table params
3809 * @array_gain: pointer to array gain table
3810 * @tbl_len: table length
3811 * @multichain_gain_bypass: bypass multichain gain
3812 */
3813struct mimogain_table_params {
3814 uint8_t *array_gain;
3815 uint16_t tbl_len;
3816 bool multichain_gain_bypass;
3817};
3818
3819/**
3820 * struct ratepwr_chainmask_params - Rate power chainmask params
3821 * @ratepwr_chain_tbl: pointer to ratepwr chain table
3822 * @num_rate: number of rate in table
3823 * @pream_type: preamble type
3824 * @ops: ops
3825 */
3826struct ratepwr_chainmsk_params {
3827 uint32_t *ratepwr_chain_tbl;
3828 uint16_t num_rate;
3829 uint8_t pream_type;
3830 uint8_t ops;
3831};
3832
3833struct macaddr_params {
3834 uint8_t *macaddr;
3835};
3836
3837/**
3838 * struct acparams_params - acparams config structure
3839 * @ac: AC to configure
3840 * @use_rts: Use rts for this AC
3841 * @aggrsize_scaling: Aggregrate size scaling for the AC
3842 * @min_kbps: min kbps req
3843 */
3844struct acparams_params {
3845 uint8_t ac;
3846 uint8_t use_rts;
3847 uint8_t aggrsize_scaling;
3848 uint32_t min_kbps;
3849};
3850
3851/**
3852 * struct vap_dscp_tid_map_params - DSCP tid map params
3853 * @vdev_id: vdev id
3854 * @dscp_to_tid_map: pointer to arry of tid to dscp map table
3855 */
3856struct vap_dscp_tid_map_params {
3857 uint8_t vdev_id;
3858 uint32_t *dscp_to_tid_map;
3859};
3860
3861/**
3862 * struct proxy_ast_reserve_params - Proxy AST reserve params
3863 * @macaddr: macaddr for proxy ast entry
3864 */
3865struct proxy_ast_reserve_params {
3866 uint8_t *macaddr;
3867};
3868
3869/**
3870 * struct fips_params - FIPS params config
3871 * @key: pointer to key
3872 * @key_len: length of key
3873 * @data: pointer data buf
3874 * @data_len: lenght of sata buf
3875 * @mode: mode
3876 * @op: operation
3877 */
3878struct fips_params {
3879 uint8_t *key;
3880 uint32_t key_len;
3881 uint8_t *data;
3882 uint32_t data_len;
3883 uint32_t mode;
3884 uint32_t op;
3885};
3886
3887/**
3888 * struct mcast_group_update_param - Mcast group table update to target
3889 * @action: Addition/deletion
3890 * @wildcard: iwldcard table entry?
3891 * @mcast_ip_addr: mcast ip address to be updated
3892 * @mcast_ip_addr_bytes: mcast ip addr bytes
3893 * @ucast_mac_addr: ucast peer mac subscribed to mcast ip
3894 * @filter_mode: filter mode
3895 * @nsrcs: number of entries in source list
3896 * @srcs: source mac accpted
3897 * @mask: mask
3898 * @vap_id: vdev id
3899 * @is_action_delete: is delete
3900 * @is_filter_mode_snoop:
3901 * @is_mcast_addr_len:
3902 */
3903struct mcast_group_update_params {
3904 int action;
3905 int wildcard;
3906 uint8_t *mcast_ip_addr;
3907 int mcast_ip_addr_bytes;
3908 uint8_t *ucast_mac_addr;
3909 uint8_t filter_mode;
3910 uint8_t nsrcs;
3911 uint8_t *srcs;
3912 uint8_t *mask;
3913 uint8_t vap_id;
3914 bool is_action_delete;
3915 bool is_filter_mode_snoop;
3916 bool is_mcast_addr_len;
3917};
3918
3919/**
3920 * struct periodic_chan_stats_param - periodic channel stats req param
3921 * @stats_period: stats period update
3922 * @enable: enable/disable
3923 */
3924struct periodic_chan_stats_params {
3925 uint32_t stats_period;
3926 bool enable;
3927};
3928
3929/**
3930 * struct packet_power_info_params - packet power info params
3931 * @rate_flags: rate flags
3932 * @nss: number of spatial streams
3933 * @preamble: preamble
3934 * @hw_rate:
3935 */
3936struct packet_power_info_params {
3937 uint16_t rate_flags;
3938 uint16_t nss;
3939 uint16_t preamble;
3940 uint16_t hw_rate;
3941};
3942
3943/**
3944 * WMI_GPIO_CONFIG_CMDID
3945 */
3946enum {
3947 WMI_HOST_GPIO_PULL_NONE,
3948 WMI_HOST_GPIO_PULL_UP,
3949 WMI_HOST_GPIO_PULL_DOWN,
3950};
3951
3952/**
3953 * WMI_GPIO_INTTYPE
3954 */
3955enum {
3956 WMI_HOST_GPIO_INTTYPE_DISABLE,
3957 WMI_HOST_GPIO_INTTYPE_RISING_EDGE,
3958 WMI_HOST_GPIO_INTTYPE_FALLING_EDGE,
3959 WMI_HOST_GPIO_INTTYPE_BOTH_EDGE,
3960 WMI_HOST_GPIO_INTTYPE_LEVEL_LOW,
3961 WMI_HOST_GPIO_INTTYPE_LEVEL_HIGH
3962};
3963
3964/**
3965 * struct wmi_host_gpio_input_event - GPIO input event structure
3966 * @gpio_num: GPIO number which changed state
3967 */
3968typedef struct {
3969 uint32_t gpio_num; /* GPIO number which changed state */
3970} wmi_host_gpio_input_event;
3971
3972/**
3973 * struct gpio_config_params - GPIO config params
3974 * @gpio_num: GPIO number to config
3975 * @input: input/output
3976 * @pull_type: pull type
3977 * @intr_mode: int mode
3978 */
3979struct gpio_config_params {
3980 uint32_t gpio_num;
3981 uint32_t input;
3982 uint32_t pull_type;
3983 uint32_t intr_mode;
3984};
3985
3986/**
3987 * struct gpio_output_params - GPIO output params
3988 * @gpio_num: GPIO number to configure
3989 * @set: set/reset
3990 */
3991struct gpio_output_params {
3992 uint32_t gpio_num;
3993 uint32_t set;
3994};
3995
3996#define WMI_HOST_RTT_REPORT_CFR 0
3997#define WMI_HOST_RTT_NO_REPORT_CFR 1
3998#define WMI_HOST_RTT_AGGREGATE_REPORT_NON_CFR 2
3999/**
4000 * struct rtt_meas_req_test_params
4001 * @peer: peer mac address
4002 * @req_frame_type: RTT request frame type
4003 * @req_bw: requested bandwidth
4004 * @req_preamble: Preamble
4005 * @req_num_req: num of requests
4006 * @req_report_type: report type
4007 * @num_measurements: number of measurements
4008 * @asap_mode: priority
4009 * @lci_requested: LCI requested
4010 * @loc_civ_requested:
4011 * @channel_param: channel param
4012 * @req_id: requested id
4013 */
4014struct rtt_meas_req_test_params {
4015 uint8_t peer[IEEE80211_ADDR_LEN];
4016 int req_frame_type;
4017 int req_bw;
4018 int req_preamble;
4019 int req_num_req;
4020 int req_report_type;
4021 uint32_t num_measurements;
4022 uint32_t asap_mode;
4023 uint32_t lci_requested;
4024 uint32_t loc_civ_requested;
4025 struct channel_param channel;
4026 uint8_t req_id;
4027};
4028
4029/**
4030 * struct rtt_meas_req_params - RTT measurement request params
4031 * @req_id: Request id
4032 * @vdev_id: vdev id
4033 * @sta_mac_addr: pointer to station mac address
4034 * @spoof_mac_addr: pointer to spoof mac address
4035 * @is_mode_na: 11NA
4036 * @is_mode_ac: AC
4037 * @is_bw_20: 20
4038 * @is_bw_40: 40
4039 * @is_bw_80: 80
4040 * @num_probe_rqst: number of probe request
4041 * @channel_param: channel param
4042 */
4043struct rtt_meas_req_params {
4044 uint8_t req_id;
4045 uint8_t vdev_id;
4046 uint8_t *sta_mac_addr;
4047 uint8_t *spoof_mac_addr;
4048 bool is_mode_na;
4049 bool is_mode_ac;
4050 bool is_bw_20;
4051 bool is_bw_40;
4052 bool is_bw_80;
4053 uint32_t num_probe_rqst;
4054 struct channel_param channel;
4055};
4056
4057/**
4058 * struct lci_set_params - LCI params
4059 * @lci_data: pointer to LCI data
4060 * @latitude_unc: latitude
4061 * @latitude_0_12: bits 0 to 1 of latitude
4062 * @latitude_2_33: bits 2 to 33 of latitude
4063 * @longitude_unc: longitude
4064 * @longitude_0_1: bits 0 to 1 of longitude
4065 * @longitude_2_33: bits 2 to 33 of longitude
4066 * @altitude_type: altitude type
4067 * @altitude_unc_0_3: altitude bits 0 - 3
4068 * @altitude_unc_4_5: altitude bits 4 - 5
4069 * @altitude: altitude
4070 * @datum: dataum
4071 * @reg_loc_agmt:
4072 * @reg_loc_dse:
4073 * @dep_sta:
4074 * @version: version
4075 */
4076struct lci_set_params {
4077 void *lci_data;
4078 uint8_t latitude_unc:6,
4079 latitude_0_1:2;
4080 uint32_t latitude_2_33;
4081 uint8_t longitude_unc:6,
4082 longitude_0_1:2;
4083 uint32_t longitude_2_33;
4084 uint8_t altitude_type:4,
4085 altitude_unc_0_3:4;
4086 uint32_t altitude_unc_4_5:2,
4087 altitude:30;
4088 uint8_t datum:3,
4089 reg_loc_agmt:1,
4090 reg_loc_dse:1,
4091 dep_sta:1,
4092 version:2;
4093};
4094
4095/**
4096 * struct lcr_set_params - LCR params
4097 * @lcr_data: pointer to lcr data
4098 */
4099struct lcr_set_params {
4100 void *lcr_data;
4101};
4102
4103/**
4104 * struct rtt_keepalive_req_params - RTT keepalive params
4105 * @macaddr: pointer to macaddress
4106 * @req_id: Request id
4107 * @vdev_id: vdev id
4108 * @stop: start/stop
4109 */
4110struct rtt_keepalive_req_params {
4111 uint8_t *macaddr;
4112 uint8_t req_id;
4113 uint8_t vdev_id;
4114 bool stop;
4115};
4116
4117/**
4118 * struct wmi_host_stats_event - Stats event params
4119 * @stats_id: stats id of type wmi_host_stats_event
4120 * @num_pdev_stats: number of pdev stats event structures 0 or 1
4121 * @num_pdev_ext_stats: number of pdev ext stats event structures
4122 * @num_vdev_stats: number of vdev stats
4123 * @num_peer_stats: number of peer stats event structures 0 or max peers
4124 * @num_bcnflt_stats: number of beacon filter stats
4125 * @num_chan_stats: number of channel stats
4126 */
4127typedef struct {
4128 wmi_host_stats_id stats_id;
4129 uint32_t num_pdev_stats;
4130 uint32_t num_pdev_ext_stats;
4131 uint32_t num_vdev_stats;
4132 uint32_t num_peer_stats;
4133 uint32_t num_bcnflt_stats;
4134 uint32_t num_chan_stats;
4135} wmi_host_stats_event;
4136
4137/**
4138 * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
4139 * @mac_addr31to0: upper 4 bytes of MAC address
4140 * @mac_addr47to32: lower 2 bytes of MAC address
4141 */
4142typedef struct {
4143 uint32_t mac_addr31to0;
4144 uint32_t mac_addr47to32;
4145} wmi_host_mac_addr;
4146
4147/**
4148 * struct wmi_host_peer_extd_stats - peer extd stats event structure
4149 * @peer_macaddr: Peer mac address
4150 * @inactive_time: inactive time in secs
4151 * @peer_chain_rssi: peer rssi
4152 * @rx_duration: RX duration
4153 * @peer_tx_bytes: TX bytes
4154 * @peer_rx_bytes: RX bytes
4155 * @last_tx_rate_code: Tx rate code of last frame
4156 * @last_tx_power: Tx power latest
4157 * @atf_tokens_allocated: atf tokens allocated
4158 * @atf_tokens_utilized: atf tokens utilized
4159 * @reserved: for future use
4160 */
4161typedef struct {
4162 wmi_host_mac_addr peer_macaddr;
4163 uint32_t inactive_time;
4164 uint32_t peer_chain_rssi;
4165 uint32_t rx_duration;
4166 uint32_t peer_tx_bytes;
4167 uint32_t peer_rx_bytes;
4168 uint32_t last_tx_rate_code;
4169 uint32_t last_tx_power;
4170 uint32_t atf_tokens_allocated;
4171 uint32_t atf_tokens_utilized;
4172 uint32_t reserved[4];
4173} wmi_host_peer_extd_stats;
4174
4175/**
4176 * struct wmi_host_pdev_ext_stats - peer ext stats structure
4177 * @rx_rssi_comb: RX rssi
4178 * @rx_rssi_chain0: RX rssi chain 0
4179 * @rx_rssi_chain1: RX rssi chain 1
4180 * @rx_rssi_chain2: RX rssi chain 2
4181 * @rx_rssi_chain3: RX rssi chain 3
4182 * @rx_mcs: RX MCS array
4183 * @tx_mcs: TX MCS array
4184 * @ack_rssi: Ack rssi
4185 */
4186typedef struct {
4187 uint32_t rx_rssi_comb;
4188 uint32_t rx_rssi_chain0;
4189 uint32_t rx_rssi_chain1;
4190 uint32_t rx_rssi_chain2;
4191 uint32_t rx_rssi_chain3;
4192 uint32_t rx_mcs[10];
4193 uint32_t tx_mcs[10];
4194 uint32_t ack_rssi;
4195} wmi_host_pdev_ext_stats;
4196
4197/**
4198 * struct wmi_host_dbg_tx_stats - Debug stats
4199 * @comp_queued: Num HTT cookies queued to dispatch list
4200 * @comp_delivered: Num HTT cookies dispatched
4201 * @msdu_enqued: Num MSDU queued to WAL
4202 * @mpdu_enqued: Num MPDU queue to WAL
4203 * @wmm_drop: Num MSDUs dropped by WMM limit
4204 * @local_enqued: Num Local frames queued
4205 * @local_freed: Num Local frames done
4206 * @hw_queued: Num queued to HW
4207 * @hw_reaped: Num PPDU reaped from HW
4208 * @underrun: Num underruns
4209 * @hw_paused: HW Paused.
4210 * @tx_abort: Num PPDUs cleaned up in TX abort
4211 * @mpdus_requed: Num MPDUs requed by SW
4212 * @tx_ko: excessive retries
4213 * @tx_xretry:
4214 * @data_rc: data hw rate code
4215 * @self_triggers: Scheduler self triggers
4216 * @sw_retry_failure: frames dropped due to excessive sw retries
4217 * @illgl_rate_phy_err: illegal rate phy errors
4218 * @pdev_cont_xretry: wal pdev continous xretry
4219 * @pdev_tx_timeout: wal pdev continous xretry
4220 * @pdev_resets: wal pdev resets
4221 * @stateless_tid_alloc_failure: frames dropped due to non-availability of
4222 * stateless TIDs
4223 * @phy_underrun: PhY/BB underrun
4224 * @txop_ovf: MPDU is more than txop limit
4225 * @seq_posted: Number of Sequences posted
4226 * @seq_failed_queueing: Number of Sequences failed queueing
4227 * @seq_completed: Number of Sequences completed
4228 * @seq_restarted: Number of Sequences restarted
4229 * @mu_seq_posted: Number of MU Sequences posted
4230 * @mpdus_sw_flush: Num MPDUs flushed by SW, HWPAUSED, SW TXABORT
4231 * (Reset,channel change)
4232 * @mpdus_hw_filter: Num MPDUs filtered by HW, all filter condition
4233 * (TTL expired)
4234 * @mpdus_truncated: Num MPDUs truncated by PDG (TXOP, TBTT,
4235 * PPDU_duration based on rate, dyn_bw)
4236 * @mpdus_ack_failed: Num MPDUs that was tried but didn't receive ACK or BA
4237 * @mpdus_expired: Num MPDUs that was dropped du to expiry.
4238 * @mc_dropr: Num mc drops
4239 */
4240typedef struct {
4241 int32_t comp_queued;
4242 int32_t comp_delivered;
4243 int32_t msdu_enqued;
4244 int32_t mpdu_enqued;
4245 int32_t wmm_drop;
4246 int32_t local_enqued;
4247 int32_t local_freed;
4248 int32_t hw_queued;
4249 int32_t hw_reaped;
4250 int32_t underrun;
4251 uint32_t hw_paused;
4252 int32_t tx_abort;
4253 int32_t mpdus_requed;
4254 uint32_t tx_ko;
4255 uint32_t tx_xretry;
4256 uint32_t data_rc;
4257 uint32_t self_triggers;
4258 uint32_t sw_retry_failure;
4259 uint32_t illgl_rate_phy_err;
4260 uint32_t pdev_cont_xretry;
4261 uint32_t pdev_tx_timeout;
4262 uint32_t pdev_resets;
4263 uint32_t stateless_tid_alloc_failure;
4264 uint32_t phy_underrun;
4265 uint32_t txop_ovf;
4266 uint32_t seq_posted;
4267 uint32_t seq_failed_queueing;
4268 uint32_t seq_completed;
4269 uint32_t seq_restarted;
4270 uint32_t mu_seq_posted;
4271 int32_t mpdus_sw_flush;
4272 int32_t mpdus_hw_filter;
4273 int32_t mpdus_truncated;
4274 int32_t mpdus_ack_failed;
4275 int32_t mpdus_expired;
4276 uint32_t mc_drop;
4277} wmi_host_dbg_tx_stats;
4278
4279/**
4280 * struct wmi_host_dbg_rx_stats - RX Debug stats
4281 * @mid_ppdu_route_change: Cnts any change in ring routing mid-ppdu
4282 * @status_rcvd: Total number of statuses processed
4283 * @r0_frags: Extra frags on rings 0
4284 * @r1_frags: Extra frags on rings 1
4285 * @r2_frags: Extra frags on rings 2
4286 * @r3_frags: Extra frags on rings 3
4287 * @htt_msdus: MSDUs delivered to HTT
4288 * @htt_mpdus: MPDUs delivered to HTT
4289 * @loc_msdus: MSDUs delivered to local stack
4290 * @loc_mpdus: MPDUS delivered to local stack
4291 * @oversize_amsdu: AMSDUs that have more MSDUs than the status ring size
4292 * @phy_errs: Number of PHY errors
4293 * @phy_err_drop: Number of PHY errors drops
4294 * @mpdu_errs: Number of mpdu errors - FCS, MIC, ENC etc.
4295 * @pdev_rx_timeout: Number of rx inactivity timeouts
4296 * @rx_ovfl_errs: Number of rx overflow errors.
4297 */
4298typedef struct {
4299 int32_t mid_ppdu_route_change;
4300 int32_t status_rcvd;
4301 int32_t r0_frags;
4302 int32_t r1_frags;
4303 int32_t r2_frags;
4304 int32_t r3_frags;
4305 int32_t htt_msdus;
4306 int32_t htt_mpdus;
4307 int32_t loc_msdus;
4308 int32_t loc_mpdus;
4309 int32_t oversize_amsdu;
4310 int32_t phy_errs;
4311 int32_t phy_err_drop;
4312 int32_t mpdu_errs;
4313 uint32_t pdev_rx_timeout;
4314 int32_t rx_ovfl_errs;
4315} wmi_host_dbg_rx_stats;
4316
4317/** struct wmi_host_dbg_mem_stats - memory stats
4318 * @iram_free_size: IRAM free size on target
4319 * @dram_free_size: DRAM free size on target
4320 * @sram_free_size: SRAM free size on target
4321 */
4322typedef struct {
4323 uint32_t iram_free_size;
4324 uint32_t dram_free_size;
4325 /* Only Non-TLV */
4326 uint32_t sram_free_size;
4327} wmi_host_dbg_mem_stats;
4328
4329typedef struct {
4330 /* Only TLV */
4331 int32_t dummy;/* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4332} wmi_host_dbg_peer_stats;
4333
4334/**
4335 * struct wmi_host_dbg_stats - host debug stats
4336 * @tx: TX stats of type wmi_host_dbg_tx_stats
4337 * @rx: RX stats of type wmi_host_dbg_rx_stats
4338 * @mem: Memory stats of type wmi_host_dbg_mem_stats
4339 * @peer: peer stats of type wmi_host_dbg_peer_stats
4340 */
4341typedef struct {
4342 wmi_host_dbg_tx_stats tx;
4343 wmi_host_dbg_rx_stats rx;
4344 wmi_host_dbg_mem_stats mem;
4345 wmi_host_dbg_peer_stats peer;
4346} wmi_host_dbg_stats;
4347
4348/**
4349 * struct wmi_host_pdev_stats - PDEV stats
4350 * @chan_nf: Channel noise floor
4351 * @tx_frame_count: TX frame count
4352 * @rx_frame_count: RX frame count
4353 * @rx_clear_count: rx clear count
4354 * @cycle_count: cycle count
4355 * @phy_err_count: Phy error count
4356 * @chan_tx_pwr: Channel Tx Power
4357 * @pdev_stats: WAL dbg stats
4358 * @ackRcvBad:
4359 * @rtsBad:
4360 * @rtsGood:
4361 * @fcsBad:
4362 * @noBeacons:
4363 * @mib_int_count:
4364 */
4365typedef struct {
4366 int32_t chan_nf;
4367 uint32_t tx_frame_count;
4368 uint32_t rx_frame_count;
4369 uint32_t rx_clear_count;
4370 uint32_t cycle_count;
4371 uint32_t phy_err_count;
4372 uint32_t chan_tx_pwr;
4373 wmi_host_dbg_stats pdev_stats;
4374 uint32_t ackRcvBad;
4375 uint32_t rtsBad;
4376 uint32_t rtsGood;
4377 uint32_t fcsBad;
4378 uint32_t noBeacons;
4379 uint32_t mib_int_count;
4380} wmi_host_pdev_stats;
4381
4382/**
4383 * struct wmi_host_snr_info - WMI host Signal to noise ration info
4384 * @bcn_snr: beacon SNR
4385 * @dat_snr: Data frames SNR
4386 */
4387typedef struct {
4388 int32_t bcn_snr;
4389 int32_t dat_snr;
4390} wmi_host_snr_info;
4391
4392#define WMI_HOST_MAX_TX_RATE_VALUES 10 /*Max Tx Rates */
4393#define WMI_HOST_MAX_RSSI_VALUES 10 /*Max Rssi values */
4394
4395/* The WLAN_MAX_AC macro cannot be changed without breaking
4396 * * WMI compatibility.
4397 * * The maximum value of access category
4398 * */
4399#define WMI_HOST_WLAN_MAX_AC 4
4400
4401/**
4402 * struct wmi_host_vdev_stats - vdev stats structure
4403 * @vdev_id: unique id identifying the VDEV, generated by the caller
4404 * Rest all Only TLV
4405 * @vdev_snr: wmi_host_snr_info
4406 * @tx_frm_cnt: Total number of packets(per AC) that were successfully
4407 * transmitted (with and without retries,
4408 * including multi-cast, broadcast)
4409 * @rx_frm_cnt: Total number of packets that were successfully received
4410 * (after appropriate filter rules including multi-cast, broadcast)
4411 * @multiple_retry_cnt: The number of MSDU packets and MMPDU frames per AC
4412 * that the 802.11 station successfully transmitted after
4413 * more than one retransmission attempt
4414 * @fail_cnt: Total number packets(per AC) failed to transmit
4415 * @rts_fail_cnt: Total number of RTS/CTS sequence failures for transmission
4416 * of a packet
4417 * @rts_succ_cnt: Total number of RTS/CTS sequence success for transmission
4418 * of a packet
4419 * @rx_err_cnt: The receive error count. HAL will provide the
4420 * RxP FCS error global
4421 * @rx_discard_cnt: The sum of the receive error count and
4422 * dropped-receive-buffer error count (FCS error)
4423 * @ack_fail_cnt: Total number packets failed transmit because of no
4424 * ACK from the remote entity
4425 * @tx_rate_history:History of last ten transmit rate, in units of 500 kbit/sec
4426 * @bcn_rssi_history: History of last ten Beacon rssi of the connected Bss
4427 */
4428typedef struct {
4429 uint32_t vdev_id;
4430 /* Rest all Only TLV */
4431 wmi_host_snr_info vdev_snr;
4432 uint32_t tx_frm_cnt[WMI_HOST_WLAN_MAX_AC];
4433 uint32_t rx_frm_cnt;
4434 uint32_t multiple_retry_cnt[WMI_HOST_WLAN_MAX_AC];
4435 uint32_t fail_cnt[WMI_HOST_WLAN_MAX_AC];
4436 uint32_t rts_fail_cnt;
4437 uint32_t rts_succ_cnt;
4438 uint32_t rx_err_cnt;
4439 uint32_t rx_discard_cnt;
4440 uint32_t ack_fail_cnt;
4441 uint32_t tx_rate_history[WMI_HOST_MAX_TX_RATE_VALUES];
4442 uint32_t bcn_rssi_history[WMI_HOST_MAX_RSSI_VALUES];
4443} wmi_host_vdev_stats;
4444
4445/**
4446 * struct wmi_host_vdev_extd_stats - VDEV extended stats
4447 * @vdev_id: unique id identifying the VDEV, generated by the caller
4448 * @ppdu_aggr_cnt: No of Aggrs Queued to HW
4449 * @ppdu_noack: No of PPDU's not Acked includes both aggr and nonaggr's
4450 * @mpdu_queued: No of MPDU/Subframes's queued to HW in Aggregates
4451 * @ppdu_nonaggr_cnt: No of NonAggr/MPDU/Subframes's queued to HW
4452 * in Legacy NonAggregates
4453 * @mpdu_sw_requed: No of MPDU/Subframes's SW requeued includes
4454 * both Aggr and NonAggr
4455 * @mpdu_suc_retry: No of MPDU/Subframes's transmitted Successfully
4456 * after Single/mul HW retry
4457 * @mpdu_suc_multitry: No of MPDU/Subframes's transmitted Success
4458 * after Multiple HW retry
4459 * @mpdu_fail_retry: No of MPDU/Subframes's failed transmission
4460 * after Multiple HW retry
4461 * @reserved[13]: for future extensions set to 0x0
4462 */
4463typedef struct {
4464 uint32_t vdev_id;
4465 uint32_t ppdu_aggr_cnt;
4466 uint32_t ppdu_noack;
4467 uint32_t mpdu_queued;
4468 uint32_t ppdu_nonaggr_cnt;
4469 uint32_t mpdu_sw_requed;
4470 uint32_t mpdu_suc_retry;
4471 uint32_t mpdu_suc_multitry;
4472 uint32_t mpdu_fail_retry;
4473 uint32_t reserved[13];
4474} wmi_host_vdev_extd_stats;
4475
4476/**
4477 * struct wmi_host_peer_stats - peer stats
4478 * @peer_macaddr: peer MAC address
4479 * @peer_rssi: rssi
4480 * @peer_rssi_seq_num: rssi sequence number
4481 * @peer_tx_rate: last tx data rate used for peer
4482 * @peer_rx_rate: last rx data rate used for peer
4483 * @currentper: Current PER
4484 * @retries: Retries happend during transmission
4485 * @txratecount: Maximum Aggregation Size
4486 * @max4msframelen: Max4msframelen of tx rates used
4487 * @totalsubframes: Total no of subframes
4488 * @txbytes: No of bytes transmitted to the client
4489 * @nobuffs[4]: Packet Loss due to buffer overflows
4490 * @excretries[4]: Packet Loss due to excessive retries
4491 * @peer_rssi_changed: how many times peer's RSSI changed by a
4492 * non-negligible amount
4493 */
4494typedef struct {
4495 wmi_host_mac_addr peer_macaddr;
4496 uint32_t peer_rssi;
4497 uint32_t peer_rssi_seq_num;
4498 uint32_t peer_tx_rate;
4499 uint32_t peer_rx_rate;
4500 uint32_t currentper;
4501 uint32_t retries;
4502 uint32_t txratecount;
4503 uint32_t max4msframelen;
4504 uint32_t totalsubframes;
4505 uint32_t txbytes;
4506 uint32_t nobuffs[4];
4507 uint32_t excretries[4];
4508 uint32_t peer_rssi_changed;
4509} wmi_host_peer_stats;
4510
4511typedef struct {
4512 uint32_t dummy;
4513} wmi_host_bcnflt_stats;
4514
4515/**
4516 * struct wmi_host_chan_stats - WMI chan stats
4517 * @chan_mhz: Primary channel freq of the channel for which stats are sent
4518 * @sampling_period_us: Time spent on the channel
4519 * @rx_clear_count: Aggregate duration over a sampling period for
4520 * which channel activity was observed
4521 * @tx_duration_us: Accumalation of the TX PPDU duration over a sampling period
4522 * @rx_duration_us: Accumalation of the RX PPDU duration over a sampling period
4523 */
4524typedef struct {
4525 uint32_t chan_mhz;
4526 uint32_t sampling_period_us;
4527 uint32_t rx_clear_count;
4528 uint32_t tx_duration_us;
4529 uint32_t rx_duration_us;
4530} wmi_host_chan_stats;
4531
4532#define WMI_EVENT_ID_INVALID 0
4533/**
4534 * Host based ENUM IDs for events to abstract target enums for event_id
4535 */
4536typedef enum {
4537 wmi_service_ready_event_id = 0,
4538 wmi_ready_event_id,
4539 wmi_dbg_msg_event_id,
4540 wmi_scan_event_id,
4541 wmi_echo_event_id,
4542 wmi_update_stats_event_id,
4543 wmi_inst_rssi_stats_event_id,
4544 wmi_vdev_start_resp_event_id,
4545 wmi_vdev_standby_req_event_id,
4546 wmi_vdev_resume_req_event_id,
4547 wmi_vdev_stopped_event_id,
4548 wmi_peer_sta_kickout_event_id,
4549 wmi_host_swba_event_id,
4550 wmi_tbttoffset_update_event_id,
4551 wmi_mgmt_rx_event_id,
4552 wmi_chan_info_event_id,
4553 wmi_phyerr_event_id,
4554 wmi_roam_event_id,
4555 wmi_profile_match,
4556 wmi_debug_print_event_id,
4557 wmi_pdev_qvit_event_id,
4558 wmi_wlan_profile_data_event_id,
4559 wmi_rtt_meas_report_event_id,
4560 wmi_tsf_meas_report_event_id,
4561 wmi_rtt_error_report_event_id,
4562 wmi_rtt_keepalive_event_id,
4563 wmi_oem_cap_event_id,
4564 wmi_oem_meas_report_event_id,
4565 wmi_oem_report_event_id,
4566 wmi_nan_event_id,
4567 wmi_wow_wakeup_host_event_id,
4568 wmi_gtk_offload_status_event_id,
4569 wmi_gtk_rekey_fail_event_id,
4570 wmi_dcs_interference_event_id,
4571 wmi_pdev_tpc_config_event_id,
4572 wmi_csa_handling_event_id,
4573 wmi_gpio_input_event_id,
4574 wmi_peer_ratecode_list_event_id,
4575 wmi_generic_buffer_event_id,
4576 wmi_mcast_buf_release_event_id,
4577 wmi_mcast_list_ageout_event_id,
4578 wmi_vdev_get_keepalive_event_id,
4579 wmi_wds_peer_event_id,
4580 wmi_peer_sta_ps_statechg_event_id,
4581 wmi_pdev_fips_event_id,
4582 wmi_tt_stats_event_id,
4583 wmi_pdev_channel_hopping_event_id,
4584 wmi_pdev_ani_cck_level_event_id,
4585 wmi_pdev_ani_ofdm_level_event_id,
4586 wmi_pdev_reserve_ast_entry_event_id,
4587 wmi_pdev_nfcal_power_event_id,
4588 wmi_pdev_tpc_event_id,
4589 wmi_pdev_get_ast_info_event_id,
4590 wmi_pdev_temperature_event_id,
4591 wmi_pdev_nfcal_power_all_channels_event_id,
4592 wmi_pdev_bss_chan_info_event_id,
4593 wmi_mu_report_event_id,
4594 wmi_pdev_utf_event_id,
4595 wmi_pdev_dump_event_id,
4596 wmi_tx_pause_event_id,
4597 wmi_dfs_radar_event_id,
4598 wmi_pdev_l1ss_track_event_id,
4599 wmi_service_ready_ext_event_id,
4600 wmi_vdev_install_key_complete_event_id,
4601 wmi_vdev_mcc_bcn_intvl_change_req_event_id,
4602 wmi_vdev_tsf_report_event_id,
4603 wmi_peer_info_event_id,
4604 wmi_peer_tx_fail_cnt_thr_event_id,
4605 wmi_peer_estimated_linkspeed_event_id,
4606 wmi_peer_state_event_id,
4607 wmi_offload_bcn_tx_status_event_id,
4608 wmi_offload_prob_resp_tx_status_event_id,
4609 wmi_mgmt_tx_completion_event_id,
4610 wmi_tx_delba_complete_event_id,
4611 wmi_tx_addba_complete_event_id,
4612 wmi_ba_rsp_ssn_event_id,
4613 wmi_aggr_state_trig_event_id,
4614 wmi_roam_synch_event_id,
4615 wmi_p2p_disc_event_id,
4616 wmi_p2p_noa_event_id,
4617 wmi_pdev_resume_event_id,
4618 wmi_do_wow_disable_ack_event_id,
4619 wmi_wow_initial_wakeup_event_id,
4620 wmi_stats_ext_event_id,
4621 wmi_iface_link_stats_event_id,
4622 wmi_peer_link_stats_event_id,
4623 wmi_radio_link_stats_link,
4624 wmi_update_fw_mem_dump_event_id,
4625 wmi_diag_event_id_log_supported_event_id,
4626 wmi_nlo_match_event_id,
4627 wmi_nlo_scan_complete_event_id,
4628 wmi_apfind_event_id,
4629 wmi_passpoint_match_event_id,
4630 wmi_chatter_pc_query_event_id,
4631 wmi_pdev_ftm_intg_event_id,
4632 wmi_wlan_freq_avoid_event_id,
4633 wmi_thermal_mgmt_event_id,
4634 wmi_diag_container_event_id,
4635 wmi_host_auto_shutdown_event_id,
4636 wmi_update_whal_mib_stats_event_id,
4637 wmi_update_vdev_rate_stats_event_id,
4638 wmi_diag_event_id,
4639 wmi_ocb_set_sched_event_id,
4640 wmi_dbg_mesg_flush_complete_event_id,
4641 wmi_rssi_breach_event_id,
4642 wmi_uploadh_event_id,
4643 wmi_captureh_event_id,
4644 wmi_rfkill_state_change_event_id,
4645 wmi_tdls_peer_event_id,
4646 wmi_batch_scan_enabled_event_id,
4647 wmi_batch_scan_result_event_id,
4648 wmi_lpi_result_event_id,
4649 wmi_lpi_status_event_id,
4650 wmi_lpi_handoff_event_id,
4651 wmi_extscan_start_stop_event_id,
4652 wmi_extscan_operation_event_id,
4653 wmi_extscan_table_usage_event_id,
4654 wmi_extscan_cached_results_event_id,
4655 wmi_extscan_wlan_change_results_event_id,
4656 wmi_extscan_hotlist_match_event_id,
4657 wmi_extscan_capabilities_event_id,
4658 wmi_extscan_hotlist_ssid_match_event_id,
4659 wmi_mdns_stats_event_id,
4660 wmi_sap_ofl_add_sta_event_id,
4661 wmi_sap_ofl_del_sta_event_id,
4662 wmi_ocb_set_config_resp_event_id,
4663 wmi_ocb_get_tsf_timer_resp_event_id,
4664 wmi_dcc_get_stats_resp_event_id,
4665 wmi_dcc_update_ndl_resp_event_id,
4666 wmi_dcc_stats_event_id,
4667 wmi_soc_set_hw_mode_resp_event_id,
4668 wmi_soc_hw_mode_transition_event_id,
4669 wmi_soc_set_dual_mac_config_resp_event_id,
4670 wmi_tx_data_traffic_ctrl_event_id,
4671
4672 wmi_events_max,
4673} wmi_conv_event_id;
4674
4675#define WMI_UNAVAILABLE_PARAM 0
4676/**
4677 * Host based ENUM IDs for PDEV params to abstract target enums
4678 */
4679typedef enum {
4680 wmi_pdev_param_tx_chain_mask = 0,
4681 wmi_pdev_param_rx_chain_mask,
4682 wmi_pdev_param_txpower_limit2g,
4683 wmi_pdev_param_txpower_limit5g,
4684 wmi_pdev_param_txpower_scale,
4685 wmi_pdev_param_beacon_gen_mode,
4686 wmi_pdev_param_beacon_tx_mode,
4687 wmi_pdev_param_resmgr_offchan_mode,
4688 wmi_pdev_param_protection_mode,
4689 wmi_pdev_param_dynamic_bw,
4690 wmi_pdev_param_non_agg_sw_retry_th,
4691 wmi_pdev_param_agg_sw_retry_th,
4692 wmi_pdev_param_sta_kickout_th,
4693 wmi_pdev_param_ac_aggrsize_scaling,
4694 wmi_pdev_param_ltr_enable,
4695 wmi_pdev_param_ltr_ac_latency_be,
4696 wmi_pdev_param_ltr_ac_latency_bk,
4697 wmi_pdev_param_ltr_ac_latency_vi,
4698 wmi_pdev_param_ltr_ac_latency_vo,
4699 wmi_pdev_param_ltr_ac_latency_timeout,
4700 wmi_pdev_param_ltr_sleep_override,
4701 wmi_pdev_param_ltr_rx_override,
4702 wmi_pdev_param_ltr_tx_activity_timeout,
4703 wmi_pdev_param_l1ss_enable,
4704 wmi_pdev_param_dsleep_enable,
4705 wmi_pdev_param_pcielp_txbuf_flush,
4706 wmi_pdev_param_pcielp_txbuf_watermark,
4707 wmi_pdev_param_pcielp_txbuf_tmo_en,
4708 wmi_pdev_param_pcielp_txbuf_tmo_value,
4709 wmi_pdev_param_pdev_stats_update_period,
4710 wmi_pdev_param_vdev_stats_update_period,
4711 wmi_pdev_param_peer_stats_update_period,
4712 wmi_pdev_param_bcnflt_stats_update_period,
4713 wmi_pdev_param_pmf_qos,
4714 wmi_pdev_param_arp_ac_override,
4715 wmi_pdev_param_dcs,
4716 wmi_pdev_param_ani_enable,
4717 wmi_pdev_param_ani_poll_period,
4718 wmi_pdev_param_ani_listen_period,
4719 wmi_pdev_param_ani_ofdm_level,
4720 wmi_pdev_param_ani_cck_level,
4721 wmi_pdev_param_dyntxchain,
4722 wmi_pdev_param_proxy_sta,
4723 wmi_pdev_param_idle_ps_config,
4724 wmi_pdev_param_power_gating_sleep,
4725 wmi_pdev_param_aggr_burst,
4726 wmi_pdev_param_rx_decap_mode,
4727 wmi_pdev_param_fast_channel_reset,
4728 wmi_pdev_param_burst_dur,
4729 wmi_pdev_param_burst_enable,
4730 wmi_pdev_param_smart_antenna_default_antenna,
4731 wmi_pdev_param_igmpmld_override,
4732 wmi_pdev_param_igmpmld_tid,
4733 wmi_pdev_param_antenna_gain,
4734 wmi_pdev_param_rx_filter,
4735 wmi_pdev_set_mcast_to_ucast_tid,
4736 wmi_pdev_param_proxy_sta_mode,
4737 wmi_pdev_param_set_mcast2ucast_mode,
4738 wmi_pdev_param_set_mcast2ucast_buffer,
4739 wmi_pdev_param_remove_mcast2ucast_buffer,
4740 wmi_pdev_peer_sta_ps_statechg_enable,
4741 wmi_pdev_param_igmpmld_ac_override,
4742 wmi_pdev_param_block_interbss,
4743 wmi_pdev_param_set_disable_reset_cmdid,
4744 wmi_pdev_param_set_msdu_ttl_cmdid,
4745 wmi_pdev_param_set_ppdu_duration_cmdid,
4746 wmi_pdev_param_txbf_sound_period_cmdid,
4747 wmi_pdev_param_set_promisc_mode_cmdid,
4748 wmi_pdev_param_set_burst_mode_cmdid,
4749 wmi_pdev_param_en_stats,
4750 wmi_pdev_param_mu_group_policy,
4751 wmi_pdev_param_noise_detection,
4752 wmi_pdev_param_noise_threshold,
4753 wmi_pdev_param_dpd_enable,
4754 wmi_pdev_param_set_mcast_bcast_echo,
4755 wmi_pdev_param_atf_strict_sch,
4756 wmi_pdev_param_atf_sched_duration,
4757 wmi_pdev_param_ant_plzn,
4758 wmi_pdev_param_mgmt_retry_limit,
4759 wmi_pdev_param_sensitivity_level,
4760 wmi_pdev_param_signed_txpower_2g,
4761 wmi_pdev_param_signed_txpower_5g,
4762 wmi_pdev_param_enable_per_tid_amsdu,
4763 wmi_pdev_param_enable_per_tid_ampdu,
4764 wmi_pdev_param_cca_threshold,
4765 wmi_pdev_param_rts_fixed_rate,
4766 wmi_pdev_param_cal_period,
4767 wmi_pdev_param_pdev_reset,
4768 wmi_pdev_param_wapi_mbssid_offset,
4769 wmi_pdev_param_arp_srcaddr,
4770 wmi_pdev_param_arp_dstaddr,
4771 wmi_pdev_param_txpower_decr_db,
4772 wmi_pdev_param_rx_batchmode,
4773 wmi_pdev_param_packet_aggr_delay,
4774 wmi_pdev_param_atf_obss_noise_sch,
4775 wmi_pdev_param_atf_obss_noise_scaling_factor,
4776 wmi_pdev_param_cust_txpower_scale,
4777 wmi_pdev_param_atf_dynamic_enable,
4778 wmi_pdev_param_atf_ssid_group_policy,
4779 wmi_pdev_param_rfkill_enable,
4780 wmi_pdev_param_hw_rfkill_config,
4781 wmi_pdev_param_low_power_rf_enable,
4782 wmi_pdev_param_l1ss_track,
4783 wmi_pdev_param_hyst_en,
4784 wmi_pdev_param_power_collapse_enable,
4785 wmi_pdev_param_led_sys_state,
4786 wmi_pdev_param_led_enable,
4787 wmi_pdev_param_audio_over_wlan_latency,
4788 wmi_pdev_param_audio_over_wlan_enable,
4789 wmi_pdev_param_whal_mib_stats_update_enable,
4790 wmi_pdev_param_vdev_rate_stats_update_period,
4791 wmi_pdev_param_cts_cbw,
4792 wmi_pdev_param_wnts_config,
4793 wmi_pdev_param_adaptive_early_rx_enable,
4794 wmi_pdev_param_adaptive_early_rx_min_sleep_slop,
4795 wmi_pdev_param_adaptive_early_rx_inc_dec_step,
4796 wmi_pdev_param_early_rx_fix_sleep_slop,
4797 wmi_pdev_param_bmiss_based_adaptive_bto_enable,
4798 wmi_pdev_param_bmiss_bto_min_bcn_timeout,
4799 wmi_pdev_param_bmiss_bto_inc_dec_step,
4800 wmi_pdev_param_bto_fix_bcn_timeout,
4801 wmi_pdev_param_ce_based_adaptive_bto_enable,
4802 wmi_pdev_param_ce_bto_combo_ce_value,
4803 wmi_pdev_param_tx_chain_mask_2g,
4804 wmi_pdev_param_rx_chain_mask_2g,
4805 wmi_pdev_param_tx_chain_mask_5g,
4806 wmi_pdev_param_rx_chain_mask_5g,
4807 wmi_pdev_param_tx_chain_mask_cck,
4808 wmi_pdev_param_tx_chain_mask_1ss,
4809
4810 wmi_pdev_param_max,
4811} wmi_conv_pdev_params_id;
4812
4813
4814/**
4815 * Host based ENUM IDs for VDEV params to abstract target enums
4816 */
4817typedef enum {
4818 wmi_vdev_param_rts_threshold = 0,
4819 wmi_vdev_param_fragmentation_threshold,
4820 wmi_vdev_param_beacon_interval,
4821 wmi_vdev_param_listen_interval,
4822 wmi_vdev_param_multicast_rate,
4823 wmi_vdev_param_mgmt_tx_rate,
4824 wmi_vdev_param_slot_time,
4825 wmi_vdev_param_preamble,
4826 wmi_vdev_param_swba_time,
4827 wmi_vdev_stats_update_period,
4828 wmi_vdev_pwrsave_ageout_time,
4829 wmi_vdev_host_swba_interval,
4830 wmi_vdev_param_dtim_period,
4831 wmi_vdev_oc_scheduler_air_time_limit,
4832 wmi_vdev_param_wds,
4833 wmi_vdev_param_atim_window,
4834 wmi_vdev_param_bmiss_count_max,
4835 wmi_vdev_param_bmiss_first_bcnt,
4836 wmi_vdev_param_bmiss_final_bcnt,
4837 wmi_vdev_param_feature_wmm,
4838 wmi_vdev_param_chwidth,
4839 wmi_vdev_param_chextoffset,
4840 wmi_vdev_param_disable_htprotection,
4841 wmi_vdev_param_sta_quickkickout,
4842 wmi_vdev_param_mgmt_rate,
4843 wmi_vdev_param_protection_mode,
4844 wmi_vdev_param_fixed_rate,
4845 wmi_vdev_param_sgi,
4846 wmi_vdev_param_ldpc,
4847 wmi_vdev_param_tx_stbc,
4848 wmi_vdev_param_rx_stbc,
4849 wmi_vdev_param_intra_bss_fwd,
4850 wmi_vdev_param_def_keyid,
4851 wmi_vdev_param_nss,
4852 wmi_vdev_param_bcast_data_rate,
4853 wmi_vdev_param_mcast_data_rate,
4854 wmi_vdev_param_mcast_indicate,
4855 wmi_vdev_param_dhcp_indicate,
4856 wmi_vdev_param_unknown_dest_indicate,
4857 wmi_vdev_param_ap_keepalive_min_idle_inactive_time_secs,
4858 wmi_vdev_param_ap_keepalive_max_idle_inactive_time_secs,
4859 wmi_vdev_param_ap_keepalive_max_unresponsive_time_secs,
4860 wmi_vdev_param_ap_enable_nawds,
4861 wmi_vdev_param_mcast2ucast_set,
4862 wmi_vdev_param_enable_rtscts,
4863 wmi_vdev_param_rc_num_retries,
4864 wmi_vdev_param_txbf,
4865 wmi_vdev_param_packet_powersave,
4866 wmi_vdev_param_drop_unencry,
4867 wmi_vdev_param_tx_encap_type,
4868 wmi_vdev_param_ap_detect_out_of_sync_sleeping_sta_time_secs,
4869 wmi_vdev_param_cabq_maxdur,
4870 wmi_vdev_param_mfptest_set,
4871 wmi_vdev_param_rts_fixed_rate,
4872 wmi_vdev_param_vht_sgimask,
4873 wmi_vdev_param_vht80_ratemask,
4874 wmi_vdev_param_early_rx_adjust_enable,
4875 wmi_vdev_param_early_rx_tgt_bmiss_num,
4876 wmi_vdev_param_early_rx_bmiss_sample_cycle,
4877 wmi_vdev_param_early_rx_slop_step,
4878 wmi_vdev_param_early_rx_init_slop,
4879 wmi_vdev_param_early_rx_adjust_pause,
4880 wmi_vdev_param_proxy_sta,
4881 wmi_vdev_param_meru_vc,
4882 wmi_vdev_param_rx_decap_type,
4883 wmi_vdev_param_bw_nss_ratemask,
4884 wmi_vdev_param_sensor_ap,
4885 wmi_vdev_param_beacon_rate,
4886 wmi_vdev_param_dtim_enable_cts,
4887 wmi_vdev_param_sta_kickout,
4888 wmi_vdev_param_tx_pwrlimit,
4889 wmi_vdev_param_snr_num_for_cal,
4890 wmi_vdev_param_roam_fw_offload,
4891 wmi_vdev_param_enable_rmc,
4892 wmi_vdev_param_ibss_max_bcn_lost_ms,
4893 wmi_vdev_param_max_rate,
4894 wmi_vdev_param_early_rx_drift_sample,
4895 wmi_vdev_param_set_ibss_tx_fail_cnt_thr,
4896 wmi_vdev_param_ebt_resync_timeout,
4897 wmi_vdev_param_aggr_trig_event_enable,
4898 wmi_vdev_param_is_ibss_power_save_allowed,
4899 wmi_vdev_param_is_power_collapse_allowed,
4900 wmi_vdev_param_is_awake_on_txrx_enabled,
4901 wmi_vdev_param_inactivity_cnt,
4902 wmi_vdev_param_txsp_end_inactivity_time_ms,
4903 wmi_vdev_param_dtim_policy,
4904 wmi_vdev_param_ibss_ps_warmup_time_secs,
4905 wmi_vdev_param_ibss_ps_1rx_chain_in_atim_window_enable,
4906 wmi_vdev_param_rx_leak_window,
4907 wmi_vdev_param_stats_avg_factor,
4908 wmi_vdev_param_disconnect_th,
4909 wmi_vdev_param_rtscts_rate,
4910 wmi_vdev_param_mcc_rtscts_protection_enable,
4911 wmi_vdev_param_mcc_broadcast_probe_enable,
4912
4913 wmi_vdev_param_max,
4914} wmi_conv_vdev_param_id;
4915
4916/**
4917 * Host based ENUM IDs for service bits to abstract target enums
4918 */
4919typedef enum {
4920 wmi_service_beacon_offload = 0,
4921 wmi_service_scan_offload,
4922 wmi_service_roam_offload,
4923 wmi_service_bcn_miss_offload,
4924 wmi_service_sta_pwrsave,
4925 wmi_service_sta_advanced_pwrsave,
4926 wmi_service_ap_uapsd,
4927 wmi_service_ap_dfs,
4928 wmi_service_11ac,
4929 wmi_service_blockack,
4930 wmi_service_phyerr,
4931 wmi_service_bcn_filter,
4932 wmi_service_rtt,
4933 wmi_service_ratectrl,
4934 wmi_service_wow,
4935 wmi_service_ratectrl_cache,
4936 wmi_service_iram_tids,
4937 wmi_service_burst,
4938 wmi_service_smart_antenna_sw_support,
4939 wmi_service_gtk_offload,
4940 wmi_service_scan_sch,
4941 wmi_service_csa_offload,
4942 wmi_service_chatter,
4943 wmi_service_coex_freqavoid,
4944 wmi_service_packet_power_save,
4945 wmi_service_force_fw_hang,
4946 wmi_service_smart_antenna_hw_support,
4947 wmi_service_gpio,
4948 wmi_sta_uapsd_basic_auto_trig,
4949 wmi_sta_uapsd_var_auto_trig,
4950 wmi_service_sta_keep_alive,
4951 wmi_service_tx_encap,
4952 wmi_service_ap_ps_detect_out_of_sync,
4953 wmi_service_early_rx,
4954 wmi_service_enhanced_proxy_sta,
4955 wmi_service_tt,
4956 wmi_service_atf,
4957 wmi_service_peer_caching,
4958 wmi_service_coex_gpio,
4959 wmi_service_aux_spectral_intf,
4960 wmi_service_aux_chan_load_intf,
4961 wmi_service_bss_channel_info_64,
4962 wmi_service_ext_res_cfg_support,
4963 wmi_service_mesh,
4964 wmi_service_restrt_chnl_support,
4965 wmi_service_roam_scan_offload,
4966 wmi_service_arpns_offload,
4967 wmi_service_nlo,
4968 wmi_service_sta_dtim_ps_modulated_dtim,
4969 wmi_service_sta_smps,
4970 wmi_service_fwtest,
4971 wmi_service_sta_wmmac,
4972 wmi_service_tdls,
4973 wmi_service_mcc_bcn_interval_change,
4974 wmi_service_adaptive_ocs,
4975 wmi_service_ba_ssn_support,
4976 wmi_service_filter_ipsec_natkeepalive,
4977 wmi_service_wlan_hb,
4978 wmi_service_lte_ant_share_support,
4979 wmi_service_batch_scan,
4980 wmi_service_qpower,
4981 wmi_service_plmreq,
4982 wmi_service_thermal_mgmt,
4983 wmi_service_rmc,
4984 wmi_service_mhf_offload,
4985 wmi_service_coex_sar,
4986 wmi_service_bcn_txrate_override,
4987 wmi_service_nan,
4988 wmi_service_l1ss_stat,
4989 wmi_service_estimate_linkspeed,
4990 wmi_service_obss_scan,
4991 wmi_service_tdls_offchan,
4992 wmi_service_tdls_uapsd_buffer_sta,
4993 wmi_service_tdls_uapsd_sleep_sta,
4994 wmi_service_ibss_pwrsave,
4995 wmi_service_lpass,
4996 wmi_service_extscan,
4997 wmi_service_d0wow,
4998 wmi_service_hsoffload,
4999 wmi_service_roam_ho_offload,
5000 wmi_service_rx_full_reorder,
5001 wmi_service_dhcp_offload,
5002 wmi_service_sta_rx_ipa_offload_support,
5003 wmi_service_mdns_offload,
5004 wmi_service_sap_auth_offload,
5005 wmi_service_dual_band_simultaneous_support,
5006 wmi_service_ocb,
5007 wmi_service_ap_arpns_offload,
5008 wmi_service_per_band_chainmask_support,
5009 wmi_service_packet_filter_offload,
5010 wmi_service_mgmt_tx_htt,
5011 wmi_service_mgmt_tx_wmi,
5012 wmi_service_ext_msg,
5013 wmi_service_mawc,
5014
5015 wmi_service_peer_stats,
5016 wmi_service_mesh_11s,
5017 wmi_service_periodic_chan_stat_support,
5018 wmi_service_tx_mode_push_only,
5019 wmi_service_tx_mode_push_pull,
5020 wmi_service_tx_mode_dynamic,
5021
5022 wmi_services_max,
5023} wmi_conv_service_ids;
5024#define WMI_SERVICE_UNAVAILABLE 0xFFFF
5025
5026/**
5027 * struct target_capability_info - Target capabilities in service ready
5028 * @phy_capability: PHY capabilities
5029 * @max_frag_entry: Maximum frag entries
5030 * @num_rf_chains: Number of RF chains supported
5031 * @ht_cap_info: HT cap info
5032 * @vht_cap_info: VHT cap info
5033 * @vht_supp_mcs: VHT Supported MCS
5034 * @hw_min_tx_power: HW minimum tx power
5035 * @hw_max_tx_power: HW maximum tx power
5036 * @sys_cap_info: sys capability info
5037 * @min_pkt_size_enable: Enterprise mode short pkt enable
5038 * @max_bcn_ie_size: Max beacon and probe rsp IE offload size
5039 * @max_num_scan_channels: Max scan channels
5040 * @max_supported_macs: max supported MCS
5041 * @wmi_fw_sub_feat_caps: FW sub feature capabilities
5042 * @txrx_chainmask: TXRX chain mask
5043 * @default_dbs_hw_mode_index: DBS hw mode index
5044 * @num_msdu_desc: number of msdu desc
5045 */
5046typedef struct {
5047 uint32_t phy_capability;
5048 uint32_t max_frag_entry;
5049 uint32_t num_rf_chains;
5050 uint32_t ht_cap_info;
5051 uint32_t vht_cap_info;
5052 uint32_t vht_supp_mcs;
5053 uint32_t hw_min_tx_power;
5054 uint32_t hw_max_tx_power;
5055 uint32_t sys_cap_info;
5056 uint32_t min_pkt_size_enable;
5057 uint32_t max_bcn_ie_size;
5058 uint32_t max_num_scan_channels;
5059 uint32_t max_supported_macs;
5060 uint32_t wmi_fw_sub_feat_caps;
5061 uint32_t txrx_chainmask;
5062 uint32_t default_dbs_hw_mode_index;
5063 uint32_t num_msdu_desc;
5064} target_capability_info;
5065
5066/**
5067 * struct wmi_host_fw_ver - FW version in non-tlv target
5068 * @sw_version: Versin info
5069 * @sw_version_1: Second dword of version
5070 */
5071struct wmi_host_fw_ver {
5072 uint32_t sw_version;
5073 uint32_t sw_version_1;
5074};
5075
5076/**
5077 * struct wmi_host_fw_abi_ver - FW version in non-tlv target
5078 * @sw_version: Versin info
5079 * @abi_version: ABI version
5080 */
5081struct wmi_host_fw_abi_ver {
5082 uint32_t sw_version;
5083 uint32_t abi_version;
5084};
5085
5086/**
5087 * struct target_resource_config - Resource config sent from host to target
5088 * abstracted out to include union of both configs
5089 * @num_vdevs: Number vdevs configured
5090 * @num_peers: Number of peers
5091 * @num_active_peers: Number of active peers for peer cache
5092 * @num_offload_peers: Number of offload peers
5093 * @num_offload_reorder_buffs: number of offload reorder buffs
5094 * @num_peer_keys: number of peer keys
5095 * @num_tids: number of tids
5096 * @ast_skid_limit: AST skid limit
5097 * @tx_chain_mask: TX chain mask
5098 * @rx_chain_mask: RX chain mask
5099 * @rx_timeout_pri: RX reorder timeout per AC
5100 * @rx_decap_mode: RX decap mode
5101 * @scan_max_pending_req: Scan mac pending req
5102 * @bmiss_offload_max_vdev: Beacom miss offload max vdevs
5103 * @roam_offload_max_vdev: Roam offload max vdevs
5104 * @roam_offload_max_ap_profiles: roam offload max ap profiles
5105 * @num_mcast_groups: num mcast groups
5106 * @num_mcast_table_elems: number of macst table elems
5107 * @mcast2ucast_mode: mcast enhance mode
5108 * @tx_dbg_log_size: DBG log buf size
5109 * @num_wds_entries: number of WDS entries
5110 * @dma_burst_size: DMA burst size.
5111 * @mac_aggr_delim: Mac aggr delim
5112 * @rx_skip_defrag_timeout_dup_detection_check: Defrag dup check in host?
5113 * @vow_config: vow configuration
5114 * @gtk_offload_max_vdev: Max vdevs for GTK offload
5115 * @num_msdu_desc: Number of msdu desc
5116 * @max_frag_entries: Max frag entries
5117 * End common
5118 * @max_peer_ext_stats: Max peer EXT stats
5119 * @smart_ant_cap: Smart antenna capabilities
5120 * @BK_Minfree: BIN configuration for BK traffic
5121 * @BE_Minfree: BIN configuration for BE traffic
5122 * @VI_Minfree: BIN configuration for VI traffic
5123 * @VO_Minfree: BIN configuration for VO traffic
5124 * @rx_batchmode: RX batch mode
5125 * @tt_support: Thermal throttling support
5126 * @atf_config: ATF config
5127 * @iphdr_pad_config: ipheader pad config
5128 * @qwrap_config: Qwrap configuration
5129 * @alloc_frag_desc_for_data_pkt: Frag desc for data
5130 * Added in MCL
5131 * @num_tdls_vdevs:
5132 * @num_tdls_conn_table_entries:
5133 * @beacon_tx_offload_max_vdev:
5134 * @num_multicast_filter_entries:
5135 * @num_wow_filters:
5136 * @num_keep_alive_pattern:
5137 * @keep_alive_pattern_size:
5138 * @max_tdls_concurrent_sleep_sta:
5139 * @max_tdls_concurrent_buffer_sta:
5140 * @wmi_send_separate:
5141 * @num_ocb_vdevs:
5142 * @num_ocb_channels:
5143 * @num_ocb_schedules:
5144 */
5145typedef struct {
5146 uint32_t num_vdevs;
5147 uint32_t num_peers;
5148 uint32_t num_active_peers;
5149 uint32_t num_offload_peers;
5150 uint32_t num_offload_reorder_buffs;
5151 uint32_t num_peer_keys;
5152 uint32_t num_tids;
5153 uint32_t ast_skid_limit;
5154 uint32_t tx_chain_mask;
5155 uint32_t rx_chain_mask;
5156 uint32_t rx_timeout_pri[4];
5157 uint32_t rx_decap_mode;
5158 uint32_t scan_max_pending_req;
5159 uint32_t bmiss_offload_max_vdev;
5160 uint32_t roam_offload_max_vdev;
5161 uint32_t roam_offload_max_ap_profiles;
5162 uint32_t num_mcast_groups;
5163 uint32_t num_mcast_table_elems;
5164 uint32_t mcast2ucast_mode;
5165 uint32_t tx_dbg_log_size;
5166 uint32_t num_wds_entries;
5167 uint32_t dma_burst_size;
5168 uint32_t mac_aggr_delim;
5169 uint32_t rx_skip_defrag_timeout_dup_detection_check;
5170 uint32_t vow_config;
5171 uint32_t gtk_offload_max_vdev;
5172 uint32_t num_msdu_desc; /* Number of msdu desc */
5173 uint32_t max_frag_entries;
5174 /* End common */
5175
5176 /* Added for Beeliner */
5177 uint32_t max_peer_ext_stats;
5178 uint32_t smart_ant_cap;
5179 uint32_t BK_Minfree;
5180 uint32_t BE_Minfree;
5181 uint32_t VI_Minfree;
5182 uint32_t VO_Minfree;
5183 uint32_t rx_batchmode;
5184 uint32_t tt_support;
5185 uint32_t atf_config;
5186 uint32_t iphdr_pad_config;
5187 uint32_t
5188 qwrap_config:16,
5189 alloc_frag_desc_for_data_pkt:16;
5190
5191 /* Added in MCL */
5192 uint32_t num_tdls_vdevs;
5193 uint32_t num_tdls_conn_table_entries;
5194 uint32_t beacon_tx_offload_max_vdev;
5195 uint32_t num_multicast_filter_entries;
5196 uint32_t num_wow_filters;
5197 uint32_t num_keep_alive_pattern;
5198 uint32_t keep_alive_pattern_size;
5199 uint32_t max_tdls_concurrent_sleep_sta;
5200 uint32_t max_tdls_concurrent_buffer_sta;
5201 uint32_t wmi_send_separate;
5202 uint32_t num_ocb_vdevs;
5203 uint32_t num_ocb_channels;
5204 uint32_t num_ocb_schedules;
5205} target_resource_config;
5206
5207/**
5208 * struct wds_addr_event - WDS addr event structure
5209 * @event_type: event type add/delete
5210 * @peer_mac: peer mac
5211 * @dest_mac: destination mac address
5212 */
5213typedef struct {
5214 uint32_t event_type[4];
5215 u_int8_t peer_mac[IEEE80211_ADDR_LEN];
5216 u_int8_t dest_mac[IEEE80211_ADDR_LEN];
5217} wds_addr_event_t;
5218/**
5219 * Enum replicated for host abstraction with FW
5220 */
5221typedef enum {
5222 /* Event respose of START CMD */
5223 WMI_HOST_VDEV_START_RESP_EVENT = 0,
5224 /* Event respose of RESTART CMD */
5225 WMI_HOST_VDEV_RESTART_RESP_EVENT,
5226} WMI_HOST_START_EVENT_PARAM;
5227
5228/**
5229 * struct wmi_host_vdev_start_resp - VDEV start response
5230 * @vdev_id: vdev id
5231 * @requestor_id: requestor id that requested the VDEV start request
5232 * @resp_type: Respose of Event type START/RESTART
5233 * @status: status of the response
5234 * @chain_mask: Vdev chain mask
5235 * @smps_mode: Vdev mimo power save mode
5236 * @mac_id: mac_id field contains the MAC identifier that the
5237 * VDEV is bound to. The valid range is 0 to (num_macs-1).
5238 * @cfgd_tx_streams: Configured Transmit Streams
5239 * @cfgd_rx_streams: Configured Receive Streams
5240 */
5241typedef struct {
5242 uint32_t vdev_id;
5243 uint32_t requestor_id;
5244 WMI_HOST_START_EVENT_PARAM resp_type;
5245 uint32_t status;
5246 uint32_t chain_mask;
5247 uint32_t smps_mode;
5248 uint32_t mac_id;
5249 uint32_t cfgd_tx_streams;
5250 uint32_t cfgd_rx_streams;
5251} wmi_host_vdev_start_resp;
5252
5253#define WMI_HOST_ATH_MAX_ANTENNA 4
5254/**
5255 * struct wmi_host_mgmt_rx_hdr - host mgmt header params
5256 * @channel: channel on which this frame is received
5257 * @snr: snr information used to cal rssi
5258 * @rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA]: RSSI of PRI 20MHz for each chain.
5259 * @rate: Rate kbps
5260 * @phy_mode: rx phy mode WLAN_PHY_MODE
5261 * @buf_len: length of the frame
5262 * @status: rx status
5263 * @flags: information about the management frame e.g. can give a
5264 * scan source for a scan result mgmt frame
5265 * @rssi: combined RSSI, i.e. the sum of the snr + noise floor (dBm units)
5266 * @tsf_delta:
5267 */
5268typedef struct {
5269 uint32_t channel;
5270 uint32_t snr;
5271 uint8_t rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA];
5272 uint32_t rate;
5273 uint32_t phy_mode;
5274 uint32_t buf_len;
5275 uint32_t status;
5276 uint32_t flags;
5277 int32_t rssi;
5278 uint32_t tsf_delta;
5279} wmi_host_mgmt_rx_hdr;
5280
5281/**
5282 * struct wmi_host_roam_event - host roam event param
5283 * @vdev_id: vdev id
5284 * @reason: roam reason
5285 * @rssi: RSSI
5286 */
5287typedef struct {
5288 uint32_t vdev_id;
5289 uint32_t reason;
5290 uint32_t rssi;
5291} wmi_host_roam_event;
5292
5293/**
5294 * ENUM wmi_host_scan_event_type - Scan event type
5295 */
5296enum wmi_host_scan_event_type {
5297 WMI_HOST_SCAN_EVENT_STARTED = 0x1,
5298 WMI_HOST_SCAN_EVENT_COMPLETED = 0x2,
5299 WMI_HOST_SCAN_EVENT_BSS_CHANNEL = 0x4,
5300 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
5301 WMI_HOST_SCAN_EVENT_DEQUEUED = 0x10,
5302 WMI_HOST_SCAN_EVENT_PREEMPTED = 0x20,
5303 WMI_HOST_SCAN_EVENT_START_FAILED = 0x40,
5304 WMI_HOST_SCAN_EVENT_RESTARTED = 0x80,
5305 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = 0x100,
5306 WMI_HOST_SCAN_EVENT_INVALID = 0x200,
5307 WMI_HOST_SCAN_EVENT_MAX = 0x8000
5308};
5309
5310/**
5311 * ENUM wmi_host_scan_completion_reason - Scan completion event type
5312 */
5313enum wmi_host_scan_completion_reason {
5314 /** scan related events */
5315 WMI_HOST_SCAN_REASON_NONE = 0xFF,
5316 WMI_HOST_SCAN_REASON_COMPLETED = 0,
5317 WMI_HOST_SCAN_REASON_CANCELLED = 1,
5318 WMI_HOST_SCAN_REASON_PREEMPTED = 2,
5319 WMI_HOST_SCAN_REASON_TIMEDOUT = 3,
5320 WMI_HOST_SCAN_REASON_INTERNAL_FAILURE = 4,
5321 WMI_HOST_SCAN_REASON_MAX,
5322};
5323
5324/**
5325 * struct wmi_host_scan_event - Scan event response from target
5326 * @event: event type
5327 * @reason: Reason for event
5328 * @channel_freq: channel frequency
5329 * @requestor: requestor id
5330 * @scan_id: scan id
5331 * @vdev_id: vdev id
5332 */
5333typedef struct {
5334 uint32_t event;
5335 uint32_t reason;
5336 uint32_t channel_freq;
5337 uint32_t requestor;
5338 uint32_t scan_id;
5339 uint32_t vdev_id;
5340} wmi_host_scan_event;
5341
5342/**
5343 * struct wmi_host_pdev_reserve_ast_entry_event - Reserve AST entry
5344 * @result: result
5345 */
5346typedef struct {
5347 uint32_t result;
5348} wmi_host_pdev_reserve_ast_entry_event;
5349
5350/**
5351 * struct wmi_host_mcast_ageout_entry - mcast aged-out entry
5352 * @grp_addr: IPv4/6 mcast group addr
5353 * @vdev_id: vdev id
5354 */
5355typedef struct {
5356 uint8_t grp_addr[16];
5357 uint32_t vdev_id;
5358} wmi_host_mcast_ageout_entry;
5359
5360/**
5361 * struct wmi_host_mcast_list_ageout_event - List of mcast entry aged-out
5362 * @num_entry: Number of mcast entries timed-out
5363 * @entry: List of wmi_host_mcast_ageout_entry
5364 */
5365typedef struct {
5366 uint32_t num_entry;
5367 wmi_host_mcast_ageout_entry entry[1];
5368} wmi_host_mcast_list_ageout_event;
5369
5370/**
5371 * struct wmi_host_pdev_nfcal_power_all_channels_event - NF cal event data
5372 * @nfdBr:
5373 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5374 * NFCalPower_chain2, NFCalPower_chain3},
5375 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5376 * NFCalPower_chain2, NFCalPower_chain3},
5377 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5378 * NFCalPower_chain2, NFCalPower_chain3},
5379 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5380 * NFCalPower_chain2, NFCalPower_chain3},
5381 * @nfdBr:
5382 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5383 * NFCalPower_chain2, NFCalPower_chain3},
5384 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5385 * NFCalPower_chain2, NFCalPower_chain3},
5386 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5387 * NFCalPower_chain2, NFCalPower_chain3},
5388 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5389 * NFCalPower_chain2, NFCalPower_chain3},
5390 * @freqNum: frequency number
5391 */
5392typedef struct {
5393 int8_t nfdBr[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5394 int8_t nfdBm[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5395 uint32_t freqNum[WMI_HOST_RXG_CAL_CHAN_MAX];
5396} wmi_host_pdev_nfcal_power_all_channels_event;
5397
5398/**
5399 * struct wmi_host_pdev_tpc_event - WMI host pdev TPC event
5400 * @tpc:
5401 */
5402typedef struct {
5403 uint32_t tpc[1];
5404} wmi_host_pdev_tpc_event;
5405
5406/**
5407 * struct wmi_host_pdev_generic_buffer_event
5408 * @buf_type: Buffer type
5409 * @frag_id: Frag id
5410 * @more_frag: more frags pending
5411 * @buf_len: buffer length
5412 * @buf_info: variable length buffer
5413 */
5414typedef struct {
5415 uint32_t buf_type;
5416 uint32_t frag_id;
5417 uint32_t more_frag;
5418 uint32_t buf_len;
5419 uint32_t buf_info[1];
5420} wmi_host_pdev_generic_buffer_event;
5421/**
5422 * Enum for host buffer event
5423 */
5424enum {
5425 WMI_HOST_BUFFER_TYPE_RATEPWR_TABLE,
5426 WMI_HOST_BUFFER_TYPE_CTL_TABLE,
5427};
5428
5429/**
5430 * struct wmi_host_pdev_tpc_config_event - host pdev tpc config event
5431 * @regDomain:
5432 * @chanFreq:
5433 * @phyMode:
5434 * @twiceAntennaReduction:
5435 * @twiceMaxRDPower:
5436 * @twiceAntennaGain:
5437 * @powerLimit:
5438 * @rateMax:
5439 * @numTxChain:
5440 * @ctl:
5441 * @flags:
5442 * @maxRegAllowedPower:
5443 * @maxRegAllowedPowerAGCDD:
5444 * @maxRegAllowedPowerAGSTBC:
5445 * @maxRegAllowedPowerAGTXBF:
5446 * @ratesArray:
5447 */
5448typedef struct {
5449 uint32_t regDomain;
5450 uint32_t chanFreq;
5451 uint32_t phyMode;
5452 uint32_t twiceAntennaReduction;
5453 uint32_t twiceMaxRDPower;
5454 int32_t twiceAntennaGain;
5455 uint32_t powerLimit;
5456 uint32_t rateMax;
5457 uint32_t numTxChain;
5458 uint32_t ctl;
5459 uint32_t flags;
5460 int8_t maxRegAllowedPower[WMI_HOST_TPC_TX_NUM_CHAIN];
5461 int8_t maxRegAllowedPowerAGCDD[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5462 int8_t maxRegAllowedPowerAGSTBC[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5463 int8_t maxRegAllowedPowerAGTXBF[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5464 uint8_t ratesArray[WMI_HOST_TPC_RATE_MAX];
5465} wmi_host_pdev_tpc_config_event;
5466/**
5467 * Enums for TPC event
5468 */
5469typedef enum {
5470 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
5471 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
5472 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
5473} WMI_HOST_TPC_CONFIG_EVENT_FLAG;
5474
5475/**
5476 * Medium Utilization evaluation algorithms
5477 * These algorithms can be complementary rather than exclusive.
5478 */
5479typedef enum {
5480 WMI_HOST_MU_BASIC_ALGO = 0x1,
5481 WMI_HOST_MU_PER_BSSID_ALGO = 0x2,
5482 WMI_HOST_MU_HIDDEN_NODE_ALGO = 0x4,
5483} WMI_HOST_MU_ALGO_TYPE;
5484/* max MU alg combinations supported by target */
5485#define WMI_HOST_MU_MAX_ALGO_TYPE 3
5486
5487/**
5488 * struct wmi_host_mu_report_event - WMI_MU_REPORT_EVENTID
5489 * @mu_request_id: request id
5490 * @status_reason: MU_STATUS_REASON
5491 * @total_mu: MU_ALG_TYPE combinations
5492 * @num_active_bssid: number of active bssid
5493 */
5494typedef struct {
5495 uint32_t mu_request_id;
5496 uint32_t status_reason;
5497 uint32_t total_mu[WMI_HOST_MU_MAX_ALGO_TYPE];
5498 uint32_t num_active_bssid;
5499} wmi_host_mu_report_event;
5500
5501/**
5502 * struct wmi_host_mgmt_tx_compl_event - TX completion event
5503 * @desc_id: from tx_send_cmd
5504 * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
5505 */
5506typedef struct {
5507 uint32_t desc_id;
5508 uint32_t status;
5509} wmi_host_mgmt_tx_compl_event;
5510
5511#define WMI_HOST_TIM_BITMAP_ARRAY_SIZE 17
5512
5513/**
5514 * struct wmi_host_tim_info - TIM info in SWBA event
5515 * @tim_len: TIM length
5516 * @tim_mcast:
5517 * @tim_bitmap: TIM bitmap
5518 * @tim_changed: TIM changed
5519 * @tim_num_ps_pending: TIM num PS sta pending
5520 */
5521typedef struct {
5522 uint32_t tim_len;
5523 uint32_t tim_mcast;
5524 uint32_t tim_bitmap[WMI_HOST_TIM_BITMAP_ARRAY_SIZE];
5525 uint32_t tim_changed;
5526 uint32_t tim_num_ps_pending;
5527} wmi_host_tim_info;
5528
5529/**
5530 * struct wmi_host_p2p_noa_descriptor - NoA desc in SWBA event
5531 * @type_count: Absence count
5532 * @duration: NoA duration
5533 * @interval: NoA interval
5534 * @start_time: start time
5535 */
5536typedef struct {
5537 uint32_t type_count;
5538 uint32_t duration;
5539 uint32_t interval;
5540 uint32_t start_time;
5541} wmi_host_p2p_noa_descriptor;
5542/* Maximum number of NOA Descriptors supported */
5543#define WMI_HOST_P2P_MAX_NOA_DESCRIPTORS 4
5544/**
5545 * struct wmi_host_p2p_noa_info - p2p noa information
5546 * @modified: NoA modified
5547 * @index: Index
5548 * @oppPS: Oppurtunstic ps
5549 * @ctwindow: CT window
5550 * @num_descriptors: number of descriptors
5551 * @noa_descriptors: noa descriptors
5552 */
5553typedef struct {
5554 uint8_t modified;
5555 uint8_t index;
5556 uint8_t oppPS;
5557 uint8_t ctwindow;
5558 uint8_t num_descriptors;
5559 wmi_host_p2p_noa_descriptor
5560 noa_descriptors[WMI_HOST_P2P_MAX_NOA_DESCRIPTORS];
5561} wmi_host_p2p_noa_info;
5562
5563/**
5564 * struct wmi_host_peer_sta_kickout_event
5565 * @peer_macaddr: peer mac address
5566 * @reason: kickout reason
5567 * @rssi: rssi
5568 */
5569typedef struct {
5570 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5571 uint32_t reason;
5572 uint32_t rssi;
5573} wmi_host_peer_sta_kickout_event;
5574
5575/**
5576 * struct wmi_host_peer_sta_ps_statechange_event - ST ps state change event
5577 * @peer_macaddr: peer mac address
5578 * @peer_ps_stats: peer PS state
5579 */
5580typedef struct {
5581 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5582 uint32_t peer_ps_state;
5583} wmi_host_peer_sta_ps_statechange_event;
5584
5585/* Maximum CCK, OFDM rates supported */
5586#define WMI_SA_MAX_CCK_OFDM_RATES 12
5587/* Maximum MCS rates supported; 4 rates in each dword */
5588#define WMI_SA_MAX_MCS_RATES 40
5589#define WMI_SA_MAX_RATE_COUNTERS 4
5590/* Maximum rate series used for transmission */
5591#define SA_MAX_RATE_SERIES 2
5592
5593#define SA_MAX_LEGACY_RATE_DWORDS 3
5594#define SA_MAX_HT_RATE_DWORDS 10
5595#define SA_BYTES_IN_DWORD 4
5596#define SA_MASK_BYTE 0xff
5597/* TODO: ratecode_160 needs to add for future chips */
5598/**
5599 * struct wmi_sa_rate_cap - smart antenna rat capabilities
5600 * @ratecode_legacy: Rate code array for CCK OFDM
5601 * @ratecode_20: Rate code array for 20MHz BW
5602 * @ratecode_40: Rate code array for 40MHz BW
5603 * @ratecode_80: Rate code array for 80MHz BW
5604 * @ratecount: Max Rate count for each mode
5605 */
5606typedef struct {
5607 uint8_t ratecode_legacy[WMI_SA_MAX_CCK_OFDM_RATES];
5608 uint8_t ratecode_20[WMI_SA_MAX_MCS_RATES];
5609 uint8_t ratecode_40[WMI_SA_MAX_MCS_RATES];
5610 uint8_t ratecode_80[WMI_SA_MAX_MCS_RATES];
5611 uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS];
5612} wmi_sa_rate_cap;
5613
5614/** Preamble types to be used with VDEV fixed rate configuration */
5615typedef enum {
5616 WMI_HOST_RATE_PREAMBLE_OFDM,
5617 WMI_HOST_RATE_PREAMBLE_CCK,
5618 WMI_HOST_RATE_PREAMBLE_HT,
5619 WMI_HOST_RATE_PREAMBLE_VHT,
5620} WMI_HOST_RATE_PREAMBLE;
5621
5622#define WMI_HOST_FIXED_RATE_NONE (0xff)
5623
5624/** slot time long */
5625#define WMI_HOST_VDEV_SLOT_TIME_LONG 0x1
5626/** slot time short */
5627#define WMI_HOST_VDEV_SLOT_TIME_SHORT 0x2
5628/** preablbe long */
5629#define WMI_HOST_VDEV_PREAMBLE_LONG 0x1
5630/** preablbe short */
5631#define WMI_HOST_VDEV_PREAMBLE_SHORT 0x2
5632/** found a better AP */
5633#define WMI_HOST_ROAM_REASON_BETTER_AP 0x1
5634/** beacon miss detected */
5635#define WMI_HOST_ROAM_REASON_BMISS 0x2
5636/** deauth/disassoc received */
5637#define WMI_HOST_ROAM_REASON_DEAUTH 0x2
5638/** connected AP's low rssi condition detected */
5639#define WMI_HOST_ROAM_REASON_LOW_RSSI 0x3
5640/** found another AP that matches SSID and Security profile in
5641 * WMI_ROAM_AP_PROFILE, found during scan triggered upon FINAL_BMISS
5642 */
5643#define WMI_HOST_ROAM_REASON_SUITABLE_AP 0x4
5644/** LFR3.0 roaming failed, indicate the disconnection to host */
5645#define WMI_HOST_ROAM_REASON_HO_FAILED 0x5
5646
5647/** values for vdev_type */
5648#define WMI_HOST_VDEV_TYPE_AP 0x1
5649#define WMI_HOST_VDEV_TYPE_STA 0x2
5650#define WMI_HOST_VDEV_TYPE_IBSS 0x3
5651#define WMI_HOST_VDEV_TYPE_MONITOR 0x4
5652
5653/** values for vdev_subtype */
5654#define WMI_HOST_VDEV_SUBTYPE_P2P_DEVICE 0x1
5655#define WMI_HOST_VDEV_SUBTYPE_P2P_CLIENT 0x2
5656#define WMI_HOST_VDEV_SUBTYPE_P2P_GO 0x3
5657#define WMI_HOST_VDEV_SUBTYPE_PROXY_STA 0x4
5658#define WMI_HOST_VDEV_SUBTYPE_MESH 0x5
5659
5660#define WMI_HOST_MGMT_TID 17
5661/* Disable aging & learning */
5662#define WMI_HOST_WDS_FLAG_STATIC 0x1
5663
5664/**
5665 * Peer param enum abstracted from target
5666 */
5667typedef enum {
5668 /** mimo powersave state */
5669 WMI_HOST_PEER_MIMO_PS_STATE = 0x1,
5670 /** enable/disable AMPDU . initial value (enabled) */
5671 WMI_HOST_PEER_AMPDU = 0x2,
5672 /** authorize/unauthorize peer. initial value is unauthorized (0) */
5673 WMI_HOST_PEER_AUTHORIZE = 0x3,
5674 /** peer channel bandwidth */
5675 WMI_HOST_PEER_CHWIDTH = 0x4,
5676 /** peer NSS */
5677 WMI_HOST_PEER_NSS = 0x5,
5678 /** USE 4 ADDR */
5679 WMI_HOST_PEER_USE_4ADDR = 0x6,
5680 /** Enable extended peer stats */
5681 WMI_HOST_PEER_EXT_STATS_ENABLE = 0x7,
5682 /*Use FIXED Pwr */
5683 WMI_HOST_PEER_USE_FIXED_PWR = 0x8,
5684 /* Set peer fixed rate */
5685 WMI_HOST_PEER_PARAM_FIXED_RATE = 0x9,
5686 /* Whitelist peer TIDs */
5687 WMI_HOST_PEER_SET_MU_WHITELIST = 0xa,
5688 /* set group membership status */
5689 WMI_HOST_PEER_MEMBERSHIP = 0xb,
5690 WMI_HOST_PEER_USERPOS = 0xc,
5691} PEER_PARAM_ENUM;
5692#define WMI_HOST_PEER_MIMO_PS_NONE 0x0
5693#define WMI_HOST_PEER_MIMO_PS_STATIC 0x1
5694#define WMI_HOST_PEER_MIMO_PS_DYNAMIC 0x2
5695typedef enum {
5696 HOST_PLATFORM_HIGH_PERF,
5697 HOST_PLATFORM_LOW_PERF,
5698} HOST_PLATFORM_TYPE;
5699
5700enum wmi_host_sta_ps_mode {
5701 /** enable power save for the given STA VDEV */
5702 WMI_HOST_STA_PS_MODE_DISABLED = 0,
5703 /** disable power save for a given STA VDEV */
5704 WMI_HOST_STA_PS_MODE_ENABLED = 1,
5705};
5706enum wmi_host_sta_powersave_param {
5707 /**
5708 * Controls how frames are retrievd from AP while STA is sleeping
5709 *
5710 * (see enum wmi_sta_ps_param_rx_wake_policy)
5711 */
5712 WMI_HOST_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5713
5714 /**
5715 * The STA will go active after this many TX
5716 *
5717 * (see enum wmi_sta_ps_param_tx_wake_threshold)
5718 */
5719 WMI_HOST_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5720
5721 /**
5722 * Number of PS-Poll to send before STA wakes up
5723 *
5724 * (see enum wmi_sta_ps_param_pspoll_count)
5725 *
5726 */
5727 WMI_HOST_STA_PS_PARAM_PSPOLL_COUNT = 2,
5728
5729 /**
5730 * TX/RX inactivity time in msec before going to sleep.
5731 *
5732 * The power save SM will monitor tx/rx activity on the VDEV, if no
5733 * activity for the specified msec of the parameter
5734 * the Power save SM will go to sleep.
5735 */
5736 WMI_HOST_STA_PS_PARAM_INACTIVITY_TIME = 3,
5737
5738 /**
5739 * Set uapsd configuration.
5740 *
5741 * (see enum wmi_sta_ps_param_uapsd)
5742 */
5743 WMI_HOST_STA_PS_PARAM_UAPSD = 4,
5744};
5745/* prefix used by scan requestor ids on the host
5746 * replicated here form wmi_unified.h*/
5747#define WMI_HOST_P_SCAN_REQUESTOR_ID_PREFIX 0xA000
5748/* prefix used by scan request ids generated on the host */
5749/* host cycles through the lower 12 bits to generate ids */
5750#define WMI_HOST_P_SCAN_REQ_ID_PREFIX 0xA000
5751
5752#define WMI_HOST_RC_DS_FLAG 0x01 /* Dual stream flag */
5753#define WMI_HOST_RC_CW40_FLAG 0x02 /* CW 40 */
5754#define WMI_HOST_RC_SGI_FLAG 0x04 /* Short Guard Interval */
5755#define WMI_HOST_RC_HT_FLAG 0x08 /* HT */
5756#define WMI_HOST_RC_RTSCTS_FLAG 0x10 /* RTS-CTS */
5757#define WMI_HOST_RC_TX_STBC_FLAG 0x20 /* TX STBC */
5758#define WMI_HOST_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
5759#define WMI_HOST_RC_RX_STBC_FLAG_S 6 /* RX STBC ,2 bits */
5760#define WMI_HOST_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */
5761#define WMI_HOST_RC_TS_FLAG 0x200 /* Three stream flag */
5762#define WMI_HOST_RC_UAPSD_FLAG 0x400 /* UAPSD Rate Control */
5763
5764/** HT Capabilities*/
5765#define WMI_HOST_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
5766/* Short Guard Interval with HT20 */
5767#define WMI_HOST_HT_CAP_HT20_SGI 0x0002
5768#define WMI_HOST_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
5769#define WMI_HOST_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
5770#define WMI_HOST_HT_CAP_TX_STBC_MASK_SHIFT 3
5771#define WMI_HOST_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
5772#define WMI_HOST_HT_CAP_RX_STBC_MASK_SHIFT 4
5773#define WMI_HOST_HT_CAP_LDPC 0x0040 /* LDPC supported */
5774#define WMI_HOST_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
5775#define WMI_HOST_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
5776#define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
5777#define WMI_HOST_HT_CAP_HT40_SGI 0x0800
5778#define WMI_HOST_HT_CAP_IBF_BFER 0x1000
5779
5780/* These macros should be used when we wish to advertise STBC support for
5781 * only 1SS or 2SS or 3SS. */
5782#define WMI_HOST_HT_CAP_RX_STBC_1SS 0x0010 /* B4-B5 RX STBC */
5783#define WMI_HOST_HT_CAP_RX_STBC_2SS 0x0020 /* B4-B5 RX STBC */
5784#define WMI_HOST_HT_CAP_RX_STBC_3SS 0x0030 /* B4-B5 RX STBC */
5785
5786
5787#define WMI_HOST_HT_CAP_DEFAULT_ALL (WMI_HOST_HT_CAP_ENABLED | \
5788 WMI_HOST_HT_CAP_HT20_SGI | \
5789 WMI_HOST_HT_CAP_HT40_SGI | \
5790 WMI_HOST_HT_CAP_TX_STBC | \
5791 WMI_HOST_HT_CAP_RX_STBC | \
5792 WMI_HOST_HT_CAP_LDPC)
5793
5794/* WMI_HOST_VHT_CAP_* these maps to ieee 802.11ac vht capability information
5795 field. The fields not defined here are not supported, or reserved.
5796 Do not change these masks and if you have to add new one follow the
5797 bitmask as specified by 802.11ac draft.
5798*/
5799
5800#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
5801#define WMI_HOST_VHT_CAP_RX_LDPC 0x00000010
5802#define WMI_HOST_VHT_CAP_SGI_80MHZ 0x00000020
5803#define WMI_HOST_VHT_CAP_SGI_160MHZ 0x00000040
5804#define WMI_HOST_VHT_CAP_TX_STBC 0x00000080
5805#define WMI_HOST_VHT_CAP_RX_STBC_MASK 0x00000300
5806#define WMI_HOST_VHT_CAP_RX_STBC_MASK_SHIFT 8
5807#define WMI_HOST_VHT_CAP_SU_BFER 0x00000800
5808#define WMI_HOST_VHT_CAP_SU_BFEE 0x00001000
5809#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
5810#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
5811#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
5812#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
5813#define WMI_HOST_VHT_CAP_MU_BFER 0x00080000
5814#define WMI_HOST_VHT_CAP_MU_BFEE 0x00100000
5815#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
5816#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIT 23
5817#define WMI_HOST_VHT_CAP_RX_FIXED_ANT 0x10000000
5818#define WMI_HOST_VHT_CAP_TX_FIXED_ANT 0x20000000
5819
5820#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
5821
5822/* These macros should be used when we wish to advertise STBC support for
5823 * only 1SS or 2SS or 3SS. */
5824#define WMI_HOST_VHT_CAP_RX_STBC_1SS 0x00000100
5825#define WMI_HOST_VHT_CAP_RX_STBC_2SS 0x00000200
5826#define WMI_HOST_VHT_CAP_RX_STBC_3SS 0x00000300
5827
5828#define WMI_HOST_VHT_CAP_DEFAULT_ALL (WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 | \
5829 WMI_HOST_VHT_CAP_SGI_80MHZ | \
5830 WMI_HOST_VHT_CAP_TX_STBC | \
5831 WMI_HOST_VHT_CAP_RX_STBC_MASK | \
5832 WMI_HOST_VHT_CAP_RX_LDPC | \
5833 WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP | \
5834 WMI_HOST_VHT_CAP_RX_FIXED_ANT | \
5835 WMI_HOST_VHT_CAP_TX_FIXED_ANT)
5836
5837/* Interested readers refer to Rx/Tx MCS Map definition as defined in
5838 802.11ac
5839*/
5840#define WMI_HOST_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
5841#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
5842#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
5843
5844/** U-APSD configuration of peer station from (re)assoc request and TSPECs */
5845enum wmi_host_ap_ps_param_uapsd {
5846 WMI_HOST_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5847 WMI_HOST_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5848 WMI_HOST_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5849 WMI_HOST_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5850 WMI_HOST_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5851 WMI_HOST_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5852 WMI_HOST_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5853 WMI_HOST_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5854};
5855/** U-APSD maximum service period of peer station */
5856enum wmi_host_ap_ps_peer_param_max_sp {
5857 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
5858 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
5859 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
5860 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
5861
5862 /* keep last! */
5863 MAX_HOST_WMI_AP_PS_PEER_PARAM_MAX_SP,
5864};
5865
5866#define WMI_HOST_UAPSD_AC_TYPE_DELI 0
5867#define WMI_HOST_UAPSD_AC_TYPE_TRIG 1
5868
5869#define WMI_HOST_UAPSD_AC_BIT_MASK(ac, type) \
5870 ((type == WMI_HOST_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) :\
5871 (1<<((ac<<1)+1)))
5872
5873enum wmi_host_ap_ps_peer_param_wnm_sleep {
5874 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_ENABLE,
5875 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_DISABLE,
5876};
5877
5878enum wmi_host_ap_ps_peer_param {
5879 /** Set uapsd configuration for a given peer.
5880 *
5881 * This will include the delivery and trigger enabled state for every AC.
5882 * The host MLME needs to set this based on AP capability and stations
5883 * request Set in the association request received from the station.
5884 *
5885 * Lower 8 bits of the value specify the UAPSD configuration.
5886 *
5887 * (see enum wmi_ap_ps_param_uapsd)
5888 * The default value is 0.
5889 */
5890 WMI_HOST_AP_PS_PEER_PARAM_UAPSD = 0,
5891
5892 /**
5893 * Set the service period for a UAPSD capable station
5894 *
5895 * The service period from wme ie in the (re)assoc request frame.
5896 *
5897 * (see enum wmi_ap_ps_peer_param_max_sp)
5898 */
5899 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP = 1,
5900
5901 /** Time in seconds for aging out buffered frames
5902 * for STA in power save */
5903 WMI_HOST_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
5904
5905 /** Specify frame types that are considered SIFS
5906 * RESP trigger frame */
5907 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_FRMTYPE = 3,
5908
5909 /** Specifies the trigger state of TID.
5910 * Valid only for UAPSD frame type */
5911 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_UAPSD = 4,
5912
5913 /** Specifies the WNM sleep state of a STA */
5914 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP = 5,
5915};
5916#define WMI_HOST_RXERR_CRC 0x01 /* CRC error on frame */
5917#define WMI_HOST_RXERR_DECRYPT 0x08 /* non-Michael decrypt error */
5918#define WMI_HOST_RXERR_MIC 0x10 /* Michael MIC decrypt error */
5919#define WMI_HOST_RXERR_KEY_CACHE_MISS 0x20 /* No/incorrect key matter in h/w */
5920
5921enum wmi_host_sta_ps_param_uapsd {
5922 WMI_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5923 WMI_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5924 WMI_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5925 WMI_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5926 WMI_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5927 WMI_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5928 WMI_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5929 WMI_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5930};
5931
5932enum wmi_host_sta_ps_param_rx_wake_policy {
5933 /* Wake up when ever there is an RX activity on the VDEV. In this mode
5934 * the Power save SM(state machine) will come out of sleep by either
5935 * sending null frame (or) a data frame (with PS==0) in response to TIM
5936 * bit set in the received beacon frame from AP.
5937 */
5938 WMI_HOST_STA_PS_RX_WAKE_POLICY_WAKE = 0,
5939
5940 /* Here the power save state machine will not wakeup in response to TIM
5941 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
5942 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
5943 * access categories are delivery-enabled, the station will send a UAPSD
5944 * trigger frame, otherwise it will send a PS-Poll.
5945 */
5946 WMI_HOST_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
5947};
5948enum wmi_host_sta_ps_param_pspoll_count {
5949 WMI_HOST_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
5950 /* Values greater than 0 indicate the maximum numer of PS-Poll frames FW
5951 * will send before waking up.
5952 */
5953};
5954/** Number of tx frames/beacon that cause the power save SM to wake up.
5955 *
5956 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
5957 * meaning, It will cause the SM to never wake up. This is useful if you want
5958 * to keep the system to sleep all the time for some kind of test mode . host
5959 * can change this parameter any time. It will affect at the next tx frame.
5960 */
5961enum wmi_host_sta_ps_param_tx_wake_threshold {
5962 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
5963 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
5964
5965 /* Values greater than one indicate that many TX attempts per beacon
5966 * interval before the STA will wake up
5967 */
5968};
5969/*
5970 * Transmit power scale factor.
5971 *
5972 */
5973typedef enum {
5974 WMI_HOST_TP_SCALE_MAX = 0, /* no scaling (default) */
5975 WMI_HOST_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
5976 WMI_HOST_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
5977 WMI_HOST_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
5978 WMI_HOST_TP_SCALE_MIN = 4, /* min, but still on */
5979 WMI_HOST_TP_SCALE_SIZE = 5, /* max num of enum */
5980} WMI_HOST_TP_SCALE;
5981enum {
5982 WMI_HOST_RATEPWR_TABLE_OPS_SET,
5983 WMI_HOST_RATEPWR_TABLE_OPS_GET,
5984};
5985/* reserved up through 0xF */
5986/**
5987 * struct wmi_host_dcs_mib_stats - WLAN IM stats from target to host
5988 * Below statistics are sent from target to host periodically.
5989 * These are collected at target as long as target is running
5990 * and target chip is not in sleep.
5991 * @listen_time:
5992 * @reg_tx_frame_cnt:
5993 * @reg_rx_frame_cnt:
5994 * @reg_rxclr_cnt:
5995 * @reg_cycle_cnt: delta cycle count
5996 * @reg_rxclr_ext_cnt:
5997 * @reg_ofdm_phyerr_cnt:
5998 * @reg_cck_phyerr_cnt: CCK err count since last reset, read from register
5999 */
6000typedef struct _hp_dcs_mib_stats {
6001 int32_t listen_time;
6002 uint32_t reg_tx_frame_cnt;
6003 uint32_t reg_rx_frame_cnt;
6004 uint32_t reg_rxclr_cnt;
6005 uint32_t reg_cycle_cnt;
6006 uint32_t reg_rxclr_ext_cnt;
6007 uint32_t reg_ofdm_phyerr_cnt;
6008 uint32_t reg_cck_phyerr_cnt;
6009} wmi_host_dcs_mib_stats_t;
6010
6011/**
6012 * struct wmi_host_dcs_im_tgt_stats - DCS IM target stats
6013 * @reg_tsf32: current running TSF from the TSF-1
6014 * @last_ack_rssi: Known last frame rssi, in case of multiple stations, if
6015 * and at different ranges, this would not gaurantee that
6016 * this is the least rssi.
6017 * @tx_waste_time: Sum of all the failed durations in the last
6018 * one second interval.
6019 * @rx_time: count how many times the hal_rxerr_phy is marked, in this
6020 * time period
6021 * @phyerr_cnt:
6022 * @mib_stats: wmi_host_dcs_mib_stats_t - collected mib stats as explained
6023 * in mib structure
6024 */
6025typedef struct _wmi_host_dcs_im_tgt_stats {
6026 uint32_t reg_tsf32;
6027 uint32_t last_ack_rssi;
6028 uint32_t tx_waste_time;
6029 uint32_t rx_time;
6030 uint32_t phyerr_cnt;
6031 wmi_host_dcs_mib_stats_t mib_stats;
6032} wmi_host_dcs_im_tgt_stats_t;
6033
6034/**
6035 * Enum for pktlog req
6036 */
6037typedef enum {
6038 WMI_HOST_PKTLOG_EVENT_RX = 0x1,
6039 WMI_HOST_PKTLOG_EVENT_TX = 0x2,
6040 WMI_HOST_PKTLOG_EVENT_RCF = 0x4, /* Rate Control Find */
6041 WMI_HOST_PKTLOG_EVENT_RCU = 0x8, /* Rate Control Update */
6042 WMI_HOST_PKTLOG_EVENT_DBG_PRINT = 0x10, /* DEBUG prints */
6043 /* To support Smart Antenna */
6044 WMI_HOST_PKTLOG_EVENT_SMART_ANTENNA = 0x20,
6045 WMI_HOST_PKTLOG_EVENT_H_INFO = 0x40,
6046 WMI_HOST_PKTLOG_EVENT_STEERING = 0x80,
6047} WMI_HOST_PKTLOG_EVENT;
6048
6049/**
6050 * wmi_host_phyerr
6051 *
6052 */
6053#define WMI_HOST_PHY_ERROR_SPECTRAL_SCAN 0x26
6054#define WMI_HOST_PHY_ERROR_FALSE_RADAR_EXT 0x24
6055
6056#define WMI_HOST_AR900B_DFS_PHYERR_MASK 0x4
6057#define WMI_HOST_AR900B_SPECTRAL_PHYERR_MASK 0x4000000
6058
6059/**
6060 * struct wmi_host_perchain_rssi_info - per chain RSSI info
6061 * @rssi_pri20: RSSI on primary 20
6062 * @rssi_sec20: RSSI on secomdary 20
6063 * @rssi_sec40: RSSI secondary 40
6064 * @rssi_sec80: RSSI secondary 80
6065 */
6066typedef struct wmi_host_perchain_rssi_info {
6067 int8_t rssi_pri20;
6068 int8_t rssi_sec20;
6069 int8_t rssi_sec40;
6070 int8_t rssi_sec80;
6071} wmi_host_perchain_rssi_info_t;
6072
6073/**
6074 * struct _wmi_host_rf_info - RF measurement information
6075 * @rssi_comb: RSSI Information
6076 * @pc_rssi_info[4]: For now, we know we are getting information
6077 * for only 4 chains at max. For future extensions
6078 * use a define
6079 * @noise_floor: Noise floor information
6080 */
6081typedef struct _wmi_host_rf_info {
6082 int8_t rssi_comb;
6083 wmi_host_perchain_rssi_info_t pc_rssi_info[4];
6084 int16_t noise_floor[4];
6085} wmi_host_rf_info_t;
6086
6087/**
6088 * struct _wmi_host_chan_info
6089 * @center_freq1: center frequency 1 in MHz
6090 * @center_freq2: center frequency 2 in MHz -valid only for
6091 * 11ACVHT 80PLUS80 mode
6092 * @chan_width: channel width in MHz
6093 */
6094typedef struct _wmi_host_chan_info {
6095 u_int16_t center_freq1;
6096 u_int16_t center_freq2;
6097 u_int8_t chan_width;
6098} wmi_host_chan_info_t;
6099
6100/**
6101 * struct wmi_host_phyerr
6102 * @rf_info:
6103 * @chan_info:
6104 * @tsf64:
6105 * @phy_err_code:
6106 * @tsf_timestamp:
6107 * @bufp:
6108 * @buf_len:
6109 * @phy_err_mask0:
6110 * @phy_err_mask1:
6111 */
6112typedef struct _wmi_host_phyerr {
6113 wmi_host_rf_info_t rf_info;
6114 wmi_host_chan_info_t chan_info;
6115 uint64_t tsf64;
6116 int32_t phy_err_code;
6117 uint32_t tsf_timestamp;
6118 uint8_t *bufp;
6119 uint32_t buf_len;
6120 uint32_t phy_err_mask0;
6121 uint32_t phy_err_mask1;
6122} wmi_host_phyerr_t;
6123
6124/**
6125 * struct wmi_host_rtt_event_hdr
6126 * @req_id: request id
6127 * @status: status
6128 * @meas_done: measurement done flag
6129 * @meas_type: measurement type
6130 * @report_type: report type
6131 * @v3_status: v2 status
6132 * @v3_finish:
6133 * @v3_tm_start:
6134 * @num_ap: number of AP
6135 * @result: resuult
6136 * @dest_mac: destination mac
6137 */
6138typedef struct {
6139 uint16_t req_id;
6140 uint16_t status:1,
6141 meas_done:1,
6142 meas_type:3,
6143 report_type:3,
6144 v3_status:2,
6145 v3_finish:1,
6146 v3_tm_start:1,
6147 num_ap:4;
6148 uint16_t result;
6149 uint8_t dest_mac[IEEE80211_ADDR_LEN];
6150} wmi_host_rtt_event_hdr;
6151
6152/**
6153 * struct wmi_host_rtt_meas_event - RTT measurement event
6154 * @chain_mask:
6155 * @bw:
6156 * @rsvd:
6157 * @txrxchain_mask: Bit:0-3:chain mask
6158 * Bit 4-5: band width info
6159 * 00 --Legacy 20, 01 --HT/VHT20
6160 * 10 --HT/VHT40, 11 -- VHT80
6161 * @tod: resolution of 0.1ns
6162 * @toa: resolution of 0.1ns
6163 * @t3:
6164 * @t4:
6165 * @rssi0:
6166 * @rssi1:
6167 * @rssi2:
6168 * @rssi3:
6169 */
6170typedef struct {
6171 uint32_t chain_mask:3,
6172 bw:2,
6173 rsvd:27;
6174 uint32_t txrxchain_mask;
6175 uint64_t tod;
6176 uint64_t toa;
6177 uint64_t t3;
6178 uint64_t t4;
6179 uint32_t rssi0;
6180 uint32_t rssi1;
6181 uint32_t rssi2;
6182 uint32_t rssi3;
6183} wmi_host_rtt_meas_event;
6184
6185/*----RTT Report event definition ----*/
6186typedef enum {
6187 /* rtt cmd header parsing error --terminate */
6188 WMI_HOST_RTT_COMMAND_HEADER_ERROR = 0,
6189 /* rtt body parsing error -- skip current STA REQ */
6190 WMI_HOST_RTT_COMMAND_ERROR,
6191 /* rtt no resource -- terminate */
6192 WMI_HOST_RTT_MODULE_BUSY,
6193 /* STA exceed the support limit -- only server the first n STA */
6194 WMI_HOST_RTT_TOO_MANY_STA,
6195 /* any allocate failure */
6196 WMI_HOST_RTT_NO_RESOURCE,
6197 /* can not find vdev with vdev ID - skip current STA REQ */
6198 WMI_HOST_RTT_VDEV_ERROR,
6199 /* Tx failure -- continiue and measure number */
6200 WMI_HOST_RTT_TRANSIMISSION_ERROR,
6201 /* wait for first TM timer expire-terminate current STA measurement */
6202 WMI_HOST_RTT_TM_TIMER_EXPIRE,
6203 /* we do not support RTT measurement with this type of frame */
6204 WMI_HOST_RTT_FRAME_TYPE_NOSUPPORT,
6205 /* whole RTT measurement timer expire-terminate
6206 ** current STA measurement */
6207 WMI_HOST_RTT_TIMER_EXPIRE,
6208 /* channel swicth failed */
6209 WMI_HOST_RTT_CHAN_SWITCH_ERROR,
6210 /* TMR trans error, this dest peer will be skipped */
6211 WMI_HOST_RTT_TMR_TRANS_ERROR,
6212 /* V3 only. If both CFR and Token mismatch, do not report */
6213 WMI_HOST_RTT_NO_REPORT_BAD_CFR_TOKEN,
6214 /* For First TM, if CFR is bad, then do not report */
6215 WMI_HOST_RTT_NO_REPORT_FIRST_TM_BAD_CFR,
6216 /* do not allow report type2 mix with type 0, 1 */
6217 WMI_HOST_RTT_REPORT_TYPE2_MIX,
6218 /* LCI Configuration OK. - Responder only */
6219 WMI_HOST_RTT_LCI_CFG_OK,
6220 /* LCR configuration OK. - Responder only */
6221 WMI_HOST_RTT_LCR_CFG_OK,
6222 /* Bad configuration LCI (or) LCR request - Responder only */
6223 WMI_HOST_RTT_CFG_ERROR,
6224 WMI_HOST_WMI_RTT_REJECT_MAX,
6225} WMI_HOST_RTT_ERROR_INDICATOR;
6226typedef struct {
6227 wmi_host_rtt_event_hdr hdr;
6228 WMI_HOST_RTT_ERROR_INDICATOR reject_reason;
6229} wmi_host_rtt_error_report_event;
6230
6231#if defined(AR9888)
6232typedef enum {
6233 WMI_HOST_PROF_CPU_IDLE,
6234 WMI_HOST_PROF_PPDU_PROC,
6235 WMI_HOST_PROF_PPDU_POST,
6236 WMI_HOST_PROF_HTT_TX_INPUT,
6237 WMI_HOST_PROF_MSDU_ENQ,
6238 WMI_HOST_PROF_PPDU_POST_HAL,
6239 WMI_HOST_PROF_COMPUTE_TX_TIME,
6240
6241 /* Add new ID's above this. */
6242 WMI_HOST_PROF_MAX_ID,
6243} wmi_host_profile_id_t;
6244#endif
6245
6246#define WMI_HOST_WLAN_PROFILE_MAX_HIST 3
6247#define WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT 32
6248
6249#if defined(AR9888)
6250#define WMI_HOST_MAX_PROFILE WMI_HOST_PROF_MAX_ID
6251#else
6252#define WMI_HOST_MAX_PROFILE WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT
6253#endif
6254
6255/**
6256 * struct wmi_host_wlan_profile - Host profile param
6257 * @id: profile id
6258 * @cnt: Count
6259 * @tot:
6260 * @min: minimum
6261 * @max: Mac
6262 * @hist_intvl: history interval
6263 * @hist: profile data history
6264 */
6265typedef struct {
6266 uint32_t id;
6267 uint32_t cnt;
6268 uint32_t tot;
6269 uint32_t min;
6270 uint32_t max;
6271 uint32_t hist_intvl;
6272 uint32_t hist[WMI_HOST_WLAN_PROFILE_MAX_HIST];
6273} wmi_host_wlan_profile_t;
6274
6275/**
6276 * struct wmi_host_wlan_profile_ctx_t - profile context
6277 * @tot: time in us
6278 * @tx_msdu_cnt: MSDU TX count
6279 * @tx_mpdu_cnt: MPDU tx count
6280 * @tx_ppdu_cnt: PPDU tx count
6281 * @rx_msdu_cnt: MSDU RX count
6282 * @rx_mpdu_cnt: MPDU RXcount
6283 * @bin_count: Bin count
6284 */
6285typedef struct {
6286 uint32_t tot;
6287 uint32_t tx_msdu_cnt;
6288 uint32_t tx_mpdu_cnt;
6289 uint32_t tx_ppdu_cnt;
6290 uint32_t rx_msdu_cnt;
6291 uint32_t rx_mpdu_cnt;
6292 uint32_t bin_count;
6293} wmi_host_wlan_profile_ctx_t;
6294
6295/**
Govind Singh89727882016-04-15 13:58:27 +05306296 * struct wmi_host_chan_info_event - Channel info WMI event
6297 * @err_code: Error code
6298 * @freq: Channel freq
6299 * @cmd_flags: Read flags
6300 * @noise_floor: Noise Floor value
6301 * @rx_clear_count: rx clear count
6302 * @cycle_count: cycle count
6303 * @chan_tx_pwr_range: channel tx power per range
6304 * @chan_tx_pwr_tp: channel tx power per throughput
6305 * @rx_frame_count: rx frame count
6306 * @rx_11b_mode_data_duration: 11b mode data duration
6307 */
6308typedef struct {
6309 uint32_t err_code;
6310 uint32_t freq;
6311 uint32_t cmd_flags;
6312 uint32_t noise_floor;
6313 uint32_t rx_clear_count;
6314 uint32_t cycle_count;
6315 uint32_t chan_tx_pwr_range;
6316 uint32_t chan_tx_pwr_tp;
6317 uint32_t rx_frame_count;
6318 uint32_t rx_11b_mode_data_duration;
6319} wmi_host_chan_info_event;
6320
6321/**
6322 * struct wmi_host_pdev_channel_hopping_event
6323 * @noise_floor_report_iter: Noise threshold iterations with high values
6324 * @noise_floor_total_iter: Total noise threshold iterations
6325 */
6326typedef struct {
6327 uint32_t noise_floor_report_iter;
6328 uint32_t noise_floor_total_iter;
6329} wmi_host_pdev_channel_hopping_event;
6330
6331/**
6332 * struct wmi_host_pdev_bss_chan_info_event
6333 * @freq: Units in MHz
6334 * @noise_floor: units are dBm
6335 * @rx_clear_count_low:
6336 * @rx_clear_count_high:
6337 * @cycle_count_low:
6338 * @cycle_count_high:
6339 * @tx_cycle_count_low:
6340 * @tx_cycle_count_high:
6341 * @rx_cycle_count_low:
6342 * @rx_cycle_count_high:
6343 * @rx_bss_cycle_count_low:
6344 * @rx_bss_cycle_count_high:
6345 * @reserved:
6346 */
6347typedef struct {
6348 uint32_t freq;
6349 uint32_t noise_floor;
6350 uint32_t rx_clear_count_low;
6351 uint32_t rx_clear_count_high;
6352 uint32_t cycle_count_low;
6353 uint32_t cycle_count_high;
6354 uint32_t tx_cycle_count_low;
6355 uint32_t tx_cycle_count_high;
6356 uint32_t rx_cycle_count_low;
6357 uint32_t rx_cycle_count_high;
6358 uint32_t rx_bss_cycle_count_low;
6359 uint32_t rx_bss_cycle_count_high;
6360 uint32_t reserved;
6361} wmi_host_pdev_bss_chan_info_event;
6362
6363#define WMI_HOST_INST_STATS_INVALID_RSSI 0
6364/**
6365 * struct wmi_host_inst_stats_resp
6366 * @iRSSI: Instantaneous RSSI
6367 * @peer_macaddr: peer mac address
6368 */
6369typedef struct {
6370 uint32_t iRSSI;
6371 wmi_host_mac_addr peer_macaddr;
6372} wmi_host_inst_stats_resp;
6373
6374/* Event definition and new structure addition to send event
6375 * to host to block/unblock tx data traffic based on peer_ast_idx or vdev id
6376 */
6377#define WMI_HOST_INVALID_PEER_AST_INDEX 0xffff
6378#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_BLOCK 0x1
6379#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_UNBLOCK 0x2
6380/**
6381 * struct wmi_host_tx_data_traffic_ctrl_event
6382 * @peer_ast_idx: For vdev based control, peer_ast_idx will be
6383 * WMI_INVALID_PEER_AST_INDEX
6384 * @vdev_id: only applies if peer_ast_idx == INVALID
6385 * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
6386 * WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
6387 */
6388typedef struct {
6389 uint32_t peer_ast_idx;
6390 uint32_t vdev_id;
6391 uint32_t ctrl_cmd;
6392} wmi_host_tx_data_traffic_ctrl_event;
6393
6394/**
6395 * struct wmi_host_ath_dcs_cw_int
6396 * @channel: either number or freq in mhz
6397 */
6398typedef struct {
6399 uint32_t channel;
6400} wmi_host_ath_dcs_cw_int;
Govind Singhc10bde82016-05-02 17:59:24 +05306401
6402#define WMI_MAX_POWER_DBG_ARGS 8
6403
6404/**
6405 * struct wmi_power_dbg_params - power debug command parameter
6406 * @pdev_id: subsystem identifier
6407 * @module_id: parameter id
6408 * @num_arg: no of arguments
6409 * @args: arguments
6410 */
6411struct wmi_power_dbg_params {
6412 uint32_t pdev_id;
6413 uint32_t module_id;
6414 uint32_t num_args;
6415 uint32_t args[WMI_MAX_POWER_DBG_ARGS];
6416};
6417
Gupta, Kapil7b768002016-04-25 19:14:19 +05306418/**
6419 * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
6420 * @vdev_id: vdev id
6421 * @is_enabled: Adaptive dwell time is enabled/disabled
6422 * @dwelltime_mode: global default adaptive dwell mode
6423 * @lpf_weight: weight to calculate the average low pass
6424 * filter for channel congestion
6425 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
6426 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
6427 *
6428 */
6429struct wmi_adaptive_dwelltime_params {
6430 uint32_t vdev_id;
6431 bool is_enabled;
6432 enum wmi_dwelltime_adaptive_mode dwelltime_mode;
6433 uint8_t lpf_weight;
6434 uint8_t passive_mon_intval;
6435 uint8_t wifi_act_threshold;
6436};
Govind Singhc7cd2d62016-06-21 14:33:26 +05306437
6438/**
6439 * struct wmi_fw_dump_seg_req - individual segment details
6440 * @seg_id - segment id.
6441 * @seg_start_addr_lo - lower address of the segment.
6442 * @seg_start_addr_hi - higher address of the segment.
6443 * @seg_length - length of the segment.
6444 * @dst_addr_lo - lower address of the destination buffer.
6445 * @dst_addr_hi - higher address of the destination buffer.
6446 *
6447 * This structure carries the information to firmware about the
6448 * individual segments. This structure is part of firmware memory
6449 * dump request.
6450 */
6451struct wmi_fw_dump_seg_req {
6452 uint8_t seg_id;
6453 uint32_t seg_start_addr_lo;
6454 uint32_t seg_start_addr_hi;
6455 uint32_t seg_length;
6456 uint32_t dst_addr_lo;
6457 uint32_t dst_addr_hi;
6458};
6459
6460/**
6461 * enum wmi_userspace_log_level - Log level at userspace
6462 * @WMI_LOG_LEVEL_NO_COLLECTION: verbose_level 0 corresponds to no collection
6463 * @WMI_LOG_LEVEL_NORMAL_COLLECT: verbose_level 1 correspond to normal log
6464 * level with minimal user impact. This is the default value.
6465 * @WMI_LOG_LEVEL_ISSUE_REPRO: verbose_level 2 are enabled when user is lazily
6466 * trying to reproduce a problem, wifi performances and power can be impacted
6467 * but device should not otherwise be significantly impacted
6468 * @WMI_LOG_LEVEL_ACTIVE: verbose_level 3+ are used when trying to
6469 * actively debug a problem
6470 *
6471 * Various log levels defined in the userspace for logging applications
6472 */
6473enum wmi_userspace_log_level {
6474 WMI_LOG_LEVEL_NO_COLLECTION,
6475 WMI_LOG_LEVEL_NORMAL_COLLECT,
6476 WMI_LOG_LEVEL_ISSUE_REPRO,
6477 WMI_LOG_LEVEL_ACTIVE,
6478};
6479
Govind Singh3ddda1f2016-03-09 11:34:12 +05306480#endif /* _WMI_UNIFIED_PARAM_H_ */
6481