blob: 9e8f7d074aaf1be689f7cdd859c44219363fe16d [file] [log] [blame]
Kalle Valo5e3dd152013-06-12 20:52:10 +03001/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _WMI_H_
19#define _WMI_H_
20
21#include <linux/types.h>
22#include <net/mac80211.h>
23
24/*
25 * This file specifies the WMI interface for the Unified Software
26 * Architecture.
27 *
28 * It includes definitions of all the commands and events. Commands are
29 * messages from the host to the target. Events and Replies are messages
30 * from the target to the host.
31 *
32 * Ownership of correctness in regards to WMI commands belongs to the host
33 * driver and the target is not required to validate parameters for value,
34 * proper range, or any other checking.
35 *
36 * Guidelines for extending this interface are below.
37 *
38 * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
39 *
40 * 2. Use ONLY u32 type for defining member variables within WMI
41 * command/event structures. Do not use u8, u16, bool or
42 * enum types within these structures.
43 *
44 * 3. DO NOT define bit fields within structures. Implement bit fields
45 * using masks if necessary. Do not use the programming language's bit
46 * field definition.
47 *
48 * 4. Define macros for encode/decode of u8, u16 fields within
49 * the u32 variables. Use these macros for set/get of these fields.
50 * Try to use this to optimize the structure without bloating it with
51 * u32 variables for every lower sized field.
52 *
53 * 5. Do not use PACK/UNPACK attributes for the structures as each member
54 * variable is already 4-byte aligned by virtue of being a u32
55 * type.
56 *
57 * 6. Comment each parameter part of the WMI command/event structure by
58 * using the 2 stars at the begining of C comment instead of one star to
59 * enable HTML document generation using Doxygen.
60 *
61 */
62
63/* Control Path */
64struct wmi_cmd_hdr {
65 __le32 cmd_id;
66} __packed;
67
68#define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
69#define WMI_CMD_HDR_CMD_ID_LSB 0
70#define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
71#define WMI_CMD_HDR_PLT_PRIV_LSB 24
72
73#define HTC_PROTOCOL_VERSION 0x0002
74#define WMI_PROTOCOL_VERSION 0x0002
75
Kalle Valo3b8fc902015-10-05 17:56:37 +030076/*
77 * There is no signed version of __le32, so for a temporary solution come
78 * up with our own version. The idea is from fs/ntfs/types.h.
79 *
80 * Use a_ prefix so that it doesn't conflict if we get proper support to
81 * linux/types.h.
82 */
83typedef __s32 __bitwise a_sle32;
84
85static inline a_sle32 a_cpu_to_sle32(s32 val)
86{
87 return (__force a_sle32)cpu_to_le32(val);
88}
89
90static inline s32 a_sle32_to_cpu(a_sle32 val)
91{
92 return le32_to_cpu((__force __le32)val);
93}
94
Michal Kaziorcff990c2014-08-04 09:18:33 +030095enum wmi_service {
96 WMI_SERVICE_BEACON_OFFLOAD = 0,
97 WMI_SERVICE_SCAN_OFFLOAD,
98 WMI_SERVICE_ROAM_OFFLOAD,
99 WMI_SERVICE_BCN_MISS_OFFLOAD,
100 WMI_SERVICE_STA_PWRSAVE,
101 WMI_SERVICE_STA_ADVANCED_PWRSAVE,
102 WMI_SERVICE_AP_UAPSD,
103 WMI_SERVICE_AP_DFS,
104 WMI_SERVICE_11AC,
105 WMI_SERVICE_BLOCKACK,
106 WMI_SERVICE_PHYERR,
107 WMI_SERVICE_BCN_FILTER,
108 WMI_SERVICE_RTT,
109 WMI_SERVICE_RATECTRL,
110 WMI_SERVICE_WOW,
111 WMI_SERVICE_RATECTRL_CACHE,
112 WMI_SERVICE_IRAM_TIDS,
113 WMI_SERVICE_ARPNS_OFFLOAD,
114 WMI_SERVICE_NLO,
115 WMI_SERVICE_GTK_OFFLOAD,
116 WMI_SERVICE_SCAN_SCH,
117 WMI_SERVICE_CSA_OFFLOAD,
118 WMI_SERVICE_CHATTER,
119 WMI_SERVICE_COEX_FREQAVOID,
120 WMI_SERVICE_PACKET_POWER_SAVE,
121 WMI_SERVICE_FORCE_FW_HANG,
122 WMI_SERVICE_GPIO,
123 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
124 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
125 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
126 WMI_SERVICE_STA_KEEP_ALIVE,
127 WMI_SERVICE_TX_ENCAP,
128 WMI_SERVICE_BURST,
129 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
130 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kaziorca996ec2014-12-03 10:11:32 +0200131 WMI_SERVICE_ROAM_SCAN_OFFLOAD,
132 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
133 WMI_SERVICE_EARLY_RX,
134 WMI_SERVICE_STA_SMPS,
135 WMI_SERVICE_FWTEST,
136 WMI_SERVICE_STA_WMMAC,
137 WMI_SERVICE_TDLS,
138 WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
139 WMI_SERVICE_ADAPTIVE_OCS,
140 WMI_SERVICE_BA_SSN_SUPPORT,
141 WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
142 WMI_SERVICE_WLAN_HB,
143 WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
144 WMI_SERVICE_BATCH_SCAN,
145 WMI_SERVICE_QPOWER,
146 WMI_SERVICE_PLMREQ,
147 WMI_SERVICE_THERMAL_MGMT,
148 WMI_SERVICE_RMC,
149 WMI_SERVICE_MHF_OFFLOAD,
150 WMI_SERVICE_COEX_SAR,
151 WMI_SERVICE_BCN_TXRATE_OVERRIDE,
152 WMI_SERVICE_NAN,
153 WMI_SERVICE_L1SS_STAT,
154 WMI_SERVICE_ESTIMATE_LINKSPEED,
155 WMI_SERVICE_OBSS_SCAN,
156 WMI_SERVICE_TDLS_OFFCHAN,
157 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
158 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
159 WMI_SERVICE_IBSS_PWRSAVE,
160 WMI_SERVICE_LPASS,
161 WMI_SERVICE_EXTSCAN,
162 WMI_SERVICE_D0WOW,
163 WMI_SERVICE_HSOFFLOAD,
164 WMI_SERVICE_ROAM_HO_OFFLOAD,
165 WMI_SERVICE_RX_FULL_REORDER,
166 WMI_SERVICE_DHCP_OFFLOAD,
167 WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
168 WMI_SERVICE_MDNS_OFFLOAD,
169 WMI_SERVICE_SAP_AUTH_OFFLOAD,
Yanbo Li52c22a62015-04-15 15:28:07 +0300170 WMI_SERVICE_ATF,
Yanbo Lide0c7892015-04-15 15:28:08 +0300171 WMI_SERVICE_COEX_GPIO,
Raja Mani840357c2015-06-22 20:10:10 +0530172 WMI_SERVICE_ENHANCED_PROXY_STA,
173 WMI_SERVICE_TT,
174 WMI_SERVICE_PEER_CACHING,
175 WMI_SERVICE_AUX_SPECTRAL_INTF,
176 WMI_SERVICE_AUX_CHAN_LOAD_INTF,
177 WMI_SERVICE_BSS_CHANNEL_INFO_64,
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530178 WMI_SERVICE_EXT_RES_CFG_SUPPORT,
179 WMI_SERVICE_MESH,
Michal Kaziorc4f8c832014-09-04 10:18:32 +0200180
181 /* keep last */
182 WMI_SERVICE_MAX,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300183};
Kalle Valo5e3dd152013-06-12 20:52:10 +0300184
Michal Kaziorcff990c2014-08-04 09:18:33 +0300185enum wmi_10x_service {
186 WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
187 WMI_10X_SERVICE_SCAN_OFFLOAD,
188 WMI_10X_SERVICE_ROAM_OFFLOAD,
189 WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
190 WMI_10X_SERVICE_STA_PWRSAVE,
191 WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
192 WMI_10X_SERVICE_AP_UAPSD,
193 WMI_10X_SERVICE_AP_DFS,
194 WMI_10X_SERVICE_11AC,
195 WMI_10X_SERVICE_BLOCKACK,
196 WMI_10X_SERVICE_PHYERR,
197 WMI_10X_SERVICE_BCN_FILTER,
198 WMI_10X_SERVICE_RTT,
199 WMI_10X_SERVICE_RATECTRL,
200 WMI_10X_SERVICE_WOW,
201 WMI_10X_SERVICE_RATECTRL_CACHE,
202 WMI_10X_SERVICE_IRAM_TIDS,
203 WMI_10X_SERVICE_BURST,
204
205 /* introduced in 10.2 */
206 WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
207 WMI_10X_SERVICE_FORCE_FW_HANG,
208 WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Yanbo Li52c22a62015-04-15 15:28:07 +0300209 WMI_10X_SERVICE_ATF,
Yanbo Lide0c7892015-04-15 15:28:08 +0300210 WMI_10X_SERVICE_COEX_GPIO,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300211};
212
213enum wmi_main_service {
214 WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
215 WMI_MAIN_SERVICE_SCAN_OFFLOAD,
216 WMI_MAIN_SERVICE_ROAM_OFFLOAD,
217 WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
218 WMI_MAIN_SERVICE_STA_PWRSAVE,
219 WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
220 WMI_MAIN_SERVICE_AP_UAPSD,
221 WMI_MAIN_SERVICE_AP_DFS,
222 WMI_MAIN_SERVICE_11AC,
223 WMI_MAIN_SERVICE_BLOCKACK,
224 WMI_MAIN_SERVICE_PHYERR,
225 WMI_MAIN_SERVICE_BCN_FILTER,
226 WMI_MAIN_SERVICE_RTT,
227 WMI_MAIN_SERVICE_RATECTRL,
228 WMI_MAIN_SERVICE_WOW,
229 WMI_MAIN_SERVICE_RATECTRL_CACHE,
230 WMI_MAIN_SERVICE_IRAM_TIDS,
231 WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
232 WMI_MAIN_SERVICE_NLO,
233 WMI_MAIN_SERVICE_GTK_OFFLOAD,
234 WMI_MAIN_SERVICE_SCAN_SCH,
235 WMI_MAIN_SERVICE_CSA_OFFLOAD,
236 WMI_MAIN_SERVICE_CHATTER,
237 WMI_MAIN_SERVICE_COEX_FREQAVOID,
238 WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
239 WMI_MAIN_SERVICE_FORCE_FW_HANG,
240 WMI_MAIN_SERVICE_GPIO,
241 WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
242 WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
243 WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
244 WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
245 WMI_MAIN_SERVICE_TX_ENCAP,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300246};
247
Raja Mani840357c2015-06-22 20:10:10 +0530248enum wmi_10_4_service {
249 WMI_10_4_SERVICE_BEACON_OFFLOAD = 0,
250 WMI_10_4_SERVICE_SCAN_OFFLOAD,
251 WMI_10_4_SERVICE_ROAM_OFFLOAD,
252 WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
253 WMI_10_4_SERVICE_STA_PWRSAVE,
254 WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
255 WMI_10_4_SERVICE_AP_UAPSD,
256 WMI_10_4_SERVICE_AP_DFS,
257 WMI_10_4_SERVICE_11AC,
258 WMI_10_4_SERVICE_BLOCKACK,
259 WMI_10_4_SERVICE_PHYERR,
260 WMI_10_4_SERVICE_BCN_FILTER,
261 WMI_10_4_SERVICE_RTT,
262 WMI_10_4_SERVICE_RATECTRL,
263 WMI_10_4_SERVICE_WOW,
264 WMI_10_4_SERVICE_RATECTRL_CACHE,
265 WMI_10_4_SERVICE_IRAM_TIDS,
266 WMI_10_4_SERVICE_BURST,
267 WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
268 WMI_10_4_SERVICE_GTK_OFFLOAD,
269 WMI_10_4_SERVICE_SCAN_SCH,
270 WMI_10_4_SERVICE_CSA_OFFLOAD,
271 WMI_10_4_SERVICE_CHATTER,
272 WMI_10_4_SERVICE_COEX_FREQAVOID,
273 WMI_10_4_SERVICE_PACKET_POWER_SAVE,
274 WMI_10_4_SERVICE_FORCE_FW_HANG,
275 WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
276 WMI_10_4_SERVICE_GPIO,
277 WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
278 WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
279 WMI_10_4_SERVICE_STA_KEEP_ALIVE,
280 WMI_10_4_SERVICE_TX_ENCAP,
281 WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
282 WMI_10_4_SERVICE_EARLY_RX,
283 WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
284 WMI_10_4_SERVICE_TT,
285 WMI_10_4_SERVICE_ATF,
286 WMI_10_4_SERVICE_PEER_CACHING,
287 WMI_10_4_SERVICE_COEX_GPIO,
288 WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
289 WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
290 WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530291 WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
292 WMI_10_4_SERVICE_MESH,
Raja Mani840357c2015-06-22 20:10:10 +0530293};
294
Kalle Valo5e3dd152013-06-12 20:52:10 +0300295static inline char *wmi_service_name(int service_id)
296{
Michal Kaziorcff990c2014-08-04 09:18:33 +0300297#define SVCSTR(x) case x: return #x
298
Kalle Valo5e3dd152013-06-12 20:52:10 +0300299 switch (service_id) {
Michal Kaziorcff990c2014-08-04 09:18:33 +0300300 SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
301 SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
302 SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
303 SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
304 SVCSTR(WMI_SERVICE_STA_PWRSAVE);
305 SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
306 SVCSTR(WMI_SERVICE_AP_UAPSD);
307 SVCSTR(WMI_SERVICE_AP_DFS);
308 SVCSTR(WMI_SERVICE_11AC);
309 SVCSTR(WMI_SERVICE_BLOCKACK);
310 SVCSTR(WMI_SERVICE_PHYERR);
311 SVCSTR(WMI_SERVICE_BCN_FILTER);
312 SVCSTR(WMI_SERVICE_RTT);
313 SVCSTR(WMI_SERVICE_RATECTRL);
314 SVCSTR(WMI_SERVICE_WOW);
315 SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
316 SVCSTR(WMI_SERVICE_IRAM_TIDS);
317 SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
318 SVCSTR(WMI_SERVICE_NLO);
319 SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
320 SVCSTR(WMI_SERVICE_SCAN_SCH);
321 SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
322 SVCSTR(WMI_SERVICE_CHATTER);
323 SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
324 SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
325 SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
326 SVCSTR(WMI_SERVICE_GPIO);
327 SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
328 SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
329 SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
330 SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
331 SVCSTR(WMI_SERVICE_TX_ENCAP);
332 SVCSTR(WMI_SERVICE_BURST);
333 SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
334 SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
Michal Kaziorca996ec2014-12-03 10:11:32 +0200335 SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
336 SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
337 SVCSTR(WMI_SERVICE_EARLY_RX);
338 SVCSTR(WMI_SERVICE_STA_SMPS);
339 SVCSTR(WMI_SERVICE_FWTEST);
340 SVCSTR(WMI_SERVICE_STA_WMMAC);
341 SVCSTR(WMI_SERVICE_TDLS);
342 SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
343 SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
344 SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
345 SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
346 SVCSTR(WMI_SERVICE_WLAN_HB);
347 SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
348 SVCSTR(WMI_SERVICE_BATCH_SCAN);
349 SVCSTR(WMI_SERVICE_QPOWER);
350 SVCSTR(WMI_SERVICE_PLMREQ);
351 SVCSTR(WMI_SERVICE_THERMAL_MGMT);
352 SVCSTR(WMI_SERVICE_RMC);
353 SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
354 SVCSTR(WMI_SERVICE_COEX_SAR);
355 SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
356 SVCSTR(WMI_SERVICE_NAN);
357 SVCSTR(WMI_SERVICE_L1SS_STAT);
358 SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
359 SVCSTR(WMI_SERVICE_OBSS_SCAN);
360 SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
361 SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
362 SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
363 SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
364 SVCSTR(WMI_SERVICE_LPASS);
365 SVCSTR(WMI_SERVICE_EXTSCAN);
366 SVCSTR(WMI_SERVICE_D0WOW);
367 SVCSTR(WMI_SERVICE_HSOFFLOAD);
368 SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
369 SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
370 SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
371 SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
372 SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
373 SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
Yanbo Li52c22a62015-04-15 15:28:07 +0300374 SVCSTR(WMI_SERVICE_ATF);
Yanbo Lide0c7892015-04-15 15:28:08 +0300375 SVCSTR(WMI_SERVICE_COEX_GPIO);
Raja Mani840357c2015-06-22 20:10:10 +0530376 SVCSTR(WMI_SERVICE_ENHANCED_PROXY_STA);
377 SVCSTR(WMI_SERVICE_TT);
378 SVCSTR(WMI_SERVICE_PEER_CACHING);
379 SVCSTR(WMI_SERVICE_AUX_SPECTRAL_INTF);
380 SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF);
381 SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64);
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530382 SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT);
383 SVCSTR(WMI_SERVICE_MESH);
Kalle Valo5e3dd152013-06-12 20:52:10 +0300384 default:
Michal Kaziorcff990c2014-08-04 09:18:33 +0300385 return NULL;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300386 }
Michal Kaziorcff990c2014-08-04 09:18:33 +0300387
388#undef SVCSTR
Kalle Valo5e3dd152013-06-12 20:52:10 +0300389}
390
Michal Kazior37b9f932014-11-27 10:11:16 +0100391#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
392 ((svc_id) < (len) && \
393 __le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300394 BIT((svc_id)%(sizeof(u32))))
395
Michal Kazior37b9f932014-11-27 10:11:16 +0100396#define SVCMAP(x, y, len) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300397 do { \
Michal Kazior37b9f932014-11-27 10:11:16 +0100398 if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300399 __set_bit(y, out); \
400 } while (0)
401
Michal Kazior37b9f932014-11-27 10:11:16 +0100402static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
403 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300404{
405 SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100406 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300407 SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100408 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300409 SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100410 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300411 SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100412 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300413 SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100414 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300415 SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100416 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300417 SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100418 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300419 SVCMAP(WMI_10X_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100420 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300421 SVCMAP(WMI_10X_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100422 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300423 SVCMAP(WMI_10X_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100424 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300425 SVCMAP(WMI_10X_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100426 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300427 SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100428 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300429 SVCMAP(WMI_10X_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100430 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300431 SVCMAP(WMI_10X_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100432 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300433 SVCMAP(WMI_10X_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100434 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300435 SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100436 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300437 SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100438 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300439 SVCMAP(WMI_10X_SERVICE_BURST,
Michal Kazior37b9f932014-11-27 10:11:16 +0100440 WMI_SERVICE_BURST, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300441 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100442 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300443 SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100444 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300445 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100446 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
Yanbo Li52c22a62015-04-15 15:28:07 +0300447 SVCMAP(WMI_10X_SERVICE_ATF,
448 WMI_SERVICE_ATF, len);
Yanbo Lide0c7892015-04-15 15:28:08 +0300449 SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
450 WMI_SERVICE_COEX_GPIO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300451}
452
Michal Kazior37b9f932014-11-27 10:11:16 +0100453static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
454 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300455{
456 SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100457 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300458 SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100459 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300460 SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100461 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300462 SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100463 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300464 SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100465 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300466 SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100467 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300468 SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100469 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300470 SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100471 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300472 SVCMAP(WMI_MAIN_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100473 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300474 SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100475 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300476 SVCMAP(WMI_MAIN_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100477 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300478 SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100479 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300480 SVCMAP(WMI_MAIN_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100481 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300482 SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100483 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300484 SVCMAP(WMI_MAIN_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100485 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300486 SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100487 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300488 SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100489 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300490 SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100491 WMI_SERVICE_ARPNS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300492 SVCMAP(WMI_MAIN_SERVICE_NLO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100493 WMI_SERVICE_NLO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300494 SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100495 WMI_SERVICE_GTK_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300496 SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
Michal Kazior37b9f932014-11-27 10:11:16 +0100497 WMI_SERVICE_SCAN_SCH, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300498 SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100499 WMI_SERVICE_CSA_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300500 SVCMAP(WMI_MAIN_SERVICE_CHATTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100501 WMI_SERVICE_CHATTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300502 SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
Michal Kazior37b9f932014-11-27 10:11:16 +0100503 WMI_SERVICE_COEX_FREQAVOID, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300504 SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100505 WMI_SERVICE_PACKET_POWER_SAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300506 SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100507 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300508 SVCMAP(WMI_MAIN_SERVICE_GPIO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100509 WMI_SERVICE_GPIO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300510 SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
Michal Kazior37b9f932014-11-27 10:11:16 +0100511 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300512 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100513 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300514 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100515 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300516 SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100517 WMI_SERVICE_STA_KEEP_ALIVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300518 SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
Michal Kazior37b9f932014-11-27 10:11:16 +0100519 WMI_SERVICE_TX_ENCAP, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300520}
521
Raja Mani840357c2015-06-22 20:10:10 +0530522static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
523 size_t len)
524{
525 SVCMAP(WMI_10_4_SERVICE_BEACON_OFFLOAD,
526 WMI_SERVICE_BEACON_OFFLOAD, len);
527 SVCMAP(WMI_10_4_SERVICE_SCAN_OFFLOAD,
528 WMI_SERVICE_SCAN_OFFLOAD, len);
529 SVCMAP(WMI_10_4_SERVICE_ROAM_OFFLOAD,
530 WMI_SERVICE_ROAM_OFFLOAD, len);
531 SVCMAP(WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
532 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
533 SVCMAP(WMI_10_4_SERVICE_STA_PWRSAVE,
534 WMI_SERVICE_STA_PWRSAVE, len);
535 SVCMAP(WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
536 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
537 SVCMAP(WMI_10_4_SERVICE_AP_UAPSD,
538 WMI_SERVICE_AP_UAPSD, len);
539 SVCMAP(WMI_10_4_SERVICE_AP_DFS,
540 WMI_SERVICE_AP_DFS, len);
541 SVCMAP(WMI_10_4_SERVICE_11AC,
542 WMI_SERVICE_11AC, len);
543 SVCMAP(WMI_10_4_SERVICE_BLOCKACK,
544 WMI_SERVICE_BLOCKACK, len);
545 SVCMAP(WMI_10_4_SERVICE_PHYERR,
546 WMI_SERVICE_PHYERR, len);
547 SVCMAP(WMI_10_4_SERVICE_BCN_FILTER,
548 WMI_SERVICE_BCN_FILTER, len);
549 SVCMAP(WMI_10_4_SERVICE_RTT,
550 WMI_SERVICE_RTT, len);
551 SVCMAP(WMI_10_4_SERVICE_RATECTRL,
552 WMI_SERVICE_RATECTRL, len);
553 SVCMAP(WMI_10_4_SERVICE_WOW,
554 WMI_SERVICE_WOW, len);
555 SVCMAP(WMI_10_4_SERVICE_RATECTRL_CACHE,
556 WMI_SERVICE_RATECTRL_CACHE, len);
557 SVCMAP(WMI_10_4_SERVICE_IRAM_TIDS,
558 WMI_SERVICE_IRAM_TIDS, len);
559 SVCMAP(WMI_10_4_SERVICE_BURST,
560 WMI_SERVICE_BURST, len);
561 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
562 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
563 SVCMAP(WMI_10_4_SERVICE_GTK_OFFLOAD,
564 WMI_SERVICE_GTK_OFFLOAD, len);
565 SVCMAP(WMI_10_4_SERVICE_SCAN_SCH,
566 WMI_SERVICE_SCAN_SCH, len);
567 SVCMAP(WMI_10_4_SERVICE_CSA_OFFLOAD,
568 WMI_SERVICE_CSA_OFFLOAD, len);
569 SVCMAP(WMI_10_4_SERVICE_CHATTER,
570 WMI_SERVICE_CHATTER, len);
571 SVCMAP(WMI_10_4_SERVICE_COEX_FREQAVOID,
572 WMI_SERVICE_COEX_FREQAVOID, len);
573 SVCMAP(WMI_10_4_SERVICE_PACKET_POWER_SAVE,
574 WMI_SERVICE_PACKET_POWER_SAVE, len);
575 SVCMAP(WMI_10_4_SERVICE_FORCE_FW_HANG,
576 WMI_SERVICE_FORCE_FW_HANG, len);
577 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
578 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
579 SVCMAP(WMI_10_4_SERVICE_GPIO,
580 WMI_SERVICE_GPIO, len);
581 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
582 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
583 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
584 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
585 SVCMAP(WMI_10_4_SERVICE_STA_KEEP_ALIVE,
586 WMI_SERVICE_STA_KEEP_ALIVE, len);
587 SVCMAP(WMI_10_4_SERVICE_TX_ENCAP,
588 WMI_SERVICE_TX_ENCAP, len);
589 SVCMAP(WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
590 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, len);
591 SVCMAP(WMI_10_4_SERVICE_EARLY_RX,
592 WMI_SERVICE_EARLY_RX, len);
593 SVCMAP(WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
594 WMI_SERVICE_ENHANCED_PROXY_STA, len);
595 SVCMAP(WMI_10_4_SERVICE_TT,
596 WMI_SERVICE_TT, len);
597 SVCMAP(WMI_10_4_SERVICE_ATF,
598 WMI_SERVICE_ATF, len);
599 SVCMAP(WMI_10_4_SERVICE_PEER_CACHING,
600 WMI_SERVICE_PEER_CACHING, len);
601 SVCMAP(WMI_10_4_SERVICE_COEX_GPIO,
602 WMI_SERVICE_COEX_GPIO, len);
603 SVCMAP(WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
604 WMI_SERVICE_AUX_SPECTRAL_INTF, len);
605 SVCMAP(WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
606 WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
607 SVCMAP(WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
608 WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
Vasanthakumar Thiagarajane3c62252015-10-29 19:11:32 +0530609 SVCMAP(WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
610 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
611 SVCMAP(WMI_10_4_SERVICE_MESH,
612 WMI_SERVICE_MESH, len);
Raja Mani840357c2015-06-22 20:10:10 +0530613}
614
Michal Kaziorcff990c2014-08-04 09:18:33 +0300615#undef SVCMAP
Kalle Valo5e3dd152013-06-12 20:52:10 +0300616
Kalle Valo5e3dd152013-06-12 20:52:10 +0300617/* 2 word representation of MAC addr */
618struct wmi_mac_addr {
619 union {
620 u8 addr[6];
621 struct {
622 u32 word0;
623 u32 word1;
624 } __packed;
625 } __packed;
626} __packed;
627
Bartosz Markowskice428702013-09-26 17:47:05 +0200628struct wmi_cmd_map {
629 u32 init_cmdid;
630 u32 start_scan_cmdid;
631 u32 stop_scan_cmdid;
632 u32 scan_chan_list_cmdid;
633 u32 scan_sch_prio_tbl_cmdid;
634 u32 pdev_set_regdomain_cmdid;
635 u32 pdev_set_channel_cmdid;
636 u32 pdev_set_param_cmdid;
637 u32 pdev_pktlog_enable_cmdid;
638 u32 pdev_pktlog_disable_cmdid;
639 u32 pdev_set_wmm_params_cmdid;
640 u32 pdev_set_ht_cap_ie_cmdid;
641 u32 pdev_set_vht_cap_ie_cmdid;
642 u32 pdev_set_dscp_tid_map_cmdid;
643 u32 pdev_set_quiet_mode_cmdid;
644 u32 pdev_green_ap_ps_enable_cmdid;
645 u32 pdev_get_tpc_config_cmdid;
646 u32 pdev_set_base_macaddr_cmdid;
647 u32 vdev_create_cmdid;
648 u32 vdev_delete_cmdid;
649 u32 vdev_start_request_cmdid;
650 u32 vdev_restart_request_cmdid;
651 u32 vdev_up_cmdid;
652 u32 vdev_stop_cmdid;
653 u32 vdev_down_cmdid;
654 u32 vdev_set_param_cmdid;
655 u32 vdev_install_key_cmdid;
656 u32 peer_create_cmdid;
657 u32 peer_delete_cmdid;
658 u32 peer_flush_tids_cmdid;
659 u32 peer_set_param_cmdid;
660 u32 peer_assoc_cmdid;
661 u32 peer_add_wds_entry_cmdid;
662 u32 peer_remove_wds_entry_cmdid;
663 u32 peer_mcast_group_cmdid;
664 u32 bcn_tx_cmdid;
665 u32 pdev_send_bcn_cmdid;
666 u32 bcn_tmpl_cmdid;
667 u32 bcn_filter_rx_cmdid;
668 u32 prb_req_filter_rx_cmdid;
669 u32 mgmt_tx_cmdid;
670 u32 prb_tmpl_cmdid;
671 u32 addba_clear_resp_cmdid;
672 u32 addba_send_cmdid;
673 u32 addba_status_cmdid;
674 u32 delba_send_cmdid;
675 u32 addba_set_resp_cmdid;
676 u32 send_singleamsdu_cmdid;
677 u32 sta_powersave_mode_cmdid;
678 u32 sta_powersave_param_cmdid;
679 u32 sta_mimo_ps_mode_cmdid;
680 u32 pdev_dfs_enable_cmdid;
681 u32 pdev_dfs_disable_cmdid;
682 u32 roam_scan_mode;
683 u32 roam_scan_rssi_threshold;
684 u32 roam_scan_period;
685 u32 roam_scan_rssi_change_threshold;
686 u32 roam_ap_profile;
687 u32 ofl_scan_add_ap_profile;
688 u32 ofl_scan_remove_ap_profile;
689 u32 ofl_scan_period;
690 u32 p2p_dev_set_device_info;
691 u32 p2p_dev_set_discoverability;
692 u32 p2p_go_set_beacon_ie;
693 u32 p2p_go_set_probe_resp_ie;
694 u32 p2p_set_vendor_ie_data_cmdid;
695 u32 ap_ps_peer_param_cmdid;
696 u32 ap_ps_peer_uapsd_coex_cmdid;
697 u32 peer_rate_retry_sched_cmdid;
698 u32 wlan_profile_trigger_cmdid;
699 u32 wlan_profile_set_hist_intvl_cmdid;
700 u32 wlan_profile_get_profile_data_cmdid;
701 u32 wlan_profile_enable_profile_id_cmdid;
702 u32 wlan_profile_list_profile_id_cmdid;
703 u32 pdev_suspend_cmdid;
704 u32 pdev_resume_cmdid;
705 u32 add_bcn_filter_cmdid;
706 u32 rmv_bcn_filter_cmdid;
707 u32 wow_add_wake_pattern_cmdid;
708 u32 wow_del_wake_pattern_cmdid;
709 u32 wow_enable_disable_wake_event_cmdid;
710 u32 wow_enable_cmdid;
711 u32 wow_hostwakeup_from_sleep_cmdid;
712 u32 rtt_measreq_cmdid;
713 u32 rtt_tsf_cmdid;
714 u32 vdev_spectral_scan_configure_cmdid;
715 u32 vdev_spectral_scan_enable_cmdid;
716 u32 request_stats_cmdid;
717 u32 set_arp_ns_offload_cmdid;
718 u32 network_list_offload_config_cmdid;
719 u32 gtk_offload_cmdid;
720 u32 csa_offload_enable_cmdid;
721 u32 csa_offload_chanswitch_cmdid;
722 u32 chatter_set_mode_cmdid;
723 u32 peer_tid_addba_cmdid;
724 u32 peer_tid_delba_cmdid;
725 u32 sta_dtim_ps_method_cmdid;
726 u32 sta_uapsd_auto_trig_cmdid;
727 u32 sta_keepalive_cmd;
728 u32 echo_cmdid;
729 u32 pdev_utf_cmdid;
730 u32 dbglog_cfg_cmdid;
731 u32 pdev_qvit_cmdid;
732 u32 pdev_ftm_intg_cmdid;
733 u32 vdev_set_keepalive_cmdid;
734 u32 vdev_get_keepalive_cmdid;
735 u32 force_fw_hang_cmdid;
736 u32 gpio_config_cmdid;
737 u32 gpio_output_cmdid;
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +0200738 u32 pdev_get_temperature_cmdid;
Michal Kazior6d492fe2015-01-28 09:57:22 +0200739 u32 vdev_set_wmm_params_cmdid;
Marek Puzyniakad45c882015-03-30 09:51:53 +0300740 u32 tdls_set_state_cmdid;
741 u32 tdls_peer_update_cmdid;
Michal Kazior5b272e32015-03-31 10:26:22 +0000742 u32 adaptive_qcs_cmdid;
Raja Mani2d491e62015-06-22 20:10:11 +0530743 u32 scan_update_request_cmdid;
744 u32 vdev_standby_response_cmdid;
745 u32 vdev_resume_response_cmdid;
746 u32 wlan_peer_caching_add_peer_cmdid;
747 u32 wlan_peer_caching_evict_peer_cmdid;
748 u32 wlan_peer_caching_restore_peer_cmdid;
749 u32 wlan_peer_caching_print_all_peers_info_cmdid;
750 u32 peer_update_wds_entry_cmdid;
751 u32 peer_add_proxy_sta_entry_cmdid;
752 u32 rtt_keepalive_cmdid;
753 u32 oem_req_cmdid;
754 u32 nan_cmdid;
755 u32 vdev_ratemask_cmdid;
756 u32 qboost_cfg_cmdid;
757 u32 pdev_smart_ant_enable_cmdid;
758 u32 pdev_smart_ant_set_rx_antenna_cmdid;
759 u32 peer_smart_ant_set_tx_antenna_cmdid;
760 u32 peer_smart_ant_set_train_info_cmdid;
761 u32 peer_smart_ant_set_node_config_ops_cmdid;
762 u32 pdev_set_antenna_switch_table_cmdid;
763 u32 pdev_set_ctl_table_cmdid;
764 u32 pdev_set_mimogain_table_cmdid;
765 u32 pdev_ratepwr_table_cmdid;
766 u32 pdev_ratepwr_chainmsk_table_cmdid;
767 u32 pdev_fips_cmdid;
768 u32 tt_set_conf_cmdid;
769 u32 fwtest_cmdid;
770 u32 vdev_atf_request_cmdid;
771 u32 peer_atf_request_cmdid;
772 u32 pdev_get_ani_cck_config_cmdid;
773 u32 pdev_get_ani_ofdm_config_cmdid;
774 u32 pdev_reserve_ast_entry_cmdid;
775 u32 pdev_get_nfcal_power_cmdid;
776 u32 pdev_get_tpc_cmdid;
777 u32 pdev_get_ast_info_cmdid;
778 u32 vdev_set_dscp_tid_map_cmdid;
779 u32 pdev_get_info_cmdid;
780 u32 vdev_get_info_cmdid;
781 u32 vdev_filter_neighbor_rx_packets_cmdid;
782 u32 mu_cal_start_cmdid;
783 u32 set_cca_params_cmdid;
784 u32 pdev_bss_chan_info_request_cmdid;
Maharaja62f77f02015-10-21 11:49:18 +0300785 u32 pdev_enable_adaptive_cca_cmdid;
Bartosz Markowskice428702013-09-26 17:47:05 +0200786};
787
Kalle Valo5e3dd152013-06-12 20:52:10 +0300788/*
789 * wmi command groups.
790 */
791enum wmi_cmd_group {
792 /* 0 to 2 are reserved */
793 WMI_GRP_START = 0x3,
794 WMI_GRP_SCAN = WMI_GRP_START,
795 WMI_GRP_PDEV,
796 WMI_GRP_VDEV,
797 WMI_GRP_PEER,
798 WMI_GRP_MGMT,
799 WMI_GRP_BA_NEG,
800 WMI_GRP_STA_PS,
801 WMI_GRP_DFS,
802 WMI_GRP_ROAM,
803 WMI_GRP_OFL_SCAN,
804 WMI_GRP_P2P,
805 WMI_GRP_AP_PS,
806 WMI_GRP_RATE_CTRL,
807 WMI_GRP_PROFILE,
808 WMI_GRP_SUSPEND,
809 WMI_GRP_BCN_FILTER,
810 WMI_GRP_WOW,
811 WMI_GRP_RTT,
812 WMI_GRP_SPECTRAL,
813 WMI_GRP_STATS,
814 WMI_GRP_ARP_NS_OFL,
815 WMI_GRP_NLO_OFL,
816 WMI_GRP_GTK_OFL,
817 WMI_GRP_CSA_OFL,
818 WMI_GRP_CHATTER,
819 WMI_GRP_TID_ADDBA,
820 WMI_GRP_MISC,
821 WMI_GRP_GPIO,
822};
823
824#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
825#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
826
Bartosz Markowski34957b22013-10-15 09:55:31 +0200827#define WMI_CMD_UNSUPPORTED 0
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +0200828
829/* Command IDs and command events for MAIN FW. */
Kalle Valo5e3dd152013-06-12 20:52:10 +0300830enum wmi_cmd_id {
831 WMI_INIT_CMDID = 0x1,
832
833 /* Scan specific commands */
834 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
835 WMI_STOP_SCAN_CMDID,
836 WMI_SCAN_CHAN_LIST_CMDID,
837 WMI_SCAN_SCH_PRIO_TBL_CMDID,
838
839 /* PDEV (physical device) specific commands */
840 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
841 WMI_PDEV_SET_CHANNEL_CMDID,
842 WMI_PDEV_SET_PARAM_CMDID,
843 WMI_PDEV_PKTLOG_ENABLE_CMDID,
844 WMI_PDEV_PKTLOG_DISABLE_CMDID,
845 WMI_PDEV_SET_WMM_PARAMS_CMDID,
846 WMI_PDEV_SET_HT_CAP_IE_CMDID,
847 WMI_PDEV_SET_VHT_CAP_IE_CMDID,
848 WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
849 WMI_PDEV_SET_QUIET_MODE_CMDID,
850 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
851 WMI_PDEV_GET_TPC_CONFIG_CMDID,
852 WMI_PDEV_SET_BASE_MACADDR_CMDID,
853
854 /* VDEV (virtual device) specific commands */
855 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
856 WMI_VDEV_DELETE_CMDID,
857 WMI_VDEV_START_REQUEST_CMDID,
858 WMI_VDEV_RESTART_REQUEST_CMDID,
859 WMI_VDEV_UP_CMDID,
860 WMI_VDEV_STOP_CMDID,
861 WMI_VDEV_DOWN_CMDID,
862 WMI_VDEV_SET_PARAM_CMDID,
863 WMI_VDEV_INSTALL_KEY_CMDID,
864
865 /* peer specific commands */
866 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
867 WMI_PEER_DELETE_CMDID,
868 WMI_PEER_FLUSH_TIDS_CMDID,
869 WMI_PEER_SET_PARAM_CMDID,
870 WMI_PEER_ASSOC_CMDID,
871 WMI_PEER_ADD_WDS_ENTRY_CMDID,
872 WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
873 WMI_PEER_MCAST_GROUP_CMDID,
874
875 /* beacon/management specific commands */
876 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
877 WMI_PDEV_SEND_BCN_CMDID,
878 WMI_BCN_TMPL_CMDID,
879 WMI_BCN_FILTER_RX_CMDID,
880 WMI_PRB_REQ_FILTER_RX_CMDID,
881 WMI_MGMT_TX_CMDID,
882 WMI_PRB_TMPL_CMDID,
883
884 /* commands to directly control BA negotiation directly from host. */
885 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
886 WMI_ADDBA_SEND_CMDID,
887 WMI_ADDBA_STATUS_CMDID,
888 WMI_DELBA_SEND_CMDID,
889 WMI_ADDBA_SET_RESP_CMDID,
890 WMI_SEND_SINGLEAMSDU_CMDID,
891
892 /* Station power save specific config */
893 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
894 WMI_STA_POWERSAVE_PARAM_CMDID,
895 WMI_STA_MIMO_PS_MODE_CMDID,
896
897 /** DFS-specific commands */
898 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
899 WMI_PDEV_DFS_DISABLE_CMDID,
900
901 /* Roaming specific commands */
902 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
903 WMI_ROAM_SCAN_RSSI_THRESHOLD,
904 WMI_ROAM_SCAN_PERIOD,
905 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
906 WMI_ROAM_AP_PROFILE,
907
908 /* offload scan specific commands */
909 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
910 WMI_OFL_SCAN_REMOVE_AP_PROFILE,
911 WMI_OFL_SCAN_PERIOD,
912
913 /* P2P specific commands */
914 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
915 WMI_P2P_DEV_SET_DISCOVERABILITY,
916 WMI_P2P_GO_SET_BEACON_IE,
917 WMI_P2P_GO_SET_PROBE_RESP_IE,
918 WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
919
920 /* AP power save specific config */
921 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
922 WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
923
924 /* Rate-control specific commands */
925 WMI_PEER_RATE_RETRY_SCHED_CMDID =
926 WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
927
928 /* WLAN Profiling commands. */
929 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
930 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
931 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
932 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
933 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
934
935 /* Suspend resume command Ids */
936 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
937 WMI_PDEV_RESUME_CMDID,
938
939 /* Beacon filter commands */
940 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
941 WMI_RMV_BCN_FILTER_CMDID,
942
943 /* WOW Specific WMI commands*/
944 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
945 WMI_WOW_DEL_WAKE_PATTERN_CMDID,
946 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
947 WMI_WOW_ENABLE_CMDID,
948 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
949
950 /* RTT measurement related cmd */
951 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
952 WMI_RTT_TSF_CMDID,
953
954 /* spectral scan commands */
955 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
956 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
957
958 /* F/W stats */
959 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
960
961 /* ARP OFFLOAD REQUEST*/
962 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
963
964 /* NS offload confid*/
965 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
966
967 /* GTK offload Specific WMI commands*/
968 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
969
970 /* CSA offload Specific WMI commands*/
971 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
972 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
973
974 /* Chatter commands*/
975 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
976
977 /* addba specific commands */
978 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
979 WMI_PEER_TID_DELBA_CMDID,
980
981 /* set station mimo powersave method */
982 WMI_STA_DTIM_PS_METHOD_CMDID,
983 /* Configure the Station UAPSD AC Auto Trigger Parameters */
984 WMI_STA_UAPSD_AUTO_TRIG_CMDID,
985
986 /* STA Keep alive parameter configuration,
987 Requires WMI_SERVICE_STA_KEEP_ALIVE */
988 WMI_STA_KEEPALIVE_CMD,
989
990 /* misc command group */
991 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
992 WMI_PDEV_UTF_CMDID,
993 WMI_DBGLOG_CFG_CMDID,
994 WMI_PDEV_QVIT_CMDID,
995 WMI_PDEV_FTM_INTG_CMDID,
996 WMI_VDEV_SET_KEEPALIVE_CMDID,
997 WMI_VDEV_GET_KEEPALIVE_CMDID,
Michal Kazior9cfbce72013-07-16 09:54:36 +0200998 WMI_FORCE_FW_HANG_CMDID,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300999
1000 /* GPIO Configuration */
1001 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
1002 WMI_GPIO_OUTPUT_CMDID,
1003};
1004
1005enum wmi_event_id {
1006 WMI_SERVICE_READY_EVENTID = 0x1,
1007 WMI_READY_EVENTID,
1008
1009 /* Scan specific events */
1010 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
1011
1012 /* PDEV specific events */
1013 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
1014 WMI_CHAN_INFO_EVENTID,
1015 WMI_PHYERR_EVENTID,
1016
1017 /* VDEV specific events */
1018 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
1019 WMI_VDEV_STOPPED_EVENTID,
1020 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
1021
1022 /* peer specific events */
1023 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
1024
1025 /* beacon/mgmt specific events */
1026 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
1027 WMI_HOST_SWBA_EVENTID,
1028 WMI_TBTTOFFSET_UPDATE_EVENTID,
1029
1030 /* ADDBA Related WMI Events*/
1031 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
1032 WMI_TX_ADDBA_COMPLETE_EVENTID,
1033
1034 /* Roam event to trigger roaming on host */
1035 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
1036 WMI_PROFILE_MATCH,
1037
1038 /* WoW */
1039 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
1040
1041 /* RTT */
1042 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
1043 WMI_TSF_MEASUREMENT_REPORT_EVENTID,
1044 WMI_RTT_ERROR_REPORT_EVENTID,
1045
1046 /* GTK offload */
1047 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
1048 WMI_GTK_REKEY_FAIL_EVENTID,
1049
1050 /* CSA IE received event */
1051 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
1052
1053 /* Misc events */
1054 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
1055 WMI_PDEV_UTF_EVENTID,
1056 WMI_DEBUG_MESG_EVENTID,
1057 WMI_UPDATE_STATS_EVENTID,
1058 WMI_DEBUG_PRINT_EVENTID,
1059 WMI_DCS_INTERFERENCE_EVENTID,
1060 WMI_PDEV_QVIT_EVENTID,
1061 WMI_WLAN_PROFILE_DATA_EVENTID,
1062 WMI_PDEV_FTM_INTG_EVENTID,
1063 WMI_WLAN_FREQ_AVOID_EVENTID,
1064 WMI_VDEV_GET_KEEPALIVE_EVENTID,
1065
1066 /* GPIO Event */
1067 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
1068};
1069
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +02001070/* Command IDs and command events for 10.X firmware */
1071enum wmi_10x_cmd_id {
1072 WMI_10X_START_CMDID = 0x9000,
1073 WMI_10X_END_CMDID = 0x9FFF,
1074
1075 /* initialize the wlan sub system */
1076 WMI_10X_INIT_CMDID,
1077
1078 /* Scan specific commands */
1079
1080 WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
1081 WMI_10X_STOP_SCAN_CMDID,
1082 WMI_10X_SCAN_CHAN_LIST_CMDID,
1083 WMI_10X_ECHO_CMDID,
1084
1085 /* PDEV(physical device) specific commands */
1086 WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
1087 WMI_10X_PDEV_SET_CHANNEL_CMDID,
1088 WMI_10X_PDEV_SET_PARAM_CMDID,
1089 WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
1090 WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
1091 WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
1092 WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
1093 WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
1094 WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
1095 WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
1096 WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
1097 WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1098 WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
1099
1100 /* VDEV(virtual device) specific commands */
1101 WMI_10X_VDEV_CREATE_CMDID,
1102 WMI_10X_VDEV_DELETE_CMDID,
1103 WMI_10X_VDEV_START_REQUEST_CMDID,
1104 WMI_10X_VDEV_RESTART_REQUEST_CMDID,
1105 WMI_10X_VDEV_UP_CMDID,
1106 WMI_10X_VDEV_STOP_CMDID,
1107 WMI_10X_VDEV_DOWN_CMDID,
1108 WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
1109 WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
1110 WMI_10X_VDEV_SET_PARAM_CMDID,
1111 WMI_10X_VDEV_INSTALL_KEY_CMDID,
1112
1113 /* peer specific commands */
1114 WMI_10X_PEER_CREATE_CMDID,
1115 WMI_10X_PEER_DELETE_CMDID,
1116 WMI_10X_PEER_FLUSH_TIDS_CMDID,
1117 WMI_10X_PEER_SET_PARAM_CMDID,
1118 WMI_10X_PEER_ASSOC_CMDID,
1119 WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
1120 WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
1121 WMI_10X_PEER_MCAST_GROUP_CMDID,
1122
1123 /* beacon/management specific commands */
1124
1125 WMI_10X_BCN_TX_CMDID,
1126 WMI_10X_BCN_PRB_TMPL_CMDID,
1127 WMI_10X_BCN_FILTER_RX_CMDID,
1128 WMI_10X_PRB_REQ_FILTER_RX_CMDID,
1129 WMI_10X_MGMT_TX_CMDID,
1130
1131 /* commands to directly control ba negotiation directly from host. */
1132 WMI_10X_ADDBA_CLEAR_RESP_CMDID,
1133 WMI_10X_ADDBA_SEND_CMDID,
1134 WMI_10X_ADDBA_STATUS_CMDID,
1135 WMI_10X_DELBA_SEND_CMDID,
1136 WMI_10X_ADDBA_SET_RESP_CMDID,
1137 WMI_10X_SEND_SINGLEAMSDU_CMDID,
1138
1139 /* Station power save specific config */
1140 WMI_10X_STA_POWERSAVE_MODE_CMDID,
1141 WMI_10X_STA_POWERSAVE_PARAM_CMDID,
1142 WMI_10X_STA_MIMO_PS_MODE_CMDID,
1143
1144 /* set debug log config */
1145 WMI_10X_DBGLOG_CFG_CMDID,
1146
1147 /* DFS-specific commands */
1148 WMI_10X_PDEV_DFS_ENABLE_CMDID,
1149 WMI_10X_PDEV_DFS_DISABLE_CMDID,
1150
1151 /* QVIT specific command id */
1152 WMI_10X_PDEV_QVIT_CMDID,
1153
1154 /* Offload Scan and Roaming related commands */
1155 WMI_10X_ROAM_SCAN_MODE,
1156 WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
1157 WMI_10X_ROAM_SCAN_PERIOD,
1158 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1159 WMI_10X_ROAM_AP_PROFILE,
1160 WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
1161 WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
1162 WMI_10X_OFL_SCAN_PERIOD,
1163
1164 /* P2P specific commands */
1165 WMI_10X_P2P_DEV_SET_DEVICE_INFO,
1166 WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
1167 WMI_10X_P2P_GO_SET_BEACON_IE,
1168 WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
1169
1170 /* AP power save specific config */
1171 WMI_10X_AP_PS_PEER_PARAM_CMDID,
1172 WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
1173
1174 /* Rate-control specific commands */
1175 WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
1176
1177 /* WLAN Profiling commands. */
1178 WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
1179 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1180 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1181 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1182 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1183
1184 /* Suspend resume command Ids */
1185 WMI_10X_PDEV_SUSPEND_CMDID,
1186 WMI_10X_PDEV_RESUME_CMDID,
1187
1188 /* Beacon filter commands */
1189 WMI_10X_ADD_BCN_FILTER_CMDID,
1190 WMI_10X_RMV_BCN_FILTER_CMDID,
1191
1192 /* WOW Specific WMI commands*/
1193 WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
1194 WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
1195 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1196 WMI_10X_WOW_ENABLE_CMDID,
1197 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1198
1199 /* RTT measurement related cmd */
1200 WMI_10X_RTT_MEASREQ_CMDID,
1201 WMI_10X_RTT_TSF_CMDID,
1202
1203 /* transmit beacon by value */
1204 WMI_10X_PDEV_SEND_BCN_CMDID,
1205
1206 /* F/W stats */
1207 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1208 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1209 WMI_10X_REQUEST_STATS_CMDID,
1210
1211 /* GPIO Configuration */
1212 WMI_10X_GPIO_CONFIG_CMDID,
1213 WMI_10X_GPIO_OUTPUT_CMDID,
1214
1215 WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
1216};
1217
1218enum wmi_10x_event_id {
1219 WMI_10X_SERVICE_READY_EVENTID = 0x8000,
1220 WMI_10X_READY_EVENTID,
1221 WMI_10X_START_EVENTID = 0x9000,
1222 WMI_10X_END_EVENTID = 0x9FFF,
1223
1224 /* Scan specific events */
1225 WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
1226 WMI_10X_ECHO_EVENTID,
1227 WMI_10X_DEBUG_MESG_EVENTID,
1228 WMI_10X_UPDATE_STATS_EVENTID,
1229
1230 /* Instantaneous RSSI event */
1231 WMI_10X_INST_RSSI_STATS_EVENTID,
1232
1233 /* VDEV specific events */
1234 WMI_10X_VDEV_START_RESP_EVENTID,
1235 WMI_10X_VDEV_STANDBY_REQ_EVENTID,
1236 WMI_10X_VDEV_RESUME_REQ_EVENTID,
1237 WMI_10X_VDEV_STOPPED_EVENTID,
1238
1239 /* peer specific events */
1240 WMI_10X_PEER_STA_KICKOUT_EVENTID,
1241
1242 /* beacon/mgmt specific events */
1243 WMI_10X_HOST_SWBA_EVENTID,
1244 WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
1245 WMI_10X_MGMT_RX_EVENTID,
1246
1247 /* Channel stats event */
1248 WMI_10X_CHAN_INFO_EVENTID,
1249
1250 /* PHY Error specific WMI event */
1251 WMI_10X_PHYERR_EVENTID,
1252
1253 /* Roam event to trigger roaming on host */
1254 WMI_10X_ROAM_EVENTID,
1255
1256 /* matching AP found from list of profiles */
1257 WMI_10X_PROFILE_MATCH,
1258
1259 /* debug print message used for tracing FW code while debugging */
1260 WMI_10X_DEBUG_PRINT_EVENTID,
1261 /* VI spoecific event */
1262 WMI_10X_PDEV_QVIT_EVENTID,
1263 /* FW code profile data in response to profile request */
1264 WMI_10X_WLAN_PROFILE_DATA_EVENTID,
1265
1266 /*RTT related event ID*/
1267 WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
1268 WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
1269 WMI_10X_RTT_ERROR_REPORT_EVENTID,
1270
1271 WMI_10X_WOW_WAKEUP_HOST_EVENTID,
1272 WMI_10X_DCS_INTERFERENCE_EVENTID,
1273
1274 /* TPC config for the current operating channel */
1275 WMI_10X_PDEV_TPC_CONFIG_EVENTID,
1276
1277 WMI_10X_GPIO_INPUT_EVENTID,
1278 WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
1279};
1280
Michal Kazior24c88f72014-07-25 13:32:17 +02001281enum wmi_10_2_cmd_id {
1282 WMI_10_2_START_CMDID = 0x9000,
1283 WMI_10_2_END_CMDID = 0x9FFF,
1284 WMI_10_2_INIT_CMDID,
1285 WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
1286 WMI_10_2_STOP_SCAN_CMDID,
1287 WMI_10_2_SCAN_CHAN_LIST_CMDID,
1288 WMI_10_2_ECHO_CMDID,
1289 WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
1290 WMI_10_2_PDEV_SET_CHANNEL_CMDID,
1291 WMI_10_2_PDEV_SET_PARAM_CMDID,
1292 WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
1293 WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
1294 WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
1295 WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
1296 WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
1297 WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
1298 WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
1299 WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1300 WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
1301 WMI_10_2_VDEV_CREATE_CMDID,
1302 WMI_10_2_VDEV_DELETE_CMDID,
1303 WMI_10_2_VDEV_START_REQUEST_CMDID,
1304 WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
1305 WMI_10_2_VDEV_UP_CMDID,
1306 WMI_10_2_VDEV_STOP_CMDID,
1307 WMI_10_2_VDEV_DOWN_CMDID,
1308 WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
1309 WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
1310 WMI_10_2_VDEV_SET_PARAM_CMDID,
1311 WMI_10_2_VDEV_INSTALL_KEY_CMDID,
1312 WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
1313 WMI_10_2_PEER_CREATE_CMDID,
1314 WMI_10_2_PEER_DELETE_CMDID,
1315 WMI_10_2_PEER_FLUSH_TIDS_CMDID,
1316 WMI_10_2_PEER_SET_PARAM_CMDID,
1317 WMI_10_2_PEER_ASSOC_CMDID,
1318 WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
1319 WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
1320 WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
1321 WMI_10_2_PEER_MCAST_GROUP_CMDID,
1322 WMI_10_2_BCN_TX_CMDID,
1323 WMI_10_2_BCN_PRB_TMPL_CMDID,
1324 WMI_10_2_BCN_FILTER_RX_CMDID,
1325 WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
1326 WMI_10_2_MGMT_TX_CMDID,
1327 WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
1328 WMI_10_2_ADDBA_SEND_CMDID,
1329 WMI_10_2_ADDBA_STATUS_CMDID,
1330 WMI_10_2_DELBA_SEND_CMDID,
1331 WMI_10_2_ADDBA_SET_RESP_CMDID,
1332 WMI_10_2_SEND_SINGLEAMSDU_CMDID,
1333 WMI_10_2_STA_POWERSAVE_MODE_CMDID,
1334 WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
1335 WMI_10_2_STA_MIMO_PS_MODE_CMDID,
1336 WMI_10_2_DBGLOG_CFG_CMDID,
1337 WMI_10_2_PDEV_DFS_ENABLE_CMDID,
1338 WMI_10_2_PDEV_DFS_DISABLE_CMDID,
1339 WMI_10_2_PDEV_QVIT_CMDID,
1340 WMI_10_2_ROAM_SCAN_MODE,
1341 WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
1342 WMI_10_2_ROAM_SCAN_PERIOD,
1343 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1344 WMI_10_2_ROAM_AP_PROFILE,
1345 WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
1346 WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
1347 WMI_10_2_OFL_SCAN_PERIOD,
1348 WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
1349 WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
1350 WMI_10_2_P2P_GO_SET_BEACON_IE,
1351 WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
1352 WMI_10_2_AP_PS_PEER_PARAM_CMDID,
1353 WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
1354 WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
1355 WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
1356 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1357 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1358 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1359 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1360 WMI_10_2_PDEV_SUSPEND_CMDID,
1361 WMI_10_2_PDEV_RESUME_CMDID,
1362 WMI_10_2_ADD_BCN_FILTER_CMDID,
1363 WMI_10_2_RMV_BCN_FILTER_CMDID,
1364 WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
1365 WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
1366 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1367 WMI_10_2_WOW_ENABLE_CMDID,
1368 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1369 WMI_10_2_RTT_MEASREQ_CMDID,
1370 WMI_10_2_RTT_TSF_CMDID,
1371 WMI_10_2_RTT_KEEPALIVE_CMDID,
1372 WMI_10_2_PDEV_SEND_BCN_CMDID,
1373 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1374 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1375 WMI_10_2_REQUEST_STATS_CMDID,
1376 WMI_10_2_GPIO_CONFIG_CMDID,
1377 WMI_10_2_GPIO_OUTPUT_CMDID,
1378 WMI_10_2_VDEV_RATEMASK_CMDID,
1379 WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
1380 WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
1381 WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
1382 WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
1383 WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
1384 WMI_10_2_FORCE_FW_HANG_CMDID,
1385 WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
1386 WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
1387 WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
1388 WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
1389 WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001390 WMI_10_2_PDEV_GET_INFO,
1391 WMI_10_2_VDEV_GET_INFO,
1392 WMI_10_2_VDEV_ATF_REQUEST_CMDID,
1393 WMI_10_2_PEER_ATF_REQUEST_CMDID,
1394 WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
Maharaja62f77f02015-10-21 11:49:18 +03001395 WMI_10_2_MU_CAL_START_CMDID,
1396 WMI_10_2_SET_LTEU_CONFIG_CMDID,
1397 WMI_10_2_SET_CCA_PARAMS,
Michal Kazior24c88f72014-07-25 13:32:17 +02001398 WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
1399};
1400
1401enum wmi_10_2_event_id {
1402 WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
1403 WMI_10_2_READY_EVENTID,
1404 WMI_10_2_DEBUG_MESG_EVENTID,
1405 WMI_10_2_START_EVENTID = 0x9000,
1406 WMI_10_2_END_EVENTID = 0x9FFF,
1407 WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
1408 WMI_10_2_ECHO_EVENTID,
1409 WMI_10_2_UPDATE_STATS_EVENTID,
1410 WMI_10_2_INST_RSSI_STATS_EVENTID,
1411 WMI_10_2_VDEV_START_RESP_EVENTID,
1412 WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
1413 WMI_10_2_VDEV_RESUME_REQ_EVENTID,
1414 WMI_10_2_VDEV_STOPPED_EVENTID,
1415 WMI_10_2_PEER_STA_KICKOUT_EVENTID,
1416 WMI_10_2_HOST_SWBA_EVENTID,
1417 WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
1418 WMI_10_2_MGMT_RX_EVENTID,
1419 WMI_10_2_CHAN_INFO_EVENTID,
1420 WMI_10_2_PHYERR_EVENTID,
1421 WMI_10_2_ROAM_EVENTID,
1422 WMI_10_2_PROFILE_MATCH,
1423 WMI_10_2_DEBUG_PRINT_EVENTID,
1424 WMI_10_2_PDEV_QVIT_EVENTID,
1425 WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
1426 WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
1427 WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
1428 WMI_10_2_RTT_ERROR_REPORT_EVENTID,
1429 WMI_10_2_RTT_KEEPALIVE_EVENTID,
1430 WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
1431 WMI_10_2_DCS_INTERFERENCE_EVENTID,
1432 WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
1433 WMI_10_2_GPIO_INPUT_EVENTID,
1434 WMI_10_2_PEER_RATECODE_LIST_EVENTID,
1435 WMI_10_2_GENERIC_BUFFER_EVENTID,
1436 WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
1437 WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
1438 WMI_10_2_WDS_PEER_EVENTID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001439 WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
1440 WMI_10_2_PDEV_TEMPERATURE_EVENTID,
Michal Kazior24c88f72014-07-25 13:32:17 +02001441 WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
1442};
1443
Raja Mani2d491e62015-06-22 20:10:11 +05301444enum wmi_10_4_cmd_id {
1445 WMI_10_4_START_CMDID = 0x9000,
1446 WMI_10_4_END_CMDID = 0x9FFF,
1447 WMI_10_4_INIT_CMDID,
1448 WMI_10_4_START_SCAN_CMDID = WMI_10_4_START_CMDID,
1449 WMI_10_4_STOP_SCAN_CMDID,
1450 WMI_10_4_SCAN_CHAN_LIST_CMDID,
1451 WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID,
1452 WMI_10_4_SCAN_UPDATE_REQUEST_CMDID,
1453 WMI_10_4_ECHO_CMDID,
1454 WMI_10_4_PDEV_SET_REGDOMAIN_CMDID,
1455 WMI_10_4_PDEV_SET_CHANNEL_CMDID,
1456 WMI_10_4_PDEV_SET_PARAM_CMDID,
1457 WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID,
1458 WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID,
1459 WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID,
1460 WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID,
1461 WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID,
1462 WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID,
1463 WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID,
1464 WMI_10_4_PDEV_SET_QUIET_MODE_CMDID,
1465 WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1466 WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID,
1467 WMI_10_4_VDEV_CREATE_CMDID,
1468 WMI_10_4_VDEV_DELETE_CMDID,
1469 WMI_10_4_VDEV_START_REQUEST_CMDID,
1470 WMI_10_4_VDEV_RESTART_REQUEST_CMDID,
1471 WMI_10_4_VDEV_UP_CMDID,
1472 WMI_10_4_VDEV_STOP_CMDID,
1473 WMI_10_4_VDEV_DOWN_CMDID,
1474 WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID,
1475 WMI_10_4_VDEV_RESUME_RESPONSE_CMDID,
1476 WMI_10_4_VDEV_SET_PARAM_CMDID,
1477 WMI_10_4_VDEV_INSTALL_KEY_CMDID,
1478 WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID,
1479 WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID,
1480 WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID,
1481 WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID,
1482 WMI_10_4_PEER_CREATE_CMDID,
1483 WMI_10_4_PEER_DELETE_CMDID,
1484 WMI_10_4_PEER_FLUSH_TIDS_CMDID,
1485 WMI_10_4_PEER_SET_PARAM_CMDID,
1486 WMI_10_4_PEER_ASSOC_CMDID,
1487 WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID,
1488 WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID,
1489 WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID,
1490 WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID,
1491 WMI_10_4_PEER_MCAST_GROUP_CMDID,
1492 WMI_10_4_BCN_TX_CMDID,
1493 WMI_10_4_PDEV_SEND_BCN_CMDID,
1494 WMI_10_4_BCN_PRB_TMPL_CMDID,
1495 WMI_10_4_BCN_FILTER_RX_CMDID,
1496 WMI_10_4_PRB_REQ_FILTER_RX_CMDID,
1497 WMI_10_4_MGMT_TX_CMDID,
1498 WMI_10_4_PRB_TMPL_CMDID,
1499 WMI_10_4_ADDBA_CLEAR_RESP_CMDID,
1500 WMI_10_4_ADDBA_SEND_CMDID,
1501 WMI_10_4_ADDBA_STATUS_CMDID,
1502 WMI_10_4_DELBA_SEND_CMDID,
1503 WMI_10_4_ADDBA_SET_RESP_CMDID,
1504 WMI_10_4_SEND_SINGLEAMSDU_CMDID,
1505 WMI_10_4_STA_POWERSAVE_MODE_CMDID,
1506 WMI_10_4_STA_POWERSAVE_PARAM_CMDID,
1507 WMI_10_4_STA_MIMO_PS_MODE_CMDID,
1508 WMI_10_4_DBGLOG_CFG_CMDID,
1509 WMI_10_4_PDEV_DFS_ENABLE_CMDID,
1510 WMI_10_4_PDEV_DFS_DISABLE_CMDID,
1511 WMI_10_4_PDEV_QVIT_CMDID,
1512 WMI_10_4_ROAM_SCAN_MODE,
1513 WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD,
1514 WMI_10_4_ROAM_SCAN_PERIOD,
1515 WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1516 WMI_10_4_ROAM_AP_PROFILE,
1517 WMI_10_4_OFL_SCAN_ADD_AP_PROFILE,
1518 WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE,
1519 WMI_10_4_OFL_SCAN_PERIOD,
1520 WMI_10_4_P2P_DEV_SET_DEVICE_INFO,
1521 WMI_10_4_P2P_DEV_SET_DISCOVERABILITY,
1522 WMI_10_4_P2P_GO_SET_BEACON_IE,
1523 WMI_10_4_P2P_GO_SET_PROBE_RESP_IE,
1524 WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID,
1525 WMI_10_4_AP_PS_PEER_PARAM_CMDID,
1526 WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID,
1527 WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID,
1528 WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID,
1529 WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1530 WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1531 WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1532 WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1533 WMI_10_4_PDEV_SUSPEND_CMDID,
1534 WMI_10_4_PDEV_RESUME_CMDID,
1535 WMI_10_4_ADD_BCN_FILTER_CMDID,
1536 WMI_10_4_RMV_BCN_FILTER_CMDID,
1537 WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID,
1538 WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID,
1539 WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1540 WMI_10_4_WOW_ENABLE_CMDID,
1541 WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1542 WMI_10_4_RTT_MEASREQ_CMDID,
1543 WMI_10_4_RTT_TSF_CMDID,
1544 WMI_10_4_RTT_KEEPALIVE_CMDID,
1545 WMI_10_4_OEM_REQ_CMDID,
1546 WMI_10_4_NAN_CMDID,
1547 WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1548 WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1549 WMI_10_4_REQUEST_STATS_CMDID,
1550 WMI_10_4_GPIO_CONFIG_CMDID,
1551 WMI_10_4_GPIO_OUTPUT_CMDID,
1552 WMI_10_4_VDEV_RATEMASK_CMDID,
1553 WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID,
1554 WMI_10_4_GTK_OFFLOAD_CMDID,
1555 WMI_10_4_QBOOST_CFG_CMDID,
1556 WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID,
1557 WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID,
1558 WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
1559 WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
1560 WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
1561 WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
1562 WMI_10_4_VDEV_SET_KEEPALIVE_CMDID,
1563 WMI_10_4_VDEV_GET_KEEPALIVE_CMDID,
1564 WMI_10_4_FORCE_FW_HANG_CMDID,
1565 WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
1566 WMI_10_4_PDEV_SET_CTL_TABLE_CMDID,
1567 WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID,
1568 WMI_10_4_PDEV_RATEPWR_TABLE_CMDID,
1569 WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
1570 WMI_10_4_PDEV_FIPS_CMDID,
1571 WMI_10_4_TT_SET_CONF_CMDID,
1572 WMI_10_4_FWTEST_CMDID,
1573 WMI_10_4_VDEV_ATF_REQUEST_CMDID,
1574 WMI_10_4_PEER_ATF_REQUEST_CMDID,
1575 WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID,
1576 WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID,
1577 WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID,
1578 WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID,
1579 WMI_10_4_PDEV_GET_TPC_CMDID,
1580 WMI_10_4_PDEV_GET_AST_INFO_CMDID,
1581 WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID,
1582 WMI_10_4_PDEV_GET_TEMPERATURE_CMDID,
1583 WMI_10_4_PDEV_GET_INFO_CMDID,
1584 WMI_10_4_VDEV_GET_INFO_CMDID,
1585 WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID,
1586 WMI_10_4_MU_CAL_START_CMDID,
1587 WMI_10_4_SET_CCA_PARAMS_CMDID,
1588 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
Vasanthakumar Thiagarajan69d43152015-10-29 19:11:33 +05301589 WMI_10_4_EXT_RESOURCE_CFG_CMDID,
1590 WMI_10_4_VDEV_SET_IE_CMDID,
1591 WMI_10_4_SET_LTEU_CONFIG_CMDID,
Raja Mani2d491e62015-06-22 20:10:11 +05301592 WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
1593};
1594
1595enum wmi_10_4_event_id {
1596 WMI_10_4_SERVICE_READY_EVENTID = 0x8000,
1597 WMI_10_4_READY_EVENTID,
1598 WMI_10_4_DEBUG_MESG_EVENTID,
1599 WMI_10_4_START_EVENTID = 0x9000,
1600 WMI_10_4_END_EVENTID = 0x9FFF,
1601 WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID,
1602 WMI_10_4_ECHO_EVENTID,
1603 WMI_10_4_UPDATE_STATS_EVENTID,
1604 WMI_10_4_INST_RSSI_STATS_EVENTID,
1605 WMI_10_4_VDEV_START_RESP_EVENTID,
1606 WMI_10_4_VDEV_STANDBY_REQ_EVENTID,
1607 WMI_10_4_VDEV_RESUME_REQ_EVENTID,
1608 WMI_10_4_VDEV_STOPPED_EVENTID,
1609 WMI_10_4_PEER_STA_KICKOUT_EVENTID,
1610 WMI_10_4_HOST_SWBA_EVENTID,
1611 WMI_10_4_TBTTOFFSET_UPDATE_EVENTID,
1612 WMI_10_4_MGMT_RX_EVENTID,
1613 WMI_10_4_CHAN_INFO_EVENTID,
1614 WMI_10_4_PHYERR_EVENTID,
1615 WMI_10_4_ROAM_EVENTID,
1616 WMI_10_4_PROFILE_MATCH,
1617 WMI_10_4_DEBUG_PRINT_EVENTID,
1618 WMI_10_4_PDEV_QVIT_EVENTID,
1619 WMI_10_4_WLAN_PROFILE_DATA_EVENTID,
1620 WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID,
1621 WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID,
1622 WMI_10_4_RTT_ERROR_REPORT_EVENTID,
1623 WMI_10_4_RTT_KEEPALIVE_EVENTID,
1624 WMI_10_4_OEM_CAPABILITY_EVENTID,
1625 WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID,
1626 WMI_10_4_OEM_ERROR_REPORT_EVENTID,
1627 WMI_10_4_NAN_EVENTID,
1628 WMI_10_4_WOW_WAKEUP_HOST_EVENTID,
1629 WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID,
1630 WMI_10_4_GTK_REKEY_FAIL_EVENTID,
1631 WMI_10_4_DCS_INTERFERENCE_EVENTID,
1632 WMI_10_4_PDEV_TPC_CONFIG_EVENTID,
1633 WMI_10_4_CSA_HANDLING_EVENTID,
1634 WMI_10_4_GPIO_INPUT_EVENTID,
1635 WMI_10_4_PEER_RATECODE_LIST_EVENTID,
1636 WMI_10_4_GENERIC_BUFFER_EVENTID,
1637 WMI_10_4_MCAST_BUF_RELEASE_EVENTID,
1638 WMI_10_4_MCAST_LIST_AGEOUT_EVENTID,
1639 WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID,
1640 WMI_10_4_WDS_PEER_EVENTID,
1641 WMI_10_4_PEER_STA_PS_STATECHG_EVENTID,
1642 WMI_10_4_PDEV_FIPS_EVENTID,
1643 WMI_10_4_TT_STATS_EVENTID,
1644 WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID,
1645 WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID,
1646 WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID,
1647 WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID,
1648 WMI_10_4_PDEV_NFCAL_POWER_EVENTID,
1649 WMI_10_4_PDEV_TPC_EVENTID,
1650 WMI_10_4_PDEV_GET_AST_INFO_EVENTID,
1651 WMI_10_4_PDEV_TEMPERATURE_EVENTID,
1652 WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID,
1653 WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID,
Vasanthakumar Thiagarajan69d43152015-10-29 19:11:33 +05301654 WMI_10_4_MU_REPORT_EVENTID,
Raja Mani2d491e62015-06-22 20:10:11 +05301655 WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
1656};
1657
Kalle Valo5e3dd152013-06-12 20:52:10 +03001658enum wmi_phy_mode {
1659 MODE_11A = 0, /* 11a Mode */
1660 MODE_11G = 1, /* 11b/g Mode */
1661 MODE_11B = 2, /* 11b Mode */
1662 MODE_11GONLY = 3, /* 11g only Mode */
1663 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
1664 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
1665 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
1666 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
1667 MODE_11AC_VHT20 = 8,
1668 MODE_11AC_VHT40 = 9,
1669 MODE_11AC_VHT80 = 10,
1670 /* MODE_11AC_VHT160 = 11, */
1671 MODE_11AC_VHT20_2G = 11,
1672 MODE_11AC_VHT40_2G = 12,
1673 MODE_11AC_VHT80_2G = 13,
1674 MODE_UNKNOWN = 14,
1675 MODE_MAX = 14
1676};
1677
Kalle Valo38a1d472013-09-08 17:56:14 +03001678static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
1679{
1680 switch (mode) {
1681 case MODE_11A:
1682 return "11a";
1683 case MODE_11G:
1684 return "11g";
1685 case MODE_11B:
1686 return "11b";
1687 case MODE_11GONLY:
1688 return "11gonly";
1689 case MODE_11NA_HT20:
1690 return "11na-ht20";
1691 case MODE_11NG_HT20:
1692 return "11ng-ht20";
1693 case MODE_11NA_HT40:
1694 return "11na-ht40";
1695 case MODE_11NG_HT40:
1696 return "11ng-ht40";
1697 case MODE_11AC_VHT20:
1698 return "11ac-vht20";
1699 case MODE_11AC_VHT40:
1700 return "11ac-vht40";
1701 case MODE_11AC_VHT80:
1702 return "11ac-vht80";
1703 case MODE_11AC_VHT20_2G:
1704 return "11ac-vht20-2g";
1705 case MODE_11AC_VHT40_2G:
1706 return "11ac-vht40-2g";
1707 case MODE_11AC_VHT80_2G:
1708 return "11ac-vht80-2g";
1709 case MODE_UNKNOWN:
1710 /* skip */
1711 break;
1712
1713 /* no default handler to allow compiler to check that the
1714 * enum is fully handled */
1715 };
1716
1717 return "<unknown>";
1718}
1719
Kalle Valo5e3dd152013-06-12 20:52:10 +03001720#define WMI_CHAN_LIST_TAG 0x1
1721#define WMI_SSID_LIST_TAG 0x2
1722#define WMI_BSSID_LIST_TAG 0x3
1723#define WMI_IE_TAG 0x4
1724
1725struct wmi_channel {
1726 __le32 mhz;
1727 __le32 band_center_freq1;
1728 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
1729 union {
1730 __le32 flags; /* WMI_CHAN_FLAG_ */
1731 struct {
1732 u8 mode; /* only 6 LSBs */
1733 } __packed;
1734 } __packed;
1735 union {
1736 __le32 reginfo0;
1737 struct {
Michal Kazior02256932013-10-23 04:02:14 -07001738 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001739 u8 min_power;
1740 u8 max_power;
1741 u8 reg_power;
1742 u8 reg_classid;
1743 } __packed;
1744 } __packed;
1745 union {
1746 __le32 reginfo1;
1747 struct {
1748 u8 antenna_max;
1749 } __packed;
1750 } __packed;
1751} __packed;
1752
1753struct wmi_channel_arg {
1754 u32 freq;
1755 u32 band_center_freq1;
1756 bool passive;
1757 bool allow_ibss;
1758 bool allow_ht;
1759 bool allow_vht;
1760 bool ht40plus;
Marek Puzyniake8a50f82013-11-20 09:59:47 +02001761 bool chan_radar;
Michal Kazior02256932013-10-23 04:02:14 -07001762 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001763 u32 min_power;
1764 u32 max_power;
1765 u32 max_reg_power;
1766 u32 max_antenna_gain;
1767 u32 reg_class_id;
1768 enum wmi_phy_mode mode;
1769};
1770
1771enum wmi_channel_change_cause {
1772 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
1773 WMI_CHANNEL_CHANGE_CAUSE_CSA,
1774};
1775
1776#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
1777#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
1778#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
1779#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
1780#define WMI_CHAN_FLAG_DFS (1 << 10)
1781#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
1782#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
1783
1784/* Indicate reason for channel switch */
1785#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
1786
Raja Mani5c8726e2015-06-22 20:22:26 +05301787#define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */
1788#define WMI_10_4_MAX_SPATIAL_STREAM 4
Kalle Valo5e3dd152013-06-12 20:52:10 +03001789
1790/* HT Capabilities*/
1791#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
1792#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
1793#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
1794#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
1795#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
1796#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
1797#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
1798#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
1799#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
1800#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
1801#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
1802#define WMI_HT_CAP_HT40_SGI 0x0800
1803
1804#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
1805 WMI_HT_CAP_HT20_SGI | \
1806 WMI_HT_CAP_HT40_SGI | \
1807 WMI_HT_CAP_TX_STBC | \
1808 WMI_HT_CAP_RX_STBC | \
1809 WMI_HT_CAP_LDPC)
1810
Kalle Valo5e3dd152013-06-12 20:52:10 +03001811/*
1812 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
1813 * field. The fields not defined here are not supported, or reserved.
1814 * Do not change these masks and if you have to add new one follow the
1815 * bitmask as specified by 802.11ac draft.
1816 */
1817
1818#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
1819#define WMI_VHT_CAP_RX_LDPC 0x00000010
1820#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
1821#define WMI_VHT_CAP_TX_STBC 0x00000080
1822#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
1823#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
1824#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
1825#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
1826#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
1827#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
1828
1829/* The following also refer for max HT AMSDU */
1830#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
1831#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
1832#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
1833
1834#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
1835 WMI_VHT_CAP_RX_LDPC | \
1836 WMI_VHT_CAP_SGI_80MHZ | \
1837 WMI_VHT_CAP_TX_STBC | \
1838 WMI_VHT_CAP_RX_STBC_MASK | \
1839 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
1840 WMI_VHT_CAP_RX_FIXED_ANT | \
1841 WMI_VHT_CAP_TX_FIXED_ANT)
1842
1843/*
1844 * Interested readers refer to Rx/Tx MCS Map definition as defined in
1845 * 802.11ac
1846 */
1847#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
1848#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
1849#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
1850
1851enum {
1852 REGDMN_MODE_11A = 0x00001, /* 11a channels */
1853 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
1854 REGDMN_MODE_11B = 0x00004, /* 11b channels */
1855 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
1856 REGDMN_MODE_11G = 0x00008, /* XXX historical */
1857 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
1858 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
1859 REGDMN_MODE_XR = 0x00100, /* XR channels */
1860 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
1861 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
1862 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
1863 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
1864 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
1865 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
1866 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
1867 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
1868 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
1869 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
1870 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
1871 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
1872 REGDMN_MODE_ALL = 0xffffffff
1873};
1874
1875#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
1876#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
1877#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
1878
1879/* regulatory capabilities */
1880#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
1881#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
1882#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
1883#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
1884#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
1885#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
1886
1887struct hal_reg_capabilities {
1888 /* regdomain value specified in EEPROM */
1889 __le32 eeprom_rd;
1890 /*regdomain */
1891 __le32 eeprom_rd_ext;
1892 /* CAP1 capabilities bit map. */
1893 __le32 regcap1;
1894 /* REGDMN EEPROM CAP. */
1895 __le32 regcap2;
1896 /* REGDMN MODE */
1897 __le32 wireless_modes;
1898 __le32 low_2ghz_chan;
1899 __le32 high_2ghz_chan;
1900 __le32 low_5ghz_chan;
1901 __le32 high_5ghz_chan;
1902} __packed;
1903
1904enum wlan_mode_capability {
1905 WHAL_WLAN_11A_CAPABILITY = 0x1,
1906 WHAL_WLAN_11G_CAPABILITY = 0x2,
1907 WHAL_WLAN_11AG_CAPABILITY = 0x3,
1908};
1909
1910/* structure used by FW for requesting host memory */
1911struct wlan_host_mem_req {
1912 /* ID of the request */
1913 __le32 req_id;
1914 /* size of the of each unit */
1915 __le32 unit_size;
1916 /* flags to indicate that
1917 * the number units is dependent
1918 * on number of resources(num vdevs num peers .. etc)
1919 */
1920 __le32 num_unit_info;
1921 /*
1922 * actual number of units to allocate . if flags in the num_unit_info
1923 * indicate that number of units is tied to number of a particular
1924 * resource to allocate then num_units filed is set to 0 and host
1925 * will derive the number units from number of the resources it is
1926 * requesting.
1927 */
1928 __le32 num_units;
1929} __packed;
1930
Kalle Valo5e3dd152013-06-12 20:52:10 +03001931/*
1932 * The following struct holds optional payload for
1933 * wmi_service_ready_event,e.g., 11ac pass some of the
1934 * device capability to the host.
1935 */
1936struct wmi_service_ready_event {
1937 __le32 sw_version;
1938 __le32 sw_version_1;
1939 __le32 abi_version;
1940 /* WMI_PHY_CAPABILITY */
1941 __le32 phy_capability;
1942 /* Maximum number of frag table entries that SW will populate less 1 */
1943 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001944 __le32 wmi_service_bitmap[16];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001945 __le32 num_rf_chains;
1946 /*
1947 * The following field is only valid for service type
1948 * WMI_SERVICE_11AC
1949 */
1950 __le32 ht_cap_info; /* WMI HT Capability */
1951 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1952 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1953 __le32 hw_min_tx_power;
1954 __le32 hw_max_tx_power;
1955 struct hal_reg_capabilities hal_reg_capabilities;
1956 __le32 sys_cap_info;
1957 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1958 /*
1959 * Max beacon and Probe Response IE offload size
1960 * (includes optional P2P IEs)
1961 */
1962 __le32 max_bcn_ie_size;
1963 /*
1964 * request to host to allocate a chuck of memory and pss it down to FW
1965 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1966 * data structures. Only valid for low latency interfaces like PCIE
1967 * where FW can access this memory directly (or) by DMA.
1968 */
1969 __le32 num_mem_reqs;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001970 struct wlan_host_mem_req mem_reqs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001971} __packed;
1972
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001973/* This is the definition from 10.X firmware branch */
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001974struct wmi_10x_service_ready_event {
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001975 __le32 sw_version;
1976 __le32 abi_version;
1977
1978 /* WMI_PHY_CAPABILITY */
1979 __le32 phy_capability;
1980
1981 /* Maximum number of frag table entries that SW will populate less 1 */
1982 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001983 __le32 wmi_service_bitmap[16];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001984 __le32 num_rf_chains;
1985
1986 /*
1987 * The following field is only valid for service type
1988 * WMI_SERVICE_11AC
1989 */
1990 __le32 ht_cap_info; /* WMI HT Capability */
1991 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1992 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1993 __le32 hw_min_tx_power;
1994 __le32 hw_max_tx_power;
1995
1996 struct hal_reg_capabilities hal_reg_capabilities;
1997
1998 __le32 sys_cap_info;
1999 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
2000
2001 /*
2002 * request to host to allocate a chuck of memory and pss it down to FW
2003 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
2004 * data structures. Only valid for low latency interfaces like PCIE
2005 * where FW can access this memory directly (or) by DMA.
2006 */
2007 __le32 num_mem_reqs;
2008
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02002009 struct wlan_host_mem_req mem_reqs[0];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002010} __packed;
2011
Kalle Valo5e3dd152013-06-12 20:52:10 +03002012#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
2013#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
2014
2015struct wmi_ready_event {
2016 __le32 sw_version;
2017 __le32 abi_version;
2018 struct wmi_mac_addr mac_addr;
2019 __le32 status;
2020} __packed;
2021
2022struct wmi_resource_config {
2023 /* number of virtual devices (VAPs) to support */
2024 __le32 num_vdevs;
2025
2026 /* number of peer nodes to support */
2027 __le32 num_peers;
2028
2029 /*
2030 * In offload mode target supports features like WOW, chatter and
2031 * other protocol offloads. In order to support them some
2032 * functionalities like reorder buffering, PN checking need to be
2033 * done in target. This determines maximum number of peers suported
2034 * by target in offload mode
2035 */
2036 __le32 num_offload_peers;
2037
2038 /* For target-based RX reordering */
2039 __le32 num_offload_reorder_bufs;
2040
2041 /* number of keys per peer */
2042 __le32 num_peer_keys;
2043
2044 /* total number of TX/RX data TIDs */
2045 __le32 num_tids;
2046
2047 /*
2048 * max skid for resolving hash collisions
2049 *
2050 * The address search table is sparse, so that if two MAC addresses
2051 * result in the same hash value, the second of these conflicting
2052 * entries can slide to the next index in the address search table,
2053 * and use it, if it is unoccupied. This ast_skid_limit parameter
2054 * specifies the upper bound on how many subsequent indices to search
2055 * over to find an unoccupied space.
2056 */
2057 __le32 ast_skid_limit;
2058
2059 /*
2060 * the nominal chain mask for transmit
2061 *
2062 * The chain mask may be modified dynamically, e.g. to operate AP
2063 * tx with a reduced number of chains if no clients are associated.
2064 * This configuration parameter specifies the nominal chain-mask that
2065 * should be used when not operating with a reduced set of tx chains.
2066 */
2067 __le32 tx_chain_mask;
2068
2069 /*
2070 * the nominal chain mask for receive
2071 *
2072 * The chain mask may be modified dynamically, e.g. for a client
2073 * to use a reduced number of chains for receive if the traffic to
2074 * the client is low enough that it doesn't require downlink MIMO
2075 * or antenna diversity.
2076 * This configuration parameter specifies the nominal chain-mask that
2077 * should be used when not operating with a reduced set of rx chains.
2078 */
2079 __le32 rx_chain_mask;
2080
2081 /*
2082 * what rx reorder timeout (ms) to use for the AC
2083 *
2084 * Each WMM access class (voice, video, best-effort, background) will
2085 * have its own timeout value to dictate how long to wait for missing
2086 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2087 * already been received.
2088 * This parameter specifies the timeout in milliseconds for each
2089 * class.
2090 */
2091 __le32 rx_timeout_pri_vi;
2092 __le32 rx_timeout_pri_vo;
2093 __le32 rx_timeout_pri_be;
2094 __le32 rx_timeout_pri_bk;
2095
2096 /*
2097 * what mode the rx should decap packets to
2098 *
2099 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2100 * THis setting also determines the default TX behavior, however TX
2101 * behavior can be modified on a per VAP basis during VAP init
2102 */
2103 __le32 rx_decap_mode;
2104
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002105 /* what is the maximum number of scan requests that can be queued */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002106 __le32 scan_max_pending_reqs;
2107
2108 /* maximum VDEV that could use BMISS offload */
2109 __le32 bmiss_offload_max_vdev;
2110
2111 /* maximum VDEV that could use offload roaming */
2112 __le32 roam_offload_max_vdev;
2113
2114 /* maximum AP profiles that would push to offload roaming */
2115 __le32 roam_offload_max_ap_profiles;
2116
2117 /*
2118 * how many groups to use for mcast->ucast conversion
2119 *
2120 * The target's WAL maintains a table to hold information regarding
2121 * which peers belong to a given multicast group, so that if
2122 * multicast->unicast conversion is enabled, the target can convert
2123 * multicast tx frames to a series of unicast tx frames, to each
2124 * peer within the multicast group.
2125 This num_mcast_groups configuration parameter tells the target how
2126 * many multicast groups to provide storage for within its multicast
2127 * group membership table.
2128 */
2129 __le32 num_mcast_groups;
2130
2131 /*
2132 * size to alloc for the mcast membership table
2133 *
2134 * This num_mcast_table_elems configuration parameter tells the
2135 * target how many peer elements it needs to provide storage for in
2136 * its multicast group membership table.
2137 * These multicast group membership table elements are shared by the
2138 * multicast groups stored within the table.
2139 */
2140 __le32 num_mcast_table_elems;
2141
2142 /*
2143 * whether/how to do multicast->unicast conversion
2144 *
2145 * This configuration parameter specifies whether the target should
2146 * perform multicast --> unicast conversion on transmit, and if so,
2147 * what to do if it finds no entries in its multicast group
2148 * membership table for the multicast IP address in the tx frame.
2149 * Configuration value:
2150 * 0 -> Do not perform multicast to unicast conversion.
2151 * 1 -> Convert multicast frames to unicast, if the IP multicast
2152 * address from the tx frame is found in the multicast group
2153 * membership table. If the IP multicast address is not found,
2154 * drop the frame.
2155 * 2 -> Convert multicast frames to unicast, if the IP multicast
2156 * address from the tx frame is found in the multicast group
2157 * membership table. If the IP multicast address is not found,
2158 * transmit the frame as multicast.
2159 */
2160 __le32 mcast2ucast_mode;
2161
2162 /*
2163 * how much memory to allocate for a tx PPDU dbg log
2164 *
2165 * This parameter controls how much memory the target will allocate
2166 * to store a log of tx PPDU meta-information (how large the PPDU
2167 * was, when it was sent, whether it was successful, etc.)
2168 */
2169 __le32 tx_dbg_log_size;
2170
2171 /* how many AST entries to be allocated for WDS */
2172 __le32 num_wds_entries;
2173
2174 /*
2175 * MAC DMA burst size, e.g., For target PCI limit can be
2176 * 0 -default, 1 256B
2177 */
2178 __le32 dma_burst_size;
2179
2180 /*
2181 * Fixed delimiters to be inserted after every MPDU to
2182 * account for interface latency to avoid underrun.
2183 */
2184 __le32 mac_aggr_delim;
2185
2186 /*
2187 * determine whether target is responsible for detecting duplicate
2188 * non-aggregate MPDU and timing out stale fragments.
2189 *
2190 * A-MPDU reordering is always performed on the target.
2191 *
2192 * 0: target responsible for frag timeout and dup checking
2193 * 1: host responsible for frag timeout and dup checking
2194 */
2195 __le32 rx_skip_defrag_timeout_dup_detection_check;
2196
2197 /*
2198 * Configuration for VoW :
2199 * No of Video Nodes to be supported
2200 * and Max no of descriptors for each Video link (node).
2201 */
2202 __le32 vow_config;
2203
2204 /* maximum VDEV that could use GTK offload */
2205 __le32 gtk_offload_max_vdev;
2206
2207 /* Number of msdu descriptors target should use */
2208 __le32 num_msdu_desc;
2209
2210 /*
2211 * Max. number of Tx fragments per MSDU
2212 * This parameter controls the max number of Tx fragments per MSDU.
2213 * This is sent by the target as part of the WMI_SERVICE_READY event
2214 * and is overriden by the OS shim as required.
2215 */
2216 __le32 max_frag_entries;
2217} __packed;
2218
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002219struct wmi_resource_config_10x {
2220 /* number of virtual devices (VAPs) to support */
2221 __le32 num_vdevs;
2222
2223 /* number of peer nodes to support */
2224 __le32 num_peers;
2225
2226 /* number of keys per peer */
2227 __le32 num_peer_keys;
2228
2229 /* total number of TX/RX data TIDs */
2230 __le32 num_tids;
2231
2232 /*
2233 * max skid for resolving hash collisions
2234 *
2235 * The address search table is sparse, so that if two MAC addresses
2236 * result in the same hash value, the second of these conflicting
2237 * entries can slide to the next index in the address search table,
2238 * and use it, if it is unoccupied. This ast_skid_limit parameter
2239 * specifies the upper bound on how many subsequent indices to search
2240 * over to find an unoccupied space.
2241 */
2242 __le32 ast_skid_limit;
2243
2244 /*
2245 * the nominal chain mask for transmit
2246 *
2247 * The chain mask may be modified dynamically, e.g. to operate AP
2248 * tx with a reduced number of chains if no clients are associated.
2249 * This configuration parameter specifies the nominal chain-mask that
2250 * should be used when not operating with a reduced set of tx chains.
2251 */
2252 __le32 tx_chain_mask;
2253
2254 /*
2255 * the nominal chain mask for receive
2256 *
2257 * The chain mask may be modified dynamically, e.g. for a client
2258 * to use a reduced number of chains for receive if the traffic to
2259 * the client is low enough that it doesn't require downlink MIMO
2260 * or antenna diversity.
2261 * This configuration parameter specifies the nominal chain-mask that
2262 * should be used when not operating with a reduced set of rx chains.
2263 */
2264 __le32 rx_chain_mask;
2265
2266 /*
2267 * what rx reorder timeout (ms) to use for the AC
2268 *
2269 * Each WMM access class (voice, video, best-effort, background) will
2270 * have its own timeout value to dictate how long to wait for missing
2271 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2272 * already been received.
2273 * This parameter specifies the timeout in milliseconds for each
2274 * class.
2275 */
2276 __le32 rx_timeout_pri_vi;
2277 __le32 rx_timeout_pri_vo;
2278 __le32 rx_timeout_pri_be;
2279 __le32 rx_timeout_pri_bk;
2280
2281 /*
2282 * what mode the rx should decap packets to
2283 *
2284 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2285 * THis setting also determines the default TX behavior, however TX
2286 * behavior can be modified on a per VAP basis during VAP init
2287 */
2288 __le32 rx_decap_mode;
2289
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002290 /* what is the maximum number of scan requests that can be queued */
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002291 __le32 scan_max_pending_reqs;
2292
2293 /* maximum VDEV that could use BMISS offload */
2294 __le32 bmiss_offload_max_vdev;
2295
2296 /* maximum VDEV that could use offload roaming */
2297 __le32 roam_offload_max_vdev;
2298
2299 /* maximum AP profiles that would push to offload roaming */
2300 __le32 roam_offload_max_ap_profiles;
2301
2302 /*
2303 * how many groups to use for mcast->ucast conversion
2304 *
2305 * The target's WAL maintains a table to hold information regarding
2306 * which peers belong to a given multicast group, so that if
2307 * multicast->unicast conversion is enabled, the target can convert
2308 * multicast tx frames to a series of unicast tx frames, to each
2309 * peer within the multicast group.
2310 This num_mcast_groups configuration parameter tells the target how
2311 * many multicast groups to provide storage for within its multicast
2312 * group membership table.
2313 */
2314 __le32 num_mcast_groups;
2315
2316 /*
2317 * size to alloc for the mcast membership table
2318 *
2319 * This num_mcast_table_elems configuration parameter tells the
2320 * target how many peer elements it needs to provide storage for in
2321 * its multicast group membership table.
2322 * These multicast group membership table elements are shared by the
2323 * multicast groups stored within the table.
2324 */
2325 __le32 num_mcast_table_elems;
2326
2327 /*
2328 * whether/how to do multicast->unicast conversion
2329 *
2330 * This configuration parameter specifies whether the target should
2331 * perform multicast --> unicast conversion on transmit, and if so,
2332 * what to do if it finds no entries in its multicast group
2333 * membership table for the multicast IP address in the tx frame.
2334 * Configuration value:
2335 * 0 -> Do not perform multicast to unicast conversion.
2336 * 1 -> Convert multicast frames to unicast, if the IP multicast
2337 * address from the tx frame is found in the multicast group
2338 * membership table. If the IP multicast address is not found,
2339 * drop the frame.
2340 * 2 -> Convert multicast frames to unicast, if the IP multicast
2341 * address from the tx frame is found in the multicast group
2342 * membership table. If the IP multicast address is not found,
2343 * transmit the frame as multicast.
2344 */
2345 __le32 mcast2ucast_mode;
2346
2347 /*
2348 * how much memory to allocate for a tx PPDU dbg log
2349 *
2350 * This parameter controls how much memory the target will allocate
2351 * to store a log of tx PPDU meta-information (how large the PPDU
2352 * was, when it was sent, whether it was successful, etc.)
2353 */
2354 __le32 tx_dbg_log_size;
2355
2356 /* how many AST entries to be allocated for WDS */
2357 __le32 num_wds_entries;
2358
2359 /*
2360 * MAC DMA burst size, e.g., For target PCI limit can be
2361 * 0 -default, 1 256B
2362 */
2363 __le32 dma_burst_size;
2364
2365 /*
2366 * Fixed delimiters to be inserted after every MPDU to
2367 * account for interface latency to avoid underrun.
2368 */
2369 __le32 mac_aggr_delim;
2370
2371 /*
2372 * determine whether target is responsible for detecting duplicate
2373 * non-aggregate MPDU and timing out stale fragments.
2374 *
2375 * A-MPDU reordering is always performed on the target.
2376 *
2377 * 0: target responsible for frag timeout and dup checking
2378 * 1: host responsible for frag timeout and dup checking
2379 */
2380 __le32 rx_skip_defrag_timeout_dup_detection_check;
2381
2382 /*
2383 * Configuration for VoW :
2384 * No of Video Nodes to be supported
2385 * and Max no of descriptors for each Video link (node).
2386 */
2387 __le32 vow_config;
2388
2389 /* Number of msdu descriptors target should use */
2390 __le32 num_msdu_desc;
2391
2392 /*
2393 * Max. number of Tx fragments per MSDU
2394 * This parameter controls the max number of Tx fragments per MSDU.
2395 * This is sent by the target as part of the WMI_SERVICE_READY event
2396 * and is overriden by the OS shim as required.
2397 */
2398 __le32 max_frag_entries;
2399} __packed;
2400
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002401enum wmi_10_2_feature_mask {
2402 WMI_10_2_RX_BATCH_MODE = BIT(0),
2403 WMI_10_2_ATF_CONFIG = BIT(1),
Yanbo Lide0c7892015-04-15 15:28:08 +03002404 WMI_10_2_COEX_GPIO = BIT(3),
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002405};
2406
Michal Kazior24c88f72014-07-25 13:32:17 +02002407struct wmi_resource_config_10_2 {
2408 struct wmi_resource_config_10x common;
2409 __le32 max_peer_ext_stats;
2410 __le32 smart_ant_cap; /* 0-disable, 1-enable */
2411 __le32 bk_min_free;
2412 __le32 be_min_free;
2413 __le32 vi_min_free;
2414 __le32 vo_min_free;
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002415 __le32 feature_mask;
Michal Kazior24c88f72014-07-25 13:32:17 +02002416} __packed;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002417
Raja Manib0399412015-06-22 20:10:17 +05302418#define NUM_UNITS_IS_NUM_VDEVS BIT(0)
2419#define NUM_UNITS_IS_NUM_PEERS BIT(1)
2420#define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2)
Bartosz Markowskib3effe62013-09-26 17:47:11 +02002421
Raja Manid1e52a82015-06-22 20:10:15 +05302422struct wmi_resource_config_10_4 {
2423 /* Number of virtual devices (VAPs) to support */
2424 __le32 num_vdevs;
2425
2426 /* Number of peer nodes to support */
2427 __le32 num_peers;
2428
2429 /* Number of active peer nodes to support */
2430 __le32 num_active_peers;
2431
2432 /* In offload mode, target supports features like WOW, chatter and other
2433 * protocol offloads. In order to support them some functionalities like
2434 * reorder buffering, PN checking need to be done in target.
2435 * This determines maximum number of peers supported by target in
2436 * offload mode.
2437 */
2438 __le32 num_offload_peers;
2439
2440 /* Number of reorder buffers available for doing target based reorder
2441 * Rx reorder buffering
2442 */
2443 __le32 num_offload_reorder_buffs;
2444
2445 /* Number of keys per peer */
2446 __le32 num_peer_keys;
2447
2448 /* Total number of TX/RX data TIDs */
2449 __le32 num_tids;
2450
2451 /* Max skid for resolving hash collisions.
2452 * The address search table is sparse, so that if two MAC addresses
2453 * result in the same hash value, the second of these conflicting
2454 * entries can slide to the next index in the address search table,
2455 * and use it, if it is unoccupied. This ast_skid_limit parameter
2456 * specifies the upper bound on how many subsequent indices to search
2457 * over to find an unoccupied space.
2458 */
2459 __le32 ast_skid_limit;
2460
2461 /* The nominal chain mask for transmit.
2462 * The chain mask may be modified dynamically, e.g. to operate AP tx
2463 * with a reduced number of chains if no clients are associated.
2464 * This configuration parameter specifies the nominal chain-mask that
2465 * should be used when not operating with a reduced set of tx chains.
2466 */
2467 __le32 tx_chain_mask;
2468
2469 /* The nominal chain mask for receive.
2470 * The chain mask may be modified dynamically, e.g. for a client to use
2471 * a reduced number of chains for receive if the traffic to the client
2472 * is low enough that it doesn't require downlink MIMO or antenna
2473 * diversity. This configuration parameter specifies the nominal
2474 * chain-mask that should be used when not operating with a reduced
2475 * set of rx chains.
2476 */
2477 __le32 rx_chain_mask;
2478
2479 /* What rx reorder timeout (ms) to use for the AC.
2480 * Each WMM access class (voice, video, best-effort, background) will
2481 * have its own timeout value to dictate how long to wait for missing
2482 * rx MPDUs to arrive before flushing subsequent MPDUs that have already
2483 * been received. This parameter specifies the timeout in milliseconds
2484 * for each class.
2485 */
2486 __le32 rx_timeout_pri[4];
2487
2488 /* What mode the rx should decap packets to.
2489 * MAC can decap to RAW (no decap), native wifi or Ethernet types.
2490 * This setting also determines the default TX behavior, however TX
2491 * behavior can be modified on a per VAP basis during VAP init
2492 */
2493 __le32 rx_decap_mode;
2494
2495 __le32 scan_max_pending_req;
2496
2497 __le32 bmiss_offload_max_vdev;
2498
2499 __le32 roam_offload_max_vdev;
2500
2501 __le32 roam_offload_max_ap_profiles;
2502
2503 /* How many groups to use for mcast->ucast conversion.
2504 * The target's WAL maintains a table to hold information regarding
2505 * which peers belong to a given multicast group, so that if
2506 * multicast->unicast conversion is enabled, the target can convert
2507 * multicast tx frames to a series of unicast tx frames, to each peer
2508 * within the multicast group. This num_mcast_groups configuration
2509 * parameter tells the target how many multicast groups to provide
2510 * storage for within its multicast group membership table.
2511 */
2512 __le32 num_mcast_groups;
2513
2514 /* Size to alloc for the mcast membership table.
2515 * This num_mcast_table_elems configuration parameter tells the target
2516 * how many peer elements it needs to provide storage for in its
2517 * multicast group membership table. These multicast group membership
2518 * table elements are shared by the multicast groups stored within
2519 * the table.
2520 */
2521 __le32 num_mcast_table_elems;
2522
2523 /* Whether/how to do multicast->unicast conversion.
2524 * This configuration parameter specifies whether the target should
2525 * perform multicast --> unicast conversion on transmit, and if so,
2526 * what to do if it finds no entries in its multicast group membership
2527 * table for the multicast IP address in the tx frame.
2528 * Configuration value:
2529 * 0 -> Do not perform multicast to unicast conversion.
2530 * 1 -> Convert multicast frames to unicast, if the IP multicast address
2531 * from the tx frame is found in the multicast group membership
2532 * table. If the IP multicast address is not found, drop the frame
2533 * 2 -> Convert multicast frames to unicast, if the IP multicast address
2534 * from the tx frame is found in the multicast group membership
2535 * table. If the IP multicast address is not found, transmit the
2536 * frame as multicast.
2537 */
2538 __le32 mcast2ucast_mode;
2539
2540 /* How much memory to allocate for a tx PPDU dbg log.
2541 * This parameter controls how much memory the target will allocate to
2542 * store a log of tx PPDU meta-information (how large the PPDU was,
2543 * when it was sent, whether it was successful, etc.)
2544 */
2545 __le32 tx_dbg_log_size;
2546
2547 /* How many AST entries to be allocated for WDS */
2548 __le32 num_wds_entries;
2549
2550 /* MAC DMA burst size. 0 -default, 1 -256B */
2551 __le32 dma_burst_size;
2552
2553 /* Fixed delimiters to be inserted after every MPDU to account for
2554 * interface latency to avoid underrun.
2555 */
2556 __le32 mac_aggr_delim;
2557
2558 /* Determine whether target is responsible for detecting duplicate
2559 * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering
2560 * is always performed on the target.
2561 *
2562 * 0: target responsible for frag timeout and dup checking
2563 * 1: host responsible for frag timeout and dup checking
2564 */
2565 __le32 rx_skip_defrag_timeout_dup_detection_check;
2566
2567 /* Configuration for VoW : No of Video nodes to be supported and max
2568 * no of descriptors for each video link (node).
2569 */
2570 __le32 vow_config;
2571
2572 /* Maximum vdev that could use gtk offload */
2573 __le32 gtk_offload_max_vdev;
2574
2575 /* Number of msdu descriptors target should use */
2576 __le32 num_msdu_desc;
2577
2578 /* Max number of tx fragments per MSDU.
2579 * This parameter controls the max number of tx fragments per MSDU.
2580 * This will passed by target as part of the WMI_SERVICE_READY event
2581 * and is overridden by the OS shim as required.
2582 */
2583 __le32 max_frag_entries;
2584
2585 /* Max number of extended peer stats.
2586 * This parameter controls the max number of peers for which extended
2587 * statistics are supported by target
2588 */
2589 __le32 max_peer_ext_stats;
2590
2591 /* Smart antenna capabilities information.
2592 * 1 - Smart antenna is enabled
2593 * 0 - Smart antenna is disabled
2594 * In future this can contain smart antenna specific capabilities.
2595 */
2596 __le32 smart_ant_cap;
2597
2598 /* User can configure the buffers allocated for each AC (BE, BK, VI, VO)
2599 * during init.
2600 */
2601 __le32 bk_minfree;
2602 __le32 be_minfree;
2603 __le32 vi_minfree;
2604 __le32 vo_minfree;
2605
2606 /* Rx batch mode capability.
2607 * 1 - Rx batch mode enabled
2608 * 0 - Rx batch mode disabled
2609 */
2610 __le32 rx_batchmode;
2611
2612 /* Thermal throttling capability.
2613 * 1 - Capable of thermal throttling
2614 * 0 - Not capable of thermal throttling
2615 */
2616 __le32 tt_support;
2617
2618 /* ATF configuration.
2619 * 1 - Enable ATF
2620 * 0 - Disable ATF
2621 */
2622 __le32 atf_config;
2623
2624 /* Configure padding to manage IP header un-alignment
2625 * 1 - Enable padding
2626 * 0 - Disable padding
2627 */
2628 __le32 iphdr_pad_config;
2629
2630 /* qwrap configuration
2631 * 1 - This is qwrap configuration
2632 * 0 - This is not qwrap
2633 */
2634 __le32 qwrap_config;
2635} __packed;
2636
Kalle Valo5e3dd152013-06-12 20:52:10 +03002637/* strucutre describing host memory chunk. */
2638struct host_memory_chunk {
2639 /* id of the request that is passed up in service ready */
2640 __le32 req_id;
2641 /* the physical address the memory chunk */
2642 __le32 ptr;
2643 /* size of the chunk */
2644 __le32 size;
2645} __packed;
2646
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002647struct wmi_host_mem_chunks {
2648 __le32 count;
2649 /* some fw revisions require at least 1 chunk regardless of count */
2650 struct host_memory_chunk items[1];
2651} __packed;
2652
Kalle Valo5e3dd152013-06-12 20:52:10 +03002653struct wmi_init_cmd {
2654 struct wmi_resource_config resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002655 struct wmi_host_mem_chunks mem_chunks;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002656} __packed;
2657
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002658/* _10x stucture is from 10.X FW API */
2659struct wmi_init_cmd_10x {
2660 struct wmi_resource_config_10x resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002661 struct wmi_host_mem_chunks mem_chunks;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002662} __packed;
2663
Michal Kazior24c88f72014-07-25 13:32:17 +02002664struct wmi_init_cmd_10_2 {
2665 struct wmi_resource_config_10_2 resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002666 struct wmi_host_mem_chunks mem_chunks;
Michal Kazior24c88f72014-07-25 13:32:17 +02002667} __packed;
2668
Raja Manid1e52a82015-06-22 20:10:15 +05302669struct wmi_init_cmd_10_4 {
2670 struct wmi_resource_config_10_4 resource_config;
2671 struct wmi_host_mem_chunks mem_chunks;
2672} __packed;
2673
Michal Kazior24c88f72014-07-25 13:32:17 +02002674struct wmi_chan_list_entry {
2675 __le16 freq;
2676 u8 phy_mode; /* valid for 10.2 only */
2677 u8 reserved;
2678} __packed;
2679
Kalle Valo5e3dd152013-06-12 20:52:10 +03002680/* TLV for channel list */
2681struct wmi_chan_list {
2682 __le32 tag; /* WMI_CHAN_LIST_TAG */
2683 __le32 num_chan;
Michal Kazior24c88f72014-07-25 13:32:17 +02002684 struct wmi_chan_list_entry channel_list[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002685} __packed;
2686
2687struct wmi_bssid_list {
2688 __le32 tag; /* WMI_BSSID_LIST_TAG */
2689 __le32 num_bssid;
2690 struct wmi_mac_addr bssid_list[0];
2691} __packed;
2692
2693struct wmi_ie_data {
2694 __le32 tag; /* WMI_IE_TAG */
2695 __le32 ie_len;
2696 u8 ie_data[0];
2697} __packed;
2698
2699struct wmi_ssid {
2700 __le32 ssid_len;
2701 u8 ssid[32];
2702} __packed;
2703
2704struct wmi_ssid_list {
2705 __le32 tag; /* WMI_SSID_LIST_TAG */
2706 __le32 num_ssids;
2707 struct wmi_ssid ssids[0];
2708} __packed;
2709
2710/* prefix used by scan requestor ids on the host */
2711#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
2712
2713/* prefix used by scan request ids generated on the host */
2714/* host cycles through the lower 12 bits to generate ids */
2715#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
2716
2717#define WLAN_SCAN_PARAMS_MAX_SSID 16
2718#define WLAN_SCAN_PARAMS_MAX_BSSID 4
2719#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
2720
Michal Kaziordcca0bd2014-11-24 14:58:32 +01002721/* Values lower than this may be refused by some firmware revisions with a scan
2722 * completion with a timedout reason.
2723 */
2724#define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
2725
Kalle Valo5e3dd152013-06-12 20:52:10 +03002726/* Scan priority numbers must be sequential, starting with 0 */
2727enum wmi_scan_priority {
2728 WMI_SCAN_PRIORITY_VERY_LOW = 0,
2729 WMI_SCAN_PRIORITY_LOW,
2730 WMI_SCAN_PRIORITY_MEDIUM,
2731 WMI_SCAN_PRIORITY_HIGH,
2732 WMI_SCAN_PRIORITY_VERY_HIGH,
2733 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
2734};
2735
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002736struct wmi_start_scan_common {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002737 /* Scan ID */
2738 __le32 scan_id;
2739 /* Scan requestor ID */
2740 __le32 scan_req_id;
2741 /* VDEV id(interface) that is requesting scan */
2742 __le32 vdev_id;
2743 /* Scan Priority, input to scan scheduler */
2744 __le32 scan_priority;
2745 /* Scan events subscription */
2746 __le32 notify_scan_events;
2747 /* dwell time in msec on active channels */
2748 __le32 dwell_time_active;
2749 /* dwell time in msec on passive channels */
2750 __le32 dwell_time_passive;
2751 /*
2752 * min time in msec on the BSS channel,only valid if atleast one
2753 * VDEV is active
2754 */
2755 __le32 min_rest_time;
2756 /*
2757 * max rest time in msec on the BSS channel,only valid if at least
2758 * one VDEV is active
2759 */
2760 /*
2761 * the scanner will rest on the bss channel at least min_rest_time
2762 * after min_rest_time the scanner will start checking for tx/rx
2763 * activity on all VDEVs. if there is no activity the scanner will
2764 * switch to off channel. if there is activity the scanner will let
2765 * the radio on the bss channel until max_rest_time expires.at
2766 * max_rest_time scanner will switch to off channel irrespective of
2767 * activity. activity is determined by the idle_time parameter.
2768 */
2769 __le32 max_rest_time;
2770 /*
2771 * time before sending next set of probe requests.
2772 * The scanner keeps repeating probe requests transmission with
2773 * period specified by repeat_probe_time.
2774 * The number of probe requests specified depends on the ssid_list
2775 * and bssid_list
2776 */
2777 __le32 repeat_probe_time;
2778 /* time in msec between 2 consequetive probe requests with in a set. */
2779 __le32 probe_spacing_time;
2780 /*
2781 * data inactivity time in msec on bss channel that will be used by
2782 * scanner for measuring the inactivity.
2783 */
2784 __le32 idle_time;
2785 /* maximum time in msec allowed for scan */
2786 __le32 max_scan_time;
2787 /*
2788 * delay in msec before sending first probe request after switching
2789 * to a channel
2790 */
2791 __le32 probe_delay;
2792 /* Scan control flags */
2793 __le32 scan_ctrl_flags;
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002794} __packed;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002795
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002796struct wmi_start_scan_tlvs {
2797 /* TLV parameters. These includes channel list, ssid list, bssid list,
2798 * extra ies.
Kalle Valo5e3dd152013-06-12 20:52:10 +03002799 */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002800 u8 tlvs[0];
2801} __packed;
2802
2803struct wmi_start_scan_cmd {
2804 struct wmi_start_scan_common common;
2805 __le32 burst_duration_ms;
2806 struct wmi_start_scan_tlvs tlvs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002807} __packed;
2808
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002809/* This is the definition from 10.X firmware branch */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002810struct wmi_10x_start_scan_cmd {
2811 struct wmi_start_scan_common common;
2812 struct wmi_start_scan_tlvs tlvs;
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002813} __packed;
2814
Kalle Valo5e3dd152013-06-12 20:52:10 +03002815struct wmi_ssid_arg {
2816 int len;
2817 const u8 *ssid;
2818};
2819
2820struct wmi_bssid_arg {
2821 const u8 *bssid;
2822};
2823
2824struct wmi_start_scan_arg {
2825 u32 scan_id;
2826 u32 scan_req_id;
2827 u32 vdev_id;
2828 u32 scan_priority;
2829 u32 notify_scan_events;
2830 u32 dwell_time_active;
2831 u32 dwell_time_passive;
2832 u32 min_rest_time;
2833 u32 max_rest_time;
2834 u32 repeat_probe_time;
2835 u32 probe_spacing_time;
2836 u32 idle_time;
2837 u32 max_scan_time;
2838 u32 probe_delay;
2839 u32 scan_ctrl_flags;
Michal Kaziordbd3f9f2015-03-31 11:03:48 +00002840 u32 burst_duration_ms;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002841
2842 u32 ie_len;
2843 u32 n_channels;
2844 u32 n_ssids;
2845 u32 n_bssids;
2846
2847 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
Michal Kazior24c88f72014-07-25 13:32:17 +02002848 u16 channels[64];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002849 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
2850 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
2851};
2852
2853/* scan control flags */
2854
2855/* passively scan all channels including active channels */
2856#define WMI_SCAN_FLAG_PASSIVE 0x1
2857/* add wild card ssid probe request even though ssid_list is specified. */
2858#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
2859/* add cck rates to rates/xrate ie for the generated probe request */
2860#define WMI_SCAN_ADD_CCK_RATES 0x4
2861/* add ofdm rates to rates/xrate ie for the generated probe request */
2862#define WMI_SCAN_ADD_OFDM_RATES 0x8
2863/* To enable indication of Chan load and Noise floor to host */
2864#define WMI_SCAN_CHAN_STAT_EVENT 0x10
2865/* Filter Probe request frames */
2866#define WMI_SCAN_FILTER_PROBE_REQ 0x20
2867/* When set, DFS channels will not be scanned */
2868#define WMI_SCAN_BYPASS_DFS_CHN 0x40
2869/* Different FW scan engine may choose to bail out on errors.
2870 * Allow the driver to have influence over that. */
2871#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
2872
2873/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
2874#define WMI_SCAN_CLASS_MASK 0xFF000000
2875
Kalle Valo5e3dd152013-06-12 20:52:10 +03002876enum wmi_stop_scan_type {
2877 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
2878 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
2879 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
2880};
2881
2882struct wmi_stop_scan_cmd {
2883 __le32 scan_req_id;
2884 __le32 scan_id;
2885 __le32 req_type;
2886 __le32 vdev_id;
2887} __packed;
2888
2889struct wmi_stop_scan_arg {
2890 u32 req_id;
2891 enum wmi_stop_scan_type req_type;
2892 union {
2893 u32 scan_id;
2894 u32 vdev_id;
2895 } u;
2896};
2897
2898struct wmi_scan_chan_list_cmd {
2899 __le32 num_scan_chans;
2900 struct wmi_channel chan_info[0];
2901} __packed;
2902
2903struct wmi_scan_chan_list_arg {
2904 u32 n_channels;
2905 struct wmi_channel_arg *channels;
2906};
2907
2908enum wmi_bss_filter {
2909 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
2910 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
2911 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
2912 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
2913 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
2914 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
2915 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
2916 WMI_BSS_FILTER_LAST_BSS, /* marker only */
2917};
2918
2919enum wmi_scan_event_type {
Raja Manib2297ba2015-06-22 20:22:23 +05302920 WMI_SCAN_EVENT_STARTED = BIT(0),
2921 WMI_SCAN_EVENT_COMPLETED = BIT(1),
2922 WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2),
2923 WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3),
2924 WMI_SCAN_EVENT_DEQUEUED = BIT(4),
2925 /* possibly by high-prio scan */
2926 WMI_SCAN_EVENT_PREEMPTED = BIT(5),
2927 WMI_SCAN_EVENT_START_FAILED = BIT(6),
2928 WMI_SCAN_EVENT_RESTARTED = BIT(7),
2929 WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
2930 WMI_SCAN_EVENT_MAX = BIT(15),
Kalle Valo5e3dd152013-06-12 20:52:10 +03002931};
2932
2933enum wmi_scan_completion_reason {
2934 WMI_SCAN_REASON_COMPLETED,
2935 WMI_SCAN_REASON_CANCELLED,
2936 WMI_SCAN_REASON_PREEMPTED,
2937 WMI_SCAN_REASON_TIMEDOUT,
Raja Manib2297ba2015-06-22 20:22:23 +05302938 WMI_SCAN_REASON_INTERNAL_FAILURE,
Kalle Valo5e3dd152013-06-12 20:52:10 +03002939 WMI_SCAN_REASON_MAX,
2940};
2941
2942struct wmi_scan_event {
2943 __le32 event_type; /* %WMI_SCAN_EVENT_ */
2944 __le32 reason; /* %WMI_SCAN_REASON_ */
2945 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
2946 __le32 scan_req_id;
2947 __le32 scan_id;
2948 __le32 vdev_id;
2949} __packed;
2950
2951/*
2952 * This defines how much headroom is kept in the
2953 * receive frame between the descriptor and the
2954 * payload, in order for the WMI PHY error and
2955 * management handler to insert header contents.
2956 *
2957 * This is in bytes.
2958 */
2959#define WMI_MGMT_RX_HDR_HEADROOM 52
2960
2961/*
2962 * This event will be used for sending scan results
2963 * as well as rx mgmt frames to the host. The rx buffer
2964 * will be sent as part of this WMI event. It would be a
2965 * good idea to pass all the fields in the RX status
2966 * descriptor up to the host.
2967 */
Michal Kazior0d9b0432013-08-09 10:13:33 +02002968struct wmi_mgmt_rx_hdr_v1 {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002969 __le32 channel;
2970 __le32 snr;
2971 __le32 rate;
2972 __le32 phy_mode;
2973 __le32 buf_len;
2974 __le32 status; /* %WMI_RX_STATUS_ */
2975} __packed;
2976
Michal Kazior0d9b0432013-08-09 10:13:33 +02002977struct wmi_mgmt_rx_hdr_v2 {
2978 struct wmi_mgmt_rx_hdr_v1 v1;
2979 __le32 rssi_ctl[4];
2980} __packed;
2981
2982struct wmi_mgmt_rx_event_v1 {
2983 struct wmi_mgmt_rx_hdr_v1 hdr;
2984 u8 buf[0];
2985} __packed;
2986
2987struct wmi_mgmt_rx_event_v2 {
2988 struct wmi_mgmt_rx_hdr_v2 hdr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002989 u8 buf[0];
2990} __packed;
2991
Raja Mani1c092962015-06-22 20:10:16 +05302992struct wmi_10_4_mgmt_rx_hdr {
2993 __le32 channel;
2994 __le32 snr;
2995 u8 rssi_ctl[4];
2996 __le32 rate;
2997 __le32 phy_mode;
2998 __le32 buf_len;
2999 __le32 status;
3000} __packed;
3001
3002struct wmi_10_4_mgmt_rx_event {
3003 struct wmi_10_4_mgmt_rx_hdr hdr;
3004 u8 buf[0];
3005} __packed;
3006
Kalle Valo5e3dd152013-06-12 20:52:10 +03003007#define WMI_RX_STATUS_OK 0x00
3008#define WMI_RX_STATUS_ERR_CRC 0x01
3009#define WMI_RX_STATUS_ERR_DECRYPT 0x08
3010#define WMI_RX_STATUS_ERR_MIC 0x10
3011#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
3012
Raja Mani991adf72015-08-14 11:13:29 +03003013#define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26
3014#define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24
3015#define PHY_ERROR_GEN_RADAR 0x05
3016
Raja Mani2b0a2e02015-08-14 11:13:34 +03003017#define PHY_ERROR_10_4_RADAR_MASK 0x4
3018#define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000
3019
Raja Mani991adf72015-08-14 11:13:29 +03003020enum phy_err_type {
3021 PHY_ERROR_UNKNOWN,
3022 PHY_ERROR_SPECTRAL_SCAN,
3023 PHY_ERROR_FALSE_RADAR_EXT,
3024 PHY_ERROR_RADAR
3025};
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003026
Michal Kazior2332d0a2014-09-18 15:21:25 +02003027struct wmi_phyerr {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003028 __le32 tsf_timestamp;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003029 __le16 freq1;
3030 __le16 freq2;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003031 u8 rssi_combined;
3032 u8 chan_width_mhz;
3033 u8 phy_err_code;
3034 u8 rsvd0;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003035 __le32 rssi_chains[4];
3036 __le16 nf_chains[4];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003037 __le32 buf_len;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003038 u8 buf[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003039} __packed;
3040
Michal Kazior2332d0a2014-09-18 15:21:25 +02003041struct wmi_phyerr_event {
3042 __le32 num_phyerrs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003043 __le32 tsf_l32;
3044 __le32 tsf_u32;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003045 struct wmi_phyerr phyerrs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003046} __packed;
3047
Raja Mani2b0a2e02015-08-14 11:13:34 +03003048struct wmi_10_4_phyerr_event {
3049 __le32 tsf_l32;
3050 __le32 tsf_u32;
3051 __le16 freq1;
3052 __le16 freq2;
3053 u8 rssi_combined;
3054 u8 chan_width_mhz;
3055 u8 phy_err_code;
3056 u8 rsvd0;
3057 __le32 rssi_chains[4];
3058 __le16 nf_chains[4];
3059 __le32 phy_err_mask[2];
3060 __le32 tsf_timestamp;
3061 __le32 buf_len;
3062 u8 buf[0];
3063} __packed;
3064
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003065#define PHYERR_TLV_SIG 0xBB
3066#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
3067#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
Simon Wunderlich855aed12014-08-02 09:12:54 +03003068#define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003069
3070struct phyerr_radar_report {
3071 __le32 reg0; /* RADAR_REPORT_REG0_* */
3072 __le32 reg1; /* REDAR_REPORT_REG1_* */
3073} __packed;
3074
3075#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
3076#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
3077
3078#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
3079#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
3080
3081#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
3082#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
3083
3084#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
3085#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
3086
3087#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
3088#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
3089
3090#define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
3091#define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
3092
3093#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
3094#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
3095
3096#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
3097#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
3098
3099#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
3100#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
3101
3102#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
3103#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
3104
3105#define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
3106#define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
3107
3108struct phyerr_fft_report {
3109 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
3110 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
3111} __packed;
3112
3113#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
3114#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
3115
3116#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
3117#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
3118
3119#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
3120#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
3121
3122#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
3123#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
3124
3125#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
3126#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
3127
3128#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
3129#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
3130
3131#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
3132#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
3133
3134#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
3135#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
3136
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003137struct phyerr_tlv {
3138 __le16 len;
3139 u8 tag;
3140 u8 sig;
3141} __packed;
3142
3143#define DFS_RSSI_POSSIBLY_FALSE 50
3144#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
3145
Kalle Valo5e3dd152013-06-12 20:52:10 +03003146struct wmi_mgmt_tx_hdr {
3147 __le32 vdev_id;
3148 struct wmi_mac_addr peer_macaddr;
3149 __le32 tx_rate;
3150 __le32 tx_power;
3151 __le32 buf_len;
3152} __packed;
3153
3154struct wmi_mgmt_tx_cmd {
3155 struct wmi_mgmt_tx_hdr hdr;
3156 u8 buf[0];
3157} __packed;
3158
3159struct wmi_echo_event {
3160 __le32 value;
3161} __packed;
3162
3163struct wmi_echo_cmd {
3164 __le32 value;
3165} __packed;
3166
Kalle Valo5e3dd152013-06-12 20:52:10 +03003167struct wmi_pdev_set_regdomain_cmd {
3168 __le32 reg_domain;
3169 __le32 reg_domain_2G;
3170 __le32 reg_domain_5G;
3171 __le32 conformance_test_limit_2G;
3172 __le32 conformance_test_limit_5G;
3173} __packed;
3174
Marek Puzyniak821af6a2014-03-21 17:46:57 +02003175enum wmi_dfs_region {
3176 /* Uninitialized dfs domain */
3177 WMI_UNINIT_DFS_DOMAIN = 0,
3178
3179 /* FCC3 dfs domain */
3180 WMI_FCC_DFS_DOMAIN = 1,
3181
3182 /* ETSI dfs domain */
3183 WMI_ETSI_DFS_DOMAIN = 2,
3184
3185 /*Japan dfs domain */
3186 WMI_MKK4_DFS_DOMAIN = 3,
3187};
3188
3189struct wmi_pdev_set_regdomain_cmd_10x {
3190 __le32 reg_domain;
3191 __le32 reg_domain_2G;
3192 __le32 reg_domain_5G;
3193 __le32 conformance_test_limit_2G;
3194 __le32 conformance_test_limit_5G;
3195
3196 /* dfs domain from wmi_dfs_region */
3197 __le32 dfs_domain;
3198} __packed;
3199
Kalle Valo5e3dd152013-06-12 20:52:10 +03003200/* Command to set/unset chip in quiet mode */
3201struct wmi_pdev_set_quiet_cmd {
3202 /* period in TUs */
3203 __le32 period;
3204
3205 /* duration in TUs */
3206 __le32 duration;
3207
3208 /* offset in TUs */
3209 __le32 next_start;
3210
3211 /* enable/disable */
3212 __le32 enabled;
3213} __packed;
3214
Kalle Valo5e3dd152013-06-12 20:52:10 +03003215/*
3216 * 802.11g protection mode.
3217 */
3218enum ath10k_protmode {
3219 ATH10K_PROT_NONE = 0, /* no protection */
3220 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
3221 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
3222};
3223
Marek Kwaczynskie81bd102014-03-11 12:58:00 +02003224enum wmi_rtscts_profile {
3225 WMI_RTSCTS_FOR_NO_RATESERIES = 0,
3226 WMI_RTSCTS_FOR_SECOND_RATESERIES,
3227 WMI_RTSCTS_ACROSS_SW_RETRIES
3228};
3229
3230#define WMI_RTSCTS_ENABLED 1
3231#define WMI_RTSCTS_SET_MASK 0x0f
3232#define WMI_RTSCTS_SET_LSB 0
3233
3234#define WMI_RTSCTS_PROFILE_MASK 0xf0
3235#define WMI_RTSCTS_PROFILE_LSB 4
3236
Kalle Valo5e3dd152013-06-12 20:52:10 +03003237enum wmi_beacon_gen_mode {
3238 WMI_BEACON_STAGGERED_MODE = 0,
3239 WMI_BEACON_BURST_MODE = 1
3240};
3241
3242enum wmi_csa_event_ies_present_flag {
3243 WMI_CSA_IE_PRESENT = 0x00000001,
3244 WMI_XCSA_IE_PRESENT = 0x00000002,
3245 WMI_WBW_IE_PRESENT = 0x00000004,
3246 WMI_CSWARP_IE_PRESENT = 0x00000008,
3247};
3248
3249/* wmi CSA receive event from beacon frame */
3250struct wmi_csa_event {
3251 __le32 i_fc_dur;
3252 /* Bit 0-15: FC */
3253 /* Bit 16-31: DUR */
3254 struct wmi_mac_addr i_addr1;
3255 struct wmi_mac_addr i_addr2;
3256 __le32 csa_ie[2];
3257 __le32 xcsa_ie[2];
3258 __le32 wb_ie[2];
3259 __le32 cswarp_ie;
3260 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
3261} __packed;
3262
3263/* the definition of different PDEV parameters */
3264#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3265#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3266#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
3267
Bartosz Markowski226a3392013-09-26 17:47:16 +02003268struct wmi_pdev_param_map {
3269 u32 tx_chain_mask;
3270 u32 rx_chain_mask;
3271 u32 txpower_limit2g;
3272 u32 txpower_limit5g;
3273 u32 txpower_scale;
3274 u32 beacon_gen_mode;
3275 u32 beacon_tx_mode;
3276 u32 resmgr_offchan_mode;
3277 u32 protection_mode;
3278 u32 dynamic_bw;
3279 u32 non_agg_sw_retry_th;
3280 u32 agg_sw_retry_th;
3281 u32 sta_kickout_th;
3282 u32 ac_aggrsize_scaling;
3283 u32 ltr_enable;
3284 u32 ltr_ac_latency_be;
3285 u32 ltr_ac_latency_bk;
3286 u32 ltr_ac_latency_vi;
3287 u32 ltr_ac_latency_vo;
3288 u32 ltr_ac_latency_timeout;
3289 u32 ltr_sleep_override;
3290 u32 ltr_rx_override;
3291 u32 ltr_tx_activity_timeout;
3292 u32 l1ss_enable;
3293 u32 dsleep_enable;
3294 u32 pcielp_txbuf_flush;
3295 u32 pcielp_txbuf_watermark;
3296 u32 pcielp_txbuf_tmo_en;
3297 u32 pcielp_txbuf_tmo_value;
3298 u32 pdev_stats_update_period;
3299 u32 vdev_stats_update_period;
3300 u32 peer_stats_update_period;
3301 u32 bcnflt_stats_update_period;
3302 u32 pmf_qos;
3303 u32 arp_ac_override;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003304 u32 dcs;
3305 u32 ani_enable;
3306 u32 ani_poll_period;
3307 u32 ani_listen_period;
3308 u32 ani_ofdm_level;
3309 u32 ani_cck_level;
3310 u32 dyntxchain;
3311 u32 proxy_sta;
3312 u32 idle_ps_config;
3313 u32 power_gating_sleep;
3314 u32 fast_channel_reset;
3315 u32 burst_dur;
3316 u32 burst_enable;
Peter Oha7bd3e92014-12-02 13:07:14 +02003317 u32 cal_period;
Raja Manid86561f2015-06-22 20:10:14 +05303318 u32 aggr_burst;
3319 u32 rx_decap_mode;
3320 u32 smart_antenna_default_antenna;
3321 u32 igmpmld_override;
3322 u32 igmpmld_tid;
3323 u32 antenna_gain;
3324 u32 rx_filter;
3325 u32 set_mcast_to_ucast_tid;
3326 u32 proxy_sta_mode;
3327 u32 set_mcast2ucast_mode;
3328 u32 set_mcast2ucast_buffer;
3329 u32 remove_mcast2ucast_buffer;
3330 u32 peer_sta_ps_statechg_enable;
3331 u32 igmpmld_ac_override;
3332 u32 block_interbss;
3333 u32 set_disable_reset_cmdid;
3334 u32 set_msdu_ttl_cmdid;
3335 u32 set_ppdu_duration_cmdid;
3336 u32 txbf_sound_period_cmdid;
3337 u32 set_promisc_mode_cmdid;
3338 u32 set_burst_mode_cmdid;
3339 u32 en_stats;
3340 u32 mu_group_policy;
3341 u32 noise_detection;
3342 u32 noise_threshold;
3343 u32 dpd_enable;
3344 u32 set_mcast_bcast_echo;
3345 u32 atf_strict_sch;
3346 u32 atf_sched_duration;
3347 u32 ant_plzn;
3348 u32 mgmt_retry_limit;
3349 u32 sensitivity_level;
3350 u32 signed_txpower_2g;
3351 u32 signed_txpower_5g;
3352 u32 enable_per_tid_amsdu;
3353 u32 enable_per_tid_ampdu;
3354 u32 cca_threshold;
3355 u32 rts_fixed_rate;
3356 u32 pdev_reset;
3357 u32 wapi_mbssid_offset;
3358 u32 arp_srcaddr;
3359 u32 arp_dstaddr;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003360};
3361
3362#define WMI_PDEV_PARAM_UNSUPPORTED 0
3363
Kalle Valo5e3dd152013-06-12 20:52:10 +03003364enum wmi_pdev_param {
Ben Greeard0e0a552014-05-14 16:56:14 +03003365 /* TX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003366 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
Ben Greeard0e0a552014-05-14 16:56:14 +03003367 /* RX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003368 WMI_PDEV_PARAM_RX_CHAIN_MASK,
3369 /* TX power limit for 2G Radio */
3370 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
3371 /* TX power limit for 5G Radio */
3372 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
3373 /* TX power scale */
3374 WMI_PDEV_PARAM_TXPOWER_SCALE,
3375 /* Beacon generation mode . 0: host, 1: target */
3376 WMI_PDEV_PARAM_BEACON_GEN_MODE,
3377 /* Beacon generation mode . 0: staggered 1: bursted */
3378 WMI_PDEV_PARAM_BEACON_TX_MODE,
3379 /*
3380 * Resource manager off chan mode .
3381 * 0: turn off off chan mode. 1: turn on offchan mode
3382 */
3383 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3384 /*
3385 * Protection mode:
3386 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3387 */
3388 WMI_PDEV_PARAM_PROTECTION_MODE,
Michal Kaziorc4dd0d02013-11-13 11:05:10 +01003389 /*
3390 * Dynamic bandwidth - 0: disable, 1: enable
3391 *
3392 * When enabled HW rate control tries different bandwidths when
3393 * retransmitting frames.
3394 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003395 WMI_PDEV_PARAM_DYNAMIC_BW,
3396 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3397 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3398 /* aggregrate sw retry threshold. 0-disable*/
3399 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
3400 /* Station kickout threshold (non of consecutive failures).0-disable */
3401 WMI_PDEV_PARAM_STA_KICKOUT_TH,
3402 /* Aggerate size scaling configuration per AC */
3403 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3404 /* LTR enable */
3405 WMI_PDEV_PARAM_LTR_ENABLE,
3406 /* LTR latency for BE, in us */
3407 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
3408 /* LTR latency for BK, in us */
3409 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
3410 /* LTR latency for VI, in us */
3411 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
3412 /* LTR latency for VO, in us */
3413 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
3414 /* LTR AC latency timeout, in ms */
3415 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3416 /* LTR platform latency override, in us */
3417 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3418 /* LTR-RX override, in us */
3419 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
3420 /* Tx activity timeout for LTR, in us */
3421 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3422 /* L1SS state machine enable */
3423 WMI_PDEV_PARAM_L1SS_ENABLE,
3424 /* Deep sleep state machine enable */
3425 WMI_PDEV_PARAM_DSLEEP_ENABLE,
3426 /* RX buffering flush enable */
3427 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3428 /* RX buffering matermark */
3429 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3430 /* RX buffering timeout enable */
3431 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3432 /* RX buffering timeout value */
3433 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3434 /* pdev level stats update period in ms */
3435 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3436 /* vdev level stats update period in ms */
3437 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3438 /* peer level stats update period in ms */
3439 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3440 /* beacon filter status update period */
3441 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3442 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3443 WMI_PDEV_PARAM_PMF_QOS,
3444 /* Access category on which ARP frames are sent */
3445 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
3446 /* DCS configuration */
3447 WMI_PDEV_PARAM_DCS,
3448 /* Enable/Disable ANI on target */
3449 WMI_PDEV_PARAM_ANI_ENABLE,
3450 /* configure the ANI polling period */
3451 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
3452 /* configure the ANI listening period */
3453 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
3454 /* configure OFDM immunity level */
3455 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
3456 /* configure CCK immunity level */
3457 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
3458 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3459 WMI_PDEV_PARAM_DYNTXCHAIN,
3460 /* Enable/Disable proxy STA */
3461 WMI_PDEV_PARAM_PROXY_STA,
3462 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
3463 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
3464 /* Enable/Disable power gating sleep */
3465 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
3466};
3467
Bartosz Markowski226a3392013-09-26 17:47:16 +02003468enum wmi_10x_pdev_param {
3469 /* TX chian mask */
3470 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3471 /* RX chian mask */
3472 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
3473 /* TX power limit for 2G Radio */
3474 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
3475 /* TX power limit for 5G Radio */
3476 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
3477 /* TX power scale */
3478 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
3479 /* Beacon generation mode . 0: host, 1: target */
3480 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
3481 /* Beacon generation mode . 0: staggered 1: bursted */
3482 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
3483 /*
3484 * Resource manager off chan mode .
3485 * 0: turn off off chan mode. 1: turn on offchan mode
3486 */
3487 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3488 /*
3489 * Protection mode:
3490 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3491 */
3492 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
3493 /* Dynamic bandwidth 0: disable 1: enable */
3494 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
3495 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3496 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3497 /* aggregrate sw retry threshold. 0-disable*/
3498 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
3499 /* Station kickout threshold (non of consecutive failures).0-disable */
3500 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
3501 /* Aggerate size scaling configuration per AC */
3502 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3503 /* LTR enable */
3504 WMI_10X_PDEV_PARAM_LTR_ENABLE,
3505 /* LTR latency for BE, in us */
3506 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
3507 /* LTR latency for BK, in us */
3508 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
3509 /* LTR latency for VI, in us */
3510 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
3511 /* LTR latency for VO, in us */
3512 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
3513 /* LTR AC latency timeout, in ms */
3514 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3515 /* LTR platform latency override, in us */
3516 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3517 /* LTR-RX override, in us */
3518 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
3519 /* Tx activity timeout for LTR, in us */
3520 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3521 /* L1SS state machine enable */
3522 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
3523 /* Deep sleep state machine enable */
3524 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
3525 /* pdev level stats update period in ms */
3526 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3527 /* vdev level stats update period in ms */
3528 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3529 /* peer level stats update period in ms */
3530 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3531 /* beacon filter status update period */
3532 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3533 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3534 WMI_10X_PDEV_PARAM_PMF_QOS,
3535 /* Access category on which ARP and DHCP frames are sent */
3536 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
3537 /* DCS configuration */
3538 WMI_10X_PDEV_PARAM_DCS,
3539 /* Enable/Disable ANI on target */
3540 WMI_10X_PDEV_PARAM_ANI_ENABLE,
3541 /* configure the ANI polling period */
3542 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
3543 /* configure the ANI listening period */
3544 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
3545 /* configure OFDM immunity level */
3546 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
3547 /* configure CCK immunity level */
3548 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
3549 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3550 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
3551 /* Enable/Disable Fast channel reset*/
3552 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
3553 /* Set Bursting DUR */
3554 WMI_10X_PDEV_PARAM_BURST_DUR,
3555 /* Set Bursting Enable*/
3556 WMI_10X_PDEV_PARAM_BURST_ENABLE,
Michal Kazior24c88f72014-07-25 13:32:17 +02003557
3558 /* following are available as of firmware 10.2 */
3559 WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3560 WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
3561 WMI_10X_PDEV_PARAM_IGMPMLD_TID,
3562 WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
3563 WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
3564 WMI_10X_PDEV_PARAM_RX_FILTER,
3565 WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
3566 WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
3567 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3568 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3569 WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
Peter Ohb43bf972014-12-02 13:06:53 +02003570 WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
3571 WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
3572 WMI_10X_PDEV_PARAM_CAL_PERIOD
Bartosz Markowski226a3392013-09-26 17:47:16 +02003573};
3574
Raja Manid86561f2015-06-22 20:10:14 +05303575enum wmi_10_4_pdev_param {
3576 WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3577 WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK,
3578 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G,
3579 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G,
3580 WMI_10_4_PDEV_PARAM_TXPOWER_SCALE,
3581 WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE,
3582 WMI_10_4_PDEV_PARAM_BEACON_TX_MODE,
3583 WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3584 WMI_10_4_PDEV_PARAM_PROTECTION_MODE,
3585 WMI_10_4_PDEV_PARAM_DYNAMIC_BW,
3586 WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3587 WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH,
3588 WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH,
3589 WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3590 WMI_10_4_PDEV_PARAM_LTR_ENABLE,
3591 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE,
3592 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK,
3593 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI,
3594 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO,
3595 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3596 WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3597 WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE,
3598 WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3599 WMI_10_4_PDEV_PARAM_L1SS_ENABLE,
3600 WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE,
3601 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3602 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3603 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3604 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3605 WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3606 WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3607 WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3608 WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3609 WMI_10_4_PDEV_PARAM_PMF_QOS,
3610 WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE,
3611 WMI_10_4_PDEV_PARAM_DCS,
3612 WMI_10_4_PDEV_PARAM_ANI_ENABLE,
3613 WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD,
3614 WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD,
3615 WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL,
3616 WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL,
3617 WMI_10_4_PDEV_PARAM_DYNTXCHAIN,
3618 WMI_10_4_PDEV_PARAM_PROXY_STA,
3619 WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG,
3620 WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP,
3621 WMI_10_4_PDEV_PARAM_AGGR_BURST,
3622 WMI_10_4_PDEV_PARAM_RX_DECAP_MODE,
3623 WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET,
3624 WMI_10_4_PDEV_PARAM_BURST_DUR,
3625 WMI_10_4_PDEV_PARAM_BURST_ENABLE,
3626 WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3627 WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE,
3628 WMI_10_4_PDEV_PARAM_IGMPMLD_TID,
3629 WMI_10_4_PDEV_PARAM_ANTENNA_GAIN,
3630 WMI_10_4_PDEV_PARAM_RX_FILTER,
3631 WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID,
3632 WMI_10_4_PDEV_PARAM_PROXY_STA_MODE,
3633 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3634 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3635 WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
3636 WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE,
3637 WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE,
3638 WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS,
3639 WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID,
3640 WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID,
3641 WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID,
3642 WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID,
3643 WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
3644 WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID,
3645 WMI_10_4_PDEV_PARAM_EN_STATS,
3646 WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY,
3647 WMI_10_4_PDEV_PARAM_NOISE_DETECTION,
3648 WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD,
3649 WMI_10_4_PDEV_PARAM_DPD_ENABLE,
3650 WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO,
3651 WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH,
3652 WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION,
3653 WMI_10_4_PDEV_PARAM_ANT_PLZN,
3654 WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT,
3655 WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL,
3656 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G,
3657 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G,
3658 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU,
3659 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU,
3660 WMI_10_4_PDEV_PARAM_CCA_THRESHOLD,
3661 WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE,
3662 WMI_10_4_PDEV_PARAM_CAL_PERIOD,
3663 WMI_10_4_PDEV_PARAM_PDEV_RESET,
3664 WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET,
3665 WMI_10_4_PDEV_PARAM_ARP_SRCADDR,
3666 WMI_10_4_PDEV_PARAM_ARP_DSTADDR,
3667};
3668
Kalle Valo5e3dd152013-06-12 20:52:10 +03003669struct wmi_pdev_set_param_cmd {
3670 __le32 param_id;
3671 __le32 param_value;
3672} __packed;
3673
Peter Oha7bd3e92014-12-02 13:07:14 +02003674/* valid period is 1 ~ 60000ms, unit in millisecond */
3675#define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
3676
Kalle Valo5e3dd152013-06-12 20:52:10 +03003677struct wmi_pdev_get_tpc_config_cmd {
3678 /* parameter */
3679 __le32 param;
3680} __packed;
3681
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03003682#define WMI_TPC_CONFIG_PARAM 1
Kalle Valo5e3dd152013-06-12 20:52:10 +03003683#define WMI_TPC_RATE_MAX 160
3684#define WMI_TPC_TX_N_CHAIN 4
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03003685#define WMI_TPC_PREAM_TABLE_MAX 10
3686#define WMI_TPC_FLAG 3
3687#define WMI_TPC_BUF_SIZE 10
3688
3689enum wmi_tpc_table_type {
3690 WMI_TPC_TABLE_TYPE_CDD = 0,
3691 WMI_TPC_TABLE_TYPE_STBC = 1,
3692 WMI_TPC_TABLE_TYPE_TXBF = 2,
3693};
Kalle Valo5e3dd152013-06-12 20:52:10 +03003694
3695enum wmi_tpc_config_event_flag {
3696 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
3697 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
3698 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
3699};
3700
3701struct wmi_pdev_tpc_config_event {
3702 __le32 reg_domain;
3703 __le32 chan_freq;
3704 __le32 phy_mode;
3705 __le32 twice_antenna_reduction;
3706 __le32 twice_max_rd_power;
Kalle Valo3b8fc902015-10-05 17:56:37 +03003707 a_sle32 twice_antenna_gain;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003708 __le32 power_limit;
3709 __le32 rate_max;
3710 __le32 num_tx_chain;
3711 __le32 ctl;
3712 __le32 flags;
3713 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
3714 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3715 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3716 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3717 u8 rates_array[WMI_TPC_RATE_MAX];
3718} __packed;
3719
3720/* Transmit power scale factor. */
3721enum wmi_tp_scale {
3722 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
3723 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
3724 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
3725 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
3726 WMI_TP_SCALE_MIN = 4, /* min, but still on */
3727 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
3728};
3729
Kalle Valo5e3dd152013-06-12 20:52:10 +03003730struct wmi_pdev_chanlist_update_event {
3731 /* number of channels */
3732 __le32 num_chan;
3733 /* array of channels */
3734 struct wmi_channel channel_list[1];
3735} __packed;
3736
3737#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
3738
3739struct wmi_debug_mesg_event {
3740 /* message buffer, NULL terminated */
3741 char bufp[WMI_MAX_DEBUG_MESG];
3742} __packed;
3743
3744enum {
3745 /* P2P device */
3746 VDEV_SUBTYPE_P2PDEV = 0,
3747 /* P2P client */
3748 VDEV_SUBTYPE_P2PCLI,
3749 /* P2P GO */
3750 VDEV_SUBTYPE_P2PGO,
3751 /* BT3.0 HS */
3752 VDEV_SUBTYPE_BT,
3753};
3754
3755struct wmi_pdev_set_channel_cmd {
3756 /* idnore power , only use flags , mode and freq */
3757 struct wmi_channel chan;
3758} __packed;
3759
Rajkumar Manoharan90174452014-10-03 08:02:33 +03003760struct wmi_pdev_pktlog_enable_cmd {
3761 __le32 ev_bitmap;
3762} __packed;
3763
Kalle Valo5e3dd152013-06-12 20:52:10 +03003764/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
3765#define WMI_DSCP_MAP_MAX (64)
3766struct wmi_pdev_set_dscp_tid_map_cmd {
3767 /* map indicating DSCP to TID conversion */
3768 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
3769} __packed;
3770
3771enum mcast_bcast_rate_id {
3772 WMI_SET_MCAST_RATE,
3773 WMI_SET_BCAST_RATE
3774};
3775
3776struct mcast_bcast_rate {
3777 enum mcast_bcast_rate_id rate_id;
3778 __le32 rate;
3779} __packed;
3780
3781struct wmi_wmm_params {
3782 __le32 cwmin;
3783 __le32 cwmax;
3784 __le32 aifs;
3785 __le32 txop;
3786 __le32 acm;
3787 __le32 no_ack;
3788} __packed;
3789
3790struct wmi_pdev_set_wmm_params {
3791 struct wmi_wmm_params ac_be;
3792 struct wmi_wmm_params ac_bk;
3793 struct wmi_wmm_params ac_vi;
3794 struct wmi_wmm_params ac_vo;
3795} __packed;
3796
3797struct wmi_wmm_params_arg {
3798 u32 cwmin;
3799 u32 cwmax;
3800 u32 aifs;
3801 u32 txop;
3802 u32 acm;
3803 u32 no_ack;
3804};
3805
Michal Kazior5e752e42015-01-19 09:53:41 +01003806struct wmi_wmm_params_all_arg {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003807 struct wmi_wmm_params_arg ac_be;
3808 struct wmi_wmm_params_arg ac_bk;
3809 struct wmi_wmm_params_arg ac_vi;
3810 struct wmi_wmm_params_arg ac_vo;
3811};
3812
Michal Kaziorb91251f2015-01-24 12:14:49 +02003813struct wmi_pdev_stats_tx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003814 /* Num HTT cookies queued to dispatch list */
3815 __le32 comp_queued;
3816
3817 /* Num HTT cookies dispatched */
3818 __le32 comp_delivered;
3819
3820 /* Num MSDU queued to WAL */
3821 __le32 msdu_enqued;
3822
3823 /* Num MPDU queue to WAL */
3824 __le32 mpdu_enqued;
3825
3826 /* Num MSDUs dropped by WMM limit */
3827 __le32 wmm_drop;
3828
3829 /* Num Local frames queued */
3830 __le32 local_enqued;
3831
3832 /* Num Local frames done */
3833 __le32 local_freed;
3834
3835 /* Num queued to HW */
3836 __le32 hw_queued;
3837
3838 /* Num PPDU reaped from HW */
3839 __le32 hw_reaped;
3840
3841 /* Num underruns */
3842 __le32 underrun;
3843
3844 /* Num PPDUs cleaned up in TX abort */
3845 __le32 tx_abort;
3846
3847 /* Num MPDUs requed by SW */
3848 __le32 mpdus_requed;
3849
3850 /* excessive retries */
3851 __le32 tx_ko;
3852
3853 /* data hw rate code */
3854 __le32 data_rc;
3855
3856 /* Scheduler self triggers */
3857 __le32 self_triggers;
3858
3859 /* frames dropped due to excessive sw retries */
3860 __le32 sw_retry_failure;
3861
3862 /* illegal rate phy errors */
3863 __le32 illgl_rate_phy_err;
3864
3865 /* wal pdev continous xretry */
3866 __le32 pdev_cont_xretry;
3867
3868 /* wal pdev continous xretry */
3869 __le32 pdev_tx_timeout;
3870
3871 /* wal pdev resets */
3872 __le32 pdev_resets;
3873
Bartosz Markowski34d714e2014-03-28 14:35:16 +02003874 /* frames dropped due to non-availability of stateless TIDs */
3875 __le32 stateless_tid_alloc_failure;
3876
Kalle Valo5e3dd152013-06-12 20:52:10 +03003877 __le32 phy_underrun;
3878
3879 /* MPDU is more than txop limit */
3880 __le32 txop_ovf;
3881} __packed;
3882
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02003883struct wmi_10_4_pdev_stats_tx {
3884 /* Num HTT cookies queued to dispatch list */
3885 __le32 comp_queued;
3886
3887 /* Num HTT cookies dispatched */
3888 __le32 comp_delivered;
3889
3890 /* Num MSDU queued to WAL */
3891 __le32 msdu_enqued;
3892
3893 /* Num MPDU queue to WAL */
3894 __le32 mpdu_enqued;
3895
3896 /* Num MSDUs dropped by WMM limit */
3897 __le32 wmm_drop;
3898
3899 /* Num Local frames queued */
3900 __le32 local_enqued;
3901
3902 /* Num Local frames done */
3903 __le32 local_freed;
3904
3905 /* Num queued to HW */
3906 __le32 hw_queued;
3907
3908 /* Num PPDU reaped from HW */
3909 __le32 hw_reaped;
3910
3911 /* Num underruns */
3912 __le32 underrun;
3913
3914 /* HW Paused. */
3915 __le32 hw_paused;
3916
3917 /* Num PPDUs cleaned up in TX abort */
3918 __le32 tx_abort;
3919
3920 /* Num MPDUs requed by SW */
3921 __le32 mpdus_requed;
3922
3923 /* excessive retries */
3924 __le32 tx_ko;
3925
3926 /* data hw rate code */
3927 __le32 data_rc;
3928
3929 /* Scheduler self triggers */
3930 __le32 self_triggers;
3931
3932 /* frames dropped due to excessive sw retries */
3933 __le32 sw_retry_failure;
3934
3935 /* illegal rate phy errors */
3936 __le32 illgl_rate_phy_err;
3937
3938 /* wal pdev continuous xretry */
3939 __le32 pdev_cont_xretry;
3940
3941 /* wal pdev tx timeouts */
3942 __le32 pdev_tx_timeout;
3943
3944 /* wal pdev resets */
3945 __le32 pdev_resets;
3946
3947 /* frames dropped due to non-availability of stateless TIDs */
3948 __le32 stateless_tid_alloc_failure;
3949
3950 __le32 phy_underrun;
3951
3952 /* MPDU is more than txop limit */
3953 __le32 txop_ovf;
3954
3955 /* Number of Sequences posted */
3956 __le32 seq_posted;
3957
3958 /* Number of Sequences failed queueing */
3959 __le32 seq_failed_queueing;
3960
3961 /* Number of Sequences completed */
3962 __le32 seq_completed;
3963
3964 /* Number of Sequences restarted */
3965 __le32 seq_restarted;
3966
3967 /* Number of MU Sequences posted */
3968 __le32 mu_seq_posted;
3969
3970 /* Num MPDUs flushed by SW, HWPAUSED,SW TXABORT(Reset,channel change) */
3971 __le32 mpdus_sw_flush;
3972
3973 /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
3974 __le32 mpdus_hw_filter;
3975
3976 /* Num MPDUs truncated by PDG
3977 * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
3978 */
3979 __le32 mpdus_truncated;
3980
3981 /* Num MPDUs that was tried but didn't receive ACK or BA */
3982 __le32 mpdus_ack_failed;
3983
3984 /* Num MPDUs that was dropped due to expiry. */
3985 __le32 mpdus_expired;
3986} __packed;
3987
Michal Kaziorb91251f2015-01-24 12:14:49 +02003988struct wmi_pdev_stats_rx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003989 /* Cnts any change in ring routing mid-ppdu */
3990 __le32 mid_ppdu_route_change;
3991
3992 /* Total number of statuses processed */
3993 __le32 status_rcvd;
3994
3995 /* Extra frags on rings 0-3 */
3996 __le32 r0_frags;
3997 __le32 r1_frags;
3998 __le32 r2_frags;
3999 __le32 r3_frags;
4000
4001 /* MSDUs / MPDUs delivered to HTT */
4002 __le32 htt_msdus;
4003 __le32 htt_mpdus;
4004
4005 /* MSDUs / MPDUs delivered to local stack */
4006 __le32 loc_msdus;
4007 __le32 loc_mpdus;
4008
4009 /* AMSDUs that have more MSDUs than the status ring size */
4010 __le32 oversize_amsdu;
4011
4012 /* Number of PHY errors */
4013 __le32 phy_errs;
4014
4015 /* Number of PHY errors drops */
4016 __le32 phy_err_drop;
4017
4018 /* Number of mpdu errors - FCS, MIC, ENC etc. */
4019 __le32 mpdu_errs;
4020} __packed;
4021
Michal Kaziorb91251f2015-01-24 12:14:49 +02004022struct wmi_pdev_stats_peer {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004023 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4024 __le32 dummy;
4025} __packed;
4026
Kalle Valo5e3dd152013-06-12 20:52:10 +03004027enum wmi_stats_id {
Michal Kazioreed55412015-02-15 16:50:41 +02004028 WMI_STAT_PEER = BIT(0),
4029 WMI_STAT_AP = BIT(1),
4030 WMI_STAT_PDEV = BIT(2),
4031 WMI_STAT_VDEV = BIT(3),
4032 WMI_STAT_BCNFLT = BIT(4),
4033 WMI_STAT_VDEV_RATE = BIT(5),
Kalle Valo5e3dd152013-06-12 20:52:10 +03004034};
4035
Ben Greeardb9cdda2014-03-28 14:35:15 +02004036struct wlan_inst_rssi_args {
4037 __le16 cfg_retry_count;
4038 __le16 retry_count;
4039};
4040
Kalle Valo5e3dd152013-06-12 20:52:10 +03004041struct wmi_request_stats_cmd {
4042 __le32 stats_id;
4043
Ben Greeardb9cdda2014-03-28 14:35:15 +02004044 __le32 vdev_id;
4045
4046 /* peer MAC address */
4047 struct wmi_mac_addr peer_macaddr;
4048
4049 /* Instantaneous RSSI arguments */
4050 struct wlan_inst_rssi_args inst_rssi_args;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004051} __packed;
4052
4053/* Suspend option */
4054enum {
4055 /* suspend */
4056 WMI_PDEV_SUSPEND,
4057
4058 /* suspend and disable all interrupts */
4059 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
4060};
4061
4062struct wmi_pdev_suspend_cmd {
4063 /* suspend option sent to target */
4064 __le32 suspend_opt;
4065} __packed;
4066
4067struct wmi_stats_event {
Michal Kazioreed55412015-02-15 16:50:41 +02004068 __le32 stats_id; /* WMI_STAT_ */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004069 /*
4070 * number of pdev stats event structures
4071 * (wmi_pdev_stats) 0 or 1
4072 */
4073 __le32 num_pdev_stats;
4074 /*
4075 * number of vdev stats event structures
4076 * (wmi_vdev_stats) 0 or max vdevs
4077 */
4078 __le32 num_vdev_stats;
4079 /*
4080 * number of peer stats event structures
4081 * (wmi_peer_stats) 0 or max peers
4082 */
4083 __le32 num_peer_stats;
4084 __le32 num_bcnflt_stats;
4085 /*
4086 * followed by
4087 * num_pdev_stats * size of(struct wmi_pdev_stats)
4088 * num_vdev_stats * size of(struct wmi_vdev_stats)
4089 * num_peer_stats * size of(struct wmi_peer_stats)
4090 *
4091 * By having a zero sized array, the pointer to data area
4092 * becomes available without increasing the struct size
4093 */
4094 u8 data[0];
4095} __packed;
4096
Michal Kazior20de2222015-01-24 12:14:49 +02004097struct wmi_10_2_stats_event {
4098 __le32 stats_id; /* %WMI_REQUEST_ */
4099 __le32 num_pdev_stats;
4100 __le32 num_pdev_ext_stats;
4101 __le32 num_vdev_stats;
4102 __le32 num_peer_stats;
4103 __le32 num_bcnflt_stats;
4104 u8 data[0];
4105} __packed;
4106
Kalle Valo5e3dd152013-06-12 20:52:10 +03004107/*
4108 * PDEV statistics
4109 * TODO: add all PDEV stats here
4110 */
Michal Kaziorb91251f2015-01-24 12:14:49 +02004111struct wmi_pdev_stats_base {
4112 __le32 chan_nf;
4113 __le32 tx_frame_count;
4114 __le32 rx_frame_count;
4115 __le32 rx_clear_count;
4116 __le32 cycle_count;
4117 __le32 phy_err_count;
4118 __le32 chan_tx_pwr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004119} __packed;
4120
Michal Kaziorb91251f2015-01-24 12:14:49 +02004121struct wmi_pdev_stats {
4122 struct wmi_pdev_stats_base base;
4123 struct wmi_pdev_stats_tx tx;
4124 struct wmi_pdev_stats_rx rx;
4125 struct wmi_pdev_stats_peer peer;
4126} __packed;
4127
4128struct wmi_pdev_stats_extra {
Chun-Yeow Yeoh52e346d2014-03-28 14:35:16 +02004129 __le32 ack_rx_bad;
4130 __le32 rts_bad;
4131 __le32 rts_good;
4132 __le32 fcs_bad;
4133 __le32 no_beacons;
4134 __le32 mib_int_count;
4135} __packed;
4136
Michal Kaziorb91251f2015-01-24 12:14:49 +02004137struct wmi_10x_pdev_stats {
4138 struct wmi_pdev_stats_base base;
4139 struct wmi_pdev_stats_tx tx;
4140 struct wmi_pdev_stats_rx rx;
4141 struct wmi_pdev_stats_peer peer;
4142 struct wmi_pdev_stats_extra extra;
4143} __packed;
4144
Michal Kazior20de2222015-01-24 12:14:49 +02004145struct wmi_pdev_stats_mem {
4146 __le32 dram_free;
4147 __le32 iram_free;
4148} __packed;
4149
4150struct wmi_10_2_pdev_stats {
4151 struct wmi_pdev_stats_base base;
4152 struct wmi_pdev_stats_tx tx;
4153 __le32 mc_drop;
4154 struct wmi_pdev_stats_rx rx;
4155 __le32 pdev_rx_timeout;
4156 struct wmi_pdev_stats_mem mem;
4157 struct wmi_pdev_stats_peer peer;
4158 struct wmi_pdev_stats_extra extra;
4159} __packed;
4160
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004161struct wmi_10_4_pdev_stats {
4162 struct wmi_pdev_stats_base base;
4163 struct wmi_10_4_pdev_stats_tx tx;
4164 struct wmi_pdev_stats_rx rx;
4165 __le32 rx_ovfl_errs;
4166 struct wmi_pdev_stats_mem mem;
4167 __le32 sram_free_size;
4168 struct wmi_pdev_stats_extra extra;
4169} __packed;
4170
Kalle Valo5e3dd152013-06-12 20:52:10 +03004171/*
4172 * VDEV statistics
4173 * TODO: add all VDEV stats here
4174 */
4175struct wmi_vdev_stats {
4176 __le32 vdev_id;
4177} __packed;
4178
4179/*
4180 * peer statistics.
4181 * TODO: add more stats
4182 */
Michal Kaziord15fb522014-09-25 12:33:47 +02004183struct wmi_peer_stats {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004184 struct wmi_mac_addr peer_macaddr;
4185 __le32 peer_rssi;
4186 __le32 peer_tx_rate;
4187} __packed;
4188
Michal Kaziord15fb522014-09-25 12:33:47 +02004189struct wmi_10x_peer_stats {
4190 struct wmi_peer_stats old;
Ben Greear23c3aae2014-03-28 14:35:15 +02004191 __le32 peer_rx_rate;
4192} __packed;
4193
Michal Kazior20de2222015-01-24 12:14:49 +02004194struct wmi_10_2_peer_stats {
4195 struct wmi_peer_stats old;
4196 __le32 peer_rx_rate;
4197 __le32 current_per;
4198 __le32 retries;
4199 __le32 tx_rate_count;
4200 __le32 max_4ms_frame_len;
4201 __le32 total_sub_frames;
4202 __le32 tx_bytes;
4203 __le32 num_pkt_loss_overflow[4];
4204 __le32 num_pkt_loss_excess_retry[4];
4205} __packed;
4206
4207struct wmi_10_2_4_peer_stats {
4208 struct wmi_10_2_peer_stats common;
4209 __le32 unknown_value; /* FIXME: what is this word? */
4210} __packed;
4211
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004212struct wmi_10_4_peer_stats {
4213 struct wmi_mac_addr peer_macaddr;
4214 __le32 peer_rssi;
4215 __le32 peer_rssi_seq_num;
4216 __le32 peer_tx_rate;
4217 __le32 peer_rx_rate;
4218 __le32 current_per;
4219 __le32 retries;
4220 __le32 tx_rate_count;
4221 __le32 max_4ms_frame_len;
4222 __le32 total_sub_frames;
4223 __le32 tx_bytes;
4224 __le32 num_pkt_loss_overflow[4];
4225 __le32 num_pkt_loss_excess_retry[4];
4226 __le32 peer_rssi_changed;
4227} __packed;
4228
Michal Kazior20de2222015-01-24 12:14:49 +02004229struct wmi_10_2_pdev_ext_stats {
4230 __le32 rx_rssi_comb;
4231 __le32 rx_rssi[4];
4232 __le32 rx_mcs[10];
4233 __le32 tx_mcs[10];
4234 __le32 ack_rssi;
4235} __packed;
4236
Kalle Valo5e3dd152013-06-12 20:52:10 +03004237struct wmi_vdev_create_cmd {
4238 __le32 vdev_id;
4239 __le32 vdev_type;
4240 __le32 vdev_subtype;
4241 struct wmi_mac_addr vdev_macaddr;
4242} __packed;
4243
4244enum wmi_vdev_type {
4245 WMI_VDEV_TYPE_AP = 1,
4246 WMI_VDEV_TYPE_STA = 2,
4247 WMI_VDEV_TYPE_IBSS = 3,
4248 WMI_VDEV_TYPE_MONITOR = 4,
4249};
4250
4251enum wmi_vdev_subtype {
4252 WMI_VDEV_SUBTYPE_NONE = 0,
4253 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
4254 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
4255 WMI_VDEV_SUBTYPE_P2P_GO = 3,
4256};
4257
4258/* values for vdev_subtype */
4259
4260/* values for vdev_start_request flags */
4261/*
4262 * Indicates that AP VDEV uses hidden ssid. only valid for
4263 * AP/GO */
4264#define WMI_VDEV_START_HIDDEN_SSID (1<<0)
4265/*
4266 * Indicates if robust management frame/management frame
4267 * protection is enabled. For GO/AP vdevs, it indicates that
4268 * it may support station/client associations with RMF enabled.
4269 * For STA/client vdevs, it indicates that sta will
4270 * associate with AP with RMF enabled. */
4271#define WMI_VDEV_START_PMF_ENABLED (1<<1)
4272
4273struct wmi_p2p_noa_descriptor {
4274 __le32 type_count; /* 255: continuous schedule, 0: reserved */
4275 __le32 duration; /* Absent period duration in micro seconds */
4276 __le32 interval; /* Absent period interval in micro seconds */
4277 __le32 start_time; /* 32 bit tsf time when in starts */
4278} __packed;
4279
4280struct wmi_vdev_start_request_cmd {
4281 /* WMI channel */
4282 struct wmi_channel chan;
4283 /* unique id identifying the VDEV, generated by the caller */
4284 __le32 vdev_id;
4285 /* requestor id identifying the caller module */
4286 __le32 requestor_id;
4287 /* beacon interval from received beacon */
4288 __le32 beacon_interval;
4289 /* DTIM Period from the received beacon */
4290 __le32 dtim_period;
4291 /* Flags */
4292 __le32 flags;
4293 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
4294 struct wmi_ssid ssid;
4295 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
4296 __le32 bcn_tx_rate;
4297 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
4298 __le32 bcn_tx_power;
4299 /* number of p2p NOA descriptor(s) from scan entry */
4300 __le32 num_noa_descriptors;
4301 /*
4302 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
4303 * During CAC, Our HW shouldn't ack ditected frames
4304 */
4305 __le32 disable_hw_ack;
4306 /* actual p2p NOA descriptor from scan entry */
4307 struct wmi_p2p_noa_descriptor noa_descriptors[2];
4308} __packed;
4309
4310struct wmi_vdev_restart_request_cmd {
4311 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
4312} __packed;
4313
4314struct wmi_vdev_start_request_arg {
4315 u32 vdev_id;
4316 struct wmi_channel_arg channel;
4317 u32 bcn_intval;
4318 u32 dtim_period;
4319 u8 *ssid;
4320 u32 ssid_len;
4321 u32 bcn_tx_rate;
4322 u32 bcn_tx_power;
4323 bool disable_hw_ack;
4324 bool hidden_ssid;
4325 bool pmf_enabled;
4326};
4327
4328struct wmi_vdev_delete_cmd {
4329 /* unique id identifying the VDEV, generated by the caller */
4330 __le32 vdev_id;
4331} __packed;
4332
4333struct wmi_vdev_up_cmd {
4334 __le32 vdev_id;
4335 __le32 vdev_assoc_id;
4336 struct wmi_mac_addr vdev_bssid;
4337} __packed;
4338
4339struct wmi_vdev_stop_cmd {
4340 __le32 vdev_id;
4341} __packed;
4342
4343struct wmi_vdev_down_cmd {
4344 __le32 vdev_id;
4345} __packed;
4346
4347struct wmi_vdev_standby_response_cmd {
4348 /* unique id identifying the VDEV, generated by the caller */
4349 __le32 vdev_id;
4350} __packed;
4351
4352struct wmi_vdev_resume_response_cmd {
4353 /* unique id identifying the VDEV, generated by the caller */
4354 __le32 vdev_id;
4355} __packed;
4356
4357struct wmi_vdev_set_param_cmd {
4358 __le32 vdev_id;
4359 __le32 param_id;
4360 __le32 param_value;
4361} __packed;
4362
4363#define WMI_MAX_KEY_INDEX 3
4364#define WMI_MAX_KEY_LEN 32
4365
4366#define WMI_KEY_PAIRWISE 0x00
4367#define WMI_KEY_GROUP 0x01
4368#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
4369
4370struct wmi_key_seq_counter {
4371 __le32 key_seq_counter_l;
4372 __le32 key_seq_counter_h;
4373} __packed;
4374
4375#define WMI_CIPHER_NONE 0x0 /* clear key */
4376#define WMI_CIPHER_WEP 0x1
4377#define WMI_CIPHER_TKIP 0x2
4378#define WMI_CIPHER_AES_OCB 0x3
4379#define WMI_CIPHER_AES_CCM 0x4
4380#define WMI_CIPHER_WAPI 0x5
4381#define WMI_CIPHER_CKIP 0x6
4382#define WMI_CIPHER_AES_CMAC 0x7
4383
4384struct wmi_vdev_install_key_cmd {
4385 __le32 vdev_id;
4386 struct wmi_mac_addr peer_macaddr;
4387 __le32 key_idx;
4388 __le32 key_flags;
4389 __le32 key_cipher; /* %WMI_CIPHER_ */
4390 struct wmi_key_seq_counter key_rsc_counter;
4391 struct wmi_key_seq_counter key_global_rsc_counter;
4392 struct wmi_key_seq_counter key_tsc_counter;
4393 u8 wpi_key_rsc_counter[16];
4394 u8 wpi_key_tsc_counter[16];
4395 __le32 key_len;
4396 __le32 key_txmic_len;
4397 __le32 key_rxmic_len;
4398
4399 /* contains key followed by tx mic followed by rx mic */
4400 u8 key_data[0];
4401} __packed;
4402
4403struct wmi_vdev_install_key_arg {
4404 u32 vdev_id;
4405 const u8 *macaddr;
4406 u32 key_idx;
4407 u32 key_flags;
4408 u32 key_cipher;
4409 u32 key_len;
4410 u32 key_txmic_len;
4411 u32 key_rxmic_len;
4412 const void *key_data;
4413};
4414
Janusz Dziedzic51ab1a02014-01-08 09:08:33 +01004415/*
4416 * vdev fixed rate format:
4417 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
4418 * - nss - b5:b4 - ss number (0 mean 1ss)
4419 * - rate_mcs - b3:b0 - as below
4420 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
4421 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
4422 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
4423 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
4424 * HT/VHT: MCS index
4425 */
4426
Kalle Valo5e3dd152013-06-12 20:52:10 +03004427/* Preamble types to be used with VDEV fixed rate configuration */
4428enum wmi_rate_preamble {
4429 WMI_RATE_PREAMBLE_OFDM,
4430 WMI_RATE_PREAMBLE_CCK,
4431 WMI_RATE_PREAMBLE_HT,
4432 WMI_RATE_PREAMBLE_VHT,
4433};
4434
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004435#define ATH10K_HW_NSS(rate) (1 + (((rate) >> 4) & 0x3))
4436#define ATH10K_HW_PREAMBLE(rate) (((rate) >> 6) & 0x3)
4437#define ATH10K_HW_RATECODE(rate, nss, preamble) \
4438 (((preamble) << 6) | ((nss) << 4) | (rate))
4439
Kalle Valo5e3dd152013-06-12 20:52:10 +03004440/* Value to disable fixed rate setting */
4441#define WMI_FIXED_RATE_NONE (0xff)
4442
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004443struct wmi_vdev_param_map {
4444 u32 rts_threshold;
4445 u32 fragmentation_threshold;
4446 u32 beacon_interval;
4447 u32 listen_interval;
4448 u32 multicast_rate;
4449 u32 mgmt_tx_rate;
4450 u32 slot_time;
4451 u32 preamble;
4452 u32 swba_time;
4453 u32 wmi_vdev_stats_update_period;
4454 u32 wmi_vdev_pwrsave_ageout_time;
4455 u32 wmi_vdev_host_swba_interval;
4456 u32 dtim_period;
4457 u32 wmi_vdev_oc_scheduler_air_time_limit;
4458 u32 wds;
4459 u32 atim_window;
4460 u32 bmiss_count_max;
4461 u32 bmiss_first_bcnt;
4462 u32 bmiss_final_bcnt;
4463 u32 feature_wmm;
4464 u32 chwidth;
4465 u32 chextoffset;
4466 u32 disable_htprotection;
4467 u32 sta_quickkickout;
4468 u32 mgmt_rate;
4469 u32 protection_mode;
4470 u32 fixed_rate;
4471 u32 sgi;
4472 u32 ldpc;
4473 u32 tx_stbc;
4474 u32 rx_stbc;
4475 u32 intra_bss_fwd;
4476 u32 def_keyid;
4477 u32 nss;
4478 u32 bcast_data_rate;
4479 u32 mcast_data_rate;
4480 u32 mcast_indicate;
4481 u32 dhcp_indicate;
4482 u32 unknown_dest_indicate;
4483 u32 ap_keepalive_min_idle_inactive_time_secs;
4484 u32 ap_keepalive_max_idle_inactive_time_secs;
4485 u32 ap_keepalive_max_unresponsive_time_secs;
4486 u32 ap_enable_nawds;
4487 u32 mcast2ucast_set;
4488 u32 enable_rtscts;
4489 u32 txbf;
4490 u32 packet_powersave;
4491 u32 drop_unencry;
4492 u32 tx_encap_type;
4493 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
Raja Mani93841a12015-06-22 20:10:13 +05304494 u32 rc_num_retries;
4495 u32 cabq_maxdur;
4496 u32 mfptest_set;
4497 u32 rts_fixed_rate;
4498 u32 vht_sgimask;
4499 u32 vht80_ratemask;
4500 u32 early_rx_adjust_enable;
4501 u32 early_rx_tgt_bmiss_num;
4502 u32 early_rx_bmiss_sample_cycle;
4503 u32 early_rx_slop_step;
4504 u32 early_rx_init_slop;
4505 u32 early_rx_adjust_pause;
4506 u32 proxy_sta;
4507 u32 meru_vc;
4508 u32 rx_decap_type;
4509 u32 bw_nss_ratemask;
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004510};
4511
4512#define WMI_VDEV_PARAM_UNSUPPORTED 0
4513
Kalle Valo5e3dd152013-06-12 20:52:10 +03004514/* the definition of different VDEV parameters */
4515enum wmi_vdev_param {
4516 /* RTS Threshold */
4517 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4518 /* Fragmentation threshold */
4519 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4520 /* beacon interval in TUs */
4521 WMI_VDEV_PARAM_BEACON_INTERVAL,
4522 /* Listen interval in TUs */
4523 WMI_VDEV_PARAM_LISTEN_INTERVAL,
4524 /* muticast rate in Mbps */
4525 WMI_VDEV_PARAM_MULTICAST_RATE,
4526 /* management frame rate in Mbps */
4527 WMI_VDEV_PARAM_MGMT_TX_RATE,
4528 /* slot time (long vs short) */
4529 WMI_VDEV_PARAM_SLOT_TIME,
4530 /* preamble (long vs short) */
4531 WMI_VDEV_PARAM_PREAMBLE,
4532 /* SWBA time (time before tbtt in msec) */
4533 WMI_VDEV_PARAM_SWBA_TIME,
4534 /* time period for updating VDEV stats */
4535 WMI_VDEV_STATS_UPDATE_PERIOD,
4536 /* age out time in msec for frames queued for station in power save */
4537 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
4538 /*
4539 * Host SWBA interval (time in msec before tbtt for SWBA event
4540 * generation).
4541 */
4542 WMI_VDEV_HOST_SWBA_INTERVAL,
4543 /* DTIM period (specified in units of num beacon intervals) */
4544 WMI_VDEV_PARAM_DTIM_PERIOD,
4545 /*
4546 * scheduler air time limit for this VDEV. used by off chan
4547 * scheduler.
4548 */
4549 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4550 /* enable/dsiable WDS for this VDEV */
4551 WMI_VDEV_PARAM_WDS,
4552 /* ATIM Window */
4553 WMI_VDEV_PARAM_ATIM_WINDOW,
4554 /* BMISS max */
4555 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
4556 /* BMISS first time */
4557 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
4558 /* BMISS final time */
4559 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
4560 /* WMM enables/disabled */
4561 WMI_VDEV_PARAM_FEATURE_WMM,
4562 /* Channel width */
4563 WMI_VDEV_PARAM_CHWIDTH,
4564 /* Channel Offset */
4565 WMI_VDEV_PARAM_CHEXTOFFSET,
4566 /* Disable HT Protection */
4567 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
4568 /* Quick STA Kickout */
4569 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
4570 /* Rate to be used with Management frames */
4571 WMI_VDEV_PARAM_MGMT_RATE,
4572 /* Protection Mode */
4573 WMI_VDEV_PARAM_PROTECTION_MODE,
4574 /* Fixed rate setting */
4575 WMI_VDEV_PARAM_FIXED_RATE,
4576 /* Short GI Enable/Disable */
4577 WMI_VDEV_PARAM_SGI,
4578 /* Enable LDPC */
4579 WMI_VDEV_PARAM_LDPC,
4580 /* Enable Tx STBC */
4581 WMI_VDEV_PARAM_TX_STBC,
4582 /* Enable Rx STBC */
4583 WMI_VDEV_PARAM_RX_STBC,
4584 /* Intra BSS forwarding */
4585 WMI_VDEV_PARAM_INTRA_BSS_FWD,
4586 /* Setting Default xmit key for Vdev */
4587 WMI_VDEV_PARAM_DEF_KEYID,
4588 /* NSS width */
4589 WMI_VDEV_PARAM_NSS,
4590 /* Set the custom rate for the broadcast data frames */
4591 WMI_VDEV_PARAM_BCAST_DATA_RATE,
4592 /* Set the custom rate (rate-code) for multicast data frames */
4593 WMI_VDEV_PARAM_MCAST_DATA_RATE,
4594 /* Tx multicast packet indicate Enable/Disable */
4595 WMI_VDEV_PARAM_MCAST_INDICATE,
4596 /* Tx DHCP packet indicate Enable/Disable */
4597 WMI_VDEV_PARAM_DHCP_INDICATE,
4598 /* Enable host inspection of Tx unicast packet to unknown destination */
4599 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4600
4601 /* The minimum amount of time AP begins to consider STA inactive */
4602 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4603
4604 /*
4605 * An associated STA is considered inactive when there is no recent
4606 * TX/RX activity and no downlink frames are buffered for it. Once a
4607 * STA exceeds the maximum idle inactive time, the AP will send an
4608 * 802.11 data-null as a keep alive to verify the STA is still
4609 * associated. If the STA does ACK the data-null, or if the data-null
4610 * is buffered and the STA does not retrieve it, the STA will be
4611 * considered unresponsive
4612 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
4613 */
4614 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4615
4616 /*
4617 * An associated STA is considered unresponsive if there is no recent
4618 * TX/RX activity and downlink frames are buffered for it. Once a STA
4619 * exceeds the maximum unresponsive time, the AP will send a
4620 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
4621 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4622
4623 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
4624 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
4625 /* Enable/Disable RTS-CTS */
4626 WMI_VDEV_PARAM_ENABLE_RTSCTS,
4627 /* Enable TXBFee/er */
4628 WMI_VDEV_PARAM_TXBF,
4629
4630 /* Set packet power save */
4631 WMI_VDEV_PARAM_PACKET_POWERSAVE,
4632
4633 /*
4634 * Drops un-encrypted packets if eceived in an encrypted connection
4635 * otherwise forwards to host.
4636 */
4637 WMI_VDEV_PARAM_DROP_UNENCRY,
4638
4639 /*
4640 * Set the encapsulation type for frames.
4641 */
4642 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
4643};
4644
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004645/* the definition of different VDEV parameters */
4646enum wmi_10x_vdev_param {
4647 /* RTS Threshold */
4648 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4649 /* Fragmentation threshold */
4650 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4651 /* beacon interval in TUs */
4652 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
4653 /* Listen interval in TUs */
4654 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
4655 /* muticast rate in Mbps */
4656 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
4657 /* management frame rate in Mbps */
4658 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
4659 /* slot time (long vs short) */
4660 WMI_10X_VDEV_PARAM_SLOT_TIME,
4661 /* preamble (long vs short) */
4662 WMI_10X_VDEV_PARAM_PREAMBLE,
4663 /* SWBA time (time before tbtt in msec) */
4664 WMI_10X_VDEV_PARAM_SWBA_TIME,
4665 /* time period for updating VDEV stats */
4666 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
4667 /* age out time in msec for frames queued for station in power save */
4668 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
4669 /*
4670 * Host SWBA interval (time in msec before tbtt for SWBA event
4671 * generation).
4672 */
4673 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
4674 /* DTIM period (specified in units of num beacon intervals) */
4675 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
4676 /*
4677 * scheduler air time limit for this VDEV. used by off chan
4678 * scheduler.
4679 */
4680 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4681 /* enable/dsiable WDS for this VDEV */
4682 WMI_10X_VDEV_PARAM_WDS,
4683 /* ATIM Window */
4684 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
4685 /* BMISS max */
4686 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
4687 /* WMM enables/disabled */
4688 WMI_10X_VDEV_PARAM_FEATURE_WMM,
4689 /* Channel width */
4690 WMI_10X_VDEV_PARAM_CHWIDTH,
4691 /* Channel Offset */
4692 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
4693 /* Disable HT Protection */
4694 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
4695 /* Quick STA Kickout */
4696 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
4697 /* Rate to be used with Management frames */
4698 WMI_10X_VDEV_PARAM_MGMT_RATE,
4699 /* Protection Mode */
4700 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
4701 /* Fixed rate setting */
4702 WMI_10X_VDEV_PARAM_FIXED_RATE,
4703 /* Short GI Enable/Disable */
4704 WMI_10X_VDEV_PARAM_SGI,
4705 /* Enable LDPC */
4706 WMI_10X_VDEV_PARAM_LDPC,
4707 /* Enable Tx STBC */
4708 WMI_10X_VDEV_PARAM_TX_STBC,
4709 /* Enable Rx STBC */
4710 WMI_10X_VDEV_PARAM_RX_STBC,
4711 /* Intra BSS forwarding */
4712 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
4713 /* Setting Default xmit key for Vdev */
4714 WMI_10X_VDEV_PARAM_DEF_KEYID,
4715 /* NSS width */
4716 WMI_10X_VDEV_PARAM_NSS,
4717 /* Set the custom rate for the broadcast data frames */
4718 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
4719 /* Set the custom rate (rate-code) for multicast data frames */
4720 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
4721 /* Tx multicast packet indicate Enable/Disable */
4722 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
4723 /* Tx DHCP packet indicate Enable/Disable */
4724 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
4725 /* Enable host inspection of Tx unicast packet to unknown destination */
4726 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4727
4728 /* The minimum amount of time AP begins to consider STA inactive */
4729 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4730
4731 /*
4732 * An associated STA is considered inactive when there is no recent
4733 * TX/RX activity and no downlink frames are buffered for it. Once a
4734 * STA exceeds the maximum idle inactive time, the AP will send an
4735 * 802.11 data-null as a keep alive to verify the STA is still
4736 * associated. If the STA does ACK the data-null, or if the data-null
4737 * is buffered and the STA does not retrieve it, the STA will be
4738 * considered unresponsive
4739 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
4740 */
4741 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4742
4743 /*
4744 * An associated STA is considered unresponsive if there is no recent
4745 * TX/RX activity and downlink frames are buffered for it. Once a STA
4746 * exceeds the maximum unresponsive time, the AP will send a
4747 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
4748 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4749
4750 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
4751 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
4752
4753 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
4754 /* Enable/Disable RTS-CTS */
4755 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
4756
4757 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
Michal Kazior24c88f72014-07-25 13:32:17 +02004758
4759 /* following are available as of firmware 10.2 */
4760 WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
4761 WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
4762 WMI_10X_VDEV_PARAM_MFPTEST_SET,
4763 WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
4764 WMI_10X_VDEV_PARAM_VHT_SGIMASK,
4765 WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004766};
4767
Raja Mani93841a12015-06-22 20:10:13 +05304768enum wmi_10_4_vdev_param {
4769 WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4770 WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4771 WMI_10_4_VDEV_PARAM_BEACON_INTERVAL,
4772 WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL,
4773 WMI_10_4_VDEV_PARAM_MULTICAST_RATE,
4774 WMI_10_4_VDEV_PARAM_MGMT_TX_RATE,
4775 WMI_10_4_VDEV_PARAM_SLOT_TIME,
4776 WMI_10_4_VDEV_PARAM_PREAMBLE,
4777 WMI_10_4_VDEV_PARAM_SWBA_TIME,
4778 WMI_10_4_VDEV_STATS_UPDATE_PERIOD,
4779 WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME,
4780 WMI_10_4_VDEV_HOST_SWBA_INTERVAL,
4781 WMI_10_4_VDEV_PARAM_DTIM_PERIOD,
4782 WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4783 WMI_10_4_VDEV_PARAM_WDS,
4784 WMI_10_4_VDEV_PARAM_ATIM_WINDOW,
4785 WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX,
4786 WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT,
4787 WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT,
4788 WMI_10_4_VDEV_PARAM_FEATURE_WMM,
4789 WMI_10_4_VDEV_PARAM_CHWIDTH,
4790 WMI_10_4_VDEV_PARAM_CHEXTOFFSET,
4791 WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION,
4792 WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT,
4793 WMI_10_4_VDEV_PARAM_MGMT_RATE,
4794 WMI_10_4_VDEV_PARAM_PROTECTION_MODE,
4795 WMI_10_4_VDEV_PARAM_FIXED_RATE,
4796 WMI_10_4_VDEV_PARAM_SGI,
4797 WMI_10_4_VDEV_PARAM_LDPC,
4798 WMI_10_4_VDEV_PARAM_TX_STBC,
4799 WMI_10_4_VDEV_PARAM_RX_STBC,
4800 WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD,
4801 WMI_10_4_VDEV_PARAM_DEF_KEYID,
4802 WMI_10_4_VDEV_PARAM_NSS,
4803 WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE,
4804 WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE,
4805 WMI_10_4_VDEV_PARAM_MCAST_INDICATE,
4806 WMI_10_4_VDEV_PARAM_DHCP_INDICATE,
4807 WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4808 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4809 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4810 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4811 WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS,
4812 WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET,
4813 WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS,
4814 WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES,
4815 WMI_10_4_VDEV_PARAM_TXBF,
4816 WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE,
4817 WMI_10_4_VDEV_PARAM_DROP_UNENCRY,
4818 WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE,
4819 WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
4820 WMI_10_4_VDEV_PARAM_CABQ_MAXDUR,
4821 WMI_10_4_VDEV_PARAM_MFPTEST_SET,
4822 WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE,
4823 WMI_10_4_VDEV_PARAM_VHT_SGIMASK,
4824 WMI_10_4_VDEV_PARAM_VHT80_RATEMASK,
4825 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE,
4826 WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
4827 WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE,
4828 WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP,
4829 WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP,
4830 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE,
4831 WMI_10_4_VDEV_PARAM_PROXY_STA,
4832 WMI_10_4_VDEV_PARAM_MERU_VC,
4833 WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
4834 WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
4835};
4836
Michal Kazior139e1702015-02-15 16:50:42 +02004837#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
4838#define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
4839#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
4840#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
4841
Vivek Natarajana48e2cc2015-08-04 10:45:12 +05304842#define WMI_TXBF_STS_CAP_OFFSET_LSB 4
4843#define WMI_TXBF_STS_CAP_OFFSET_MASK 0xf0
4844#define WMI_BF_SOUND_DIM_OFFSET_LSB 8
4845#define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00
4846
Kalle Valo5e3dd152013-06-12 20:52:10 +03004847/* slot time long */
4848#define WMI_VDEV_SLOT_TIME_LONG 0x1
4849/* slot time short */
4850#define WMI_VDEV_SLOT_TIME_SHORT 0x2
4851/* preablbe long */
4852#define WMI_VDEV_PREAMBLE_LONG 0x1
4853/* preablbe short */
4854#define WMI_VDEV_PREAMBLE_SHORT 0x2
4855
4856enum wmi_start_event_param {
4857 WMI_VDEV_RESP_START_EVENT = 0,
4858 WMI_VDEV_RESP_RESTART_EVENT,
4859};
4860
4861struct wmi_vdev_start_response_event {
4862 __le32 vdev_id;
4863 __le32 req_id;
4864 __le32 resp_type; /* %WMI_VDEV_RESP_ */
4865 __le32 status;
4866} __packed;
4867
4868struct wmi_vdev_standby_req_event {
4869 /* unique id identifying the VDEV, generated by the caller */
4870 __le32 vdev_id;
4871} __packed;
4872
4873struct wmi_vdev_resume_req_event {
4874 /* unique id identifying the VDEV, generated by the caller */
4875 __le32 vdev_id;
4876} __packed;
4877
4878struct wmi_vdev_stopped_event {
4879 /* unique id identifying the VDEV, generated by the caller */
4880 __le32 vdev_id;
4881} __packed;
4882
4883/*
4884 * common structure used for simple events
4885 * (stopped, resume_req, standby response)
4886 */
4887struct wmi_vdev_simple_event {
4888 /* unique id identifying the VDEV, generated by the caller */
4889 __le32 vdev_id;
4890} __packed;
4891
4892/* VDEV start response status codes */
4893/* VDEV succesfully started */
4894#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
4895
4896/* requested VDEV not found */
4897#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
4898
4899/* unsupported VDEV combination */
4900#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
4901
Simon Wunderlich855aed12014-08-02 09:12:54 +03004902/* TODO: please add more comments if you have in-depth information */
4903struct wmi_vdev_spectral_conf_cmd {
4904 __le32 vdev_id;
4905
4906 /* number of fft samples to send (0 for infinite) */
4907 __le32 scan_count;
4908 __le32 scan_period;
4909 __le32 scan_priority;
4910
4911 /* number of bins in the FFT: 2^(fft_size - bin_scale) */
4912 __le32 scan_fft_size;
4913 __le32 scan_gc_ena;
4914 __le32 scan_restart_ena;
4915 __le32 scan_noise_floor_ref;
4916 __le32 scan_init_delay;
4917 __le32 scan_nb_tone_thr;
4918 __le32 scan_str_bin_thr;
4919 __le32 scan_wb_rpt_mode;
4920 __le32 scan_rssi_rpt_mode;
4921 __le32 scan_rssi_thr;
4922 __le32 scan_pwr_format;
4923
4924 /* rpt_mode: Format of FFT report to software for spectral scan
4925 * triggered FFTs:
4926 * 0: No FFT report (only spectral scan summary report)
4927 * 1: 2-dword summary of metrics for each completed FFT + spectral
4928 * scan summary report
4929 * 2: 2-dword summary of metrics for each completed FFT +
4930 * 1x- oversampled bins(in-band) per FFT + spectral scan summary
4931 * report
4932 * 3: 2-dword summary of metrics for each completed FFT +
4933 * 2x- oversampled bins (all) per FFT + spectral scan summary
4934 */
4935 __le32 scan_rpt_mode;
4936 __le32 scan_bin_scale;
4937 __le32 scan_dbm_adj;
4938 __le32 scan_chn_mask;
4939} __packed;
4940
4941struct wmi_vdev_spectral_conf_arg {
4942 u32 vdev_id;
4943 u32 scan_count;
4944 u32 scan_period;
4945 u32 scan_priority;
4946 u32 scan_fft_size;
4947 u32 scan_gc_ena;
4948 u32 scan_restart_ena;
4949 u32 scan_noise_floor_ref;
4950 u32 scan_init_delay;
4951 u32 scan_nb_tone_thr;
4952 u32 scan_str_bin_thr;
4953 u32 scan_wb_rpt_mode;
4954 u32 scan_rssi_rpt_mode;
4955 u32 scan_rssi_thr;
4956 u32 scan_pwr_format;
4957 u32 scan_rpt_mode;
4958 u32 scan_bin_scale;
4959 u32 scan_dbm_adj;
4960 u32 scan_chn_mask;
4961};
4962
4963#define WMI_SPECTRAL_ENABLE_DEFAULT 0
4964#define WMI_SPECTRAL_COUNT_DEFAULT 0
4965#define WMI_SPECTRAL_PERIOD_DEFAULT 35
4966#define WMI_SPECTRAL_PRIORITY_DEFAULT 1
4967#define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
4968#define WMI_SPECTRAL_GC_ENA_DEFAULT 1
4969#define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
4970#define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
4971#define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
4972#define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
4973#define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
4974#define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
4975#define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
4976#define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
4977#define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
4978#define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
4979#define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
4980#define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
4981#define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
4982
4983struct wmi_vdev_spectral_enable_cmd {
4984 __le32 vdev_id;
4985 __le32 trigger_cmd;
4986 __le32 enable_cmd;
4987} __packed;
4988
4989#define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
4990#define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
4991#define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
4992#define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
4993
Kalle Valo5e3dd152013-06-12 20:52:10 +03004994/* Beacon processing related command and event structures */
4995struct wmi_bcn_tx_hdr {
4996 __le32 vdev_id;
4997 __le32 tx_rate;
4998 __le32 tx_power;
4999 __le32 bcn_len;
5000} __packed;
5001
5002struct wmi_bcn_tx_cmd {
5003 struct wmi_bcn_tx_hdr hdr;
5004 u8 *bcn[0];
5005} __packed;
5006
5007struct wmi_bcn_tx_arg {
5008 u32 vdev_id;
5009 u32 tx_rate;
5010 u32 tx_power;
5011 u32 bcn_len;
5012 const void *bcn;
5013};
5014
Michal Kazior748afc42014-01-23 12:48:21 +01005015enum wmi_bcn_tx_ref_flags {
5016 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
5017 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
5018};
5019
Michal Kazior24c88f72014-07-25 13:32:17 +02005020/* TODO: It is unclear why "no antenna" works while any other seemingly valid
5021 * chainmask yields no beacons on the air at all.
5022 */
5023#define WMI_BCN_TX_REF_DEF_ANTENNA 0
5024
Michal Kazior748afc42014-01-23 12:48:21 +01005025struct wmi_bcn_tx_ref_cmd {
5026 __le32 vdev_id;
5027 __le32 data_len;
5028 /* physical address of the frame - dma pointer */
5029 __le32 data_ptr;
5030 /* id for host to track */
5031 __le32 msdu_id;
5032 /* frame ctrl to setup PPDU desc */
5033 __le32 frame_control;
5034 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
5035 __le32 flags;
Michal Kazior24c88f72014-07-25 13:32:17 +02005036 /* introduced in 10.2 */
5037 __le32 antenna_mask;
Michal Kazior748afc42014-01-23 12:48:21 +01005038} __packed;
5039
Kalle Valo5e3dd152013-06-12 20:52:10 +03005040/* Beacon filter */
5041#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
5042#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
5043#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
5044#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
5045#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
5046
5047struct wmi_bcn_filter_rx_cmd {
5048 /* Filter ID */
5049 __le32 bcn_filter_id;
5050 /* Filter type - wmi_bcn_filter */
5051 __le32 bcn_filter;
5052 /* Buffer len */
5053 __le32 bcn_filter_len;
5054 /* Filter info (threshold, BSSID, RSSI) */
5055 u8 *bcn_filter_buf;
5056} __packed;
5057
5058/* Capabilities and IEs to be passed to firmware */
5059struct wmi_bcn_prb_info {
5060 /* Capabilities */
5061 __le32 caps;
5062 /* ERP info */
5063 __le32 erp;
5064 /* Advanced capabilities */
5065 /* HT capabilities */
5066 /* HT Info */
5067 /* ibss_dfs */
5068 /* wpa Info */
5069 /* rsn Info */
5070 /* rrm info */
5071 /* ath_ext */
5072 /* app IE */
5073} __packed;
5074
5075struct wmi_bcn_tmpl_cmd {
5076 /* unique id identifying the VDEV, generated by the caller */
5077 __le32 vdev_id;
5078 /* TIM IE offset from the beginning of the template. */
5079 __le32 tim_ie_offset;
5080 /* beacon probe capabilities and IEs */
5081 struct wmi_bcn_prb_info bcn_prb_info;
5082 /* beacon buffer length */
5083 __le32 buf_len;
5084 /* variable length data */
5085 u8 data[1];
5086} __packed;
5087
5088struct wmi_prb_tmpl_cmd {
5089 /* unique id identifying the VDEV, generated by the caller */
5090 __le32 vdev_id;
5091 /* beacon probe capabilities and IEs */
5092 struct wmi_bcn_prb_info bcn_prb_info;
5093 /* beacon buffer length */
5094 __le32 buf_len;
5095 /* Variable length data */
5096 u8 data[1];
5097} __packed;
5098
5099enum wmi_sta_ps_mode {
5100 /* enable power save for the given STA VDEV */
5101 WMI_STA_PS_MODE_DISABLED = 0,
5102 /* disable power save for a given STA VDEV */
5103 WMI_STA_PS_MODE_ENABLED = 1,
5104};
5105
5106struct wmi_sta_powersave_mode_cmd {
5107 /* unique id identifying the VDEV, generated by the caller */
5108 __le32 vdev_id;
5109
5110 /*
5111 * Power save mode
5112 * (see enum wmi_sta_ps_mode)
5113 */
5114 __le32 sta_ps_mode;
5115} __packed;
5116
5117enum wmi_csa_offload_en {
5118 WMI_CSA_OFFLOAD_DISABLE = 0,
5119 WMI_CSA_OFFLOAD_ENABLE = 1,
5120};
5121
5122struct wmi_csa_offload_enable_cmd {
5123 __le32 vdev_id;
5124 __le32 csa_offload_enable;
5125} __packed;
5126
5127struct wmi_csa_offload_chanswitch_cmd {
5128 __le32 vdev_id;
5129 struct wmi_channel chan;
5130} __packed;
5131
5132/*
5133 * This parameter controls the policy for retrieving frames from AP while the
5134 * STA is in sleep state.
5135 *
5136 * Only takes affect if the sta_ps_mode is enabled
5137 */
5138enum wmi_sta_ps_param_rx_wake_policy {
5139 /*
5140 * Wake up when ever there is an RX activity on the VDEV. In this mode
5141 * the Power save SM(state machine) will come out of sleep by either
5142 * sending null frame (or) a data frame (with PS==0) in response to TIM
5143 * bit set in the received beacon frame from AP.
5144 */
5145 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
5146
5147 /*
5148 * Here the power save state machine will not wakeup in response to TIM
5149 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
5150 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
5151 * access categories are delivery-enabled, the station will send a
5152 * UAPSD trigger frame, otherwise it will send a PS-Poll.
5153 */
5154 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
5155};
5156
5157/*
5158 * Number of tx frames/beacon that cause the power save SM to wake up.
5159 *
5160 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
5161 * meaning, It will cause the SM to never wake up. This is useful if you want
5162 * to keep the system to sleep all the time for some kind of test mode . host
5163 * can change this parameter any time. It will affect at the next tx frame.
5164 */
5165enum wmi_sta_ps_param_tx_wake_threshold {
5166 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
5167 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
5168
5169 /*
5170 * Values greater than one indicate that many TX attempts per beacon
5171 * interval before the STA will wake up
5172 */
5173};
5174
5175/*
5176 * The maximum number of PS-Poll frames the FW will send in response to
5177 * traffic advertised in TIM before waking up (by sending a null frame with PS
5178 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
5179 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
5180 * parameter is used when the RX wake policy is
5181 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
5182 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
5183 */
5184enum wmi_sta_ps_param_pspoll_count {
5185 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
5186 /*
5187 * Values greater than 0 indicate the maximum numer of PS-Poll frames
5188 * FW will send before waking up.
5189 */
Michal Kazior9f9b5742014-12-12 12:41:36 +01005190
5191 /* When u-APSD is enabled the firmware will be very reluctant to exit
5192 * STA PS. This could result in very poor Rx performance with STA doing
5193 * PS-Poll for each and every buffered frame. This value is a bit
5194 * arbitrary.
5195 */
5196 WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
Kalle Valo5e3dd152013-06-12 20:52:10 +03005197};
5198
5199/*
5200 * This will include the delivery and trigger enabled state for every AC.
5201 * This is the negotiated state with AP. The host MLME needs to set this based
5202 * on AP capability and the state Set in the association request by the
5203 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
5204 */
5205#define WMI_UAPSD_AC_TYPE_DELI 0
5206#define WMI_UAPSD_AC_TYPE_TRIG 1
5207
5208#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
5209 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
5210
5211enum wmi_sta_ps_param_uapsd {
5212 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5213 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5214 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5215 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5216 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5217 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5218 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5219 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5220};
5221
Janusz Dziedzic0c7e4772015-01-24 12:14:52 +02005222#define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
5223
5224struct wmi_sta_uapsd_auto_trig_param {
5225 __le32 wmm_ac;
5226 __le32 user_priority;
5227 __le32 service_interval;
5228 __le32 suspend_interval;
5229 __le32 delay_interval;
5230};
5231
5232struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
5233 __le32 vdev_id;
5234 struct wmi_mac_addr peer_macaddr;
5235 __le32 num_ac;
5236};
5237
5238struct wmi_sta_uapsd_auto_trig_arg {
5239 u32 wmm_ac;
5240 u32 user_priority;
5241 u32 service_interval;
5242 u32 suspend_interval;
5243 u32 delay_interval;
5244};
5245
Kalle Valo5e3dd152013-06-12 20:52:10 +03005246enum wmi_sta_powersave_param {
5247 /*
5248 * Controls how frames are retrievd from AP while STA is sleeping
5249 *
5250 * (see enum wmi_sta_ps_param_rx_wake_policy)
5251 */
5252 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5253
5254 /*
5255 * The STA will go active after this many TX
5256 *
5257 * (see enum wmi_sta_ps_param_tx_wake_threshold)
5258 */
5259 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5260
5261 /*
5262 * Number of PS-Poll to send before STA wakes up
5263 *
5264 * (see enum wmi_sta_ps_param_pspoll_count)
5265 *
5266 */
5267 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
5268
5269 /*
5270 * TX/RX inactivity time in msec before going to sleep.
5271 *
5272 * The power save SM will monitor tx/rx activity on the VDEV, if no
5273 * activity for the specified msec of the parameter the Power save
5274 * SM will go to sleep.
5275 */
5276 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
5277
5278 /*
5279 * Set uapsd configuration.
5280 *
5281 * (see enum wmi_sta_ps_param_uapsd)
5282 */
5283 WMI_STA_PS_PARAM_UAPSD = 4,
5284};
5285
5286struct wmi_sta_powersave_param_cmd {
5287 __le32 vdev_id;
5288 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
5289 __le32 param_value;
5290} __packed;
5291
5292/* No MIMO power save */
5293#define WMI_STA_MIMO_PS_MODE_DISABLE
5294/* mimo powersave mode static*/
5295#define WMI_STA_MIMO_PS_MODE_STATIC
5296/* mimo powersave mode dynamic */
5297#define WMI_STA_MIMO_PS_MODE_DYNAMIC
5298
5299struct wmi_sta_mimo_ps_mode_cmd {
5300 /* unique id identifying the VDEV, generated by the caller */
5301 __le32 vdev_id;
5302 /* mimo powersave mode as defined above */
5303 __le32 mimo_pwrsave_mode;
5304} __packed;
5305
5306/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
5307enum wmi_ap_ps_param_uapsd {
5308 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5309 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5310 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5311 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5312 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5313 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5314 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5315 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5316};
5317
5318/* U-APSD maximum service period of peer station */
5319enum wmi_ap_ps_peer_param_max_sp {
5320 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
5321 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
5322 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
5323 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
5324 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
5325};
5326
5327/*
5328 * AP power save parameter
5329 * Set a power save specific parameter for a peer station
5330 */
5331enum wmi_ap_ps_peer_param {
5332 /* Set uapsd configuration for a given peer.
5333 *
5334 * Include the delivery and trigger enabled state for every AC.
5335 * The host MLME needs to set this based on AP capability and stations
5336 * request Set in the association request received from the station.
5337 *
5338 * Lower 8 bits of the value specify the UAPSD configuration.
5339 *
5340 * (see enum wmi_ap_ps_param_uapsd)
5341 * The default value is 0.
5342 */
5343 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
5344
5345 /*
5346 * Set the service period for a UAPSD capable station
5347 *
5348 * The service period from wme ie in the (re)assoc request frame.
5349 *
5350 * (see enum wmi_ap_ps_peer_param_max_sp)
5351 */
5352 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
5353
5354 /* Time in seconds for aging out buffered frames for STA in PS */
5355 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
5356};
5357
5358struct wmi_ap_ps_peer_cmd {
5359 /* unique id identifying the VDEV, generated by the caller */
5360 __le32 vdev_id;
5361
5362 /* peer MAC address */
5363 struct wmi_mac_addr peer_macaddr;
5364
5365 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
5366 __le32 param_id;
5367
5368 /* AP powersave param value */
5369 __le32 param_value;
5370} __packed;
5371
5372/* 128 clients = 4 words */
5373#define WMI_TIM_BITMAP_ARRAY_SIZE 4
5374
5375struct wmi_tim_info {
5376 __le32 tim_len;
5377 __le32 tim_mcast;
5378 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
5379 __le32 tim_changed;
5380 __le32 tim_num_ps_pending;
5381} __packed;
5382
Raja Mania03fee32015-06-22 20:22:20 +05305383struct wmi_tim_info_arg {
5384 __le32 tim_len;
5385 __le32 tim_mcast;
5386 const __le32 *tim_bitmap;
5387 __le32 tim_changed;
5388 __le32 tim_num_ps_pending;
5389} __packed;
5390
Kalle Valo5e3dd152013-06-12 20:52:10 +03005391/* Maximum number of NOA Descriptors supported */
5392#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
5393#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
5394#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
5395#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
5396
5397struct wmi_p2p_noa_info {
5398 /* Bit 0 - Flag to indicate an update in NOA schedule
5399 Bits 7-1 - Reserved */
5400 u8 changed;
5401 /* NOA index */
5402 u8 index;
5403 /* Bit 0 - Opp PS state of the AP
5404 Bits 1-7 - Ctwindow in TUs */
5405 u8 ctwindow_oppps;
5406 /* Number of NOA descriptors */
5407 u8 num_descriptors;
5408
5409 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
5410} __packed;
5411
5412struct wmi_bcn_info {
5413 struct wmi_tim_info tim_info;
5414 struct wmi_p2p_noa_info p2p_noa_info;
5415} __packed;
5416
5417struct wmi_host_swba_event {
5418 __le32 vdev_map;
Michal Kazior32653cf2014-12-03 10:10:26 +02005419 struct wmi_bcn_info bcn_info[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03005420} __packed;
5421
Raja Mani3cec3be2015-06-22 20:22:21 +05305422/* 16 words = 512 client + 1 word = for guard */
5423#define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
5424
5425struct wmi_10_4_tim_info {
5426 __le32 tim_len;
5427 __le32 tim_mcast;
5428 __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
5429 __le32 tim_changed;
5430 __le32 tim_num_ps_pending;
5431} __packed;
5432
5433#define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
5434
5435struct wmi_10_4_p2p_noa_info {
5436 /* Bit 0 - Flag to indicate an update in NOA schedule
5437 * Bits 7-1 - Reserved
5438 */
5439 u8 changed;
5440 /* NOA index */
5441 u8 index;
5442 /* Bit 0 - Opp PS state of the AP
5443 * Bits 1-7 - Ctwindow in TUs
5444 */
5445 u8 ctwindow_oppps;
5446 /* Number of NOA descriptors */
5447 u8 num_descriptors;
5448
5449 struct wmi_p2p_noa_descriptor
5450 noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
5451} __packed;
5452
5453struct wmi_10_4_bcn_info {
5454 struct wmi_10_4_tim_info tim_info;
5455 struct wmi_10_4_p2p_noa_info p2p_noa_info;
5456} __packed;
5457
5458struct wmi_10_4_host_swba_event {
5459 __le32 vdev_map;
5460 struct wmi_10_4_bcn_info bcn_info[0];
5461} __packed;
5462
Kalle Valo5e3dd152013-06-12 20:52:10 +03005463#define WMI_MAX_AP_VDEV 16
5464
5465struct wmi_tbtt_offset_event {
5466 __le32 vdev_map;
5467 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
5468} __packed;
5469
Kalle Valo5e3dd152013-06-12 20:52:10 +03005470struct wmi_peer_create_cmd {
5471 __le32 vdev_id;
5472 struct wmi_mac_addr peer_macaddr;
5473} __packed;
5474
Marek Puzyniak7390ed32015-03-30 09:51:52 +03005475enum wmi_peer_type {
5476 WMI_PEER_TYPE_DEFAULT = 0,
5477 WMI_PEER_TYPE_BSS = 1,
5478 WMI_PEER_TYPE_TDLS = 2,
5479};
5480
Kalle Valo5e3dd152013-06-12 20:52:10 +03005481struct wmi_peer_delete_cmd {
5482 __le32 vdev_id;
5483 struct wmi_mac_addr peer_macaddr;
5484} __packed;
5485
5486struct wmi_peer_flush_tids_cmd {
5487 __le32 vdev_id;
5488 struct wmi_mac_addr peer_macaddr;
5489 __le32 peer_tid_bitmap;
5490} __packed;
5491
5492struct wmi_fixed_rate {
5493 /*
5494 * rate mode . 0: disable fixed rate (auto rate)
5495 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
5496 * 2: ht20 11n rate specified as mcs index
5497 * 3: ht40 11n rate specified as mcs index
5498 */
5499 __le32 rate_mode;
5500 /*
5501 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
5502 * and series 3 is stored at byte 3 (MSB)
5503 */
5504 __le32 rate_series;
5505 /*
5506 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
5507 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
5508 * (MSB)
5509 */
5510 __le32 rate_retries;
5511} __packed;
5512
5513struct wmi_peer_fixed_rate_cmd {
5514 /* unique id identifying the VDEV, generated by the caller */
5515 __le32 vdev_id;
5516 /* peer MAC address */
5517 struct wmi_mac_addr peer_macaddr;
5518 /* fixed rate */
5519 struct wmi_fixed_rate peer_fixed_rate;
5520} __packed;
5521
5522#define WMI_MGMT_TID 17
5523
5524struct wmi_addba_clear_resp_cmd {
5525 /* unique id identifying the VDEV, generated by the caller */
5526 __le32 vdev_id;
5527 /* peer MAC address */
5528 struct wmi_mac_addr peer_macaddr;
5529} __packed;
5530
5531struct wmi_addba_send_cmd {
5532 /* unique id identifying the VDEV, generated by the caller */
5533 __le32 vdev_id;
5534 /* peer MAC address */
5535 struct wmi_mac_addr peer_macaddr;
5536 /* Tid number */
5537 __le32 tid;
5538 /* Buffer/Window size*/
5539 __le32 buffersize;
5540} __packed;
5541
5542struct wmi_delba_send_cmd {
5543 /* unique id identifying the VDEV, generated by the caller */
5544 __le32 vdev_id;
5545 /* peer MAC address */
5546 struct wmi_mac_addr peer_macaddr;
5547 /* Tid number */
5548 __le32 tid;
5549 /* Is Initiator */
5550 __le32 initiator;
5551 /* Reason code */
5552 __le32 reasoncode;
5553} __packed;
5554
5555struct wmi_addba_setresponse_cmd {
5556 /* unique id identifying the vdev, generated by the caller */
5557 __le32 vdev_id;
5558 /* peer mac address */
5559 struct wmi_mac_addr peer_macaddr;
5560 /* Tid number */
5561 __le32 tid;
5562 /* status code */
5563 __le32 statuscode;
5564} __packed;
5565
5566struct wmi_send_singleamsdu_cmd {
5567 /* unique id identifying the vdev, generated by the caller */
5568 __le32 vdev_id;
5569 /* peer mac address */
5570 struct wmi_mac_addr peer_macaddr;
5571 /* Tid number */
5572 __le32 tid;
5573} __packed;
5574
5575enum wmi_peer_smps_state {
5576 WMI_PEER_SMPS_PS_NONE = 0x0,
5577 WMI_PEER_SMPS_STATIC = 0x1,
5578 WMI_PEER_SMPS_DYNAMIC = 0x2
5579};
5580
Michal Kazior9797feb2014-02-14 14:49:48 +01005581enum wmi_peer_chwidth {
5582 WMI_PEER_CHWIDTH_20MHZ = 0,
5583 WMI_PEER_CHWIDTH_40MHZ = 1,
5584 WMI_PEER_CHWIDTH_80MHZ = 2,
5585};
5586
Kalle Valo5e3dd152013-06-12 20:52:10 +03005587enum wmi_peer_param {
5588 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
5589 WMI_PEER_AMPDU = 0x2,
5590 WMI_PEER_AUTHORIZE = 0x3,
5591 WMI_PEER_CHAN_WIDTH = 0x4,
5592 WMI_PEER_NSS = 0x5,
Michal Kazior0a987fb2015-02-13 13:30:15 +01005593 WMI_PEER_USE_4ADDR = 0x6,
5594 WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005595};
5596
5597struct wmi_peer_set_param_cmd {
5598 __le32 vdev_id;
5599 struct wmi_mac_addr peer_macaddr;
5600 __le32 param_id;
5601 __le32 param_value;
5602} __packed;
5603
5604#define MAX_SUPPORTED_RATES 128
5605
5606struct wmi_rate_set {
5607 /* total number of rates */
5608 __le32 num_rates;
5609 /*
5610 * rates (each 8bit value) packed into a 32 bit word.
5611 * the rates are filled from least significant byte to most
5612 * significant byte.
5613 */
5614 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
5615} __packed;
5616
5617struct wmi_rate_set_arg {
5618 unsigned int num_rates;
5619 u8 rates[MAX_SUPPORTED_RATES];
5620};
5621
5622/*
5623 * NOTE: It would bea good idea to represent the Tx MCS
5624 * info in one word and Rx in another word. This is split
5625 * into multiple words for convenience
5626 */
5627struct wmi_vht_rate_set {
5628 __le32 rx_max_rate; /* Max Rx data rate */
5629 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
5630 __le32 tx_max_rate; /* Max Tx data rate */
5631 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
5632} __packed;
5633
5634struct wmi_vht_rate_set_arg {
5635 u32 rx_max_rate;
5636 u32 rx_mcs_set;
5637 u32 tx_max_rate;
5638 u32 tx_mcs_set;
5639};
5640
5641struct wmi_peer_set_rates_cmd {
5642 /* peer MAC address */
5643 struct wmi_mac_addr peer_macaddr;
5644 /* legacy rate set */
5645 struct wmi_rate_set peer_legacy_rates;
5646 /* ht rate set */
5647 struct wmi_rate_set peer_ht_rates;
5648} __packed;
5649
5650struct wmi_peer_set_q_empty_callback_cmd {
5651 /* unique id identifying the VDEV, generated by the caller */
5652 __le32 vdev_id;
5653 /* peer MAC address */
5654 struct wmi_mac_addr peer_macaddr;
5655 __le32 callback_enable;
5656} __packed;
5657
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02005658struct wmi_peer_flags_map {
5659 u32 auth;
5660 u32 qos;
5661 u32 need_ptk_4_way;
5662 u32 need_gtk_2_way;
5663 u32 apsd;
5664 u32 ht;
5665 u32 bw40;
5666 u32 stbc;
5667 u32 ldbc;
5668 u32 dyn_mimops;
5669 u32 static_mimops;
5670 u32 spatial_mux;
5671 u32 vht;
5672 u32 bw80;
5673 u32 vht_2g;
5674 u32 pmf;
5675};
5676
5677enum wmi_peer_flags {
5678 WMI_PEER_AUTH = 0x00000001,
5679 WMI_PEER_QOS = 0x00000002,
5680 WMI_PEER_NEED_PTK_4_WAY = 0x00000004,
5681 WMI_PEER_NEED_GTK_2_WAY = 0x00000010,
5682 WMI_PEER_APSD = 0x00000800,
5683 WMI_PEER_HT = 0x00001000,
5684 WMI_PEER_40MHZ = 0x00002000,
5685 WMI_PEER_STBC = 0x00008000,
5686 WMI_PEER_LDPC = 0x00010000,
5687 WMI_PEER_DYN_MIMOPS = 0x00020000,
5688 WMI_PEER_STATIC_MIMOPS = 0x00040000,
5689 WMI_PEER_SPATIAL_MUX = 0x00200000,
5690 WMI_PEER_VHT = 0x02000000,
5691 WMI_PEER_80MHZ = 0x04000000,
5692 WMI_PEER_VHT_2G = 0x08000000,
5693 WMI_PEER_PMF = 0x10000000,
5694};
5695
5696enum wmi_10x_peer_flags {
5697 WMI_10X_PEER_AUTH = 0x00000001,
5698 WMI_10X_PEER_QOS = 0x00000002,
5699 WMI_10X_PEER_NEED_PTK_4_WAY = 0x00000004,
5700 WMI_10X_PEER_NEED_GTK_2_WAY = 0x00000010,
5701 WMI_10X_PEER_APSD = 0x00000800,
5702 WMI_10X_PEER_HT = 0x00001000,
5703 WMI_10X_PEER_40MHZ = 0x00002000,
5704 WMI_10X_PEER_STBC = 0x00008000,
5705 WMI_10X_PEER_LDPC = 0x00010000,
5706 WMI_10X_PEER_DYN_MIMOPS = 0x00020000,
5707 WMI_10X_PEER_STATIC_MIMOPS = 0x00040000,
5708 WMI_10X_PEER_SPATIAL_MUX = 0x00200000,
5709 WMI_10X_PEER_VHT = 0x02000000,
5710 WMI_10X_PEER_80MHZ = 0x04000000,
5711};
5712
5713enum wmi_10_2_peer_flags {
5714 WMI_10_2_PEER_AUTH = 0x00000001,
5715 WMI_10_2_PEER_QOS = 0x00000002,
5716 WMI_10_2_PEER_NEED_PTK_4_WAY = 0x00000004,
5717 WMI_10_2_PEER_NEED_GTK_2_WAY = 0x00000010,
5718 WMI_10_2_PEER_APSD = 0x00000800,
5719 WMI_10_2_PEER_HT = 0x00001000,
5720 WMI_10_2_PEER_40MHZ = 0x00002000,
5721 WMI_10_2_PEER_STBC = 0x00008000,
5722 WMI_10_2_PEER_LDPC = 0x00010000,
5723 WMI_10_2_PEER_DYN_MIMOPS = 0x00020000,
5724 WMI_10_2_PEER_STATIC_MIMOPS = 0x00040000,
5725 WMI_10_2_PEER_SPATIAL_MUX = 0x00200000,
5726 WMI_10_2_PEER_VHT = 0x02000000,
5727 WMI_10_2_PEER_80MHZ = 0x04000000,
5728 WMI_10_2_PEER_VHT_2G = 0x08000000,
5729 WMI_10_2_PEER_PMF = 0x10000000,
5730};
Kalle Valo5e3dd152013-06-12 20:52:10 +03005731
5732/*
5733 * Peer rate capabilities.
5734 *
5735 * This is of interest to the ratecontrol
5736 * module which resides in the firmware. The bit definitions are
5737 * consistent with that defined in if_athrate.c.
5738 */
5739#define WMI_RC_DS_FLAG 0x01
5740#define WMI_RC_CW40_FLAG 0x02
5741#define WMI_RC_SGI_FLAG 0x04
5742#define WMI_RC_HT_FLAG 0x08
5743#define WMI_RC_RTSCTS_FLAG 0x10
5744#define WMI_RC_TX_STBC_FLAG 0x20
5745#define WMI_RC_RX_STBC_FLAG 0xC0
5746#define WMI_RC_RX_STBC_FLAG_S 6
5747#define WMI_RC_WEP_TKIP_FLAG 0x100
5748#define WMI_RC_TS_FLAG 0x200
5749#define WMI_RC_UAPSD_FLAG 0x400
5750
5751/* Maximum listen interval supported by hw in units of beacon interval */
5752#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
5753
Michal Kazior24c88f72014-07-25 13:32:17 +02005754struct wmi_common_peer_assoc_complete_cmd {
Kalle Valo5e3dd152013-06-12 20:52:10 +03005755 struct wmi_mac_addr peer_macaddr;
5756 __le32 vdev_id;
5757 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
5758 __le32 peer_associd; /* 16 LSBs */
5759 __le32 peer_flags;
5760 __le32 peer_caps; /* 16 LSBs */
5761 __le32 peer_listen_intval;
5762 __le32 peer_ht_caps;
5763 __le32 peer_max_mpdu;
5764 __le32 peer_mpdu_density; /* 0..16 */
5765 __le32 peer_rate_caps;
5766 struct wmi_rate_set peer_legacy_rates;
5767 struct wmi_rate_set peer_ht_rates;
5768 __le32 peer_nss; /* num of spatial streams */
5769 __le32 peer_vht_caps;
5770 __le32 peer_phymode;
5771 struct wmi_vht_rate_set peer_vht_rates;
Michal Kazior24c88f72014-07-25 13:32:17 +02005772};
5773
5774struct wmi_main_peer_assoc_complete_cmd {
5775 struct wmi_common_peer_assoc_complete_cmd cmd;
5776
Kalle Valo5e3dd152013-06-12 20:52:10 +03005777 /* HT Operation Element of the peer. Five bytes packed in 2
5778 * INT32 array and filled from lsb to msb. */
5779 __le32 peer_ht_info[2];
5780} __packed;
5781
Michal Kazior24c88f72014-07-25 13:32:17 +02005782struct wmi_10_1_peer_assoc_complete_cmd {
5783 struct wmi_common_peer_assoc_complete_cmd cmd;
5784} __packed;
5785
5786#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
5787#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
5788#define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
5789#define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
5790
5791struct wmi_10_2_peer_assoc_complete_cmd {
5792 struct wmi_common_peer_assoc_complete_cmd cmd;
5793 __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
5794} __packed;
5795
Kalle Valo5e3dd152013-06-12 20:52:10 +03005796struct wmi_peer_assoc_complete_arg {
5797 u8 addr[ETH_ALEN];
5798 u32 vdev_id;
5799 bool peer_reassoc;
5800 u16 peer_aid;
5801 u32 peer_flags; /* see %WMI_PEER_ */
5802 u16 peer_caps;
5803 u32 peer_listen_intval;
5804 u32 peer_ht_caps;
5805 u32 peer_max_mpdu;
5806 u32 peer_mpdu_density; /* 0..16 */
5807 u32 peer_rate_caps; /* see %WMI_RC_ */
5808 struct wmi_rate_set_arg peer_legacy_rates;
5809 struct wmi_rate_set_arg peer_ht_rates;
5810 u32 peer_num_spatial_streams;
5811 u32 peer_vht_caps;
5812 enum wmi_phy_mode peer_phymode;
5813 struct wmi_vht_rate_set_arg peer_vht_rates;
5814};
5815
5816struct wmi_peer_add_wds_entry_cmd {
5817 /* peer MAC address */
5818 struct wmi_mac_addr peer_macaddr;
5819 /* wds MAC addr */
5820 struct wmi_mac_addr wds_macaddr;
5821} __packed;
5822
5823struct wmi_peer_remove_wds_entry_cmd {
5824 /* wds MAC addr */
5825 struct wmi_mac_addr wds_macaddr;
5826} __packed;
5827
5828struct wmi_peer_q_empty_callback_event {
5829 /* peer MAC address */
5830 struct wmi_mac_addr peer_macaddr;
5831} __packed;
5832
5833/*
5834 * Channel info WMI event
5835 */
5836struct wmi_chan_info_event {
5837 __le32 err_code;
5838 __le32 freq;
5839 __le32 cmd_flags;
5840 __le32 noise_floor;
5841 __le32 rx_clear_count;
5842 __le32 cycle_count;
5843} __packed;
5844
Raja Manib2297ba2015-06-22 20:22:23 +05305845struct wmi_10_4_chan_info_event {
5846 __le32 err_code;
5847 __le32 freq;
5848 __le32 cmd_flags;
5849 __le32 noise_floor;
5850 __le32 rx_clear_count;
5851 __le32 cycle_count;
5852 __le32 chan_tx_pwr_range;
5853 __le32 chan_tx_pwr_tp;
5854 __le32 rx_frame_count;
5855} __packed;
5856
Kalle Valo5a13e762014-01-20 11:01:46 +02005857struct wmi_peer_sta_kickout_event {
5858 struct wmi_mac_addr peer_macaddr;
5859} __packed;
5860
Michal Kazior2e1dea42013-07-31 10:32:40 +02005861#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
Vasanthakumar Thiagarajan3d2a2e22015-08-12 16:24:04 +05305862#define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1)
Michal Kazior2e1dea42013-07-31 10:32:40 +02005863
Kalle Valo5e3dd152013-06-12 20:52:10 +03005864/* Beacon filter wmi command info */
5865#define BCN_FLT_MAX_SUPPORTED_IES 256
5866#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
5867
5868struct bss_bcn_stats {
5869 __le32 vdev_id;
5870 __le32 bss_bcnsdropped;
5871 __le32 bss_bcnsdelivered;
5872} __packed;
5873
5874struct bcn_filter_stats {
5875 __le32 bcns_dropped;
5876 __le32 bcns_delivered;
5877 __le32 activefilters;
5878 struct bss_bcn_stats bss_stats;
5879} __packed;
5880
5881struct wmi_add_bcn_filter_cmd {
5882 u32 vdev_id;
5883 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
5884} __packed;
5885
5886enum wmi_sta_keepalive_method {
5887 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
5888 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
5889};
5890
Michal Kazior46725b12015-01-28 09:57:49 +02005891#define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
5892
5893/* Firmware crashes if keepalive interval exceeds this limit */
5894#define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
5895
Kalle Valo5e3dd152013-06-12 20:52:10 +03005896/* note: ip4 addresses are in network byte order, i.e. big endian */
5897struct wmi_sta_keepalive_arp_resp {
5898 __be32 src_ip4_addr;
5899 __be32 dest_ip4_addr;
5900 struct wmi_mac_addr dest_mac_addr;
5901} __packed;
5902
5903struct wmi_sta_keepalive_cmd {
5904 __le32 vdev_id;
5905 __le32 enabled;
5906 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
5907 __le32 interval; /* in seconds */
5908 struct wmi_sta_keepalive_arp_resp arp_resp;
5909} __packed;
5910
Janusz Dziedzic6e8b1882015-01-28 09:57:39 +02005911struct wmi_sta_keepalive_arg {
5912 u32 vdev_id;
5913 u32 enabled;
5914 u32 method;
5915 u32 interval;
5916 __be32 src_ip4_addr;
5917 __be32 dest_ip4_addr;
5918 const u8 dest_mac_addr[ETH_ALEN];
5919};
5920
Michal Kazior9cfbce72013-07-16 09:54:36 +02005921enum wmi_force_fw_hang_type {
5922 WMI_FORCE_FW_HANG_ASSERT = 1,
5923 WMI_FORCE_FW_HANG_NO_DETECT,
5924 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
5925 WMI_FORCE_FW_HANG_EMPTY_POINT,
5926 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
5927 WMI_FORCE_FW_HANG_INFINITE_LOOP,
5928};
5929
5930#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
5931
5932struct wmi_force_fw_hang_cmd {
5933 __le32 type;
5934 __le32 delay_ms;
5935} __packed;
5936
Kalle Valof118a3e2014-01-03 12:59:31 +02005937enum ath10k_dbglog_level {
5938 ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
5939 ATH10K_DBGLOG_LEVEL_INFO = 1,
5940 ATH10K_DBGLOG_LEVEL_WARN = 2,
5941 ATH10K_DBGLOG_LEVEL_ERR = 3,
5942};
5943
5944/* VAP ids to enable dbglog */
5945#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
5946#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
5947
5948/* to enable dbglog in the firmware */
5949#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
5950#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
5951
5952/* timestamp resolution */
5953#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
5954#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
5955
5956/* number of queued messages before sending them to the host */
5957#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
5958#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
5959
5960/*
5961 * Log levels to enable. This defines the minimum level to enable, this is
5962 * not a bitmask. See enum ath10k_dbglog_level for the values.
5963 */
5964#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
5965#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
5966
5967/*
5968 * Note: this is a cleaned up version of a struct firmware uses. For
5969 * example, config_valid was hidden inside an array.
5970 */
5971struct wmi_dbglog_cfg_cmd {
5972 /* bitmask to hold mod id config*/
5973 __le32 module_enable;
5974
5975 /* see ATH10K_DBGLOG_CFG_ */
5976 __le32 config_enable;
5977
5978 /* mask of module id bits to be changed */
5979 __le32 module_valid;
5980
5981 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
5982 __le32 config_valid;
5983} __packed;
5984
Michal Kaziorc1a46542015-03-10 16:21:54 +02005985enum wmi_roam_reason {
5986 WMI_ROAM_REASON_BETTER_AP = 1,
5987 WMI_ROAM_REASON_BEACON_MISS = 2,
5988 WMI_ROAM_REASON_LOW_RSSI = 3,
5989 WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
5990 WMI_ROAM_REASON_HO_FAILED = 5,
5991
5992 /* keep last */
5993 WMI_ROAM_REASON_MAX,
5994};
5995
5996struct wmi_roam_ev {
5997 __le32 vdev_id;
5998 __le32 reason;
5999} __packed;
6000
Kalle Valo5e3dd152013-06-12 20:52:10 +03006001#define ATH10K_FRAGMT_THRESHOLD_MIN 540
6002#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
6003
6004#define WMI_MAX_EVENT 0x1000
6005/* Maximum number of pending TXed WMI packets */
Kalle Valo5e3dd152013-06-12 20:52:10 +03006006#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
6007
6008/* By default disable power save for IBSS */
6009#define ATH10K_DEFAULT_ATIM 0
6010
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006011#define WMI_MAX_MEM_REQS 16
6012
Michal Kazior32653cf2014-12-03 10:10:26 +02006013struct wmi_scan_ev_arg {
6014 __le32 event_type; /* %WMI_SCAN_EVENT_ */
6015 __le32 reason; /* %WMI_SCAN_REASON_ */
6016 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
6017 __le32 scan_req_id;
6018 __le32 scan_id;
6019 __le32 vdev_id;
6020};
6021
6022struct wmi_mgmt_rx_ev_arg {
6023 __le32 channel;
6024 __le32 snr;
6025 __le32 rate;
6026 __le32 phy_mode;
6027 __le32 buf_len;
6028 __le32 status; /* %WMI_RX_STATUS_ */
6029};
6030
6031struct wmi_ch_info_ev_arg {
6032 __le32 err_code;
6033 __le32 freq;
6034 __le32 cmd_flags;
6035 __le32 noise_floor;
6036 __le32 rx_clear_count;
6037 __le32 cycle_count;
Raja Manib2297ba2015-06-22 20:22:23 +05306038 __le32 chan_tx_pwr_range;
6039 __le32 chan_tx_pwr_tp;
6040 __le32 rx_frame_count;
Michal Kazior32653cf2014-12-03 10:10:26 +02006041};
6042
6043struct wmi_vdev_start_ev_arg {
6044 __le32 vdev_id;
6045 __le32 req_id;
6046 __le32 resp_type; /* %WMI_VDEV_RESP_ */
6047 __le32 status;
6048};
6049
6050struct wmi_peer_kick_ev_arg {
6051 const u8 *mac_addr;
6052};
6053
6054struct wmi_swba_ev_arg {
6055 __le32 vdev_map;
Raja Mania03fee32015-06-22 20:22:20 +05306056 struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
Michal Kazior32653cf2014-12-03 10:10:26 +02006057 const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
6058};
6059
6060struct wmi_phyerr_ev_arg {
Raja Mani991adf72015-08-14 11:13:29 +03006061 u32 tsf_timestamp;
6062 u16 freq1;
6063 u16 freq2;
6064 u8 rssi_combined;
6065 u8 chan_width_mhz;
6066 u8 phy_err_code;
6067 u16 nf_chains[4];
6068 u32 buf_len;
6069 const u8 *buf;
6070 u8 hdr_len;
6071};
6072
6073struct wmi_phyerr_hdr_arg {
6074 u32 num_phyerrs;
6075 u32 tsf_l32;
6076 u32 tsf_u32;
6077 u32 buf_len;
6078 const void *phyerrs;
Michal Kazior32653cf2014-12-03 10:10:26 +02006079};
6080
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006081struct wmi_svc_rdy_ev_arg {
6082 __le32 min_tx_power;
6083 __le32 max_tx_power;
6084 __le32 ht_cap;
6085 __le32 vht_cap;
6086 __le32 sw_ver0;
6087 __le32 sw_ver1;
Michal Kaziorca996ec2014-12-03 10:11:32 +02006088 __le32 fw_build;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006089 __le32 phy_capab;
6090 __le32 num_rf_chains;
6091 __le32 eeprom_rd;
6092 __le32 num_mem_reqs;
6093 const __le32 *service_map;
Michal Kazior2a3e60d2014-11-27 10:11:15 +01006094 size_t service_map_len;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006095 const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
6096};
6097
Michal Kazior32653cf2014-12-03 10:10:26 +02006098struct wmi_rdy_ev_arg {
6099 __le32 sw_version;
6100 __le32 abi_version;
6101 __le32 status;
6102 const u8 *mac_addr;
6103};
6104
Michal Kaziorc1a46542015-03-10 16:21:54 +02006105struct wmi_roam_ev_arg {
6106 __le32 vdev_id;
6107 __le32 reason;
6108 __le32 rssi;
6109};
6110
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02006111struct wmi_pdev_temperature_event {
6112 /* temperature value in Celcius degree */
6113 __le32 temperature;
6114} __packed;
6115
Janusz Dziedzicf5431e82015-03-23 17:32:53 +02006116/* WOW structures */
6117enum wmi_wow_wakeup_event {
6118 WOW_BMISS_EVENT = 0,
6119 WOW_BETTER_AP_EVENT,
6120 WOW_DEAUTH_RECVD_EVENT,
6121 WOW_MAGIC_PKT_RECVD_EVENT,
6122 WOW_GTK_ERR_EVENT,
6123 WOW_FOURWAY_HSHAKE_EVENT,
6124 WOW_EAPOL_RECVD_EVENT,
6125 WOW_NLO_DETECTED_EVENT,
6126 WOW_DISASSOC_RECVD_EVENT,
6127 WOW_PATTERN_MATCH_EVENT,
6128 WOW_CSA_IE_EVENT,
6129 WOW_PROBE_REQ_WPS_IE_EVENT,
6130 WOW_AUTH_REQ_EVENT,
6131 WOW_ASSOC_REQ_EVENT,
6132 WOW_HTT_EVENT,
6133 WOW_RA_MATCH_EVENT,
6134 WOW_HOST_AUTO_SHUTDOWN_EVENT,
6135 WOW_IOAC_MAGIC_EVENT,
6136 WOW_IOAC_SHORT_EVENT,
6137 WOW_IOAC_EXTEND_EVENT,
6138 WOW_IOAC_TIMER_EVENT,
6139 WOW_DFS_PHYERR_RADAR_EVENT,
6140 WOW_BEACON_EVENT,
6141 WOW_CLIENT_KICKOUT_EVENT,
6142 WOW_EVENT_MAX,
6143};
6144
6145#define C2S(x) case x: return #x
6146
6147static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
6148{
6149 switch (ev) {
6150 C2S(WOW_BMISS_EVENT);
6151 C2S(WOW_BETTER_AP_EVENT);
6152 C2S(WOW_DEAUTH_RECVD_EVENT);
6153 C2S(WOW_MAGIC_PKT_RECVD_EVENT);
6154 C2S(WOW_GTK_ERR_EVENT);
6155 C2S(WOW_FOURWAY_HSHAKE_EVENT);
6156 C2S(WOW_EAPOL_RECVD_EVENT);
6157 C2S(WOW_NLO_DETECTED_EVENT);
6158 C2S(WOW_DISASSOC_RECVD_EVENT);
6159 C2S(WOW_PATTERN_MATCH_EVENT);
6160 C2S(WOW_CSA_IE_EVENT);
6161 C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
6162 C2S(WOW_AUTH_REQ_EVENT);
6163 C2S(WOW_ASSOC_REQ_EVENT);
6164 C2S(WOW_HTT_EVENT);
6165 C2S(WOW_RA_MATCH_EVENT);
6166 C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
6167 C2S(WOW_IOAC_MAGIC_EVENT);
6168 C2S(WOW_IOAC_SHORT_EVENT);
6169 C2S(WOW_IOAC_EXTEND_EVENT);
6170 C2S(WOW_IOAC_TIMER_EVENT);
6171 C2S(WOW_DFS_PHYERR_RADAR_EVENT);
6172 C2S(WOW_BEACON_EVENT);
6173 C2S(WOW_CLIENT_KICKOUT_EVENT);
6174 C2S(WOW_EVENT_MAX);
6175 default:
6176 return NULL;
6177 }
6178}
6179
6180enum wmi_wow_wake_reason {
6181 WOW_REASON_UNSPECIFIED = -1,
6182 WOW_REASON_NLOD = 0,
6183 WOW_REASON_AP_ASSOC_LOST,
6184 WOW_REASON_LOW_RSSI,
6185 WOW_REASON_DEAUTH_RECVD,
6186 WOW_REASON_DISASSOC_RECVD,
6187 WOW_REASON_GTK_HS_ERR,
6188 WOW_REASON_EAP_REQ,
6189 WOW_REASON_FOURWAY_HS_RECV,
6190 WOW_REASON_TIMER_INTR_RECV,
6191 WOW_REASON_PATTERN_MATCH_FOUND,
6192 WOW_REASON_RECV_MAGIC_PATTERN,
6193 WOW_REASON_P2P_DISC,
6194 WOW_REASON_WLAN_HB,
6195 WOW_REASON_CSA_EVENT,
6196 WOW_REASON_PROBE_REQ_WPS_IE_RECV,
6197 WOW_REASON_AUTH_REQ_RECV,
6198 WOW_REASON_ASSOC_REQ_RECV,
6199 WOW_REASON_HTT_EVENT,
6200 WOW_REASON_RA_MATCH,
6201 WOW_REASON_HOST_AUTO_SHUTDOWN,
6202 WOW_REASON_IOAC_MAGIC_EVENT,
6203 WOW_REASON_IOAC_SHORT_EVENT,
6204 WOW_REASON_IOAC_EXTEND_EVENT,
6205 WOW_REASON_IOAC_TIMER_EVENT,
6206 WOW_REASON_ROAM_HO,
6207 WOW_REASON_DFS_PHYERR_RADADR_EVENT,
6208 WOW_REASON_BEACON_RECV,
6209 WOW_REASON_CLIENT_KICKOUT_EVENT,
6210 WOW_REASON_DEBUG_TEST = 0xFF,
6211};
6212
6213static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
6214{
6215 switch (reason) {
6216 C2S(WOW_REASON_UNSPECIFIED);
6217 C2S(WOW_REASON_NLOD);
6218 C2S(WOW_REASON_AP_ASSOC_LOST);
6219 C2S(WOW_REASON_LOW_RSSI);
6220 C2S(WOW_REASON_DEAUTH_RECVD);
6221 C2S(WOW_REASON_DISASSOC_RECVD);
6222 C2S(WOW_REASON_GTK_HS_ERR);
6223 C2S(WOW_REASON_EAP_REQ);
6224 C2S(WOW_REASON_FOURWAY_HS_RECV);
6225 C2S(WOW_REASON_TIMER_INTR_RECV);
6226 C2S(WOW_REASON_PATTERN_MATCH_FOUND);
6227 C2S(WOW_REASON_RECV_MAGIC_PATTERN);
6228 C2S(WOW_REASON_P2P_DISC);
6229 C2S(WOW_REASON_WLAN_HB);
6230 C2S(WOW_REASON_CSA_EVENT);
6231 C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
6232 C2S(WOW_REASON_AUTH_REQ_RECV);
6233 C2S(WOW_REASON_ASSOC_REQ_RECV);
6234 C2S(WOW_REASON_HTT_EVENT);
6235 C2S(WOW_REASON_RA_MATCH);
6236 C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
6237 C2S(WOW_REASON_IOAC_MAGIC_EVENT);
6238 C2S(WOW_REASON_IOAC_SHORT_EVENT);
6239 C2S(WOW_REASON_IOAC_EXTEND_EVENT);
6240 C2S(WOW_REASON_IOAC_TIMER_EVENT);
6241 C2S(WOW_REASON_ROAM_HO);
6242 C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
6243 C2S(WOW_REASON_BEACON_RECV);
6244 C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
6245 C2S(WOW_REASON_DEBUG_TEST);
6246 default:
6247 return NULL;
6248 }
6249}
6250
6251#undef C2S
6252
6253struct wmi_wow_ev_arg {
6254 u32 vdev_id;
6255 u32 flag;
6256 enum wmi_wow_wake_reason wake_reason;
6257 u32 data_len;
6258};
6259
Janusz Dziedzic25c86612015-03-23 17:32:54 +02006260#define WOW_MIN_PATTERN_SIZE 1
6261#define WOW_MAX_PATTERN_SIZE 148
6262#define WOW_MAX_PKT_OFFSET 128
6263
Marek Puzyniakad45c882015-03-30 09:51:53 +03006264enum wmi_tdls_state {
6265 WMI_TDLS_DISABLE,
6266 WMI_TDLS_ENABLE_PASSIVE,
6267 WMI_TDLS_ENABLE_ACTIVE,
6268};
6269
6270enum wmi_tdls_peer_state {
6271 WMI_TDLS_PEER_STATE_PEERING,
6272 WMI_TDLS_PEER_STATE_CONNECTED,
6273 WMI_TDLS_PEER_STATE_TEARDOWN,
6274};
6275
6276struct wmi_tdls_peer_update_cmd_arg {
6277 u32 vdev_id;
6278 enum wmi_tdls_peer_state peer_state;
6279 u8 addr[ETH_ALEN];
6280};
6281
6282#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
6283
6284struct wmi_tdls_peer_capab_arg {
6285 u8 peer_uapsd_queues;
6286 u8 peer_max_sp;
6287 u32 buff_sta_support;
6288 u32 off_chan_support;
6289 u32 peer_curr_operclass;
6290 u32 self_curr_operclass;
6291 u32 peer_chan_len;
6292 u32 peer_operclass_len;
6293 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
6294 u32 is_peer_responder;
6295 u32 pref_offchan_num;
6296 u32 pref_offchan_bw;
6297};
6298
Vivek Natarajan08e75ea2015-08-04 10:45:11 +05306299enum wmi_txbf_conf {
6300 WMI_TXBF_CONF_UNSUPPORTED,
6301 WMI_TXBF_CONF_BEFORE_ASSOC,
6302 WMI_TXBF_CONF_AFTER_ASSOC,
6303};
6304
Maharaja62f77f02015-10-21 11:49:18 +03006305#define WMI_CCA_DETECT_LEVEL_AUTO 0
6306#define WMI_CCA_DETECT_MARGIN_AUTO 0
6307
6308struct wmi_pdev_set_adaptive_cca_params {
6309 __le32 enable;
6310 __le32 cca_detect_level;
6311 __le32 cca_detect_margin;
6312} __packed;
6313
Kalle Valo5e3dd152013-06-12 20:52:10 +03006314struct ath10k;
6315struct ath10k_vif;
Michal Kazior0226d602014-12-03 10:11:22 +02006316struct ath10k_fw_stats_pdev;
6317struct ath10k_fw_stats_peer;
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006318struct ath10k_fw_stats;
Kalle Valo5e3dd152013-06-12 20:52:10 +03006319
6320int ath10k_wmi_attach(struct ath10k *ar);
6321void ath10k_wmi_detach(struct ath10k *ar);
Vasanthakumar Thiagarajana925a372015-08-28 17:21:34 +05306322void ath10k_wmi_free_host_mem(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006323int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
6324int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006325
Michal Kazior0226d602014-12-03 10:11:22 +02006326struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
Michal Kazior95bf21f2014-05-16 17:15:39 +03006327int ath10k_wmi_connect(struct ath10k *ar);
Kalle Valo666a73f32014-09-10 18:23:23 +03006328
6329struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
6330int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
Michal Kaziord7579d12014-12-03 10:10:54 +02006331int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
6332 u32 cmd_id);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006333void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006334
Michal Kaziorb91251f2015-01-24 12:14:49 +02006335void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
6336 struct ath10k_fw_stats_pdev *dst);
6337void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
6338 struct ath10k_fw_stats_pdev *dst);
6339void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
6340 struct ath10k_fw_stats_pdev *dst);
6341void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
6342 struct ath10k_fw_stats_pdev *dst);
Michal Kazior0226d602014-12-03 10:11:22 +02006343void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
6344 struct ath10k_fw_stats_peer *dst);
6345void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
6346 struct wmi_host_mem_chunks *chunks);
6347void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
6348 const struct wmi_start_scan_arg *arg);
Michal Kazior5e752e42015-01-19 09:53:41 +01006349void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
6350 const struct wmi_wmm_params_arg *arg);
Michal Kazior0226d602014-12-03 10:11:22 +02006351void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
6352 const struct wmi_channel_arg *arg);
6353int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
6354
6355int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
6356int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
6357void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
6358void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
6359int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
6360void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
6361void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
6362void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
6363void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
6364void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
6365void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
6366void ath10k_wmi_event_dfs(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03006367 struct wmi_phyerr_ev_arg *phyerr, u64 tsf);
Michal Kazior0226d602014-12-03 10:11:22 +02006368void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03006369 struct wmi_phyerr_ev_arg *phyerr,
Michal Kazior0226d602014-12-03 10:11:22 +02006370 u64 tsf);
6371void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
6372void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
6373void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
6374void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
6375void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
6376void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
6377void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
6378 struct sk_buff *skb);
6379void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
6380 struct sk_buff *skb);
6381void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
6382void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
6383void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
6384void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
6385void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
6386void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
6387 struct sk_buff *skb);
6388void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
6389void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
6390void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
6391void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
6392 struct sk_buff *skb);
6393void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
6394void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
6395void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
6396void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
6397int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
Raja Mani991adf72015-08-14 11:13:29 +03006398int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf,
6399 int left_len, struct wmi_phyerr_ev_arg *arg);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006400void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar,
6401 struct ath10k_fw_stats *fw_stats,
6402 char *buf);
6403void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k *ar,
6404 struct ath10k_fw_stats *fw_stats,
6405 char *buf);
6406size_t ath10k_wmi_fw_stats_num_peers(struct list_head *head);
6407size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head);
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02006408void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
6409 struct ath10k_fw_stats *fw_stats,
6410 char *buf);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006411
Kalle Valo5e3dd152013-06-12 20:52:10 +03006412#endif /* _WMI_H_ */