blob: c8fc45d8090ea1ab9f9d330ba92da871e3c41504 [file] [log] [blame]
Kalle Valo5e3dd152013-06-12 20:52:10 +03001/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
Kalle Valo8b1083d2017-12-22 18:31:13 +02003 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +02004 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
Kalle Valo5e3dd152013-06-12 20:52:10 +03005 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef _WMI_H_
20#define _WMI_H_
21
22#include <linux/types.h>
23#include <net/mac80211.h>
24
25/*
26 * This file specifies the WMI interface for the Unified Software
27 * Architecture.
28 *
29 * It includes definitions of all the commands and events. Commands are
30 * messages from the host to the target. Events and Replies are messages
31 * from the target to the host.
32 *
33 * Ownership of correctness in regards to WMI commands belongs to the host
34 * driver and the target is not required to validate parameters for value,
35 * proper range, or any other checking.
36 *
37 * Guidelines for extending this interface are below.
38 *
39 * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
40 *
41 * 2. Use ONLY u32 type for defining member variables within WMI
42 * command/event structures. Do not use u8, u16, bool or
43 * enum types within these structures.
44 *
45 * 3. DO NOT define bit fields within structures. Implement bit fields
46 * using masks if necessary. Do not use the programming language's bit
47 * field definition.
48 *
49 * 4. Define macros for encode/decode of u8, u16 fields within
50 * the u32 variables. Use these macros for set/get of these fields.
51 * Try to use this to optimize the structure without bloating it with
52 * u32 variables for every lower sized field.
53 *
54 * 5. Do not use PACK/UNPACK attributes for the structures as each member
55 * variable is already 4-byte aligned by virtue of being a u32
56 * type.
57 *
58 * 6. Comment each parameter part of the WMI command/event structure by
Joe Perchese13dbea2016-09-26 21:56:21 +030059 * using the 2 stars at the beginning of C comment instead of one star to
Kalle Valo5e3dd152013-06-12 20:52:10 +030060 * enable HTML document generation using Doxygen.
61 *
62 */
63
64/* Control Path */
65struct wmi_cmd_hdr {
66 __le32 cmd_id;
67} __packed;
68
69#define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
70#define WMI_CMD_HDR_CMD_ID_LSB 0
71#define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
72#define WMI_CMD_HDR_PLT_PRIV_LSB 24
73
74#define HTC_PROTOCOL_VERSION 0x0002
75#define WMI_PROTOCOL_VERSION 0x0002
76
Kalle Valo3b8fc902015-10-05 17:56:37 +030077/*
78 * There is no signed version of __le32, so for a temporary solution come
Amadeusz Sławiński6d219112017-02-13 12:38:39 +020079 * up with our own version. The idea is from fs/ntfs/endian.h.
Kalle Valo3b8fc902015-10-05 17:56:37 +030080 *
81 * Use a_ prefix so that it doesn't conflict if we get proper support to
82 * linux/types.h.
83 */
84typedef __s32 __bitwise a_sle32;
85
86static inline a_sle32 a_cpu_to_sle32(s32 val)
87{
88 return (__force a_sle32)cpu_to_le32(val);
89}
90
91static inline s32 a_sle32_to_cpu(a_sle32 val)
92{
93 return le32_to_cpu((__force __le32)val);
94}
95
Michal Kaziorcff990c2014-08-04 09:18:33 +030096enum wmi_service {
97 WMI_SERVICE_BEACON_OFFLOAD = 0,
98 WMI_SERVICE_SCAN_OFFLOAD,
99 WMI_SERVICE_ROAM_OFFLOAD,
100 WMI_SERVICE_BCN_MISS_OFFLOAD,
101 WMI_SERVICE_STA_PWRSAVE,
102 WMI_SERVICE_STA_ADVANCED_PWRSAVE,
103 WMI_SERVICE_AP_UAPSD,
104 WMI_SERVICE_AP_DFS,
105 WMI_SERVICE_11AC,
106 WMI_SERVICE_BLOCKACK,
107 WMI_SERVICE_PHYERR,
108 WMI_SERVICE_BCN_FILTER,
109 WMI_SERVICE_RTT,
110 WMI_SERVICE_RATECTRL,
111 WMI_SERVICE_WOW,
112 WMI_SERVICE_RATECTRL_CACHE,
113 WMI_SERVICE_IRAM_TIDS,
114 WMI_SERVICE_ARPNS_OFFLOAD,
115 WMI_SERVICE_NLO,
116 WMI_SERVICE_GTK_OFFLOAD,
117 WMI_SERVICE_SCAN_SCH,
118 WMI_SERVICE_CSA_OFFLOAD,
119 WMI_SERVICE_CHATTER,
120 WMI_SERVICE_COEX_FREQAVOID,
121 WMI_SERVICE_PACKET_POWER_SAVE,
122 WMI_SERVICE_FORCE_FW_HANG,
123 WMI_SERVICE_GPIO,
124 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
125 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
126 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
127 WMI_SERVICE_STA_KEEP_ALIVE,
128 WMI_SERVICE_TX_ENCAP,
129 WMI_SERVICE_BURST,
130 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
131 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kaziorca996ec2014-12-03 10:11:32 +0200132 WMI_SERVICE_ROAM_SCAN_OFFLOAD,
133 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
134 WMI_SERVICE_EARLY_RX,
135 WMI_SERVICE_STA_SMPS,
136 WMI_SERVICE_FWTEST,
137 WMI_SERVICE_STA_WMMAC,
138 WMI_SERVICE_TDLS,
139 WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
140 WMI_SERVICE_ADAPTIVE_OCS,
141 WMI_SERVICE_BA_SSN_SUPPORT,
142 WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
143 WMI_SERVICE_WLAN_HB,
144 WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
145 WMI_SERVICE_BATCH_SCAN,
146 WMI_SERVICE_QPOWER,
147 WMI_SERVICE_PLMREQ,
148 WMI_SERVICE_THERMAL_MGMT,
149 WMI_SERVICE_RMC,
150 WMI_SERVICE_MHF_OFFLOAD,
151 WMI_SERVICE_COEX_SAR,
152 WMI_SERVICE_BCN_TXRATE_OVERRIDE,
153 WMI_SERVICE_NAN,
154 WMI_SERVICE_L1SS_STAT,
155 WMI_SERVICE_ESTIMATE_LINKSPEED,
156 WMI_SERVICE_OBSS_SCAN,
157 WMI_SERVICE_TDLS_OFFCHAN,
158 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
159 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
160 WMI_SERVICE_IBSS_PWRSAVE,
161 WMI_SERVICE_LPASS,
162 WMI_SERVICE_EXTSCAN,
163 WMI_SERVICE_D0WOW,
164 WMI_SERVICE_HSOFFLOAD,
165 WMI_SERVICE_ROAM_HO_OFFLOAD,
166 WMI_SERVICE_RX_FULL_REORDER,
167 WMI_SERVICE_DHCP_OFFLOAD,
168 WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
169 WMI_SERVICE_MDNS_OFFLOAD,
170 WMI_SERVICE_SAP_AUTH_OFFLOAD,
Yanbo Li52c22a62015-04-15 15:28:07 +0300171 WMI_SERVICE_ATF,
Yanbo Lide0c789b2015-04-15 15:28:08 +0300172 WMI_SERVICE_COEX_GPIO,
Raja Mani840357c2015-06-22 20:10:10 +0530173 WMI_SERVICE_ENHANCED_PROXY_STA,
174 WMI_SERVICE_TT,
175 WMI_SERVICE_PEER_CACHING,
176 WMI_SERVICE_AUX_SPECTRAL_INTF,
177 WMI_SERVICE_AUX_CHAN_LOAD_INTF,
178 WMI_SERVICE_BSS_CHANNEL_INFO_64,
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530179 WMI_SERVICE_EXT_RES_CFG_SUPPORT,
Peter Oh0b3d76e2016-01-28 13:54:07 -0800180 WMI_SERVICE_MESH_11S,
181 WMI_SERVICE_MESH_NON_11S,
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +0530182 WMI_SERVICE_PEER_STATS,
Peter Ohe70e9ba2016-01-28 13:54:08 -0800183 WMI_SERVICE_RESTRT_CHNL_SUPPORT,
Tamizh chelvam64ed57712016-08-02 16:13:14 +0530184 WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
Raja Mani7e247a92016-04-12 20:15:53 +0530185 WMI_SERVICE_TX_MODE_PUSH_ONLY,
186 WMI_SERVICE_TX_MODE_PUSH_PULL,
187 WMI_SERVICE_TX_MODE_DYNAMIC,
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +0300188 WMI_SERVICE_VDEV_RX_FILTER,
189 WMI_SERVICE_BTCOEX,
190 WMI_SERVICE_CHECK_CAL_VERSION,
191 WMI_SERVICE_DBGLOG_WARN2,
192 WMI_SERVICE_BTCOEX_DUTY_CYCLE,
193 WMI_SERVICE_4_WIRE_COEX_SUPPORT,
194 WMI_SERVICE_EXTENDED_NSS_SUPPORT,
195 WMI_SERVICE_PROG_GPIO_BAND_SELECT,
196 WMI_SERVICE_SMART_LOGGING_SUPPORT,
197 WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
198 WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
Rakesh Pillai229329f2017-12-11 19:52:52 +0530199 WMI_SERVICE_MGMT_TX_WMI,
Balaji Pothunoori14d65772017-12-21 20:00:42 +0530200 WMI_SERVICE_TDLS_WIDER_BANDWIDTH,
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +0200201 WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
202 WMI_SERVICE_HOST_DFS_CHECK_SUPPORT,
203 WMI_SERVICE_TPC_STATS_FINAL,
Michal Kaziorc4f8c832014-09-04 10:18:32 +0200204
205 /* keep last */
206 WMI_SERVICE_MAX,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300207};
Kalle Valo5e3dd152013-06-12 20:52:10 +0300208
Michal Kaziorcff990c2014-08-04 09:18:33 +0300209enum wmi_10x_service {
210 WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
211 WMI_10X_SERVICE_SCAN_OFFLOAD,
212 WMI_10X_SERVICE_ROAM_OFFLOAD,
213 WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
214 WMI_10X_SERVICE_STA_PWRSAVE,
215 WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
216 WMI_10X_SERVICE_AP_UAPSD,
217 WMI_10X_SERVICE_AP_DFS,
218 WMI_10X_SERVICE_11AC,
219 WMI_10X_SERVICE_BLOCKACK,
220 WMI_10X_SERVICE_PHYERR,
221 WMI_10X_SERVICE_BCN_FILTER,
222 WMI_10X_SERVICE_RTT,
223 WMI_10X_SERVICE_RATECTRL,
224 WMI_10X_SERVICE_WOW,
225 WMI_10X_SERVICE_RATECTRL_CACHE,
226 WMI_10X_SERVICE_IRAM_TIDS,
227 WMI_10X_SERVICE_BURST,
228
229 /* introduced in 10.2 */
230 WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
231 WMI_10X_SERVICE_FORCE_FW_HANG,
232 WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Yanbo Li52c22a62015-04-15 15:28:07 +0300233 WMI_10X_SERVICE_ATF,
Yanbo Lide0c789b2015-04-15 15:28:08 +0300234 WMI_10X_SERVICE_COEX_GPIO,
Peter Oh20fa2f72015-11-24 09:37:33 -0800235 WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
236 WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
237 WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
238 WMI_10X_SERVICE_MESH,
239 WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +0530240 WMI_10X_SERVICE_PEER_STATS,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300241};
242
243enum wmi_main_service {
244 WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
245 WMI_MAIN_SERVICE_SCAN_OFFLOAD,
246 WMI_MAIN_SERVICE_ROAM_OFFLOAD,
247 WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
248 WMI_MAIN_SERVICE_STA_PWRSAVE,
249 WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
250 WMI_MAIN_SERVICE_AP_UAPSD,
251 WMI_MAIN_SERVICE_AP_DFS,
252 WMI_MAIN_SERVICE_11AC,
253 WMI_MAIN_SERVICE_BLOCKACK,
254 WMI_MAIN_SERVICE_PHYERR,
255 WMI_MAIN_SERVICE_BCN_FILTER,
256 WMI_MAIN_SERVICE_RTT,
257 WMI_MAIN_SERVICE_RATECTRL,
258 WMI_MAIN_SERVICE_WOW,
259 WMI_MAIN_SERVICE_RATECTRL_CACHE,
260 WMI_MAIN_SERVICE_IRAM_TIDS,
261 WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
262 WMI_MAIN_SERVICE_NLO,
263 WMI_MAIN_SERVICE_GTK_OFFLOAD,
264 WMI_MAIN_SERVICE_SCAN_SCH,
265 WMI_MAIN_SERVICE_CSA_OFFLOAD,
266 WMI_MAIN_SERVICE_CHATTER,
267 WMI_MAIN_SERVICE_COEX_FREQAVOID,
268 WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
269 WMI_MAIN_SERVICE_FORCE_FW_HANG,
270 WMI_MAIN_SERVICE_GPIO,
271 WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
272 WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
273 WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
274 WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
275 WMI_MAIN_SERVICE_TX_ENCAP,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300276};
277
Raja Mani840357c2015-06-22 20:10:10 +0530278enum wmi_10_4_service {
279 WMI_10_4_SERVICE_BEACON_OFFLOAD = 0,
280 WMI_10_4_SERVICE_SCAN_OFFLOAD,
281 WMI_10_4_SERVICE_ROAM_OFFLOAD,
282 WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
283 WMI_10_4_SERVICE_STA_PWRSAVE,
284 WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
285 WMI_10_4_SERVICE_AP_UAPSD,
286 WMI_10_4_SERVICE_AP_DFS,
287 WMI_10_4_SERVICE_11AC,
288 WMI_10_4_SERVICE_BLOCKACK,
289 WMI_10_4_SERVICE_PHYERR,
290 WMI_10_4_SERVICE_BCN_FILTER,
291 WMI_10_4_SERVICE_RTT,
292 WMI_10_4_SERVICE_RATECTRL,
293 WMI_10_4_SERVICE_WOW,
294 WMI_10_4_SERVICE_RATECTRL_CACHE,
295 WMI_10_4_SERVICE_IRAM_TIDS,
296 WMI_10_4_SERVICE_BURST,
297 WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
298 WMI_10_4_SERVICE_GTK_OFFLOAD,
299 WMI_10_4_SERVICE_SCAN_SCH,
300 WMI_10_4_SERVICE_CSA_OFFLOAD,
301 WMI_10_4_SERVICE_CHATTER,
302 WMI_10_4_SERVICE_COEX_FREQAVOID,
303 WMI_10_4_SERVICE_PACKET_POWER_SAVE,
304 WMI_10_4_SERVICE_FORCE_FW_HANG,
305 WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
306 WMI_10_4_SERVICE_GPIO,
307 WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
308 WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
309 WMI_10_4_SERVICE_STA_KEEP_ALIVE,
310 WMI_10_4_SERVICE_TX_ENCAP,
311 WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
312 WMI_10_4_SERVICE_EARLY_RX,
313 WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
314 WMI_10_4_SERVICE_TT,
315 WMI_10_4_SERVICE_ATF,
316 WMI_10_4_SERVICE_PEER_CACHING,
317 WMI_10_4_SERVICE_COEX_GPIO,
318 WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
319 WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
320 WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530321 WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
Peter Oh0b3d76e2016-01-28 13:54:07 -0800322 WMI_10_4_SERVICE_MESH_NON_11S,
Peter Ohe70e9ba2016-01-28 13:54:08 -0800323 WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
324 WMI_10_4_SERVICE_PEER_STATS,
325 WMI_10_4_SERVICE_MESH_11S,
Tamizh chelvam64ed57712016-08-02 16:13:14 +0530326 WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
Raja Mani7e247a92016-04-12 20:15:53 +0530327 WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY,
328 WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
329 WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +0300330 WMI_10_4_SERVICE_VDEV_RX_FILTER,
331 WMI_10_4_SERVICE_BTCOEX,
332 WMI_10_4_SERVICE_CHECK_CAL_VERSION,
333 WMI_10_4_SERVICE_DBGLOG_WARN2,
334 WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE,
335 WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT,
336 WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT,
337 WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT,
338 WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT,
339 WMI_10_4_SERVICE_TDLS,
340 WMI_10_4_SERVICE_TDLS_OFFCHAN,
341 WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA,
342 WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA,
343 WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
344 WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
Balaji Pothunoori14d65772017-12-21 20:00:42 +0530345 WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +0200346 WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
347 WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
348 WMI_10_4_SERVICE_TPC_STATS_FINAL,
Raja Mani840357c2015-06-22 20:10:10 +0530349};
350
Kalle Valo5e3dd152013-06-12 20:52:10 +0300351static inline char *wmi_service_name(int service_id)
352{
Michal Kaziorcff990c2014-08-04 09:18:33 +0300353#define SVCSTR(x) case x: return #x
354
Kalle Valo5e3dd152013-06-12 20:52:10 +0300355 switch (service_id) {
Michal Kaziorcff990c2014-08-04 09:18:33 +0300356 SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
357 SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
358 SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
359 SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
360 SVCSTR(WMI_SERVICE_STA_PWRSAVE);
361 SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
362 SVCSTR(WMI_SERVICE_AP_UAPSD);
363 SVCSTR(WMI_SERVICE_AP_DFS);
364 SVCSTR(WMI_SERVICE_11AC);
365 SVCSTR(WMI_SERVICE_BLOCKACK);
366 SVCSTR(WMI_SERVICE_PHYERR);
367 SVCSTR(WMI_SERVICE_BCN_FILTER);
368 SVCSTR(WMI_SERVICE_RTT);
369 SVCSTR(WMI_SERVICE_RATECTRL);
370 SVCSTR(WMI_SERVICE_WOW);
371 SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
372 SVCSTR(WMI_SERVICE_IRAM_TIDS);
373 SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
374 SVCSTR(WMI_SERVICE_NLO);
375 SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
376 SVCSTR(WMI_SERVICE_SCAN_SCH);
377 SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
378 SVCSTR(WMI_SERVICE_CHATTER);
379 SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
380 SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
381 SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
382 SVCSTR(WMI_SERVICE_GPIO);
383 SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
384 SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
385 SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
386 SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
387 SVCSTR(WMI_SERVICE_TX_ENCAP);
388 SVCSTR(WMI_SERVICE_BURST);
389 SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
390 SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
Michal Kaziorca996ec2014-12-03 10:11:32 +0200391 SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
392 SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
393 SVCSTR(WMI_SERVICE_EARLY_RX);
394 SVCSTR(WMI_SERVICE_STA_SMPS);
395 SVCSTR(WMI_SERVICE_FWTEST);
396 SVCSTR(WMI_SERVICE_STA_WMMAC);
397 SVCSTR(WMI_SERVICE_TDLS);
398 SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
399 SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
400 SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
401 SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
402 SVCSTR(WMI_SERVICE_WLAN_HB);
403 SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
404 SVCSTR(WMI_SERVICE_BATCH_SCAN);
405 SVCSTR(WMI_SERVICE_QPOWER);
406 SVCSTR(WMI_SERVICE_PLMREQ);
407 SVCSTR(WMI_SERVICE_THERMAL_MGMT);
408 SVCSTR(WMI_SERVICE_RMC);
409 SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
410 SVCSTR(WMI_SERVICE_COEX_SAR);
411 SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
412 SVCSTR(WMI_SERVICE_NAN);
413 SVCSTR(WMI_SERVICE_L1SS_STAT);
414 SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
415 SVCSTR(WMI_SERVICE_OBSS_SCAN);
416 SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
417 SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
418 SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
419 SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
420 SVCSTR(WMI_SERVICE_LPASS);
421 SVCSTR(WMI_SERVICE_EXTSCAN);
422 SVCSTR(WMI_SERVICE_D0WOW);
423 SVCSTR(WMI_SERVICE_HSOFFLOAD);
424 SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
425 SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
426 SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
427 SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
428 SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
429 SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
Yanbo Li52c22a62015-04-15 15:28:07 +0300430 SVCSTR(WMI_SERVICE_ATF);
Yanbo Lide0c789b2015-04-15 15:28:08 +0300431 SVCSTR(WMI_SERVICE_COEX_GPIO);
Raja Mani840357c2015-06-22 20:10:10 +0530432 SVCSTR(WMI_SERVICE_ENHANCED_PROXY_STA);
433 SVCSTR(WMI_SERVICE_TT);
434 SVCSTR(WMI_SERVICE_PEER_CACHING);
435 SVCSTR(WMI_SERVICE_AUX_SPECTRAL_INTF);
436 SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF);
437 SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64);
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530438 SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT);
Peter Oh0b3d76e2016-01-28 13:54:07 -0800439 SVCSTR(WMI_SERVICE_MESH_11S);
440 SVCSTR(WMI_SERVICE_MESH_NON_11S);
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +0530441 SVCSTR(WMI_SERVICE_PEER_STATS);
Peter Ohe70e9ba2016-01-28 13:54:08 -0800442 SVCSTR(WMI_SERVICE_RESTRT_CHNL_SUPPORT);
Tamizh chelvam64ed57712016-08-02 16:13:14 +0530443 SVCSTR(WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT);
Raja Mani7e247a92016-04-12 20:15:53 +0530444 SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY);
445 SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL);
446 SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC);
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +0300447 SVCSTR(WMI_SERVICE_VDEV_RX_FILTER);
448 SVCSTR(WMI_SERVICE_CHECK_CAL_VERSION);
449 SVCSTR(WMI_SERVICE_DBGLOG_WARN2);
450 SVCSTR(WMI_SERVICE_BTCOEX_DUTY_CYCLE);
451 SVCSTR(WMI_SERVICE_4_WIRE_COEX_SUPPORT);
452 SVCSTR(WMI_SERVICE_EXTENDED_NSS_SUPPORT);
453 SVCSTR(WMI_SERVICE_PROG_GPIO_BAND_SELECT);
454 SVCSTR(WMI_SERVICE_SMART_LOGGING_SUPPORT);
455 SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE);
456 SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY);
Balaji Pothunoori14d65772017-12-21 20:00:42 +0530457 SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH);
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +0200458 SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS);
459 SVCSTR(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT);
460 SVCSTR(WMI_SERVICE_TPC_STATS_FINAL);
Kalle Valo5e3dd152013-06-12 20:52:10 +0300461 default:
Michal Kaziorcff990c2014-08-04 09:18:33 +0300462 return NULL;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300463 }
Michal Kaziorcff990c2014-08-04 09:18:33 +0300464
465#undef SVCSTR
Kalle Valo5e3dd152013-06-12 20:52:10 +0300466}
467
Michal Kazior37b9f932014-11-27 10:11:16 +0100468#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
469 ((svc_id) < (len) && \
Kalle Valo14e105c2016-04-13 14:13:21 +0300470 __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \
471 BIT((svc_id) % (sizeof(u32))))
Michal Kaziorcff990c2014-08-04 09:18:33 +0300472
Manikanta Pubbisetty810fe812017-07-28 15:15:41 +0300473/* This extension is required to accommodate new services, current limit
474 * for wmi_services is 64 as target is using only 4-bits of each 32-bit
475 * wmi_service word. Extending this to make use of remaining unused bits
476 * for new services.
477 */
478#define WMI_EXT_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
479 ((svc_id) >= (len) && \
480 __le32_to_cpu((wmi_svc_bmap)[((svc_id) - (len)) / 28]) & \
481 BIT(((((svc_id) - (len)) % 28) & 0x1f) + 4))
482
Michal Kazior37b9f932014-11-27 10:11:16 +0100483#define SVCMAP(x, y, len) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300484 do { \
Manikanta Pubbisetty810fe812017-07-28 15:15:41 +0300485 if ((WMI_SERVICE_IS_ENABLED((in), (x), (len))) || \
486 (WMI_EXT_SERVICE_IS_ENABLED((in), (x), (len)))) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300487 __set_bit(y, out); \
488 } while (0)
489
Michal Kazior37b9f932014-11-27 10:11:16 +0100490static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
491 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300492{
493 SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100494 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300495 SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100496 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300497 SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100498 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300499 SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100500 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300501 SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100502 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300503 SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100504 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300505 SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100506 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300507 SVCMAP(WMI_10X_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100508 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300509 SVCMAP(WMI_10X_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100510 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300511 SVCMAP(WMI_10X_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100512 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300513 SVCMAP(WMI_10X_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100514 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300515 SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100516 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300517 SVCMAP(WMI_10X_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100518 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300519 SVCMAP(WMI_10X_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100520 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300521 SVCMAP(WMI_10X_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100522 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300523 SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100524 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300525 SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100526 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300527 SVCMAP(WMI_10X_SERVICE_BURST,
Michal Kazior37b9f932014-11-27 10:11:16 +0100528 WMI_SERVICE_BURST, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300529 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100530 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300531 SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100532 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300533 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100534 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
Yanbo Li52c22a62015-04-15 15:28:07 +0300535 SVCMAP(WMI_10X_SERVICE_ATF,
536 WMI_SERVICE_ATF, len);
Yanbo Lide0c789b2015-04-15 15:28:08 +0300537 SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
538 WMI_SERVICE_COEX_GPIO, len);
Peter Oh20fa2f72015-11-24 09:37:33 -0800539 SVCMAP(WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
540 WMI_SERVICE_AUX_SPECTRAL_INTF, len);
541 SVCMAP(WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
542 WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
543 SVCMAP(WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
544 WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
545 SVCMAP(WMI_10X_SERVICE_MESH,
Peter Oh0b3d76e2016-01-28 13:54:07 -0800546 WMI_SERVICE_MESH_11S, len);
Peter Oh20fa2f72015-11-24 09:37:33 -0800547 SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
548 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +0530549 SVCMAP(WMI_10X_SERVICE_PEER_STATS,
550 WMI_SERVICE_PEER_STATS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300551}
552
Michal Kazior37b9f932014-11-27 10:11:16 +0100553static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
554 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300555{
556 SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100557 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300558 SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100559 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300560 SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100561 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300562 SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100563 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300564 SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100565 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300566 SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100567 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300568 SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100569 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300570 SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100571 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300572 SVCMAP(WMI_MAIN_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100573 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300574 SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100575 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300576 SVCMAP(WMI_MAIN_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100577 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300578 SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100579 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300580 SVCMAP(WMI_MAIN_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100581 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300582 SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100583 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300584 SVCMAP(WMI_MAIN_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100585 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300586 SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100587 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300588 SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100589 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300590 SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100591 WMI_SERVICE_ARPNS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300592 SVCMAP(WMI_MAIN_SERVICE_NLO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100593 WMI_SERVICE_NLO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300594 SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100595 WMI_SERVICE_GTK_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300596 SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
Michal Kazior37b9f932014-11-27 10:11:16 +0100597 WMI_SERVICE_SCAN_SCH, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300598 SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100599 WMI_SERVICE_CSA_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300600 SVCMAP(WMI_MAIN_SERVICE_CHATTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100601 WMI_SERVICE_CHATTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300602 SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
Michal Kazior37b9f932014-11-27 10:11:16 +0100603 WMI_SERVICE_COEX_FREQAVOID, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300604 SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100605 WMI_SERVICE_PACKET_POWER_SAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300606 SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100607 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300608 SVCMAP(WMI_MAIN_SERVICE_GPIO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100609 WMI_SERVICE_GPIO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300610 SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
Michal Kazior37b9f932014-11-27 10:11:16 +0100611 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300612 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100613 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300614 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100615 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300616 SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100617 WMI_SERVICE_STA_KEEP_ALIVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300618 SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
Michal Kazior37b9f932014-11-27 10:11:16 +0100619 WMI_SERVICE_TX_ENCAP, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300620}
621
Raja Mani840357c2015-06-22 20:10:10 +0530622static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
623 size_t len)
624{
625 SVCMAP(WMI_10_4_SERVICE_BEACON_OFFLOAD,
626 WMI_SERVICE_BEACON_OFFLOAD, len);
627 SVCMAP(WMI_10_4_SERVICE_SCAN_OFFLOAD,
628 WMI_SERVICE_SCAN_OFFLOAD, len);
629 SVCMAP(WMI_10_4_SERVICE_ROAM_OFFLOAD,
630 WMI_SERVICE_ROAM_OFFLOAD, len);
631 SVCMAP(WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
632 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
633 SVCMAP(WMI_10_4_SERVICE_STA_PWRSAVE,
634 WMI_SERVICE_STA_PWRSAVE, len);
635 SVCMAP(WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
636 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
637 SVCMAP(WMI_10_4_SERVICE_AP_UAPSD,
638 WMI_SERVICE_AP_UAPSD, len);
639 SVCMAP(WMI_10_4_SERVICE_AP_DFS,
640 WMI_SERVICE_AP_DFS, len);
641 SVCMAP(WMI_10_4_SERVICE_11AC,
642 WMI_SERVICE_11AC, len);
643 SVCMAP(WMI_10_4_SERVICE_BLOCKACK,
644 WMI_SERVICE_BLOCKACK, len);
645 SVCMAP(WMI_10_4_SERVICE_PHYERR,
646 WMI_SERVICE_PHYERR, len);
647 SVCMAP(WMI_10_4_SERVICE_BCN_FILTER,
648 WMI_SERVICE_BCN_FILTER, len);
649 SVCMAP(WMI_10_4_SERVICE_RTT,
650 WMI_SERVICE_RTT, len);
651 SVCMAP(WMI_10_4_SERVICE_RATECTRL,
652 WMI_SERVICE_RATECTRL, len);
653 SVCMAP(WMI_10_4_SERVICE_WOW,
654 WMI_SERVICE_WOW, len);
655 SVCMAP(WMI_10_4_SERVICE_RATECTRL_CACHE,
656 WMI_SERVICE_RATECTRL_CACHE, len);
657 SVCMAP(WMI_10_4_SERVICE_IRAM_TIDS,
658 WMI_SERVICE_IRAM_TIDS, len);
659 SVCMAP(WMI_10_4_SERVICE_BURST,
660 WMI_SERVICE_BURST, len);
661 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
662 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
663 SVCMAP(WMI_10_4_SERVICE_GTK_OFFLOAD,
664 WMI_SERVICE_GTK_OFFLOAD, len);
665 SVCMAP(WMI_10_4_SERVICE_SCAN_SCH,
666 WMI_SERVICE_SCAN_SCH, len);
667 SVCMAP(WMI_10_4_SERVICE_CSA_OFFLOAD,
668 WMI_SERVICE_CSA_OFFLOAD, len);
669 SVCMAP(WMI_10_4_SERVICE_CHATTER,
670 WMI_SERVICE_CHATTER, len);
671 SVCMAP(WMI_10_4_SERVICE_COEX_FREQAVOID,
672 WMI_SERVICE_COEX_FREQAVOID, len);
673 SVCMAP(WMI_10_4_SERVICE_PACKET_POWER_SAVE,
674 WMI_SERVICE_PACKET_POWER_SAVE, len);
675 SVCMAP(WMI_10_4_SERVICE_FORCE_FW_HANG,
676 WMI_SERVICE_FORCE_FW_HANG, len);
677 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
678 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
679 SVCMAP(WMI_10_4_SERVICE_GPIO,
680 WMI_SERVICE_GPIO, len);
681 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
682 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
683 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
684 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
685 SVCMAP(WMI_10_4_SERVICE_STA_KEEP_ALIVE,
686 WMI_SERVICE_STA_KEEP_ALIVE, len);
687 SVCMAP(WMI_10_4_SERVICE_TX_ENCAP,
688 WMI_SERVICE_TX_ENCAP, len);
689 SVCMAP(WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
690 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, len);
691 SVCMAP(WMI_10_4_SERVICE_EARLY_RX,
692 WMI_SERVICE_EARLY_RX, len);
693 SVCMAP(WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
694 WMI_SERVICE_ENHANCED_PROXY_STA, len);
695 SVCMAP(WMI_10_4_SERVICE_TT,
696 WMI_SERVICE_TT, len);
697 SVCMAP(WMI_10_4_SERVICE_ATF,
698 WMI_SERVICE_ATF, len);
699 SVCMAP(WMI_10_4_SERVICE_PEER_CACHING,
700 WMI_SERVICE_PEER_CACHING, len);
701 SVCMAP(WMI_10_4_SERVICE_COEX_GPIO,
702 WMI_SERVICE_COEX_GPIO, len);
703 SVCMAP(WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
704 WMI_SERVICE_AUX_SPECTRAL_INTF, len);
705 SVCMAP(WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
706 WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
707 SVCMAP(WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
708 WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530709 SVCMAP(WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
710 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
Peter Oh0b3d76e2016-01-28 13:54:07 -0800711 SVCMAP(WMI_10_4_SERVICE_MESH_NON_11S,
712 WMI_SERVICE_MESH_NON_11S, len);
Peter Ohe70e9ba2016-01-28 13:54:08 -0800713 SVCMAP(WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
714 WMI_SERVICE_RESTRT_CHNL_SUPPORT, len);
715 SVCMAP(WMI_10_4_SERVICE_PEER_STATS,
716 WMI_SERVICE_PEER_STATS, len);
717 SVCMAP(WMI_10_4_SERVICE_MESH_11S,
718 WMI_SERVICE_MESH_11S, len);
Tamizh chelvam64ed57712016-08-02 16:13:14 +0530719 SVCMAP(WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
720 WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, len);
Raja Mani7e247a92016-04-12 20:15:53 +0530721 SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY,
722 WMI_SERVICE_TX_MODE_PUSH_ONLY, len);
723 SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
724 WMI_SERVICE_TX_MODE_PUSH_PULL, len);
725 SVCMAP(WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
726 WMI_SERVICE_TX_MODE_DYNAMIC, len);
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +0300727 SVCMAP(WMI_10_4_SERVICE_VDEV_RX_FILTER,
728 WMI_SERVICE_VDEV_RX_FILTER, len);
729 SVCMAP(WMI_10_4_SERVICE_BTCOEX,
730 WMI_SERVICE_BTCOEX, len);
731 SVCMAP(WMI_10_4_SERVICE_CHECK_CAL_VERSION,
732 WMI_SERVICE_CHECK_CAL_VERSION, len);
733 SVCMAP(WMI_10_4_SERVICE_DBGLOG_WARN2,
734 WMI_SERVICE_DBGLOG_WARN2, len);
735 SVCMAP(WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE,
736 WMI_SERVICE_BTCOEX_DUTY_CYCLE, len);
737 SVCMAP(WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT,
738 WMI_SERVICE_4_WIRE_COEX_SUPPORT, len);
739 SVCMAP(WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT,
740 WMI_SERVICE_EXTENDED_NSS_SUPPORT, len);
741 SVCMAP(WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT,
742 WMI_SERVICE_PROG_GPIO_BAND_SELECT, len);
743 SVCMAP(WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT,
744 WMI_SERVICE_SMART_LOGGING_SUPPORT, len);
745 SVCMAP(WMI_10_4_SERVICE_TDLS,
746 WMI_SERVICE_TDLS, len);
747 SVCMAP(WMI_10_4_SERVICE_TDLS_OFFCHAN,
748 WMI_SERVICE_TDLS_OFFCHAN, len);
749 SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA,
750 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA, len);
751 SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA,
752 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA, len);
753 SVCMAP(WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
754 WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, len);
755 SVCMAP(WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
756 WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len);
Balaji Pothunoori14d65772017-12-21 20:00:42 +0530757 SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
758 WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len);
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +0200759 SVCMAP(WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
760 WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len);
761 SVCMAP(WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
762 WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, len);
763 SVCMAP(WMI_10_4_SERVICE_TPC_STATS_FINAL,
764 WMI_SERVICE_TPC_STATS_FINAL, len);
Raja Mani840357c2015-06-22 20:10:10 +0530765}
766
Michal Kaziorcff990c2014-08-04 09:18:33 +0300767#undef SVCMAP
Kalle Valo5e3dd152013-06-12 20:52:10 +0300768
Kalle Valo5e3dd152013-06-12 20:52:10 +0300769/* 2 word representation of MAC addr */
770struct wmi_mac_addr {
771 union {
772 u8 addr[6];
773 struct {
774 u32 word0;
775 u32 word1;
776 } __packed;
777 } __packed;
778} __packed;
779
Bartosz Markowskice428702013-09-26 17:47:05 +0200780struct wmi_cmd_map {
781 u32 init_cmdid;
782 u32 start_scan_cmdid;
783 u32 stop_scan_cmdid;
784 u32 scan_chan_list_cmdid;
785 u32 scan_sch_prio_tbl_cmdid;
786 u32 pdev_set_regdomain_cmdid;
787 u32 pdev_set_channel_cmdid;
788 u32 pdev_set_param_cmdid;
789 u32 pdev_pktlog_enable_cmdid;
790 u32 pdev_pktlog_disable_cmdid;
791 u32 pdev_set_wmm_params_cmdid;
792 u32 pdev_set_ht_cap_ie_cmdid;
793 u32 pdev_set_vht_cap_ie_cmdid;
794 u32 pdev_set_dscp_tid_map_cmdid;
795 u32 pdev_set_quiet_mode_cmdid;
796 u32 pdev_green_ap_ps_enable_cmdid;
797 u32 pdev_get_tpc_config_cmdid;
798 u32 pdev_set_base_macaddr_cmdid;
799 u32 vdev_create_cmdid;
800 u32 vdev_delete_cmdid;
801 u32 vdev_start_request_cmdid;
802 u32 vdev_restart_request_cmdid;
803 u32 vdev_up_cmdid;
804 u32 vdev_stop_cmdid;
805 u32 vdev_down_cmdid;
806 u32 vdev_set_param_cmdid;
807 u32 vdev_install_key_cmdid;
808 u32 peer_create_cmdid;
809 u32 peer_delete_cmdid;
810 u32 peer_flush_tids_cmdid;
811 u32 peer_set_param_cmdid;
812 u32 peer_assoc_cmdid;
813 u32 peer_add_wds_entry_cmdid;
814 u32 peer_remove_wds_entry_cmdid;
815 u32 peer_mcast_group_cmdid;
816 u32 bcn_tx_cmdid;
817 u32 pdev_send_bcn_cmdid;
818 u32 bcn_tmpl_cmdid;
819 u32 bcn_filter_rx_cmdid;
820 u32 prb_req_filter_rx_cmdid;
821 u32 mgmt_tx_cmdid;
Rakesh Pillai1807da42017-12-11 19:52:53 +0530822 u32 mgmt_tx_send_cmdid;
Bartosz Markowskice428702013-09-26 17:47:05 +0200823 u32 prb_tmpl_cmdid;
824 u32 addba_clear_resp_cmdid;
825 u32 addba_send_cmdid;
826 u32 addba_status_cmdid;
827 u32 delba_send_cmdid;
828 u32 addba_set_resp_cmdid;
829 u32 send_singleamsdu_cmdid;
830 u32 sta_powersave_mode_cmdid;
831 u32 sta_powersave_param_cmdid;
832 u32 sta_mimo_ps_mode_cmdid;
833 u32 pdev_dfs_enable_cmdid;
834 u32 pdev_dfs_disable_cmdid;
835 u32 roam_scan_mode;
836 u32 roam_scan_rssi_threshold;
837 u32 roam_scan_period;
838 u32 roam_scan_rssi_change_threshold;
839 u32 roam_ap_profile;
840 u32 ofl_scan_add_ap_profile;
841 u32 ofl_scan_remove_ap_profile;
842 u32 ofl_scan_period;
843 u32 p2p_dev_set_device_info;
844 u32 p2p_dev_set_discoverability;
845 u32 p2p_go_set_beacon_ie;
846 u32 p2p_go_set_probe_resp_ie;
847 u32 p2p_set_vendor_ie_data_cmdid;
848 u32 ap_ps_peer_param_cmdid;
849 u32 ap_ps_peer_uapsd_coex_cmdid;
850 u32 peer_rate_retry_sched_cmdid;
851 u32 wlan_profile_trigger_cmdid;
852 u32 wlan_profile_set_hist_intvl_cmdid;
853 u32 wlan_profile_get_profile_data_cmdid;
854 u32 wlan_profile_enable_profile_id_cmdid;
855 u32 wlan_profile_list_profile_id_cmdid;
856 u32 pdev_suspend_cmdid;
857 u32 pdev_resume_cmdid;
858 u32 add_bcn_filter_cmdid;
859 u32 rmv_bcn_filter_cmdid;
860 u32 wow_add_wake_pattern_cmdid;
861 u32 wow_del_wake_pattern_cmdid;
862 u32 wow_enable_disable_wake_event_cmdid;
863 u32 wow_enable_cmdid;
864 u32 wow_hostwakeup_from_sleep_cmdid;
865 u32 rtt_measreq_cmdid;
866 u32 rtt_tsf_cmdid;
867 u32 vdev_spectral_scan_configure_cmdid;
868 u32 vdev_spectral_scan_enable_cmdid;
869 u32 request_stats_cmdid;
870 u32 set_arp_ns_offload_cmdid;
871 u32 network_list_offload_config_cmdid;
872 u32 gtk_offload_cmdid;
873 u32 csa_offload_enable_cmdid;
874 u32 csa_offload_chanswitch_cmdid;
875 u32 chatter_set_mode_cmdid;
876 u32 peer_tid_addba_cmdid;
877 u32 peer_tid_delba_cmdid;
878 u32 sta_dtim_ps_method_cmdid;
879 u32 sta_uapsd_auto_trig_cmdid;
880 u32 sta_keepalive_cmd;
881 u32 echo_cmdid;
882 u32 pdev_utf_cmdid;
883 u32 dbglog_cfg_cmdid;
884 u32 pdev_qvit_cmdid;
885 u32 pdev_ftm_intg_cmdid;
886 u32 vdev_set_keepalive_cmdid;
887 u32 vdev_get_keepalive_cmdid;
888 u32 force_fw_hang_cmdid;
889 u32 gpio_config_cmdid;
890 u32 gpio_output_cmdid;
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +0200891 u32 pdev_get_temperature_cmdid;
Michal Kazior6d492fe2015-01-28 09:57:22 +0200892 u32 vdev_set_wmm_params_cmdid;
Marek Puzyniakad45c882015-03-30 09:51:53 +0300893 u32 tdls_set_state_cmdid;
894 u32 tdls_peer_update_cmdid;
Michal Kazior5b272e32015-03-31 10:26:22 +0000895 u32 adaptive_qcs_cmdid;
Raja Mani2d491e62015-06-22 20:10:11 +0530896 u32 scan_update_request_cmdid;
897 u32 vdev_standby_response_cmdid;
898 u32 vdev_resume_response_cmdid;
899 u32 wlan_peer_caching_add_peer_cmdid;
900 u32 wlan_peer_caching_evict_peer_cmdid;
901 u32 wlan_peer_caching_restore_peer_cmdid;
902 u32 wlan_peer_caching_print_all_peers_info_cmdid;
903 u32 peer_update_wds_entry_cmdid;
904 u32 peer_add_proxy_sta_entry_cmdid;
905 u32 rtt_keepalive_cmdid;
906 u32 oem_req_cmdid;
907 u32 nan_cmdid;
908 u32 vdev_ratemask_cmdid;
909 u32 qboost_cfg_cmdid;
910 u32 pdev_smart_ant_enable_cmdid;
911 u32 pdev_smart_ant_set_rx_antenna_cmdid;
912 u32 peer_smart_ant_set_tx_antenna_cmdid;
913 u32 peer_smart_ant_set_train_info_cmdid;
914 u32 peer_smart_ant_set_node_config_ops_cmdid;
915 u32 pdev_set_antenna_switch_table_cmdid;
916 u32 pdev_set_ctl_table_cmdid;
917 u32 pdev_set_mimogain_table_cmdid;
918 u32 pdev_ratepwr_table_cmdid;
919 u32 pdev_ratepwr_chainmsk_table_cmdid;
920 u32 pdev_fips_cmdid;
921 u32 tt_set_conf_cmdid;
922 u32 fwtest_cmdid;
923 u32 vdev_atf_request_cmdid;
924 u32 peer_atf_request_cmdid;
925 u32 pdev_get_ani_cck_config_cmdid;
926 u32 pdev_get_ani_ofdm_config_cmdid;
927 u32 pdev_reserve_ast_entry_cmdid;
928 u32 pdev_get_nfcal_power_cmdid;
929 u32 pdev_get_tpc_cmdid;
930 u32 pdev_get_ast_info_cmdid;
931 u32 vdev_set_dscp_tid_map_cmdid;
932 u32 pdev_get_info_cmdid;
933 u32 vdev_get_info_cmdid;
934 u32 vdev_filter_neighbor_rx_packets_cmdid;
935 u32 mu_cal_start_cmdid;
936 u32 set_cca_params_cmdid;
937 u32 pdev_bss_chan_info_request_cmdid;
Maharaja62f77f02015-10-21 11:49:18 +0300938 u32 pdev_enable_adaptive_cca_cmdid;
Raja Mani47771902016-03-16 18:13:33 +0530939 u32 ext_resource_cfg_cmdid;
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +0300940 u32 vdev_set_ie_cmdid;
941 u32 set_lteu_config_cmdid;
942 u32 atf_ssid_grouping_request_cmdid;
943 u32 peer_atf_ext_request_cmdid;
944 u32 set_periodic_channel_stats_cfg_cmdid;
945 u32 peer_bwf_request_cmdid;
946 u32 btcoex_cfg_cmdid;
947 u32 peer_tx_mu_txmit_count_cmdid;
948 u32 peer_tx_mu_txmit_rstcnt_cmdid;
949 u32 peer_gid_userpos_list_cmdid;
950 u32 pdev_check_cal_version_cmdid;
951 u32 coex_version_cfg_cmid;
952 u32 pdev_get_rx_filter_cmdid;
953 u32 pdev_extended_nss_cfg_cmdid;
954 u32 vdev_set_scan_nac_rssi_cmdid;
955 u32 prog_gpio_band_select_cmdid;
956 u32 config_smart_logging_cmdid;
957 u32 debug_fatal_condition_cmdid;
958 u32 get_tsf_timer_cmdid;
959 u32 pdev_get_tpc_table_cmdid;
960 u32 vdev_sifs_trigger_time_cmdid;
961 u32 pdev_wds_entry_list_cmdid;
962 u32 tdls_set_offchan_mode_cmdid;
Bartosz Markowskice428702013-09-26 17:47:05 +0200963};
964
Kalle Valo5e3dd152013-06-12 20:52:10 +0300965/*
966 * wmi command groups.
967 */
968enum wmi_cmd_group {
969 /* 0 to 2 are reserved */
970 WMI_GRP_START = 0x3,
971 WMI_GRP_SCAN = WMI_GRP_START,
972 WMI_GRP_PDEV,
973 WMI_GRP_VDEV,
974 WMI_GRP_PEER,
975 WMI_GRP_MGMT,
976 WMI_GRP_BA_NEG,
977 WMI_GRP_STA_PS,
978 WMI_GRP_DFS,
979 WMI_GRP_ROAM,
980 WMI_GRP_OFL_SCAN,
981 WMI_GRP_P2P,
982 WMI_GRP_AP_PS,
983 WMI_GRP_RATE_CTRL,
984 WMI_GRP_PROFILE,
985 WMI_GRP_SUSPEND,
986 WMI_GRP_BCN_FILTER,
987 WMI_GRP_WOW,
988 WMI_GRP_RTT,
989 WMI_GRP_SPECTRAL,
990 WMI_GRP_STATS,
991 WMI_GRP_ARP_NS_OFL,
992 WMI_GRP_NLO_OFL,
993 WMI_GRP_GTK_OFL,
994 WMI_GRP_CSA_OFL,
995 WMI_GRP_CHATTER,
996 WMI_GRP_TID_ADDBA,
997 WMI_GRP_MISC,
998 WMI_GRP_GPIO,
999};
1000
1001#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
1002#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
1003
Bartosz Markowski34957b22013-10-15 09:55:31 +02001004#define WMI_CMD_UNSUPPORTED 0
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +02001005
1006/* Command IDs and command events for MAIN FW. */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001007enum wmi_cmd_id {
1008 WMI_INIT_CMDID = 0x1,
1009
1010 /* Scan specific commands */
1011 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
1012 WMI_STOP_SCAN_CMDID,
1013 WMI_SCAN_CHAN_LIST_CMDID,
1014 WMI_SCAN_SCH_PRIO_TBL_CMDID,
1015
1016 /* PDEV (physical device) specific commands */
1017 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
1018 WMI_PDEV_SET_CHANNEL_CMDID,
1019 WMI_PDEV_SET_PARAM_CMDID,
1020 WMI_PDEV_PKTLOG_ENABLE_CMDID,
1021 WMI_PDEV_PKTLOG_DISABLE_CMDID,
1022 WMI_PDEV_SET_WMM_PARAMS_CMDID,
1023 WMI_PDEV_SET_HT_CAP_IE_CMDID,
1024 WMI_PDEV_SET_VHT_CAP_IE_CMDID,
1025 WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
1026 WMI_PDEV_SET_QUIET_MODE_CMDID,
1027 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1028 WMI_PDEV_GET_TPC_CONFIG_CMDID,
1029 WMI_PDEV_SET_BASE_MACADDR_CMDID,
1030
1031 /* VDEV (virtual device) specific commands */
1032 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
1033 WMI_VDEV_DELETE_CMDID,
1034 WMI_VDEV_START_REQUEST_CMDID,
1035 WMI_VDEV_RESTART_REQUEST_CMDID,
1036 WMI_VDEV_UP_CMDID,
1037 WMI_VDEV_STOP_CMDID,
1038 WMI_VDEV_DOWN_CMDID,
1039 WMI_VDEV_SET_PARAM_CMDID,
1040 WMI_VDEV_INSTALL_KEY_CMDID,
1041
1042 /* peer specific commands */
1043 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
1044 WMI_PEER_DELETE_CMDID,
1045 WMI_PEER_FLUSH_TIDS_CMDID,
1046 WMI_PEER_SET_PARAM_CMDID,
1047 WMI_PEER_ASSOC_CMDID,
1048 WMI_PEER_ADD_WDS_ENTRY_CMDID,
1049 WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
1050 WMI_PEER_MCAST_GROUP_CMDID,
1051
1052 /* beacon/management specific commands */
1053 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
1054 WMI_PDEV_SEND_BCN_CMDID,
1055 WMI_BCN_TMPL_CMDID,
1056 WMI_BCN_FILTER_RX_CMDID,
1057 WMI_PRB_REQ_FILTER_RX_CMDID,
1058 WMI_MGMT_TX_CMDID,
1059 WMI_PRB_TMPL_CMDID,
1060
1061 /* commands to directly control BA negotiation directly from host. */
1062 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
1063 WMI_ADDBA_SEND_CMDID,
1064 WMI_ADDBA_STATUS_CMDID,
1065 WMI_DELBA_SEND_CMDID,
1066 WMI_ADDBA_SET_RESP_CMDID,
1067 WMI_SEND_SINGLEAMSDU_CMDID,
1068
1069 /* Station power save specific config */
1070 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
1071 WMI_STA_POWERSAVE_PARAM_CMDID,
1072 WMI_STA_MIMO_PS_MODE_CMDID,
1073
1074 /** DFS-specific commands */
1075 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
1076 WMI_PDEV_DFS_DISABLE_CMDID,
1077
1078 /* Roaming specific commands */
1079 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
1080 WMI_ROAM_SCAN_RSSI_THRESHOLD,
1081 WMI_ROAM_SCAN_PERIOD,
1082 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1083 WMI_ROAM_AP_PROFILE,
1084
1085 /* offload scan specific commands */
1086 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
1087 WMI_OFL_SCAN_REMOVE_AP_PROFILE,
1088 WMI_OFL_SCAN_PERIOD,
1089
1090 /* P2P specific commands */
1091 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
1092 WMI_P2P_DEV_SET_DISCOVERABILITY,
1093 WMI_P2P_GO_SET_BEACON_IE,
1094 WMI_P2P_GO_SET_PROBE_RESP_IE,
1095 WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
1096
1097 /* AP power save specific config */
1098 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
1099 WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
1100
1101 /* Rate-control specific commands */
1102 WMI_PEER_RATE_RETRY_SCHED_CMDID =
1103 WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
1104
1105 /* WLAN Profiling commands. */
1106 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
1107 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1108 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1109 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1110 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1111
1112 /* Suspend resume command Ids */
1113 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
1114 WMI_PDEV_RESUME_CMDID,
1115
1116 /* Beacon filter commands */
1117 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
1118 WMI_RMV_BCN_FILTER_CMDID,
1119
1120 /* WOW Specific WMI commands*/
1121 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
1122 WMI_WOW_DEL_WAKE_PATTERN_CMDID,
1123 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1124 WMI_WOW_ENABLE_CMDID,
1125 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1126
1127 /* RTT measurement related cmd */
1128 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
1129 WMI_RTT_TSF_CMDID,
1130
1131 /* spectral scan commands */
1132 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
1133 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1134
1135 /* F/W stats */
1136 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
1137
1138 /* ARP OFFLOAD REQUEST*/
1139 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
1140
1141 /* NS offload confid*/
1142 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
1143
1144 /* GTK offload Specific WMI commands*/
1145 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
1146
1147 /* CSA offload Specific WMI commands*/
1148 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
1149 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
1150
1151 /* Chatter commands*/
1152 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
1153
1154 /* addba specific commands */
1155 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
1156 WMI_PEER_TID_DELBA_CMDID,
1157
1158 /* set station mimo powersave method */
1159 WMI_STA_DTIM_PS_METHOD_CMDID,
1160 /* Configure the Station UAPSD AC Auto Trigger Parameters */
1161 WMI_STA_UAPSD_AUTO_TRIG_CMDID,
1162
1163 /* STA Keep alive parameter configuration,
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01001164 * Requires WMI_SERVICE_STA_KEEP_ALIVE
1165 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001166 WMI_STA_KEEPALIVE_CMD,
1167
1168 /* misc command group */
1169 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
1170 WMI_PDEV_UTF_CMDID,
1171 WMI_DBGLOG_CFG_CMDID,
1172 WMI_PDEV_QVIT_CMDID,
1173 WMI_PDEV_FTM_INTG_CMDID,
1174 WMI_VDEV_SET_KEEPALIVE_CMDID,
1175 WMI_VDEV_GET_KEEPALIVE_CMDID,
Michal Kazior9cfbce72013-07-16 09:54:36 +02001176 WMI_FORCE_FW_HANG_CMDID,
Kalle Valo5e3dd152013-06-12 20:52:10 +03001177
1178 /* GPIO Configuration */
1179 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
1180 WMI_GPIO_OUTPUT_CMDID,
1181};
1182
1183enum wmi_event_id {
1184 WMI_SERVICE_READY_EVENTID = 0x1,
1185 WMI_READY_EVENTID,
1186
1187 /* Scan specific events */
1188 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
1189
1190 /* PDEV specific events */
1191 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
1192 WMI_CHAN_INFO_EVENTID,
1193 WMI_PHYERR_EVENTID,
1194
1195 /* VDEV specific events */
1196 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
1197 WMI_VDEV_STOPPED_EVENTID,
1198 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
1199
1200 /* peer specific events */
1201 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
1202
1203 /* beacon/mgmt specific events */
1204 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
1205 WMI_HOST_SWBA_EVENTID,
1206 WMI_TBTTOFFSET_UPDATE_EVENTID,
1207
1208 /* ADDBA Related WMI Events*/
1209 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
1210 WMI_TX_ADDBA_COMPLETE_EVENTID,
1211
1212 /* Roam event to trigger roaming on host */
1213 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
1214 WMI_PROFILE_MATCH,
1215
1216 /* WoW */
1217 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
1218
1219 /* RTT */
1220 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
1221 WMI_TSF_MEASUREMENT_REPORT_EVENTID,
1222 WMI_RTT_ERROR_REPORT_EVENTID,
1223
1224 /* GTK offload */
1225 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
1226 WMI_GTK_REKEY_FAIL_EVENTID,
1227
1228 /* CSA IE received event */
1229 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
1230
1231 /* Misc events */
1232 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
1233 WMI_PDEV_UTF_EVENTID,
1234 WMI_DEBUG_MESG_EVENTID,
1235 WMI_UPDATE_STATS_EVENTID,
1236 WMI_DEBUG_PRINT_EVENTID,
1237 WMI_DCS_INTERFERENCE_EVENTID,
1238 WMI_PDEV_QVIT_EVENTID,
1239 WMI_WLAN_PROFILE_DATA_EVENTID,
1240 WMI_PDEV_FTM_INTG_EVENTID,
1241 WMI_WLAN_FREQ_AVOID_EVENTID,
1242 WMI_VDEV_GET_KEEPALIVE_EVENTID,
1243
1244 /* GPIO Event */
1245 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
1246};
1247
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +02001248/* Command IDs and command events for 10.X firmware */
1249enum wmi_10x_cmd_id {
1250 WMI_10X_START_CMDID = 0x9000,
1251 WMI_10X_END_CMDID = 0x9FFF,
1252
1253 /* initialize the wlan sub system */
1254 WMI_10X_INIT_CMDID,
1255
1256 /* Scan specific commands */
1257
1258 WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
1259 WMI_10X_STOP_SCAN_CMDID,
1260 WMI_10X_SCAN_CHAN_LIST_CMDID,
1261 WMI_10X_ECHO_CMDID,
1262
1263 /* PDEV(physical device) specific commands */
1264 WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
1265 WMI_10X_PDEV_SET_CHANNEL_CMDID,
1266 WMI_10X_PDEV_SET_PARAM_CMDID,
1267 WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
1268 WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
1269 WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
1270 WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
1271 WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
1272 WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
1273 WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
1274 WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
1275 WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1276 WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
1277
1278 /* VDEV(virtual device) specific commands */
1279 WMI_10X_VDEV_CREATE_CMDID,
1280 WMI_10X_VDEV_DELETE_CMDID,
1281 WMI_10X_VDEV_START_REQUEST_CMDID,
1282 WMI_10X_VDEV_RESTART_REQUEST_CMDID,
1283 WMI_10X_VDEV_UP_CMDID,
1284 WMI_10X_VDEV_STOP_CMDID,
1285 WMI_10X_VDEV_DOWN_CMDID,
1286 WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
1287 WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
1288 WMI_10X_VDEV_SET_PARAM_CMDID,
1289 WMI_10X_VDEV_INSTALL_KEY_CMDID,
1290
1291 /* peer specific commands */
1292 WMI_10X_PEER_CREATE_CMDID,
1293 WMI_10X_PEER_DELETE_CMDID,
1294 WMI_10X_PEER_FLUSH_TIDS_CMDID,
1295 WMI_10X_PEER_SET_PARAM_CMDID,
1296 WMI_10X_PEER_ASSOC_CMDID,
1297 WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
1298 WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
1299 WMI_10X_PEER_MCAST_GROUP_CMDID,
1300
1301 /* beacon/management specific commands */
1302
1303 WMI_10X_BCN_TX_CMDID,
1304 WMI_10X_BCN_PRB_TMPL_CMDID,
1305 WMI_10X_BCN_FILTER_RX_CMDID,
1306 WMI_10X_PRB_REQ_FILTER_RX_CMDID,
1307 WMI_10X_MGMT_TX_CMDID,
1308
1309 /* commands to directly control ba negotiation directly from host. */
1310 WMI_10X_ADDBA_CLEAR_RESP_CMDID,
1311 WMI_10X_ADDBA_SEND_CMDID,
1312 WMI_10X_ADDBA_STATUS_CMDID,
1313 WMI_10X_DELBA_SEND_CMDID,
1314 WMI_10X_ADDBA_SET_RESP_CMDID,
1315 WMI_10X_SEND_SINGLEAMSDU_CMDID,
1316
1317 /* Station power save specific config */
1318 WMI_10X_STA_POWERSAVE_MODE_CMDID,
1319 WMI_10X_STA_POWERSAVE_PARAM_CMDID,
1320 WMI_10X_STA_MIMO_PS_MODE_CMDID,
1321
1322 /* set debug log config */
1323 WMI_10X_DBGLOG_CFG_CMDID,
1324
1325 /* DFS-specific commands */
1326 WMI_10X_PDEV_DFS_ENABLE_CMDID,
1327 WMI_10X_PDEV_DFS_DISABLE_CMDID,
1328
1329 /* QVIT specific command id */
1330 WMI_10X_PDEV_QVIT_CMDID,
1331
1332 /* Offload Scan and Roaming related commands */
1333 WMI_10X_ROAM_SCAN_MODE,
1334 WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
1335 WMI_10X_ROAM_SCAN_PERIOD,
1336 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1337 WMI_10X_ROAM_AP_PROFILE,
1338 WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
1339 WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
1340 WMI_10X_OFL_SCAN_PERIOD,
1341
1342 /* P2P specific commands */
1343 WMI_10X_P2P_DEV_SET_DEVICE_INFO,
1344 WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
1345 WMI_10X_P2P_GO_SET_BEACON_IE,
1346 WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
1347
1348 /* AP power save specific config */
1349 WMI_10X_AP_PS_PEER_PARAM_CMDID,
1350 WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
1351
1352 /* Rate-control specific commands */
1353 WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
1354
1355 /* WLAN Profiling commands. */
1356 WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
1357 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1358 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1359 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1360 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1361
1362 /* Suspend resume command Ids */
1363 WMI_10X_PDEV_SUSPEND_CMDID,
1364 WMI_10X_PDEV_RESUME_CMDID,
1365
1366 /* Beacon filter commands */
1367 WMI_10X_ADD_BCN_FILTER_CMDID,
1368 WMI_10X_RMV_BCN_FILTER_CMDID,
1369
1370 /* WOW Specific WMI commands*/
1371 WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
1372 WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
1373 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1374 WMI_10X_WOW_ENABLE_CMDID,
1375 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1376
1377 /* RTT measurement related cmd */
1378 WMI_10X_RTT_MEASREQ_CMDID,
1379 WMI_10X_RTT_TSF_CMDID,
1380
1381 /* transmit beacon by value */
1382 WMI_10X_PDEV_SEND_BCN_CMDID,
1383
1384 /* F/W stats */
1385 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1386 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1387 WMI_10X_REQUEST_STATS_CMDID,
1388
1389 /* GPIO Configuration */
1390 WMI_10X_GPIO_CONFIG_CMDID,
1391 WMI_10X_GPIO_OUTPUT_CMDID,
1392
1393 WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
1394};
1395
1396enum wmi_10x_event_id {
1397 WMI_10X_SERVICE_READY_EVENTID = 0x8000,
1398 WMI_10X_READY_EVENTID,
1399 WMI_10X_START_EVENTID = 0x9000,
1400 WMI_10X_END_EVENTID = 0x9FFF,
1401
1402 /* Scan specific events */
1403 WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
1404 WMI_10X_ECHO_EVENTID,
1405 WMI_10X_DEBUG_MESG_EVENTID,
1406 WMI_10X_UPDATE_STATS_EVENTID,
1407
1408 /* Instantaneous RSSI event */
1409 WMI_10X_INST_RSSI_STATS_EVENTID,
1410
1411 /* VDEV specific events */
1412 WMI_10X_VDEV_START_RESP_EVENTID,
1413 WMI_10X_VDEV_STANDBY_REQ_EVENTID,
1414 WMI_10X_VDEV_RESUME_REQ_EVENTID,
1415 WMI_10X_VDEV_STOPPED_EVENTID,
1416
1417 /* peer specific events */
1418 WMI_10X_PEER_STA_KICKOUT_EVENTID,
1419
1420 /* beacon/mgmt specific events */
1421 WMI_10X_HOST_SWBA_EVENTID,
1422 WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
1423 WMI_10X_MGMT_RX_EVENTID,
1424
1425 /* Channel stats event */
1426 WMI_10X_CHAN_INFO_EVENTID,
1427
1428 /* PHY Error specific WMI event */
1429 WMI_10X_PHYERR_EVENTID,
1430
1431 /* Roam event to trigger roaming on host */
1432 WMI_10X_ROAM_EVENTID,
1433
1434 /* matching AP found from list of profiles */
1435 WMI_10X_PROFILE_MATCH,
1436
1437 /* debug print message used for tracing FW code while debugging */
1438 WMI_10X_DEBUG_PRINT_EVENTID,
1439 /* VI spoecific event */
1440 WMI_10X_PDEV_QVIT_EVENTID,
1441 /* FW code profile data in response to profile request */
1442 WMI_10X_WLAN_PROFILE_DATA_EVENTID,
1443
1444 /*RTT related event ID*/
1445 WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
1446 WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
1447 WMI_10X_RTT_ERROR_REPORT_EVENTID,
1448
1449 WMI_10X_WOW_WAKEUP_HOST_EVENTID,
1450 WMI_10X_DCS_INTERFERENCE_EVENTID,
1451
1452 /* TPC config for the current operating channel */
1453 WMI_10X_PDEV_TPC_CONFIG_EVENTID,
1454
1455 WMI_10X_GPIO_INPUT_EVENTID,
Kalle Valo14e105c2016-04-13 14:13:21 +03001456 WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID - 1,
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +02001457};
1458
Michal Kazior24c88f72014-07-25 13:32:17 +02001459enum wmi_10_2_cmd_id {
1460 WMI_10_2_START_CMDID = 0x9000,
1461 WMI_10_2_END_CMDID = 0x9FFF,
1462 WMI_10_2_INIT_CMDID,
1463 WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
1464 WMI_10_2_STOP_SCAN_CMDID,
1465 WMI_10_2_SCAN_CHAN_LIST_CMDID,
1466 WMI_10_2_ECHO_CMDID,
1467 WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
1468 WMI_10_2_PDEV_SET_CHANNEL_CMDID,
1469 WMI_10_2_PDEV_SET_PARAM_CMDID,
1470 WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
1471 WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
1472 WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
1473 WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
1474 WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
1475 WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
1476 WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
1477 WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1478 WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
1479 WMI_10_2_VDEV_CREATE_CMDID,
1480 WMI_10_2_VDEV_DELETE_CMDID,
1481 WMI_10_2_VDEV_START_REQUEST_CMDID,
1482 WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
1483 WMI_10_2_VDEV_UP_CMDID,
1484 WMI_10_2_VDEV_STOP_CMDID,
1485 WMI_10_2_VDEV_DOWN_CMDID,
1486 WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
1487 WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
1488 WMI_10_2_VDEV_SET_PARAM_CMDID,
1489 WMI_10_2_VDEV_INSTALL_KEY_CMDID,
1490 WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
1491 WMI_10_2_PEER_CREATE_CMDID,
1492 WMI_10_2_PEER_DELETE_CMDID,
1493 WMI_10_2_PEER_FLUSH_TIDS_CMDID,
1494 WMI_10_2_PEER_SET_PARAM_CMDID,
1495 WMI_10_2_PEER_ASSOC_CMDID,
1496 WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
1497 WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
1498 WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
1499 WMI_10_2_PEER_MCAST_GROUP_CMDID,
1500 WMI_10_2_BCN_TX_CMDID,
1501 WMI_10_2_BCN_PRB_TMPL_CMDID,
1502 WMI_10_2_BCN_FILTER_RX_CMDID,
1503 WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
1504 WMI_10_2_MGMT_TX_CMDID,
1505 WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
1506 WMI_10_2_ADDBA_SEND_CMDID,
1507 WMI_10_2_ADDBA_STATUS_CMDID,
1508 WMI_10_2_DELBA_SEND_CMDID,
1509 WMI_10_2_ADDBA_SET_RESP_CMDID,
1510 WMI_10_2_SEND_SINGLEAMSDU_CMDID,
1511 WMI_10_2_STA_POWERSAVE_MODE_CMDID,
1512 WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
1513 WMI_10_2_STA_MIMO_PS_MODE_CMDID,
1514 WMI_10_2_DBGLOG_CFG_CMDID,
1515 WMI_10_2_PDEV_DFS_ENABLE_CMDID,
1516 WMI_10_2_PDEV_DFS_DISABLE_CMDID,
1517 WMI_10_2_PDEV_QVIT_CMDID,
1518 WMI_10_2_ROAM_SCAN_MODE,
1519 WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
1520 WMI_10_2_ROAM_SCAN_PERIOD,
1521 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1522 WMI_10_2_ROAM_AP_PROFILE,
1523 WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
1524 WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
1525 WMI_10_2_OFL_SCAN_PERIOD,
1526 WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
1527 WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
1528 WMI_10_2_P2P_GO_SET_BEACON_IE,
1529 WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
1530 WMI_10_2_AP_PS_PEER_PARAM_CMDID,
1531 WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
1532 WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
1533 WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
1534 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1535 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1536 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1537 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1538 WMI_10_2_PDEV_SUSPEND_CMDID,
1539 WMI_10_2_PDEV_RESUME_CMDID,
1540 WMI_10_2_ADD_BCN_FILTER_CMDID,
1541 WMI_10_2_RMV_BCN_FILTER_CMDID,
1542 WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
1543 WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
1544 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1545 WMI_10_2_WOW_ENABLE_CMDID,
1546 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1547 WMI_10_2_RTT_MEASREQ_CMDID,
1548 WMI_10_2_RTT_TSF_CMDID,
1549 WMI_10_2_RTT_KEEPALIVE_CMDID,
1550 WMI_10_2_PDEV_SEND_BCN_CMDID,
1551 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1552 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1553 WMI_10_2_REQUEST_STATS_CMDID,
1554 WMI_10_2_GPIO_CONFIG_CMDID,
1555 WMI_10_2_GPIO_OUTPUT_CMDID,
1556 WMI_10_2_VDEV_RATEMASK_CMDID,
1557 WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
1558 WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
1559 WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
1560 WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
1561 WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
1562 WMI_10_2_FORCE_FW_HANG_CMDID,
1563 WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
1564 WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
1565 WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
1566 WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
1567 WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001568 WMI_10_2_PDEV_GET_INFO,
1569 WMI_10_2_VDEV_GET_INFO,
1570 WMI_10_2_VDEV_ATF_REQUEST_CMDID,
1571 WMI_10_2_PEER_ATF_REQUEST_CMDID,
1572 WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
Maharaja62f77f02015-10-21 11:49:18 +03001573 WMI_10_2_MU_CAL_START_CMDID,
1574 WMI_10_2_SET_LTEU_CONFIG_CMDID,
1575 WMI_10_2_SET_CCA_PARAMS,
Rajkumar Manoharandd2c5fc2016-04-27 16:23:19 +05301576 WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
Michal Kazior24c88f72014-07-25 13:32:17 +02001577 WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
1578};
1579
1580enum wmi_10_2_event_id {
1581 WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
1582 WMI_10_2_READY_EVENTID,
1583 WMI_10_2_DEBUG_MESG_EVENTID,
1584 WMI_10_2_START_EVENTID = 0x9000,
1585 WMI_10_2_END_EVENTID = 0x9FFF,
1586 WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
1587 WMI_10_2_ECHO_EVENTID,
1588 WMI_10_2_UPDATE_STATS_EVENTID,
1589 WMI_10_2_INST_RSSI_STATS_EVENTID,
1590 WMI_10_2_VDEV_START_RESP_EVENTID,
1591 WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
1592 WMI_10_2_VDEV_RESUME_REQ_EVENTID,
1593 WMI_10_2_VDEV_STOPPED_EVENTID,
1594 WMI_10_2_PEER_STA_KICKOUT_EVENTID,
1595 WMI_10_2_HOST_SWBA_EVENTID,
1596 WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
1597 WMI_10_2_MGMT_RX_EVENTID,
1598 WMI_10_2_CHAN_INFO_EVENTID,
1599 WMI_10_2_PHYERR_EVENTID,
1600 WMI_10_2_ROAM_EVENTID,
1601 WMI_10_2_PROFILE_MATCH,
1602 WMI_10_2_DEBUG_PRINT_EVENTID,
1603 WMI_10_2_PDEV_QVIT_EVENTID,
1604 WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
1605 WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
1606 WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
1607 WMI_10_2_RTT_ERROR_REPORT_EVENTID,
1608 WMI_10_2_RTT_KEEPALIVE_EVENTID,
1609 WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
1610 WMI_10_2_DCS_INTERFERENCE_EVENTID,
1611 WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
1612 WMI_10_2_GPIO_INPUT_EVENTID,
1613 WMI_10_2_PEER_RATECODE_LIST_EVENTID,
1614 WMI_10_2_GENERIC_BUFFER_EVENTID,
1615 WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
1616 WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
1617 WMI_10_2_WDS_PEER_EVENTID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001618 WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
1619 WMI_10_2_PDEV_TEMPERATURE_EVENTID,
Rajkumar Manoharandd2c5fc2016-04-27 16:23:19 +05301620 WMI_10_2_MU_REPORT_EVENTID,
1621 WMI_10_2_PDEV_BSS_CHAN_INFO_EVENTID,
Michal Kazior24c88f72014-07-25 13:32:17 +02001622 WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
1623};
1624
Raja Mani2d491e62015-06-22 20:10:11 +05301625enum wmi_10_4_cmd_id {
1626 WMI_10_4_START_CMDID = 0x9000,
1627 WMI_10_4_END_CMDID = 0x9FFF,
1628 WMI_10_4_INIT_CMDID,
1629 WMI_10_4_START_SCAN_CMDID = WMI_10_4_START_CMDID,
1630 WMI_10_4_STOP_SCAN_CMDID,
1631 WMI_10_4_SCAN_CHAN_LIST_CMDID,
1632 WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID,
1633 WMI_10_4_SCAN_UPDATE_REQUEST_CMDID,
1634 WMI_10_4_ECHO_CMDID,
1635 WMI_10_4_PDEV_SET_REGDOMAIN_CMDID,
1636 WMI_10_4_PDEV_SET_CHANNEL_CMDID,
1637 WMI_10_4_PDEV_SET_PARAM_CMDID,
1638 WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID,
1639 WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID,
1640 WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID,
1641 WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID,
1642 WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID,
1643 WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID,
1644 WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID,
1645 WMI_10_4_PDEV_SET_QUIET_MODE_CMDID,
1646 WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1647 WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID,
1648 WMI_10_4_VDEV_CREATE_CMDID,
1649 WMI_10_4_VDEV_DELETE_CMDID,
1650 WMI_10_4_VDEV_START_REQUEST_CMDID,
1651 WMI_10_4_VDEV_RESTART_REQUEST_CMDID,
1652 WMI_10_4_VDEV_UP_CMDID,
1653 WMI_10_4_VDEV_STOP_CMDID,
1654 WMI_10_4_VDEV_DOWN_CMDID,
1655 WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID,
1656 WMI_10_4_VDEV_RESUME_RESPONSE_CMDID,
1657 WMI_10_4_VDEV_SET_PARAM_CMDID,
1658 WMI_10_4_VDEV_INSTALL_KEY_CMDID,
1659 WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID,
1660 WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID,
1661 WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID,
1662 WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID,
1663 WMI_10_4_PEER_CREATE_CMDID,
1664 WMI_10_4_PEER_DELETE_CMDID,
1665 WMI_10_4_PEER_FLUSH_TIDS_CMDID,
1666 WMI_10_4_PEER_SET_PARAM_CMDID,
1667 WMI_10_4_PEER_ASSOC_CMDID,
1668 WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID,
1669 WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID,
1670 WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID,
1671 WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID,
1672 WMI_10_4_PEER_MCAST_GROUP_CMDID,
1673 WMI_10_4_BCN_TX_CMDID,
1674 WMI_10_4_PDEV_SEND_BCN_CMDID,
1675 WMI_10_4_BCN_PRB_TMPL_CMDID,
1676 WMI_10_4_BCN_FILTER_RX_CMDID,
1677 WMI_10_4_PRB_REQ_FILTER_RX_CMDID,
1678 WMI_10_4_MGMT_TX_CMDID,
1679 WMI_10_4_PRB_TMPL_CMDID,
1680 WMI_10_4_ADDBA_CLEAR_RESP_CMDID,
1681 WMI_10_4_ADDBA_SEND_CMDID,
1682 WMI_10_4_ADDBA_STATUS_CMDID,
1683 WMI_10_4_DELBA_SEND_CMDID,
1684 WMI_10_4_ADDBA_SET_RESP_CMDID,
1685 WMI_10_4_SEND_SINGLEAMSDU_CMDID,
1686 WMI_10_4_STA_POWERSAVE_MODE_CMDID,
1687 WMI_10_4_STA_POWERSAVE_PARAM_CMDID,
1688 WMI_10_4_STA_MIMO_PS_MODE_CMDID,
1689 WMI_10_4_DBGLOG_CFG_CMDID,
1690 WMI_10_4_PDEV_DFS_ENABLE_CMDID,
1691 WMI_10_4_PDEV_DFS_DISABLE_CMDID,
1692 WMI_10_4_PDEV_QVIT_CMDID,
1693 WMI_10_4_ROAM_SCAN_MODE,
1694 WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD,
1695 WMI_10_4_ROAM_SCAN_PERIOD,
1696 WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1697 WMI_10_4_ROAM_AP_PROFILE,
1698 WMI_10_4_OFL_SCAN_ADD_AP_PROFILE,
1699 WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE,
1700 WMI_10_4_OFL_SCAN_PERIOD,
1701 WMI_10_4_P2P_DEV_SET_DEVICE_INFO,
1702 WMI_10_4_P2P_DEV_SET_DISCOVERABILITY,
1703 WMI_10_4_P2P_GO_SET_BEACON_IE,
1704 WMI_10_4_P2P_GO_SET_PROBE_RESP_IE,
1705 WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID,
1706 WMI_10_4_AP_PS_PEER_PARAM_CMDID,
1707 WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID,
1708 WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID,
1709 WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID,
1710 WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1711 WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1712 WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1713 WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1714 WMI_10_4_PDEV_SUSPEND_CMDID,
1715 WMI_10_4_PDEV_RESUME_CMDID,
1716 WMI_10_4_ADD_BCN_FILTER_CMDID,
1717 WMI_10_4_RMV_BCN_FILTER_CMDID,
1718 WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID,
1719 WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID,
1720 WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1721 WMI_10_4_WOW_ENABLE_CMDID,
1722 WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1723 WMI_10_4_RTT_MEASREQ_CMDID,
1724 WMI_10_4_RTT_TSF_CMDID,
1725 WMI_10_4_RTT_KEEPALIVE_CMDID,
1726 WMI_10_4_OEM_REQ_CMDID,
1727 WMI_10_4_NAN_CMDID,
1728 WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1729 WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1730 WMI_10_4_REQUEST_STATS_CMDID,
1731 WMI_10_4_GPIO_CONFIG_CMDID,
1732 WMI_10_4_GPIO_OUTPUT_CMDID,
1733 WMI_10_4_VDEV_RATEMASK_CMDID,
1734 WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID,
1735 WMI_10_4_GTK_OFFLOAD_CMDID,
1736 WMI_10_4_QBOOST_CFG_CMDID,
1737 WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID,
1738 WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID,
1739 WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
1740 WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
1741 WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
1742 WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
1743 WMI_10_4_VDEV_SET_KEEPALIVE_CMDID,
1744 WMI_10_4_VDEV_GET_KEEPALIVE_CMDID,
1745 WMI_10_4_FORCE_FW_HANG_CMDID,
1746 WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
1747 WMI_10_4_PDEV_SET_CTL_TABLE_CMDID,
1748 WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID,
1749 WMI_10_4_PDEV_RATEPWR_TABLE_CMDID,
1750 WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
1751 WMI_10_4_PDEV_FIPS_CMDID,
1752 WMI_10_4_TT_SET_CONF_CMDID,
1753 WMI_10_4_FWTEST_CMDID,
1754 WMI_10_4_VDEV_ATF_REQUEST_CMDID,
1755 WMI_10_4_PEER_ATF_REQUEST_CMDID,
1756 WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID,
1757 WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID,
1758 WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID,
1759 WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID,
1760 WMI_10_4_PDEV_GET_TPC_CMDID,
1761 WMI_10_4_PDEV_GET_AST_INFO_CMDID,
1762 WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID,
1763 WMI_10_4_PDEV_GET_TEMPERATURE_CMDID,
1764 WMI_10_4_PDEV_GET_INFO_CMDID,
1765 WMI_10_4_VDEV_GET_INFO_CMDID,
1766 WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID,
1767 WMI_10_4_MU_CAL_START_CMDID,
1768 WMI_10_4_SET_CCA_PARAMS_CMDID,
1769 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
Vasanthakumar Thiagarajan69d43152015-10-29 19:11:33 +05301770 WMI_10_4_EXT_RESOURCE_CFG_CMDID,
1771 WMI_10_4_VDEV_SET_IE_CMDID,
1772 WMI_10_4_SET_LTEU_CONFIG_CMDID,
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03001773 WMI_10_4_ATF_SSID_GROUPING_REQUEST_CMDID,
1774 WMI_10_4_PEER_ATF_EXT_REQUEST_CMDID,
1775 WMI_10_4_SET_PERIODIC_CHANNEL_STATS_CONFIG,
1776 WMI_10_4_PEER_BWF_REQUEST_CMDID,
1777 WMI_10_4_BTCOEX_CFG_CMDID,
1778 WMI_10_4_PEER_TX_MU_TXMIT_COUNT_CMDID,
1779 WMI_10_4_PEER_TX_MU_TXMIT_RSTCNT_CMDID,
1780 WMI_10_4_PEER_GID_USERPOS_LIST_CMDID,
1781 WMI_10_4_PDEV_CHECK_CAL_VERSION_CMDID,
1782 WMI_10_4_COEX_VERSION_CFG_CMID,
1783 WMI_10_4_PDEV_GET_RX_FILTER_CMDID,
1784 WMI_10_4_PDEV_EXTENDED_NSS_CFG_CMDID,
1785 WMI_10_4_VDEV_SET_SCAN_NAC_RSSI_CMDID,
1786 WMI_10_4_PROG_GPIO_BAND_SELECT_CMDID,
1787 WMI_10_4_CONFIG_SMART_LOGGING_CMDID,
1788 WMI_10_4_DEBUG_FATAL_CONDITION_CMDID,
1789 WMI_10_4_GET_TSF_TIMER_CMDID,
1790 WMI_10_4_PDEV_GET_TPC_TABLE_CMDID,
1791 WMI_10_4_VDEV_SIFS_TRIGGER_TIME_CMDID,
1792 WMI_10_4_PDEV_WDS_ENTRY_LIST_CMDID,
1793 WMI_10_4_TDLS_SET_STATE_CMDID,
1794 WMI_10_4_TDLS_PEER_UPDATE_CMDID,
1795 WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID,
Raja Mani2d491e62015-06-22 20:10:11 +05301796 WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
1797};
1798
1799enum wmi_10_4_event_id {
1800 WMI_10_4_SERVICE_READY_EVENTID = 0x8000,
1801 WMI_10_4_READY_EVENTID,
1802 WMI_10_4_DEBUG_MESG_EVENTID,
1803 WMI_10_4_START_EVENTID = 0x9000,
1804 WMI_10_4_END_EVENTID = 0x9FFF,
1805 WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID,
1806 WMI_10_4_ECHO_EVENTID,
1807 WMI_10_4_UPDATE_STATS_EVENTID,
1808 WMI_10_4_INST_RSSI_STATS_EVENTID,
1809 WMI_10_4_VDEV_START_RESP_EVENTID,
1810 WMI_10_4_VDEV_STANDBY_REQ_EVENTID,
1811 WMI_10_4_VDEV_RESUME_REQ_EVENTID,
1812 WMI_10_4_VDEV_STOPPED_EVENTID,
1813 WMI_10_4_PEER_STA_KICKOUT_EVENTID,
1814 WMI_10_4_HOST_SWBA_EVENTID,
1815 WMI_10_4_TBTTOFFSET_UPDATE_EVENTID,
1816 WMI_10_4_MGMT_RX_EVENTID,
1817 WMI_10_4_CHAN_INFO_EVENTID,
1818 WMI_10_4_PHYERR_EVENTID,
1819 WMI_10_4_ROAM_EVENTID,
1820 WMI_10_4_PROFILE_MATCH,
1821 WMI_10_4_DEBUG_PRINT_EVENTID,
1822 WMI_10_4_PDEV_QVIT_EVENTID,
1823 WMI_10_4_WLAN_PROFILE_DATA_EVENTID,
1824 WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID,
1825 WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID,
1826 WMI_10_4_RTT_ERROR_REPORT_EVENTID,
1827 WMI_10_4_RTT_KEEPALIVE_EVENTID,
1828 WMI_10_4_OEM_CAPABILITY_EVENTID,
1829 WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID,
1830 WMI_10_4_OEM_ERROR_REPORT_EVENTID,
1831 WMI_10_4_NAN_EVENTID,
1832 WMI_10_4_WOW_WAKEUP_HOST_EVENTID,
1833 WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID,
1834 WMI_10_4_GTK_REKEY_FAIL_EVENTID,
1835 WMI_10_4_DCS_INTERFERENCE_EVENTID,
1836 WMI_10_4_PDEV_TPC_CONFIG_EVENTID,
1837 WMI_10_4_CSA_HANDLING_EVENTID,
1838 WMI_10_4_GPIO_INPUT_EVENTID,
1839 WMI_10_4_PEER_RATECODE_LIST_EVENTID,
1840 WMI_10_4_GENERIC_BUFFER_EVENTID,
1841 WMI_10_4_MCAST_BUF_RELEASE_EVENTID,
1842 WMI_10_4_MCAST_LIST_AGEOUT_EVENTID,
1843 WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID,
1844 WMI_10_4_WDS_PEER_EVENTID,
1845 WMI_10_4_PEER_STA_PS_STATECHG_EVENTID,
1846 WMI_10_4_PDEV_FIPS_EVENTID,
1847 WMI_10_4_TT_STATS_EVENTID,
1848 WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID,
1849 WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID,
1850 WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID,
1851 WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID,
1852 WMI_10_4_PDEV_NFCAL_POWER_EVENTID,
1853 WMI_10_4_PDEV_TPC_EVENTID,
1854 WMI_10_4_PDEV_GET_AST_INFO_EVENTID,
1855 WMI_10_4_PDEV_TEMPERATURE_EVENTID,
1856 WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID,
1857 WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID,
Vasanthakumar Thiagarajan69d43152015-10-29 19:11:33 +05301858 WMI_10_4_MU_REPORT_EVENTID,
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03001859 WMI_10_4_TX_DATA_TRAFFIC_CTRL_EVENTID,
1860 WMI_10_4_PEER_TX_MU_TXMIT_COUNT_EVENTID,
1861 WMI_10_4_PEER_GID_USERPOS_LIST_EVENTID,
1862 WMI_10_4_PDEV_CHECK_CAL_VERSION_EVENTID,
1863 WMI_10_4_ATF_PEER_STATS_EVENTID,
1864 WMI_10_4_PDEV_GET_RX_FILTER_EVENTID,
1865 WMI_10_4_NAC_RSSI_EVENTID,
1866 WMI_10_4_DEBUG_FATAL_CONDITION_EVENTID,
1867 WMI_10_4_GET_TSF_TIMER_RESP_EVENTID,
1868 WMI_10_4_PDEV_TPC_TABLE_EVENTID,
1869 WMI_10_4_PDEV_WDS_ENTRY_LIST_EVENTID,
1870 WMI_10_4_TDLS_PEER_EVENTID,
Raja Mani2d491e62015-06-22 20:10:11 +05301871 WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
1872};
1873
Kalle Valo5e3dd152013-06-12 20:52:10 +03001874enum wmi_phy_mode {
1875 MODE_11A = 0, /* 11a Mode */
1876 MODE_11G = 1, /* 11b/g Mode */
1877 MODE_11B = 2, /* 11b Mode */
1878 MODE_11GONLY = 3, /* 11g only Mode */
1879 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
1880 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
1881 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
1882 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
1883 MODE_11AC_VHT20 = 8,
1884 MODE_11AC_VHT40 = 9,
1885 MODE_11AC_VHT80 = 10,
1886 /* MODE_11AC_VHT160 = 11, */
1887 MODE_11AC_VHT20_2G = 11,
1888 MODE_11AC_VHT40_2G = 12,
1889 MODE_11AC_VHT80_2G = 13,
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02001890 MODE_11AC_VHT80_80 = 14,
1891 MODE_11AC_VHT160 = 15,
1892 MODE_UNKNOWN = 16,
1893 MODE_MAX = 16
Kalle Valo5e3dd152013-06-12 20:52:10 +03001894};
1895
Kalle Valo38a1d472013-09-08 17:56:14 +03001896static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
1897{
1898 switch (mode) {
1899 case MODE_11A:
1900 return "11a";
1901 case MODE_11G:
1902 return "11g";
1903 case MODE_11B:
1904 return "11b";
1905 case MODE_11GONLY:
1906 return "11gonly";
1907 case MODE_11NA_HT20:
1908 return "11na-ht20";
1909 case MODE_11NG_HT20:
1910 return "11ng-ht20";
1911 case MODE_11NA_HT40:
1912 return "11na-ht40";
1913 case MODE_11NG_HT40:
1914 return "11ng-ht40";
1915 case MODE_11AC_VHT20:
1916 return "11ac-vht20";
1917 case MODE_11AC_VHT40:
1918 return "11ac-vht40";
1919 case MODE_11AC_VHT80:
1920 return "11ac-vht80";
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02001921 case MODE_11AC_VHT160:
1922 return "11ac-vht160";
1923 case MODE_11AC_VHT80_80:
1924 return "11ac-vht80+80";
Kalle Valo38a1d472013-09-08 17:56:14 +03001925 case MODE_11AC_VHT20_2G:
1926 return "11ac-vht20-2g";
1927 case MODE_11AC_VHT40_2G:
1928 return "11ac-vht40-2g";
1929 case MODE_11AC_VHT80_2G:
1930 return "11ac-vht80-2g";
1931 case MODE_UNKNOWN:
1932 /* skip */
1933 break;
1934
1935 /* no default handler to allow compiler to check that the
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01001936 * enum is fully handled
1937 */
Kalle Valo38a1d472013-09-08 17:56:14 +03001938 };
1939
1940 return "<unknown>";
1941}
1942
Kalle Valo5e3dd152013-06-12 20:52:10 +03001943#define WMI_CHAN_LIST_TAG 0x1
1944#define WMI_SSID_LIST_TAG 0x2
1945#define WMI_BSSID_LIST_TAG 0x3
1946#define WMI_IE_TAG 0x4
1947
1948struct wmi_channel {
1949 __le32 mhz;
1950 __le32 band_center_freq1;
1951 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
1952 union {
1953 __le32 flags; /* WMI_CHAN_FLAG_ */
1954 struct {
1955 u8 mode; /* only 6 LSBs */
1956 } __packed;
1957 } __packed;
1958 union {
1959 __le32 reginfo0;
1960 struct {
Michal Kazior02256932013-10-23 04:02:14 -07001961 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001962 u8 min_power;
1963 u8 max_power;
1964 u8 reg_power;
1965 u8 reg_classid;
1966 } __packed;
1967 } __packed;
1968 union {
1969 __le32 reginfo1;
1970 struct {
1971 u8 antenna_max;
Alan Liu513527c2016-04-26 14:41:33 +03001972 u8 max_tx_power;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001973 } __packed;
1974 } __packed;
1975} __packed;
1976
1977struct wmi_channel_arg {
1978 u32 freq;
1979 u32 band_center_freq1;
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02001980 u32 band_center_freq2;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001981 bool passive;
1982 bool allow_ibss;
1983 bool allow_ht;
1984 bool allow_vht;
1985 bool ht40plus;
Marek Puzyniake8a50f82013-11-20 09:59:47 +02001986 bool chan_radar;
Michal Kazior02256932013-10-23 04:02:14 -07001987 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001988 u32 min_power;
1989 u32 max_power;
1990 u32 max_reg_power;
1991 u32 max_antenna_gain;
1992 u32 reg_class_id;
1993 enum wmi_phy_mode mode;
1994};
1995
1996enum wmi_channel_change_cause {
1997 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
1998 WMI_CHANNEL_CHANGE_CAUSE_CSA,
1999};
2000
2001#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
2002#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
2003#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
2004#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
2005#define WMI_CHAN_FLAG_DFS (1 << 10)
2006#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
2007#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
2008
2009/* Indicate reason for channel switch */
2010#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
2011
Raja Mani5c8726e2015-06-22 20:22:26 +05302012#define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002013
2014/* HT Capabilities*/
2015#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
2016#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
2017#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
2018#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
2019#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
2020#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
2021#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
2022#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
2023#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
2024#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
2025#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
2026#define WMI_HT_CAP_HT40_SGI 0x0800
2027
2028#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
2029 WMI_HT_CAP_HT20_SGI | \
2030 WMI_HT_CAP_HT40_SGI | \
2031 WMI_HT_CAP_TX_STBC | \
2032 WMI_HT_CAP_RX_STBC | \
2033 WMI_HT_CAP_LDPC)
2034
Kalle Valo5e3dd152013-06-12 20:52:10 +03002035/*
2036 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
2037 * field. The fields not defined here are not supported, or reserved.
2038 * Do not change these masks and if you have to add new one follow the
2039 * bitmask as specified by 802.11ac draft.
2040 */
2041
2042#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
2043#define WMI_VHT_CAP_RX_LDPC 0x00000010
2044#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02002045#define WMI_VHT_CAP_SGI_160MHZ 0x00000040
Kalle Valo5e3dd152013-06-12 20:52:10 +03002046#define WMI_VHT_CAP_TX_STBC 0x00000080
2047#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
2048#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02002049#define WMI_VHT_CAP_SU_BFER 0x00000800
2050#define WMI_VHT_CAP_SU_BFEE 0x00001000
2051#define WMI_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
2052#define WMI_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
2053#define WMI_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
2054#define WMI_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
2055#define WMI_VHT_CAP_MU_BFER 0x00080000
2056#define WMI_VHT_CAP_MU_BFEE 0x00100000
Kalle Valo5e3dd152013-06-12 20:52:10 +03002057#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
2058#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
2059#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
2060#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
2061
2062/* The following also refer for max HT AMSDU */
2063#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
2064#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
2065#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
2066
2067#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
2068 WMI_VHT_CAP_RX_LDPC | \
2069 WMI_VHT_CAP_SGI_80MHZ | \
2070 WMI_VHT_CAP_TX_STBC | \
2071 WMI_VHT_CAP_RX_STBC_MASK | \
2072 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
2073 WMI_VHT_CAP_RX_FIXED_ANT | \
2074 WMI_VHT_CAP_TX_FIXED_ANT)
2075
2076/*
2077 * Interested readers refer to Rx/Tx MCS Map definition as defined in
2078 * 802.11ac
2079 */
2080#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
2081#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
2082#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
2083
2084enum {
2085 REGDMN_MODE_11A = 0x00001, /* 11a channels */
2086 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
2087 REGDMN_MODE_11B = 0x00004, /* 11b channels */
2088 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
2089 REGDMN_MODE_11G = 0x00008, /* XXX historical */
2090 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
2091 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
2092 REGDMN_MODE_XR = 0x00100, /* XR channels */
2093 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
2094 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
2095 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
2096 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
2097 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
2098 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
2099 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
2100 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
2101 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
2102 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
2103 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
2104 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02002105 REGDMN_MODE_11AC_VHT160 = 0x200000, /* 5Ghz, VHT160 channels */
2106 REGDMN_MODE_11AC_VHT80_80 = 0x400000, /* 5Ghz, VHT80+80 channels */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002107 REGDMN_MODE_ALL = 0xffffffff
2108};
2109
2110#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
2111#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
2112#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
2113
2114/* regulatory capabilities */
2115#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
2116#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
2117#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
2118#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
2119#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
2120#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
2121
2122struct hal_reg_capabilities {
2123 /* regdomain value specified in EEPROM */
2124 __le32 eeprom_rd;
2125 /*regdomain */
2126 __le32 eeprom_rd_ext;
2127 /* CAP1 capabilities bit map. */
2128 __le32 regcap1;
2129 /* REGDMN EEPROM CAP. */
2130 __le32 regcap2;
2131 /* REGDMN MODE */
2132 __le32 wireless_modes;
2133 __le32 low_2ghz_chan;
2134 __le32 high_2ghz_chan;
2135 __le32 low_5ghz_chan;
2136 __le32 high_5ghz_chan;
2137} __packed;
2138
2139enum wlan_mode_capability {
2140 WHAL_WLAN_11A_CAPABILITY = 0x1,
2141 WHAL_WLAN_11G_CAPABILITY = 0x2,
2142 WHAL_WLAN_11AG_CAPABILITY = 0x3,
2143};
2144
2145/* structure used by FW for requesting host memory */
2146struct wlan_host_mem_req {
2147 /* ID of the request */
2148 __le32 req_id;
2149 /* size of the of each unit */
2150 __le32 unit_size;
2151 /* flags to indicate that
2152 * the number units is dependent
2153 * on number of resources(num vdevs num peers .. etc)
2154 */
2155 __le32 num_unit_info;
2156 /*
2157 * actual number of units to allocate . if flags in the num_unit_info
2158 * indicate that number of units is tied to number of a particular
2159 * resource to allocate then num_units filed is set to 0 and host
2160 * will derive the number units from number of the resources it is
2161 * requesting.
2162 */
2163 __le32 num_units;
2164} __packed;
2165
Kalle Valo5e3dd152013-06-12 20:52:10 +03002166/*
2167 * The following struct holds optional payload for
2168 * wmi_service_ready_event,e.g., 11ac pass some of the
2169 * device capability to the host.
2170 */
2171struct wmi_service_ready_event {
2172 __le32 sw_version;
2173 __le32 sw_version_1;
2174 __le32 abi_version;
2175 /* WMI_PHY_CAPABILITY */
2176 __le32 phy_capability;
2177 /* Maximum number of frag table entries that SW will populate less 1 */
2178 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02002179 __le32 wmi_service_bitmap[16];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002180 __le32 num_rf_chains;
2181 /*
2182 * The following field is only valid for service type
2183 * WMI_SERVICE_11AC
2184 */
2185 __le32 ht_cap_info; /* WMI HT Capability */
2186 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
2187 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
2188 __le32 hw_min_tx_power;
2189 __le32 hw_max_tx_power;
2190 struct hal_reg_capabilities hal_reg_capabilities;
2191 __le32 sys_cap_info;
2192 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
2193 /*
2194 * Max beacon and Probe Response IE offload size
2195 * (includes optional P2P IEs)
2196 */
2197 __le32 max_bcn_ie_size;
2198 /*
2199 * request to host to allocate a chuck of memory and pss it down to FW
2200 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
2201 * data structures. Only valid for low latency interfaces like PCIE
2202 * where FW can access this memory directly (or) by DMA.
2203 */
2204 __le32 num_mem_reqs;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02002205 struct wlan_host_mem_req mem_reqs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002206} __packed;
2207
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002208/* This is the definition from 10.X firmware branch */
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02002209struct wmi_10x_service_ready_event {
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002210 __le32 sw_version;
2211 __le32 abi_version;
2212
2213 /* WMI_PHY_CAPABILITY */
2214 __le32 phy_capability;
2215
2216 /* Maximum number of frag table entries that SW will populate less 1 */
2217 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02002218 __le32 wmi_service_bitmap[16];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002219 __le32 num_rf_chains;
2220
2221 /*
2222 * The following field is only valid for service type
2223 * WMI_SERVICE_11AC
2224 */
2225 __le32 ht_cap_info; /* WMI HT Capability */
2226 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
2227 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
2228 __le32 hw_min_tx_power;
2229 __le32 hw_max_tx_power;
2230
2231 struct hal_reg_capabilities hal_reg_capabilities;
2232
2233 __le32 sys_cap_info;
2234 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
2235
2236 /*
2237 * request to host to allocate a chuck of memory and pss it down to FW
2238 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
2239 * data structures. Only valid for low latency interfaces like PCIE
2240 * where FW can access this memory directly (or) by DMA.
2241 */
2242 __le32 num_mem_reqs;
2243
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02002244 struct wlan_host_mem_req mem_reqs[0];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002245} __packed;
2246
Kalle Valo14e105c2016-04-13 14:13:21 +03002247#define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ)
2248#define WMI_UNIFIED_READY_TIMEOUT_HZ (5 * HZ)
Kalle Valo5e3dd152013-06-12 20:52:10 +03002249
2250struct wmi_ready_event {
2251 __le32 sw_version;
2252 __le32 abi_version;
2253 struct wmi_mac_addr mac_addr;
2254 __le32 status;
2255} __packed;
2256
2257struct wmi_resource_config {
2258 /* number of virtual devices (VAPs) to support */
2259 __le32 num_vdevs;
2260
2261 /* number of peer nodes to support */
2262 __le32 num_peers;
2263
2264 /*
2265 * In offload mode target supports features like WOW, chatter and
2266 * other protocol offloads. In order to support them some
2267 * functionalities like reorder buffering, PN checking need to be
Joe Perchese13dbea2016-09-26 21:56:21 +03002268 * done in target. This determines maximum number of peers supported
Kalle Valo5e3dd152013-06-12 20:52:10 +03002269 * by target in offload mode
2270 */
2271 __le32 num_offload_peers;
2272
2273 /* For target-based RX reordering */
2274 __le32 num_offload_reorder_bufs;
2275
2276 /* number of keys per peer */
2277 __le32 num_peer_keys;
2278
2279 /* total number of TX/RX data TIDs */
2280 __le32 num_tids;
2281
2282 /*
2283 * max skid for resolving hash collisions
2284 *
2285 * The address search table is sparse, so that if two MAC addresses
2286 * result in the same hash value, the second of these conflicting
2287 * entries can slide to the next index in the address search table,
2288 * and use it, if it is unoccupied. This ast_skid_limit parameter
2289 * specifies the upper bound on how many subsequent indices to search
2290 * over to find an unoccupied space.
2291 */
2292 __le32 ast_skid_limit;
2293
2294 /*
2295 * the nominal chain mask for transmit
2296 *
2297 * The chain mask may be modified dynamically, e.g. to operate AP
2298 * tx with a reduced number of chains if no clients are associated.
2299 * This configuration parameter specifies the nominal chain-mask that
2300 * should be used when not operating with a reduced set of tx chains.
2301 */
2302 __le32 tx_chain_mask;
2303
2304 /*
2305 * the nominal chain mask for receive
2306 *
2307 * The chain mask may be modified dynamically, e.g. for a client
2308 * to use a reduced number of chains for receive if the traffic to
2309 * the client is low enough that it doesn't require downlink MIMO
2310 * or antenna diversity.
2311 * This configuration parameter specifies the nominal chain-mask that
2312 * should be used when not operating with a reduced set of rx chains.
2313 */
2314 __le32 rx_chain_mask;
2315
2316 /*
2317 * what rx reorder timeout (ms) to use for the AC
2318 *
2319 * Each WMM access class (voice, video, best-effort, background) will
2320 * have its own timeout value to dictate how long to wait for missing
2321 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2322 * already been received.
2323 * This parameter specifies the timeout in milliseconds for each
2324 * class.
2325 */
2326 __le32 rx_timeout_pri_vi;
2327 __le32 rx_timeout_pri_vo;
2328 __le32 rx_timeout_pri_be;
2329 __le32 rx_timeout_pri_bk;
2330
2331 /*
2332 * what mode the rx should decap packets to
2333 *
2334 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2335 * THis setting also determines the default TX behavior, however TX
2336 * behavior can be modified on a per VAP basis during VAP init
2337 */
2338 __le32 rx_decap_mode;
2339
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002340 /* what is the maximum number of scan requests that can be queued */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002341 __le32 scan_max_pending_reqs;
2342
2343 /* maximum VDEV that could use BMISS offload */
2344 __le32 bmiss_offload_max_vdev;
2345
2346 /* maximum VDEV that could use offload roaming */
2347 __le32 roam_offload_max_vdev;
2348
2349 /* maximum AP profiles that would push to offload roaming */
2350 __le32 roam_offload_max_ap_profiles;
2351
2352 /*
2353 * how many groups to use for mcast->ucast conversion
2354 *
2355 * The target's WAL maintains a table to hold information regarding
2356 * which peers belong to a given multicast group, so that if
2357 * multicast->unicast conversion is enabled, the target can convert
2358 * multicast tx frames to a series of unicast tx frames, to each
2359 * peer within the multicast group.
2360 This num_mcast_groups configuration parameter tells the target how
2361 * many multicast groups to provide storage for within its multicast
2362 * group membership table.
2363 */
2364 __le32 num_mcast_groups;
2365
2366 /*
2367 * size to alloc for the mcast membership table
2368 *
2369 * This num_mcast_table_elems configuration parameter tells the
2370 * target how many peer elements it needs to provide storage for in
2371 * its multicast group membership table.
2372 * These multicast group membership table elements are shared by the
2373 * multicast groups stored within the table.
2374 */
2375 __le32 num_mcast_table_elems;
2376
2377 /*
2378 * whether/how to do multicast->unicast conversion
2379 *
2380 * This configuration parameter specifies whether the target should
2381 * perform multicast --> unicast conversion on transmit, and if so,
2382 * what to do if it finds no entries in its multicast group
2383 * membership table for the multicast IP address in the tx frame.
2384 * Configuration value:
2385 * 0 -> Do not perform multicast to unicast conversion.
2386 * 1 -> Convert multicast frames to unicast, if the IP multicast
2387 * address from the tx frame is found in the multicast group
2388 * membership table. If the IP multicast address is not found,
2389 * drop the frame.
2390 * 2 -> Convert multicast frames to unicast, if the IP multicast
2391 * address from the tx frame is found in the multicast group
2392 * membership table. If the IP multicast address is not found,
2393 * transmit the frame as multicast.
2394 */
2395 __le32 mcast2ucast_mode;
2396
2397 /*
2398 * how much memory to allocate for a tx PPDU dbg log
2399 *
2400 * This parameter controls how much memory the target will allocate
2401 * to store a log of tx PPDU meta-information (how large the PPDU
2402 * was, when it was sent, whether it was successful, etc.)
2403 */
2404 __le32 tx_dbg_log_size;
2405
2406 /* how many AST entries to be allocated for WDS */
2407 __le32 num_wds_entries;
2408
2409 /*
2410 * MAC DMA burst size, e.g., For target PCI limit can be
2411 * 0 -default, 1 256B
2412 */
2413 __le32 dma_burst_size;
2414
2415 /*
2416 * Fixed delimiters to be inserted after every MPDU to
2417 * account for interface latency to avoid underrun.
2418 */
2419 __le32 mac_aggr_delim;
2420
2421 /*
2422 * determine whether target is responsible for detecting duplicate
2423 * non-aggregate MPDU and timing out stale fragments.
2424 *
2425 * A-MPDU reordering is always performed on the target.
2426 *
2427 * 0: target responsible for frag timeout and dup checking
2428 * 1: host responsible for frag timeout and dup checking
2429 */
2430 __le32 rx_skip_defrag_timeout_dup_detection_check;
2431
2432 /*
2433 * Configuration for VoW :
2434 * No of Video Nodes to be supported
2435 * and Max no of descriptors for each Video link (node).
2436 */
2437 __le32 vow_config;
2438
2439 /* maximum VDEV that could use GTK offload */
2440 __le32 gtk_offload_max_vdev;
2441
2442 /* Number of msdu descriptors target should use */
2443 __le32 num_msdu_desc;
2444
2445 /*
2446 * Max. number of Tx fragments per MSDU
2447 * This parameter controls the max number of Tx fragments per MSDU.
2448 * This is sent by the target as part of the WMI_SERVICE_READY event
Joe Perchese13dbea2016-09-26 21:56:21 +03002449 * and is overridden by the OS shim as required.
Kalle Valo5e3dd152013-06-12 20:52:10 +03002450 */
2451 __le32 max_frag_entries;
2452} __packed;
2453
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002454struct wmi_resource_config_10x {
2455 /* number of virtual devices (VAPs) to support */
2456 __le32 num_vdevs;
2457
2458 /* number of peer nodes to support */
2459 __le32 num_peers;
2460
2461 /* number of keys per peer */
2462 __le32 num_peer_keys;
2463
2464 /* total number of TX/RX data TIDs */
2465 __le32 num_tids;
2466
2467 /*
2468 * max skid for resolving hash collisions
2469 *
2470 * The address search table is sparse, so that if two MAC addresses
2471 * result in the same hash value, the second of these conflicting
2472 * entries can slide to the next index in the address search table,
2473 * and use it, if it is unoccupied. This ast_skid_limit parameter
2474 * specifies the upper bound on how many subsequent indices to search
2475 * over to find an unoccupied space.
2476 */
2477 __le32 ast_skid_limit;
2478
2479 /*
2480 * the nominal chain mask for transmit
2481 *
2482 * The chain mask may be modified dynamically, e.g. to operate AP
2483 * tx with a reduced number of chains if no clients are associated.
2484 * This configuration parameter specifies the nominal chain-mask that
2485 * should be used when not operating with a reduced set of tx chains.
2486 */
2487 __le32 tx_chain_mask;
2488
2489 /*
2490 * the nominal chain mask for receive
2491 *
2492 * The chain mask may be modified dynamically, e.g. for a client
2493 * to use a reduced number of chains for receive if the traffic to
2494 * the client is low enough that it doesn't require downlink MIMO
2495 * or antenna diversity.
2496 * This configuration parameter specifies the nominal chain-mask that
2497 * should be used when not operating with a reduced set of rx chains.
2498 */
2499 __le32 rx_chain_mask;
2500
2501 /*
2502 * what rx reorder timeout (ms) to use for the AC
2503 *
2504 * Each WMM access class (voice, video, best-effort, background) will
2505 * have its own timeout value to dictate how long to wait for missing
2506 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2507 * already been received.
2508 * This parameter specifies the timeout in milliseconds for each
2509 * class.
2510 */
2511 __le32 rx_timeout_pri_vi;
2512 __le32 rx_timeout_pri_vo;
2513 __le32 rx_timeout_pri_be;
2514 __le32 rx_timeout_pri_bk;
2515
2516 /*
2517 * what mode the rx should decap packets to
2518 *
2519 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2520 * THis setting also determines the default TX behavior, however TX
2521 * behavior can be modified on a per VAP basis during VAP init
2522 */
2523 __le32 rx_decap_mode;
2524
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002525 /* what is the maximum number of scan requests that can be queued */
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002526 __le32 scan_max_pending_reqs;
2527
2528 /* maximum VDEV that could use BMISS offload */
2529 __le32 bmiss_offload_max_vdev;
2530
2531 /* maximum VDEV that could use offload roaming */
2532 __le32 roam_offload_max_vdev;
2533
2534 /* maximum AP profiles that would push to offload roaming */
2535 __le32 roam_offload_max_ap_profiles;
2536
2537 /*
2538 * how many groups to use for mcast->ucast conversion
2539 *
2540 * The target's WAL maintains a table to hold information regarding
2541 * which peers belong to a given multicast group, so that if
2542 * multicast->unicast conversion is enabled, the target can convert
2543 * multicast tx frames to a series of unicast tx frames, to each
2544 * peer within the multicast group.
2545 This num_mcast_groups configuration parameter tells the target how
2546 * many multicast groups to provide storage for within its multicast
2547 * group membership table.
2548 */
2549 __le32 num_mcast_groups;
2550
2551 /*
2552 * size to alloc for the mcast membership table
2553 *
2554 * This num_mcast_table_elems configuration parameter tells the
2555 * target how many peer elements it needs to provide storage for in
2556 * its multicast group membership table.
2557 * These multicast group membership table elements are shared by the
2558 * multicast groups stored within the table.
2559 */
2560 __le32 num_mcast_table_elems;
2561
2562 /*
2563 * whether/how to do multicast->unicast conversion
2564 *
2565 * This configuration parameter specifies whether the target should
2566 * perform multicast --> unicast conversion on transmit, and if so,
2567 * what to do if it finds no entries in its multicast group
2568 * membership table for the multicast IP address in the tx frame.
2569 * Configuration value:
2570 * 0 -> Do not perform multicast to unicast conversion.
2571 * 1 -> Convert multicast frames to unicast, if the IP multicast
2572 * address from the tx frame is found in the multicast group
2573 * membership table. If the IP multicast address is not found,
2574 * drop the frame.
2575 * 2 -> Convert multicast frames to unicast, if the IP multicast
2576 * address from the tx frame is found in the multicast group
2577 * membership table. If the IP multicast address is not found,
2578 * transmit the frame as multicast.
2579 */
2580 __le32 mcast2ucast_mode;
2581
2582 /*
2583 * how much memory to allocate for a tx PPDU dbg log
2584 *
2585 * This parameter controls how much memory the target will allocate
2586 * to store a log of tx PPDU meta-information (how large the PPDU
2587 * was, when it was sent, whether it was successful, etc.)
2588 */
2589 __le32 tx_dbg_log_size;
2590
2591 /* how many AST entries to be allocated for WDS */
2592 __le32 num_wds_entries;
2593
2594 /*
2595 * MAC DMA burst size, e.g., For target PCI limit can be
2596 * 0 -default, 1 256B
2597 */
2598 __le32 dma_burst_size;
2599
2600 /*
2601 * Fixed delimiters to be inserted after every MPDU to
2602 * account for interface latency to avoid underrun.
2603 */
2604 __le32 mac_aggr_delim;
2605
2606 /*
2607 * determine whether target is responsible for detecting duplicate
2608 * non-aggregate MPDU and timing out stale fragments.
2609 *
2610 * A-MPDU reordering is always performed on the target.
2611 *
2612 * 0: target responsible for frag timeout and dup checking
2613 * 1: host responsible for frag timeout and dup checking
2614 */
2615 __le32 rx_skip_defrag_timeout_dup_detection_check;
2616
2617 /*
2618 * Configuration for VoW :
2619 * No of Video Nodes to be supported
2620 * and Max no of descriptors for each Video link (node).
2621 */
2622 __le32 vow_config;
2623
2624 /* Number of msdu descriptors target should use */
2625 __le32 num_msdu_desc;
2626
2627 /*
2628 * Max. number of Tx fragments per MSDU
2629 * This parameter controls the max number of Tx fragments per MSDU.
2630 * This is sent by the target as part of the WMI_SERVICE_READY event
Joe Perchese13dbea2016-09-26 21:56:21 +03002631 * and is overridden by the OS shim as required.
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002632 */
2633 __le32 max_frag_entries;
2634} __packed;
2635
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002636enum wmi_10_2_feature_mask {
2637 WMI_10_2_RX_BATCH_MODE = BIT(0),
2638 WMI_10_2_ATF_CONFIG = BIT(1),
Yanbo Lide0c789b2015-04-15 15:28:08 +03002639 WMI_10_2_COEX_GPIO = BIT(3),
Rajkumar Manoharandd2c5fc2016-04-27 16:23:19 +05302640 WMI_10_2_BSS_CHAN_INFO = BIT(6),
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +05302641 WMI_10_2_PEER_STATS = BIT(7),
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002642};
2643
Michal Kazior24c88f72014-07-25 13:32:17 +02002644struct wmi_resource_config_10_2 {
2645 struct wmi_resource_config_10x common;
2646 __le32 max_peer_ext_stats;
2647 __le32 smart_ant_cap; /* 0-disable, 1-enable */
2648 __le32 bk_min_free;
2649 __le32 be_min_free;
2650 __le32 vi_min_free;
2651 __le32 vo_min_free;
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002652 __le32 feature_mask;
Michal Kazior24c88f72014-07-25 13:32:17 +02002653} __packed;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002654
Raja Manib0399412015-06-22 20:10:17 +05302655#define NUM_UNITS_IS_NUM_VDEVS BIT(0)
2656#define NUM_UNITS_IS_NUM_PEERS BIT(1)
2657#define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2)
Bartosz Markowskib3effe62013-09-26 17:47:11 +02002658
Raja Manid1e52a82015-06-22 20:10:15 +05302659struct wmi_resource_config_10_4 {
2660 /* Number of virtual devices (VAPs) to support */
2661 __le32 num_vdevs;
2662
2663 /* Number of peer nodes to support */
2664 __le32 num_peers;
2665
2666 /* Number of active peer nodes to support */
2667 __le32 num_active_peers;
2668
2669 /* In offload mode, target supports features like WOW, chatter and other
2670 * protocol offloads. In order to support them some functionalities like
2671 * reorder buffering, PN checking need to be done in target.
2672 * This determines maximum number of peers supported by target in
2673 * offload mode.
2674 */
2675 __le32 num_offload_peers;
2676
2677 /* Number of reorder buffers available for doing target based reorder
2678 * Rx reorder buffering
2679 */
2680 __le32 num_offload_reorder_buffs;
2681
2682 /* Number of keys per peer */
2683 __le32 num_peer_keys;
2684
2685 /* Total number of TX/RX data TIDs */
2686 __le32 num_tids;
2687
2688 /* Max skid for resolving hash collisions.
2689 * The address search table is sparse, so that if two MAC addresses
2690 * result in the same hash value, the second of these conflicting
2691 * entries can slide to the next index in the address search table,
2692 * and use it, if it is unoccupied. This ast_skid_limit parameter
2693 * specifies the upper bound on how many subsequent indices to search
2694 * over to find an unoccupied space.
2695 */
2696 __le32 ast_skid_limit;
2697
2698 /* The nominal chain mask for transmit.
2699 * The chain mask may be modified dynamically, e.g. to operate AP tx
2700 * with a reduced number of chains if no clients are associated.
2701 * This configuration parameter specifies the nominal chain-mask that
2702 * should be used when not operating with a reduced set of tx chains.
2703 */
2704 __le32 tx_chain_mask;
2705
2706 /* The nominal chain mask for receive.
2707 * The chain mask may be modified dynamically, e.g. for a client to use
2708 * a reduced number of chains for receive if the traffic to the client
2709 * is low enough that it doesn't require downlink MIMO or antenna
2710 * diversity. This configuration parameter specifies the nominal
2711 * chain-mask that should be used when not operating with a reduced
2712 * set of rx chains.
2713 */
2714 __le32 rx_chain_mask;
2715
2716 /* What rx reorder timeout (ms) to use for the AC.
2717 * Each WMM access class (voice, video, best-effort, background) will
2718 * have its own timeout value to dictate how long to wait for missing
2719 * rx MPDUs to arrive before flushing subsequent MPDUs that have already
2720 * been received. This parameter specifies the timeout in milliseconds
2721 * for each class.
2722 */
2723 __le32 rx_timeout_pri[4];
2724
2725 /* What mode the rx should decap packets to.
2726 * MAC can decap to RAW (no decap), native wifi or Ethernet types.
2727 * This setting also determines the default TX behavior, however TX
2728 * behavior can be modified on a per VAP basis during VAP init
2729 */
2730 __le32 rx_decap_mode;
2731
2732 __le32 scan_max_pending_req;
2733
2734 __le32 bmiss_offload_max_vdev;
2735
2736 __le32 roam_offload_max_vdev;
2737
2738 __le32 roam_offload_max_ap_profiles;
2739
2740 /* How many groups to use for mcast->ucast conversion.
2741 * The target's WAL maintains a table to hold information regarding
2742 * which peers belong to a given multicast group, so that if
2743 * multicast->unicast conversion is enabled, the target can convert
2744 * multicast tx frames to a series of unicast tx frames, to each peer
2745 * within the multicast group. This num_mcast_groups configuration
2746 * parameter tells the target how many multicast groups to provide
2747 * storage for within its multicast group membership table.
2748 */
2749 __le32 num_mcast_groups;
2750
2751 /* Size to alloc for the mcast membership table.
2752 * This num_mcast_table_elems configuration parameter tells the target
2753 * how many peer elements it needs to provide storage for in its
2754 * multicast group membership table. These multicast group membership
2755 * table elements are shared by the multicast groups stored within
2756 * the table.
2757 */
2758 __le32 num_mcast_table_elems;
2759
2760 /* Whether/how to do multicast->unicast conversion.
2761 * This configuration parameter specifies whether the target should
2762 * perform multicast --> unicast conversion on transmit, and if so,
2763 * what to do if it finds no entries in its multicast group membership
2764 * table for the multicast IP address in the tx frame.
2765 * Configuration value:
2766 * 0 -> Do not perform multicast to unicast conversion.
2767 * 1 -> Convert multicast frames to unicast, if the IP multicast address
2768 * from the tx frame is found in the multicast group membership
2769 * table. If the IP multicast address is not found, drop the frame
2770 * 2 -> Convert multicast frames to unicast, if the IP multicast address
2771 * from the tx frame is found in the multicast group membership
2772 * table. If the IP multicast address is not found, transmit the
2773 * frame as multicast.
2774 */
2775 __le32 mcast2ucast_mode;
2776
2777 /* How much memory to allocate for a tx PPDU dbg log.
2778 * This parameter controls how much memory the target will allocate to
2779 * store a log of tx PPDU meta-information (how large the PPDU was,
2780 * when it was sent, whether it was successful, etc.)
2781 */
2782 __le32 tx_dbg_log_size;
2783
2784 /* How many AST entries to be allocated for WDS */
2785 __le32 num_wds_entries;
2786
2787 /* MAC DMA burst size. 0 -default, 1 -256B */
2788 __le32 dma_burst_size;
2789
2790 /* Fixed delimiters to be inserted after every MPDU to account for
2791 * interface latency to avoid underrun.
2792 */
2793 __le32 mac_aggr_delim;
2794
2795 /* Determine whether target is responsible for detecting duplicate
2796 * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering
2797 * is always performed on the target.
2798 *
2799 * 0: target responsible for frag timeout and dup checking
2800 * 1: host responsible for frag timeout and dup checking
2801 */
2802 __le32 rx_skip_defrag_timeout_dup_detection_check;
2803
2804 /* Configuration for VoW : No of Video nodes to be supported and max
2805 * no of descriptors for each video link (node).
2806 */
2807 __le32 vow_config;
2808
2809 /* Maximum vdev that could use gtk offload */
2810 __le32 gtk_offload_max_vdev;
2811
2812 /* Number of msdu descriptors target should use */
2813 __le32 num_msdu_desc;
2814
2815 /* Max number of tx fragments per MSDU.
2816 * This parameter controls the max number of tx fragments per MSDU.
2817 * This will passed by target as part of the WMI_SERVICE_READY event
2818 * and is overridden by the OS shim as required.
2819 */
2820 __le32 max_frag_entries;
2821
2822 /* Max number of extended peer stats.
2823 * This parameter controls the max number of peers for which extended
2824 * statistics are supported by target
2825 */
2826 __le32 max_peer_ext_stats;
2827
2828 /* Smart antenna capabilities information.
2829 * 1 - Smart antenna is enabled
2830 * 0 - Smart antenna is disabled
2831 * In future this can contain smart antenna specific capabilities.
2832 */
2833 __le32 smart_ant_cap;
2834
2835 /* User can configure the buffers allocated for each AC (BE, BK, VI, VO)
2836 * during init.
2837 */
2838 __le32 bk_minfree;
2839 __le32 be_minfree;
2840 __le32 vi_minfree;
2841 __le32 vo_minfree;
2842
2843 /* Rx batch mode capability.
2844 * 1 - Rx batch mode enabled
2845 * 0 - Rx batch mode disabled
2846 */
2847 __le32 rx_batchmode;
2848
2849 /* Thermal throttling capability.
2850 * 1 - Capable of thermal throttling
2851 * 0 - Not capable of thermal throttling
2852 */
2853 __le32 tt_support;
2854
2855 /* ATF configuration.
2856 * 1 - Enable ATF
2857 * 0 - Disable ATF
2858 */
2859 __le32 atf_config;
2860
2861 /* Configure padding to manage IP header un-alignment
2862 * 1 - Enable padding
2863 * 0 - Disable padding
2864 */
2865 __le32 iphdr_pad_config;
2866
Ben Greear169ff6d2016-02-05 15:10:02 -08002867 /* qwrap configuration (bits 15-0)
Raja Manid1e52a82015-06-22 20:10:15 +05302868 * 1 - This is qwrap configuration
2869 * 0 - This is not qwrap
Ben Greear169ff6d2016-02-05 15:10:02 -08002870 *
2871 * Bits 31-16 is alloc_frag_desc_for_data_pkt (1 enables, 0 disables)
2872 * In order to get ack-RSSI reporting and to specify the tx-rate for
2873 * individual frames, this option must be enabled. This uses an extra
2874 * 4 bytes per tx-msdu descriptor, so don't enable it unless you need it.
Raja Manid1e52a82015-06-22 20:10:15 +05302875 */
2876 __le32 qwrap_config;
2877} __packed;
2878
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03002879enum wmi_coex_version {
2880 WMI_NO_COEX_VERSION_SUPPORT = 0,
2881 /* 3 wire coex support*/
2882 WMI_COEX_VERSION_1 = 1,
2883 /* 2.5 wire coex support*/
2884 WMI_COEX_VERSION_2 = 2,
2885 /* 2.5 wire coex with duty cycle support */
2886 WMI_COEX_VERSION_3 = 3,
2887 /* 4 wire coex support*/
2888 WMI_COEX_VERSION_4 = 4,
2889};
2890
Raja Mani47771902016-03-16 18:13:33 +05302891/**
2892 * enum wmi_10_4_feature_mask - WMI 10.4 feature enable/disable flags
2893 * @WMI_10_4_LTEU_SUPPORT: LTEU config
2894 * @WMI_10_4_COEX_GPIO_SUPPORT: COEX GPIO config
2895 * @WMI_10_4_AUX_RADIO_SPECTRAL_INTF: AUX Radio Enhancement for spectral scan
2896 * @WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF: AUX Radio Enhancement for chan load scan
2897 * @WMI_10_4_BSS_CHANNEL_INFO_64: BSS channel info stats
2898 * @WMI_10_4_PEER_STATS: Per station stats
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03002899 * @WMI_10_4_VDEV_STATS: Per vdev stats
2900 * @WMI_10_4_TDLS: Implicit TDLS support in firmware enable/disable
2901 * @WMI_10_4_TDLS_OFFCHAN: TDLS offchannel support enable/disable
2902 * @WMI_10_4_TDLS_UAPSD_BUFFER_STA: TDLS buffer sta support enable/disable
2903 * @WMI_10_4_TDLS_UAPSD_SLEEP_STA: TDLS sleep sta support enable/disable
2904 * @WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE: TDLS connection tracker in host
2905 * enable/disable
2906 * @WMI_10_4_TDLS_EXPLICIT_MODE_ONLY:Explicit TDLS mode enable/disable
Raja Mani47771902016-03-16 18:13:33 +05302907 */
2908enum wmi_10_4_feature_mask {
2909 WMI_10_4_LTEU_SUPPORT = BIT(0),
2910 WMI_10_4_COEX_GPIO_SUPPORT = BIT(1),
2911 WMI_10_4_AUX_RADIO_SPECTRAL_INTF = BIT(2),
2912 WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF = BIT(3),
2913 WMI_10_4_BSS_CHANNEL_INFO_64 = BIT(4),
2914 WMI_10_4_PEER_STATS = BIT(5),
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03002915 WMI_10_4_VDEV_STATS = BIT(6),
2916 WMI_10_4_TDLS = BIT(7),
2917 WMI_10_4_TDLS_OFFCHAN = BIT(8),
2918 WMI_10_4_TDLS_UAPSD_BUFFER_STA = BIT(9),
2919 WMI_10_4_TDLS_UAPSD_SLEEP_STA = BIT(10),
2920 WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE = BIT(11),
2921 WMI_10_4_TDLS_EXPLICIT_MODE_ONLY = BIT(12),
2922
Raja Mani47771902016-03-16 18:13:33 +05302923};
2924
2925struct wmi_ext_resource_config_10_4_cmd {
2926 /* contains enum wmi_host_platform_type */
2927 __le32 host_platform_config;
2928 /* see enum wmi_10_4_feature_mask */
2929 __le32 fw_feature_bitmap;
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03002930 /* WLAN priority GPIO number */
2931 __le32 wlan_gpio_priority;
2932 /* see enum wmi_coex_version */
2933 __le32 coex_version;
2934 /* COEX GPIO config */
2935 __le32 coex_gpio_pin1;
2936 __le32 coex_gpio_pin2;
2937 __le32 coex_gpio_pin3;
2938 /* number of vdevs allowed to perform tdls */
2939 __le32 num_tdls_vdevs;
2940 /* number of peers to track per TDLS vdev */
2941 __le32 num_tdls_conn_table_entries;
2942 /* number of tdls sleep sta supported */
2943 __le32 max_tdls_concurrent_sleep_sta;
2944 /* number of tdls buffer sta supported */
2945 __le32 max_tdls_concurrent_buffer_sta;
Raja Mani47771902016-03-16 18:13:33 +05302946};
2947
Erik Stromdahl5c9f0712017-12-28 20:06:43 +01002948/* structure describing host memory chunk. */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002949struct host_memory_chunk {
2950 /* id of the request that is passed up in service ready */
2951 __le32 req_id;
2952 /* the physical address the memory chunk */
2953 __le32 ptr;
2954 /* size of the chunk */
2955 __le32 size;
2956} __packed;
2957
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002958struct wmi_host_mem_chunks {
2959 __le32 count;
2960 /* some fw revisions require at least 1 chunk regardless of count */
2961 struct host_memory_chunk items[1];
2962} __packed;
2963
Kalle Valo5e3dd152013-06-12 20:52:10 +03002964struct wmi_init_cmd {
2965 struct wmi_resource_config resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002966 struct wmi_host_mem_chunks mem_chunks;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002967} __packed;
2968
Joe Perchese13dbea2016-09-26 21:56:21 +03002969/* _10x structure is from 10.X FW API */
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002970struct wmi_init_cmd_10x {
2971 struct wmi_resource_config_10x resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002972 struct wmi_host_mem_chunks mem_chunks;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002973} __packed;
2974
Michal Kazior24c88f72014-07-25 13:32:17 +02002975struct wmi_init_cmd_10_2 {
2976 struct wmi_resource_config_10_2 resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002977 struct wmi_host_mem_chunks mem_chunks;
Michal Kazior24c88f72014-07-25 13:32:17 +02002978} __packed;
2979
Raja Manid1e52a82015-06-22 20:10:15 +05302980struct wmi_init_cmd_10_4 {
2981 struct wmi_resource_config_10_4 resource_config;
2982 struct wmi_host_mem_chunks mem_chunks;
2983} __packed;
2984
Michal Kazior24c88f72014-07-25 13:32:17 +02002985struct wmi_chan_list_entry {
2986 __le16 freq;
2987 u8 phy_mode; /* valid for 10.2 only */
2988 u8 reserved;
2989} __packed;
2990
Kalle Valo5e3dd152013-06-12 20:52:10 +03002991/* TLV for channel list */
2992struct wmi_chan_list {
2993 __le32 tag; /* WMI_CHAN_LIST_TAG */
2994 __le32 num_chan;
Michal Kazior24c88f72014-07-25 13:32:17 +02002995 struct wmi_chan_list_entry channel_list[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002996} __packed;
2997
2998struct wmi_bssid_list {
2999 __le32 tag; /* WMI_BSSID_LIST_TAG */
3000 __le32 num_bssid;
3001 struct wmi_mac_addr bssid_list[0];
3002} __packed;
3003
3004struct wmi_ie_data {
3005 __le32 tag; /* WMI_IE_TAG */
3006 __le32 ie_len;
3007 u8 ie_data[0];
3008} __packed;
3009
3010struct wmi_ssid {
3011 __le32 ssid_len;
3012 u8 ssid[32];
3013} __packed;
3014
3015struct wmi_ssid_list {
3016 __le32 tag; /* WMI_SSID_LIST_TAG */
3017 __le32 num_ssids;
3018 struct wmi_ssid ssids[0];
3019} __packed;
3020
3021/* prefix used by scan requestor ids on the host */
3022#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
3023
3024/* prefix used by scan request ids generated on the host */
3025/* host cycles through the lower 12 bits to generate ids */
3026#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
3027
3028#define WLAN_SCAN_PARAMS_MAX_SSID 16
3029#define WLAN_SCAN_PARAMS_MAX_BSSID 4
3030#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
3031
Michal Kaziordcca0bd2014-11-24 14:58:32 +01003032/* Values lower than this may be refused by some firmware revisions with a scan
3033 * completion with a timedout reason.
3034 */
3035#define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
3036
Kalle Valo5e3dd152013-06-12 20:52:10 +03003037/* Scan priority numbers must be sequential, starting with 0 */
3038enum wmi_scan_priority {
3039 WMI_SCAN_PRIORITY_VERY_LOW = 0,
3040 WMI_SCAN_PRIORITY_LOW,
3041 WMI_SCAN_PRIORITY_MEDIUM,
3042 WMI_SCAN_PRIORITY_HIGH,
3043 WMI_SCAN_PRIORITY_VERY_HIGH,
3044 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
3045};
3046
Michal Kaziora6aa5da2014-09-18 15:21:27 +02003047struct wmi_start_scan_common {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003048 /* Scan ID */
3049 __le32 scan_id;
3050 /* Scan requestor ID */
3051 __le32 scan_req_id;
3052 /* VDEV id(interface) that is requesting scan */
3053 __le32 vdev_id;
3054 /* Scan Priority, input to scan scheduler */
3055 __le32 scan_priority;
3056 /* Scan events subscription */
3057 __le32 notify_scan_events;
3058 /* dwell time in msec on active channels */
3059 __le32 dwell_time_active;
3060 /* dwell time in msec on passive channels */
3061 __le32 dwell_time_passive;
3062 /*
3063 * min time in msec on the BSS channel,only valid if atleast one
3064 * VDEV is active
3065 */
3066 __le32 min_rest_time;
3067 /*
3068 * max rest time in msec on the BSS channel,only valid if at least
3069 * one VDEV is active
3070 */
3071 /*
3072 * the scanner will rest on the bss channel at least min_rest_time
3073 * after min_rest_time the scanner will start checking for tx/rx
3074 * activity on all VDEVs. if there is no activity the scanner will
3075 * switch to off channel. if there is activity the scanner will let
3076 * the radio on the bss channel until max_rest_time expires.at
3077 * max_rest_time scanner will switch to off channel irrespective of
3078 * activity. activity is determined by the idle_time parameter.
3079 */
3080 __le32 max_rest_time;
3081 /*
3082 * time before sending next set of probe requests.
3083 * The scanner keeps repeating probe requests transmission with
3084 * period specified by repeat_probe_time.
3085 * The number of probe requests specified depends on the ssid_list
3086 * and bssid_list
3087 */
3088 __le32 repeat_probe_time;
3089 /* time in msec between 2 consequetive probe requests with in a set. */
3090 __le32 probe_spacing_time;
3091 /*
3092 * data inactivity time in msec on bss channel that will be used by
3093 * scanner for measuring the inactivity.
3094 */
3095 __le32 idle_time;
3096 /* maximum time in msec allowed for scan */
3097 __le32 max_scan_time;
3098 /*
3099 * delay in msec before sending first probe request after switching
3100 * to a channel
3101 */
3102 __le32 probe_delay;
3103 /* Scan control flags */
3104 __le32 scan_ctrl_flags;
Michal Kaziora6aa5da2014-09-18 15:21:27 +02003105} __packed;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003106
Michal Kaziora6aa5da2014-09-18 15:21:27 +02003107struct wmi_start_scan_tlvs {
3108 /* TLV parameters. These includes channel list, ssid list, bssid list,
3109 * extra ies.
Kalle Valo5e3dd152013-06-12 20:52:10 +03003110 */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02003111 u8 tlvs[0];
3112} __packed;
3113
3114struct wmi_start_scan_cmd {
3115 struct wmi_start_scan_common common;
3116 __le32 burst_duration_ms;
3117 struct wmi_start_scan_tlvs tlvs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003118} __packed;
3119
Bartosz Markowski89b7e762013-09-26 17:47:17 +02003120/* This is the definition from 10.X firmware branch */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02003121struct wmi_10x_start_scan_cmd {
3122 struct wmi_start_scan_common common;
3123 struct wmi_start_scan_tlvs tlvs;
Bartosz Markowski89b7e762013-09-26 17:47:17 +02003124} __packed;
3125
Kalle Valo5e3dd152013-06-12 20:52:10 +03003126struct wmi_ssid_arg {
3127 int len;
3128 const u8 *ssid;
3129};
3130
3131struct wmi_bssid_arg {
3132 const u8 *bssid;
3133};
3134
3135struct wmi_start_scan_arg {
3136 u32 scan_id;
3137 u32 scan_req_id;
3138 u32 vdev_id;
3139 u32 scan_priority;
3140 u32 notify_scan_events;
3141 u32 dwell_time_active;
3142 u32 dwell_time_passive;
3143 u32 min_rest_time;
3144 u32 max_rest_time;
3145 u32 repeat_probe_time;
3146 u32 probe_spacing_time;
3147 u32 idle_time;
3148 u32 max_scan_time;
3149 u32 probe_delay;
3150 u32 scan_ctrl_flags;
Michal Kaziordbd3f9f2015-03-31 11:03:48 +00003151 u32 burst_duration_ms;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003152
3153 u32 ie_len;
3154 u32 n_channels;
3155 u32 n_ssids;
3156 u32 n_bssids;
3157
3158 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
Michal Kazior24c88f72014-07-25 13:32:17 +02003159 u16 channels[64];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003160 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
3161 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
3162};
3163
3164/* scan control flags */
3165
3166/* passively scan all channels including active channels */
3167#define WMI_SCAN_FLAG_PASSIVE 0x1
3168/* add wild card ssid probe request even though ssid_list is specified. */
3169#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
3170/* add cck rates to rates/xrate ie for the generated probe request */
3171#define WMI_SCAN_ADD_CCK_RATES 0x4
3172/* add ofdm rates to rates/xrate ie for the generated probe request */
3173#define WMI_SCAN_ADD_OFDM_RATES 0x8
3174/* To enable indication of Chan load and Noise floor to host */
3175#define WMI_SCAN_CHAN_STAT_EVENT 0x10
3176/* Filter Probe request frames */
3177#define WMI_SCAN_FILTER_PROBE_REQ 0x20
3178/* When set, DFS channels will not be scanned */
3179#define WMI_SCAN_BYPASS_DFS_CHN 0x40
3180/* Different FW scan engine may choose to bail out on errors.
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01003181 * Allow the driver to have influence over that.
3182 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003183#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
3184
3185/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
3186#define WMI_SCAN_CLASS_MASK 0xFF000000
3187
Kalle Valo5e3dd152013-06-12 20:52:10 +03003188enum wmi_stop_scan_type {
3189 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
3190 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
3191 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
3192};
3193
3194struct wmi_stop_scan_cmd {
3195 __le32 scan_req_id;
3196 __le32 scan_id;
3197 __le32 req_type;
3198 __le32 vdev_id;
3199} __packed;
3200
3201struct wmi_stop_scan_arg {
3202 u32 req_id;
3203 enum wmi_stop_scan_type req_type;
3204 union {
3205 u32 scan_id;
3206 u32 vdev_id;
3207 } u;
3208};
3209
3210struct wmi_scan_chan_list_cmd {
3211 __le32 num_scan_chans;
3212 struct wmi_channel chan_info[0];
3213} __packed;
3214
3215struct wmi_scan_chan_list_arg {
3216 u32 n_channels;
3217 struct wmi_channel_arg *channels;
3218};
3219
3220enum wmi_bss_filter {
3221 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
3222 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
3223 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
3224 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
3225 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
3226 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
3227 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
3228 WMI_BSS_FILTER_LAST_BSS, /* marker only */
3229};
3230
3231enum wmi_scan_event_type {
Raja Manib2297ba2015-06-22 20:22:23 +05303232 WMI_SCAN_EVENT_STARTED = BIT(0),
3233 WMI_SCAN_EVENT_COMPLETED = BIT(1),
3234 WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2),
3235 WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3),
3236 WMI_SCAN_EVENT_DEQUEUED = BIT(4),
3237 /* possibly by high-prio scan */
3238 WMI_SCAN_EVENT_PREEMPTED = BIT(5),
3239 WMI_SCAN_EVENT_START_FAILED = BIT(6),
3240 WMI_SCAN_EVENT_RESTARTED = BIT(7),
3241 WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
3242 WMI_SCAN_EVENT_MAX = BIT(15),
Kalle Valo5e3dd152013-06-12 20:52:10 +03003243};
3244
3245enum wmi_scan_completion_reason {
3246 WMI_SCAN_REASON_COMPLETED,
3247 WMI_SCAN_REASON_CANCELLED,
3248 WMI_SCAN_REASON_PREEMPTED,
3249 WMI_SCAN_REASON_TIMEDOUT,
Raja Manib2297ba2015-06-22 20:22:23 +05303250 WMI_SCAN_REASON_INTERNAL_FAILURE,
Kalle Valo5e3dd152013-06-12 20:52:10 +03003251 WMI_SCAN_REASON_MAX,
3252};
3253
3254struct wmi_scan_event {
3255 __le32 event_type; /* %WMI_SCAN_EVENT_ */
3256 __le32 reason; /* %WMI_SCAN_REASON_ */
3257 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
3258 __le32 scan_req_id;
3259 __le32 scan_id;
3260 __le32 vdev_id;
3261} __packed;
3262
3263/*
3264 * This defines how much headroom is kept in the
3265 * receive frame between the descriptor and the
3266 * payload, in order for the WMI PHY error and
3267 * management handler to insert header contents.
3268 *
3269 * This is in bytes.
3270 */
3271#define WMI_MGMT_RX_HDR_HEADROOM 52
3272
3273/*
3274 * This event will be used for sending scan results
3275 * as well as rx mgmt frames to the host. The rx buffer
3276 * will be sent as part of this WMI event. It would be a
3277 * good idea to pass all the fields in the RX status
3278 * descriptor up to the host.
3279 */
Michal Kazior0d9b0432013-08-09 10:13:33 +02003280struct wmi_mgmt_rx_hdr_v1 {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003281 __le32 channel;
3282 __le32 snr;
3283 __le32 rate;
3284 __le32 phy_mode;
3285 __le32 buf_len;
3286 __le32 status; /* %WMI_RX_STATUS_ */
3287} __packed;
3288
Michal Kazior0d9b0432013-08-09 10:13:33 +02003289struct wmi_mgmt_rx_hdr_v2 {
3290 struct wmi_mgmt_rx_hdr_v1 v1;
3291 __le32 rssi_ctl[4];
3292} __packed;
3293
3294struct wmi_mgmt_rx_event_v1 {
3295 struct wmi_mgmt_rx_hdr_v1 hdr;
3296 u8 buf[0];
3297} __packed;
3298
3299struct wmi_mgmt_rx_event_v2 {
3300 struct wmi_mgmt_rx_hdr_v2 hdr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003301 u8 buf[0];
3302} __packed;
3303
Raja Mani1c092962015-06-22 20:10:16 +05303304struct wmi_10_4_mgmt_rx_hdr {
3305 __le32 channel;
3306 __le32 snr;
3307 u8 rssi_ctl[4];
3308 __le32 rate;
3309 __le32 phy_mode;
3310 __le32 buf_len;
3311 __le32 status;
3312} __packed;
3313
3314struct wmi_10_4_mgmt_rx_event {
3315 struct wmi_10_4_mgmt_rx_hdr hdr;
3316 u8 buf[0];
3317} __packed;
3318
Peter Oh8d130962016-03-01 09:52:49 -08003319struct wmi_mgmt_rx_ext_info {
3320 __le64 rx_mac_timestamp;
3321} __packed __aligned(4);
3322
Kalle Valo5e3dd152013-06-12 20:52:10 +03003323#define WMI_RX_STATUS_OK 0x00
3324#define WMI_RX_STATUS_ERR_CRC 0x01
3325#define WMI_RX_STATUS_ERR_DECRYPT 0x08
3326#define WMI_RX_STATUS_ERR_MIC 0x10
3327#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
Peter Oh8d130962016-03-01 09:52:49 -08003328/* Extension data at the end of mgmt frame */
3329#define WMI_RX_STATUS_EXT_INFO 0x40
Kalle Valo5e3dd152013-06-12 20:52:10 +03003330
Raja Mani991adf72015-08-14 11:13:29 +03003331#define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26
3332#define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24
3333#define PHY_ERROR_GEN_RADAR 0x05
3334
Raja Mani2b0a2e02015-08-14 11:13:34 +03003335#define PHY_ERROR_10_4_RADAR_MASK 0x4
3336#define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000
3337
Raja Mani991adf72015-08-14 11:13:29 +03003338enum phy_err_type {
3339 PHY_ERROR_UNKNOWN,
3340 PHY_ERROR_SPECTRAL_SCAN,
3341 PHY_ERROR_FALSE_RADAR_EXT,
3342 PHY_ERROR_RADAR
3343};
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003344
Michal Kazior2332d0a2014-09-18 15:21:25 +02003345struct wmi_phyerr {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003346 __le32 tsf_timestamp;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003347 __le16 freq1;
3348 __le16 freq2;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003349 u8 rssi_combined;
3350 u8 chan_width_mhz;
3351 u8 phy_err_code;
3352 u8 rsvd0;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003353 __le32 rssi_chains[4];
3354 __le16 nf_chains[4];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003355 __le32 buf_len;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003356 u8 buf[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003357} __packed;
3358
Michal Kazior2332d0a2014-09-18 15:21:25 +02003359struct wmi_phyerr_event {
3360 __le32 num_phyerrs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003361 __le32 tsf_l32;
3362 __le32 tsf_u32;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003363 struct wmi_phyerr phyerrs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003364} __packed;
3365
Raja Mani2b0a2e02015-08-14 11:13:34 +03003366struct wmi_10_4_phyerr_event {
3367 __le32 tsf_l32;
3368 __le32 tsf_u32;
3369 __le16 freq1;
3370 __le16 freq2;
3371 u8 rssi_combined;
3372 u8 chan_width_mhz;
3373 u8 phy_err_code;
3374 u8 rsvd0;
3375 __le32 rssi_chains[4];
3376 __le16 nf_chains[4];
3377 __le32 phy_err_mask[2];
3378 __le32 tsf_timestamp;
3379 __le32 buf_len;
3380 u8 buf[0];
3381} __packed;
3382
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003383#define PHYERR_TLV_SIG 0xBB
3384#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
3385#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
Simon Wunderlich855aed12014-08-02 09:12:54 +03003386#define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003387
3388struct phyerr_radar_report {
3389 __le32 reg0; /* RADAR_REPORT_REG0_* */
Mohammed Shafi Shajakhan0a7d88e2017-03-14 17:03:24 +05303390 __le32 reg1; /* RADAR_REPORT_REG1_* */
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003391} __packed;
3392
3393#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
3394#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
3395
3396#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
3397#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
3398
3399#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
3400#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
3401
3402#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
3403#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
3404
3405#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
3406#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
3407
3408#define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
3409#define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
3410
3411#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
3412#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
3413
3414#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
3415#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
3416
3417#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
3418#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
3419
3420#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
3421#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
3422
3423#define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
3424#define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
3425
3426struct phyerr_fft_report {
3427 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
3428 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
3429} __packed;
3430
3431#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
3432#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
3433
3434#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
3435#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
3436
3437#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
3438#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
3439
3440#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
3441#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
3442
3443#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
3444#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
3445
3446#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
3447#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
3448
3449#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
3450#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
3451
3452#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
3453#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
3454
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003455struct phyerr_tlv {
3456 __le16 len;
3457 u8 tag;
3458 u8 sig;
3459} __packed;
3460
3461#define DFS_RSSI_POSSIBLY_FALSE 50
3462#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
3463
Kalle Valo5e3dd152013-06-12 20:52:10 +03003464struct wmi_mgmt_tx_hdr {
3465 __le32 vdev_id;
3466 struct wmi_mac_addr peer_macaddr;
3467 __le32 tx_rate;
3468 __le32 tx_power;
3469 __le32 buf_len;
3470} __packed;
3471
3472struct wmi_mgmt_tx_cmd {
3473 struct wmi_mgmt_tx_hdr hdr;
3474 u8 buf[0];
3475} __packed;
3476
3477struct wmi_echo_event {
3478 __le32 value;
3479} __packed;
3480
3481struct wmi_echo_cmd {
3482 __le32 value;
3483} __packed;
3484
Kalle Valo5e3dd152013-06-12 20:52:10 +03003485struct wmi_pdev_set_regdomain_cmd {
3486 __le32 reg_domain;
3487 __le32 reg_domain_2G;
3488 __le32 reg_domain_5G;
3489 __le32 conformance_test_limit_2G;
3490 __le32 conformance_test_limit_5G;
3491} __packed;
3492
Marek Puzyniak821af6a2014-03-21 17:46:57 +02003493enum wmi_dfs_region {
3494 /* Uninitialized dfs domain */
3495 WMI_UNINIT_DFS_DOMAIN = 0,
3496
3497 /* FCC3 dfs domain */
3498 WMI_FCC_DFS_DOMAIN = 1,
3499
3500 /* ETSI dfs domain */
3501 WMI_ETSI_DFS_DOMAIN = 2,
3502
3503 /*Japan dfs domain */
3504 WMI_MKK4_DFS_DOMAIN = 3,
3505};
3506
3507struct wmi_pdev_set_regdomain_cmd_10x {
3508 __le32 reg_domain;
3509 __le32 reg_domain_2G;
3510 __le32 reg_domain_5G;
3511 __le32 conformance_test_limit_2G;
3512 __le32 conformance_test_limit_5G;
3513
3514 /* dfs domain from wmi_dfs_region */
3515 __le32 dfs_domain;
3516} __packed;
3517
Kalle Valo5e3dd152013-06-12 20:52:10 +03003518/* Command to set/unset chip in quiet mode */
3519struct wmi_pdev_set_quiet_cmd {
3520 /* period in TUs */
3521 __le32 period;
3522
3523 /* duration in TUs */
3524 __le32 duration;
3525
3526 /* offset in TUs */
3527 __le32 next_start;
3528
3529 /* enable/disable */
3530 __le32 enabled;
3531} __packed;
3532
Kalle Valo5e3dd152013-06-12 20:52:10 +03003533/*
3534 * 802.11g protection mode.
3535 */
3536enum ath10k_protmode {
3537 ATH10K_PROT_NONE = 0, /* no protection */
3538 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
3539 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
3540};
3541
Marek Kwaczynskie81bd102014-03-11 12:58:00 +02003542enum wmi_rtscts_profile {
3543 WMI_RTSCTS_FOR_NO_RATESERIES = 0,
3544 WMI_RTSCTS_FOR_SECOND_RATESERIES,
3545 WMI_RTSCTS_ACROSS_SW_RETRIES
3546};
3547
3548#define WMI_RTSCTS_ENABLED 1
3549#define WMI_RTSCTS_SET_MASK 0x0f
3550#define WMI_RTSCTS_SET_LSB 0
3551
3552#define WMI_RTSCTS_PROFILE_MASK 0xf0
3553#define WMI_RTSCTS_PROFILE_LSB 4
3554
Kalle Valo5e3dd152013-06-12 20:52:10 +03003555enum wmi_beacon_gen_mode {
3556 WMI_BEACON_STAGGERED_MODE = 0,
3557 WMI_BEACON_BURST_MODE = 1
3558};
3559
3560enum wmi_csa_event_ies_present_flag {
3561 WMI_CSA_IE_PRESENT = 0x00000001,
3562 WMI_XCSA_IE_PRESENT = 0x00000002,
3563 WMI_WBW_IE_PRESENT = 0x00000004,
3564 WMI_CSWARP_IE_PRESENT = 0x00000008,
3565};
3566
3567/* wmi CSA receive event from beacon frame */
3568struct wmi_csa_event {
3569 __le32 i_fc_dur;
3570 /* Bit 0-15: FC */
3571 /* Bit 16-31: DUR */
3572 struct wmi_mac_addr i_addr1;
3573 struct wmi_mac_addr i_addr2;
3574 __le32 csa_ie[2];
3575 __le32 xcsa_ie[2];
3576 __le32 wb_ie[2];
3577 __le32 cswarp_ie;
3578 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
3579} __packed;
3580
3581/* the definition of different PDEV parameters */
3582#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3583#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3584#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
3585
Bartosz Markowski226a3392013-09-26 17:47:16 +02003586struct wmi_pdev_param_map {
3587 u32 tx_chain_mask;
3588 u32 rx_chain_mask;
3589 u32 txpower_limit2g;
3590 u32 txpower_limit5g;
3591 u32 txpower_scale;
3592 u32 beacon_gen_mode;
3593 u32 beacon_tx_mode;
3594 u32 resmgr_offchan_mode;
3595 u32 protection_mode;
3596 u32 dynamic_bw;
3597 u32 non_agg_sw_retry_th;
3598 u32 agg_sw_retry_th;
3599 u32 sta_kickout_th;
3600 u32 ac_aggrsize_scaling;
3601 u32 ltr_enable;
3602 u32 ltr_ac_latency_be;
3603 u32 ltr_ac_latency_bk;
3604 u32 ltr_ac_latency_vi;
3605 u32 ltr_ac_latency_vo;
3606 u32 ltr_ac_latency_timeout;
3607 u32 ltr_sleep_override;
3608 u32 ltr_rx_override;
3609 u32 ltr_tx_activity_timeout;
3610 u32 l1ss_enable;
3611 u32 dsleep_enable;
3612 u32 pcielp_txbuf_flush;
3613 u32 pcielp_txbuf_watermark;
3614 u32 pcielp_txbuf_tmo_en;
3615 u32 pcielp_txbuf_tmo_value;
3616 u32 pdev_stats_update_period;
3617 u32 vdev_stats_update_period;
3618 u32 peer_stats_update_period;
3619 u32 bcnflt_stats_update_period;
3620 u32 pmf_qos;
3621 u32 arp_ac_override;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003622 u32 dcs;
3623 u32 ani_enable;
3624 u32 ani_poll_period;
3625 u32 ani_listen_period;
3626 u32 ani_ofdm_level;
3627 u32 ani_cck_level;
3628 u32 dyntxchain;
3629 u32 proxy_sta;
3630 u32 idle_ps_config;
3631 u32 power_gating_sleep;
3632 u32 fast_channel_reset;
3633 u32 burst_dur;
3634 u32 burst_enable;
Peter Oha7bd3e92014-12-02 13:07:14 +02003635 u32 cal_period;
Raja Manid86561f2015-06-22 20:10:14 +05303636 u32 aggr_burst;
3637 u32 rx_decap_mode;
3638 u32 smart_antenna_default_antenna;
3639 u32 igmpmld_override;
3640 u32 igmpmld_tid;
3641 u32 antenna_gain;
3642 u32 rx_filter;
3643 u32 set_mcast_to_ucast_tid;
3644 u32 proxy_sta_mode;
3645 u32 set_mcast2ucast_mode;
3646 u32 set_mcast2ucast_buffer;
3647 u32 remove_mcast2ucast_buffer;
3648 u32 peer_sta_ps_statechg_enable;
3649 u32 igmpmld_ac_override;
3650 u32 block_interbss;
3651 u32 set_disable_reset_cmdid;
3652 u32 set_msdu_ttl_cmdid;
3653 u32 set_ppdu_duration_cmdid;
3654 u32 txbf_sound_period_cmdid;
3655 u32 set_promisc_mode_cmdid;
3656 u32 set_burst_mode_cmdid;
3657 u32 en_stats;
3658 u32 mu_group_policy;
3659 u32 noise_detection;
3660 u32 noise_threshold;
3661 u32 dpd_enable;
3662 u32 set_mcast_bcast_echo;
3663 u32 atf_strict_sch;
3664 u32 atf_sched_duration;
3665 u32 ant_plzn;
3666 u32 mgmt_retry_limit;
3667 u32 sensitivity_level;
3668 u32 signed_txpower_2g;
3669 u32 signed_txpower_5g;
3670 u32 enable_per_tid_amsdu;
3671 u32 enable_per_tid_ampdu;
3672 u32 cca_threshold;
3673 u32 rts_fixed_rate;
3674 u32 pdev_reset;
3675 u32 wapi_mbssid_offset;
3676 u32 arp_srcaddr;
3677 u32 arp_dstaddr;
Rajkumar Manoharan39136242016-05-27 20:15:59 +05303678 u32 enable_btcoex;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003679};
3680
3681#define WMI_PDEV_PARAM_UNSUPPORTED 0
3682
Kalle Valo5e3dd152013-06-12 20:52:10 +03003683enum wmi_pdev_param {
Ben Greeard0e0a552014-05-14 16:56:14 +03003684 /* TX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003685 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
Ben Greeard0e0a552014-05-14 16:56:14 +03003686 /* RX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003687 WMI_PDEV_PARAM_RX_CHAIN_MASK,
3688 /* TX power limit for 2G Radio */
3689 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
3690 /* TX power limit for 5G Radio */
3691 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
3692 /* TX power scale */
3693 WMI_PDEV_PARAM_TXPOWER_SCALE,
3694 /* Beacon generation mode . 0: host, 1: target */
3695 WMI_PDEV_PARAM_BEACON_GEN_MODE,
3696 /* Beacon generation mode . 0: staggered 1: bursted */
3697 WMI_PDEV_PARAM_BEACON_TX_MODE,
3698 /*
3699 * Resource manager off chan mode .
3700 * 0: turn off off chan mode. 1: turn on offchan mode
3701 */
3702 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3703 /*
3704 * Protection mode:
3705 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3706 */
3707 WMI_PDEV_PARAM_PROTECTION_MODE,
Michal Kaziorc4dd0d02013-11-13 11:05:10 +01003708 /*
3709 * Dynamic bandwidth - 0: disable, 1: enable
3710 *
3711 * When enabled HW rate control tries different bandwidths when
3712 * retransmitting frames.
3713 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003714 WMI_PDEV_PARAM_DYNAMIC_BW,
3715 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3716 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3717 /* aggregrate sw retry threshold. 0-disable*/
3718 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
3719 /* Station kickout threshold (non of consecutive failures).0-disable */
3720 WMI_PDEV_PARAM_STA_KICKOUT_TH,
3721 /* Aggerate size scaling configuration per AC */
3722 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3723 /* LTR enable */
3724 WMI_PDEV_PARAM_LTR_ENABLE,
3725 /* LTR latency for BE, in us */
3726 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
3727 /* LTR latency for BK, in us */
3728 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
3729 /* LTR latency for VI, in us */
3730 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
3731 /* LTR latency for VO, in us */
3732 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
3733 /* LTR AC latency timeout, in ms */
3734 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3735 /* LTR platform latency override, in us */
3736 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3737 /* LTR-RX override, in us */
3738 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
3739 /* Tx activity timeout for LTR, in us */
3740 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3741 /* L1SS state machine enable */
3742 WMI_PDEV_PARAM_L1SS_ENABLE,
3743 /* Deep sleep state machine enable */
3744 WMI_PDEV_PARAM_DSLEEP_ENABLE,
3745 /* RX buffering flush enable */
3746 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3747 /* RX buffering matermark */
3748 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3749 /* RX buffering timeout enable */
3750 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3751 /* RX buffering timeout value */
3752 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3753 /* pdev level stats update period in ms */
3754 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3755 /* vdev level stats update period in ms */
3756 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3757 /* peer level stats update period in ms */
3758 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3759 /* beacon filter status update period */
3760 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3761 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3762 WMI_PDEV_PARAM_PMF_QOS,
3763 /* Access category on which ARP frames are sent */
3764 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
3765 /* DCS configuration */
3766 WMI_PDEV_PARAM_DCS,
3767 /* Enable/Disable ANI on target */
3768 WMI_PDEV_PARAM_ANI_ENABLE,
3769 /* configure the ANI polling period */
3770 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
3771 /* configure the ANI listening period */
3772 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
3773 /* configure OFDM immunity level */
3774 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
3775 /* configure CCK immunity level */
3776 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
3777 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3778 WMI_PDEV_PARAM_DYNTXCHAIN,
3779 /* Enable/Disable proxy STA */
3780 WMI_PDEV_PARAM_PROXY_STA,
3781 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
3782 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
3783 /* Enable/Disable power gating sleep */
3784 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
3785};
3786
Bartosz Markowski226a3392013-09-26 17:47:16 +02003787enum wmi_10x_pdev_param {
3788 /* TX chian mask */
3789 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3790 /* RX chian mask */
3791 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
3792 /* TX power limit for 2G Radio */
3793 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
3794 /* TX power limit for 5G Radio */
3795 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
3796 /* TX power scale */
3797 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
3798 /* Beacon generation mode . 0: host, 1: target */
3799 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
3800 /* Beacon generation mode . 0: staggered 1: bursted */
3801 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
3802 /*
3803 * Resource manager off chan mode .
3804 * 0: turn off off chan mode. 1: turn on offchan mode
3805 */
3806 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3807 /*
3808 * Protection mode:
3809 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3810 */
3811 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
3812 /* Dynamic bandwidth 0: disable 1: enable */
3813 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
3814 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3815 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3816 /* aggregrate sw retry threshold. 0-disable*/
3817 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
3818 /* Station kickout threshold (non of consecutive failures).0-disable */
3819 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
3820 /* Aggerate size scaling configuration per AC */
3821 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3822 /* LTR enable */
3823 WMI_10X_PDEV_PARAM_LTR_ENABLE,
3824 /* LTR latency for BE, in us */
3825 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
3826 /* LTR latency for BK, in us */
3827 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
3828 /* LTR latency for VI, in us */
3829 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
3830 /* LTR latency for VO, in us */
3831 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
3832 /* LTR AC latency timeout, in ms */
3833 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3834 /* LTR platform latency override, in us */
3835 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3836 /* LTR-RX override, in us */
3837 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
3838 /* Tx activity timeout for LTR, in us */
3839 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3840 /* L1SS state machine enable */
3841 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
3842 /* Deep sleep state machine enable */
3843 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
3844 /* pdev level stats update period in ms */
3845 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3846 /* vdev level stats update period in ms */
3847 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3848 /* peer level stats update period in ms */
3849 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3850 /* beacon filter status update period */
3851 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3852 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3853 WMI_10X_PDEV_PARAM_PMF_QOS,
3854 /* Access category on which ARP and DHCP frames are sent */
3855 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
3856 /* DCS configuration */
3857 WMI_10X_PDEV_PARAM_DCS,
3858 /* Enable/Disable ANI on target */
3859 WMI_10X_PDEV_PARAM_ANI_ENABLE,
3860 /* configure the ANI polling period */
3861 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
3862 /* configure the ANI listening period */
3863 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
3864 /* configure OFDM immunity level */
3865 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
3866 /* configure CCK immunity level */
3867 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
3868 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3869 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
3870 /* Enable/Disable Fast channel reset*/
3871 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
3872 /* Set Bursting DUR */
3873 WMI_10X_PDEV_PARAM_BURST_DUR,
3874 /* Set Bursting Enable*/
3875 WMI_10X_PDEV_PARAM_BURST_ENABLE,
Michal Kazior24c88f72014-07-25 13:32:17 +02003876
3877 /* following are available as of firmware 10.2 */
3878 WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3879 WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
3880 WMI_10X_PDEV_PARAM_IGMPMLD_TID,
3881 WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
3882 WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
3883 WMI_10X_PDEV_PARAM_RX_FILTER,
3884 WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
3885 WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
3886 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3887 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3888 WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
Peter Ohb43bf972014-12-02 13:06:53 +02003889 WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
3890 WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
3891 WMI_10X_PDEV_PARAM_CAL_PERIOD
Bartosz Markowski226a3392013-09-26 17:47:16 +02003892};
3893
Raja Manid86561f2015-06-22 20:10:14 +05303894enum wmi_10_4_pdev_param {
3895 WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3896 WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK,
3897 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G,
3898 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G,
3899 WMI_10_4_PDEV_PARAM_TXPOWER_SCALE,
3900 WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE,
3901 WMI_10_4_PDEV_PARAM_BEACON_TX_MODE,
3902 WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3903 WMI_10_4_PDEV_PARAM_PROTECTION_MODE,
3904 WMI_10_4_PDEV_PARAM_DYNAMIC_BW,
3905 WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3906 WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH,
3907 WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH,
3908 WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3909 WMI_10_4_PDEV_PARAM_LTR_ENABLE,
3910 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE,
3911 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK,
3912 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI,
3913 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO,
3914 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3915 WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3916 WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE,
3917 WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3918 WMI_10_4_PDEV_PARAM_L1SS_ENABLE,
3919 WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE,
3920 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3921 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3922 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3923 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3924 WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3925 WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3926 WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3927 WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3928 WMI_10_4_PDEV_PARAM_PMF_QOS,
3929 WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE,
3930 WMI_10_4_PDEV_PARAM_DCS,
3931 WMI_10_4_PDEV_PARAM_ANI_ENABLE,
3932 WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD,
3933 WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD,
3934 WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL,
3935 WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL,
3936 WMI_10_4_PDEV_PARAM_DYNTXCHAIN,
3937 WMI_10_4_PDEV_PARAM_PROXY_STA,
3938 WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG,
3939 WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP,
3940 WMI_10_4_PDEV_PARAM_AGGR_BURST,
3941 WMI_10_4_PDEV_PARAM_RX_DECAP_MODE,
3942 WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET,
3943 WMI_10_4_PDEV_PARAM_BURST_DUR,
3944 WMI_10_4_PDEV_PARAM_BURST_ENABLE,
3945 WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3946 WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE,
3947 WMI_10_4_PDEV_PARAM_IGMPMLD_TID,
3948 WMI_10_4_PDEV_PARAM_ANTENNA_GAIN,
3949 WMI_10_4_PDEV_PARAM_RX_FILTER,
3950 WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID,
3951 WMI_10_4_PDEV_PARAM_PROXY_STA_MODE,
3952 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3953 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3954 WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
3955 WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE,
3956 WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE,
3957 WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS,
3958 WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID,
3959 WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID,
3960 WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID,
3961 WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID,
3962 WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
3963 WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID,
3964 WMI_10_4_PDEV_PARAM_EN_STATS,
3965 WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY,
3966 WMI_10_4_PDEV_PARAM_NOISE_DETECTION,
3967 WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD,
3968 WMI_10_4_PDEV_PARAM_DPD_ENABLE,
3969 WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO,
3970 WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH,
3971 WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION,
3972 WMI_10_4_PDEV_PARAM_ANT_PLZN,
3973 WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT,
3974 WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL,
3975 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G,
3976 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G,
3977 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU,
3978 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU,
3979 WMI_10_4_PDEV_PARAM_CCA_THRESHOLD,
3980 WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE,
3981 WMI_10_4_PDEV_PARAM_CAL_PERIOD,
3982 WMI_10_4_PDEV_PARAM_PDEV_RESET,
3983 WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET,
3984 WMI_10_4_PDEV_PARAM_ARP_SRCADDR,
3985 WMI_10_4_PDEV_PARAM_ARP_DSTADDR,
Vasanthakumar Thiagarajan52e8ce12015-10-29 19:11:34 +05303986 WMI_10_4_PDEV_PARAM_TXPOWER_DECR_DB,
3987 WMI_10_4_PDEV_PARAM_RX_BATCHMODE,
3988 WMI_10_4_PDEV_PARAM_PACKET_AGGR_DELAY,
3989 WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCH,
3990 WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCALING_FACTOR,
3991 WMI_10_4_PDEV_PARAM_CUST_TXPOWER_SCALE,
Rajkumar Manoharan39136242016-05-27 20:15:59 +05303992 WMI_10_4_PDEV_PARAM_ATF_DYNAMIC_ENABLE,
3993 WMI_10_4_PDEV_PARAM_ATF_SSID_GROUP_POLICY,
3994 WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX,
Raja Manid86561f2015-06-22 20:10:14 +05303995};
3996
Kalle Valo5e3dd152013-06-12 20:52:10 +03003997struct wmi_pdev_set_param_cmd {
3998 __le32 param_id;
3999 __le32 param_value;
4000} __packed;
4001
Peter Oha7bd3e92014-12-02 13:07:14 +02004002/* valid period is 1 ~ 60000ms, unit in millisecond */
4003#define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
4004
Kalle Valo5e3dd152013-06-12 20:52:10 +03004005struct wmi_pdev_get_tpc_config_cmd {
4006 /* parameter */
4007 __le32 param;
4008} __packed;
4009
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004010#define WMI_TPC_CONFIG_PARAM 1
Kalle Valo5e3dd152013-06-12 20:52:10 +03004011#define WMI_TPC_RATE_MAX 160
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +02004012#define WMI_TPC_FINAL_RATE_MAX 240
Kalle Valo5e3dd152013-06-12 20:52:10 +03004013#define WMI_TPC_TX_N_CHAIN 4
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004014#define WMI_TPC_PREAM_TABLE_MAX 10
4015#define WMI_TPC_FLAG 3
4016#define WMI_TPC_BUF_SIZE 10
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +02004017#define WMI_TPC_BEAMFORMING 2
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004018
4019enum wmi_tpc_table_type {
4020 WMI_TPC_TABLE_TYPE_CDD = 0,
4021 WMI_TPC_TABLE_TYPE_STBC = 1,
4022 WMI_TPC_TABLE_TYPE_TXBF = 2,
4023};
Kalle Valo5e3dd152013-06-12 20:52:10 +03004024
4025enum wmi_tpc_config_event_flag {
4026 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
4027 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
4028 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
4029};
4030
4031struct wmi_pdev_tpc_config_event {
4032 __le32 reg_domain;
4033 __le32 chan_freq;
4034 __le32 phy_mode;
4035 __le32 twice_antenna_reduction;
4036 __le32 twice_max_rd_power;
Kalle Valo3b8fc902015-10-05 17:56:37 +03004037 a_sle32 twice_antenna_gain;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004038 __le32 power_limit;
4039 __le32 rate_max;
4040 __le32 num_tx_chain;
4041 __le32 ctl;
4042 __le32 flags;
4043 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
4044 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4045 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4046 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4047 u8 rates_array[WMI_TPC_RATE_MAX];
4048} __packed;
4049
4050/* Transmit power scale factor. */
4051enum wmi_tp_scale {
4052 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
4053 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
4054 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
4055 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
4056 WMI_TP_SCALE_MIN = 4, /* min, but still on */
4057 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
4058};
4059
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +02004060struct wmi_pdev_tpc_final_table_event {
4061 __le32 reg_domain;
4062 __le32 chan_freq;
4063 __le32 phy_mode;
4064 __le32 twice_antenna_reduction;
4065 __le32 twice_max_rd_power;
4066 a_sle32 twice_antenna_gain;
4067 __le32 power_limit;
4068 __le32 rate_max;
4069 __le32 num_tx_chain;
4070 __le32 ctl;
4071 __le32 flags;
4072 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
4073 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4074 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4075 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
4076 u8 rates_array[WMI_TPC_FINAL_RATE_MAX];
4077 u8 ctl_power_table[WMI_TPC_BEAMFORMING][WMI_TPC_TX_N_CHAIN]
4078 [WMI_TPC_TX_N_CHAIN];
4079} __packed;
4080
4081struct wmi_pdev_get_tpc_table_cmd {
4082 __le32 param;
4083} __packed;
4084
4085enum wmi_tpc_pream_2ghz {
4086 WMI_TPC_PREAM_2GHZ_CCK = 0,
4087 WMI_TPC_PREAM_2GHZ_OFDM,
4088 WMI_TPC_PREAM_2GHZ_HT20,
4089 WMI_TPC_PREAM_2GHZ_HT40,
4090 WMI_TPC_PREAM_2GHZ_VHT20,
4091 WMI_TPC_PREAM_2GHZ_VHT40,
4092 WMI_TPC_PREAM_2GHZ_VHT80,
4093};
4094
4095enum wmi_tpc_pream_5ghz {
4096 WMI_TPC_PREAM_5GHZ_OFDM = 1,
4097 WMI_TPC_PREAM_5GHZ_HT20,
4098 WMI_TPC_PREAM_5GHZ_HT40,
4099 WMI_TPC_PREAM_5GHZ_VHT20,
4100 WMI_TPC_PREAM_5GHZ_VHT40,
4101 WMI_TPC_PREAM_5GHZ_VHT80,
4102 WMI_TPC_PREAM_5GHZ_HTCUP,
4103};
4104
Kalle Valo5e3dd152013-06-12 20:52:10 +03004105struct wmi_pdev_chanlist_update_event {
4106 /* number of channels */
4107 __le32 num_chan;
4108 /* array of channels */
4109 struct wmi_channel channel_list[1];
4110} __packed;
4111
4112#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
4113
4114struct wmi_debug_mesg_event {
4115 /* message buffer, NULL terminated */
4116 char bufp[WMI_MAX_DEBUG_MESG];
4117} __packed;
4118
4119enum {
4120 /* P2P device */
4121 VDEV_SUBTYPE_P2PDEV = 0,
4122 /* P2P client */
4123 VDEV_SUBTYPE_P2PCLI,
4124 /* P2P GO */
4125 VDEV_SUBTYPE_P2PGO,
4126 /* BT3.0 HS */
4127 VDEV_SUBTYPE_BT,
4128};
4129
4130struct wmi_pdev_set_channel_cmd {
4131 /* idnore power , only use flags , mode and freq */
4132 struct wmi_channel chan;
4133} __packed;
4134
Rajkumar Manoharan90174452014-10-03 08:02:33 +03004135struct wmi_pdev_pktlog_enable_cmd {
4136 __le32 ev_bitmap;
4137} __packed;
4138
Kalle Valo5e3dd152013-06-12 20:52:10 +03004139/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
4140#define WMI_DSCP_MAP_MAX (64)
4141struct wmi_pdev_set_dscp_tid_map_cmd {
4142 /* map indicating DSCP to TID conversion */
4143 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
4144} __packed;
4145
4146enum mcast_bcast_rate_id {
4147 WMI_SET_MCAST_RATE,
4148 WMI_SET_BCAST_RATE
4149};
4150
4151struct mcast_bcast_rate {
4152 enum mcast_bcast_rate_id rate_id;
4153 __le32 rate;
4154} __packed;
4155
4156struct wmi_wmm_params {
4157 __le32 cwmin;
4158 __le32 cwmax;
4159 __le32 aifs;
4160 __le32 txop;
4161 __le32 acm;
4162 __le32 no_ack;
4163} __packed;
4164
4165struct wmi_pdev_set_wmm_params {
4166 struct wmi_wmm_params ac_be;
4167 struct wmi_wmm_params ac_bk;
4168 struct wmi_wmm_params ac_vi;
4169 struct wmi_wmm_params ac_vo;
4170} __packed;
4171
4172struct wmi_wmm_params_arg {
4173 u32 cwmin;
4174 u32 cwmax;
4175 u32 aifs;
4176 u32 txop;
4177 u32 acm;
4178 u32 no_ack;
4179};
4180
Michal Kazior5e752e42015-01-19 09:53:41 +01004181struct wmi_wmm_params_all_arg {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004182 struct wmi_wmm_params_arg ac_be;
4183 struct wmi_wmm_params_arg ac_bk;
4184 struct wmi_wmm_params_arg ac_vi;
4185 struct wmi_wmm_params_arg ac_vo;
4186};
4187
Michal Kaziorb91251f2015-01-24 12:14:49 +02004188struct wmi_pdev_stats_tx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004189 /* Num HTT cookies queued to dispatch list */
4190 __le32 comp_queued;
4191
4192 /* Num HTT cookies dispatched */
4193 __le32 comp_delivered;
4194
4195 /* Num MSDU queued to WAL */
4196 __le32 msdu_enqued;
4197
4198 /* Num MPDU queue to WAL */
4199 __le32 mpdu_enqued;
4200
4201 /* Num MSDUs dropped by WMM limit */
4202 __le32 wmm_drop;
4203
4204 /* Num Local frames queued */
4205 __le32 local_enqued;
4206
4207 /* Num Local frames done */
4208 __le32 local_freed;
4209
4210 /* Num queued to HW */
4211 __le32 hw_queued;
4212
4213 /* Num PPDU reaped from HW */
4214 __le32 hw_reaped;
4215
4216 /* Num underruns */
4217 __le32 underrun;
4218
4219 /* Num PPDUs cleaned up in TX abort */
4220 __le32 tx_abort;
4221
4222 /* Num MPDUs requed by SW */
4223 __le32 mpdus_requed;
4224
4225 /* excessive retries */
4226 __le32 tx_ko;
4227
4228 /* data hw rate code */
4229 __le32 data_rc;
4230
4231 /* Scheduler self triggers */
4232 __le32 self_triggers;
4233
4234 /* frames dropped due to excessive sw retries */
4235 __le32 sw_retry_failure;
4236
4237 /* illegal rate phy errors */
4238 __le32 illgl_rate_phy_err;
4239
Joe Perchese13dbea2016-09-26 21:56:21 +03004240 /* wal pdev continuous xretry */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004241 __le32 pdev_cont_xretry;
4242
4243 /* wal pdev continous xretry */
4244 __le32 pdev_tx_timeout;
4245
4246 /* wal pdev resets */
4247 __le32 pdev_resets;
4248
Bartosz Markowski34d714e2014-03-28 14:35:16 +02004249 /* frames dropped due to non-availability of stateless TIDs */
4250 __le32 stateless_tid_alloc_failure;
4251
Kalle Valo5e3dd152013-06-12 20:52:10 +03004252 __le32 phy_underrun;
4253
4254 /* MPDU is more than txop limit */
4255 __le32 txop_ovf;
4256} __packed;
4257
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004258struct wmi_10_4_pdev_stats_tx {
4259 /* Num HTT cookies queued to dispatch list */
4260 __le32 comp_queued;
4261
4262 /* Num HTT cookies dispatched */
4263 __le32 comp_delivered;
4264
4265 /* Num MSDU queued to WAL */
4266 __le32 msdu_enqued;
4267
4268 /* Num MPDU queue to WAL */
4269 __le32 mpdu_enqued;
4270
4271 /* Num MSDUs dropped by WMM limit */
4272 __le32 wmm_drop;
4273
4274 /* Num Local frames queued */
4275 __le32 local_enqued;
4276
4277 /* Num Local frames done */
4278 __le32 local_freed;
4279
4280 /* Num queued to HW */
4281 __le32 hw_queued;
4282
4283 /* Num PPDU reaped from HW */
4284 __le32 hw_reaped;
4285
4286 /* Num underruns */
4287 __le32 underrun;
4288
4289 /* HW Paused. */
4290 __le32 hw_paused;
4291
4292 /* Num PPDUs cleaned up in TX abort */
4293 __le32 tx_abort;
4294
4295 /* Num MPDUs requed by SW */
4296 __le32 mpdus_requed;
4297
4298 /* excessive retries */
4299 __le32 tx_ko;
4300
4301 /* data hw rate code */
4302 __le32 data_rc;
4303
4304 /* Scheduler self triggers */
4305 __le32 self_triggers;
4306
4307 /* frames dropped due to excessive sw retries */
4308 __le32 sw_retry_failure;
4309
4310 /* illegal rate phy errors */
4311 __le32 illgl_rate_phy_err;
4312
4313 /* wal pdev continuous xretry */
4314 __le32 pdev_cont_xretry;
4315
4316 /* wal pdev tx timeouts */
4317 __le32 pdev_tx_timeout;
4318
4319 /* wal pdev resets */
4320 __le32 pdev_resets;
4321
4322 /* frames dropped due to non-availability of stateless TIDs */
4323 __le32 stateless_tid_alloc_failure;
4324
4325 __le32 phy_underrun;
4326
4327 /* MPDU is more than txop limit */
4328 __le32 txop_ovf;
4329
4330 /* Number of Sequences posted */
4331 __le32 seq_posted;
4332
4333 /* Number of Sequences failed queueing */
4334 __le32 seq_failed_queueing;
4335
4336 /* Number of Sequences completed */
4337 __le32 seq_completed;
4338
4339 /* Number of Sequences restarted */
4340 __le32 seq_restarted;
4341
4342 /* Number of MU Sequences posted */
4343 __le32 mu_seq_posted;
4344
4345 /* Num MPDUs flushed by SW, HWPAUSED,SW TXABORT(Reset,channel change) */
4346 __le32 mpdus_sw_flush;
4347
4348 /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
4349 __le32 mpdus_hw_filter;
4350
4351 /* Num MPDUs truncated by PDG
4352 * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
4353 */
4354 __le32 mpdus_truncated;
4355
4356 /* Num MPDUs that was tried but didn't receive ACK or BA */
4357 __le32 mpdus_ack_failed;
4358
4359 /* Num MPDUs that was dropped due to expiry. */
4360 __le32 mpdus_expired;
4361} __packed;
4362
Michal Kaziorb91251f2015-01-24 12:14:49 +02004363struct wmi_pdev_stats_rx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004364 /* Cnts any change in ring routing mid-ppdu */
4365 __le32 mid_ppdu_route_change;
4366
4367 /* Total number of statuses processed */
4368 __le32 status_rcvd;
4369
4370 /* Extra frags on rings 0-3 */
4371 __le32 r0_frags;
4372 __le32 r1_frags;
4373 __le32 r2_frags;
4374 __le32 r3_frags;
4375
4376 /* MSDUs / MPDUs delivered to HTT */
4377 __le32 htt_msdus;
4378 __le32 htt_mpdus;
4379
4380 /* MSDUs / MPDUs delivered to local stack */
4381 __le32 loc_msdus;
4382 __le32 loc_mpdus;
4383
4384 /* AMSDUs that have more MSDUs than the status ring size */
4385 __le32 oversize_amsdu;
4386
4387 /* Number of PHY errors */
4388 __le32 phy_errs;
4389
4390 /* Number of PHY errors drops */
4391 __le32 phy_err_drop;
4392
4393 /* Number of mpdu errors - FCS, MIC, ENC etc. */
4394 __le32 mpdu_errs;
4395} __packed;
4396
Michal Kaziorb91251f2015-01-24 12:14:49 +02004397struct wmi_pdev_stats_peer {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004398 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4399 __le32 dummy;
4400} __packed;
4401
Kalle Valo5e3dd152013-06-12 20:52:10 +03004402enum wmi_stats_id {
Michal Kazioreed55412015-02-15 16:50:41 +02004403 WMI_STAT_PEER = BIT(0),
4404 WMI_STAT_AP = BIT(1),
4405 WMI_STAT_PDEV = BIT(2),
4406 WMI_STAT_VDEV = BIT(3),
4407 WMI_STAT_BCNFLT = BIT(4),
4408 WMI_STAT_VDEV_RATE = BIT(5),
Kalle Valo5e3dd152013-06-12 20:52:10 +03004409};
4410
Mohammed Shafi Shajakhanf9575792016-03-16 18:13:34 +05304411enum wmi_10_4_stats_id {
4412 WMI_10_4_STAT_PEER = BIT(0),
4413 WMI_10_4_STAT_AP = BIT(1),
4414 WMI_10_4_STAT_INST = BIT(2),
4415 WMI_10_4_STAT_PEER_EXTD = BIT(3),
4416};
4417
Ben Greeardb9cdda2014-03-28 14:35:15 +02004418struct wlan_inst_rssi_args {
4419 __le16 cfg_retry_count;
4420 __le16 retry_count;
4421};
4422
Kalle Valo5e3dd152013-06-12 20:52:10 +03004423struct wmi_request_stats_cmd {
4424 __le32 stats_id;
4425
Ben Greeardb9cdda2014-03-28 14:35:15 +02004426 __le32 vdev_id;
4427
4428 /* peer MAC address */
4429 struct wmi_mac_addr peer_macaddr;
4430
4431 /* Instantaneous RSSI arguments */
4432 struct wlan_inst_rssi_args inst_rssi_args;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004433} __packed;
4434
4435/* Suspend option */
4436enum {
4437 /* suspend */
4438 WMI_PDEV_SUSPEND,
4439
4440 /* suspend and disable all interrupts */
4441 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
4442};
4443
4444struct wmi_pdev_suspend_cmd {
4445 /* suspend option sent to target */
4446 __le32 suspend_opt;
4447} __packed;
4448
4449struct wmi_stats_event {
Michal Kazioreed55412015-02-15 16:50:41 +02004450 __le32 stats_id; /* WMI_STAT_ */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004451 /*
4452 * number of pdev stats event structures
4453 * (wmi_pdev_stats) 0 or 1
4454 */
4455 __le32 num_pdev_stats;
4456 /*
4457 * number of vdev stats event structures
4458 * (wmi_vdev_stats) 0 or max vdevs
4459 */
4460 __le32 num_vdev_stats;
4461 /*
4462 * number of peer stats event structures
4463 * (wmi_peer_stats) 0 or max peers
4464 */
4465 __le32 num_peer_stats;
4466 __le32 num_bcnflt_stats;
4467 /*
4468 * followed by
4469 * num_pdev_stats * size of(struct wmi_pdev_stats)
4470 * num_vdev_stats * size of(struct wmi_vdev_stats)
4471 * num_peer_stats * size of(struct wmi_peer_stats)
4472 *
4473 * By having a zero sized array, the pointer to data area
4474 * becomes available without increasing the struct size
4475 */
4476 u8 data[0];
4477} __packed;
4478
Michal Kazior20de2222015-01-24 12:14:49 +02004479struct wmi_10_2_stats_event {
4480 __le32 stats_id; /* %WMI_REQUEST_ */
4481 __le32 num_pdev_stats;
4482 __le32 num_pdev_ext_stats;
4483 __le32 num_vdev_stats;
4484 __le32 num_peer_stats;
4485 __le32 num_bcnflt_stats;
4486 u8 data[0];
4487} __packed;
4488
Kalle Valo5e3dd152013-06-12 20:52:10 +03004489/*
4490 * PDEV statistics
4491 * TODO: add all PDEV stats here
4492 */
Michal Kaziorb91251f2015-01-24 12:14:49 +02004493struct wmi_pdev_stats_base {
4494 __le32 chan_nf;
Ben Greear15138fd2016-09-26 21:56:26 +03004495 __le32 tx_frame_count; /* Cycles spent transmitting frames */
4496 __le32 rx_frame_count; /* Cycles spent receiving frames */
4497 __le32 rx_clear_count; /* Total channel busy time, evidently */
4498 __le32 cycle_count; /* Total on-channel time */
Michal Kaziorb91251f2015-01-24 12:14:49 +02004499 __le32 phy_err_count;
4500 __le32 chan_tx_pwr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004501} __packed;
4502
Michal Kaziorb91251f2015-01-24 12:14:49 +02004503struct wmi_pdev_stats {
4504 struct wmi_pdev_stats_base base;
4505 struct wmi_pdev_stats_tx tx;
4506 struct wmi_pdev_stats_rx rx;
4507 struct wmi_pdev_stats_peer peer;
4508} __packed;
4509
4510struct wmi_pdev_stats_extra {
Chun-Yeow Yeoh52e346d2014-03-28 14:35:16 +02004511 __le32 ack_rx_bad;
4512 __le32 rts_bad;
4513 __le32 rts_good;
4514 __le32 fcs_bad;
4515 __le32 no_beacons;
4516 __le32 mib_int_count;
4517} __packed;
4518
Michal Kaziorb91251f2015-01-24 12:14:49 +02004519struct wmi_10x_pdev_stats {
4520 struct wmi_pdev_stats_base base;
4521 struct wmi_pdev_stats_tx tx;
4522 struct wmi_pdev_stats_rx rx;
4523 struct wmi_pdev_stats_peer peer;
4524 struct wmi_pdev_stats_extra extra;
4525} __packed;
4526
Michal Kazior20de2222015-01-24 12:14:49 +02004527struct wmi_pdev_stats_mem {
4528 __le32 dram_free;
4529 __le32 iram_free;
4530} __packed;
4531
4532struct wmi_10_2_pdev_stats {
4533 struct wmi_pdev_stats_base base;
4534 struct wmi_pdev_stats_tx tx;
4535 __le32 mc_drop;
4536 struct wmi_pdev_stats_rx rx;
4537 __le32 pdev_rx_timeout;
4538 struct wmi_pdev_stats_mem mem;
4539 struct wmi_pdev_stats_peer peer;
4540 struct wmi_pdev_stats_extra extra;
4541} __packed;
4542
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004543struct wmi_10_4_pdev_stats {
4544 struct wmi_pdev_stats_base base;
4545 struct wmi_10_4_pdev_stats_tx tx;
4546 struct wmi_pdev_stats_rx rx;
4547 __le32 rx_ovfl_errs;
4548 struct wmi_pdev_stats_mem mem;
4549 __le32 sram_free_size;
4550 struct wmi_pdev_stats_extra extra;
4551} __packed;
4552
Kalle Valo5e3dd152013-06-12 20:52:10 +03004553/*
4554 * VDEV statistics
4555 * TODO: add all VDEV stats here
4556 */
4557struct wmi_vdev_stats {
4558 __le32 vdev_id;
4559} __packed;
4560
4561/*
4562 * peer statistics.
4563 * TODO: add more stats
4564 */
Michal Kaziord15fb522014-09-25 12:33:47 +02004565struct wmi_peer_stats {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004566 struct wmi_mac_addr peer_macaddr;
4567 __le32 peer_rssi;
4568 __le32 peer_tx_rate;
4569} __packed;
4570
Michal Kaziord15fb522014-09-25 12:33:47 +02004571struct wmi_10x_peer_stats {
4572 struct wmi_peer_stats old;
Ben Greear23c3aae2014-03-28 14:35:15 +02004573 __le32 peer_rx_rate;
4574} __packed;
4575
Michal Kazior20de2222015-01-24 12:14:49 +02004576struct wmi_10_2_peer_stats {
4577 struct wmi_peer_stats old;
4578 __le32 peer_rx_rate;
4579 __le32 current_per;
4580 __le32 retries;
4581 __le32 tx_rate_count;
4582 __le32 max_4ms_frame_len;
4583 __le32 total_sub_frames;
4584 __le32 tx_bytes;
4585 __le32 num_pkt_loss_overflow[4];
4586 __le32 num_pkt_loss_excess_retry[4];
4587} __packed;
4588
4589struct wmi_10_2_4_peer_stats {
4590 struct wmi_10_2_peer_stats common;
Mohammed Shafi Shajakhan774e6562016-01-13 21:16:29 +05304591 __le32 peer_rssi_changed;
Michal Kazior20de2222015-01-24 12:14:49 +02004592} __packed;
4593
Mohammed Shafi Shajakhande46c012016-01-13 21:16:28 +05304594struct wmi_10_2_4_ext_peer_stats {
4595 struct wmi_10_2_peer_stats common;
4596 __le32 peer_rssi_changed;
4597 __le32 rx_duration;
4598} __packed;
4599
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004600struct wmi_10_4_peer_stats {
4601 struct wmi_mac_addr peer_macaddr;
4602 __le32 peer_rssi;
4603 __le32 peer_rssi_seq_num;
4604 __le32 peer_tx_rate;
4605 __le32 peer_rx_rate;
4606 __le32 current_per;
4607 __le32 retries;
4608 __le32 tx_rate_count;
4609 __le32 max_4ms_frame_len;
4610 __le32 total_sub_frames;
4611 __le32 tx_bytes;
4612 __le32 num_pkt_loss_overflow[4];
4613 __le32 num_pkt_loss_excess_retry[4];
4614 __le32 peer_rssi_changed;
4615} __packed;
4616
Mohammed Shafi Shajakhanf9575792016-03-16 18:13:34 +05304617struct wmi_10_4_peer_extd_stats {
Mohammed Shafi Shajakhanf9575792016-03-16 18:13:34 +05304618 struct wmi_mac_addr peer_macaddr;
4619 __le32 inactive_time;
4620 __le32 peer_chain_rssi;
4621 __le32 rx_duration;
4622 __le32 reserved[10];
4623} __packed;
4624
Mohammed Shafi Shajakhan4a49ae92016-06-30 15:23:47 +03004625struct wmi_10_4_bss_bcn_stats {
4626 __le32 vdev_id;
4627 __le32 bss_bcns_dropped;
4628 __le32 bss_bcn_delivered;
4629} __packed;
4630
4631struct wmi_10_4_bss_bcn_filter_stats {
4632 __le32 bcns_dropped;
4633 __le32 bcns_delivered;
4634 __le32 active_filters;
4635 struct wmi_10_4_bss_bcn_stats bss_stats;
4636} __packed;
4637
Michal Kazior20de2222015-01-24 12:14:49 +02004638struct wmi_10_2_pdev_ext_stats {
4639 __le32 rx_rssi_comb;
4640 __le32 rx_rssi[4];
4641 __le32 rx_mcs[10];
4642 __le32 tx_mcs[10];
4643 __le32 ack_rssi;
4644} __packed;
4645
Kalle Valo5e3dd152013-06-12 20:52:10 +03004646struct wmi_vdev_create_cmd {
4647 __le32 vdev_id;
4648 __le32 vdev_type;
4649 __le32 vdev_subtype;
4650 struct wmi_mac_addr vdev_macaddr;
4651} __packed;
4652
4653enum wmi_vdev_type {
4654 WMI_VDEV_TYPE_AP = 1,
4655 WMI_VDEV_TYPE_STA = 2,
4656 WMI_VDEV_TYPE_IBSS = 3,
4657 WMI_VDEV_TYPE_MONITOR = 4,
4658};
4659
4660enum wmi_vdev_subtype {
Peter Oh6e4de1a2016-01-28 13:54:10 -08004661 WMI_VDEV_SUBTYPE_NONE,
4662 WMI_VDEV_SUBTYPE_P2P_DEVICE,
4663 WMI_VDEV_SUBTYPE_P2P_CLIENT,
4664 WMI_VDEV_SUBTYPE_P2P_GO,
4665 WMI_VDEV_SUBTYPE_PROXY_STA,
4666 WMI_VDEV_SUBTYPE_MESH_11S,
4667 WMI_VDEV_SUBTYPE_MESH_NON_11S,
4668};
4669
4670enum wmi_vdev_subtype_legacy {
4671 WMI_VDEV_SUBTYPE_LEGACY_NONE = 0,
4672 WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV = 1,
4673 WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI = 2,
4674 WMI_VDEV_SUBTYPE_LEGACY_P2P_GO = 3,
4675 WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA = 4,
4676};
4677
4678enum wmi_vdev_subtype_10_2_4 {
4679 WMI_VDEV_SUBTYPE_10_2_4_NONE = 0,
4680 WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV = 1,
4681 WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI = 2,
4682 WMI_VDEV_SUBTYPE_10_2_4_P2P_GO = 3,
4683 WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA = 4,
4684 WMI_VDEV_SUBTYPE_10_2_4_MESH_11S = 5,
4685};
4686
4687enum wmi_vdev_subtype_10_4 {
4688 WMI_VDEV_SUBTYPE_10_4_NONE = 0,
4689 WMI_VDEV_SUBTYPE_10_4_P2P_DEV = 1,
4690 WMI_VDEV_SUBTYPE_10_4_P2P_CLI = 2,
4691 WMI_VDEV_SUBTYPE_10_4_P2P_GO = 3,
4692 WMI_VDEV_SUBTYPE_10_4_PROXY_STA = 4,
4693 WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S = 5,
4694 WMI_VDEV_SUBTYPE_10_4_MESH_11S = 6,
Kalle Valo5e3dd152013-06-12 20:52:10 +03004695};
4696
4697/* values for vdev_subtype */
4698
4699/* values for vdev_start_request flags */
4700/*
4701 * Indicates that AP VDEV uses hidden ssid. only valid for
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01004702 * AP/GO
4703 */
Kalle Valo14e105c2016-04-13 14:13:21 +03004704#define WMI_VDEV_START_HIDDEN_SSID (1 << 0)
Kalle Valo5e3dd152013-06-12 20:52:10 +03004705/*
4706 * Indicates if robust management frame/management frame
4707 * protection is enabled. For GO/AP vdevs, it indicates that
4708 * it may support station/client associations with RMF enabled.
4709 * For STA/client vdevs, it indicates that sta will
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01004710 * associate with AP with RMF enabled.
4711 */
Kalle Valo14e105c2016-04-13 14:13:21 +03004712#define WMI_VDEV_START_PMF_ENABLED (1 << 1)
Kalle Valo5e3dd152013-06-12 20:52:10 +03004713
4714struct wmi_p2p_noa_descriptor {
4715 __le32 type_count; /* 255: continuous schedule, 0: reserved */
4716 __le32 duration; /* Absent period duration in micro seconds */
4717 __le32 interval; /* Absent period interval in micro seconds */
4718 __le32 start_time; /* 32 bit tsf time when in starts */
4719} __packed;
4720
4721struct wmi_vdev_start_request_cmd {
4722 /* WMI channel */
4723 struct wmi_channel chan;
4724 /* unique id identifying the VDEV, generated by the caller */
4725 __le32 vdev_id;
4726 /* requestor id identifying the caller module */
4727 __le32 requestor_id;
4728 /* beacon interval from received beacon */
4729 __le32 beacon_interval;
4730 /* DTIM Period from the received beacon */
4731 __le32 dtim_period;
4732 /* Flags */
4733 __le32 flags;
4734 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
4735 struct wmi_ssid ssid;
Joe Perchese13dbea2016-09-26 21:56:21 +03004736 /* beacon/probe response xmit rate. Applicable for SoftAP. */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004737 __le32 bcn_tx_rate;
Joe Perchese13dbea2016-09-26 21:56:21 +03004738 /* beacon/probe response xmit power. Applicable for SoftAP. */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004739 __le32 bcn_tx_power;
4740 /* number of p2p NOA descriptor(s) from scan entry */
4741 __le32 num_noa_descriptors;
4742 /*
4743 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
4744 * During CAC, Our HW shouldn't ack ditected frames
4745 */
4746 __le32 disable_hw_ack;
4747 /* actual p2p NOA descriptor from scan entry */
4748 struct wmi_p2p_noa_descriptor noa_descriptors[2];
4749} __packed;
4750
4751struct wmi_vdev_restart_request_cmd {
4752 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
4753} __packed;
4754
4755struct wmi_vdev_start_request_arg {
4756 u32 vdev_id;
4757 struct wmi_channel_arg channel;
4758 u32 bcn_intval;
4759 u32 dtim_period;
4760 u8 *ssid;
4761 u32 ssid_len;
4762 u32 bcn_tx_rate;
4763 u32 bcn_tx_power;
4764 bool disable_hw_ack;
4765 bool hidden_ssid;
4766 bool pmf_enabled;
4767};
4768
4769struct wmi_vdev_delete_cmd {
4770 /* unique id identifying the VDEV, generated by the caller */
4771 __le32 vdev_id;
4772} __packed;
4773
4774struct wmi_vdev_up_cmd {
4775 __le32 vdev_id;
4776 __le32 vdev_assoc_id;
4777 struct wmi_mac_addr vdev_bssid;
4778} __packed;
4779
4780struct wmi_vdev_stop_cmd {
4781 __le32 vdev_id;
4782} __packed;
4783
4784struct wmi_vdev_down_cmd {
4785 __le32 vdev_id;
4786} __packed;
4787
4788struct wmi_vdev_standby_response_cmd {
4789 /* unique id identifying the VDEV, generated by the caller */
4790 __le32 vdev_id;
4791} __packed;
4792
4793struct wmi_vdev_resume_response_cmd {
4794 /* unique id identifying the VDEV, generated by the caller */
4795 __le32 vdev_id;
4796} __packed;
4797
4798struct wmi_vdev_set_param_cmd {
4799 __le32 vdev_id;
4800 __le32 param_id;
4801 __le32 param_value;
4802} __packed;
4803
4804#define WMI_MAX_KEY_INDEX 3
4805#define WMI_MAX_KEY_LEN 32
4806
4807#define WMI_KEY_PAIRWISE 0x00
4808#define WMI_KEY_GROUP 0x01
4809#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
4810
4811struct wmi_key_seq_counter {
4812 __le32 key_seq_counter_l;
4813 __le32 key_seq_counter_h;
4814} __packed;
4815
4816#define WMI_CIPHER_NONE 0x0 /* clear key */
4817#define WMI_CIPHER_WEP 0x1
4818#define WMI_CIPHER_TKIP 0x2
4819#define WMI_CIPHER_AES_OCB 0x3
4820#define WMI_CIPHER_AES_CCM 0x4
4821#define WMI_CIPHER_WAPI 0x5
4822#define WMI_CIPHER_CKIP 0x6
4823#define WMI_CIPHER_AES_CMAC 0x7
Rajkumar Manoharan2ea9f122017-09-25 15:29:41 -07004824#define WMI_CIPHER_AES_GCM 0x8
Kalle Valo5e3dd152013-06-12 20:52:10 +03004825
4826struct wmi_vdev_install_key_cmd {
4827 __le32 vdev_id;
4828 struct wmi_mac_addr peer_macaddr;
4829 __le32 key_idx;
4830 __le32 key_flags;
4831 __le32 key_cipher; /* %WMI_CIPHER_ */
4832 struct wmi_key_seq_counter key_rsc_counter;
4833 struct wmi_key_seq_counter key_global_rsc_counter;
4834 struct wmi_key_seq_counter key_tsc_counter;
4835 u8 wpi_key_rsc_counter[16];
4836 u8 wpi_key_tsc_counter[16];
4837 __le32 key_len;
4838 __le32 key_txmic_len;
4839 __le32 key_rxmic_len;
4840
4841 /* contains key followed by tx mic followed by rx mic */
4842 u8 key_data[0];
4843} __packed;
4844
4845struct wmi_vdev_install_key_arg {
4846 u32 vdev_id;
4847 const u8 *macaddr;
4848 u32 key_idx;
4849 u32 key_flags;
4850 u32 key_cipher;
4851 u32 key_len;
4852 u32 key_txmic_len;
4853 u32 key_rxmic_len;
4854 const void *key_data;
4855};
4856
Janusz Dziedzic51ab1a02014-01-08 09:08:33 +01004857/*
4858 * vdev fixed rate format:
4859 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
4860 * - nss - b5:b4 - ss number (0 mean 1ss)
4861 * - rate_mcs - b3:b0 - as below
4862 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
4863 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
4864 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
4865 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
4866 * HT/VHT: MCS index
4867 */
4868
Kalle Valo5e3dd152013-06-12 20:52:10 +03004869/* Preamble types to be used with VDEV fixed rate configuration */
4870enum wmi_rate_preamble {
4871 WMI_RATE_PREAMBLE_OFDM,
4872 WMI_RATE_PREAMBLE_CCK,
4873 WMI_RATE_PREAMBLE_HT,
4874 WMI_RATE_PREAMBLE_VHT,
4875};
4876
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004877#define ATH10K_HW_NSS(rate) (1 + (((rate) >> 4) & 0x3))
4878#define ATH10K_HW_PREAMBLE(rate) (((rate) >> 6) & 0x3)
Anilkumar Kollicec17c32016-11-23 16:58:10 +02004879#define ATH10K_HW_MCS_RATE(rate) ((rate) & 0xf)
4880#define ATH10K_HW_LEGACY_RATE(rate) ((rate) & 0x3f)
4881#define ATH10K_HW_BW(flags) (((flags) >> 3) & 0x3)
4882#define ATH10K_HW_GI(flags) (((flags) >> 5) & 0x1)
4883#define ATH10K_HW_RATECODE(rate, nss, preamble) \
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004884 (((preamble) << 6) | ((nss) << 4) | (rate))
4885
Anilkumar Kollicec17c32016-11-23 16:58:10 +02004886#define VHT_MCS_NUM 10
4887#define VHT_BW_NUM 4
4888#define VHT_NSS_NUM 4
4889
Kalle Valo5e3dd152013-06-12 20:52:10 +03004890/* Value to disable fixed rate setting */
4891#define WMI_FIXED_RATE_NONE (0xff)
4892
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004893struct wmi_vdev_param_map {
4894 u32 rts_threshold;
4895 u32 fragmentation_threshold;
4896 u32 beacon_interval;
4897 u32 listen_interval;
4898 u32 multicast_rate;
4899 u32 mgmt_tx_rate;
4900 u32 slot_time;
4901 u32 preamble;
4902 u32 swba_time;
4903 u32 wmi_vdev_stats_update_period;
4904 u32 wmi_vdev_pwrsave_ageout_time;
4905 u32 wmi_vdev_host_swba_interval;
4906 u32 dtim_period;
4907 u32 wmi_vdev_oc_scheduler_air_time_limit;
4908 u32 wds;
4909 u32 atim_window;
4910 u32 bmiss_count_max;
4911 u32 bmiss_first_bcnt;
4912 u32 bmiss_final_bcnt;
4913 u32 feature_wmm;
4914 u32 chwidth;
4915 u32 chextoffset;
4916 u32 disable_htprotection;
4917 u32 sta_quickkickout;
4918 u32 mgmt_rate;
4919 u32 protection_mode;
4920 u32 fixed_rate;
4921 u32 sgi;
4922 u32 ldpc;
4923 u32 tx_stbc;
4924 u32 rx_stbc;
4925 u32 intra_bss_fwd;
4926 u32 def_keyid;
4927 u32 nss;
4928 u32 bcast_data_rate;
4929 u32 mcast_data_rate;
4930 u32 mcast_indicate;
4931 u32 dhcp_indicate;
4932 u32 unknown_dest_indicate;
4933 u32 ap_keepalive_min_idle_inactive_time_secs;
4934 u32 ap_keepalive_max_idle_inactive_time_secs;
4935 u32 ap_keepalive_max_unresponsive_time_secs;
4936 u32 ap_enable_nawds;
4937 u32 mcast2ucast_set;
4938 u32 enable_rtscts;
4939 u32 txbf;
4940 u32 packet_powersave;
4941 u32 drop_unencry;
4942 u32 tx_encap_type;
4943 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
Raja Mani93841a12015-06-22 20:10:13 +05304944 u32 rc_num_retries;
4945 u32 cabq_maxdur;
4946 u32 mfptest_set;
4947 u32 rts_fixed_rate;
4948 u32 vht_sgimask;
4949 u32 vht80_ratemask;
4950 u32 early_rx_adjust_enable;
4951 u32 early_rx_tgt_bmiss_num;
4952 u32 early_rx_bmiss_sample_cycle;
4953 u32 early_rx_slop_step;
4954 u32 early_rx_init_slop;
4955 u32 early_rx_adjust_pause;
4956 u32 proxy_sta;
4957 u32 meru_vc;
4958 u32 rx_decap_type;
4959 u32 bw_nss_ratemask;
Pedersen, Thomas973324f2016-09-28 16:56:29 -07004960 u32 inc_tsf;
4961 u32 dec_tsf;
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004962};
4963
4964#define WMI_VDEV_PARAM_UNSUPPORTED 0
4965
Kalle Valo5e3dd152013-06-12 20:52:10 +03004966/* the definition of different VDEV parameters */
4967enum wmi_vdev_param {
4968 /* RTS Threshold */
4969 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4970 /* Fragmentation threshold */
4971 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4972 /* beacon interval in TUs */
4973 WMI_VDEV_PARAM_BEACON_INTERVAL,
4974 /* Listen interval in TUs */
4975 WMI_VDEV_PARAM_LISTEN_INTERVAL,
Joe Perchese13dbea2016-09-26 21:56:21 +03004976 /* multicast rate in Mbps */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004977 WMI_VDEV_PARAM_MULTICAST_RATE,
4978 /* management frame rate in Mbps */
4979 WMI_VDEV_PARAM_MGMT_TX_RATE,
4980 /* slot time (long vs short) */
4981 WMI_VDEV_PARAM_SLOT_TIME,
4982 /* preamble (long vs short) */
4983 WMI_VDEV_PARAM_PREAMBLE,
4984 /* SWBA time (time before tbtt in msec) */
4985 WMI_VDEV_PARAM_SWBA_TIME,
4986 /* time period for updating VDEV stats */
4987 WMI_VDEV_STATS_UPDATE_PERIOD,
4988 /* age out time in msec for frames queued for station in power save */
4989 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
4990 /*
4991 * Host SWBA interval (time in msec before tbtt for SWBA event
4992 * generation).
4993 */
4994 WMI_VDEV_HOST_SWBA_INTERVAL,
4995 /* DTIM period (specified in units of num beacon intervals) */
4996 WMI_VDEV_PARAM_DTIM_PERIOD,
4997 /*
4998 * scheduler air time limit for this VDEV. used by off chan
4999 * scheduler.
5000 */
5001 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
5002 /* enable/dsiable WDS for this VDEV */
5003 WMI_VDEV_PARAM_WDS,
5004 /* ATIM Window */
5005 WMI_VDEV_PARAM_ATIM_WINDOW,
5006 /* BMISS max */
5007 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
5008 /* BMISS first time */
5009 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
5010 /* BMISS final time */
5011 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
5012 /* WMM enables/disabled */
5013 WMI_VDEV_PARAM_FEATURE_WMM,
5014 /* Channel width */
5015 WMI_VDEV_PARAM_CHWIDTH,
5016 /* Channel Offset */
5017 WMI_VDEV_PARAM_CHEXTOFFSET,
5018 /* Disable HT Protection */
5019 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
5020 /* Quick STA Kickout */
5021 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
5022 /* Rate to be used with Management frames */
5023 WMI_VDEV_PARAM_MGMT_RATE,
5024 /* Protection Mode */
5025 WMI_VDEV_PARAM_PROTECTION_MODE,
5026 /* Fixed rate setting */
5027 WMI_VDEV_PARAM_FIXED_RATE,
5028 /* Short GI Enable/Disable */
5029 WMI_VDEV_PARAM_SGI,
5030 /* Enable LDPC */
5031 WMI_VDEV_PARAM_LDPC,
5032 /* Enable Tx STBC */
5033 WMI_VDEV_PARAM_TX_STBC,
5034 /* Enable Rx STBC */
5035 WMI_VDEV_PARAM_RX_STBC,
5036 /* Intra BSS forwarding */
5037 WMI_VDEV_PARAM_INTRA_BSS_FWD,
5038 /* Setting Default xmit key for Vdev */
5039 WMI_VDEV_PARAM_DEF_KEYID,
5040 /* NSS width */
5041 WMI_VDEV_PARAM_NSS,
5042 /* Set the custom rate for the broadcast data frames */
5043 WMI_VDEV_PARAM_BCAST_DATA_RATE,
5044 /* Set the custom rate (rate-code) for multicast data frames */
5045 WMI_VDEV_PARAM_MCAST_DATA_RATE,
5046 /* Tx multicast packet indicate Enable/Disable */
5047 WMI_VDEV_PARAM_MCAST_INDICATE,
5048 /* Tx DHCP packet indicate Enable/Disable */
5049 WMI_VDEV_PARAM_DHCP_INDICATE,
5050 /* Enable host inspection of Tx unicast packet to unknown destination */
5051 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
5052
5053 /* The minimum amount of time AP begins to consider STA inactive */
5054 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
5055
5056 /*
5057 * An associated STA is considered inactive when there is no recent
5058 * TX/RX activity and no downlink frames are buffered for it. Once a
5059 * STA exceeds the maximum idle inactive time, the AP will send an
5060 * 802.11 data-null as a keep alive to verify the STA is still
5061 * associated. If the STA does ACK the data-null, or if the data-null
5062 * is buffered and the STA does not retrieve it, the STA will be
5063 * considered unresponsive
5064 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
5065 */
5066 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
5067
5068 /*
5069 * An associated STA is considered unresponsive if there is no recent
5070 * TX/RX activity and downlink frames are buffered for it. Once a STA
5071 * exceeds the maximum unresponsive time, the AP will send a
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01005072 * WMI_STA_KICKOUT event to the host so the STA can be deleted.
5073 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005074 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
5075
5076 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
5077 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
5078 /* Enable/Disable RTS-CTS */
5079 WMI_VDEV_PARAM_ENABLE_RTSCTS,
5080 /* Enable TXBFee/er */
5081 WMI_VDEV_PARAM_TXBF,
5082
5083 /* Set packet power save */
5084 WMI_VDEV_PARAM_PACKET_POWERSAVE,
5085
5086 /*
5087 * Drops un-encrypted packets if eceived in an encrypted connection
5088 * otherwise forwards to host.
5089 */
5090 WMI_VDEV_PARAM_DROP_UNENCRY,
5091
5092 /*
5093 * Set the encapsulation type for frames.
5094 */
5095 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
5096};
5097
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02005098/* the definition of different VDEV parameters */
5099enum wmi_10x_vdev_param {
5100 /* RTS Threshold */
5101 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
5102 /* Fragmentation threshold */
5103 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
5104 /* beacon interval in TUs */
5105 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
5106 /* Listen interval in TUs */
5107 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
Joe Perchese13dbea2016-09-26 21:56:21 +03005108 /* multicast rate in Mbps */
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02005109 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
5110 /* management frame rate in Mbps */
5111 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
5112 /* slot time (long vs short) */
5113 WMI_10X_VDEV_PARAM_SLOT_TIME,
5114 /* preamble (long vs short) */
5115 WMI_10X_VDEV_PARAM_PREAMBLE,
5116 /* SWBA time (time before tbtt in msec) */
5117 WMI_10X_VDEV_PARAM_SWBA_TIME,
5118 /* time period for updating VDEV stats */
5119 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
5120 /* age out time in msec for frames queued for station in power save */
5121 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
5122 /*
5123 * Host SWBA interval (time in msec before tbtt for SWBA event
5124 * generation).
5125 */
5126 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
5127 /* DTIM period (specified in units of num beacon intervals) */
5128 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
5129 /*
5130 * scheduler air time limit for this VDEV. used by off chan
5131 * scheduler.
5132 */
5133 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
5134 /* enable/dsiable WDS for this VDEV */
5135 WMI_10X_VDEV_PARAM_WDS,
5136 /* ATIM Window */
5137 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
5138 /* BMISS max */
5139 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
5140 /* WMM enables/disabled */
5141 WMI_10X_VDEV_PARAM_FEATURE_WMM,
5142 /* Channel width */
5143 WMI_10X_VDEV_PARAM_CHWIDTH,
5144 /* Channel Offset */
5145 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
5146 /* Disable HT Protection */
5147 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
5148 /* Quick STA Kickout */
5149 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
5150 /* Rate to be used with Management frames */
5151 WMI_10X_VDEV_PARAM_MGMT_RATE,
5152 /* Protection Mode */
5153 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
5154 /* Fixed rate setting */
5155 WMI_10X_VDEV_PARAM_FIXED_RATE,
5156 /* Short GI Enable/Disable */
5157 WMI_10X_VDEV_PARAM_SGI,
5158 /* Enable LDPC */
5159 WMI_10X_VDEV_PARAM_LDPC,
5160 /* Enable Tx STBC */
5161 WMI_10X_VDEV_PARAM_TX_STBC,
5162 /* Enable Rx STBC */
5163 WMI_10X_VDEV_PARAM_RX_STBC,
5164 /* Intra BSS forwarding */
5165 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
5166 /* Setting Default xmit key for Vdev */
5167 WMI_10X_VDEV_PARAM_DEF_KEYID,
5168 /* NSS width */
5169 WMI_10X_VDEV_PARAM_NSS,
5170 /* Set the custom rate for the broadcast data frames */
5171 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
5172 /* Set the custom rate (rate-code) for multicast data frames */
5173 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
5174 /* Tx multicast packet indicate Enable/Disable */
5175 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
5176 /* Tx DHCP packet indicate Enable/Disable */
5177 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
5178 /* Enable host inspection of Tx unicast packet to unknown destination */
5179 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
5180
5181 /* The minimum amount of time AP begins to consider STA inactive */
5182 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
5183
5184 /*
5185 * An associated STA is considered inactive when there is no recent
5186 * TX/RX activity and no downlink frames are buffered for it. Once a
5187 * STA exceeds the maximum idle inactive time, the AP will send an
5188 * 802.11 data-null as a keep alive to verify the STA is still
5189 * associated. If the STA does ACK the data-null, or if the data-null
5190 * is buffered and the STA does not retrieve it, the STA will be
5191 * considered unresponsive
5192 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
5193 */
5194 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
5195
5196 /*
5197 * An associated STA is considered unresponsive if there is no recent
5198 * TX/RX activity and downlink frames are buffered for it. Once a STA
5199 * exceeds the maximum unresponsive time, the AP will send a
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01005200 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted.
5201 */
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02005202 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
5203
5204 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
5205 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
5206
5207 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
5208 /* Enable/Disable RTS-CTS */
5209 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
5210
5211 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
Michal Kazior24c88f72014-07-25 13:32:17 +02005212
5213 /* following are available as of firmware 10.2 */
5214 WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
5215 WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
5216 WMI_10X_VDEV_PARAM_MFPTEST_SET,
5217 WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
5218 WMI_10X_VDEV_PARAM_VHT_SGIMASK,
5219 WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
Peter Oh9f0b7e72016-04-04 16:19:14 -07005220 WMI_10X_VDEV_PARAM_TSF_INCREMENT,
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02005221};
5222
Raja Mani93841a12015-06-22 20:10:13 +05305223enum wmi_10_4_vdev_param {
5224 WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1,
5225 WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
5226 WMI_10_4_VDEV_PARAM_BEACON_INTERVAL,
5227 WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL,
5228 WMI_10_4_VDEV_PARAM_MULTICAST_RATE,
5229 WMI_10_4_VDEV_PARAM_MGMT_TX_RATE,
5230 WMI_10_4_VDEV_PARAM_SLOT_TIME,
5231 WMI_10_4_VDEV_PARAM_PREAMBLE,
5232 WMI_10_4_VDEV_PARAM_SWBA_TIME,
5233 WMI_10_4_VDEV_STATS_UPDATE_PERIOD,
5234 WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME,
5235 WMI_10_4_VDEV_HOST_SWBA_INTERVAL,
5236 WMI_10_4_VDEV_PARAM_DTIM_PERIOD,
5237 WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
5238 WMI_10_4_VDEV_PARAM_WDS,
5239 WMI_10_4_VDEV_PARAM_ATIM_WINDOW,
5240 WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX,
5241 WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT,
5242 WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT,
5243 WMI_10_4_VDEV_PARAM_FEATURE_WMM,
5244 WMI_10_4_VDEV_PARAM_CHWIDTH,
5245 WMI_10_4_VDEV_PARAM_CHEXTOFFSET,
5246 WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION,
5247 WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT,
5248 WMI_10_4_VDEV_PARAM_MGMT_RATE,
5249 WMI_10_4_VDEV_PARAM_PROTECTION_MODE,
5250 WMI_10_4_VDEV_PARAM_FIXED_RATE,
5251 WMI_10_4_VDEV_PARAM_SGI,
5252 WMI_10_4_VDEV_PARAM_LDPC,
5253 WMI_10_4_VDEV_PARAM_TX_STBC,
5254 WMI_10_4_VDEV_PARAM_RX_STBC,
5255 WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD,
5256 WMI_10_4_VDEV_PARAM_DEF_KEYID,
5257 WMI_10_4_VDEV_PARAM_NSS,
5258 WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE,
5259 WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE,
5260 WMI_10_4_VDEV_PARAM_MCAST_INDICATE,
5261 WMI_10_4_VDEV_PARAM_DHCP_INDICATE,
5262 WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
5263 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
5264 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
5265 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
5266 WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS,
5267 WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET,
5268 WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS,
5269 WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES,
5270 WMI_10_4_VDEV_PARAM_TXBF,
5271 WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE,
5272 WMI_10_4_VDEV_PARAM_DROP_UNENCRY,
5273 WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE,
5274 WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
5275 WMI_10_4_VDEV_PARAM_CABQ_MAXDUR,
5276 WMI_10_4_VDEV_PARAM_MFPTEST_SET,
5277 WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE,
5278 WMI_10_4_VDEV_PARAM_VHT_SGIMASK,
5279 WMI_10_4_VDEV_PARAM_VHT80_RATEMASK,
5280 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE,
5281 WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
5282 WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE,
5283 WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP,
5284 WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP,
5285 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE,
5286 WMI_10_4_VDEV_PARAM_PROXY_STA,
5287 WMI_10_4_VDEV_PARAM_MERU_VC,
5288 WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
5289 WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
Peter Oh4857dd12016-04-04 16:19:15 -07005290 WMI_10_4_VDEV_PARAM_SENSOR_AP,
5291 WMI_10_4_VDEV_PARAM_BEACON_RATE,
5292 WMI_10_4_VDEV_PARAM_DTIM_ENABLE_CTS,
5293 WMI_10_4_VDEV_PARAM_STA_KICKOUT,
5294 WMI_10_4_VDEV_PARAM_CAPABILITIES,
5295 WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
Pedersen, Thomas973324f2016-09-28 16:56:29 -07005296 WMI_10_4_VDEV_PARAM_RX_FILTER,
5297 WMI_10_4_VDEV_PARAM_MGMT_TX_POWER,
5298 WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY,
5299 WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS,
5300 WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
Raja Mani93841a12015-06-22 20:10:13 +05305301};
5302
Michal Kazior139e1702015-02-15 16:50:42 +02005303#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
5304#define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
5305#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
5306#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
5307
Vivek Natarajana48e2cc2015-08-04 10:45:12 +05305308#define WMI_TXBF_STS_CAP_OFFSET_LSB 4
Ben Greear8cec57f52017-12-02 16:50:49 +02005309#define WMI_TXBF_STS_CAP_OFFSET_MASK 0x70
5310#define WMI_TXBF_CONF_IMPLICIT_BF BIT(7)
Vivek Natarajana48e2cc2015-08-04 10:45:12 +05305311#define WMI_BF_SOUND_DIM_OFFSET_LSB 8
5312#define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00
5313
Kalle Valo5e3dd152013-06-12 20:52:10 +03005314/* slot time long */
5315#define WMI_VDEV_SLOT_TIME_LONG 0x1
5316/* slot time short */
5317#define WMI_VDEV_SLOT_TIME_SHORT 0x2
5318/* preablbe long */
5319#define WMI_VDEV_PREAMBLE_LONG 0x1
5320/* preablbe short */
5321#define WMI_VDEV_PREAMBLE_SHORT 0x2
5322
5323enum wmi_start_event_param {
5324 WMI_VDEV_RESP_START_EVENT = 0,
5325 WMI_VDEV_RESP_RESTART_EVENT,
5326};
5327
5328struct wmi_vdev_start_response_event {
5329 __le32 vdev_id;
5330 __le32 req_id;
5331 __le32 resp_type; /* %WMI_VDEV_RESP_ */
5332 __le32 status;
5333} __packed;
5334
5335struct wmi_vdev_standby_req_event {
5336 /* unique id identifying the VDEV, generated by the caller */
5337 __le32 vdev_id;
5338} __packed;
5339
5340struct wmi_vdev_resume_req_event {
5341 /* unique id identifying the VDEV, generated by the caller */
5342 __le32 vdev_id;
5343} __packed;
5344
5345struct wmi_vdev_stopped_event {
5346 /* unique id identifying the VDEV, generated by the caller */
5347 __le32 vdev_id;
5348} __packed;
5349
5350/*
5351 * common structure used for simple events
5352 * (stopped, resume_req, standby response)
5353 */
5354struct wmi_vdev_simple_event {
5355 /* unique id identifying the VDEV, generated by the caller */
5356 __le32 vdev_id;
5357} __packed;
5358
5359/* VDEV start response status codes */
Joe Perchese13dbea2016-09-26 21:56:21 +03005360/* VDEV successfully started */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005361#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
5362
5363/* requested VDEV not found */
5364#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
5365
5366/* unsupported VDEV combination */
5367#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
5368
Simon Wunderlich855aed12014-08-02 09:12:54 +03005369/* TODO: please add more comments if you have in-depth information */
5370struct wmi_vdev_spectral_conf_cmd {
5371 __le32 vdev_id;
5372
5373 /* number of fft samples to send (0 for infinite) */
5374 __le32 scan_count;
5375 __le32 scan_period;
5376 __le32 scan_priority;
5377
5378 /* number of bins in the FFT: 2^(fft_size - bin_scale) */
5379 __le32 scan_fft_size;
5380 __le32 scan_gc_ena;
5381 __le32 scan_restart_ena;
5382 __le32 scan_noise_floor_ref;
5383 __le32 scan_init_delay;
5384 __le32 scan_nb_tone_thr;
5385 __le32 scan_str_bin_thr;
5386 __le32 scan_wb_rpt_mode;
5387 __le32 scan_rssi_rpt_mode;
5388 __le32 scan_rssi_thr;
5389 __le32 scan_pwr_format;
5390
5391 /* rpt_mode: Format of FFT report to software for spectral scan
5392 * triggered FFTs:
5393 * 0: No FFT report (only spectral scan summary report)
5394 * 1: 2-dword summary of metrics for each completed FFT + spectral
5395 * scan summary report
5396 * 2: 2-dword summary of metrics for each completed FFT +
5397 * 1x- oversampled bins(in-band) per FFT + spectral scan summary
5398 * report
5399 * 3: 2-dword summary of metrics for each completed FFT +
5400 * 2x- oversampled bins (all) per FFT + spectral scan summary
5401 */
5402 __le32 scan_rpt_mode;
5403 __le32 scan_bin_scale;
5404 __le32 scan_dbm_adj;
5405 __le32 scan_chn_mask;
5406} __packed;
5407
5408struct wmi_vdev_spectral_conf_arg {
5409 u32 vdev_id;
5410 u32 scan_count;
5411 u32 scan_period;
5412 u32 scan_priority;
5413 u32 scan_fft_size;
5414 u32 scan_gc_ena;
5415 u32 scan_restart_ena;
5416 u32 scan_noise_floor_ref;
5417 u32 scan_init_delay;
5418 u32 scan_nb_tone_thr;
5419 u32 scan_str_bin_thr;
5420 u32 scan_wb_rpt_mode;
5421 u32 scan_rssi_rpt_mode;
5422 u32 scan_rssi_thr;
5423 u32 scan_pwr_format;
5424 u32 scan_rpt_mode;
5425 u32 scan_bin_scale;
5426 u32 scan_dbm_adj;
5427 u32 scan_chn_mask;
5428};
5429
5430#define WMI_SPECTRAL_ENABLE_DEFAULT 0
5431#define WMI_SPECTRAL_COUNT_DEFAULT 0
5432#define WMI_SPECTRAL_PERIOD_DEFAULT 35
5433#define WMI_SPECTRAL_PRIORITY_DEFAULT 1
5434#define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
5435#define WMI_SPECTRAL_GC_ENA_DEFAULT 1
5436#define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
5437#define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
5438#define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
5439#define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
5440#define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
5441#define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
5442#define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
5443#define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
5444#define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
5445#define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
5446#define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
5447#define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
5448#define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
5449
5450struct wmi_vdev_spectral_enable_cmd {
5451 __le32 vdev_id;
5452 __le32 trigger_cmd;
5453 __le32 enable_cmd;
5454} __packed;
5455
5456#define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
5457#define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
5458#define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
5459#define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
5460
Kalle Valo5e3dd152013-06-12 20:52:10 +03005461/* Beacon processing related command and event structures */
5462struct wmi_bcn_tx_hdr {
5463 __le32 vdev_id;
5464 __le32 tx_rate;
5465 __le32 tx_power;
5466 __le32 bcn_len;
5467} __packed;
5468
5469struct wmi_bcn_tx_cmd {
5470 struct wmi_bcn_tx_hdr hdr;
5471 u8 *bcn[0];
5472} __packed;
5473
5474struct wmi_bcn_tx_arg {
5475 u32 vdev_id;
5476 u32 tx_rate;
5477 u32 tx_power;
5478 u32 bcn_len;
5479 const void *bcn;
5480};
5481
Michal Kazior748afc42014-01-23 12:48:21 +01005482enum wmi_bcn_tx_ref_flags {
5483 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
5484 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
5485};
5486
Michal Kazior24c88f72014-07-25 13:32:17 +02005487/* TODO: It is unclear why "no antenna" works while any other seemingly valid
5488 * chainmask yields no beacons on the air at all.
5489 */
5490#define WMI_BCN_TX_REF_DEF_ANTENNA 0
5491
Michal Kazior748afc42014-01-23 12:48:21 +01005492struct wmi_bcn_tx_ref_cmd {
5493 __le32 vdev_id;
5494 __le32 data_len;
5495 /* physical address of the frame - dma pointer */
5496 __le32 data_ptr;
5497 /* id for host to track */
5498 __le32 msdu_id;
5499 /* frame ctrl to setup PPDU desc */
5500 __le32 frame_control;
5501 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
5502 __le32 flags;
Michal Kazior24c88f72014-07-25 13:32:17 +02005503 /* introduced in 10.2 */
5504 __le32 antenna_mask;
Michal Kazior748afc42014-01-23 12:48:21 +01005505} __packed;
5506
Kalle Valo5e3dd152013-06-12 20:52:10 +03005507/* Beacon filter */
5508#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
5509#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
5510#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
5511#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
5512#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
5513
5514struct wmi_bcn_filter_rx_cmd {
5515 /* Filter ID */
5516 __le32 bcn_filter_id;
5517 /* Filter type - wmi_bcn_filter */
5518 __le32 bcn_filter;
5519 /* Buffer len */
5520 __le32 bcn_filter_len;
5521 /* Filter info (threshold, BSSID, RSSI) */
5522 u8 *bcn_filter_buf;
5523} __packed;
5524
5525/* Capabilities and IEs to be passed to firmware */
5526struct wmi_bcn_prb_info {
5527 /* Capabilities */
5528 __le32 caps;
5529 /* ERP info */
5530 __le32 erp;
5531 /* Advanced capabilities */
5532 /* HT capabilities */
5533 /* HT Info */
5534 /* ibss_dfs */
5535 /* wpa Info */
5536 /* rsn Info */
5537 /* rrm info */
5538 /* ath_ext */
5539 /* app IE */
5540} __packed;
5541
5542struct wmi_bcn_tmpl_cmd {
5543 /* unique id identifying the VDEV, generated by the caller */
5544 __le32 vdev_id;
5545 /* TIM IE offset from the beginning of the template. */
5546 __le32 tim_ie_offset;
5547 /* beacon probe capabilities and IEs */
5548 struct wmi_bcn_prb_info bcn_prb_info;
5549 /* beacon buffer length */
5550 __le32 buf_len;
5551 /* variable length data */
5552 u8 data[1];
5553} __packed;
5554
5555struct wmi_prb_tmpl_cmd {
5556 /* unique id identifying the VDEV, generated by the caller */
5557 __le32 vdev_id;
5558 /* beacon probe capabilities and IEs */
5559 struct wmi_bcn_prb_info bcn_prb_info;
5560 /* beacon buffer length */
5561 __le32 buf_len;
5562 /* Variable length data */
5563 u8 data[1];
5564} __packed;
5565
5566enum wmi_sta_ps_mode {
5567 /* enable power save for the given STA VDEV */
5568 WMI_STA_PS_MODE_DISABLED = 0,
5569 /* disable power save for a given STA VDEV */
5570 WMI_STA_PS_MODE_ENABLED = 1,
5571};
5572
5573struct wmi_sta_powersave_mode_cmd {
5574 /* unique id identifying the VDEV, generated by the caller */
5575 __le32 vdev_id;
5576
5577 /*
5578 * Power save mode
5579 * (see enum wmi_sta_ps_mode)
5580 */
5581 __le32 sta_ps_mode;
5582} __packed;
5583
5584enum wmi_csa_offload_en {
5585 WMI_CSA_OFFLOAD_DISABLE = 0,
5586 WMI_CSA_OFFLOAD_ENABLE = 1,
5587};
5588
5589struct wmi_csa_offload_enable_cmd {
5590 __le32 vdev_id;
5591 __le32 csa_offload_enable;
5592} __packed;
5593
5594struct wmi_csa_offload_chanswitch_cmd {
5595 __le32 vdev_id;
5596 struct wmi_channel chan;
5597} __packed;
5598
5599/*
5600 * This parameter controls the policy for retrieving frames from AP while the
5601 * STA is in sleep state.
5602 *
5603 * Only takes affect if the sta_ps_mode is enabled
5604 */
5605enum wmi_sta_ps_param_rx_wake_policy {
5606 /*
5607 * Wake up when ever there is an RX activity on the VDEV. In this mode
5608 * the Power save SM(state machine) will come out of sleep by either
5609 * sending null frame (or) a data frame (with PS==0) in response to TIM
5610 * bit set in the received beacon frame from AP.
5611 */
5612 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
5613
5614 /*
5615 * Here the power save state machine will not wakeup in response to TIM
5616 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
5617 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
5618 * access categories are delivery-enabled, the station will send a
5619 * UAPSD trigger frame, otherwise it will send a PS-Poll.
5620 */
5621 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
5622};
5623
5624/*
5625 * Number of tx frames/beacon that cause the power save SM to wake up.
5626 *
5627 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
5628 * meaning, It will cause the SM to never wake up. This is useful if you want
5629 * to keep the system to sleep all the time for some kind of test mode . host
5630 * can change this parameter any time. It will affect at the next tx frame.
5631 */
5632enum wmi_sta_ps_param_tx_wake_threshold {
5633 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
5634 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
5635
5636 /*
5637 * Values greater than one indicate that many TX attempts per beacon
5638 * interval before the STA will wake up
5639 */
5640};
5641
5642/*
5643 * The maximum number of PS-Poll frames the FW will send in response to
5644 * traffic advertised in TIM before waking up (by sending a null frame with PS
5645 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
5646 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
5647 * parameter is used when the RX wake policy is
5648 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
5649 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
5650 */
5651enum wmi_sta_ps_param_pspoll_count {
5652 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
5653 /*
5654 * Values greater than 0 indicate the maximum numer of PS-Poll frames
5655 * FW will send before waking up.
5656 */
Michal Kazior9f9b5742014-12-12 12:41:36 +01005657
5658 /* When u-APSD is enabled the firmware will be very reluctant to exit
5659 * STA PS. This could result in very poor Rx performance with STA doing
5660 * PS-Poll for each and every buffered frame. This value is a bit
5661 * arbitrary.
5662 */
5663 WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
Kalle Valo5e3dd152013-06-12 20:52:10 +03005664};
5665
5666/*
5667 * This will include the delivery and trigger enabled state for every AC.
5668 * This is the negotiated state with AP. The host MLME needs to set this based
5669 * on AP capability and the state Set in the association request by the
5670 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
5671 */
5672#define WMI_UAPSD_AC_TYPE_DELI 0
5673#define WMI_UAPSD_AC_TYPE_TRIG 1
5674
5675#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
Joe Perchese13dbea2016-09-26 21:56:21 +03005676 (type == WMI_UAPSD_AC_TYPE_DELI ? 1 << (ac << 1) : 1 << ((ac << 1) + 1))
Kalle Valo5e3dd152013-06-12 20:52:10 +03005677
5678enum wmi_sta_ps_param_uapsd {
5679 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5680 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5681 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5682 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5683 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5684 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5685 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5686 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5687};
5688
Janusz Dziedzic0c7e4772015-01-24 12:14:52 +02005689#define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
5690
5691struct wmi_sta_uapsd_auto_trig_param {
5692 __le32 wmm_ac;
5693 __le32 user_priority;
5694 __le32 service_interval;
5695 __le32 suspend_interval;
5696 __le32 delay_interval;
5697};
5698
5699struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
5700 __le32 vdev_id;
5701 struct wmi_mac_addr peer_macaddr;
5702 __le32 num_ac;
5703};
5704
5705struct wmi_sta_uapsd_auto_trig_arg {
5706 u32 wmm_ac;
5707 u32 user_priority;
5708 u32 service_interval;
5709 u32 suspend_interval;
5710 u32 delay_interval;
5711};
5712
Kalle Valo5e3dd152013-06-12 20:52:10 +03005713enum wmi_sta_powersave_param {
5714 /*
5715 * Controls how frames are retrievd from AP while STA is sleeping
5716 *
5717 * (see enum wmi_sta_ps_param_rx_wake_policy)
5718 */
5719 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5720
5721 /*
5722 * The STA will go active after this many TX
5723 *
5724 * (see enum wmi_sta_ps_param_tx_wake_threshold)
5725 */
5726 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5727
5728 /*
5729 * Number of PS-Poll to send before STA wakes up
5730 *
5731 * (see enum wmi_sta_ps_param_pspoll_count)
5732 *
5733 */
5734 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
5735
5736 /*
5737 * TX/RX inactivity time in msec before going to sleep.
5738 *
5739 * The power save SM will monitor tx/rx activity on the VDEV, if no
5740 * activity for the specified msec of the parameter the Power save
5741 * SM will go to sleep.
5742 */
5743 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
5744
5745 /*
5746 * Set uapsd configuration.
5747 *
5748 * (see enum wmi_sta_ps_param_uapsd)
5749 */
5750 WMI_STA_PS_PARAM_UAPSD = 4,
5751};
5752
5753struct wmi_sta_powersave_param_cmd {
5754 __le32 vdev_id;
5755 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
5756 __le32 param_value;
5757} __packed;
5758
5759/* No MIMO power save */
5760#define WMI_STA_MIMO_PS_MODE_DISABLE
5761/* mimo powersave mode static*/
5762#define WMI_STA_MIMO_PS_MODE_STATIC
5763/* mimo powersave mode dynamic */
5764#define WMI_STA_MIMO_PS_MODE_DYNAMIC
5765
5766struct wmi_sta_mimo_ps_mode_cmd {
5767 /* unique id identifying the VDEV, generated by the caller */
5768 __le32 vdev_id;
5769 /* mimo powersave mode as defined above */
5770 __le32 mimo_pwrsave_mode;
5771} __packed;
5772
5773/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
5774enum wmi_ap_ps_param_uapsd {
5775 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5776 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5777 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5778 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5779 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5780 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5781 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5782 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5783};
5784
5785/* U-APSD maximum service period of peer station */
5786enum wmi_ap_ps_peer_param_max_sp {
5787 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
5788 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
5789 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
5790 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
5791 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
5792};
5793
5794/*
5795 * AP power save parameter
5796 * Set a power save specific parameter for a peer station
5797 */
5798enum wmi_ap_ps_peer_param {
5799 /* Set uapsd configuration for a given peer.
5800 *
5801 * Include the delivery and trigger enabled state for every AC.
5802 * The host MLME needs to set this based on AP capability and stations
5803 * request Set in the association request received from the station.
5804 *
5805 * Lower 8 bits of the value specify the UAPSD configuration.
5806 *
5807 * (see enum wmi_ap_ps_param_uapsd)
5808 * The default value is 0.
5809 */
5810 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
5811
5812 /*
5813 * Set the service period for a UAPSD capable station
5814 *
5815 * The service period from wme ie in the (re)assoc request frame.
5816 *
5817 * (see enum wmi_ap_ps_peer_param_max_sp)
5818 */
5819 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
5820
5821 /* Time in seconds for aging out buffered frames for STA in PS */
5822 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
5823};
5824
5825struct wmi_ap_ps_peer_cmd {
5826 /* unique id identifying the VDEV, generated by the caller */
5827 __le32 vdev_id;
5828
5829 /* peer MAC address */
5830 struct wmi_mac_addr peer_macaddr;
5831
5832 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
5833 __le32 param_id;
5834
5835 /* AP powersave param value */
5836 __le32 param_value;
5837} __packed;
5838
5839/* 128 clients = 4 words */
5840#define WMI_TIM_BITMAP_ARRAY_SIZE 4
5841
5842struct wmi_tim_info {
5843 __le32 tim_len;
5844 __le32 tim_mcast;
5845 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
5846 __le32 tim_changed;
5847 __le32 tim_num_ps_pending;
5848} __packed;
5849
Raja Mania03fee32015-06-22 20:22:20 +05305850struct wmi_tim_info_arg {
5851 __le32 tim_len;
5852 __le32 tim_mcast;
5853 const __le32 *tim_bitmap;
5854 __le32 tim_changed;
5855 __le32 tim_num_ps_pending;
5856} __packed;
5857
Kalle Valo5e3dd152013-06-12 20:52:10 +03005858/* Maximum number of NOA Descriptors supported */
5859#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
5860#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
5861#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
5862#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
5863
5864struct wmi_p2p_noa_info {
5865 /* Bit 0 - Flag to indicate an update in NOA schedule
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01005866 * Bits 7-1 - Reserved
5867 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005868 u8 changed;
5869 /* NOA index */
5870 u8 index;
5871 /* Bit 0 - Opp PS state of the AP
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01005872 * Bits 1-7 - Ctwindow in TUs
5873 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005874 u8 ctwindow_oppps;
5875 /* Number of NOA descriptors */
5876 u8 num_descriptors;
5877
5878 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
5879} __packed;
5880
5881struct wmi_bcn_info {
5882 struct wmi_tim_info tim_info;
5883 struct wmi_p2p_noa_info p2p_noa_info;
5884} __packed;
5885
5886struct wmi_host_swba_event {
5887 __le32 vdev_map;
Michal Kazior32653cf2014-12-03 10:10:26 +02005888 struct wmi_bcn_info bcn_info[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03005889} __packed;
5890
Yanbo Li8b019fb2016-01-14 15:39:19 -08005891struct wmi_10_2_4_bcn_info {
5892 struct wmi_tim_info tim_info;
5893 /* The 10.2.4 FW doesn't have p2p NOA info */
5894} __packed;
5895
5896struct wmi_10_2_4_host_swba_event {
5897 __le32 vdev_map;
5898 struct wmi_10_2_4_bcn_info bcn_info[0];
5899} __packed;
5900
Raja Mani3cec3be2015-06-22 20:22:21 +05305901/* 16 words = 512 client + 1 word = for guard */
5902#define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
5903
5904struct wmi_10_4_tim_info {
5905 __le32 tim_len;
5906 __le32 tim_mcast;
5907 __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
5908 __le32 tim_changed;
5909 __le32 tim_num_ps_pending;
5910} __packed;
5911
5912#define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
5913
5914struct wmi_10_4_p2p_noa_info {
5915 /* Bit 0 - Flag to indicate an update in NOA schedule
5916 * Bits 7-1 - Reserved
5917 */
5918 u8 changed;
5919 /* NOA index */
5920 u8 index;
5921 /* Bit 0 - Opp PS state of the AP
5922 * Bits 1-7 - Ctwindow in TUs
5923 */
5924 u8 ctwindow_oppps;
5925 /* Number of NOA descriptors */
5926 u8 num_descriptors;
5927
5928 struct wmi_p2p_noa_descriptor
5929 noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
5930} __packed;
5931
5932struct wmi_10_4_bcn_info {
5933 struct wmi_10_4_tim_info tim_info;
5934 struct wmi_10_4_p2p_noa_info p2p_noa_info;
5935} __packed;
5936
5937struct wmi_10_4_host_swba_event {
5938 __le32 vdev_map;
5939 struct wmi_10_4_bcn_info bcn_info[0];
5940} __packed;
5941
Kalle Valo5e3dd152013-06-12 20:52:10 +03005942#define WMI_MAX_AP_VDEV 16
5943
5944struct wmi_tbtt_offset_event {
5945 __le32 vdev_map;
5946 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
5947} __packed;
5948
Kalle Valo5e3dd152013-06-12 20:52:10 +03005949struct wmi_peer_create_cmd {
5950 __le32 vdev_id;
5951 struct wmi_mac_addr peer_macaddr;
Manikanta Pubbisettybe5b4f42017-07-28 15:15:43 +03005952 __le32 peer_type;
Kalle Valo5e3dd152013-06-12 20:52:10 +03005953} __packed;
5954
Marek Puzyniak7390ed32015-03-30 09:51:52 +03005955enum wmi_peer_type {
5956 WMI_PEER_TYPE_DEFAULT = 0,
5957 WMI_PEER_TYPE_BSS = 1,
5958 WMI_PEER_TYPE_TDLS = 2,
5959};
5960
Kalle Valo5e3dd152013-06-12 20:52:10 +03005961struct wmi_peer_delete_cmd {
5962 __le32 vdev_id;
5963 struct wmi_mac_addr peer_macaddr;
5964} __packed;
5965
5966struct wmi_peer_flush_tids_cmd {
5967 __le32 vdev_id;
5968 struct wmi_mac_addr peer_macaddr;
5969 __le32 peer_tid_bitmap;
5970} __packed;
5971
5972struct wmi_fixed_rate {
5973 /*
5974 * rate mode . 0: disable fixed rate (auto rate)
5975 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
5976 * 2: ht20 11n rate specified as mcs index
5977 * 3: ht40 11n rate specified as mcs index
5978 */
5979 __le32 rate_mode;
5980 /*
5981 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
5982 * and series 3 is stored at byte 3 (MSB)
5983 */
5984 __le32 rate_series;
5985 /*
5986 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
5987 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
5988 * (MSB)
5989 */
5990 __le32 rate_retries;
5991} __packed;
5992
5993struct wmi_peer_fixed_rate_cmd {
5994 /* unique id identifying the VDEV, generated by the caller */
5995 __le32 vdev_id;
5996 /* peer MAC address */
5997 struct wmi_mac_addr peer_macaddr;
5998 /* fixed rate */
5999 struct wmi_fixed_rate peer_fixed_rate;
6000} __packed;
6001
6002#define WMI_MGMT_TID 17
6003
6004struct wmi_addba_clear_resp_cmd {
6005 /* unique id identifying the VDEV, generated by the caller */
6006 __le32 vdev_id;
6007 /* peer MAC address */
6008 struct wmi_mac_addr peer_macaddr;
6009} __packed;
6010
6011struct wmi_addba_send_cmd {
6012 /* unique id identifying the VDEV, generated by the caller */
6013 __le32 vdev_id;
6014 /* peer MAC address */
6015 struct wmi_mac_addr peer_macaddr;
6016 /* Tid number */
6017 __le32 tid;
6018 /* Buffer/Window size*/
6019 __le32 buffersize;
6020} __packed;
6021
6022struct wmi_delba_send_cmd {
6023 /* unique id identifying the VDEV, generated by the caller */
6024 __le32 vdev_id;
6025 /* peer MAC address */
6026 struct wmi_mac_addr peer_macaddr;
6027 /* Tid number */
6028 __le32 tid;
6029 /* Is Initiator */
6030 __le32 initiator;
6031 /* Reason code */
6032 __le32 reasoncode;
6033} __packed;
6034
6035struct wmi_addba_setresponse_cmd {
6036 /* unique id identifying the vdev, generated by the caller */
6037 __le32 vdev_id;
6038 /* peer mac address */
6039 struct wmi_mac_addr peer_macaddr;
6040 /* Tid number */
6041 __le32 tid;
6042 /* status code */
6043 __le32 statuscode;
6044} __packed;
6045
6046struct wmi_send_singleamsdu_cmd {
6047 /* unique id identifying the vdev, generated by the caller */
6048 __le32 vdev_id;
6049 /* peer mac address */
6050 struct wmi_mac_addr peer_macaddr;
6051 /* Tid number */
6052 __le32 tid;
6053} __packed;
6054
6055enum wmi_peer_smps_state {
6056 WMI_PEER_SMPS_PS_NONE = 0x0,
6057 WMI_PEER_SMPS_STATIC = 0x1,
6058 WMI_PEER_SMPS_DYNAMIC = 0x2
6059};
6060
Michal Kazior9797feb2014-02-14 14:49:48 +01006061enum wmi_peer_chwidth {
6062 WMI_PEER_CHWIDTH_20MHZ = 0,
6063 WMI_PEER_CHWIDTH_40MHZ = 1,
6064 WMI_PEER_CHWIDTH_80MHZ = 2,
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02006065 WMI_PEER_CHWIDTH_160MHZ = 3,
Michal Kazior9797feb2014-02-14 14:49:48 +01006066};
6067
Kalle Valo5e3dd152013-06-12 20:52:10 +03006068enum wmi_peer_param {
6069 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
6070 WMI_PEER_AMPDU = 0x2,
6071 WMI_PEER_AUTHORIZE = 0x3,
6072 WMI_PEER_CHAN_WIDTH = 0x4,
6073 WMI_PEER_NSS = 0x5,
Michal Kazior0a987fb2015-02-13 13:30:15 +01006074 WMI_PEER_USE_4ADDR = 0x6,
Maharaja Kennadyrajanee8b08a2017-02-02 08:32:19 +02006075 WMI_PEER_DEBUG = 0xa,
Michal Kazior0a987fb2015-02-13 13:30:15 +01006076 WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
Kalle Valo5e3dd152013-06-12 20:52:10 +03006077};
6078
6079struct wmi_peer_set_param_cmd {
6080 __le32 vdev_id;
6081 struct wmi_mac_addr peer_macaddr;
6082 __le32 param_id;
6083 __le32 param_value;
6084} __packed;
6085
6086#define MAX_SUPPORTED_RATES 128
6087
6088struct wmi_rate_set {
6089 /* total number of rates */
6090 __le32 num_rates;
6091 /*
6092 * rates (each 8bit value) packed into a 32 bit word.
6093 * the rates are filled from least significant byte to most
6094 * significant byte.
6095 */
Kalle Valo14e105c2016-04-13 14:13:21 +03006096 __le32 rates[(MAX_SUPPORTED_RATES / 4) + 1];
Kalle Valo5e3dd152013-06-12 20:52:10 +03006097} __packed;
6098
6099struct wmi_rate_set_arg {
6100 unsigned int num_rates;
6101 u8 rates[MAX_SUPPORTED_RATES];
6102};
6103
6104/*
6105 * NOTE: It would bea good idea to represent the Tx MCS
6106 * info in one word and Rx in another word. This is split
6107 * into multiple words for convenience
6108 */
6109struct wmi_vht_rate_set {
6110 __le32 rx_max_rate; /* Max Rx data rate */
6111 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
6112 __le32 tx_max_rate; /* Max Tx data rate */
6113 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
6114} __packed;
6115
6116struct wmi_vht_rate_set_arg {
6117 u32 rx_max_rate;
6118 u32 rx_mcs_set;
6119 u32 tx_max_rate;
6120 u32 tx_mcs_set;
6121};
6122
6123struct wmi_peer_set_rates_cmd {
6124 /* peer MAC address */
6125 struct wmi_mac_addr peer_macaddr;
6126 /* legacy rate set */
6127 struct wmi_rate_set peer_legacy_rates;
6128 /* ht rate set */
6129 struct wmi_rate_set peer_ht_rates;
6130} __packed;
6131
6132struct wmi_peer_set_q_empty_callback_cmd {
6133 /* unique id identifying the VDEV, generated by the caller */
6134 __le32 vdev_id;
6135 /* peer MAC address */
6136 struct wmi_mac_addr peer_macaddr;
6137 __le32 callback_enable;
6138} __packed;
6139
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02006140struct wmi_peer_flags_map {
6141 u32 auth;
6142 u32 qos;
6143 u32 need_ptk_4_way;
6144 u32 need_gtk_2_way;
6145 u32 apsd;
6146 u32 ht;
6147 u32 bw40;
6148 u32 stbc;
6149 u32 ldbc;
6150 u32 dyn_mimops;
6151 u32 static_mimops;
6152 u32 spatial_mux;
6153 u32 vht;
6154 u32 bw80;
6155 u32 vht_2g;
6156 u32 pmf;
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02006157 u32 bw160;
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02006158};
6159
6160enum wmi_peer_flags {
6161 WMI_PEER_AUTH = 0x00000001,
6162 WMI_PEER_QOS = 0x00000002,
6163 WMI_PEER_NEED_PTK_4_WAY = 0x00000004,
6164 WMI_PEER_NEED_GTK_2_WAY = 0x00000010,
6165 WMI_PEER_APSD = 0x00000800,
6166 WMI_PEER_HT = 0x00001000,
6167 WMI_PEER_40MHZ = 0x00002000,
6168 WMI_PEER_STBC = 0x00008000,
6169 WMI_PEER_LDPC = 0x00010000,
6170 WMI_PEER_DYN_MIMOPS = 0x00020000,
6171 WMI_PEER_STATIC_MIMOPS = 0x00040000,
6172 WMI_PEER_SPATIAL_MUX = 0x00200000,
6173 WMI_PEER_VHT = 0x02000000,
6174 WMI_PEER_80MHZ = 0x04000000,
6175 WMI_PEER_VHT_2G = 0x08000000,
6176 WMI_PEER_PMF = 0x10000000,
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02006177 WMI_PEER_160MHZ = 0x20000000
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02006178};
6179
6180enum wmi_10x_peer_flags {
6181 WMI_10X_PEER_AUTH = 0x00000001,
6182 WMI_10X_PEER_QOS = 0x00000002,
6183 WMI_10X_PEER_NEED_PTK_4_WAY = 0x00000004,
6184 WMI_10X_PEER_NEED_GTK_2_WAY = 0x00000010,
6185 WMI_10X_PEER_APSD = 0x00000800,
6186 WMI_10X_PEER_HT = 0x00001000,
6187 WMI_10X_PEER_40MHZ = 0x00002000,
6188 WMI_10X_PEER_STBC = 0x00008000,
6189 WMI_10X_PEER_LDPC = 0x00010000,
6190 WMI_10X_PEER_DYN_MIMOPS = 0x00020000,
6191 WMI_10X_PEER_STATIC_MIMOPS = 0x00040000,
6192 WMI_10X_PEER_SPATIAL_MUX = 0x00200000,
6193 WMI_10X_PEER_VHT = 0x02000000,
6194 WMI_10X_PEER_80MHZ = 0x04000000,
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02006195 WMI_10X_PEER_160MHZ = 0x20000000
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02006196};
6197
6198enum wmi_10_2_peer_flags {
6199 WMI_10_2_PEER_AUTH = 0x00000001,
6200 WMI_10_2_PEER_QOS = 0x00000002,
6201 WMI_10_2_PEER_NEED_PTK_4_WAY = 0x00000004,
6202 WMI_10_2_PEER_NEED_GTK_2_WAY = 0x00000010,
6203 WMI_10_2_PEER_APSD = 0x00000800,
6204 WMI_10_2_PEER_HT = 0x00001000,
6205 WMI_10_2_PEER_40MHZ = 0x00002000,
6206 WMI_10_2_PEER_STBC = 0x00008000,
6207 WMI_10_2_PEER_LDPC = 0x00010000,
6208 WMI_10_2_PEER_DYN_MIMOPS = 0x00020000,
6209 WMI_10_2_PEER_STATIC_MIMOPS = 0x00040000,
6210 WMI_10_2_PEER_SPATIAL_MUX = 0x00200000,
6211 WMI_10_2_PEER_VHT = 0x02000000,
6212 WMI_10_2_PEER_80MHZ = 0x04000000,
6213 WMI_10_2_PEER_VHT_2G = 0x08000000,
6214 WMI_10_2_PEER_PMF = 0x10000000,
Sebastian Gottschallbc1efd72017-01-12 13:02:12 +02006215 WMI_10_2_PEER_160MHZ = 0x20000000
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02006216};
Kalle Valo5e3dd152013-06-12 20:52:10 +03006217
6218/*
6219 * Peer rate capabilities.
6220 *
6221 * This is of interest to the ratecontrol
6222 * module which resides in the firmware. The bit definitions are
6223 * consistent with that defined in if_athrate.c.
6224 */
6225#define WMI_RC_DS_FLAG 0x01
6226#define WMI_RC_CW40_FLAG 0x02
6227#define WMI_RC_SGI_FLAG 0x04
6228#define WMI_RC_HT_FLAG 0x08
6229#define WMI_RC_RTSCTS_FLAG 0x10
6230#define WMI_RC_TX_STBC_FLAG 0x20
6231#define WMI_RC_RX_STBC_FLAG 0xC0
6232#define WMI_RC_RX_STBC_FLAG_S 6
6233#define WMI_RC_WEP_TKIP_FLAG 0x100
6234#define WMI_RC_TS_FLAG 0x200
6235#define WMI_RC_UAPSD_FLAG 0x400
6236
6237/* Maximum listen interval supported by hw in units of beacon interval */
6238#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
6239
Michal Kazior24c88f72014-07-25 13:32:17 +02006240struct wmi_common_peer_assoc_complete_cmd {
Kalle Valo5e3dd152013-06-12 20:52:10 +03006241 struct wmi_mac_addr peer_macaddr;
6242 __le32 vdev_id;
6243 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
6244 __le32 peer_associd; /* 16 LSBs */
6245 __le32 peer_flags;
6246 __le32 peer_caps; /* 16 LSBs */
6247 __le32 peer_listen_intval;
6248 __le32 peer_ht_caps;
6249 __le32 peer_max_mpdu;
6250 __le32 peer_mpdu_density; /* 0..16 */
6251 __le32 peer_rate_caps;
6252 struct wmi_rate_set peer_legacy_rates;
6253 struct wmi_rate_set peer_ht_rates;
6254 __le32 peer_nss; /* num of spatial streams */
6255 __le32 peer_vht_caps;
6256 __le32 peer_phymode;
6257 struct wmi_vht_rate_set peer_vht_rates;
Michal Kazior24c88f72014-07-25 13:32:17 +02006258};
6259
6260struct wmi_main_peer_assoc_complete_cmd {
6261 struct wmi_common_peer_assoc_complete_cmd cmd;
6262
Kalle Valo5e3dd152013-06-12 20:52:10 +03006263 /* HT Operation Element of the peer. Five bytes packed in 2
Marcin Rokicki37ff1b02017-02-20 15:38:50 +01006264 * INT32 array and filled from lsb to msb.
6265 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03006266 __le32 peer_ht_info[2];
6267} __packed;
6268
Michal Kazior24c88f72014-07-25 13:32:17 +02006269struct wmi_10_1_peer_assoc_complete_cmd {
6270 struct wmi_common_peer_assoc_complete_cmd cmd;
6271} __packed;
6272
6273#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
6274#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
6275#define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
6276#define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
6277
6278struct wmi_10_2_peer_assoc_complete_cmd {
6279 struct wmi_common_peer_assoc_complete_cmd cmd;
6280 __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
6281} __packed;
6282
Ben Greearcc914a52017-06-16 10:37:45 +03006283#define PEER_BW_RXNSS_OVERRIDE_OFFSET 31
6284
Vasanthakumar Thiagarajanb54e16f2015-11-05 11:33:58 +05306285struct wmi_10_4_peer_assoc_complete_cmd {
6286 struct wmi_10_2_peer_assoc_complete_cmd cmd;
6287 __le32 peer_bw_rxnss_override;
6288} __packed;
6289
Kalle Valo5e3dd152013-06-12 20:52:10 +03006290struct wmi_peer_assoc_complete_arg {
6291 u8 addr[ETH_ALEN];
6292 u32 vdev_id;
6293 bool peer_reassoc;
6294 u16 peer_aid;
6295 u32 peer_flags; /* see %WMI_PEER_ */
6296 u16 peer_caps;
6297 u32 peer_listen_intval;
6298 u32 peer_ht_caps;
6299 u32 peer_max_mpdu;
6300 u32 peer_mpdu_density; /* 0..16 */
6301 u32 peer_rate_caps; /* see %WMI_RC_ */
6302 struct wmi_rate_set_arg peer_legacy_rates;
6303 struct wmi_rate_set_arg peer_ht_rates;
6304 u32 peer_num_spatial_streams;
6305 u32 peer_vht_caps;
6306 enum wmi_phy_mode peer_phymode;
6307 struct wmi_vht_rate_set_arg peer_vht_rates;
Ben Greearcc914a52017-06-16 10:37:45 +03006308 u32 peer_bw_rxnss_override;
Kalle Valo5e3dd152013-06-12 20:52:10 +03006309};
6310
6311struct wmi_peer_add_wds_entry_cmd {
6312 /* peer MAC address */
6313 struct wmi_mac_addr peer_macaddr;
6314 /* wds MAC addr */
6315 struct wmi_mac_addr wds_macaddr;
6316} __packed;
6317
6318struct wmi_peer_remove_wds_entry_cmd {
6319 /* wds MAC addr */
6320 struct wmi_mac_addr wds_macaddr;
6321} __packed;
6322
6323struct wmi_peer_q_empty_callback_event {
6324 /* peer MAC address */
6325 struct wmi_mac_addr peer_macaddr;
6326} __packed;
6327
6328/*
6329 * Channel info WMI event
6330 */
6331struct wmi_chan_info_event {
6332 __le32 err_code;
6333 __le32 freq;
6334 __le32 cmd_flags;
6335 __le32 noise_floor;
6336 __le32 rx_clear_count;
6337 __le32 cycle_count;
6338} __packed;
6339
Raja Manib2297ba2015-06-22 20:22:23 +05306340struct wmi_10_4_chan_info_event {
6341 __le32 err_code;
6342 __le32 freq;
6343 __le32 cmd_flags;
6344 __le32 noise_floor;
6345 __le32 rx_clear_count;
6346 __le32 cycle_count;
6347 __le32 chan_tx_pwr_range;
6348 __le32 chan_tx_pwr_tp;
6349 __le32 rx_frame_count;
6350} __packed;
6351
Kalle Valo5a13e762014-01-20 11:01:46 +02006352struct wmi_peer_sta_kickout_event {
6353 struct wmi_mac_addr peer_macaddr;
6354} __packed;
6355
Michal Kazior2e1dea42013-07-31 10:32:40 +02006356#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
Vasanthakumar Thiagarajan3d2a2e22015-08-12 16:24:04 +05306357#define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1)
Michal Kazior2e1dea42013-07-31 10:32:40 +02006358
Kalle Valo5e3dd152013-06-12 20:52:10 +03006359/* Beacon filter wmi command info */
6360#define BCN_FLT_MAX_SUPPORTED_IES 256
6361#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
6362
6363struct bss_bcn_stats {
6364 __le32 vdev_id;
6365 __le32 bss_bcnsdropped;
6366 __le32 bss_bcnsdelivered;
6367} __packed;
6368
6369struct bcn_filter_stats {
6370 __le32 bcns_dropped;
6371 __le32 bcns_delivered;
6372 __le32 activefilters;
6373 struct bss_bcn_stats bss_stats;
6374} __packed;
6375
6376struct wmi_add_bcn_filter_cmd {
6377 u32 vdev_id;
6378 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
6379} __packed;
6380
6381enum wmi_sta_keepalive_method {
6382 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
6383 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
6384};
6385
Michal Kazior46725b152015-01-28 09:57:49 +02006386#define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
6387
6388/* Firmware crashes if keepalive interval exceeds this limit */
6389#define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
6390
Kalle Valo5e3dd152013-06-12 20:52:10 +03006391/* note: ip4 addresses are in network byte order, i.e. big endian */
6392struct wmi_sta_keepalive_arp_resp {
6393 __be32 src_ip4_addr;
6394 __be32 dest_ip4_addr;
6395 struct wmi_mac_addr dest_mac_addr;
6396} __packed;
6397
6398struct wmi_sta_keepalive_cmd {
6399 __le32 vdev_id;
6400 __le32 enabled;
6401 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
6402 __le32 interval; /* in seconds */
6403 struct wmi_sta_keepalive_arp_resp arp_resp;
6404} __packed;
6405
Janusz Dziedzic6e8b1882015-01-28 09:57:39 +02006406struct wmi_sta_keepalive_arg {
6407 u32 vdev_id;
6408 u32 enabled;
6409 u32 method;
6410 u32 interval;
6411 __be32 src_ip4_addr;
6412 __be32 dest_ip4_addr;
6413 const u8 dest_mac_addr[ETH_ALEN];
6414};
6415
Michal Kazior9cfbce72013-07-16 09:54:36 +02006416enum wmi_force_fw_hang_type {
6417 WMI_FORCE_FW_HANG_ASSERT = 1,
6418 WMI_FORCE_FW_HANG_NO_DETECT,
6419 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
6420 WMI_FORCE_FW_HANG_EMPTY_POINT,
6421 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
6422 WMI_FORCE_FW_HANG_INFINITE_LOOP,
6423};
6424
6425#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
6426
6427struct wmi_force_fw_hang_cmd {
6428 __le32 type;
6429 __le32 delay_ms;
6430} __packed;
6431
Kalle Valof118a3e2014-01-03 12:59:31 +02006432enum ath10k_dbglog_level {
6433 ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
6434 ATH10K_DBGLOG_LEVEL_INFO = 1,
6435 ATH10K_DBGLOG_LEVEL_WARN = 2,
6436 ATH10K_DBGLOG_LEVEL_ERR = 3,
6437};
6438
6439/* VAP ids to enable dbglog */
6440#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
6441#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
6442
6443/* to enable dbglog in the firmware */
6444#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
6445#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
6446
6447/* timestamp resolution */
6448#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
6449#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
6450
6451/* number of queued messages before sending them to the host */
6452#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
6453#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
6454
6455/*
6456 * Log levels to enable. This defines the minimum level to enable, this is
6457 * not a bitmask. See enum ath10k_dbglog_level for the values.
6458 */
6459#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
6460#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
6461
6462/*
6463 * Note: this is a cleaned up version of a struct firmware uses. For
6464 * example, config_valid was hidden inside an array.
6465 */
6466struct wmi_dbglog_cfg_cmd {
6467 /* bitmask to hold mod id config*/
6468 __le32 module_enable;
6469
6470 /* see ATH10K_DBGLOG_CFG_ */
6471 __le32 config_enable;
6472
6473 /* mask of module id bits to be changed */
6474 __le32 module_valid;
6475
6476 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
6477 __le32 config_valid;
6478} __packed;
6479
Maharaja Kennadyrajanafcbc822016-08-23 15:35:36 +05306480struct wmi_10_4_dbglog_cfg_cmd {
6481 /* bitmask to hold mod id config*/
6482 __le64 module_enable;
6483
6484 /* see ATH10K_DBGLOG_CFG_ */
6485 __le32 config_enable;
6486
6487 /* mask of module id bits to be changed */
6488 __le64 module_valid;
6489
6490 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
6491 __le32 config_valid;
6492} __packed;
6493
Michal Kaziorc1a46542015-03-10 16:21:54 +02006494enum wmi_roam_reason {
6495 WMI_ROAM_REASON_BETTER_AP = 1,
6496 WMI_ROAM_REASON_BEACON_MISS = 2,
6497 WMI_ROAM_REASON_LOW_RSSI = 3,
6498 WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
6499 WMI_ROAM_REASON_HO_FAILED = 5,
6500
6501 /* keep last */
6502 WMI_ROAM_REASON_MAX,
6503};
6504
6505struct wmi_roam_ev {
6506 __le32 vdev_id;
6507 __le32 reason;
6508} __packed;
6509
Kalle Valo5e3dd152013-06-12 20:52:10 +03006510#define ATH10K_FRAGMT_THRESHOLD_MIN 540
6511#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
6512
6513#define WMI_MAX_EVENT 0x1000
6514/* Maximum number of pending TXed WMI packets */
Kalle Valo5e3dd152013-06-12 20:52:10 +03006515#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
6516
6517/* By default disable power save for IBSS */
6518#define ATH10K_DEFAULT_ATIM 0
6519
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006520#define WMI_MAX_MEM_REQS 16
6521
Michal Kazior32653cf2014-12-03 10:10:26 +02006522struct wmi_scan_ev_arg {
6523 __le32 event_type; /* %WMI_SCAN_EVENT_ */
6524 __le32 reason; /* %WMI_SCAN_REASON_ */
6525 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
6526 __le32 scan_req_id;
6527 __le32 scan_id;
6528 __le32 vdev_id;
6529};
6530
6531struct wmi_mgmt_rx_ev_arg {
6532 __le32 channel;
6533 __le32 snr;
6534 __le32 rate;
6535 __le32 phy_mode;
6536 __le32 buf_len;
6537 __le32 status; /* %WMI_RX_STATUS_ */
Peter Oh8d130962016-03-01 09:52:49 -08006538 struct wmi_mgmt_rx_ext_info ext_info;
Michal Kazior32653cf2014-12-03 10:10:26 +02006539};
6540
6541struct wmi_ch_info_ev_arg {
6542 __le32 err_code;
6543 __le32 freq;
6544 __le32 cmd_flags;
6545 __le32 noise_floor;
6546 __le32 rx_clear_count;
6547 __le32 cycle_count;
Raja Manib2297ba2015-06-22 20:22:23 +05306548 __le32 chan_tx_pwr_range;
6549 __le32 chan_tx_pwr_tp;
6550 __le32 rx_frame_count;
Michal Kazior32653cf2014-12-03 10:10:26 +02006551};
6552
6553struct wmi_vdev_start_ev_arg {
6554 __le32 vdev_id;
6555 __le32 req_id;
6556 __le32 resp_type; /* %WMI_VDEV_RESP_ */
6557 __le32 status;
6558};
6559
6560struct wmi_peer_kick_ev_arg {
6561 const u8 *mac_addr;
6562};
6563
6564struct wmi_swba_ev_arg {
6565 __le32 vdev_map;
Raja Mania03fee32015-06-22 20:22:20 +05306566 struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
Michal Kazior32653cf2014-12-03 10:10:26 +02006567 const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
6568};
6569
6570struct wmi_phyerr_ev_arg {
Raja Mani991adf72015-08-14 11:13:29 +03006571 u32 tsf_timestamp;
6572 u16 freq1;
6573 u16 freq2;
6574 u8 rssi_combined;
6575 u8 chan_width_mhz;
6576 u8 phy_err_code;
6577 u16 nf_chains[4];
6578 u32 buf_len;
6579 const u8 *buf;
6580 u8 hdr_len;
6581};
6582
6583struct wmi_phyerr_hdr_arg {
6584 u32 num_phyerrs;
6585 u32 tsf_l32;
6586 u32 tsf_u32;
6587 u32 buf_len;
6588 const void *phyerrs;
Michal Kazior32653cf2014-12-03 10:10:26 +02006589};
6590
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006591struct wmi_svc_rdy_ev_arg {
6592 __le32 min_tx_power;
6593 __le32 max_tx_power;
6594 __le32 ht_cap;
6595 __le32 vht_cap;
6596 __le32 sw_ver0;
6597 __le32 sw_ver1;
Michal Kaziorca996ec2014-12-03 10:11:32 +02006598 __le32 fw_build;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006599 __le32 phy_capab;
6600 __le32 num_rf_chains;
6601 __le32 eeprom_rd;
6602 __le32 num_mem_reqs;
Tamizh chelvam523f6702017-02-23 18:48:22 +05306603 __le32 low_5ghz_chan;
6604 __le32 high_5ghz_chan;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006605 const __le32 *service_map;
Michal Kazior2a3e60d2014-11-27 10:11:15 +01006606 size_t service_map_len;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006607 const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
6608};
6609
Michal Kazior32653cf2014-12-03 10:10:26 +02006610struct wmi_rdy_ev_arg {
6611 __le32 sw_version;
6612 __le32 abi_version;
6613 __le32 status;
6614 const u8 *mac_addr;
6615};
6616
Michal Kaziorc1a46542015-03-10 16:21:54 +02006617struct wmi_roam_ev_arg {
6618 __le32 vdev_id;
6619 __le32 reason;
6620 __le32 rssi;
6621};
6622
Michal Kazior84d49112016-08-19 13:37:42 +03006623struct wmi_echo_ev_arg {
6624 __le32 value;
6625};
6626
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02006627struct wmi_pdev_temperature_event {
6628 /* temperature value in Celcius degree */
6629 __le32 temperature;
6630} __packed;
6631
Rajkumar Manoharan89d2d182016-04-27 16:23:21 +05306632struct wmi_pdev_bss_chan_info_event {
6633 __le32 freq;
6634 __le32 noise_floor;
6635 __le64 cycle_busy;
6636 __le64 cycle_total;
6637 __le64 cycle_tx;
6638 __le64 cycle_rx;
6639 __le64 cycle_rx_bss;
6640 __le32 reserved;
6641} __packed;
6642
Janusz Dziedzicf5431e82015-03-23 17:32:53 +02006643/* WOW structures */
6644enum wmi_wow_wakeup_event {
6645 WOW_BMISS_EVENT = 0,
6646 WOW_BETTER_AP_EVENT,
6647 WOW_DEAUTH_RECVD_EVENT,
6648 WOW_MAGIC_PKT_RECVD_EVENT,
6649 WOW_GTK_ERR_EVENT,
6650 WOW_FOURWAY_HSHAKE_EVENT,
6651 WOW_EAPOL_RECVD_EVENT,
6652 WOW_NLO_DETECTED_EVENT,
6653 WOW_DISASSOC_RECVD_EVENT,
6654 WOW_PATTERN_MATCH_EVENT,
6655 WOW_CSA_IE_EVENT,
6656 WOW_PROBE_REQ_WPS_IE_EVENT,
6657 WOW_AUTH_REQ_EVENT,
6658 WOW_ASSOC_REQ_EVENT,
6659 WOW_HTT_EVENT,
6660 WOW_RA_MATCH_EVENT,
6661 WOW_HOST_AUTO_SHUTDOWN_EVENT,
6662 WOW_IOAC_MAGIC_EVENT,
6663 WOW_IOAC_SHORT_EVENT,
6664 WOW_IOAC_EXTEND_EVENT,
6665 WOW_IOAC_TIMER_EVENT,
6666 WOW_DFS_PHYERR_RADAR_EVENT,
6667 WOW_BEACON_EVENT,
6668 WOW_CLIENT_KICKOUT_EVENT,
6669 WOW_EVENT_MAX,
6670};
6671
6672#define C2S(x) case x: return #x
6673
6674static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
6675{
6676 switch (ev) {
6677 C2S(WOW_BMISS_EVENT);
6678 C2S(WOW_BETTER_AP_EVENT);
6679 C2S(WOW_DEAUTH_RECVD_EVENT);
6680 C2S(WOW_MAGIC_PKT_RECVD_EVENT);
6681 C2S(WOW_GTK_ERR_EVENT);
6682 C2S(WOW_FOURWAY_HSHAKE_EVENT);
6683 C2S(WOW_EAPOL_RECVD_EVENT);
6684 C2S(WOW_NLO_DETECTED_EVENT);
6685 C2S(WOW_DISASSOC_RECVD_EVENT);
6686 C2S(WOW_PATTERN_MATCH_EVENT);
6687 C2S(WOW_CSA_IE_EVENT);
6688 C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
6689 C2S(WOW_AUTH_REQ_EVENT);
6690 C2S(WOW_ASSOC_REQ_EVENT);
6691 C2S(WOW_HTT_EVENT);
6692 C2S(WOW_RA_MATCH_EVENT);
6693 C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
6694 C2S(WOW_IOAC_MAGIC_EVENT);
6695 C2S(WOW_IOAC_SHORT_EVENT);
6696 C2S(WOW_IOAC_EXTEND_EVENT);
6697 C2S(WOW_IOAC_TIMER_EVENT);
6698 C2S(WOW_DFS_PHYERR_RADAR_EVENT);
6699 C2S(WOW_BEACON_EVENT);
6700 C2S(WOW_CLIENT_KICKOUT_EVENT);
6701 C2S(WOW_EVENT_MAX);
6702 default:
6703 return NULL;
6704 }
6705}
6706
6707enum wmi_wow_wake_reason {
6708 WOW_REASON_UNSPECIFIED = -1,
6709 WOW_REASON_NLOD = 0,
6710 WOW_REASON_AP_ASSOC_LOST,
6711 WOW_REASON_LOW_RSSI,
6712 WOW_REASON_DEAUTH_RECVD,
6713 WOW_REASON_DISASSOC_RECVD,
6714 WOW_REASON_GTK_HS_ERR,
6715 WOW_REASON_EAP_REQ,
6716 WOW_REASON_FOURWAY_HS_RECV,
6717 WOW_REASON_TIMER_INTR_RECV,
6718 WOW_REASON_PATTERN_MATCH_FOUND,
6719 WOW_REASON_RECV_MAGIC_PATTERN,
6720 WOW_REASON_P2P_DISC,
6721 WOW_REASON_WLAN_HB,
6722 WOW_REASON_CSA_EVENT,
6723 WOW_REASON_PROBE_REQ_WPS_IE_RECV,
6724 WOW_REASON_AUTH_REQ_RECV,
6725 WOW_REASON_ASSOC_REQ_RECV,
6726 WOW_REASON_HTT_EVENT,
6727 WOW_REASON_RA_MATCH,
6728 WOW_REASON_HOST_AUTO_SHUTDOWN,
6729 WOW_REASON_IOAC_MAGIC_EVENT,
6730 WOW_REASON_IOAC_SHORT_EVENT,
6731 WOW_REASON_IOAC_EXTEND_EVENT,
6732 WOW_REASON_IOAC_TIMER_EVENT,
6733 WOW_REASON_ROAM_HO,
6734 WOW_REASON_DFS_PHYERR_RADADR_EVENT,
6735 WOW_REASON_BEACON_RECV,
6736 WOW_REASON_CLIENT_KICKOUT_EVENT,
6737 WOW_REASON_DEBUG_TEST = 0xFF,
6738};
6739
6740static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
6741{
6742 switch (reason) {
6743 C2S(WOW_REASON_UNSPECIFIED);
6744 C2S(WOW_REASON_NLOD);
6745 C2S(WOW_REASON_AP_ASSOC_LOST);
6746 C2S(WOW_REASON_LOW_RSSI);
6747 C2S(WOW_REASON_DEAUTH_RECVD);
6748 C2S(WOW_REASON_DISASSOC_RECVD);
6749 C2S(WOW_REASON_GTK_HS_ERR);
6750 C2S(WOW_REASON_EAP_REQ);
6751 C2S(WOW_REASON_FOURWAY_HS_RECV);
6752 C2S(WOW_REASON_TIMER_INTR_RECV);
6753 C2S(WOW_REASON_PATTERN_MATCH_FOUND);
6754 C2S(WOW_REASON_RECV_MAGIC_PATTERN);
6755 C2S(WOW_REASON_P2P_DISC);
6756 C2S(WOW_REASON_WLAN_HB);
6757 C2S(WOW_REASON_CSA_EVENT);
6758 C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
6759 C2S(WOW_REASON_AUTH_REQ_RECV);
6760 C2S(WOW_REASON_ASSOC_REQ_RECV);
6761 C2S(WOW_REASON_HTT_EVENT);
6762 C2S(WOW_REASON_RA_MATCH);
6763 C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
6764 C2S(WOW_REASON_IOAC_MAGIC_EVENT);
6765 C2S(WOW_REASON_IOAC_SHORT_EVENT);
6766 C2S(WOW_REASON_IOAC_EXTEND_EVENT);
6767 C2S(WOW_REASON_IOAC_TIMER_EVENT);
6768 C2S(WOW_REASON_ROAM_HO);
6769 C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
6770 C2S(WOW_REASON_BEACON_RECV);
6771 C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
6772 C2S(WOW_REASON_DEBUG_TEST);
6773 default:
6774 return NULL;
6775 }
6776}
6777
6778#undef C2S
6779
6780struct wmi_wow_ev_arg {
6781 u32 vdev_id;
6782 u32 flag;
6783 enum wmi_wow_wake_reason wake_reason;
6784 u32 data_len;
6785};
6786
Janusz Dziedzic25c86612015-03-23 17:32:54 +02006787#define WOW_MIN_PATTERN_SIZE 1
6788#define WOW_MAX_PATTERN_SIZE 148
6789#define WOW_MAX_PKT_OFFSET 128
6790
Marek Puzyniakad45c882015-03-30 09:51:53 +03006791enum wmi_tdls_state {
6792 WMI_TDLS_DISABLE,
6793 WMI_TDLS_ENABLE_PASSIVE,
6794 WMI_TDLS_ENABLE_ACTIVE,
6795};
6796
6797enum wmi_tdls_peer_state {
6798 WMI_TDLS_PEER_STATE_PEERING,
6799 WMI_TDLS_PEER_STATE_CONNECTED,
6800 WMI_TDLS_PEER_STATE_TEARDOWN,
6801};
6802
6803struct wmi_tdls_peer_update_cmd_arg {
6804 u32 vdev_id;
6805 enum wmi_tdls_peer_state peer_state;
6806 u8 addr[ETH_ALEN];
6807};
6808
6809#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
6810
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03006811#define WMI_TDLS_PEER_SP_MASK 0x60
6812#define WMI_TDLS_PEER_SP_LSB 5
6813
6814enum wmi_tdls_options {
6815 WMI_TDLS_OFFCHAN_EN = BIT(0),
6816 WMI_TDLS_BUFFER_STA_EN = BIT(1),
6817 WMI_TDLS_SLEEP_STA_EN = BIT(2),
6818};
6819
6820enum {
6821 WMI_TDLS_PEER_QOS_AC_VO = BIT(0),
6822 WMI_TDLS_PEER_QOS_AC_VI = BIT(1),
6823 WMI_TDLS_PEER_QOS_AC_BK = BIT(2),
6824 WMI_TDLS_PEER_QOS_AC_BE = BIT(3),
6825};
6826
Marek Puzyniakad45c882015-03-30 09:51:53 +03006827struct wmi_tdls_peer_capab_arg {
6828 u8 peer_uapsd_queues;
6829 u8 peer_max_sp;
6830 u32 buff_sta_support;
6831 u32 off_chan_support;
6832 u32 peer_curr_operclass;
6833 u32 self_curr_operclass;
6834 u32 peer_chan_len;
6835 u32 peer_operclass_len;
6836 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
6837 u32 is_peer_responder;
6838 u32 pref_offchan_num;
6839 u32 pref_offchan_bw;
6840};
6841
Manikanta Pubbisettyadd6cd82017-07-28 15:15:42 +03006842struct wmi_10_4_tdls_set_state_cmd {
6843 __le32 vdev_id;
6844 __le32 state;
6845 __le32 notification_interval_ms;
6846 __le32 tx_discovery_threshold;
6847 __le32 tx_teardown_threshold;
6848 __le32 rssi_teardown_threshold;
6849 __le32 rssi_delta;
6850 __le32 tdls_options;
6851 __le32 tdls_peer_traffic_ind_window;
6852 __le32 tdls_peer_traffic_response_timeout_ms;
6853 __le32 tdls_puapsd_mask;
6854 __le32 tdls_puapsd_inactivity_time_ms;
6855 __le32 tdls_puapsd_rx_frame_threshold;
6856 __le32 teardown_notification_ms;
6857 __le32 tdls_peer_kickout_threshold;
6858} __packed;
6859
6860struct wmi_tdls_peer_capabilities {
6861 __le32 peer_qos;
6862 __le32 buff_sta_support;
6863 __le32 off_chan_support;
6864 __le32 peer_curr_operclass;
6865 __le32 self_curr_operclass;
6866 __le32 peer_chan_len;
6867 __le32 peer_operclass_len;
6868 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
6869 __le32 is_peer_responder;
6870 __le32 pref_offchan_num;
6871 __le32 pref_offchan_bw;
6872 struct wmi_channel peer_chan_list[1];
6873} __packed;
6874
6875struct wmi_10_4_tdls_peer_update_cmd {
6876 __le32 vdev_id;
6877 struct wmi_mac_addr peer_macaddr;
6878 __le32 peer_state;
6879 __le32 reserved[4];
6880 struct wmi_tdls_peer_capabilities peer_capab;
6881} __packed;
6882
6883enum wmi_tdls_peer_reason {
6884 WMI_TDLS_TEARDOWN_REASON_TX,
6885 WMI_TDLS_TEARDOWN_REASON_RSSI,
6886 WMI_TDLS_TEARDOWN_REASON_SCAN,
6887 WMI_TDLS_DISCONNECTED_REASON_PEER_DELETE,
6888 WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT,
6889 WMI_TDLS_TEARDOWN_REASON_BAD_PTR,
6890 WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE,
6891 WMI_TDLS_ENTER_BUF_STA,
6892 WMI_TDLS_EXIT_BUF_STA,
6893 WMI_TDLS_ENTER_BT_BUSY_MODE,
6894 WMI_TDLS_EXIT_BT_BUSY_MODE,
6895 WMI_TDLS_SCAN_STARTED_EVENT,
6896 WMI_TDLS_SCAN_COMPLETED_EVENT,
6897};
6898
6899enum wmi_tdls_peer_notification {
6900 WMI_TDLS_SHOULD_DISCOVER,
6901 WMI_TDLS_SHOULD_TEARDOWN,
6902 WMI_TDLS_PEER_DISCONNECTED,
6903 WMI_TDLS_CONNECTION_TRACKER_NOTIFICATION,
6904};
6905
6906struct wmi_tdls_peer_event {
6907 struct wmi_mac_addr peer_macaddr;
6908 /* see enum wmi_tdls_peer_notification*/
6909 __le32 peer_status;
6910 /* see enum wmi_tdls_peer_reason */
6911 __le32 peer_reason;
6912 __le32 vdev_id;
6913} __packed;
6914
Vivek Natarajan08e75ea2015-08-04 10:45:11 +05306915enum wmi_txbf_conf {
6916 WMI_TXBF_CONF_UNSUPPORTED,
6917 WMI_TXBF_CONF_BEFORE_ASSOC,
6918 WMI_TXBF_CONF_AFTER_ASSOC,
6919};
6920
Maharaja62f77f02015-10-21 11:49:18 +03006921#define WMI_CCA_DETECT_LEVEL_AUTO 0
6922#define WMI_CCA_DETECT_MARGIN_AUTO 0
6923
6924struct wmi_pdev_set_adaptive_cca_params {
6925 __le32 enable;
6926 __le32 cca_detect_level;
6927 __le32 cca_detect_margin;
6928} __packed;
6929
Raja Mani47771902016-03-16 18:13:33 +05306930enum wmi_host_platform_type {
6931 WMI_HOST_PLATFORM_HIGH_PERF,
6932 WMI_HOST_PLATFORM_LOW_PERF,
6933};
6934
Rajkumar Manoharan8a0b4592016-04-27 16:23:20 +05306935enum wmi_bss_survey_req_type {
6936 WMI_BSS_SURVEY_REQ_TYPE_READ = 1,
6937 WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR,
6938};
6939
6940struct wmi_pdev_chan_info_req_cmd {
6941 __le32 type;
6942 __le32 reserved;
6943} __packed;
6944
Kalle Valo5e3dd152013-06-12 20:52:10 +03006945struct ath10k;
6946struct ath10k_vif;
Michal Kazior0226d602014-12-03 10:11:22 +02006947struct ath10k_fw_stats_pdev;
6948struct ath10k_fw_stats_peer;
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006949struct ath10k_fw_stats;
Kalle Valo5e3dd152013-06-12 20:52:10 +03006950
6951int ath10k_wmi_attach(struct ath10k *ar);
6952void ath10k_wmi_detach(struct ath10k *ar);
Vasanthakumar Thiagarajana925a372015-08-28 17:21:34 +05306953void ath10k_wmi_free_host_mem(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006954int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
6955int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006956
Michal Kazior0226d602014-12-03 10:11:22 +02006957struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
Michal Kazior95bf21f2014-05-16 17:15:39 +03006958int ath10k_wmi_connect(struct ath10k *ar);
Kalle Valo666a73f32014-09-10 18:23:23 +03006959
6960struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
6961int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
Michal Kaziord7579d12014-12-03 10:10:54 +02006962int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
6963 u32 cmd_id);
Kalle Valo019e4282017-02-02 12:47:56 +02006964void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *arg);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006965
Michal Kaziorb91251f2015-01-24 12:14:49 +02006966void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
6967 struct ath10k_fw_stats_pdev *dst);
6968void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
6969 struct ath10k_fw_stats_pdev *dst);
6970void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
6971 struct ath10k_fw_stats_pdev *dst);
6972void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
6973 struct ath10k_fw_stats_pdev *dst);
Michal Kazior0226d602014-12-03 10:11:22 +02006974void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
6975 struct ath10k_fw_stats_peer *dst);
6976void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
6977 struct wmi_host_mem_chunks *chunks);
6978void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
6979 const struct wmi_start_scan_arg *arg);
Michal Kazior5e752e42015-01-19 09:53:41 +01006980void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
6981 const struct wmi_wmm_params_arg *arg);
Michal Kazior0226d602014-12-03 10:11:22 +02006982void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
6983 const struct wmi_channel_arg *arg);
6984int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
6985
6986int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
6987int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
6988void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
6989void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
6990int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
6991void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
6992void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
6993void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
6994void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
6995void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
6996void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
6997void ath10k_wmi_event_dfs(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03006998 struct wmi_phyerr_ev_arg *phyerr, u64 tsf);
Michal Kazior0226d602014-12-03 10:11:22 +02006999void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03007000 struct wmi_phyerr_ev_arg *phyerr,
Michal Kazior0226d602014-12-03 10:11:22 +02007001 u64 tsf);
7002void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
7003void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
7004void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
7005void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
7006void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
7007void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
7008void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
7009 struct sk_buff *skb);
7010void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
7011 struct sk_buff *skb);
7012void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
7013void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
7014void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
7015void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
7016void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
7017void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
7018 struct sk_buff *skb);
7019void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
7020void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
7021void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
7022void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
7023 struct sk_buff *skb);
7024void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
7025void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
7026void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
7027void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
7028int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
Raja Mani991adf72015-08-14 11:13:29 +03007029int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf,
7030 int left_len, struct wmi_phyerr_ev_arg *arg);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03007031void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar,
7032 struct ath10k_fw_stats *fw_stats,
7033 char *buf);
7034void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k *ar,
7035 struct ath10k_fw_stats *fw_stats,
7036 char *buf);
7037size_t ath10k_wmi_fw_stats_num_peers(struct list_head *head);
7038size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head);
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02007039void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
7040 struct ath10k_fw_stats *fw_stats,
7041 char *buf);
Peter Oh6e4de1a2016-01-28 13:54:10 -08007042int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar,
7043 enum wmi_vdev_subtype subtype);
Michal Kazior20ddca22016-08-19 13:37:42 +03007044int ath10k_wmi_barrier(struct ath10k *ar);
Maharaja Kennadyrajanbc64d052018-03-14 12:14:08 +02007045void ath10k_wmi_tpc_config_get_rate_code(u8 *rate_code, u16 *pream_table,
7046 u32 num_tx_chain);
7047void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03007048
Kalle Valo5e3dd152013-06-12 20:52:10 +03007049#endif /* _WMI_H_ */