blob: 6fb4961c1a04c2834a0f7e1169d71b48bdb7ef5f [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,
1589 WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
1590};
1591
1592enum wmi_10_4_event_id {
1593 WMI_10_4_SERVICE_READY_EVENTID = 0x8000,
1594 WMI_10_4_READY_EVENTID,
1595 WMI_10_4_DEBUG_MESG_EVENTID,
1596 WMI_10_4_START_EVENTID = 0x9000,
1597 WMI_10_4_END_EVENTID = 0x9FFF,
1598 WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID,
1599 WMI_10_4_ECHO_EVENTID,
1600 WMI_10_4_UPDATE_STATS_EVENTID,
1601 WMI_10_4_INST_RSSI_STATS_EVENTID,
1602 WMI_10_4_VDEV_START_RESP_EVENTID,
1603 WMI_10_4_VDEV_STANDBY_REQ_EVENTID,
1604 WMI_10_4_VDEV_RESUME_REQ_EVENTID,
1605 WMI_10_4_VDEV_STOPPED_EVENTID,
1606 WMI_10_4_PEER_STA_KICKOUT_EVENTID,
1607 WMI_10_4_HOST_SWBA_EVENTID,
1608 WMI_10_4_TBTTOFFSET_UPDATE_EVENTID,
1609 WMI_10_4_MGMT_RX_EVENTID,
1610 WMI_10_4_CHAN_INFO_EVENTID,
1611 WMI_10_4_PHYERR_EVENTID,
1612 WMI_10_4_ROAM_EVENTID,
1613 WMI_10_4_PROFILE_MATCH,
1614 WMI_10_4_DEBUG_PRINT_EVENTID,
1615 WMI_10_4_PDEV_QVIT_EVENTID,
1616 WMI_10_4_WLAN_PROFILE_DATA_EVENTID,
1617 WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID,
1618 WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID,
1619 WMI_10_4_RTT_ERROR_REPORT_EVENTID,
1620 WMI_10_4_RTT_KEEPALIVE_EVENTID,
1621 WMI_10_4_OEM_CAPABILITY_EVENTID,
1622 WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID,
1623 WMI_10_4_OEM_ERROR_REPORT_EVENTID,
1624 WMI_10_4_NAN_EVENTID,
1625 WMI_10_4_WOW_WAKEUP_HOST_EVENTID,
1626 WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID,
1627 WMI_10_4_GTK_REKEY_FAIL_EVENTID,
1628 WMI_10_4_DCS_INTERFERENCE_EVENTID,
1629 WMI_10_4_PDEV_TPC_CONFIG_EVENTID,
1630 WMI_10_4_CSA_HANDLING_EVENTID,
1631 WMI_10_4_GPIO_INPUT_EVENTID,
1632 WMI_10_4_PEER_RATECODE_LIST_EVENTID,
1633 WMI_10_4_GENERIC_BUFFER_EVENTID,
1634 WMI_10_4_MCAST_BUF_RELEASE_EVENTID,
1635 WMI_10_4_MCAST_LIST_AGEOUT_EVENTID,
1636 WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID,
1637 WMI_10_4_WDS_PEER_EVENTID,
1638 WMI_10_4_PEER_STA_PS_STATECHG_EVENTID,
1639 WMI_10_4_PDEV_FIPS_EVENTID,
1640 WMI_10_4_TT_STATS_EVENTID,
1641 WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID,
1642 WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID,
1643 WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID,
1644 WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID,
1645 WMI_10_4_PDEV_NFCAL_POWER_EVENTID,
1646 WMI_10_4_PDEV_TPC_EVENTID,
1647 WMI_10_4_PDEV_GET_AST_INFO_EVENTID,
1648 WMI_10_4_PDEV_TEMPERATURE_EVENTID,
1649 WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID,
1650 WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID,
1651 WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
1652};
1653
Kalle Valo5e3dd152013-06-12 20:52:10 +03001654enum wmi_phy_mode {
1655 MODE_11A = 0, /* 11a Mode */
1656 MODE_11G = 1, /* 11b/g Mode */
1657 MODE_11B = 2, /* 11b Mode */
1658 MODE_11GONLY = 3, /* 11g only Mode */
1659 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
1660 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
1661 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
1662 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
1663 MODE_11AC_VHT20 = 8,
1664 MODE_11AC_VHT40 = 9,
1665 MODE_11AC_VHT80 = 10,
1666 /* MODE_11AC_VHT160 = 11, */
1667 MODE_11AC_VHT20_2G = 11,
1668 MODE_11AC_VHT40_2G = 12,
1669 MODE_11AC_VHT80_2G = 13,
1670 MODE_UNKNOWN = 14,
1671 MODE_MAX = 14
1672};
1673
Kalle Valo38a1d472013-09-08 17:56:14 +03001674static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
1675{
1676 switch (mode) {
1677 case MODE_11A:
1678 return "11a";
1679 case MODE_11G:
1680 return "11g";
1681 case MODE_11B:
1682 return "11b";
1683 case MODE_11GONLY:
1684 return "11gonly";
1685 case MODE_11NA_HT20:
1686 return "11na-ht20";
1687 case MODE_11NG_HT20:
1688 return "11ng-ht20";
1689 case MODE_11NA_HT40:
1690 return "11na-ht40";
1691 case MODE_11NG_HT40:
1692 return "11ng-ht40";
1693 case MODE_11AC_VHT20:
1694 return "11ac-vht20";
1695 case MODE_11AC_VHT40:
1696 return "11ac-vht40";
1697 case MODE_11AC_VHT80:
1698 return "11ac-vht80";
1699 case MODE_11AC_VHT20_2G:
1700 return "11ac-vht20-2g";
1701 case MODE_11AC_VHT40_2G:
1702 return "11ac-vht40-2g";
1703 case MODE_11AC_VHT80_2G:
1704 return "11ac-vht80-2g";
1705 case MODE_UNKNOWN:
1706 /* skip */
1707 break;
1708
1709 /* no default handler to allow compiler to check that the
1710 * enum is fully handled */
1711 };
1712
1713 return "<unknown>";
1714}
1715
Kalle Valo5e3dd152013-06-12 20:52:10 +03001716#define WMI_CHAN_LIST_TAG 0x1
1717#define WMI_SSID_LIST_TAG 0x2
1718#define WMI_BSSID_LIST_TAG 0x3
1719#define WMI_IE_TAG 0x4
1720
1721struct wmi_channel {
1722 __le32 mhz;
1723 __le32 band_center_freq1;
1724 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
1725 union {
1726 __le32 flags; /* WMI_CHAN_FLAG_ */
1727 struct {
1728 u8 mode; /* only 6 LSBs */
1729 } __packed;
1730 } __packed;
1731 union {
1732 __le32 reginfo0;
1733 struct {
Michal Kazior02256932013-10-23 04:02:14 -07001734 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001735 u8 min_power;
1736 u8 max_power;
1737 u8 reg_power;
1738 u8 reg_classid;
1739 } __packed;
1740 } __packed;
1741 union {
1742 __le32 reginfo1;
1743 struct {
1744 u8 antenna_max;
1745 } __packed;
1746 } __packed;
1747} __packed;
1748
1749struct wmi_channel_arg {
1750 u32 freq;
1751 u32 band_center_freq1;
1752 bool passive;
1753 bool allow_ibss;
1754 bool allow_ht;
1755 bool allow_vht;
1756 bool ht40plus;
Marek Puzyniake8a50f82013-11-20 09:59:47 +02001757 bool chan_radar;
Michal Kazior02256932013-10-23 04:02:14 -07001758 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001759 u32 min_power;
1760 u32 max_power;
1761 u32 max_reg_power;
1762 u32 max_antenna_gain;
1763 u32 reg_class_id;
1764 enum wmi_phy_mode mode;
1765};
1766
1767enum wmi_channel_change_cause {
1768 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
1769 WMI_CHANNEL_CHANGE_CAUSE_CSA,
1770};
1771
1772#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
1773#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
1774#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
1775#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
1776#define WMI_CHAN_FLAG_DFS (1 << 10)
1777#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
1778#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
1779
1780/* Indicate reason for channel switch */
1781#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
1782
Raja Mani5c8726e2015-06-22 20:22:26 +05301783#define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */
1784#define WMI_10_4_MAX_SPATIAL_STREAM 4
Kalle Valo5e3dd152013-06-12 20:52:10 +03001785
1786/* HT Capabilities*/
1787#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
1788#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
1789#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
1790#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
1791#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
1792#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
1793#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
1794#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
1795#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
1796#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
1797#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
1798#define WMI_HT_CAP_HT40_SGI 0x0800
1799
1800#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
1801 WMI_HT_CAP_HT20_SGI | \
1802 WMI_HT_CAP_HT40_SGI | \
1803 WMI_HT_CAP_TX_STBC | \
1804 WMI_HT_CAP_RX_STBC | \
1805 WMI_HT_CAP_LDPC)
1806
Kalle Valo5e3dd152013-06-12 20:52:10 +03001807/*
1808 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
1809 * field. The fields not defined here are not supported, or reserved.
1810 * Do not change these masks and if you have to add new one follow the
1811 * bitmask as specified by 802.11ac draft.
1812 */
1813
1814#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
1815#define WMI_VHT_CAP_RX_LDPC 0x00000010
1816#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
1817#define WMI_VHT_CAP_TX_STBC 0x00000080
1818#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
1819#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
1820#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
1821#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
1822#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
1823#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
1824
1825/* The following also refer for max HT AMSDU */
1826#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
1827#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
1828#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
1829
1830#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
1831 WMI_VHT_CAP_RX_LDPC | \
1832 WMI_VHT_CAP_SGI_80MHZ | \
1833 WMI_VHT_CAP_TX_STBC | \
1834 WMI_VHT_CAP_RX_STBC_MASK | \
1835 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
1836 WMI_VHT_CAP_RX_FIXED_ANT | \
1837 WMI_VHT_CAP_TX_FIXED_ANT)
1838
1839/*
1840 * Interested readers refer to Rx/Tx MCS Map definition as defined in
1841 * 802.11ac
1842 */
1843#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
1844#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
1845#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
1846
1847enum {
1848 REGDMN_MODE_11A = 0x00001, /* 11a channels */
1849 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
1850 REGDMN_MODE_11B = 0x00004, /* 11b channels */
1851 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
1852 REGDMN_MODE_11G = 0x00008, /* XXX historical */
1853 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
1854 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
1855 REGDMN_MODE_XR = 0x00100, /* XR channels */
1856 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
1857 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
1858 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
1859 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
1860 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
1861 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
1862 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
1863 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
1864 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
1865 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
1866 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
1867 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
1868 REGDMN_MODE_ALL = 0xffffffff
1869};
1870
1871#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
1872#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
1873#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
1874
1875/* regulatory capabilities */
1876#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
1877#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
1878#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
1879#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
1880#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
1881#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
1882
1883struct hal_reg_capabilities {
1884 /* regdomain value specified in EEPROM */
1885 __le32 eeprom_rd;
1886 /*regdomain */
1887 __le32 eeprom_rd_ext;
1888 /* CAP1 capabilities bit map. */
1889 __le32 regcap1;
1890 /* REGDMN EEPROM CAP. */
1891 __le32 regcap2;
1892 /* REGDMN MODE */
1893 __le32 wireless_modes;
1894 __le32 low_2ghz_chan;
1895 __le32 high_2ghz_chan;
1896 __le32 low_5ghz_chan;
1897 __le32 high_5ghz_chan;
1898} __packed;
1899
1900enum wlan_mode_capability {
1901 WHAL_WLAN_11A_CAPABILITY = 0x1,
1902 WHAL_WLAN_11G_CAPABILITY = 0x2,
1903 WHAL_WLAN_11AG_CAPABILITY = 0x3,
1904};
1905
1906/* structure used by FW for requesting host memory */
1907struct wlan_host_mem_req {
1908 /* ID of the request */
1909 __le32 req_id;
1910 /* size of the of each unit */
1911 __le32 unit_size;
1912 /* flags to indicate that
1913 * the number units is dependent
1914 * on number of resources(num vdevs num peers .. etc)
1915 */
1916 __le32 num_unit_info;
1917 /*
1918 * actual number of units to allocate . if flags in the num_unit_info
1919 * indicate that number of units is tied to number of a particular
1920 * resource to allocate then num_units filed is set to 0 and host
1921 * will derive the number units from number of the resources it is
1922 * requesting.
1923 */
1924 __le32 num_units;
1925} __packed;
1926
Kalle Valo5e3dd152013-06-12 20:52:10 +03001927/*
1928 * The following struct holds optional payload for
1929 * wmi_service_ready_event,e.g., 11ac pass some of the
1930 * device capability to the host.
1931 */
1932struct wmi_service_ready_event {
1933 __le32 sw_version;
1934 __le32 sw_version_1;
1935 __le32 abi_version;
1936 /* WMI_PHY_CAPABILITY */
1937 __le32 phy_capability;
1938 /* Maximum number of frag table entries that SW will populate less 1 */
1939 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001940 __le32 wmi_service_bitmap[16];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001941 __le32 num_rf_chains;
1942 /*
1943 * The following field is only valid for service type
1944 * WMI_SERVICE_11AC
1945 */
1946 __le32 ht_cap_info; /* WMI HT Capability */
1947 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1948 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1949 __le32 hw_min_tx_power;
1950 __le32 hw_max_tx_power;
1951 struct hal_reg_capabilities hal_reg_capabilities;
1952 __le32 sys_cap_info;
1953 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1954 /*
1955 * Max beacon and Probe Response IE offload size
1956 * (includes optional P2P IEs)
1957 */
1958 __le32 max_bcn_ie_size;
1959 /*
1960 * request to host to allocate a chuck of memory and pss it down to FW
1961 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1962 * data structures. Only valid for low latency interfaces like PCIE
1963 * where FW can access this memory directly (or) by DMA.
1964 */
1965 __le32 num_mem_reqs;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001966 struct wlan_host_mem_req mem_reqs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001967} __packed;
1968
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001969/* This is the definition from 10.X firmware branch */
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001970struct wmi_10x_service_ready_event {
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001971 __le32 sw_version;
1972 __le32 abi_version;
1973
1974 /* WMI_PHY_CAPABILITY */
1975 __le32 phy_capability;
1976
1977 /* Maximum number of frag table entries that SW will populate less 1 */
1978 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001979 __le32 wmi_service_bitmap[16];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001980 __le32 num_rf_chains;
1981
1982 /*
1983 * The following field is only valid for service type
1984 * WMI_SERVICE_11AC
1985 */
1986 __le32 ht_cap_info; /* WMI HT Capability */
1987 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1988 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1989 __le32 hw_min_tx_power;
1990 __le32 hw_max_tx_power;
1991
1992 struct hal_reg_capabilities hal_reg_capabilities;
1993
1994 __le32 sys_cap_info;
1995 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1996
1997 /*
1998 * request to host to allocate a chuck of memory and pss it down to FW
1999 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
2000 * data structures. Only valid for low latency interfaces like PCIE
2001 * where FW can access this memory directly (or) by DMA.
2002 */
2003 __le32 num_mem_reqs;
2004
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02002005 struct wlan_host_mem_req mem_reqs[0];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02002006} __packed;
2007
Kalle Valo5e3dd152013-06-12 20:52:10 +03002008#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
2009#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
2010
2011struct wmi_ready_event {
2012 __le32 sw_version;
2013 __le32 abi_version;
2014 struct wmi_mac_addr mac_addr;
2015 __le32 status;
2016} __packed;
2017
2018struct wmi_resource_config {
2019 /* number of virtual devices (VAPs) to support */
2020 __le32 num_vdevs;
2021
2022 /* number of peer nodes to support */
2023 __le32 num_peers;
2024
2025 /*
2026 * In offload mode target supports features like WOW, chatter and
2027 * other protocol offloads. In order to support them some
2028 * functionalities like reorder buffering, PN checking need to be
2029 * done in target. This determines maximum number of peers suported
2030 * by target in offload mode
2031 */
2032 __le32 num_offload_peers;
2033
2034 /* For target-based RX reordering */
2035 __le32 num_offload_reorder_bufs;
2036
2037 /* number of keys per peer */
2038 __le32 num_peer_keys;
2039
2040 /* total number of TX/RX data TIDs */
2041 __le32 num_tids;
2042
2043 /*
2044 * max skid for resolving hash collisions
2045 *
2046 * The address search table is sparse, so that if two MAC addresses
2047 * result in the same hash value, the second of these conflicting
2048 * entries can slide to the next index in the address search table,
2049 * and use it, if it is unoccupied. This ast_skid_limit parameter
2050 * specifies the upper bound on how many subsequent indices to search
2051 * over to find an unoccupied space.
2052 */
2053 __le32 ast_skid_limit;
2054
2055 /*
2056 * the nominal chain mask for transmit
2057 *
2058 * The chain mask may be modified dynamically, e.g. to operate AP
2059 * tx with a reduced number of chains if no clients are associated.
2060 * This configuration parameter specifies the nominal chain-mask that
2061 * should be used when not operating with a reduced set of tx chains.
2062 */
2063 __le32 tx_chain_mask;
2064
2065 /*
2066 * the nominal chain mask for receive
2067 *
2068 * The chain mask may be modified dynamically, e.g. for a client
2069 * to use a reduced number of chains for receive if the traffic to
2070 * the client is low enough that it doesn't require downlink MIMO
2071 * or antenna diversity.
2072 * This configuration parameter specifies the nominal chain-mask that
2073 * should be used when not operating with a reduced set of rx chains.
2074 */
2075 __le32 rx_chain_mask;
2076
2077 /*
2078 * what rx reorder timeout (ms) to use for the AC
2079 *
2080 * Each WMM access class (voice, video, best-effort, background) will
2081 * have its own timeout value to dictate how long to wait for missing
2082 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2083 * already been received.
2084 * This parameter specifies the timeout in milliseconds for each
2085 * class.
2086 */
2087 __le32 rx_timeout_pri_vi;
2088 __le32 rx_timeout_pri_vo;
2089 __le32 rx_timeout_pri_be;
2090 __le32 rx_timeout_pri_bk;
2091
2092 /*
2093 * what mode the rx should decap packets to
2094 *
2095 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2096 * THis setting also determines the default TX behavior, however TX
2097 * behavior can be modified on a per VAP basis during VAP init
2098 */
2099 __le32 rx_decap_mode;
2100
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002101 /* what is the maximum number of scan requests that can be queued */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002102 __le32 scan_max_pending_reqs;
2103
2104 /* maximum VDEV that could use BMISS offload */
2105 __le32 bmiss_offload_max_vdev;
2106
2107 /* maximum VDEV that could use offload roaming */
2108 __le32 roam_offload_max_vdev;
2109
2110 /* maximum AP profiles that would push to offload roaming */
2111 __le32 roam_offload_max_ap_profiles;
2112
2113 /*
2114 * how many groups to use for mcast->ucast conversion
2115 *
2116 * The target's WAL maintains a table to hold information regarding
2117 * which peers belong to a given multicast group, so that if
2118 * multicast->unicast conversion is enabled, the target can convert
2119 * multicast tx frames to a series of unicast tx frames, to each
2120 * peer within the multicast group.
2121 This num_mcast_groups configuration parameter tells the target how
2122 * many multicast groups to provide storage for within its multicast
2123 * group membership table.
2124 */
2125 __le32 num_mcast_groups;
2126
2127 /*
2128 * size to alloc for the mcast membership table
2129 *
2130 * This num_mcast_table_elems configuration parameter tells the
2131 * target how many peer elements it needs to provide storage for in
2132 * its multicast group membership table.
2133 * These multicast group membership table elements are shared by the
2134 * multicast groups stored within the table.
2135 */
2136 __le32 num_mcast_table_elems;
2137
2138 /*
2139 * whether/how to do multicast->unicast conversion
2140 *
2141 * This configuration parameter specifies whether the target should
2142 * perform multicast --> unicast conversion on transmit, and if so,
2143 * what to do if it finds no entries in its multicast group
2144 * membership table for the multicast IP address in the tx frame.
2145 * Configuration value:
2146 * 0 -> Do not perform multicast to unicast conversion.
2147 * 1 -> Convert multicast frames to unicast, if the IP multicast
2148 * address from the tx frame is found in the multicast group
2149 * membership table. If the IP multicast address is not found,
2150 * drop the frame.
2151 * 2 -> 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 * transmit the frame as multicast.
2155 */
2156 __le32 mcast2ucast_mode;
2157
2158 /*
2159 * how much memory to allocate for a tx PPDU dbg log
2160 *
2161 * This parameter controls how much memory the target will allocate
2162 * to store a log of tx PPDU meta-information (how large the PPDU
2163 * was, when it was sent, whether it was successful, etc.)
2164 */
2165 __le32 tx_dbg_log_size;
2166
2167 /* how many AST entries to be allocated for WDS */
2168 __le32 num_wds_entries;
2169
2170 /*
2171 * MAC DMA burst size, e.g., For target PCI limit can be
2172 * 0 -default, 1 256B
2173 */
2174 __le32 dma_burst_size;
2175
2176 /*
2177 * Fixed delimiters to be inserted after every MPDU to
2178 * account for interface latency to avoid underrun.
2179 */
2180 __le32 mac_aggr_delim;
2181
2182 /*
2183 * determine whether target is responsible for detecting duplicate
2184 * non-aggregate MPDU and timing out stale fragments.
2185 *
2186 * A-MPDU reordering is always performed on the target.
2187 *
2188 * 0: target responsible for frag timeout and dup checking
2189 * 1: host responsible for frag timeout and dup checking
2190 */
2191 __le32 rx_skip_defrag_timeout_dup_detection_check;
2192
2193 /*
2194 * Configuration for VoW :
2195 * No of Video Nodes to be supported
2196 * and Max no of descriptors for each Video link (node).
2197 */
2198 __le32 vow_config;
2199
2200 /* maximum VDEV that could use GTK offload */
2201 __le32 gtk_offload_max_vdev;
2202
2203 /* Number of msdu descriptors target should use */
2204 __le32 num_msdu_desc;
2205
2206 /*
2207 * Max. number of Tx fragments per MSDU
2208 * This parameter controls the max number of Tx fragments per MSDU.
2209 * This is sent by the target as part of the WMI_SERVICE_READY event
2210 * and is overriden by the OS shim as required.
2211 */
2212 __le32 max_frag_entries;
2213} __packed;
2214
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002215struct wmi_resource_config_10x {
2216 /* number of virtual devices (VAPs) to support */
2217 __le32 num_vdevs;
2218
2219 /* number of peer nodes to support */
2220 __le32 num_peers;
2221
2222 /* number of keys per peer */
2223 __le32 num_peer_keys;
2224
2225 /* total number of TX/RX data TIDs */
2226 __le32 num_tids;
2227
2228 /*
2229 * max skid for resolving hash collisions
2230 *
2231 * The address search table is sparse, so that if two MAC addresses
2232 * result in the same hash value, the second of these conflicting
2233 * entries can slide to the next index in the address search table,
2234 * and use it, if it is unoccupied. This ast_skid_limit parameter
2235 * specifies the upper bound on how many subsequent indices to search
2236 * over to find an unoccupied space.
2237 */
2238 __le32 ast_skid_limit;
2239
2240 /*
2241 * the nominal chain mask for transmit
2242 *
2243 * The chain mask may be modified dynamically, e.g. to operate AP
2244 * tx with a reduced number of chains if no clients are associated.
2245 * This configuration parameter specifies the nominal chain-mask that
2246 * should be used when not operating with a reduced set of tx chains.
2247 */
2248 __le32 tx_chain_mask;
2249
2250 /*
2251 * the nominal chain mask for receive
2252 *
2253 * The chain mask may be modified dynamically, e.g. for a client
2254 * to use a reduced number of chains for receive if the traffic to
2255 * the client is low enough that it doesn't require downlink MIMO
2256 * or antenna diversity.
2257 * This configuration parameter specifies the nominal chain-mask that
2258 * should be used when not operating with a reduced set of rx chains.
2259 */
2260 __le32 rx_chain_mask;
2261
2262 /*
2263 * what rx reorder timeout (ms) to use for the AC
2264 *
2265 * Each WMM access class (voice, video, best-effort, background) will
2266 * have its own timeout value to dictate how long to wait for missing
2267 * rx MPDUs to arrive before flushing subsequent MPDUs that have
2268 * already been received.
2269 * This parameter specifies the timeout in milliseconds for each
2270 * class.
2271 */
2272 __le32 rx_timeout_pri_vi;
2273 __le32 rx_timeout_pri_vo;
2274 __le32 rx_timeout_pri_be;
2275 __le32 rx_timeout_pri_bk;
2276
2277 /*
2278 * what mode the rx should decap packets to
2279 *
2280 * MAC can decap to RAW (no decap), native wifi or Ethernet types
2281 * THis setting also determines the default TX behavior, however TX
2282 * behavior can be modified on a per VAP basis during VAP init
2283 */
2284 __le32 rx_decap_mode;
2285
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01002286 /* what is the maximum number of scan requests that can be queued */
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002287 __le32 scan_max_pending_reqs;
2288
2289 /* maximum VDEV that could use BMISS offload */
2290 __le32 bmiss_offload_max_vdev;
2291
2292 /* maximum VDEV that could use offload roaming */
2293 __le32 roam_offload_max_vdev;
2294
2295 /* maximum AP profiles that would push to offload roaming */
2296 __le32 roam_offload_max_ap_profiles;
2297
2298 /*
2299 * how many groups to use for mcast->ucast conversion
2300 *
2301 * The target's WAL maintains a table to hold information regarding
2302 * which peers belong to a given multicast group, so that if
2303 * multicast->unicast conversion is enabled, the target can convert
2304 * multicast tx frames to a series of unicast tx frames, to each
2305 * peer within the multicast group.
2306 This num_mcast_groups configuration parameter tells the target how
2307 * many multicast groups to provide storage for within its multicast
2308 * group membership table.
2309 */
2310 __le32 num_mcast_groups;
2311
2312 /*
2313 * size to alloc for the mcast membership table
2314 *
2315 * This num_mcast_table_elems configuration parameter tells the
2316 * target how many peer elements it needs to provide storage for in
2317 * its multicast group membership table.
2318 * These multicast group membership table elements are shared by the
2319 * multicast groups stored within the table.
2320 */
2321 __le32 num_mcast_table_elems;
2322
2323 /*
2324 * whether/how to do multicast->unicast conversion
2325 *
2326 * This configuration parameter specifies whether the target should
2327 * perform multicast --> unicast conversion on transmit, and if so,
2328 * what to do if it finds no entries in its multicast group
2329 * membership table for the multicast IP address in the tx frame.
2330 * Configuration value:
2331 * 0 -> Do not perform multicast to unicast conversion.
2332 * 1 -> Convert multicast frames to unicast, if the IP multicast
2333 * address from the tx frame is found in the multicast group
2334 * membership table. If the IP multicast address is not found,
2335 * drop the frame.
2336 * 2 -> 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 * transmit the frame as multicast.
2340 */
2341 __le32 mcast2ucast_mode;
2342
2343 /*
2344 * how much memory to allocate for a tx PPDU dbg log
2345 *
2346 * This parameter controls how much memory the target will allocate
2347 * to store a log of tx PPDU meta-information (how large the PPDU
2348 * was, when it was sent, whether it was successful, etc.)
2349 */
2350 __le32 tx_dbg_log_size;
2351
2352 /* how many AST entries to be allocated for WDS */
2353 __le32 num_wds_entries;
2354
2355 /*
2356 * MAC DMA burst size, e.g., For target PCI limit can be
2357 * 0 -default, 1 256B
2358 */
2359 __le32 dma_burst_size;
2360
2361 /*
2362 * Fixed delimiters to be inserted after every MPDU to
2363 * account for interface latency to avoid underrun.
2364 */
2365 __le32 mac_aggr_delim;
2366
2367 /*
2368 * determine whether target is responsible for detecting duplicate
2369 * non-aggregate MPDU and timing out stale fragments.
2370 *
2371 * A-MPDU reordering is always performed on the target.
2372 *
2373 * 0: target responsible for frag timeout and dup checking
2374 * 1: host responsible for frag timeout and dup checking
2375 */
2376 __le32 rx_skip_defrag_timeout_dup_detection_check;
2377
2378 /*
2379 * Configuration for VoW :
2380 * No of Video Nodes to be supported
2381 * and Max no of descriptors for each Video link (node).
2382 */
2383 __le32 vow_config;
2384
2385 /* Number of msdu descriptors target should use */
2386 __le32 num_msdu_desc;
2387
2388 /*
2389 * Max. number of Tx fragments per MSDU
2390 * This parameter controls the max number of Tx fragments per MSDU.
2391 * This is sent by the target as part of the WMI_SERVICE_READY event
2392 * and is overriden by the OS shim as required.
2393 */
2394 __le32 max_frag_entries;
2395} __packed;
2396
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002397enum wmi_10_2_feature_mask {
2398 WMI_10_2_RX_BATCH_MODE = BIT(0),
2399 WMI_10_2_ATF_CONFIG = BIT(1),
Yanbo Lide0c7892015-04-15 15:28:08 +03002400 WMI_10_2_COEX_GPIO = BIT(3),
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002401};
2402
Michal Kazior24c88f72014-07-25 13:32:17 +02002403struct wmi_resource_config_10_2 {
2404 struct wmi_resource_config_10x common;
2405 __le32 max_peer_ext_stats;
2406 __le32 smart_ant_cap; /* 0-disable, 1-enable */
2407 __le32 bk_min_free;
2408 __le32 be_min_free;
2409 __le32 vi_min_free;
2410 __le32 vo_min_free;
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02002411 __le32 feature_mask;
Michal Kazior24c88f72014-07-25 13:32:17 +02002412} __packed;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002413
Raja Manib0399412015-06-22 20:10:17 +05302414#define NUM_UNITS_IS_NUM_VDEVS BIT(0)
2415#define NUM_UNITS_IS_NUM_PEERS BIT(1)
2416#define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2)
Bartosz Markowskib3effe62013-09-26 17:47:11 +02002417
Raja Manid1e52a82015-06-22 20:10:15 +05302418struct wmi_resource_config_10_4 {
2419 /* Number of virtual devices (VAPs) to support */
2420 __le32 num_vdevs;
2421
2422 /* Number of peer nodes to support */
2423 __le32 num_peers;
2424
2425 /* Number of active peer nodes to support */
2426 __le32 num_active_peers;
2427
2428 /* In offload mode, target supports features like WOW, chatter and other
2429 * protocol offloads. In order to support them some functionalities like
2430 * reorder buffering, PN checking need to be done in target.
2431 * This determines maximum number of peers supported by target in
2432 * offload mode.
2433 */
2434 __le32 num_offload_peers;
2435
2436 /* Number of reorder buffers available for doing target based reorder
2437 * Rx reorder buffering
2438 */
2439 __le32 num_offload_reorder_buffs;
2440
2441 /* Number of keys per peer */
2442 __le32 num_peer_keys;
2443
2444 /* Total number of TX/RX data TIDs */
2445 __le32 num_tids;
2446
2447 /* Max skid for resolving hash collisions.
2448 * The address search table is sparse, so that if two MAC addresses
2449 * result in the same hash value, the second of these conflicting
2450 * entries can slide to the next index in the address search table,
2451 * and use it, if it is unoccupied. This ast_skid_limit parameter
2452 * specifies the upper bound on how many subsequent indices to search
2453 * over to find an unoccupied space.
2454 */
2455 __le32 ast_skid_limit;
2456
2457 /* The nominal chain mask for transmit.
2458 * The chain mask may be modified dynamically, e.g. to operate AP tx
2459 * with a reduced number of chains if no clients are associated.
2460 * This configuration parameter specifies the nominal chain-mask that
2461 * should be used when not operating with a reduced set of tx chains.
2462 */
2463 __le32 tx_chain_mask;
2464
2465 /* The nominal chain mask for receive.
2466 * The chain mask may be modified dynamically, e.g. for a client to use
2467 * a reduced number of chains for receive if the traffic to the client
2468 * is low enough that it doesn't require downlink MIMO or antenna
2469 * diversity. This configuration parameter specifies the nominal
2470 * chain-mask that should be used when not operating with a reduced
2471 * set of rx chains.
2472 */
2473 __le32 rx_chain_mask;
2474
2475 /* What rx reorder timeout (ms) to use for the AC.
2476 * Each WMM access class (voice, video, best-effort, background) will
2477 * have its own timeout value to dictate how long to wait for missing
2478 * rx MPDUs to arrive before flushing subsequent MPDUs that have already
2479 * been received. This parameter specifies the timeout in milliseconds
2480 * for each class.
2481 */
2482 __le32 rx_timeout_pri[4];
2483
2484 /* What mode the rx should decap packets to.
2485 * MAC can decap to RAW (no decap), native wifi or Ethernet types.
2486 * This setting also determines the default TX behavior, however TX
2487 * behavior can be modified on a per VAP basis during VAP init
2488 */
2489 __le32 rx_decap_mode;
2490
2491 __le32 scan_max_pending_req;
2492
2493 __le32 bmiss_offload_max_vdev;
2494
2495 __le32 roam_offload_max_vdev;
2496
2497 __le32 roam_offload_max_ap_profiles;
2498
2499 /* How many groups to use for mcast->ucast conversion.
2500 * The target's WAL maintains a table to hold information regarding
2501 * which peers belong to a given multicast group, so that if
2502 * multicast->unicast conversion is enabled, the target can convert
2503 * multicast tx frames to a series of unicast tx frames, to each peer
2504 * within the multicast group. This num_mcast_groups configuration
2505 * parameter tells the target how many multicast groups to provide
2506 * storage for within its multicast group membership table.
2507 */
2508 __le32 num_mcast_groups;
2509
2510 /* Size to alloc for the mcast membership table.
2511 * This num_mcast_table_elems configuration parameter tells the target
2512 * how many peer elements it needs to provide storage for in its
2513 * multicast group membership table. These multicast group membership
2514 * table elements are shared by the multicast groups stored within
2515 * the table.
2516 */
2517 __le32 num_mcast_table_elems;
2518
2519 /* Whether/how to do multicast->unicast conversion.
2520 * This configuration parameter specifies whether the target should
2521 * perform multicast --> unicast conversion on transmit, and if so,
2522 * what to do if it finds no entries in its multicast group membership
2523 * table for the multicast IP address in the tx frame.
2524 * Configuration value:
2525 * 0 -> Do not perform multicast to unicast conversion.
2526 * 1 -> Convert multicast frames to unicast, if the IP multicast address
2527 * from the tx frame is found in the multicast group membership
2528 * table. If the IP multicast address is not found, drop the frame
2529 * 2 -> Convert multicast frames to unicast, if the IP multicast address
2530 * from the tx frame is found in the multicast group membership
2531 * table. If the IP multicast address is not found, transmit the
2532 * frame as multicast.
2533 */
2534 __le32 mcast2ucast_mode;
2535
2536 /* How much memory to allocate for a tx PPDU dbg log.
2537 * This parameter controls how much memory the target will allocate to
2538 * store a log of tx PPDU meta-information (how large the PPDU was,
2539 * when it was sent, whether it was successful, etc.)
2540 */
2541 __le32 tx_dbg_log_size;
2542
2543 /* How many AST entries to be allocated for WDS */
2544 __le32 num_wds_entries;
2545
2546 /* MAC DMA burst size. 0 -default, 1 -256B */
2547 __le32 dma_burst_size;
2548
2549 /* Fixed delimiters to be inserted after every MPDU to account for
2550 * interface latency to avoid underrun.
2551 */
2552 __le32 mac_aggr_delim;
2553
2554 /* Determine whether target is responsible for detecting duplicate
2555 * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering
2556 * is always performed on the target.
2557 *
2558 * 0: target responsible for frag timeout and dup checking
2559 * 1: host responsible for frag timeout and dup checking
2560 */
2561 __le32 rx_skip_defrag_timeout_dup_detection_check;
2562
2563 /* Configuration for VoW : No of Video nodes to be supported and max
2564 * no of descriptors for each video link (node).
2565 */
2566 __le32 vow_config;
2567
2568 /* Maximum vdev that could use gtk offload */
2569 __le32 gtk_offload_max_vdev;
2570
2571 /* Number of msdu descriptors target should use */
2572 __le32 num_msdu_desc;
2573
2574 /* Max number of tx fragments per MSDU.
2575 * This parameter controls the max number of tx fragments per MSDU.
2576 * This will passed by target as part of the WMI_SERVICE_READY event
2577 * and is overridden by the OS shim as required.
2578 */
2579 __le32 max_frag_entries;
2580
2581 /* Max number of extended peer stats.
2582 * This parameter controls the max number of peers for which extended
2583 * statistics are supported by target
2584 */
2585 __le32 max_peer_ext_stats;
2586
2587 /* Smart antenna capabilities information.
2588 * 1 - Smart antenna is enabled
2589 * 0 - Smart antenna is disabled
2590 * In future this can contain smart antenna specific capabilities.
2591 */
2592 __le32 smart_ant_cap;
2593
2594 /* User can configure the buffers allocated for each AC (BE, BK, VI, VO)
2595 * during init.
2596 */
2597 __le32 bk_minfree;
2598 __le32 be_minfree;
2599 __le32 vi_minfree;
2600 __le32 vo_minfree;
2601
2602 /* Rx batch mode capability.
2603 * 1 - Rx batch mode enabled
2604 * 0 - Rx batch mode disabled
2605 */
2606 __le32 rx_batchmode;
2607
2608 /* Thermal throttling capability.
2609 * 1 - Capable of thermal throttling
2610 * 0 - Not capable of thermal throttling
2611 */
2612 __le32 tt_support;
2613
2614 /* ATF configuration.
2615 * 1 - Enable ATF
2616 * 0 - Disable ATF
2617 */
2618 __le32 atf_config;
2619
2620 /* Configure padding to manage IP header un-alignment
2621 * 1 - Enable padding
2622 * 0 - Disable padding
2623 */
2624 __le32 iphdr_pad_config;
2625
2626 /* qwrap configuration
2627 * 1 - This is qwrap configuration
2628 * 0 - This is not qwrap
2629 */
2630 __le32 qwrap_config;
2631} __packed;
2632
Kalle Valo5e3dd152013-06-12 20:52:10 +03002633/* strucutre describing host memory chunk. */
2634struct host_memory_chunk {
2635 /* id of the request that is passed up in service ready */
2636 __le32 req_id;
2637 /* the physical address the memory chunk */
2638 __le32 ptr;
2639 /* size of the chunk */
2640 __le32 size;
2641} __packed;
2642
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002643struct wmi_host_mem_chunks {
2644 __le32 count;
2645 /* some fw revisions require at least 1 chunk regardless of count */
2646 struct host_memory_chunk items[1];
2647} __packed;
2648
Kalle Valo5e3dd152013-06-12 20:52:10 +03002649struct wmi_init_cmd {
2650 struct wmi_resource_config resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002651 struct wmi_host_mem_chunks mem_chunks;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002652} __packed;
2653
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002654/* _10x stucture is from 10.X FW API */
2655struct wmi_init_cmd_10x {
2656 struct wmi_resource_config_10x resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002657 struct wmi_host_mem_chunks mem_chunks;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002658} __packed;
2659
Michal Kazior24c88f72014-07-25 13:32:17 +02002660struct wmi_init_cmd_10_2 {
2661 struct wmi_resource_config_10_2 resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002662 struct wmi_host_mem_chunks mem_chunks;
Michal Kazior24c88f72014-07-25 13:32:17 +02002663} __packed;
2664
Raja Manid1e52a82015-06-22 20:10:15 +05302665struct wmi_init_cmd_10_4 {
2666 struct wmi_resource_config_10_4 resource_config;
2667 struct wmi_host_mem_chunks mem_chunks;
2668} __packed;
2669
Michal Kazior24c88f72014-07-25 13:32:17 +02002670struct wmi_chan_list_entry {
2671 __le16 freq;
2672 u8 phy_mode; /* valid for 10.2 only */
2673 u8 reserved;
2674} __packed;
2675
Kalle Valo5e3dd152013-06-12 20:52:10 +03002676/* TLV for channel list */
2677struct wmi_chan_list {
2678 __le32 tag; /* WMI_CHAN_LIST_TAG */
2679 __le32 num_chan;
Michal Kazior24c88f72014-07-25 13:32:17 +02002680 struct wmi_chan_list_entry channel_list[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002681} __packed;
2682
2683struct wmi_bssid_list {
2684 __le32 tag; /* WMI_BSSID_LIST_TAG */
2685 __le32 num_bssid;
2686 struct wmi_mac_addr bssid_list[0];
2687} __packed;
2688
2689struct wmi_ie_data {
2690 __le32 tag; /* WMI_IE_TAG */
2691 __le32 ie_len;
2692 u8 ie_data[0];
2693} __packed;
2694
2695struct wmi_ssid {
2696 __le32 ssid_len;
2697 u8 ssid[32];
2698} __packed;
2699
2700struct wmi_ssid_list {
2701 __le32 tag; /* WMI_SSID_LIST_TAG */
2702 __le32 num_ssids;
2703 struct wmi_ssid ssids[0];
2704} __packed;
2705
2706/* prefix used by scan requestor ids on the host */
2707#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
2708
2709/* prefix used by scan request ids generated on the host */
2710/* host cycles through the lower 12 bits to generate ids */
2711#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
2712
2713#define WLAN_SCAN_PARAMS_MAX_SSID 16
2714#define WLAN_SCAN_PARAMS_MAX_BSSID 4
2715#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
2716
Michal Kaziordcca0bd2014-11-24 14:58:32 +01002717/* Values lower than this may be refused by some firmware revisions with a scan
2718 * completion with a timedout reason.
2719 */
2720#define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
2721
Kalle Valo5e3dd152013-06-12 20:52:10 +03002722/* Scan priority numbers must be sequential, starting with 0 */
2723enum wmi_scan_priority {
2724 WMI_SCAN_PRIORITY_VERY_LOW = 0,
2725 WMI_SCAN_PRIORITY_LOW,
2726 WMI_SCAN_PRIORITY_MEDIUM,
2727 WMI_SCAN_PRIORITY_HIGH,
2728 WMI_SCAN_PRIORITY_VERY_HIGH,
2729 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
2730};
2731
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002732struct wmi_start_scan_common {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002733 /* Scan ID */
2734 __le32 scan_id;
2735 /* Scan requestor ID */
2736 __le32 scan_req_id;
2737 /* VDEV id(interface) that is requesting scan */
2738 __le32 vdev_id;
2739 /* Scan Priority, input to scan scheduler */
2740 __le32 scan_priority;
2741 /* Scan events subscription */
2742 __le32 notify_scan_events;
2743 /* dwell time in msec on active channels */
2744 __le32 dwell_time_active;
2745 /* dwell time in msec on passive channels */
2746 __le32 dwell_time_passive;
2747 /*
2748 * min time in msec on the BSS channel,only valid if atleast one
2749 * VDEV is active
2750 */
2751 __le32 min_rest_time;
2752 /*
2753 * max rest time in msec on the BSS channel,only valid if at least
2754 * one VDEV is active
2755 */
2756 /*
2757 * the scanner will rest on the bss channel at least min_rest_time
2758 * after min_rest_time the scanner will start checking for tx/rx
2759 * activity on all VDEVs. if there is no activity the scanner will
2760 * switch to off channel. if there is activity the scanner will let
2761 * the radio on the bss channel until max_rest_time expires.at
2762 * max_rest_time scanner will switch to off channel irrespective of
2763 * activity. activity is determined by the idle_time parameter.
2764 */
2765 __le32 max_rest_time;
2766 /*
2767 * time before sending next set of probe requests.
2768 * The scanner keeps repeating probe requests transmission with
2769 * period specified by repeat_probe_time.
2770 * The number of probe requests specified depends on the ssid_list
2771 * and bssid_list
2772 */
2773 __le32 repeat_probe_time;
2774 /* time in msec between 2 consequetive probe requests with in a set. */
2775 __le32 probe_spacing_time;
2776 /*
2777 * data inactivity time in msec on bss channel that will be used by
2778 * scanner for measuring the inactivity.
2779 */
2780 __le32 idle_time;
2781 /* maximum time in msec allowed for scan */
2782 __le32 max_scan_time;
2783 /*
2784 * delay in msec before sending first probe request after switching
2785 * to a channel
2786 */
2787 __le32 probe_delay;
2788 /* Scan control flags */
2789 __le32 scan_ctrl_flags;
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002790} __packed;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002791
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002792struct wmi_start_scan_tlvs {
2793 /* TLV parameters. These includes channel list, ssid list, bssid list,
2794 * extra ies.
Kalle Valo5e3dd152013-06-12 20:52:10 +03002795 */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002796 u8 tlvs[0];
2797} __packed;
2798
2799struct wmi_start_scan_cmd {
2800 struct wmi_start_scan_common common;
2801 __le32 burst_duration_ms;
2802 struct wmi_start_scan_tlvs tlvs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002803} __packed;
2804
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002805/* This is the definition from 10.X firmware branch */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002806struct wmi_10x_start_scan_cmd {
2807 struct wmi_start_scan_common common;
2808 struct wmi_start_scan_tlvs tlvs;
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002809} __packed;
2810
Kalle Valo5e3dd152013-06-12 20:52:10 +03002811struct wmi_ssid_arg {
2812 int len;
2813 const u8 *ssid;
2814};
2815
2816struct wmi_bssid_arg {
2817 const u8 *bssid;
2818};
2819
2820struct wmi_start_scan_arg {
2821 u32 scan_id;
2822 u32 scan_req_id;
2823 u32 vdev_id;
2824 u32 scan_priority;
2825 u32 notify_scan_events;
2826 u32 dwell_time_active;
2827 u32 dwell_time_passive;
2828 u32 min_rest_time;
2829 u32 max_rest_time;
2830 u32 repeat_probe_time;
2831 u32 probe_spacing_time;
2832 u32 idle_time;
2833 u32 max_scan_time;
2834 u32 probe_delay;
2835 u32 scan_ctrl_flags;
Michal Kaziordbd3f9f2015-03-31 11:03:48 +00002836 u32 burst_duration_ms;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002837
2838 u32 ie_len;
2839 u32 n_channels;
2840 u32 n_ssids;
2841 u32 n_bssids;
2842
2843 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
Michal Kazior24c88f72014-07-25 13:32:17 +02002844 u16 channels[64];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002845 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
2846 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
2847};
2848
2849/* scan control flags */
2850
2851/* passively scan all channels including active channels */
2852#define WMI_SCAN_FLAG_PASSIVE 0x1
2853/* add wild card ssid probe request even though ssid_list is specified. */
2854#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
2855/* add cck rates to rates/xrate ie for the generated probe request */
2856#define WMI_SCAN_ADD_CCK_RATES 0x4
2857/* add ofdm rates to rates/xrate ie for the generated probe request */
2858#define WMI_SCAN_ADD_OFDM_RATES 0x8
2859/* To enable indication of Chan load and Noise floor to host */
2860#define WMI_SCAN_CHAN_STAT_EVENT 0x10
2861/* Filter Probe request frames */
2862#define WMI_SCAN_FILTER_PROBE_REQ 0x20
2863/* When set, DFS channels will not be scanned */
2864#define WMI_SCAN_BYPASS_DFS_CHN 0x40
2865/* Different FW scan engine may choose to bail out on errors.
2866 * Allow the driver to have influence over that. */
2867#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
2868
2869/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
2870#define WMI_SCAN_CLASS_MASK 0xFF000000
2871
Kalle Valo5e3dd152013-06-12 20:52:10 +03002872enum wmi_stop_scan_type {
2873 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
2874 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
2875 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
2876};
2877
2878struct wmi_stop_scan_cmd {
2879 __le32 scan_req_id;
2880 __le32 scan_id;
2881 __le32 req_type;
2882 __le32 vdev_id;
2883} __packed;
2884
2885struct wmi_stop_scan_arg {
2886 u32 req_id;
2887 enum wmi_stop_scan_type req_type;
2888 union {
2889 u32 scan_id;
2890 u32 vdev_id;
2891 } u;
2892};
2893
2894struct wmi_scan_chan_list_cmd {
2895 __le32 num_scan_chans;
2896 struct wmi_channel chan_info[0];
2897} __packed;
2898
2899struct wmi_scan_chan_list_arg {
2900 u32 n_channels;
2901 struct wmi_channel_arg *channels;
2902};
2903
2904enum wmi_bss_filter {
2905 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
2906 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
2907 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
2908 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
2909 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
2910 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
2911 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
2912 WMI_BSS_FILTER_LAST_BSS, /* marker only */
2913};
2914
2915enum wmi_scan_event_type {
Raja Manib2297ba2015-06-22 20:22:23 +05302916 WMI_SCAN_EVENT_STARTED = BIT(0),
2917 WMI_SCAN_EVENT_COMPLETED = BIT(1),
2918 WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2),
2919 WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3),
2920 WMI_SCAN_EVENT_DEQUEUED = BIT(4),
2921 /* possibly by high-prio scan */
2922 WMI_SCAN_EVENT_PREEMPTED = BIT(5),
2923 WMI_SCAN_EVENT_START_FAILED = BIT(6),
2924 WMI_SCAN_EVENT_RESTARTED = BIT(7),
2925 WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
2926 WMI_SCAN_EVENT_MAX = BIT(15),
Kalle Valo5e3dd152013-06-12 20:52:10 +03002927};
2928
2929enum wmi_scan_completion_reason {
2930 WMI_SCAN_REASON_COMPLETED,
2931 WMI_SCAN_REASON_CANCELLED,
2932 WMI_SCAN_REASON_PREEMPTED,
2933 WMI_SCAN_REASON_TIMEDOUT,
Raja Manib2297ba2015-06-22 20:22:23 +05302934 WMI_SCAN_REASON_INTERNAL_FAILURE,
Kalle Valo5e3dd152013-06-12 20:52:10 +03002935 WMI_SCAN_REASON_MAX,
2936};
2937
2938struct wmi_scan_event {
2939 __le32 event_type; /* %WMI_SCAN_EVENT_ */
2940 __le32 reason; /* %WMI_SCAN_REASON_ */
2941 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
2942 __le32 scan_req_id;
2943 __le32 scan_id;
2944 __le32 vdev_id;
2945} __packed;
2946
2947/*
2948 * This defines how much headroom is kept in the
2949 * receive frame between the descriptor and the
2950 * payload, in order for the WMI PHY error and
2951 * management handler to insert header contents.
2952 *
2953 * This is in bytes.
2954 */
2955#define WMI_MGMT_RX_HDR_HEADROOM 52
2956
2957/*
2958 * This event will be used for sending scan results
2959 * as well as rx mgmt frames to the host. The rx buffer
2960 * will be sent as part of this WMI event. It would be a
2961 * good idea to pass all the fields in the RX status
2962 * descriptor up to the host.
2963 */
Michal Kazior0d9b0432013-08-09 10:13:33 +02002964struct wmi_mgmt_rx_hdr_v1 {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002965 __le32 channel;
2966 __le32 snr;
2967 __le32 rate;
2968 __le32 phy_mode;
2969 __le32 buf_len;
2970 __le32 status; /* %WMI_RX_STATUS_ */
2971} __packed;
2972
Michal Kazior0d9b0432013-08-09 10:13:33 +02002973struct wmi_mgmt_rx_hdr_v2 {
2974 struct wmi_mgmt_rx_hdr_v1 v1;
2975 __le32 rssi_ctl[4];
2976} __packed;
2977
2978struct wmi_mgmt_rx_event_v1 {
2979 struct wmi_mgmt_rx_hdr_v1 hdr;
2980 u8 buf[0];
2981} __packed;
2982
2983struct wmi_mgmt_rx_event_v2 {
2984 struct wmi_mgmt_rx_hdr_v2 hdr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002985 u8 buf[0];
2986} __packed;
2987
Raja Mani1c092962015-06-22 20:10:16 +05302988struct wmi_10_4_mgmt_rx_hdr {
2989 __le32 channel;
2990 __le32 snr;
2991 u8 rssi_ctl[4];
2992 __le32 rate;
2993 __le32 phy_mode;
2994 __le32 buf_len;
2995 __le32 status;
2996} __packed;
2997
2998struct wmi_10_4_mgmt_rx_event {
2999 struct wmi_10_4_mgmt_rx_hdr hdr;
3000 u8 buf[0];
3001} __packed;
3002
Kalle Valo5e3dd152013-06-12 20:52:10 +03003003#define WMI_RX_STATUS_OK 0x00
3004#define WMI_RX_STATUS_ERR_CRC 0x01
3005#define WMI_RX_STATUS_ERR_DECRYPT 0x08
3006#define WMI_RX_STATUS_ERR_MIC 0x10
3007#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
3008
Raja Mani991adf72015-08-14 11:13:29 +03003009#define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26
3010#define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24
3011#define PHY_ERROR_GEN_RADAR 0x05
3012
Raja Mani2b0a2e02015-08-14 11:13:34 +03003013#define PHY_ERROR_10_4_RADAR_MASK 0x4
3014#define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000
3015
Raja Mani991adf72015-08-14 11:13:29 +03003016enum phy_err_type {
3017 PHY_ERROR_UNKNOWN,
3018 PHY_ERROR_SPECTRAL_SCAN,
3019 PHY_ERROR_FALSE_RADAR_EXT,
3020 PHY_ERROR_RADAR
3021};
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003022
Michal Kazior2332d0a2014-09-18 15:21:25 +02003023struct wmi_phyerr {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003024 __le32 tsf_timestamp;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003025 __le16 freq1;
3026 __le16 freq2;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003027 u8 rssi_combined;
3028 u8 chan_width_mhz;
3029 u8 phy_err_code;
3030 u8 rsvd0;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003031 __le32 rssi_chains[4];
3032 __le16 nf_chains[4];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003033 __le32 buf_len;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003034 u8 buf[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003035} __packed;
3036
Michal Kazior2332d0a2014-09-18 15:21:25 +02003037struct wmi_phyerr_event {
3038 __le32 num_phyerrs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003039 __le32 tsf_l32;
3040 __le32 tsf_u32;
Michal Kazior2332d0a2014-09-18 15:21:25 +02003041 struct wmi_phyerr phyerrs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03003042} __packed;
3043
Raja Mani2b0a2e02015-08-14 11:13:34 +03003044struct wmi_10_4_phyerr_event {
3045 __le32 tsf_l32;
3046 __le32 tsf_u32;
3047 __le16 freq1;
3048 __le16 freq2;
3049 u8 rssi_combined;
3050 u8 chan_width_mhz;
3051 u8 phy_err_code;
3052 u8 rsvd0;
3053 __le32 rssi_chains[4];
3054 __le16 nf_chains[4];
3055 __le32 phy_err_mask[2];
3056 __le32 tsf_timestamp;
3057 __le32 buf_len;
3058 u8 buf[0];
3059} __packed;
3060
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003061#define PHYERR_TLV_SIG 0xBB
3062#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
3063#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
Simon Wunderlich855aed12014-08-02 09:12:54 +03003064#define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003065
3066struct phyerr_radar_report {
3067 __le32 reg0; /* RADAR_REPORT_REG0_* */
3068 __le32 reg1; /* REDAR_REPORT_REG1_* */
3069} __packed;
3070
3071#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
3072#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
3073
3074#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
3075#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
3076
3077#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
3078#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
3079
3080#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
3081#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
3082
3083#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
3084#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
3085
3086#define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
3087#define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
3088
3089#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
3090#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
3091
3092#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
3093#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
3094
3095#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
3096#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
3097
3098#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
3099#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
3100
3101#define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
3102#define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
3103
3104struct phyerr_fft_report {
3105 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
3106 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
3107} __packed;
3108
3109#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
3110#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
3111
3112#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
3113#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
3114
3115#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
3116#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
3117
3118#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
3119#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
3120
3121#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
3122#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
3123
3124#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
3125#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
3126
3127#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
3128#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
3129
3130#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
3131#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
3132
Janusz Dziedzic9702c682013-11-20 09:59:41 +02003133struct phyerr_tlv {
3134 __le16 len;
3135 u8 tag;
3136 u8 sig;
3137} __packed;
3138
3139#define DFS_RSSI_POSSIBLY_FALSE 50
3140#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
3141
Kalle Valo5e3dd152013-06-12 20:52:10 +03003142struct wmi_mgmt_tx_hdr {
3143 __le32 vdev_id;
3144 struct wmi_mac_addr peer_macaddr;
3145 __le32 tx_rate;
3146 __le32 tx_power;
3147 __le32 buf_len;
3148} __packed;
3149
3150struct wmi_mgmt_tx_cmd {
3151 struct wmi_mgmt_tx_hdr hdr;
3152 u8 buf[0];
3153} __packed;
3154
3155struct wmi_echo_event {
3156 __le32 value;
3157} __packed;
3158
3159struct wmi_echo_cmd {
3160 __le32 value;
3161} __packed;
3162
Kalle Valo5e3dd152013-06-12 20:52:10 +03003163struct wmi_pdev_set_regdomain_cmd {
3164 __le32 reg_domain;
3165 __le32 reg_domain_2G;
3166 __le32 reg_domain_5G;
3167 __le32 conformance_test_limit_2G;
3168 __le32 conformance_test_limit_5G;
3169} __packed;
3170
Marek Puzyniak821af6a2014-03-21 17:46:57 +02003171enum wmi_dfs_region {
3172 /* Uninitialized dfs domain */
3173 WMI_UNINIT_DFS_DOMAIN = 0,
3174
3175 /* FCC3 dfs domain */
3176 WMI_FCC_DFS_DOMAIN = 1,
3177
3178 /* ETSI dfs domain */
3179 WMI_ETSI_DFS_DOMAIN = 2,
3180
3181 /*Japan dfs domain */
3182 WMI_MKK4_DFS_DOMAIN = 3,
3183};
3184
3185struct wmi_pdev_set_regdomain_cmd_10x {
3186 __le32 reg_domain;
3187 __le32 reg_domain_2G;
3188 __le32 reg_domain_5G;
3189 __le32 conformance_test_limit_2G;
3190 __le32 conformance_test_limit_5G;
3191
3192 /* dfs domain from wmi_dfs_region */
3193 __le32 dfs_domain;
3194} __packed;
3195
Kalle Valo5e3dd152013-06-12 20:52:10 +03003196/* Command to set/unset chip in quiet mode */
3197struct wmi_pdev_set_quiet_cmd {
3198 /* period in TUs */
3199 __le32 period;
3200
3201 /* duration in TUs */
3202 __le32 duration;
3203
3204 /* offset in TUs */
3205 __le32 next_start;
3206
3207 /* enable/disable */
3208 __le32 enabled;
3209} __packed;
3210
Kalle Valo5e3dd152013-06-12 20:52:10 +03003211/*
3212 * 802.11g protection mode.
3213 */
3214enum ath10k_protmode {
3215 ATH10K_PROT_NONE = 0, /* no protection */
3216 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
3217 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
3218};
3219
Marek Kwaczynskie81bd102014-03-11 12:58:00 +02003220enum wmi_rtscts_profile {
3221 WMI_RTSCTS_FOR_NO_RATESERIES = 0,
3222 WMI_RTSCTS_FOR_SECOND_RATESERIES,
3223 WMI_RTSCTS_ACROSS_SW_RETRIES
3224};
3225
3226#define WMI_RTSCTS_ENABLED 1
3227#define WMI_RTSCTS_SET_MASK 0x0f
3228#define WMI_RTSCTS_SET_LSB 0
3229
3230#define WMI_RTSCTS_PROFILE_MASK 0xf0
3231#define WMI_RTSCTS_PROFILE_LSB 4
3232
Kalle Valo5e3dd152013-06-12 20:52:10 +03003233enum wmi_beacon_gen_mode {
3234 WMI_BEACON_STAGGERED_MODE = 0,
3235 WMI_BEACON_BURST_MODE = 1
3236};
3237
3238enum wmi_csa_event_ies_present_flag {
3239 WMI_CSA_IE_PRESENT = 0x00000001,
3240 WMI_XCSA_IE_PRESENT = 0x00000002,
3241 WMI_WBW_IE_PRESENT = 0x00000004,
3242 WMI_CSWARP_IE_PRESENT = 0x00000008,
3243};
3244
3245/* wmi CSA receive event from beacon frame */
3246struct wmi_csa_event {
3247 __le32 i_fc_dur;
3248 /* Bit 0-15: FC */
3249 /* Bit 16-31: DUR */
3250 struct wmi_mac_addr i_addr1;
3251 struct wmi_mac_addr i_addr2;
3252 __le32 csa_ie[2];
3253 __le32 xcsa_ie[2];
3254 __le32 wb_ie[2];
3255 __le32 cswarp_ie;
3256 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
3257} __packed;
3258
3259/* the definition of different PDEV parameters */
3260#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3261#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
3262#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
3263
Bartosz Markowski226a3392013-09-26 17:47:16 +02003264struct wmi_pdev_param_map {
3265 u32 tx_chain_mask;
3266 u32 rx_chain_mask;
3267 u32 txpower_limit2g;
3268 u32 txpower_limit5g;
3269 u32 txpower_scale;
3270 u32 beacon_gen_mode;
3271 u32 beacon_tx_mode;
3272 u32 resmgr_offchan_mode;
3273 u32 protection_mode;
3274 u32 dynamic_bw;
3275 u32 non_agg_sw_retry_th;
3276 u32 agg_sw_retry_th;
3277 u32 sta_kickout_th;
3278 u32 ac_aggrsize_scaling;
3279 u32 ltr_enable;
3280 u32 ltr_ac_latency_be;
3281 u32 ltr_ac_latency_bk;
3282 u32 ltr_ac_latency_vi;
3283 u32 ltr_ac_latency_vo;
3284 u32 ltr_ac_latency_timeout;
3285 u32 ltr_sleep_override;
3286 u32 ltr_rx_override;
3287 u32 ltr_tx_activity_timeout;
3288 u32 l1ss_enable;
3289 u32 dsleep_enable;
3290 u32 pcielp_txbuf_flush;
3291 u32 pcielp_txbuf_watermark;
3292 u32 pcielp_txbuf_tmo_en;
3293 u32 pcielp_txbuf_tmo_value;
3294 u32 pdev_stats_update_period;
3295 u32 vdev_stats_update_period;
3296 u32 peer_stats_update_period;
3297 u32 bcnflt_stats_update_period;
3298 u32 pmf_qos;
3299 u32 arp_ac_override;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003300 u32 dcs;
3301 u32 ani_enable;
3302 u32 ani_poll_period;
3303 u32 ani_listen_period;
3304 u32 ani_ofdm_level;
3305 u32 ani_cck_level;
3306 u32 dyntxchain;
3307 u32 proxy_sta;
3308 u32 idle_ps_config;
3309 u32 power_gating_sleep;
3310 u32 fast_channel_reset;
3311 u32 burst_dur;
3312 u32 burst_enable;
Peter Oha7bd3e92014-12-02 13:07:14 +02003313 u32 cal_period;
Raja Manid86561f2015-06-22 20:10:14 +05303314 u32 aggr_burst;
3315 u32 rx_decap_mode;
3316 u32 smart_antenna_default_antenna;
3317 u32 igmpmld_override;
3318 u32 igmpmld_tid;
3319 u32 antenna_gain;
3320 u32 rx_filter;
3321 u32 set_mcast_to_ucast_tid;
3322 u32 proxy_sta_mode;
3323 u32 set_mcast2ucast_mode;
3324 u32 set_mcast2ucast_buffer;
3325 u32 remove_mcast2ucast_buffer;
3326 u32 peer_sta_ps_statechg_enable;
3327 u32 igmpmld_ac_override;
3328 u32 block_interbss;
3329 u32 set_disable_reset_cmdid;
3330 u32 set_msdu_ttl_cmdid;
3331 u32 set_ppdu_duration_cmdid;
3332 u32 txbf_sound_period_cmdid;
3333 u32 set_promisc_mode_cmdid;
3334 u32 set_burst_mode_cmdid;
3335 u32 en_stats;
3336 u32 mu_group_policy;
3337 u32 noise_detection;
3338 u32 noise_threshold;
3339 u32 dpd_enable;
3340 u32 set_mcast_bcast_echo;
3341 u32 atf_strict_sch;
3342 u32 atf_sched_duration;
3343 u32 ant_plzn;
3344 u32 mgmt_retry_limit;
3345 u32 sensitivity_level;
3346 u32 signed_txpower_2g;
3347 u32 signed_txpower_5g;
3348 u32 enable_per_tid_amsdu;
3349 u32 enable_per_tid_ampdu;
3350 u32 cca_threshold;
3351 u32 rts_fixed_rate;
3352 u32 pdev_reset;
3353 u32 wapi_mbssid_offset;
3354 u32 arp_srcaddr;
3355 u32 arp_dstaddr;
Bartosz Markowski226a3392013-09-26 17:47:16 +02003356};
3357
3358#define WMI_PDEV_PARAM_UNSUPPORTED 0
3359
Kalle Valo5e3dd152013-06-12 20:52:10 +03003360enum wmi_pdev_param {
Ben Greeard0e0a552014-05-14 16:56:14 +03003361 /* TX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003362 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
Ben Greeard0e0a552014-05-14 16:56:14 +03003363 /* RX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003364 WMI_PDEV_PARAM_RX_CHAIN_MASK,
3365 /* TX power limit for 2G Radio */
3366 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
3367 /* TX power limit for 5G Radio */
3368 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
3369 /* TX power scale */
3370 WMI_PDEV_PARAM_TXPOWER_SCALE,
3371 /* Beacon generation mode . 0: host, 1: target */
3372 WMI_PDEV_PARAM_BEACON_GEN_MODE,
3373 /* Beacon generation mode . 0: staggered 1: bursted */
3374 WMI_PDEV_PARAM_BEACON_TX_MODE,
3375 /*
3376 * Resource manager off chan mode .
3377 * 0: turn off off chan mode. 1: turn on offchan mode
3378 */
3379 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3380 /*
3381 * Protection mode:
3382 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3383 */
3384 WMI_PDEV_PARAM_PROTECTION_MODE,
Michal Kaziorc4dd0d02013-11-13 11:05:10 +01003385 /*
3386 * Dynamic bandwidth - 0: disable, 1: enable
3387 *
3388 * When enabled HW rate control tries different bandwidths when
3389 * retransmitting frames.
3390 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003391 WMI_PDEV_PARAM_DYNAMIC_BW,
3392 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3393 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3394 /* aggregrate sw retry threshold. 0-disable*/
3395 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
3396 /* Station kickout threshold (non of consecutive failures).0-disable */
3397 WMI_PDEV_PARAM_STA_KICKOUT_TH,
3398 /* Aggerate size scaling configuration per AC */
3399 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3400 /* LTR enable */
3401 WMI_PDEV_PARAM_LTR_ENABLE,
3402 /* LTR latency for BE, in us */
3403 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
3404 /* LTR latency for BK, in us */
3405 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
3406 /* LTR latency for VI, in us */
3407 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
3408 /* LTR latency for VO, in us */
3409 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
3410 /* LTR AC latency timeout, in ms */
3411 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3412 /* LTR platform latency override, in us */
3413 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3414 /* LTR-RX override, in us */
3415 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
3416 /* Tx activity timeout for LTR, in us */
3417 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3418 /* L1SS state machine enable */
3419 WMI_PDEV_PARAM_L1SS_ENABLE,
3420 /* Deep sleep state machine enable */
3421 WMI_PDEV_PARAM_DSLEEP_ENABLE,
3422 /* RX buffering flush enable */
3423 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3424 /* RX buffering matermark */
3425 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3426 /* RX buffering timeout enable */
3427 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3428 /* RX buffering timeout value */
3429 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3430 /* pdev level stats update period in ms */
3431 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3432 /* vdev level stats update period in ms */
3433 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3434 /* peer level stats update period in ms */
3435 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3436 /* beacon filter status update period */
3437 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3438 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3439 WMI_PDEV_PARAM_PMF_QOS,
3440 /* Access category on which ARP frames are sent */
3441 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
3442 /* DCS configuration */
3443 WMI_PDEV_PARAM_DCS,
3444 /* Enable/Disable ANI on target */
3445 WMI_PDEV_PARAM_ANI_ENABLE,
3446 /* configure the ANI polling period */
3447 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
3448 /* configure the ANI listening period */
3449 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
3450 /* configure OFDM immunity level */
3451 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
3452 /* configure CCK immunity level */
3453 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
3454 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3455 WMI_PDEV_PARAM_DYNTXCHAIN,
3456 /* Enable/Disable proxy STA */
3457 WMI_PDEV_PARAM_PROXY_STA,
3458 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
3459 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
3460 /* Enable/Disable power gating sleep */
3461 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
3462};
3463
Bartosz Markowski226a3392013-09-26 17:47:16 +02003464enum wmi_10x_pdev_param {
3465 /* TX chian mask */
3466 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3467 /* RX chian mask */
3468 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
3469 /* TX power limit for 2G Radio */
3470 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
3471 /* TX power limit for 5G Radio */
3472 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
3473 /* TX power scale */
3474 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
3475 /* Beacon generation mode . 0: host, 1: target */
3476 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
3477 /* Beacon generation mode . 0: staggered 1: bursted */
3478 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
3479 /*
3480 * Resource manager off chan mode .
3481 * 0: turn off off chan mode. 1: turn on offchan mode
3482 */
3483 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3484 /*
3485 * Protection mode:
3486 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
3487 */
3488 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
3489 /* Dynamic bandwidth 0: disable 1: enable */
3490 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
3491 /* Non aggregrate/ 11g sw retry threshold.0-disable */
3492 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3493 /* aggregrate sw retry threshold. 0-disable*/
3494 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
3495 /* Station kickout threshold (non of consecutive failures).0-disable */
3496 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
3497 /* Aggerate size scaling configuration per AC */
3498 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3499 /* LTR enable */
3500 WMI_10X_PDEV_PARAM_LTR_ENABLE,
3501 /* LTR latency for BE, in us */
3502 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
3503 /* LTR latency for BK, in us */
3504 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
3505 /* LTR latency for VI, in us */
3506 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
3507 /* LTR latency for VO, in us */
3508 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
3509 /* LTR AC latency timeout, in ms */
3510 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3511 /* LTR platform latency override, in us */
3512 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3513 /* LTR-RX override, in us */
3514 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
3515 /* Tx activity timeout for LTR, in us */
3516 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3517 /* L1SS state machine enable */
3518 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
3519 /* Deep sleep state machine enable */
3520 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
3521 /* pdev level stats update period in ms */
3522 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3523 /* vdev level stats update period in ms */
3524 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3525 /* peer level stats update period in ms */
3526 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3527 /* beacon filter status update period */
3528 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3529 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
3530 WMI_10X_PDEV_PARAM_PMF_QOS,
3531 /* Access category on which ARP and DHCP frames are sent */
3532 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
3533 /* DCS configuration */
3534 WMI_10X_PDEV_PARAM_DCS,
3535 /* Enable/Disable ANI on target */
3536 WMI_10X_PDEV_PARAM_ANI_ENABLE,
3537 /* configure the ANI polling period */
3538 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
3539 /* configure the ANI listening period */
3540 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
3541 /* configure OFDM immunity level */
3542 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
3543 /* configure CCK immunity level */
3544 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
3545 /* Enable/Disable CDD for 1x1 STAs in rate control module */
3546 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
3547 /* Enable/Disable Fast channel reset*/
3548 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
3549 /* Set Bursting DUR */
3550 WMI_10X_PDEV_PARAM_BURST_DUR,
3551 /* Set Bursting Enable*/
3552 WMI_10X_PDEV_PARAM_BURST_ENABLE,
Michal Kazior24c88f72014-07-25 13:32:17 +02003553
3554 /* following are available as of firmware 10.2 */
3555 WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3556 WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
3557 WMI_10X_PDEV_PARAM_IGMPMLD_TID,
3558 WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
3559 WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
3560 WMI_10X_PDEV_PARAM_RX_FILTER,
3561 WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
3562 WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
3563 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3564 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3565 WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
Peter Ohb43bf972014-12-02 13:06:53 +02003566 WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
3567 WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
3568 WMI_10X_PDEV_PARAM_CAL_PERIOD
Bartosz Markowski226a3392013-09-26 17:47:16 +02003569};
3570
Raja Manid86561f2015-06-22 20:10:14 +05303571enum wmi_10_4_pdev_param {
3572 WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
3573 WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK,
3574 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G,
3575 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G,
3576 WMI_10_4_PDEV_PARAM_TXPOWER_SCALE,
3577 WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE,
3578 WMI_10_4_PDEV_PARAM_BEACON_TX_MODE,
3579 WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
3580 WMI_10_4_PDEV_PARAM_PROTECTION_MODE,
3581 WMI_10_4_PDEV_PARAM_DYNAMIC_BW,
3582 WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
3583 WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH,
3584 WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH,
3585 WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING,
3586 WMI_10_4_PDEV_PARAM_LTR_ENABLE,
3587 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE,
3588 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK,
3589 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI,
3590 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO,
3591 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
3592 WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
3593 WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE,
3594 WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
3595 WMI_10_4_PDEV_PARAM_L1SS_ENABLE,
3596 WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE,
3597 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
3598 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
3599 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
3600 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
3601 WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
3602 WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
3603 WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
3604 WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
3605 WMI_10_4_PDEV_PARAM_PMF_QOS,
3606 WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE,
3607 WMI_10_4_PDEV_PARAM_DCS,
3608 WMI_10_4_PDEV_PARAM_ANI_ENABLE,
3609 WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD,
3610 WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD,
3611 WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL,
3612 WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL,
3613 WMI_10_4_PDEV_PARAM_DYNTXCHAIN,
3614 WMI_10_4_PDEV_PARAM_PROXY_STA,
3615 WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG,
3616 WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP,
3617 WMI_10_4_PDEV_PARAM_AGGR_BURST,
3618 WMI_10_4_PDEV_PARAM_RX_DECAP_MODE,
3619 WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET,
3620 WMI_10_4_PDEV_PARAM_BURST_DUR,
3621 WMI_10_4_PDEV_PARAM_BURST_ENABLE,
3622 WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
3623 WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE,
3624 WMI_10_4_PDEV_PARAM_IGMPMLD_TID,
3625 WMI_10_4_PDEV_PARAM_ANTENNA_GAIN,
3626 WMI_10_4_PDEV_PARAM_RX_FILTER,
3627 WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID,
3628 WMI_10_4_PDEV_PARAM_PROXY_STA_MODE,
3629 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE,
3630 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
3631 WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
3632 WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE,
3633 WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE,
3634 WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS,
3635 WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID,
3636 WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID,
3637 WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID,
3638 WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID,
3639 WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
3640 WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID,
3641 WMI_10_4_PDEV_PARAM_EN_STATS,
3642 WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY,
3643 WMI_10_4_PDEV_PARAM_NOISE_DETECTION,
3644 WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD,
3645 WMI_10_4_PDEV_PARAM_DPD_ENABLE,
3646 WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO,
3647 WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH,
3648 WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION,
3649 WMI_10_4_PDEV_PARAM_ANT_PLZN,
3650 WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT,
3651 WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL,
3652 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G,
3653 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G,
3654 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU,
3655 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU,
3656 WMI_10_4_PDEV_PARAM_CCA_THRESHOLD,
3657 WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE,
3658 WMI_10_4_PDEV_PARAM_CAL_PERIOD,
3659 WMI_10_4_PDEV_PARAM_PDEV_RESET,
3660 WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET,
3661 WMI_10_4_PDEV_PARAM_ARP_SRCADDR,
3662 WMI_10_4_PDEV_PARAM_ARP_DSTADDR,
3663};
3664
Kalle Valo5e3dd152013-06-12 20:52:10 +03003665struct wmi_pdev_set_param_cmd {
3666 __le32 param_id;
3667 __le32 param_value;
3668} __packed;
3669
Peter Oha7bd3e92014-12-02 13:07:14 +02003670/* valid period is 1 ~ 60000ms, unit in millisecond */
3671#define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
3672
Kalle Valo5e3dd152013-06-12 20:52:10 +03003673struct wmi_pdev_get_tpc_config_cmd {
3674 /* parameter */
3675 __le32 param;
3676} __packed;
3677
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03003678#define WMI_TPC_CONFIG_PARAM 1
Kalle Valo5e3dd152013-06-12 20:52:10 +03003679#define WMI_TPC_RATE_MAX 160
3680#define WMI_TPC_TX_N_CHAIN 4
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03003681#define WMI_TPC_PREAM_TABLE_MAX 10
3682#define WMI_TPC_FLAG 3
3683#define WMI_TPC_BUF_SIZE 10
3684
3685enum wmi_tpc_table_type {
3686 WMI_TPC_TABLE_TYPE_CDD = 0,
3687 WMI_TPC_TABLE_TYPE_STBC = 1,
3688 WMI_TPC_TABLE_TYPE_TXBF = 2,
3689};
Kalle Valo5e3dd152013-06-12 20:52:10 +03003690
3691enum wmi_tpc_config_event_flag {
3692 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
3693 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
3694 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
3695};
3696
3697struct wmi_pdev_tpc_config_event {
3698 __le32 reg_domain;
3699 __le32 chan_freq;
3700 __le32 phy_mode;
3701 __le32 twice_antenna_reduction;
3702 __le32 twice_max_rd_power;
Kalle Valo3b8fc902015-10-05 17:56:37 +03003703 a_sle32 twice_antenna_gain;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003704 __le32 power_limit;
3705 __le32 rate_max;
3706 __le32 num_tx_chain;
3707 __le32 ctl;
3708 __le32 flags;
3709 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
3710 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3711 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3712 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
3713 u8 rates_array[WMI_TPC_RATE_MAX];
3714} __packed;
3715
3716/* Transmit power scale factor. */
3717enum wmi_tp_scale {
3718 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
3719 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
3720 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
3721 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
3722 WMI_TP_SCALE_MIN = 4, /* min, but still on */
3723 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
3724};
3725
Kalle Valo5e3dd152013-06-12 20:52:10 +03003726struct wmi_pdev_chanlist_update_event {
3727 /* number of channels */
3728 __le32 num_chan;
3729 /* array of channels */
3730 struct wmi_channel channel_list[1];
3731} __packed;
3732
3733#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
3734
3735struct wmi_debug_mesg_event {
3736 /* message buffer, NULL terminated */
3737 char bufp[WMI_MAX_DEBUG_MESG];
3738} __packed;
3739
3740enum {
3741 /* P2P device */
3742 VDEV_SUBTYPE_P2PDEV = 0,
3743 /* P2P client */
3744 VDEV_SUBTYPE_P2PCLI,
3745 /* P2P GO */
3746 VDEV_SUBTYPE_P2PGO,
3747 /* BT3.0 HS */
3748 VDEV_SUBTYPE_BT,
3749};
3750
3751struct wmi_pdev_set_channel_cmd {
3752 /* idnore power , only use flags , mode and freq */
3753 struct wmi_channel chan;
3754} __packed;
3755
Rajkumar Manoharan90174452014-10-03 08:02:33 +03003756struct wmi_pdev_pktlog_enable_cmd {
3757 __le32 ev_bitmap;
3758} __packed;
3759
Kalle Valo5e3dd152013-06-12 20:52:10 +03003760/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
3761#define WMI_DSCP_MAP_MAX (64)
3762struct wmi_pdev_set_dscp_tid_map_cmd {
3763 /* map indicating DSCP to TID conversion */
3764 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
3765} __packed;
3766
3767enum mcast_bcast_rate_id {
3768 WMI_SET_MCAST_RATE,
3769 WMI_SET_BCAST_RATE
3770};
3771
3772struct mcast_bcast_rate {
3773 enum mcast_bcast_rate_id rate_id;
3774 __le32 rate;
3775} __packed;
3776
3777struct wmi_wmm_params {
3778 __le32 cwmin;
3779 __le32 cwmax;
3780 __le32 aifs;
3781 __le32 txop;
3782 __le32 acm;
3783 __le32 no_ack;
3784} __packed;
3785
3786struct wmi_pdev_set_wmm_params {
3787 struct wmi_wmm_params ac_be;
3788 struct wmi_wmm_params ac_bk;
3789 struct wmi_wmm_params ac_vi;
3790 struct wmi_wmm_params ac_vo;
3791} __packed;
3792
3793struct wmi_wmm_params_arg {
3794 u32 cwmin;
3795 u32 cwmax;
3796 u32 aifs;
3797 u32 txop;
3798 u32 acm;
3799 u32 no_ack;
3800};
3801
Michal Kazior5e752e42015-01-19 09:53:41 +01003802struct wmi_wmm_params_all_arg {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003803 struct wmi_wmm_params_arg ac_be;
3804 struct wmi_wmm_params_arg ac_bk;
3805 struct wmi_wmm_params_arg ac_vi;
3806 struct wmi_wmm_params_arg ac_vo;
3807};
3808
Michal Kaziorb91251f2015-01-24 12:14:49 +02003809struct wmi_pdev_stats_tx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003810 /* Num HTT cookies queued to dispatch list */
3811 __le32 comp_queued;
3812
3813 /* Num HTT cookies dispatched */
3814 __le32 comp_delivered;
3815
3816 /* Num MSDU queued to WAL */
3817 __le32 msdu_enqued;
3818
3819 /* Num MPDU queue to WAL */
3820 __le32 mpdu_enqued;
3821
3822 /* Num MSDUs dropped by WMM limit */
3823 __le32 wmm_drop;
3824
3825 /* Num Local frames queued */
3826 __le32 local_enqued;
3827
3828 /* Num Local frames done */
3829 __le32 local_freed;
3830
3831 /* Num queued to HW */
3832 __le32 hw_queued;
3833
3834 /* Num PPDU reaped from HW */
3835 __le32 hw_reaped;
3836
3837 /* Num underruns */
3838 __le32 underrun;
3839
3840 /* Num PPDUs cleaned up in TX abort */
3841 __le32 tx_abort;
3842
3843 /* Num MPDUs requed by SW */
3844 __le32 mpdus_requed;
3845
3846 /* excessive retries */
3847 __le32 tx_ko;
3848
3849 /* data hw rate code */
3850 __le32 data_rc;
3851
3852 /* Scheduler self triggers */
3853 __le32 self_triggers;
3854
3855 /* frames dropped due to excessive sw retries */
3856 __le32 sw_retry_failure;
3857
3858 /* illegal rate phy errors */
3859 __le32 illgl_rate_phy_err;
3860
3861 /* wal pdev continous xretry */
3862 __le32 pdev_cont_xretry;
3863
3864 /* wal pdev continous xretry */
3865 __le32 pdev_tx_timeout;
3866
3867 /* wal pdev resets */
3868 __le32 pdev_resets;
3869
Bartosz Markowski34d714e2014-03-28 14:35:16 +02003870 /* frames dropped due to non-availability of stateless TIDs */
3871 __le32 stateless_tid_alloc_failure;
3872
Kalle Valo5e3dd152013-06-12 20:52:10 +03003873 __le32 phy_underrun;
3874
3875 /* MPDU is more than txop limit */
3876 __le32 txop_ovf;
3877} __packed;
3878
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02003879struct wmi_10_4_pdev_stats_tx {
3880 /* Num HTT cookies queued to dispatch list */
3881 __le32 comp_queued;
3882
3883 /* Num HTT cookies dispatched */
3884 __le32 comp_delivered;
3885
3886 /* Num MSDU queued to WAL */
3887 __le32 msdu_enqued;
3888
3889 /* Num MPDU queue to WAL */
3890 __le32 mpdu_enqued;
3891
3892 /* Num MSDUs dropped by WMM limit */
3893 __le32 wmm_drop;
3894
3895 /* Num Local frames queued */
3896 __le32 local_enqued;
3897
3898 /* Num Local frames done */
3899 __le32 local_freed;
3900
3901 /* Num queued to HW */
3902 __le32 hw_queued;
3903
3904 /* Num PPDU reaped from HW */
3905 __le32 hw_reaped;
3906
3907 /* Num underruns */
3908 __le32 underrun;
3909
3910 /* HW Paused. */
3911 __le32 hw_paused;
3912
3913 /* Num PPDUs cleaned up in TX abort */
3914 __le32 tx_abort;
3915
3916 /* Num MPDUs requed by SW */
3917 __le32 mpdus_requed;
3918
3919 /* excessive retries */
3920 __le32 tx_ko;
3921
3922 /* data hw rate code */
3923 __le32 data_rc;
3924
3925 /* Scheduler self triggers */
3926 __le32 self_triggers;
3927
3928 /* frames dropped due to excessive sw retries */
3929 __le32 sw_retry_failure;
3930
3931 /* illegal rate phy errors */
3932 __le32 illgl_rate_phy_err;
3933
3934 /* wal pdev continuous xretry */
3935 __le32 pdev_cont_xretry;
3936
3937 /* wal pdev tx timeouts */
3938 __le32 pdev_tx_timeout;
3939
3940 /* wal pdev resets */
3941 __le32 pdev_resets;
3942
3943 /* frames dropped due to non-availability of stateless TIDs */
3944 __le32 stateless_tid_alloc_failure;
3945
3946 __le32 phy_underrun;
3947
3948 /* MPDU is more than txop limit */
3949 __le32 txop_ovf;
3950
3951 /* Number of Sequences posted */
3952 __le32 seq_posted;
3953
3954 /* Number of Sequences failed queueing */
3955 __le32 seq_failed_queueing;
3956
3957 /* Number of Sequences completed */
3958 __le32 seq_completed;
3959
3960 /* Number of Sequences restarted */
3961 __le32 seq_restarted;
3962
3963 /* Number of MU Sequences posted */
3964 __le32 mu_seq_posted;
3965
3966 /* Num MPDUs flushed by SW, HWPAUSED,SW TXABORT(Reset,channel change) */
3967 __le32 mpdus_sw_flush;
3968
3969 /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
3970 __le32 mpdus_hw_filter;
3971
3972 /* Num MPDUs truncated by PDG
3973 * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
3974 */
3975 __le32 mpdus_truncated;
3976
3977 /* Num MPDUs that was tried but didn't receive ACK or BA */
3978 __le32 mpdus_ack_failed;
3979
3980 /* Num MPDUs that was dropped due to expiry. */
3981 __le32 mpdus_expired;
3982} __packed;
3983
Michal Kaziorb91251f2015-01-24 12:14:49 +02003984struct wmi_pdev_stats_rx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003985 /* Cnts any change in ring routing mid-ppdu */
3986 __le32 mid_ppdu_route_change;
3987
3988 /* Total number of statuses processed */
3989 __le32 status_rcvd;
3990
3991 /* Extra frags on rings 0-3 */
3992 __le32 r0_frags;
3993 __le32 r1_frags;
3994 __le32 r2_frags;
3995 __le32 r3_frags;
3996
3997 /* MSDUs / MPDUs delivered to HTT */
3998 __le32 htt_msdus;
3999 __le32 htt_mpdus;
4000
4001 /* MSDUs / MPDUs delivered to local stack */
4002 __le32 loc_msdus;
4003 __le32 loc_mpdus;
4004
4005 /* AMSDUs that have more MSDUs than the status ring size */
4006 __le32 oversize_amsdu;
4007
4008 /* Number of PHY errors */
4009 __le32 phy_errs;
4010
4011 /* Number of PHY errors drops */
4012 __le32 phy_err_drop;
4013
4014 /* Number of mpdu errors - FCS, MIC, ENC etc. */
4015 __le32 mpdu_errs;
4016} __packed;
4017
Michal Kaziorb91251f2015-01-24 12:14:49 +02004018struct wmi_pdev_stats_peer {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004019 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4020 __le32 dummy;
4021} __packed;
4022
Kalle Valo5e3dd152013-06-12 20:52:10 +03004023enum wmi_stats_id {
Michal Kazioreed55412015-02-15 16:50:41 +02004024 WMI_STAT_PEER = BIT(0),
4025 WMI_STAT_AP = BIT(1),
4026 WMI_STAT_PDEV = BIT(2),
4027 WMI_STAT_VDEV = BIT(3),
4028 WMI_STAT_BCNFLT = BIT(4),
4029 WMI_STAT_VDEV_RATE = BIT(5),
Kalle Valo5e3dd152013-06-12 20:52:10 +03004030};
4031
Ben Greeardb9cdda2014-03-28 14:35:15 +02004032struct wlan_inst_rssi_args {
4033 __le16 cfg_retry_count;
4034 __le16 retry_count;
4035};
4036
Kalle Valo5e3dd152013-06-12 20:52:10 +03004037struct wmi_request_stats_cmd {
4038 __le32 stats_id;
4039
Ben Greeardb9cdda2014-03-28 14:35:15 +02004040 __le32 vdev_id;
4041
4042 /* peer MAC address */
4043 struct wmi_mac_addr peer_macaddr;
4044
4045 /* Instantaneous RSSI arguments */
4046 struct wlan_inst_rssi_args inst_rssi_args;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004047} __packed;
4048
4049/* Suspend option */
4050enum {
4051 /* suspend */
4052 WMI_PDEV_SUSPEND,
4053
4054 /* suspend and disable all interrupts */
4055 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
4056};
4057
4058struct wmi_pdev_suspend_cmd {
4059 /* suspend option sent to target */
4060 __le32 suspend_opt;
4061} __packed;
4062
4063struct wmi_stats_event {
Michal Kazioreed55412015-02-15 16:50:41 +02004064 __le32 stats_id; /* WMI_STAT_ */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004065 /*
4066 * number of pdev stats event structures
4067 * (wmi_pdev_stats) 0 or 1
4068 */
4069 __le32 num_pdev_stats;
4070 /*
4071 * number of vdev stats event structures
4072 * (wmi_vdev_stats) 0 or max vdevs
4073 */
4074 __le32 num_vdev_stats;
4075 /*
4076 * number of peer stats event structures
4077 * (wmi_peer_stats) 0 or max peers
4078 */
4079 __le32 num_peer_stats;
4080 __le32 num_bcnflt_stats;
4081 /*
4082 * followed by
4083 * num_pdev_stats * size of(struct wmi_pdev_stats)
4084 * num_vdev_stats * size of(struct wmi_vdev_stats)
4085 * num_peer_stats * size of(struct wmi_peer_stats)
4086 *
4087 * By having a zero sized array, the pointer to data area
4088 * becomes available without increasing the struct size
4089 */
4090 u8 data[0];
4091} __packed;
4092
Michal Kazior20de2222015-01-24 12:14:49 +02004093struct wmi_10_2_stats_event {
4094 __le32 stats_id; /* %WMI_REQUEST_ */
4095 __le32 num_pdev_stats;
4096 __le32 num_pdev_ext_stats;
4097 __le32 num_vdev_stats;
4098 __le32 num_peer_stats;
4099 __le32 num_bcnflt_stats;
4100 u8 data[0];
4101} __packed;
4102
Kalle Valo5e3dd152013-06-12 20:52:10 +03004103/*
4104 * PDEV statistics
4105 * TODO: add all PDEV stats here
4106 */
Michal Kaziorb91251f2015-01-24 12:14:49 +02004107struct wmi_pdev_stats_base {
4108 __le32 chan_nf;
4109 __le32 tx_frame_count;
4110 __le32 rx_frame_count;
4111 __le32 rx_clear_count;
4112 __le32 cycle_count;
4113 __le32 phy_err_count;
4114 __le32 chan_tx_pwr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03004115} __packed;
4116
Michal Kaziorb91251f2015-01-24 12:14:49 +02004117struct wmi_pdev_stats {
4118 struct wmi_pdev_stats_base base;
4119 struct wmi_pdev_stats_tx tx;
4120 struct wmi_pdev_stats_rx rx;
4121 struct wmi_pdev_stats_peer peer;
4122} __packed;
4123
4124struct wmi_pdev_stats_extra {
Chun-Yeow Yeoh52e346d2014-03-28 14:35:16 +02004125 __le32 ack_rx_bad;
4126 __le32 rts_bad;
4127 __le32 rts_good;
4128 __le32 fcs_bad;
4129 __le32 no_beacons;
4130 __le32 mib_int_count;
4131} __packed;
4132
Michal Kaziorb91251f2015-01-24 12:14:49 +02004133struct wmi_10x_pdev_stats {
4134 struct wmi_pdev_stats_base base;
4135 struct wmi_pdev_stats_tx tx;
4136 struct wmi_pdev_stats_rx rx;
4137 struct wmi_pdev_stats_peer peer;
4138 struct wmi_pdev_stats_extra extra;
4139} __packed;
4140
Michal Kazior20de2222015-01-24 12:14:49 +02004141struct wmi_pdev_stats_mem {
4142 __le32 dram_free;
4143 __le32 iram_free;
4144} __packed;
4145
4146struct wmi_10_2_pdev_stats {
4147 struct wmi_pdev_stats_base base;
4148 struct wmi_pdev_stats_tx tx;
4149 __le32 mc_drop;
4150 struct wmi_pdev_stats_rx rx;
4151 __le32 pdev_rx_timeout;
4152 struct wmi_pdev_stats_mem mem;
4153 struct wmi_pdev_stats_peer peer;
4154 struct wmi_pdev_stats_extra extra;
4155} __packed;
4156
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004157struct wmi_10_4_pdev_stats {
4158 struct wmi_pdev_stats_base base;
4159 struct wmi_10_4_pdev_stats_tx tx;
4160 struct wmi_pdev_stats_rx rx;
4161 __le32 rx_ovfl_errs;
4162 struct wmi_pdev_stats_mem mem;
4163 __le32 sram_free_size;
4164 struct wmi_pdev_stats_extra extra;
4165} __packed;
4166
Kalle Valo5e3dd152013-06-12 20:52:10 +03004167/*
4168 * VDEV statistics
4169 * TODO: add all VDEV stats here
4170 */
4171struct wmi_vdev_stats {
4172 __le32 vdev_id;
4173} __packed;
4174
4175/*
4176 * peer statistics.
4177 * TODO: add more stats
4178 */
Michal Kaziord15fb522014-09-25 12:33:47 +02004179struct wmi_peer_stats {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004180 struct wmi_mac_addr peer_macaddr;
4181 __le32 peer_rssi;
4182 __le32 peer_tx_rate;
4183} __packed;
4184
Michal Kaziord15fb522014-09-25 12:33:47 +02004185struct wmi_10x_peer_stats {
4186 struct wmi_peer_stats old;
Ben Greear23c3aae2014-03-28 14:35:15 +02004187 __le32 peer_rx_rate;
4188} __packed;
4189
Michal Kazior20de2222015-01-24 12:14:49 +02004190struct wmi_10_2_peer_stats {
4191 struct wmi_peer_stats old;
4192 __le32 peer_rx_rate;
4193 __le32 current_per;
4194 __le32 retries;
4195 __le32 tx_rate_count;
4196 __le32 max_4ms_frame_len;
4197 __le32 total_sub_frames;
4198 __le32 tx_bytes;
4199 __le32 num_pkt_loss_overflow[4];
4200 __le32 num_pkt_loss_excess_retry[4];
4201} __packed;
4202
4203struct wmi_10_2_4_peer_stats {
4204 struct wmi_10_2_peer_stats common;
4205 __le32 unknown_value; /* FIXME: what is this word? */
4206} __packed;
4207
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02004208struct wmi_10_4_peer_stats {
4209 struct wmi_mac_addr peer_macaddr;
4210 __le32 peer_rssi;
4211 __le32 peer_rssi_seq_num;
4212 __le32 peer_tx_rate;
4213 __le32 peer_rx_rate;
4214 __le32 current_per;
4215 __le32 retries;
4216 __le32 tx_rate_count;
4217 __le32 max_4ms_frame_len;
4218 __le32 total_sub_frames;
4219 __le32 tx_bytes;
4220 __le32 num_pkt_loss_overflow[4];
4221 __le32 num_pkt_loss_excess_retry[4];
4222 __le32 peer_rssi_changed;
4223} __packed;
4224
Michal Kazior20de2222015-01-24 12:14:49 +02004225struct wmi_10_2_pdev_ext_stats {
4226 __le32 rx_rssi_comb;
4227 __le32 rx_rssi[4];
4228 __le32 rx_mcs[10];
4229 __le32 tx_mcs[10];
4230 __le32 ack_rssi;
4231} __packed;
4232
Kalle Valo5e3dd152013-06-12 20:52:10 +03004233struct wmi_vdev_create_cmd {
4234 __le32 vdev_id;
4235 __le32 vdev_type;
4236 __le32 vdev_subtype;
4237 struct wmi_mac_addr vdev_macaddr;
4238} __packed;
4239
4240enum wmi_vdev_type {
4241 WMI_VDEV_TYPE_AP = 1,
4242 WMI_VDEV_TYPE_STA = 2,
4243 WMI_VDEV_TYPE_IBSS = 3,
4244 WMI_VDEV_TYPE_MONITOR = 4,
4245};
4246
4247enum wmi_vdev_subtype {
4248 WMI_VDEV_SUBTYPE_NONE = 0,
4249 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
4250 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
4251 WMI_VDEV_SUBTYPE_P2P_GO = 3,
4252};
4253
4254/* values for vdev_subtype */
4255
4256/* values for vdev_start_request flags */
4257/*
4258 * Indicates that AP VDEV uses hidden ssid. only valid for
4259 * AP/GO */
4260#define WMI_VDEV_START_HIDDEN_SSID (1<<0)
4261/*
4262 * Indicates if robust management frame/management frame
4263 * protection is enabled. For GO/AP vdevs, it indicates that
4264 * it may support station/client associations with RMF enabled.
4265 * For STA/client vdevs, it indicates that sta will
4266 * associate with AP with RMF enabled. */
4267#define WMI_VDEV_START_PMF_ENABLED (1<<1)
4268
4269struct wmi_p2p_noa_descriptor {
4270 __le32 type_count; /* 255: continuous schedule, 0: reserved */
4271 __le32 duration; /* Absent period duration in micro seconds */
4272 __le32 interval; /* Absent period interval in micro seconds */
4273 __le32 start_time; /* 32 bit tsf time when in starts */
4274} __packed;
4275
4276struct wmi_vdev_start_request_cmd {
4277 /* WMI channel */
4278 struct wmi_channel chan;
4279 /* unique id identifying the VDEV, generated by the caller */
4280 __le32 vdev_id;
4281 /* requestor id identifying the caller module */
4282 __le32 requestor_id;
4283 /* beacon interval from received beacon */
4284 __le32 beacon_interval;
4285 /* DTIM Period from the received beacon */
4286 __le32 dtim_period;
4287 /* Flags */
4288 __le32 flags;
4289 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
4290 struct wmi_ssid ssid;
4291 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
4292 __le32 bcn_tx_rate;
4293 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
4294 __le32 bcn_tx_power;
4295 /* number of p2p NOA descriptor(s) from scan entry */
4296 __le32 num_noa_descriptors;
4297 /*
4298 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
4299 * During CAC, Our HW shouldn't ack ditected frames
4300 */
4301 __le32 disable_hw_ack;
4302 /* actual p2p NOA descriptor from scan entry */
4303 struct wmi_p2p_noa_descriptor noa_descriptors[2];
4304} __packed;
4305
4306struct wmi_vdev_restart_request_cmd {
4307 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
4308} __packed;
4309
4310struct wmi_vdev_start_request_arg {
4311 u32 vdev_id;
4312 struct wmi_channel_arg channel;
4313 u32 bcn_intval;
4314 u32 dtim_period;
4315 u8 *ssid;
4316 u32 ssid_len;
4317 u32 bcn_tx_rate;
4318 u32 bcn_tx_power;
4319 bool disable_hw_ack;
4320 bool hidden_ssid;
4321 bool pmf_enabled;
4322};
4323
4324struct wmi_vdev_delete_cmd {
4325 /* unique id identifying the VDEV, generated by the caller */
4326 __le32 vdev_id;
4327} __packed;
4328
4329struct wmi_vdev_up_cmd {
4330 __le32 vdev_id;
4331 __le32 vdev_assoc_id;
4332 struct wmi_mac_addr vdev_bssid;
4333} __packed;
4334
4335struct wmi_vdev_stop_cmd {
4336 __le32 vdev_id;
4337} __packed;
4338
4339struct wmi_vdev_down_cmd {
4340 __le32 vdev_id;
4341} __packed;
4342
4343struct wmi_vdev_standby_response_cmd {
4344 /* unique id identifying the VDEV, generated by the caller */
4345 __le32 vdev_id;
4346} __packed;
4347
4348struct wmi_vdev_resume_response_cmd {
4349 /* unique id identifying the VDEV, generated by the caller */
4350 __le32 vdev_id;
4351} __packed;
4352
4353struct wmi_vdev_set_param_cmd {
4354 __le32 vdev_id;
4355 __le32 param_id;
4356 __le32 param_value;
4357} __packed;
4358
4359#define WMI_MAX_KEY_INDEX 3
4360#define WMI_MAX_KEY_LEN 32
4361
4362#define WMI_KEY_PAIRWISE 0x00
4363#define WMI_KEY_GROUP 0x01
4364#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
4365
4366struct wmi_key_seq_counter {
4367 __le32 key_seq_counter_l;
4368 __le32 key_seq_counter_h;
4369} __packed;
4370
4371#define WMI_CIPHER_NONE 0x0 /* clear key */
4372#define WMI_CIPHER_WEP 0x1
4373#define WMI_CIPHER_TKIP 0x2
4374#define WMI_CIPHER_AES_OCB 0x3
4375#define WMI_CIPHER_AES_CCM 0x4
4376#define WMI_CIPHER_WAPI 0x5
4377#define WMI_CIPHER_CKIP 0x6
4378#define WMI_CIPHER_AES_CMAC 0x7
4379
4380struct wmi_vdev_install_key_cmd {
4381 __le32 vdev_id;
4382 struct wmi_mac_addr peer_macaddr;
4383 __le32 key_idx;
4384 __le32 key_flags;
4385 __le32 key_cipher; /* %WMI_CIPHER_ */
4386 struct wmi_key_seq_counter key_rsc_counter;
4387 struct wmi_key_seq_counter key_global_rsc_counter;
4388 struct wmi_key_seq_counter key_tsc_counter;
4389 u8 wpi_key_rsc_counter[16];
4390 u8 wpi_key_tsc_counter[16];
4391 __le32 key_len;
4392 __le32 key_txmic_len;
4393 __le32 key_rxmic_len;
4394
4395 /* contains key followed by tx mic followed by rx mic */
4396 u8 key_data[0];
4397} __packed;
4398
4399struct wmi_vdev_install_key_arg {
4400 u32 vdev_id;
4401 const u8 *macaddr;
4402 u32 key_idx;
4403 u32 key_flags;
4404 u32 key_cipher;
4405 u32 key_len;
4406 u32 key_txmic_len;
4407 u32 key_rxmic_len;
4408 const void *key_data;
4409};
4410
Janusz Dziedzic51ab1a02014-01-08 09:08:33 +01004411/*
4412 * vdev fixed rate format:
4413 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
4414 * - nss - b5:b4 - ss number (0 mean 1ss)
4415 * - rate_mcs - b3:b0 - as below
4416 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
4417 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
4418 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
4419 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
4420 * HT/VHT: MCS index
4421 */
4422
Kalle Valo5e3dd152013-06-12 20:52:10 +03004423/* Preamble types to be used with VDEV fixed rate configuration */
4424enum wmi_rate_preamble {
4425 WMI_RATE_PREAMBLE_OFDM,
4426 WMI_RATE_PREAMBLE_CCK,
4427 WMI_RATE_PREAMBLE_HT,
4428 WMI_RATE_PREAMBLE_VHT,
4429};
4430
Maharaja Kennadyrajan29542662015-10-05 17:56:38 +03004431#define ATH10K_HW_NSS(rate) (1 + (((rate) >> 4) & 0x3))
4432#define ATH10K_HW_PREAMBLE(rate) (((rate) >> 6) & 0x3)
4433#define ATH10K_HW_RATECODE(rate, nss, preamble) \
4434 (((preamble) << 6) | ((nss) << 4) | (rate))
4435
Kalle Valo5e3dd152013-06-12 20:52:10 +03004436/* Value to disable fixed rate setting */
4437#define WMI_FIXED_RATE_NONE (0xff)
4438
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004439struct wmi_vdev_param_map {
4440 u32 rts_threshold;
4441 u32 fragmentation_threshold;
4442 u32 beacon_interval;
4443 u32 listen_interval;
4444 u32 multicast_rate;
4445 u32 mgmt_tx_rate;
4446 u32 slot_time;
4447 u32 preamble;
4448 u32 swba_time;
4449 u32 wmi_vdev_stats_update_period;
4450 u32 wmi_vdev_pwrsave_ageout_time;
4451 u32 wmi_vdev_host_swba_interval;
4452 u32 dtim_period;
4453 u32 wmi_vdev_oc_scheduler_air_time_limit;
4454 u32 wds;
4455 u32 atim_window;
4456 u32 bmiss_count_max;
4457 u32 bmiss_first_bcnt;
4458 u32 bmiss_final_bcnt;
4459 u32 feature_wmm;
4460 u32 chwidth;
4461 u32 chextoffset;
4462 u32 disable_htprotection;
4463 u32 sta_quickkickout;
4464 u32 mgmt_rate;
4465 u32 protection_mode;
4466 u32 fixed_rate;
4467 u32 sgi;
4468 u32 ldpc;
4469 u32 tx_stbc;
4470 u32 rx_stbc;
4471 u32 intra_bss_fwd;
4472 u32 def_keyid;
4473 u32 nss;
4474 u32 bcast_data_rate;
4475 u32 mcast_data_rate;
4476 u32 mcast_indicate;
4477 u32 dhcp_indicate;
4478 u32 unknown_dest_indicate;
4479 u32 ap_keepalive_min_idle_inactive_time_secs;
4480 u32 ap_keepalive_max_idle_inactive_time_secs;
4481 u32 ap_keepalive_max_unresponsive_time_secs;
4482 u32 ap_enable_nawds;
4483 u32 mcast2ucast_set;
4484 u32 enable_rtscts;
4485 u32 txbf;
4486 u32 packet_powersave;
4487 u32 drop_unencry;
4488 u32 tx_encap_type;
4489 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
Raja Mani93841a12015-06-22 20:10:13 +05304490 u32 rc_num_retries;
4491 u32 cabq_maxdur;
4492 u32 mfptest_set;
4493 u32 rts_fixed_rate;
4494 u32 vht_sgimask;
4495 u32 vht80_ratemask;
4496 u32 early_rx_adjust_enable;
4497 u32 early_rx_tgt_bmiss_num;
4498 u32 early_rx_bmiss_sample_cycle;
4499 u32 early_rx_slop_step;
4500 u32 early_rx_init_slop;
4501 u32 early_rx_adjust_pause;
4502 u32 proxy_sta;
4503 u32 meru_vc;
4504 u32 rx_decap_type;
4505 u32 bw_nss_ratemask;
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004506};
4507
4508#define WMI_VDEV_PARAM_UNSUPPORTED 0
4509
Kalle Valo5e3dd152013-06-12 20:52:10 +03004510/* the definition of different VDEV parameters */
4511enum wmi_vdev_param {
4512 /* RTS Threshold */
4513 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4514 /* Fragmentation threshold */
4515 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4516 /* beacon interval in TUs */
4517 WMI_VDEV_PARAM_BEACON_INTERVAL,
4518 /* Listen interval in TUs */
4519 WMI_VDEV_PARAM_LISTEN_INTERVAL,
4520 /* muticast rate in Mbps */
4521 WMI_VDEV_PARAM_MULTICAST_RATE,
4522 /* management frame rate in Mbps */
4523 WMI_VDEV_PARAM_MGMT_TX_RATE,
4524 /* slot time (long vs short) */
4525 WMI_VDEV_PARAM_SLOT_TIME,
4526 /* preamble (long vs short) */
4527 WMI_VDEV_PARAM_PREAMBLE,
4528 /* SWBA time (time before tbtt in msec) */
4529 WMI_VDEV_PARAM_SWBA_TIME,
4530 /* time period for updating VDEV stats */
4531 WMI_VDEV_STATS_UPDATE_PERIOD,
4532 /* age out time in msec for frames queued for station in power save */
4533 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
4534 /*
4535 * Host SWBA interval (time in msec before tbtt for SWBA event
4536 * generation).
4537 */
4538 WMI_VDEV_HOST_SWBA_INTERVAL,
4539 /* DTIM period (specified in units of num beacon intervals) */
4540 WMI_VDEV_PARAM_DTIM_PERIOD,
4541 /*
4542 * scheduler air time limit for this VDEV. used by off chan
4543 * scheduler.
4544 */
4545 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4546 /* enable/dsiable WDS for this VDEV */
4547 WMI_VDEV_PARAM_WDS,
4548 /* ATIM Window */
4549 WMI_VDEV_PARAM_ATIM_WINDOW,
4550 /* BMISS max */
4551 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
4552 /* BMISS first time */
4553 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
4554 /* BMISS final time */
4555 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
4556 /* WMM enables/disabled */
4557 WMI_VDEV_PARAM_FEATURE_WMM,
4558 /* Channel width */
4559 WMI_VDEV_PARAM_CHWIDTH,
4560 /* Channel Offset */
4561 WMI_VDEV_PARAM_CHEXTOFFSET,
4562 /* Disable HT Protection */
4563 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
4564 /* Quick STA Kickout */
4565 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
4566 /* Rate to be used with Management frames */
4567 WMI_VDEV_PARAM_MGMT_RATE,
4568 /* Protection Mode */
4569 WMI_VDEV_PARAM_PROTECTION_MODE,
4570 /* Fixed rate setting */
4571 WMI_VDEV_PARAM_FIXED_RATE,
4572 /* Short GI Enable/Disable */
4573 WMI_VDEV_PARAM_SGI,
4574 /* Enable LDPC */
4575 WMI_VDEV_PARAM_LDPC,
4576 /* Enable Tx STBC */
4577 WMI_VDEV_PARAM_TX_STBC,
4578 /* Enable Rx STBC */
4579 WMI_VDEV_PARAM_RX_STBC,
4580 /* Intra BSS forwarding */
4581 WMI_VDEV_PARAM_INTRA_BSS_FWD,
4582 /* Setting Default xmit key for Vdev */
4583 WMI_VDEV_PARAM_DEF_KEYID,
4584 /* NSS width */
4585 WMI_VDEV_PARAM_NSS,
4586 /* Set the custom rate for the broadcast data frames */
4587 WMI_VDEV_PARAM_BCAST_DATA_RATE,
4588 /* Set the custom rate (rate-code) for multicast data frames */
4589 WMI_VDEV_PARAM_MCAST_DATA_RATE,
4590 /* Tx multicast packet indicate Enable/Disable */
4591 WMI_VDEV_PARAM_MCAST_INDICATE,
4592 /* Tx DHCP packet indicate Enable/Disable */
4593 WMI_VDEV_PARAM_DHCP_INDICATE,
4594 /* Enable host inspection of Tx unicast packet to unknown destination */
4595 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4596
4597 /* The minimum amount of time AP begins to consider STA inactive */
4598 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4599
4600 /*
4601 * An associated STA is considered inactive when there is no recent
4602 * TX/RX activity and no downlink frames are buffered for it. Once a
4603 * STA exceeds the maximum idle inactive time, the AP will send an
4604 * 802.11 data-null as a keep alive to verify the STA is still
4605 * associated. If the STA does ACK the data-null, or if the data-null
4606 * is buffered and the STA does not retrieve it, the STA will be
4607 * considered unresponsive
4608 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
4609 */
4610 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4611
4612 /*
4613 * An associated STA is considered unresponsive if there is no recent
4614 * TX/RX activity and downlink frames are buffered for it. Once a STA
4615 * exceeds the maximum unresponsive time, the AP will send a
4616 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
4617 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4618
4619 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
4620 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
4621 /* Enable/Disable RTS-CTS */
4622 WMI_VDEV_PARAM_ENABLE_RTSCTS,
4623 /* Enable TXBFee/er */
4624 WMI_VDEV_PARAM_TXBF,
4625
4626 /* Set packet power save */
4627 WMI_VDEV_PARAM_PACKET_POWERSAVE,
4628
4629 /*
4630 * Drops un-encrypted packets if eceived in an encrypted connection
4631 * otherwise forwards to host.
4632 */
4633 WMI_VDEV_PARAM_DROP_UNENCRY,
4634
4635 /*
4636 * Set the encapsulation type for frames.
4637 */
4638 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
4639};
4640
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004641/* the definition of different VDEV parameters */
4642enum wmi_10x_vdev_param {
4643 /* RTS Threshold */
4644 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4645 /* Fragmentation threshold */
4646 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4647 /* beacon interval in TUs */
4648 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
4649 /* Listen interval in TUs */
4650 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
4651 /* muticast rate in Mbps */
4652 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
4653 /* management frame rate in Mbps */
4654 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
4655 /* slot time (long vs short) */
4656 WMI_10X_VDEV_PARAM_SLOT_TIME,
4657 /* preamble (long vs short) */
4658 WMI_10X_VDEV_PARAM_PREAMBLE,
4659 /* SWBA time (time before tbtt in msec) */
4660 WMI_10X_VDEV_PARAM_SWBA_TIME,
4661 /* time period for updating VDEV stats */
4662 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
4663 /* age out time in msec for frames queued for station in power save */
4664 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
4665 /*
4666 * Host SWBA interval (time in msec before tbtt for SWBA event
4667 * generation).
4668 */
4669 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
4670 /* DTIM period (specified in units of num beacon intervals) */
4671 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
4672 /*
4673 * scheduler air time limit for this VDEV. used by off chan
4674 * scheduler.
4675 */
4676 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4677 /* enable/dsiable WDS for this VDEV */
4678 WMI_10X_VDEV_PARAM_WDS,
4679 /* ATIM Window */
4680 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
4681 /* BMISS max */
4682 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
4683 /* WMM enables/disabled */
4684 WMI_10X_VDEV_PARAM_FEATURE_WMM,
4685 /* Channel width */
4686 WMI_10X_VDEV_PARAM_CHWIDTH,
4687 /* Channel Offset */
4688 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
4689 /* Disable HT Protection */
4690 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
4691 /* Quick STA Kickout */
4692 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
4693 /* Rate to be used with Management frames */
4694 WMI_10X_VDEV_PARAM_MGMT_RATE,
4695 /* Protection Mode */
4696 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
4697 /* Fixed rate setting */
4698 WMI_10X_VDEV_PARAM_FIXED_RATE,
4699 /* Short GI Enable/Disable */
4700 WMI_10X_VDEV_PARAM_SGI,
4701 /* Enable LDPC */
4702 WMI_10X_VDEV_PARAM_LDPC,
4703 /* Enable Tx STBC */
4704 WMI_10X_VDEV_PARAM_TX_STBC,
4705 /* Enable Rx STBC */
4706 WMI_10X_VDEV_PARAM_RX_STBC,
4707 /* Intra BSS forwarding */
4708 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
4709 /* Setting Default xmit key for Vdev */
4710 WMI_10X_VDEV_PARAM_DEF_KEYID,
4711 /* NSS width */
4712 WMI_10X_VDEV_PARAM_NSS,
4713 /* Set the custom rate for the broadcast data frames */
4714 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
4715 /* Set the custom rate (rate-code) for multicast data frames */
4716 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
4717 /* Tx multicast packet indicate Enable/Disable */
4718 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
4719 /* Tx DHCP packet indicate Enable/Disable */
4720 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
4721 /* Enable host inspection of Tx unicast packet to unknown destination */
4722 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4723
4724 /* The minimum amount of time AP begins to consider STA inactive */
4725 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4726
4727 /*
4728 * An associated STA is considered inactive when there is no recent
4729 * TX/RX activity and no downlink frames are buffered for it. Once a
4730 * STA exceeds the maximum idle inactive time, the AP will send an
4731 * 802.11 data-null as a keep alive to verify the STA is still
4732 * associated. If the STA does ACK the data-null, or if the data-null
4733 * is buffered and the STA does not retrieve it, the STA will be
4734 * considered unresponsive
4735 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
4736 */
4737 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4738
4739 /*
4740 * An associated STA is considered unresponsive if there is no recent
4741 * TX/RX activity and downlink frames are buffered for it. Once a STA
4742 * exceeds the maximum unresponsive time, the AP will send a
4743 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
4744 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4745
4746 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
4747 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
4748
4749 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
4750 /* Enable/Disable RTS-CTS */
4751 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
4752
4753 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
Michal Kazior24c88f72014-07-25 13:32:17 +02004754
4755 /* following are available as of firmware 10.2 */
4756 WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
4757 WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
4758 WMI_10X_VDEV_PARAM_MFPTEST_SET,
4759 WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
4760 WMI_10X_VDEV_PARAM_VHT_SGIMASK,
4761 WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004762};
4763
Raja Mani93841a12015-06-22 20:10:13 +05304764enum wmi_10_4_vdev_param {
4765 WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1,
4766 WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
4767 WMI_10_4_VDEV_PARAM_BEACON_INTERVAL,
4768 WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL,
4769 WMI_10_4_VDEV_PARAM_MULTICAST_RATE,
4770 WMI_10_4_VDEV_PARAM_MGMT_TX_RATE,
4771 WMI_10_4_VDEV_PARAM_SLOT_TIME,
4772 WMI_10_4_VDEV_PARAM_PREAMBLE,
4773 WMI_10_4_VDEV_PARAM_SWBA_TIME,
4774 WMI_10_4_VDEV_STATS_UPDATE_PERIOD,
4775 WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME,
4776 WMI_10_4_VDEV_HOST_SWBA_INTERVAL,
4777 WMI_10_4_VDEV_PARAM_DTIM_PERIOD,
4778 WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
4779 WMI_10_4_VDEV_PARAM_WDS,
4780 WMI_10_4_VDEV_PARAM_ATIM_WINDOW,
4781 WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX,
4782 WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT,
4783 WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT,
4784 WMI_10_4_VDEV_PARAM_FEATURE_WMM,
4785 WMI_10_4_VDEV_PARAM_CHWIDTH,
4786 WMI_10_4_VDEV_PARAM_CHEXTOFFSET,
4787 WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION,
4788 WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT,
4789 WMI_10_4_VDEV_PARAM_MGMT_RATE,
4790 WMI_10_4_VDEV_PARAM_PROTECTION_MODE,
4791 WMI_10_4_VDEV_PARAM_FIXED_RATE,
4792 WMI_10_4_VDEV_PARAM_SGI,
4793 WMI_10_4_VDEV_PARAM_LDPC,
4794 WMI_10_4_VDEV_PARAM_TX_STBC,
4795 WMI_10_4_VDEV_PARAM_RX_STBC,
4796 WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD,
4797 WMI_10_4_VDEV_PARAM_DEF_KEYID,
4798 WMI_10_4_VDEV_PARAM_NSS,
4799 WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE,
4800 WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE,
4801 WMI_10_4_VDEV_PARAM_MCAST_INDICATE,
4802 WMI_10_4_VDEV_PARAM_DHCP_INDICATE,
4803 WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
4804 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
4805 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
4806 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
4807 WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS,
4808 WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET,
4809 WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS,
4810 WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES,
4811 WMI_10_4_VDEV_PARAM_TXBF,
4812 WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE,
4813 WMI_10_4_VDEV_PARAM_DROP_UNENCRY,
4814 WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE,
4815 WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
4816 WMI_10_4_VDEV_PARAM_CABQ_MAXDUR,
4817 WMI_10_4_VDEV_PARAM_MFPTEST_SET,
4818 WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE,
4819 WMI_10_4_VDEV_PARAM_VHT_SGIMASK,
4820 WMI_10_4_VDEV_PARAM_VHT80_RATEMASK,
4821 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE,
4822 WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
4823 WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE,
4824 WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP,
4825 WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP,
4826 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE,
4827 WMI_10_4_VDEV_PARAM_PROXY_STA,
4828 WMI_10_4_VDEV_PARAM_MERU_VC,
4829 WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
4830 WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
4831};
4832
Michal Kazior139e1702015-02-15 16:50:42 +02004833#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
4834#define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
4835#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
4836#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
4837
Vivek Natarajana48e2cc2015-08-04 10:45:12 +05304838#define WMI_TXBF_STS_CAP_OFFSET_LSB 4
4839#define WMI_TXBF_STS_CAP_OFFSET_MASK 0xf0
4840#define WMI_BF_SOUND_DIM_OFFSET_LSB 8
4841#define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00
4842
Kalle Valo5e3dd152013-06-12 20:52:10 +03004843/* slot time long */
4844#define WMI_VDEV_SLOT_TIME_LONG 0x1
4845/* slot time short */
4846#define WMI_VDEV_SLOT_TIME_SHORT 0x2
4847/* preablbe long */
4848#define WMI_VDEV_PREAMBLE_LONG 0x1
4849/* preablbe short */
4850#define WMI_VDEV_PREAMBLE_SHORT 0x2
4851
4852enum wmi_start_event_param {
4853 WMI_VDEV_RESP_START_EVENT = 0,
4854 WMI_VDEV_RESP_RESTART_EVENT,
4855};
4856
4857struct wmi_vdev_start_response_event {
4858 __le32 vdev_id;
4859 __le32 req_id;
4860 __le32 resp_type; /* %WMI_VDEV_RESP_ */
4861 __le32 status;
4862} __packed;
4863
4864struct wmi_vdev_standby_req_event {
4865 /* unique id identifying the VDEV, generated by the caller */
4866 __le32 vdev_id;
4867} __packed;
4868
4869struct wmi_vdev_resume_req_event {
4870 /* unique id identifying the VDEV, generated by the caller */
4871 __le32 vdev_id;
4872} __packed;
4873
4874struct wmi_vdev_stopped_event {
4875 /* unique id identifying the VDEV, generated by the caller */
4876 __le32 vdev_id;
4877} __packed;
4878
4879/*
4880 * common structure used for simple events
4881 * (stopped, resume_req, standby response)
4882 */
4883struct wmi_vdev_simple_event {
4884 /* unique id identifying the VDEV, generated by the caller */
4885 __le32 vdev_id;
4886} __packed;
4887
4888/* VDEV start response status codes */
4889/* VDEV succesfully started */
4890#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
4891
4892/* requested VDEV not found */
4893#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
4894
4895/* unsupported VDEV combination */
4896#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
4897
Simon Wunderlich855aed12014-08-02 09:12:54 +03004898/* TODO: please add more comments if you have in-depth information */
4899struct wmi_vdev_spectral_conf_cmd {
4900 __le32 vdev_id;
4901
4902 /* number of fft samples to send (0 for infinite) */
4903 __le32 scan_count;
4904 __le32 scan_period;
4905 __le32 scan_priority;
4906
4907 /* number of bins in the FFT: 2^(fft_size - bin_scale) */
4908 __le32 scan_fft_size;
4909 __le32 scan_gc_ena;
4910 __le32 scan_restart_ena;
4911 __le32 scan_noise_floor_ref;
4912 __le32 scan_init_delay;
4913 __le32 scan_nb_tone_thr;
4914 __le32 scan_str_bin_thr;
4915 __le32 scan_wb_rpt_mode;
4916 __le32 scan_rssi_rpt_mode;
4917 __le32 scan_rssi_thr;
4918 __le32 scan_pwr_format;
4919
4920 /* rpt_mode: Format of FFT report to software for spectral scan
4921 * triggered FFTs:
4922 * 0: No FFT report (only spectral scan summary report)
4923 * 1: 2-dword summary of metrics for each completed FFT + spectral
4924 * scan summary report
4925 * 2: 2-dword summary of metrics for each completed FFT +
4926 * 1x- oversampled bins(in-band) per FFT + spectral scan summary
4927 * report
4928 * 3: 2-dword summary of metrics for each completed FFT +
4929 * 2x- oversampled bins (all) per FFT + spectral scan summary
4930 */
4931 __le32 scan_rpt_mode;
4932 __le32 scan_bin_scale;
4933 __le32 scan_dbm_adj;
4934 __le32 scan_chn_mask;
4935} __packed;
4936
4937struct wmi_vdev_spectral_conf_arg {
4938 u32 vdev_id;
4939 u32 scan_count;
4940 u32 scan_period;
4941 u32 scan_priority;
4942 u32 scan_fft_size;
4943 u32 scan_gc_ena;
4944 u32 scan_restart_ena;
4945 u32 scan_noise_floor_ref;
4946 u32 scan_init_delay;
4947 u32 scan_nb_tone_thr;
4948 u32 scan_str_bin_thr;
4949 u32 scan_wb_rpt_mode;
4950 u32 scan_rssi_rpt_mode;
4951 u32 scan_rssi_thr;
4952 u32 scan_pwr_format;
4953 u32 scan_rpt_mode;
4954 u32 scan_bin_scale;
4955 u32 scan_dbm_adj;
4956 u32 scan_chn_mask;
4957};
4958
4959#define WMI_SPECTRAL_ENABLE_DEFAULT 0
4960#define WMI_SPECTRAL_COUNT_DEFAULT 0
4961#define WMI_SPECTRAL_PERIOD_DEFAULT 35
4962#define WMI_SPECTRAL_PRIORITY_DEFAULT 1
4963#define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
4964#define WMI_SPECTRAL_GC_ENA_DEFAULT 1
4965#define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
4966#define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
4967#define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
4968#define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
4969#define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
4970#define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
4971#define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
4972#define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
4973#define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
4974#define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
4975#define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
4976#define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
4977#define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
4978
4979struct wmi_vdev_spectral_enable_cmd {
4980 __le32 vdev_id;
4981 __le32 trigger_cmd;
4982 __le32 enable_cmd;
4983} __packed;
4984
4985#define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
4986#define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
4987#define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
4988#define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
4989
Kalle Valo5e3dd152013-06-12 20:52:10 +03004990/* Beacon processing related command and event structures */
4991struct wmi_bcn_tx_hdr {
4992 __le32 vdev_id;
4993 __le32 tx_rate;
4994 __le32 tx_power;
4995 __le32 bcn_len;
4996} __packed;
4997
4998struct wmi_bcn_tx_cmd {
4999 struct wmi_bcn_tx_hdr hdr;
5000 u8 *bcn[0];
5001} __packed;
5002
5003struct wmi_bcn_tx_arg {
5004 u32 vdev_id;
5005 u32 tx_rate;
5006 u32 tx_power;
5007 u32 bcn_len;
5008 const void *bcn;
5009};
5010
Michal Kazior748afc42014-01-23 12:48:21 +01005011enum wmi_bcn_tx_ref_flags {
5012 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
5013 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
5014};
5015
Michal Kazior24c88f72014-07-25 13:32:17 +02005016/* TODO: It is unclear why "no antenna" works while any other seemingly valid
5017 * chainmask yields no beacons on the air at all.
5018 */
5019#define WMI_BCN_TX_REF_DEF_ANTENNA 0
5020
Michal Kazior748afc42014-01-23 12:48:21 +01005021struct wmi_bcn_tx_ref_cmd {
5022 __le32 vdev_id;
5023 __le32 data_len;
5024 /* physical address of the frame - dma pointer */
5025 __le32 data_ptr;
5026 /* id for host to track */
5027 __le32 msdu_id;
5028 /* frame ctrl to setup PPDU desc */
5029 __le32 frame_control;
5030 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
5031 __le32 flags;
Michal Kazior24c88f72014-07-25 13:32:17 +02005032 /* introduced in 10.2 */
5033 __le32 antenna_mask;
Michal Kazior748afc42014-01-23 12:48:21 +01005034} __packed;
5035
Kalle Valo5e3dd152013-06-12 20:52:10 +03005036/* Beacon filter */
5037#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
5038#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
5039#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
5040#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
5041#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
5042
5043struct wmi_bcn_filter_rx_cmd {
5044 /* Filter ID */
5045 __le32 bcn_filter_id;
5046 /* Filter type - wmi_bcn_filter */
5047 __le32 bcn_filter;
5048 /* Buffer len */
5049 __le32 bcn_filter_len;
5050 /* Filter info (threshold, BSSID, RSSI) */
5051 u8 *bcn_filter_buf;
5052} __packed;
5053
5054/* Capabilities and IEs to be passed to firmware */
5055struct wmi_bcn_prb_info {
5056 /* Capabilities */
5057 __le32 caps;
5058 /* ERP info */
5059 __le32 erp;
5060 /* Advanced capabilities */
5061 /* HT capabilities */
5062 /* HT Info */
5063 /* ibss_dfs */
5064 /* wpa Info */
5065 /* rsn Info */
5066 /* rrm info */
5067 /* ath_ext */
5068 /* app IE */
5069} __packed;
5070
5071struct wmi_bcn_tmpl_cmd {
5072 /* unique id identifying the VDEV, generated by the caller */
5073 __le32 vdev_id;
5074 /* TIM IE offset from the beginning of the template. */
5075 __le32 tim_ie_offset;
5076 /* beacon probe capabilities and IEs */
5077 struct wmi_bcn_prb_info bcn_prb_info;
5078 /* beacon buffer length */
5079 __le32 buf_len;
5080 /* variable length data */
5081 u8 data[1];
5082} __packed;
5083
5084struct wmi_prb_tmpl_cmd {
5085 /* unique id identifying the VDEV, generated by the caller */
5086 __le32 vdev_id;
5087 /* beacon probe capabilities and IEs */
5088 struct wmi_bcn_prb_info bcn_prb_info;
5089 /* beacon buffer length */
5090 __le32 buf_len;
5091 /* Variable length data */
5092 u8 data[1];
5093} __packed;
5094
5095enum wmi_sta_ps_mode {
5096 /* enable power save for the given STA VDEV */
5097 WMI_STA_PS_MODE_DISABLED = 0,
5098 /* disable power save for a given STA VDEV */
5099 WMI_STA_PS_MODE_ENABLED = 1,
5100};
5101
5102struct wmi_sta_powersave_mode_cmd {
5103 /* unique id identifying the VDEV, generated by the caller */
5104 __le32 vdev_id;
5105
5106 /*
5107 * Power save mode
5108 * (see enum wmi_sta_ps_mode)
5109 */
5110 __le32 sta_ps_mode;
5111} __packed;
5112
5113enum wmi_csa_offload_en {
5114 WMI_CSA_OFFLOAD_DISABLE = 0,
5115 WMI_CSA_OFFLOAD_ENABLE = 1,
5116};
5117
5118struct wmi_csa_offload_enable_cmd {
5119 __le32 vdev_id;
5120 __le32 csa_offload_enable;
5121} __packed;
5122
5123struct wmi_csa_offload_chanswitch_cmd {
5124 __le32 vdev_id;
5125 struct wmi_channel chan;
5126} __packed;
5127
5128/*
5129 * This parameter controls the policy for retrieving frames from AP while the
5130 * STA is in sleep state.
5131 *
5132 * Only takes affect if the sta_ps_mode is enabled
5133 */
5134enum wmi_sta_ps_param_rx_wake_policy {
5135 /*
5136 * Wake up when ever there is an RX activity on the VDEV. In this mode
5137 * the Power save SM(state machine) will come out of sleep by either
5138 * sending null frame (or) a data frame (with PS==0) in response to TIM
5139 * bit set in the received beacon frame from AP.
5140 */
5141 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
5142
5143 /*
5144 * Here the power save state machine will not wakeup in response to TIM
5145 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
5146 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
5147 * access categories are delivery-enabled, the station will send a
5148 * UAPSD trigger frame, otherwise it will send a PS-Poll.
5149 */
5150 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
5151};
5152
5153/*
5154 * Number of tx frames/beacon that cause the power save SM to wake up.
5155 *
5156 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
5157 * meaning, It will cause the SM to never wake up. This is useful if you want
5158 * to keep the system to sleep all the time for some kind of test mode . host
5159 * can change this parameter any time. It will affect at the next tx frame.
5160 */
5161enum wmi_sta_ps_param_tx_wake_threshold {
5162 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
5163 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
5164
5165 /*
5166 * Values greater than one indicate that many TX attempts per beacon
5167 * interval before the STA will wake up
5168 */
5169};
5170
5171/*
5172 * The maximum number of PS-Poll frames the FW will send in response to
5173 * traffic advertised in TIM before waking up (by sending a null frame with PS
5174 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
5175 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
5176 * parameter is used when the RX wake policy is
5177 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
5178 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
5179 */
5180enum wmi_sta_ps_param_pspoll_count {
5181 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
5182 /*
5183 * Values greater than 0 indicate the maximum numer of PS-Poll frames
5184 * FW will send before waking up.
5185 */
Michal Kazior9f9b5742014-12-12 12:41:36 +01005186
5187 /* When u-APSD is enabled the firmware will be very reluctant to exit
5188 * STA PS. This could result in very poor Rx performance with STA doing
5189 * PS-Poll for each and every buffered frame. This value is a bit
5190 * arbitrary.
5191 */
5192 WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
Kalle Valo5e3dd152013-06-12 20:52:10 +03005193};
5194
5195/*
5196 * This will include the delivery and trigger enabled state for every AC.
5197 * This is the negotiated state with AP. The host MLME needs to set this based
5198 * on AP capability and the state Set in the association request by the
5199 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
5200 */
5201#define WMI_UAPSD_AC_TYPE_DELI 0
5202#define WMI_UAPSD_AC_TYPE_TRIG 1
5203
5204#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
5205 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
5206
5207enum wmi_sta_ps_param_uapsd {
5208 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5209 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5210 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5211 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5212 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5213 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5214 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5215 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5216};
5217
Janusz Dziedzic0c7e4772015-01-24 12:14:52 +02005218#define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
5219
5220struct wmi_sta_uapsd_auto_trig_param {
5221 __le32 wmm_ac;
5222 __le32 user_priority;
5223 __le32 service_interval;
5224 __le32 suspend_interval;
5225 __le32 delay_interval;
5226};
5227
5228struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
5229 __le32 vdev_id;
5230 struct wmi_mac_addr peer_macaddr;
5231 __le32 num_ac;
5232};
5233
5234struct wmi_sta_uapsd_auto_trig_arg {
5235 u32 wmm_ac;
5236 u32 user_priority;
5237 u32 service_interval;
5238 u32 suspend_interval;
5239 u32 delay_interval;
5240};
5241
Kalle Valo5e3dd152013-06-12 20:52:10 +03005242enum wmi_sta_powersave_param {
5243 /*
5244 * Controls how frames are retrievd from AP while STA is sleeping
5245 *
5246 * (see enum wmi_sta_ps_param_rx_wake_policy)
5247 */
5248 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5249
5250 /*
5251 * The STA will go active after this many TX
5252 *
5253 * (see enum wmi_sta_ps_param_tx_wake_threshold)
5254 */
5255 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5256
5257 /*
5258 * Number of PS-Poll to send before STA wakes up
5259 *
5260 * (see enum wmi_sta_ps_param_pspoll_count)
5261 *
5262 */
5263 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
5264
5265 /*
5266 * TX/RX inactivity time in msec before going to sleep.
5267 *
5268 * The power save SM will monitor tx/rx activity on the VDEV, if no
5269 * activity for the specified msec of the parameter the Power save
5270 * SM will go to sleep.
5271 */
5272 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
5273
5274 /*
5275 * Set uapsd configuration.
5276 *
5277 * (see enum wmi_sta_ps_param_uapsd)
5278 */
5279 WMI_STA_PS_PARAM_UAPSD = 4,
5280};
5281
5282struct wmi_sta_powersave_param_cmd {
5283 __le32 vdev_id;
5284 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
5285 __le32 param_value;
5286} __packed;
5287
5288/* No MIMO power save */
5289#define WMI_STA_MIMO_PS_MODE_DISABLE
5290/* mimo powersave mode static*/
5291#define WMI_STA_MIMO_PS_MODE_STATIC
5292/* mimo powersave mode dynamic */
5293#define WMI_STA_MIMO_PS_MODE_DYNAMIC
5294
5295struct wmi_sta_mimo_ps_mode_cmd {
5296 /* unique id identifying the VDEV, generated by the caller */
5297 __le32 vdev_id;
5298 /* mimo powersave mode as defined above */
5299 __le32 mimo_pwrsave_mode;
5300} __packed;
5301
5302/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
5303enum wmi_ap_ps_param_uapsd {
5304 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5305 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5306 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5307 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5308 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5309 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5310 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5311 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5312};
5313
5314/* U-APSD maximum service period of peer station */
5315enum wmi_ap_ps_peer_param_max_sp {
5316 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
5317 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
5318 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
5319 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
5320 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
5321};
5322
5323/*
5324 * AP power save parameter
5325 * Set a power save specific parameter for a peer station
5326 */
5327enum wmi_ap_ps_peer_param {
5328 /* Set uapsd configuration for a given peer.
5329 *
5330 * Include the delivery and trigger enabled state for every AC.
5331 * The host MLME needs to set this based on AP capability and stations
5332 * request Set in the association request received from the station.
5333 *
5334 * Lower 8 bits of the value specify the UAPSD configuration.
5335 *
5336 * (see enum wmi_ap_ps_param_uapsd)
5337 * The default value is 0.
5338 */
5339 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
5340
5341 /*
5342 * Set the service period for a UAPSD capable station
5343 *
5344 * The service period from wme ie in the (re)assoc request frame.
5345 *
5346 * (see enum wmi_ap_ps_peer_param_max_sp)
5347 */
5348 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
5349
5350 /* Time in seconds for aging out buffered frames for STA in PS */
5351 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
5352};
5353
5354struct wmi_ap_ps_peer_cmd {
5355 /* unique id identifying the VDEV, generated by the caller */
5356 __le32 vdev_id;
5357
5358 /* peer MAC address */
5359 struct wmi_mac_addr peer_macaddr;
5360
5361 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
5362 __le32 param_id;
5363
5364 /* AP powersave param value */
5365 __le32 param_value;
5366} __packed;
5367
5368/* 128 clients = 4 words */
5369#define WMI_TIM_BITMAP_ARRAY_SIZE 4
5370
5371struct wmi_tim_info {
5372 __le32 tim_len;
5373 __le32 tim_mcast;
5374 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
5375 __le32 tim_changed;
5376 __le32 tim_num_ps_pending;
5377} __packed;
5378
Raja Mania03fee32015-06-22 20:22:20 +05305379struct wmi_tim_info_arg {
5380 __le32 tim_len;
5381 __le32 tim_mcast;
5382 const __le32 *tim_bitmap;
5383 __le32 tim_changed;
5384 __le32 tim_num_ps_pending;
5385} __packed;
5386
Kalle Valo5e3dd152013-06-12 20:52:10 +03005387/* Maximum number of NOA Descriptors supported */
5388#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
5389#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
5390#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
5391#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
5392
5393struct wmi_p2p_noa_info {
5394 /* Bit 0 - Flag to indicate an update in NOA schedule
5395 Bits 7-1 - Reserved */
5396 u8 changed;
5397 /* NOA index */
5398 u8 index;
5399 /* Bit 0 - Opp PS state of the AP
5400 Bits 1-7 - Ctwindow in TUs */
5401 u8 ctwindow_oppps;
5402 /* Number of NOA descriptors */
5403 u8 num_descriptors;
5404
5405 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
5406} __packed;
5407
5408struct wmi_bcn_info {
5409 struct wmi_tim_info tim_info;
5410 struct wmi_p2p_noa_info p2p_noa_info;
5411} __packed;
5412
5413struct wmi_host_swba_event {
5414 __le32 vdev_map;
Michal Kazior32653cf2014-12-03 10:10:26 +02005415 struct wmi_bcn_info bcn_info[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03005416} __packed;
5417
Raja Mani3cec3be2015-06-22 20:22:21 +05305418/* 16 words = 512 client + 1 word = for guard */
5419#define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
5420
5421struct wmi_10_4_tim_info {
5422 __le32 tim_len;
5423 __le32 tim_mcast;
5424 __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
5425 __le32 tim_changed;
5426 __le32 tim_num_ps_pending;
5427} __packed;
5428
5429#define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
5430
5431struct wmi_10_4_p2p_noa_info {
5432 /* Bit 0 - Flag to indicate an update in NOA schedule
5433 * Bits 7-1 - Reserved
5434 */
5435 u8 changed;
5436 /* NOA index */
5437 u8 index;
5438 /* Bit 0 - Opp PS state of the AP
5439 * Bits 1-7 - Ctwindow in TUs
5440 */
5441 u8 ctwindow_oppps;
5442 /* Number of NOA descriptors */
5443 u8 num_descriptors;
5444
5445 struct wmi_p2p_noa_descriptor
5446 noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
5447} __packed;
5448
5449struct wmi_10_4_bcn_info {
5450 struct wmi_10_4_tim_info tim_info;
5451 struct wmi_10_4_p2p_noa_info p2p_noa_info;
5452} __packed;
5453
5454struct wmi_10_4_host_swba_event {
5455 __le32 vdev_map;
5456 struct wmi_10_4_bcn_info bcn_info[0];
5457} __packed;
5458
Kalle Valo5e3dd152013-06-12 20:52:10 +03005459#define WMI_MAX_AP_VDEV 16
5460
5461struct wmi_tbtt_offset_event {
5462 __le32 vdev_map;
5463 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
5464} __packed;
5465
Kalle Valo5e3dd152013-06-12 20:52:10 +03005466struct wmi_peer_create_cmd {
5467 __le32 vdev_id;
5468 struct wmi_mac_addr peer_macaddr;
5469} __packed;
5470
Marek Puzyniak7390ed32015-03-30 09:51:52 +03005471enum wmi_peer_type {
5472 WMI_PEER_TYPE_DEFAULT = 0,
5473 WMI_PEER_TYPE_BSS = 1,
5474 WMI_PEER_TYPE_TDLS = 2,
5475};
5476
Kalle Valo5e3dd152013-06-12 20:52:10 +03005477struct wmi_peer_delete_cmd {
5478 __le32 vdev_id;
5479 struct wmi_mac_addr peer_macaddr;
5480} __packed;
5481
5482struct wmi_peer_flush_tids_cmd {
5483 __le32 vdev_id;
5484 struct wmi_mac_addr peer_macaddr;
5485 __le32 peer_tid_bitmap;
5486} __packed;
5487
5488struct wmi_fixed_rate {
5489 /*
5490 * rate mode . 0: disable fixed rate (auto rate)
5491 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
5492 * 2: ht20 11n rate specified as mcs index
5493 * 3: ht40 11n rate specified as mcs index
5494 */
5495 __le32 rate_mode;
5496 /*
5497 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
5498 * and series 3 is stored at byte 3 (MSB)
5499 */
5500 __le32 rate_series;
5501 /*
5502 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
5503 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
5504 * (MSB)
5505 */
5506 __le32 rate_retries;
5507} __packed;
5508
5509struct wmi_peer_fixed_rate_cmd {
5510 /* unique id identifying the VDEV, generated by the caller */
5511 __le32 vdev_id;
5512 /* peer MAC address */
5513 struct wmi_mac_addr peer_macaddr;
5514 /* fixed rate */
5515 struct wmi_fixed_rate peer_fixed_rate;
5516} __packed;
5517
5518#define WMI_MGMT_TID 17
5519
5520struct wmi_addba_clear_resp_cmd {
5521 /* unique id identifying the VDEV, generated by the caller */
5522 __le32 vdev_id;
5523 /* peer MAC address */
5524 struct wmi_mac_addr peer_macaddr;
5525} __packed;
5526
5527struct wmi_addba_send_cmd {
5528 /* unique id identifying the VDEV, generated by the caller */
5529 __le32 vdev_id;
5530 /* peer MAC address */
5531 struct wmi_mac_addr peer_macaddr;
5532 /* Tid number */
5533 __le32 tid;
5534 /* Buffer/Window size*/
5535 __le32 buffersize;
5536} __packed;
5537
5538struct wmi_delba_send_cmd {
5539 /* unique id identifying the VDEV, generated by the caller */
5540 __le32 vdev_id;
5541 /* peer MAC address */
5542 struct wmi_mac_addr peer_macaddr;
5543 /* Tid number */
5544 __le32 tid;
5545 /* Is Initiator */
5546 __le32 initiator;
5547 /* Reason code */
5548 __le32 reasoncode;
5549} __packed;
5550
5551struct wmi_addba_setresponse_cmd {
5552 /* unique id identifying the vdev, generated by the caller */
5553 __le32 vdev_id;
5554 /* peer mac address */
5555 struct wmi_mac_addr peer_macaddr;
5556 /* Tid number */
5557 __le32 tid;
5558 /* status code */
5559 __le32 statuscode;
5560} __packed;
5561
5562struct wmi_send_singleamsdu_cmd {
5563 /* unique id identifying the vdev, generated by the caller */
5564 __le32 vdev_id;
5565 /* peer mac address */
5566 struct wmi_mac_addr peer_macaddr;
5567 /* Tid number */
5568 __le32 tid;
5569} __packed;
5570
5571enum wmi_peer_smps_state {
5572 WMI_PEER_SMPS_PS_NONE = 0x0,
5573 WMI_PEER_SMPS_STATIC = 0x1,
5574 WMI_PEER_SMPS_DYNAMIC = 0x2
5575};
5576
Michal Kazior9797feb2014-02-14 14:49:48 +01005577enum wmi_peer_chwidth {
5578 WMI_PEER_CHWIDTH_20MHZ = 0,
5579 WMI_PEER_CHWIDTH_40MHZ = 1,
5580 WMI_PEER_CHWIDTH_80MHZ = 2,
5581};
5582
Kalle Valo5e3dd152013-06-12 20:52:10 +03005583enum wmi_peer_param {
5584 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
5585 WMI_PEER_AMPDU = 0x2,
5586 WMI_PEER_AUTHORIZE = 0x3,
5587 WMI_PEER_CHAN_WIDTH = 0x4,
5588 WMI_PEER_NSS = 0x5,
Michal Kazior0a987fb2015-02-13 13:30:15 +01005589 WMI_PEER_USE_4ADDR = 0x6,
5590 WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
Kalle Valo5e3dd152013-06-12 20:52:10 +03005591};
5592
5593struct wmi_peer_set_param_cmd {
5594 __le32 vdev_id;
5595 struct wmi_mac_addr peer_macaddr;
5596 __le32 param_id;
5597 __le32 param_value;
5598} __packed;
5599
5600#define MAX_SUPPORTED_RATES 128
5601
5602struct wmi_rate_set {
5603 /* total number of rates */
5604 __le32 num_rates;
5605 /*
5606 * rates (each 8bit value) packed into a 32 bit word.
5607 * the rates are filled from least significant byte to most
5608 * significant byte.
5609 */
5610 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
5611} __packed;
5612
5613struct wmi_rate_set_arg {
5614 unsigned int num_rates;
5615 u8 rates[MAX_SUPPORTED_RATES];
5616};
5617
5618/*
5619 * NOTE: It would bea good idea to represent the Tx MCS
5620 * info in one word and Rx in another word. This is split
5621 * into multiple words for convenience
5622 */
5623struct wmi_vht_rate_set {
5624 __le32 rx_max_rate; /* Max Rx data rate */
5625 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
5626 __le32 tx_max_rate; /* Max Tx data rate */
5627 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
5628} __packed;
5629
5630struct wmi_vht_rate_set_arg {
5631 u32 rx_max_rate;
5632 u32 rx_mcs_set;
5633 u32 tx_max_rate;
5634 u32 tx_mcs_set;
5635};
5636
5637struct wmi_peer_set_rates_cmd {
5638 /* peer MAC address */
5639 struct wmi_mac_addr peer_macaddr;
5640 /* legacy rate set */
5641 struct wmi_rate_set peer_legacy_rates;
5642 /* ht rate set */
5643 struct wmi_rate_set peer_ht_rates;
5644} __packed;
5645
5646struct wmi_peer_set_q_empty_callback_cmd {
5647 /* unique id identifying the VDEV, generated by the caller */
5648 __le32 vdev_id;
5649 /* peer MAC address */
5650 struct wmi_mac_addr peer_macaddr;
5651 __le32 callback_enable;
5652} __packed;
5653
Tamizh chelvam3fab30f2015-10-29 14:27:37 +02005654struct wmi_peer_flags_map {
5655 u32 auth;
5656 u32 qos;
5657 u32 need_ptk_4_way;
5658 u32 need_gtk_2_way;
5659 u32 apsd;
5660 u32 ht;
5661 u32 bw40;
5662 u32 stbc;
5663 u32 ldbc;
5664 u32 dyn_mimops;
5665 u32 static_mimops;
5666 u32 spatial_mux;
5667 u32 vht;
5668 u32 bw80;
5669 u32 vht_2g;
5670 u32 pmf;
5671};
5672
5673enum wmi_peer_flags {
5674 WMI_PEER_AUTH = 0x00000001,
5675 WMI_PEER_QOS = 0x00000002,
5676 WMI_PEER_NEED_PTK_4_WAY = 0x00000004,
5677 WMI_PEER_NEED_GTK_2_WAY = 0x00000010,
5678 WMI_PEER_APSD = 0x00000800,
5679 WMI_PEER_HT = 0x00001000,
5680 WMI_PEER_40MHZ = 0x00002000,
5681 WMI_PEER_STBC = 0x00008000,
5682 WMI_PEER_LDPC = 0x00010000,
5683 WMI_PEER_DYN_MIMOPS = 0x00020000,
5684 WMI_PEER_STATIC_MIMOPS = 0x00040000,
5685 WMI_PEER_SPATIAL_MUX = 0x00200000,
5686 WMI_PEER_VHT = 0x02000000,
5687 WMI_PEER_80MHZ = 0x04000000,
5688 WMI_PEER_VHT_2G = 0x08000000,
5689 WMI_PEER_PMF = 0x10000000,
5690};
5691
5692enum wmi_10x_peer_flags {
5693 WMI_10X_PEER_AUTH = 0x00000001,
5694 WMI_10X_PEER_QOS = 0x00000002,
5695 WMI_10X_PEER_NEED_PTK_4_WAY = 0x00000004,
5696 WMI_10X_PEER_NEED_GTK_2_WAY = 0x00000010,
5697 WMI_10X_PEER_APSD = 0x00000800,
5698 WMI_10X_PEER_HT = 0x00001000,
5699 WMI_10X_PEER_40MHZ = 0x00002000,
5700 WMI_10X_PEER_STBC = 0x00008000,
5701 WMI_10X_PEER_LDPC = 0x00010000,
5702 WMI_10X_PEER_DYN_MIMOPS = 0x00020000,
5703 WMI_10X_PEER_STATIC_MIMOPS = 0x00040000,
5704 WMI_10X_PEER_SPATIAL_MUX = 0x00200000,
5705 WMI_10X_PEER_VHT = 0x02000000,
5706 WMI_10X_PEER_80MHZ = 0x04000000,
5707};
5708
5709enum wmi_10_2_peer_flags {
5710 WMI_10_2_PEER_AUTH = 0x00000001,
5711 WMI_10_2_PEER_QOS = 0x00000002,
5712 WMI_10_2_PEER_NEED_PTK_4_WAY = 0x00000004,
5713 WMI_10_2_PEER_NEED_GTK_2_WAY = 0x00000010,
5714 WMI_10_2_PEER_APSD = 0x00000800,
5715 WMI_10_2_PEER_HT = 0x00001000,
5716 WMI_10_2_PEER_40MHZ = 0x00002000,
5717 WMI_10_2_PEER_STBC = 0x00008000,
5718 WMI_10_2_PEER_LDPC = 0x00010000,
5719 WMI_10_2_PEER_DYN_MIMOPS = 0x00020000,
5720 WMI_10_2_PEER_STATIC_MIMOPS = 0x00040000,
5721 WMI_10_2_PEER_SPATIAL_MUX = 0x00200000,
5722 WMI_10_2_PEER_VHT = 0x02000000,
5723 WMI_10_2_PEER_80MHZ = 0x04000000,
5724 WMI_10_2_PEER_VHT_2G = 0x08000000,
5725 WMI_10_2_PEER_PMF = 0x10000000,
5726};
Kalle Valo5e3dd152013-06-12 20:52:10 +03005727
5728/*
5729 * Peer rate capabilities.
5730 *
5731 * This is of interest to the ratecontrol
5732 * module which resides in the firmware. The bit definitions are
5733 * consistent with that defined in if_athrate.c.
5734 */
5735#define WMI_RC_DS_FLAG 0x01
5736#define WMI_RC_CW40_FLAG 0x02
5737#define WMI_RC_SGI_FLAG 0x04
5738#define WMI_RC_HT_FLAG 0x08
5739#define WMI_RC_RTSCTS_FLAG 0x10
5740#define WMI_RC_TX_STBC_FLAG 0x20
5741#define WMI_RC_RX_STBC_FLAG 0xC0
5742#define WMI_RC_RX_STBC_FLAG_S 6
5743#define WMI_RC_WEP_TKIP_FLAG 0x100
5744#define WMI_RC_TS_FLAG 0x200
5745#define WMI_RC_UAPSD_FLAG 0x400
5746
5747/* Maximum listen interval supported by hw in units of beacon interval */
5748#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
5749
Michal Kazior24c88f72014-07-25 13:32:17 +02005750struct wmi_common_peer_assoc_complete_cmd {
Kalle Valo5e3dd152013-06-12 20:52:10 +03005751 struct wmi_mac_addr peer_macaddr;
5752 __le32 vdev_id;
5753 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
5754 __le32 peer_associd; /* 16 LSBs */
5755 __le32 peer_flags;
5756 __le32 peer_caps; /* 16 LSBs */
5757 __le32 peer_listen_intval;
5758 __le32 peer_ht_caps;
5759 __le32 peer_max_mpdu;
5760 __le32 peer_mpdu_density; /* 0..16 */
5761 __le32 peer_rate_caps;
5762 struct wmi_rate_set peer_legacy_rates;
5763 struct wmi_rate_set peer_ht_rates;
5764 __le32 peer_nss; /* num of spatial streams */
5765 __le32 peer_vht_caps;
5766 __le32 peer_phymode;
5767 struct wmi_vht_rate_set peer_vht_rates;
Michal Kazior24c88f72014-07-25 13:32:17 +02005768};
5769
5770struct wmi_main_peer_assoc_complete_cmd {
5771 struct wmi_common_peer_assoc_complete_cmd cmd;
5772
Kalle Valo5e3dd152013-06-12 20:52:10 +03005773 /* HT Operation Element of the peer. Five bytes packed in 2
5774 * INT32 array and filled from lsb to msb. */
5775 __le32 peer_ht_info[2];
5776} __packed;
5777
Michal Kazior24c88f72014-07-25 13:32:17 +02005778struct wmi_10_1_peer_assoc_complete_cmd {
5779 struct wmi_common_peer_assoc_complete_cmd cmd;
5780} __packed;
5781
5782#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
5783#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
5784#define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
5785#define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
5786
5787struct wmi_10_2_peer_assoc_complete_cmd {
5788 struct wmi_common_peer_assoc_complete_cmd cmd;
5789 __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
5790} __packed;
5791
Kalle Valo5e3dd152013-06-12 20:52:10 +03005792struct wmi_peer_assoc_complete_arg {
5793 u8 addr[ETH_ALEN];
5794 u32 vdev_id;
5795 bool peer_reassoc;
5796 u16 peer_aid;
5797 u32 peer_flags; /* see %WMI_PEER_ */
5798 u16 peer_caps;
5799 u32 peer_listen_intval;
5800 u32 peer_ht_caps;
5801 u32 peer_max_mpdu;
5802 u32 peer_mpdu_density; /* 0..16 */
5803 u32 peer_rate_caps; /* see %WMI_RC_ */
5804 struct wmi_rate_set_arg peer_legacy_rates;
5805 struct wmi_rate_set_arg peer_ht_rates;
5806 u32 peer_num_spatial_streams;
5807 u32 peer_vht_caps;
5808 enum wmi_phy_mode peer_phymode;
5809 struct wmi_vht_rate_set_arg peer_vht_rates;
5810};
5811
5812struct wmi_peer_add_wds_entry_cmd {
5813 /* peer MAC address */
5814 struct wmi_mac_addr peer_macaddr;
5815 /* wds MAC addr */
5816 struct wmi_mac_addr wds_macaddr;
5817} __packed;
5818
5819struct wmi_peer_remove_wds_entry_cmd {
5820 /* wds MAC addr */
5821 struct wmi_mac_addr wds_macaddr;
5822} __packed;
5823
5824struct wmi_peer_q_empty_callback_event {
5825 /* peer MAC address */
5826 struct wmi_mac_addr peer_macaddr;
5827} __packed;
5828
5829/*
5830 * Channel info WMI event
5831 */
5832struct wmi_chan_info_event {
5833 __le32 err_code;
5834 __le32 freq;
5835 __le32 cmd_flags;
5836 __le32 noise_floor;
5837 __le32 rx_clear_count;
5838 __le32 cycle_count;
5839} __packed;
5840
Raja Manib2297ba2015-06-22 20:22:23 +05305841struct wmi_10_4_chan_info_event {
5842 __le32 err_code;
5843 __le32 freq;
5844 __le32 cmd_flags;
5845 __le32 noise_floor;
5846 __le32 rx_clear_count;
5847 __le32 cycle_count;
5848 __le32 chan_tx_pwr_range;
5849 __le32 chan_tx_pwr_tp;
5850 __le32 rx_frame_count;
5851} __packed;
5852
Kalle Valo5a13e762014-01-20 11:01:46 +02005853struct wmi_peer_sta_kickout_event {
5854 struct wmi_mac_addr peer_macaddr;
5855} __packed;
5856
Michal Kazior2e1dea42013-07-31 10:32:40 +02005857#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
Vasanthakumar Thiagarajan3d2a2e22015-08-12 16:24:04 +05305858#define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1)
Michal Kazior2e1dea42013-07-31 10:32:40 +02005859
Kalle Valo5e3dd152013-06-12 20:52:10 +03005860/* Beacon filter wmi command info */
5861#define BCN_FLT_MAX_SUPPORTED_IES 256
5862#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
5863
5864struct bss_bcn_stats {
5865 __le32 vdev_id;
5866 __le32 bss_bcnsdropped;
5867 __le32 bss_bcnsdelivered;
5868} __packed;
5869
5870struct bcn_filter_stats {
5871 __le32 bcns_dropped;
5872 __le32 bcns_delivered;
5873 __le32 activefilters;
5874 struct bss_bcn_stats bss_stats;
5875} __packed;
5876
5877struct wmi_add_bcn_filter_cmd {
5878 u32 vdev_id;
5879 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
5880} __packed;
5881
5882enum wmi_sta_keepalive_method {
5883 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
5884 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
5885};
5886
Michal Kazior46725b152015-01-28 09:57:49 +02005887#define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
5888
5889/* Firmware crashes if keepalive interval exceeds this limit */
5890#define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
5891
Kalle Valo5e3dd152013-06-12 20:52:10 +03005892/* note: ip4 addresses are in network byte order, i.e. big endian */
5893struct wmi_sta_keepalive_arp_resp {
5894 __be32 src_ip4_addr;
5895 __be32 dest_ip4_addr;
5896 struct wmi_mac_addr dest_mac_addr;
5897} __packed;
5898
5899struct wmi_sta_keepalive_cmd {
5900 __le32 vdev_id;
5901 __le32 enabled;
5902 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
5903 __le32 interval; /* in seconds */
5904 struct wmi_sta_keepalive_arp_resp arp_resp;
5905} __packed;
5906
Janusz Dziedzic6e8b1882015-01-28 09:57:39 +02005907struct wmi_sta_keepalive_arg {
5908 u32 vdev_id;
5909 u32 enabled;
5910 u32 method;
5911 u32 interval;
5912 __be32 src_ip4_addr;
5913 __be32 dest_ip4_addr;
5914 const u8 dest_mac_addr[ETH_ALEN];
5915};
5916
Michal Kazior9cfbce72013-07-16 09:54:36 +02005917enum wmi_force_fw_hang_type {
5918 WMI_FORCE_FW_HANG_ASSERT = 1,
5919 WMI_FORCE_FW_HANG_NO_DETECT,
5920 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
5921 WMI_FORCE_FW_HANG_EMPTY_POINT,
5922 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
5923 WMI_FORCE_FW_HANG_INFINITE_LOOP,
5924};
5925
5926#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
5927
5928struct wmi_force_fw_hang_cmd {
5929 __le32 type;
5930 __le32 delay_ms;
5931} __packed;
5932
Kalle Valof118a3e2014-01-03 12:59:31 +02005933enum ath10k_dbglog_level {
5934 ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
5935 ATH10K_DBGLOG_LEVEL_INFO = 1,
5936 ATH10K_DBGLOG_LEVEL_WARN = 2,
5937 ATH10K_DBGLOG_LEVEL_ERR = 3,
5938};
5939
5940/* VAP ids to enable dbglog */
5941#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
5942#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
5943
5944/* to enable dbglog in the firmware */
5945#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
5946#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
5947
5948/* timestamp resolution */
5949#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
5950#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
5951
5952/* number of queued messages before sending them to the host */
5953#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
5954#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
5955
5956/*
5957 * Log levels to enable. This defines the minimum level to enable, this is
5958 * not a bitmask. See enum ath10k_dbglog_level for the values.
5959 */
5960#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
5961#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
5962
5963/*
5964 * Note: this is a cleaned up version of a struct firmware uses. For
5965 * example, config_valid was hidden inside an array.
5966 */
5967struct wmi_dbglog_cfg_cmd {
5968 /* bitmask to hold mod id config*/
5969 __le32 module_enable;
5970
5971 /* see ATH10K_DBGLOG_CFG_ */
5972 __le32 config_enable;
5973
5974 /* mask of module id bits to be changed */
5975 __le32 module_valid;
5976
5977 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
5978 __le32 config_valid;
5979} __packed;
5980
Michal Kaziorc1a46542015-03-10 16:21:54 +02005981enum wmi_roam_reason {
5982 WMI_ROAM_REASON_BETTER_AP = 1,
5983 WMI_ROAM_REASON_BEACON_MISS = 2,
5984 WMI_ROAM_REASON_LOW_RSSI = 3,
5985 WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
5986 WMI_ROAM_REASON_HO_FAILED = 5,
5987
5988 /* keep last */
5989 WMI_ROAM_REASON_MAX,
5990};
5991
5992struct wmi_roam_ev {
5993 __le32 vdev_id;
5994 __le32 reason;
5995} __packed;
5996
Kalle Valo5e3dd152013-06-12 20:52:10 +03005997#define ATH10K_FRAGMT_THRESHOLD_MIN 540
5998#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
5999
6000#define WMI_MAX_EVENT 0x1000
6001/* Maximum number of pending TXed WMI packets */
Kalle Valo5e3dd152013-06-12 20:52:10 +03006002#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
6003
6004/* By default disable power save for IBSS */
6005#define ATH10K_DEFAULT_ATIM 0
6006
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006007#define WMI_MAX_MEM_REQS 16
6008
Michal Kazior32653cf2014-12-03 10:10:26 +02006009struct wmi_scan_ev_arg {
6010 __le32 event_type; /* %WMI_SCAN_EVENT_ */
6011 __le32 reason; /* %WMI_SCAN_REASON_ */
6012 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
6013 __le32 scan_req_id;
6014 __le32 scan_id;
6015 __le32 vdev_id;
6016};
6017
6018struct wmi_mgmt_rx_ev_arg {
6019 __le32 channel;
6020 __le32 snr;
6021 __le32 rate;
6022 __le32 phy_mode;
6023 __le32 buf_len;
6024 __le32 status; /* %WMI_RX_STATUS_ */
6025};
6026
6027struct wmi_ch_info_ev_arg {
6028 __le32 err_code;
6029 __le32 freq;
6030 __le32 cmd_flags;
6031 __le32 noise_floor;
6032 __le32 rx_clear_count;
6033 __le32 cycle_count;
Raja Manib2297ba2015-06-22 20:22:23 +05306034 __le32 chan_tx_pwr_range;
6035 __le32 chan_tx_pwr_tp;
6036 __le32 rx_frame_count;
Michal Kazior32653cf2014-12-03 10:10:26 +02006037};
6038
6039struct wmi_vdev_start_ev_arg {
6040 __le32 vdev_id;
6041 __le32 req_id;
6042 __le32 resp_type; /* %WMI_VDEV_RESP_ */
6043 __le32 status;
6044};
6045
6046struct wmi_peer_kick_ev_arg {
6047 const u8 *mac_addr;
6048};
6049
6050struct wmi_swba_ev_arg {
6051 __le32 vdev_map;
Raja Mania03fee32015-06-22 20:22:20 +05306052 struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
Michal Kazior32653cf2014-12-03 10:10:26 +02006053 const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
6054};
6055
6056struct wmi_phyerr_ev_arg {
Raja Mani991adf72015-08-14 11:13:29 +03006057 u32 tsf_timestamp;
6058 u16 freq1;
6059 u16 freq2;
6060 u8 rssi_combined;
6061 u8 chan_width_mhz;
6062 u8 phy_err_code;
6063 u16 nf_chains[4];
6064 u32 buf_len;
6065 const u8 *buf;
6066 u8 hdr_len;
6067};
6068
6069struct wmi_phyerr_hdr_arg {
6070 u32 num_phyerrs;
6071 u32 tsf_l32;
6072 u32 tsf_u32;
6073 u32 buf_len;
6074 const void *phyerrs;
Michal Kazior32653cf2014-12-03 10:10:26 +02006075};
6076
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006077struct wmi_svc_rdy_ev_arg {
6078 __le32 min_tx_power;
6079 __le32 max_tx_power;
6080 __le32 ht_cap;
6081 __le32 vht_cap;
6082 __le32 sw_ver0;
6083 __le32 sw_ver1;
Michal Kaziorca996ec2014-12-03 10:11:32 +02006084 __le32 fw_build;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006085 __le32 phy_capab;
6086 __le32 num_rf_chains;
6087 __le32 eeprom_rd;
6088 __le32 num_mem_reqs;
6089 const __le32 *service_map;
Michal Kazior2a3e60d2014-11-27 10:11:15 +01006090 size_t service_map_len;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02006091 const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
6092};
6093
Michal Kazior32653cf2014-12-03 10:10:26 +02006094struct wmi_rdy_ev_arg {
6095 __le32 sw_version;
6096 __le32 abi_version;
6097 __le32 status;
6098 const u8 *mac_addr;
6099};
6100
Michal Kaziorc1a46542015-03-10 16:21:54 +02006101struct wmi_roam_ev_arg {
6102 __le32 vdev_id;
6103 __le32 reason;
6104 __le32 rssi;
6105};
6106
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02006107struct wmi_pdev_temperature_event {
6108 /* temperature value in Celcius degree */
6109 __le32 temperature;
6110} __packed;
6111
Janusz Dziedzicf5431e82015-03-23 17:32:53 +02006112/* WOW structures */
6113enum wmi_wow_wakeup_event {
6114 WOW_BMISS_EVENT = 0,
6115 WOW_BETTER_AP_EVENT,
6116 WOW_DEAUTH_RECVD_EVENT,
6117 WOW_MAGIC_PKT_RECVD_EVENT,
6118 WOW_GTK_ERR_EVENT,
6119 WOW_FOURWAY_HSHAKE_EVENT,
6120 WOW_EAPOL_RECVD_EVENT,
6121 WOW_NLO_DETECTED_EVENT,
6122 WOW_DISASSOC_RECVD_EVENT,
6123 WOW_PATTERN_MATCH_EVENT,
6124 WOW_CSA_IE_EVENT,
6125 WOW_PROBE_REQ_WPS_IE_EVENT,
6126 WOW_AUTH_REQ_EVENT,
6127 WOW_ASSOC_REQ_EVENT,
6128 WOW_HTT_EVENT,
6129 WOW_RA_MATCH_EVENT,
6130 WOW_HOST_AUTO_SHUTDOWN_EVENT,
6131 WOW_IOAC_MAGIC_EVENT,
6132 WOW_IOAC_SHORT_EVENT,
6133 WOW_IOAC_EXTEND_EVENT,
6134 WOW_IOAC_TIMER_EVENT,
6135 WOW_DFS_PHYERR_RADAR_EVENT,
6136 WOW_BEACON_EVENT,
6137 WOW_CLIENT_KICKOUT_EVENT,
6138 WOW_EVENT_MAX,
6139};
6140
6141#define C2S(x) case x: return #x
6142
6143static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
6144{
6145 switch (ev) {
6146 C2S(WOW_BMISS_EVENT);
6147 C2S(WOW_BETTER_AP_EVENT);
6148 C2S(WOW_DEAUTH_RECVD_EVENT);
6149 C2S(WOW_MAGIC_PKT_RECVD_EVENT);
6150 C2S(WOW_GTK_ERR_EVENT);
6151 C2S(WOW_FOURWAY_HSHAKE_EVENT);
6152 C2S(WOW_EAPOL_RECVD_EVENT);
6153 C2S(WOW_NLO_DETECTED_EVENT);
6154 C2S(WOW_DISASSOC_RECVD_EVENT);
6155 C2S(WOW_PATTERN_MATCH_EVENT);
6156 C2S(WOW_CSA_IE_EVENT);
6157 C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
6158 C2S(WOW_AUTH_REQ_EVENT);
6159 C2S(WOW_ASSOC_REQ_EVENT);
6160 C2S(WOW_HTT_EVENT);
6161 C2S(WOW_RA_MATCH_EVENT);
6162 C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
6163 C2S(WOW_IOAC_MAGIC_EVENT);
6164 C2S(WOW_IOAC_SHORT_EVENT);
6165 C2S(WOW_IOAC_EXTEND_EVENT);
6166 C2S(WOW_IOAC_TIMER_EVENT);
6167 C2S(WOW_DFS_PHYERR_RADAR_EVENT);
6168 C2S(WOW_BEACON_EVENT);
6169 C2S(WOW_CLIENT_KICKOUT_EVENT);
6170 C2S(WOW_EVENT_MAX);
6171 default:
6172 return NULL;
6173 }
6174}
6175
6176enum wmi_wow_wake_reason {
6177 WOW_REASON_UNSPECIFIED = -1,
6178 WOW_REASON_NLOD = 0,
6179 WOW_REASON_AP_ASSOC_LOST,
6180 WOW_REASON_LOW_RSSI,
6181 WOW_REASON_DEAUTH_RECVD,
6182 WOW_REASON_DISASSOC_RECVD,
6183 WOW_REASON_GTK_HS_ERR,
6184 WOW_REASON_EAP_REQ,
6185 WOW_REASON_FOURWAY_HS_RECV,
6186 WOW_REASON_TIMER_INTR_RECV,
6187 WOW_REASON_PATTERN_MATCH_FOUND,
6188 WOW_REASON_RECV_MAGIC_PATTERN,
6189 WOW_REASON_P2P_DISC,
6190 WOW_REASON_WLAN_HB,
6191 WOW_REASON_CSA_EVENT,
6192 WOW_REASON_PROBE_REQ_WPS_IE_RECV,
6193 WOW_REASON_AUTH_REQ_RECV,
6194 WOW_REASON_ASSOC_REQ_RECV,
6195 WOW_REASON_HTT_EVENT,
6196 WOW_REASON_RA_MATCH,
6197 WOW_REASON_HOST_AUTO_SHUTDOWN,
6198 WOW_REASON_IOAC_MAGIC_EVENT,
6199 WOW_REASON_IOAC_SHORT_EVENT,
6200 WOW_REASON_IOAC_EXTEND_EVENT,
6201 WOW_REASON_IOAC_TIMER_EVENT,
6202 WOW_REASON_ROAM_HO,
6203 WOW_REASON_DFS_PHYERR_RADADR_EVENT,
6204 WOW_REASON_BEACON_RECV,
6205 WOW_REASON_CLIENT_KICKOUT_EVENT,
6206 WOW_REASON_DEBUG_TEST = 0xFF,
6207};
6208
6209static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
6210{
6211 switch (reason) {
6212 C2S(WOW_REASON_UNSPECIFIED);
6213 C2S(WOW_REASON_NLOD);
6214 C2S(WOW_REASON_AP_ASSOC_LOST);
6215 C2S(WOW_REASON_LOW_RSSI);
6216 C2S(WOW_REASON_DEAUTH_RECVD);
6217 C2S(WOW_REASON_DISASSOC_RECVD);
6218 C2S(WOW_REASON_GTK_HS_ERR);
6219 C2S(WOW_REASON_EAP_REQ);
6220 C2S(WOW_REASON_FOURWAY_HS_RECV);
6221 C2S(WOW_REASON_TIMER_INTR_RECV);
6222 C2S(WOW_REASON_PATTERN_MATCH_FOUND);
6223 C2S(WOW_REASON_RECV_MAGIC_PATTERN);
6224 C2S(WOW_REASON_P2P_DISC);
6225 C2S(WOW_REASON_WLAN_HB);
6226 C2S(WOW_REASON_CSA_EVENT);
6227 C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
6228 C2S(WOW_REASON_AUTH_REQ_RECV);
6229 C2S(WOW_REASON_ASSOC_REQ_RECV);
6230 C2S(WOW_REASON_HTT_EVENT);
6231 C2S(WOW_REASON_RA_MATCH);
6232 C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
6233 C2S(WOW_REASON_IOAC_MAGIC_EVENT);
6234 C2S(WOW_REASON_IOAC_SHORT_EVENT);
6235 C2S(WOW_REASON_IOAC_EXTEND_EVENT);
6236 C2S(WOW_REASON_IOAC_TIMER_EVENT);
6237 C2S(WOW_REASON_ROAM_HO);
6238 C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
6239 C2S(WOW_REASON_BEACON_RECV);
6240 C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
6241 C2S(WOW_REASON_DEBUG_TEST);
6242 default:
6243 return NULL;
6244 }
6245}
6246
6247#undef C2S
6248
6249struct wmi_wow_ev_arg {
6250 u32 vdev_id;
6251 u32 flag;
6252 enum wmi_wow_wake_reason wake_reason;
6253 u32 data_len;
6254};
6255
Janusz Dziedzic25c86612015-03-23 17:32:54 +02006256#define WOW_MIN_PATTERN_SIZE 1
6257#define WOW_MAX_PATTERN_SIZE 148
6258#define WOW_MAX_PKT_OFFSET 128
6259
Marek Puzyniakad45c882015-03-30 09:51:53 +03006260enum wmi_tdls_state {
6261 WMI_TDLS_DISABLE,
6262 WMI_TDLS_ENABLE_PASSIVE,
6263 WMI_TDLS_ENABLE_ACTIVE,
6264};
6265
6266enum wmi_tdls_peer_state {
6267 WMI_TDLS_PEER_STATE_PEERING,
6268 WMI_TDLS_PEER_STATE_CONNECTED,
6269 WMI_TDLS_PEER_STATE_TEARDOWN,
6270};
6271
6272struct wmi_tdls_peer_update_cmd_arg {
6273 u32 vdev_id;
6274 enum wmi_tdls_peer_state peer_state;
6275 u8 addr[ETH_ALEN];
6276};
6277
6278#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
6279
6280struct wmi_tdls_peer_capab_arg {
6281 u8 peer_uapsd_queues;
6282 u8 peer_max_sp;
6283 u32 buff_sta_support;
6284 u32 off_chan_support;
6285 u32 peer_curr_operclass;
6286 u32 self_curr_operclass;
6287 u32 peer_chan_len;
6288 u32 peer_operclass_len;
6289 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
6290 u32 is_peer_responder;
6291 u32 pref_offchan_num;
6292 u32 pref_offchan_bw;
6293};
6294
Vivek Natarajan08e75ea2015-08-04 10:45:11 +05306295enum wmi_txbf_conf {
6296 WMI_TXBF_CONF_UNSUPPORTED,
6297 WMI_TXBF_CONF_BEFORE_ASSOC,
6298 WMI_TXBF_CONF_AFTER_ASSOC,
6299};
6300
Maharaja62f77f02015-10-21 11:49:18 +03006301#define WMI_CCA_DETECT_LEVEL_AUTO 0
6302#define WMI_CCA_DETECT_MARGIN_AUTO 0
6303
6304struct wmi_pdev_set_adaptive_cca_params {
6305 __le32 enable;
6306 __le32 cca_detect_level;
6307 __le32 cca_detect_margin;
6308} __packed;
6309
Kalle Valo5e3dd152013-06-12 20:52:10 +03006310struct ath10k;
6311struct ath10k_vif;
Michal Kazior0226d602014-12-03 10:11:22 +02006312struct ath10k_fw_stats_pdev;
6313struct ath10k_fw_stats_peer;
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006314struct ath10k_fw_stats;
Kalle Valo5e3dd152013-06-12 20:52:10 +03006315
6316int ath10k_wmi_attach(struct ath10k *ar);
6317void ath10k_wmi_detach(struct ath10k *ar);
Vasanthakumar Thiagarajana925a372015-08-28 17:21:34 +05306318void ath10k_wmi_free_host_mem(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006319int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
6320int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006321
Michal Kazior0226d602014-12-03 10:11:22 +02006322struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
Michal Kazior95bf21f2014-05-16 17:15:39 +03006323int ath10k_wmi_connect(struct ath10k *ar);
Kalle Valo666a73f32014-09-10 18:23:23 +03006324
6325struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
6326int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
Michal Kaziord7579d12014-12-03 10:10:54 +02006327int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
6328 u32 cmd_id);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006329void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
Kalle Valo5e3dd152013-06-12 20:52:10 +03006330
Michal Kaziorb91251f2015-01-24 12:14:49 +02006331void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
6332 struct ath10k_fw_stats_pdev *dst);
6333void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
6334 struct ath10k_fw_stats_pdev *dst);
6335void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
6336 struct ath10k_fw_stats_pdev *dst);
6337void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
6338 struct ath10k_fw_stats_pdev *dst);
Michal Kazior0226d602014-12-03 10:11:22 +02006339void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
6340 struct ath10k_fw_stats_peer *dst);
6341void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
6342 struct wmi_host_mem_chunks *chunks);
6343void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
6344 const struct wmi_start_scan_arg *arg);
Michal Kazior5e752e42015-01-19 09:53:41 +01006345void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
6346 const struct wmi_wmm_params_arg *arg);
Michal Kazior0226d602014-12-03 10:11:22 +02006347void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
6348 const struct wmi_channel_arg *arg);
6349int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
6350
6351int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
6352int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
6353void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
6354void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
6355int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
6356void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
6357void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
6358void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
6359void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
6360void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
6361void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
6362void ath10k_wmi_event_dfs(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03006363 struct wmi_phyerr_ev_arg *phyerr, u64 tsf);
Michal Kazior0226d602014-12-03 10:11:22 +02006364void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
Raja Mani991adf72015-08-14 11:13:29 +03006365 struct wmi_phyerr_ev_arg *phyerr,
Michal Kazior0226d602014-12-03 10:11:22 +02006366 u64 tsf);
6367void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
6368void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
6369void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
6370void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
6371void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
6372void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
6373void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
6374 struct sk_buff *skb);
6375void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
6376 struct sk_buff *skb);
6377void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
6378void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
6379void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
6380void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
6381void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
6382void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
6383 struct sk_buff *skb);
6384void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
6385void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
6386void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
6387void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
6388 struct sk_buff *skb);
6389void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
6390void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
6391void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
6392void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
6393int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
Raja Mani991adf72015-08-14 11:13:29 +03006394int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf,
6395 int left_len, struct wmi_phyerr_ev_arg *arg);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006396void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar,
6397 struct ath10k_fw_stats *fw_stats,
6398 char *buf);
6399void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k *ar,
6400 struct ath10k_fw_stats *fw_stats,
6401 char *buf);
6402size_t ath10k_wmi_fw_stats_num_peers(struct list_head *head);
6403size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head);
Manikanta Pubbisetty98dd2b92015-10-28 21:38:33 +02006404void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
6405 struct ath10k_fw_stats *fw_stats,
6406 char *buf);
Manikanta Pubbisettybc6f9ae2015-10-16 15:54:52 +03006407
Kalle Valo5e3dd152013-06-12 20:52:10 +03006408#endif /* _WMI_H_ */