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