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