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