blob: ea5dadb306315f779e1a179bb7ac61b88768f275 [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
Michal Kaziorcff990c2014-08-04 09:18:33 +030076enum wmi_service {
77 WMI_SERVICE_BEACON_OFFLOAD = 0,
78 WMI_SERVICE_SCAN_OFFLOAD,
79 WMI_SERVICE_ROAM_OFFLOAD,
80 WMI_SERVICE_BCN_MISS_OFFLOAD,
81 WMI_SERVICE_STA_PWRSAVE,
82 WMI_SERVICE_STA_ADVANCED_PWRSAVE,
83 WMI_SERVICE_AP_UAPSD,
84 WMI_SERVICE_AP_DFS,
85 WMI_SERVICE_11AC,
86 WMI_SERVICE_BLOCKACK,
87 WMI_SERVICE_PHYERR,
88 WMI_SERVICE_BCN_FILTER,
89 WMI_SERVICE_RTT,
90 WMI_SERVICE_RATECTRL,
91 WMI_SERVICE_WOW,
92 WMI_SERVICE_RATECTRL_CACHE,
93 WMI_SERVICE_IRAM_TIDS,
94 WMI_SERVICE_ARPNS_OFFLOAD,
95 WMI_SERVICE_NLO,
96 WMI_SERVICE_GTK_OFFLOAD,
97 WMI_SERVICE_SCAN_SCH,
98 WMI_SERVICE_CSA_OFFLOAD,
99 WMI_SERVICE_CHATTER,
100 WMI_SERVICE_COEX_FREQAVOID,
101 WMI_SERVICE_PACKET_POWER_SAVE,
102 WMI_SERVICE_FORCE_FW_HANG,
103 WMI_SERVICE_GPIO,
104 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
105 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
106 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
107 WMI_SERVICE_STA_KEEP_ALIVE,
108 WMI_SERVICE_TX_ENCAP,
109 WMI_SERVICE_BURST,
110 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
111 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kaziorca996ec2014-12-03 10:11:32 +0200112 WMI_SERVICE_ROAM_SCAN_OFFLOAD,
113 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
114 WMI_SERVICE_EARLY_RX,
115 WMI_SERVICE_STA_SMPS,
116 WMI_SERVICE_FWTEST,
117 WMI_SERVICE_STA_WMMAC,
118 WMI_SERVICE_TDLS,
119 WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
120 WMI_SERVICE_ADAPTIVE_OCS,
121 WMI_SERVICE_BA_SSN_SUPPORT,
122 WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
123 WMI_SERVICE_WLAN_HB,
124 WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
125 WMI_SERVICE_BATCH_SCAN,
126 WMI_SERVICE_QPOWER,
127 WMI_SERVICE_PLMREQ,
128 WMI_SERVICE_THERMAL_MGMT,
129 WMI_SERVICE_RMC,
130 WMI_SERVICE_MHF_OFFLOAD,
131 WMI_SERVICE_COEX_SAR,
132 WMI_SERVICE_BCN_TXRATE_OVERRIDE,
133 WMI_SERVICE_NAN,
134 WMI_SERVICE_L1SS_STAT,
135 WMI_SERVICE_ESTIMATE_LINKSPEED,
136 WMI_SERVICE_OBSS_SCAN,
137 WMI_SERVICE_TDLS_OFFCHAN,
138 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
139 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
140 WMI_SERVICE_IBSS_PWRSAVE,
141 WMI_SERVICE_LPASS,
142 WMI_SERVICE_EXTSCAN,
143 WMI_SERVICE_D0WOW,
144 WMI_SERVICE_HSOFFLOAD,
145 WMI_SERVICE_ROAM_HO_OFFLOAD,
146 WMI_SERVICE_RX_FULL_REORDER,
147 WMI_SERVICE_DHCP_OFFLOAD,
148 WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
149 WMI_SERVICE_MDNS_OFFLOAD,
150 WMI_SERVICE_SAP_AUTH_OFFLOAD,
Yanbo Li52c22a62015-04-15 15:28:07 +0300151 WMI_SERVICE_ATF,
Michal Kaziorc4f8c832014-09-04 10:18:32 +0200152
153 /* keep last */
154 WMI_SERVICE_MAX,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300155};
Kalle Valo5e3dd152013-06-12 20:52:10 +0300156
Michal Kaziorcff990c2014-08-04 09:18:33 +0300157enum wmi_10x_service {
158 WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
159 WMI_10X_SERVICE_SCAN_OFFLOAD,
160 WMI_10X_SERVICE_ROAM_OFFLOAD,
161 WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
162 WMI_10X_SERVICE_STA_PWRSAVE,
163 WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
164 WMI_10X_SERVICE_AP_UAPSD,
165 WMI_10X_SERVICE_AP_DFS,
166 WMI_10X_SERVICE_11AC,
167 WMI_10X_SERVICE_BLOCKACK,
168 WMI_10X_SERVICE_PHYERR,
169 WMI_10X_SERVICE_BCN_FILTER,
170 WMI_10X_SERVICE_RTT,
171 WMI_10X_SERVICE_RATECTRL,
172 WMI_10X_SERVICE_WOW,
173 WMI_10X_SERVICE_RATECTRL_CACHE,
174 WMI_10X_SERVICE_IRAM_TIDS,
175 WMI_10X_SERVICE_BURST,
176
177 /* introduced in 10.2 */
178 WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
179 WMI_10X_SERVICE_FORCE_FW_HANG,
180 WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Yanbo Li52c22a62015-04-15 15:28:07 +0300181 WMI_10X_SERVICE_ATF,
Michal Kaziorcff990c2014-08-04 09:18:33 +0300182};
183
184enum wmi_main_service {
185 WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
186 WMI_MAIN_SERVICE_SCAN_OFFLOAD,
187 WMI_MAIN_SERVICE_ROAM_OFFLOAD,
188 WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
189 WMI_MAIN_SERVICE_STA_PWRSAVE,
190 WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
191 WMI_MAIN_SERVICE_AP_UAPSD,
192 WMI_MAIN_SERVICE_AP_DFS,
193 WMI_MAIN_SERVICE_11AC,
194 WMI_MAIN_SERVICE_BLOCKACK,
195 WMI_MAIN_SERVICE_PHYERR,
196 WMI_MAIN_SERVICE_BCN_FILTER,
197 WMI_MAIN_SERVICE_RTT,
198 WMI_MAIN_SERVICE_RATECTRL,
199 WMI_MAIN_SERVICE_WOW,
200 WMI_MAIN_SERVICE_RATECTRL_CACHE,
201 WMI_MAIN_SERVICE_IRAM_TIDS,
202 WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
203 WMI_MAIN_SERVICE_NLO,
204 WMI_MAIN_SERVICE_GTK_OFFLOAD,
205 WMI_MAIN_SERVICE_SCAN_SCH,
206 WMI_MAIN_SERVICE_CSA_OFFLOAD,
207 WMI_MAIN_SERVICE_CHATTER,
208 WMI_MAIN_SERVICE_COEX_FREQAVOID,
209 WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
210 WMI_MAIN_SERVICE_FORCE_FW_HANG,
211 WMI_MAIN_SERVICE_GPIO,
212 WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
213 WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
214 WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
215 WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
216 WMI_MAIN_SERVICE_TX_ENCAP,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300217};
218
219static inline char *wmi_service_name(int service_id)
220{
Michal Kaziorcff990c2014-08-04 09:18:33 +0300221#define SVCSTR(x) case x: return #x
222
Kalle Valo5e3dd152013-06-12 20:52:10 +0300223 switch (service_id) {
Michal Kaziorcff990c2014-08-04 09:18:33 +0300224 SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
225 SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
226 SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
227 SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
228 SVCSTR(WMI_SERVICE_STA_PWRSAVE);
229 SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
230 SVCSTR(WMI_SERVICE_AP_UAPSD);
231 SVCSTR(WMI_SERVICE_AP_DFS);
232 SVCSTR(WMI_SERVICE_11AC);
233 SVCSTR(WMI_SERVICE_BLOCKACK);
234 SVCSTR(WMI_SERVICE_PHYERR);
235 SVCSTR(WMI_SERVICE_BCN_FILTER);
236 SVCSTR(WMI_SERVICE_RTT);
237 SVCSTR(WMI_SERVICE_RATECTRL);
238 SVCSTR(WMI_SERVICE_WOW);
239 SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
240 SVCSTR(WMI_SERVICE_IRAM_TIDS);
241 SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
242 SVCSTR(WMI_SERVICE_NLO);
243 SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
244 SVCSTR(WMI_SERVICE_SCAN_SCH);
245 SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
246 SVCSTR(WMI_SERVICE_CHATTER);
247 SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
248 SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
249 SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
250 SVCSTR(WMI_SERVICE_GPIO);
251 SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
252 SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
253 SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
254 SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
255 SVCSTR(WMI_SERVICE_TX_ENCAP);
256 SVCSTR(WMI_SERVICE_BURST);
257 SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
258 SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
Michal Kaziorca996ec2014-12-03 10:11:32 +0200259 SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
260 SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
261 SVCSTR(WMI_SERVICE_EARLY_RX);
262 SVCSTR(WMI_SERVICE_STA_SMPS);
263 SVCSTR(WMI_SERVICE_FWTEST);
264 SVCSTR(WMI_SERVICE_STA_WMMAC);
265 SVCSTR(WMI_SERVICE_TDLS);
266 SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
267 SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
268 SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
269 SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
270 SVCSTR(WMI_SERVICE_WLAN_HB);
271 SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
272 SVCSTR(WMI_SERVICE_BATCH_SCAN);
273 SVCSTR(WMI_SERVICE_QPOWER);
274 SVCSTR(WMI_SERVICE_PLMREQ);
275 SVCSTR(WMI_SERVICE_THERMAL_MGMT);
276 SVCSTR(WMI_SERVICE_RMC);
277 SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
278 SVCSTR(WMI_SERVICE_COEX_SAR);
279 SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
280 SVCSTR(WMI_SERVICE_NAN);
281 SVCSTR(WMI_SERVICE_L1SS_STAT);
282 SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
283 SVCSTR(WMI_SERVICE_OBSS_SCAN);
284 SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
285 SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
286 SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
287 SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
288 SVCSTR(WMI_SERVICE_LPASS);
289 SVCSTR(WMI_SERVICE_EXTSCAN);
290 SVCSTR(WMI_SERVICE_D0WOW);
291 SVCSTR(WMI_SERVICE_HSOFFLOAD);
292 SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
293 SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
294 SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
295 SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
296 SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
297 SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
Yanbo Li52c22a62015-04-15 15:28:07 +0300298 SVCSTR(WMI_SERVICE_ATF);
Kalle Valo5e3dd152013-06-12 20:52:10 +0300299 default:
Michal Kaziorcff990c2014-08-04 09:18:33 +0300300 return NULL;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300301 }
Michal Kaziorcff990c2014-08-04 09:18:33 +0300302
303#undef SVCSTR
Kalle Valo5e3dd152013-06-12 20:52:10 +0300304}
305
Michal Kazior37b9f932014-11-27 10:11:16 +0100306#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
307 ((svc_id) < (len) && \
308 __le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300309 BIT((svc_id)%(sizeof(u32))))
310
Michal Kazior37b9f932014-11-27 10:11:16 +0100311#define SVCMAP(x, y, len) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300312 do { \
Michal Kazior37b9f932014-11-27 10:11:16 +0100313 if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
Michal Kaziorcff990c2014-08-04 09:18:33 +0300314 __set_bit(y, out); \
315 } while (0)
316
Michal Kazior37b9f932014-11-27 10:11:16 +0100317static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
318 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300319{
320 SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100321 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300322 SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100323 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300324 SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100325 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300326 SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100327 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300328 SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100329 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300330 SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100331 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300332 SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100333 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300334 SVCMAP(WMI_10X_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100335 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300336 SVCMAP(WMI_10X_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100337 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300338 SVCMAP(WMI_10X_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100339 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300340 SVCMAP(WMI_10X_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100341 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300342 SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100343 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300344 SVCMAP(WMI_10X_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100345 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300346 SVCMAP(WMI_10X_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100347 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300348 SVCMAP(WMI_10X_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100349 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300350 SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100351 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300352 SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100353 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300354 SVCMAP(WMI_10X_SERVICE_BURST,
Michal Kazior37b9f932014-11-27 10:11:16 +0100355 WMI_SERVICE_BURST, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300356 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100357 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300358 SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100359 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300360 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100361 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
Yanbo Li52c22a62015-04-15 15:28:07 +0300362 SVCMAP(WMI_10X_SERVICE_ATF,
363 WMI_SERVICE_ATF, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300364}
365
Michal Kazior37b9f932014-11-27 10:11:16 +0100366static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
367 size_t len)
Michal Kaziorcff990c2014-08-04 09:18:33 +0300368{
369 SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100370 WMI_SERVICE_BEACON_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300371 SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100372 WMI_SERVICE_SCAN_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300373 SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100374 WMI_SERVICE_ROAM_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300375 SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100376 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300377 SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100378 WMI_SERVICE_STA_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300379 SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100380 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300381 SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100382 WMI_SERVICE_AP_UAPSD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300383 SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100384 WMI_SERVICE_AP_DFS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300385 SVCMAP(WMI_MAIN_SERVICE_11AC,
Michal Kazior37b9f932014-11-27 10:11:16 +0100386 WMI_SERVICE_11AC, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300387 SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
Michal Kazior37b9f932014-11-27 10:11:16 +0100388 WMI_SERVICE_BLOCKACK, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300389 SVCMAP(WMI_MAIN_SERVICE_PHYERR,
Michal Kazior37b9f932014-11-27 10:11:16 +0100390 WMI_SERVICE_PHYERR, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300391 SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100392 WMI_SERVICE_BCN_FILTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300393 SVCMAP(WMI_MAIN_SERVICE_RTT,
Michal Kazior37b9f932014-11-27 10:11:16 +0100394 WMI_SERVICE_RTT, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300395 SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
Michal Kazior37b9f932014-11-27 10:11:16 +0100396 WMI_SERVICE_RATECTRL, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300397 SVCMAP(WMI_MAIN_SERVICE_WOW,
Michal Kazior37b9f932014-11-27 10:11:16 +0100398 WMI_SERVICE_WOW, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300399 SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100400 WMI_SERVICE_RATECTRL_CACHE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300401 SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
Michal Kazior37b9f932014-11-27 10:11:16 +0100402 WMI_SERVICE_IRAM_TIDS, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300403 SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100404 WMI_SERVICE_ARPNS_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300405 SVCMAP(WMI_MAIN_SERVICE_NLO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100406 WMI_SERVICE_NLO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300407 SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100408 WMI_SERVICE_GTK_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300409 SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
Michal Kazior37b9f932014-11-27 10:11:16 +0100410 WMI_SERVICE_SCAN_SCH, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300411 SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
Michal Kazior37b9f932014-11-27 10:11:16 +0100412 WMI_SERVICE_CSA_OFFLOAD, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300413 SVCMAP(WMI_MAIN_SERVICE_CHATTER,
Michal Kazior37b9f932014-11-27 10:11:16 +0100414 WMI_SERVICE_CHATTER, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300415 SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
Michal Kazior37b9f932014-11-27 10:11:16 +0100416 WMI_SERVICE_COEX_FREQAVOID, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300417 SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100418 WMI_SERVICE_PACKET_POWER_SAVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300419 SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100420 WMI_SERVICE_FORCE_FW_HANG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300421 SVCMAP(WMI_MAIN_SERVICE_GPIO,
Michal Kazior37b9f932014-11-27 10:11:16 +0100422 WMI_SERVICE_GPIO, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300423 SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
Michal Kazior37b9f932014-11-27 10:11:16 +0100424 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300425 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100426 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300427 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
Michal Kazior37b9f932014-11-27 10:11:16 +0100428 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300429 SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
Michal Kazior37b9f932014-11-27 10:11:16 +0100430 WMI_SERVICE_STA_KEEP_ALIVE, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300431 SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
Michal Kazior37b9f932014-11-27 10:11:16 +0100432 WMI_SERVICE_TX_ENCAP, len);
Michal Kaziorcff990c2014-08-04 09:18:33 +0300433}
434
435#undef SVCMAP
Kalle Valo5e3dd152013-06-12 20:52:10 +0300436
Kalle Valo5e3dd152013-06-12 20:52:10 +0300437/* 2 word representation of MAC addr */
438struct wmi_mac_addr {
439 union {
440 u8 addr[6];
441 struct {
442 u32 word0;
443 u32 word1;
444 } __packed;
445 } __packed;
446} __packed;
447
Bartosz Markowskice428702013-09-26 17:47:05 +0200448struct wmi_cmd_map {
449 u32 init_cmdid;
450 u32 start_scan_cmdid;
451 u32 stop_scan_cmdid;
452 u32 scan_chan_list_cmdid;
453 u32 scan_sch_prio_tbl_cmdid;
454 u32 pdev_set_regdomain_cmdid;
455 u32 pdev_set_channel_cmdid;
456 u32 pdev_set_param_cmdid;
457 u32 pdev_pktlog_enable_cmdid;
458 u32 pdev_pktlog_disable_cmdid;
459 u32 pdev_set_wmm_params_cmdid;
460 u32 pdev_set_ht_cap_ie_cmdid;
461 u32 pdev_set_vht_cap_ie_cmdid;
462 u32 pdev_set_dscp_tid_map_cmdid;
463 u32 pdev_set_quiet_mode_cmdid;
464 u32 pdev_green_ap_ps_enable_cmdid;
465 u32 pdev_get_tpc_config_cmdid;
466 u32 pdev_set_base_macaddr_cmdid;
467 u32 vdev_create_cmdid;
468 u32 vdev_delete_cmdid;
469 u32 vdev_start_request_cmdid;
470 u32 vdev_restart_request_cmdid;
471 u32 vdev_up_cmdid;
472 u32 vdev_stop_cmdid;
473 u32 vdev_down_cmdid;
474 u32 vdev_set_param_cmdid;
475 u32 vdev_install_key_cmdid;
476 u32 peer_create_cmdid;
477 u32 peer_delete_cmdid;
478 u32 peer_flush_tids_cmdid;
479 u32 peer_set_param_cmdid;
480 u32 peer_assoc_cmdid;
481 u32 peer_add_wds_entry_cmdid;
482 u32 peer_remove_wds_entry_cmdid;
483 u32 peer_mcast_group_cmdid;
484 u32 bcn_tx_cmdid;
485 u32 pdev_send_bcn_cmdid;
486 u32 bcn_tmpl_cmdid;
487 u32 bcn_filter_rx_cmdid;
488 u32 prb_req_filter_rx_cmdid;
489 u32 mgmt_tx_cmdid;
490 u32 prb_tmpl_cmdid;
491 u32 addba_clear_resp_cmdid;
492 u32 addba_send_cmdid;
493 u32 addba_status_cmdid;
494 u32 delba_send_cmdid;
495 u32 addba_set_resp_cmdid;
496 u32 send_singleamsdu_cmdid;
497 u32 sta_powersave_mode_cmdid;
498 u32 sta_powersave_param_cmdid;
499 u32 sta_mimo_ps_mode_cmdid;
500 u32 pdev_dfs_enable_cmdid;
501 u32 pdev_dfs_disable_cmdid;
502 u32 roam_scan_mode;
503 u32 roam_scan_rssi_threshold;
504 u32 roam_scan_period;
505 u32 roam_scan_rssi_change_threshold;
506 u32 roam_ap_profile;
507 u32 ofl_scan_add_ap_profile;
508 u32 ofl_scan_remove_ap_profile;
509 u32 ofl_scan_period;
510 u32 p2p_dev_set_device_info;
511 u32 p2p_dev_set_discoverability;
512 u32 p2p_go_set_beacon_ie;
513 u32 p2p_go_set_probe_resp_ie;
514 u32 p2p_set_vendor_ie_data_cmdid;
515 u32 ap_ps_peer_param_cmdid;
516 u32 ap_ps_peer_uapsd_coex_cmdid;
517 u32 peer_rate_retry_sched_cmdid;
518 u32 wlan_profile_trigger_cmdid;
519 u32 wlan_profile_set_hist_intvl_cmdid;
520 u32 wlan_profile_get_profile_data_cmdid;
521 u32 wlan_profile_enable_profile_id_cmdid;
522 u32 wlan_profile_list_profile_id_cmdid;
523 u32 pdev_suspend_cmdid;
524 u32 pdev_resume_cmdid;
525 u32 add_bcn_filter_cmdid;
526 u32 rmv_bcn_filter_cmdid;
527 u32 wow_add_wake_pattern_cmdid;
528 u32 wow_del_wake_pattern_cmdid;
529 u32 wow_enable_disable_wake_event_cmdid;
530 u32 wow_enable_cmdid;
531 u32 wow_hostwakeup_from_sleep_cmdid;
532 u32 rtt_measreq_cmdid;
533 u32 rtt_tsf_cmdid;
534 u32 vdev_spectral_scan_configure_cmdid;
535 u32 vdev_spectral_scan_enable_cmdid;
536 u32 request_stats_cmdid;
537 u32 set_arp_ns_offload_cmdid;
538 u32 network_list_offload_config_cmdid;
539 u32 gtk_offload_cmdid;
540 u32 csa_offload_enable_cmdid;
541 u32 csa_offload_chanswitch_cmdid;
542 u32 chatter_set_mode_cmdid;
543 u32 peer_tid_addba_cmdid;
544 u32 peer_tid_delba_cmdid;
545 u32 sta_dtim_ps_method_cmdid;
546 u32 sta_uapsd_auto_trig_cmdid;
547 u32 sta_keepalive_cmd;
548 u32 echo_cmdid;
549 u32 pdev_utf_cmdid;
550 u32 dbglog_cfg_cmdid;
551 u32 pdev_qvit_cmdid;
552 u32 pdev_ftm_intg_cmdid;
553 u32 vdev_set_keepalive_cmdid;
554 u32 vdev_get_keepalive_cmdid;
555 u32 force_fw_hang_cmdid;
556 u32 gpio_config_cmdid;
557 u32 gpio_output_cmdid;
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +0200558 u32 pdev_get_temperature_cmdid;
Michal Kazior6d492fe2015-01-28 09:57:22 +0200559 u32 vdev_set_wmm_params_cmdid;
Marek Puzyniakad45c882015-03-30 09:51:53 +0300560 u32 tdls_set_state_cmdid;
561 u32 tdls_peer_update_cmdid;
Michal Kazior5b272e32015-03-31 10:26:22 +0000562 u32 adaptive_qcs_cmdid;
Bartosz Markowskice428702013-09-26 17:47:05 +0200563};
564
Kalle Valo5e3dd152013-06-12 20:52:10 +0300565/*
566 * wmi command groups.
567 */
568enum wmi_cmd_group {
569 /* 0 to 2 are reserved */
570 WMI_GRP_START = 0x3,
571 WMI_GRP_SCAN = WMI_GRP_START,
572 WMI_GRP_PDEV,
573 WMI_GRP_VDEV,
574 WMI_GRP_PEER,
575 WMI_GRP_MGMT,
576 WMI_GRP_BA_NEG,
577 WMI_GRP_STA_PS,
578 WMI_GRP_DFS,
579 WMI_GRP_ROAM,
580 WMI_GRP_OFL_SCAN,
581 WMI_GRP_P2P,
582 WMI_GRP_AP_PS,
583 WMI_GRP_RATE_CTRL,
584 WMI_GRP_PROFILE,
585 WMI_GRP_SUSPEND,
586 WMI_GRP_BCN_FILTER,
587 WMI_GRP_WOW,
588 WMI_GRP_RTT,
589 WMI_GRP_SPECTRAL,
590 WMI_GRP_STATS,
591 WMI_GRP_ARP_NS_OFL,
592 WMI_GRP_NLO_OFL,
593 WMI_GRP_GTK_OFL,
594 WMI_GRP_CSA_OFL,
595 WMI_GRP_CHATTER,
596 WMI_GRP_TID_ADDBA,
597 WMI_GRP_MISC,
598 WMI_GRP_GPIO,
599};
600
601#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
602#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
603
Bartosz Markowski34957b22013-10-15 09:55:31 +0200604#define WMI_CMD_UNSUPPORTED 0
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +0200605
606/* Command IDs and command events for MAIN FW. */
Kalle Valo5e3dd152013-06-12 20:52:10 +0300607enum wmi_cmd_id {
608 WMI_INIT_CMDID = 0x1,
609
610 /* Scan specific commands */
611 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
612 WMI_STOP_SCAN_CMDID,
613 WMI_SCAN_CHAN_LIST_CMDID,
614 WMI_SCAN_SCH_PRIO_TBL_CMDID,
615
616 /* PDEV (physical device) specific commands */
617 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
618 WMI_PDEV_SET_CHANNEL_CMDID,
619 WMI_PDEV_SET_PARAM_CMDID,
620 WMI_PDEV_PKTLOG_ENABLE_CMDID,
621 WMI_PDEV_PKTLOG_DISABLE_CMDID,
622 WMI_PDEV_SET_WMM_PARAMS_CMDID,
623 WMI_PDEV_SET_HT_CAP_IE_CMDID,
624 WMI_PDEV_SET_VHT_CAP_IE_CMDID,
625 WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
626 WMI_PDEV_SET_QUIET_MODE_CMDID,
627 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
628 WMI_PDEV_GET_TPC_CONFIG_CMDID,
629 WMI_PDEV_SET_BASE_MACADDR_CMDID,
630
631 /* VDEV (virtual device) specific commands */
632 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
633 WMI_VDEV_DELETE_CMDID,
634 WMI_VDEV_START_REQUEST_CMDID,
635 WMI_VDEV_RESTART_REQUEST_CMDID,
636 WMI_VDEV_UP_CMDID,
637 WMI_VDEV_STOP_CMDID,
638 WMI_VDEV_DOWN_CMDID,
639 WMI_VDEV_SET_PARAM_CMDID,
640 WMI_VDEV_INSTALL_KEY_CMDID,
641
642 /* peer specific commands */
643 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
644 WMI_PEER_DELETE_CMDID,
645 WMI_PEER_FLUSH_TIDS_CMDID,
646 WMI_PEER_SET_PARAM_CMDID,
647 WMI_PEER_ASSOC_CMDID,
648 WMI_PEER_ADD_WDS_ENTRY_CMDID,
649 WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
650 WMI_PEER_MCAST_GROUP_CMDID,
651
652 /* beacon/management specific commands */
653 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
654 WMI_PDEV_SEND_BCN_CMDID,
655 WMI_BCN_TMPL_CMDID,
656 WMI_BCN_FILTER_RX_CMDID,
657 WMI_PRB_REQ_FILTER_RX_CMDID,
658 WMI_MGMT_TX_CMDID,
659 WMI_PRB_TMPL_CMDID,
660
661 /* commands to directly control BA negotiation directly from host. */
662 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
663 WMI_ADDBA_SEND_CMDID,
664 WMI_ADDBA_STATUS_CMDID,
665 WMI_DELBA_SEND_CMDID,
666 WMI_ADDBA_SET_RESP_CMDID,
667 WMI_SEND_SINGLEAMSDU_CMDID,
668
669 /* Station power save specific config */
670 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
671 WMI_STA_POWERSAVE_PARAM_CMDID,
672 WMI_STA_MIMO_PS_MODE_CMDID,
673
674 /** DFS-specific commands */
675 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
676 WMI_PDEV_DFS_DISABLE_CMDID,
677
678 /* Roaming specific commands */
679 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
680 WMI_ROAM_SCAN_RSSI_THRESHOLD,
681 WMI_ROAM_SCAN_PERIOD,
682 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
683 WMI_ROAM_AP_PROFILE,
684
685 /* offload scan specific commands */
686 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
687 WMI_OFL_SCAN_REMOVE_AP_PROFILE,
688 WMI_OFL_SCAN_PERIOD,
689
690 /* P2P specific commands */
691 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
692 WMI_P2P_DEV_SET_DISCOVERABILITY,
693 WMI_P2P_GO_SET_BEACON_IE,
694 WMI_P2P_GO_SET_PROBE_RESP_IE,
695 WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
696
697 /* AP power save specific config */
698 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
699 WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
700
701 /* Rate-control specific commands */
702 WMI_PEER_RATE_RETRY_SCHED_CMDID =
703 WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
704
705 /* WLAN Profiling commands. */
706 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
707 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
708 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
709 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
710 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
711
712 /* Suspend resume command Ids */
713 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
714 WMI_PDEV_RESUME_CMDID,
715
716 /* Beacon filter commands */
717 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
718 WMI_RMV_BCN_FILTER_CMDID,
719
720 /* WOW Specific WMI commands*/
721 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
722 WMI_WOW_DEL_WAKE_PATTERN_CMDID,
723 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
724 WMI_WOW_ENABLE_CMDID,
725 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
726
727 /* RTT measurement related cmd */
728 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
729 WMI_RTT_TSF_CMDID,
730
731 /* spectral scan commands */
732 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
733 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
734
735 /* F/W stats */
736 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
737
738 /* ARP OFFLOAD REQUEST*/
739 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
740
741 /* NS offload confid*/
742 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
743
744 /* GTK offload Specific WMI commands*/
745 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
746
747 /* CSA offload Specific WMI commands*/
748 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
749 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
750
751 /* Chatter commands*/
752 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
753
754 /* addba specific commands */
755 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
756 WMI_PEER_TID_DELBA_CMDID,
757
758 /* set station mimo powersave method */
759 WMI_STA_DTIM_PS_METHOD_CMDID,
760 /* Configure the Station UAPSD AC Auto Trigger Parameters */
761 WMI_STA_UAPSD_AUTO_TRIG_CMDID,
762
763 /* STA Keep alive parameter configuration,
764 Requires WMI_SERVICE_STA_KEEP_ALIVE */
765 WMI_STA_KEEPALIVE_CMD,
766
767 /* misc command group */
768 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
769 WMI_PDEV_UTF_CMDID,
770 WMI_DBGLOG_CFG_CMDID,
771 WMI_PDEV_QVIT_CMDID,
772 WMI_PDEV_FTM_INTG_CMDID,
773 WMI_VDEV_SET_KEEPALIVE_CMDID,
774 WMI_VDEV_GET_KEEPALIVE_CMDID,
Michal Kazior9cfbce72013-07-16 09:54:36 +0200775 WMI_FORCE_FW_HANG_CMDID,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300776
777 /* GPIO Configuration */
778 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
779 WMI_GPIO_OUTPUT_CMDID,
780};
781
782enum wmi_event_id {
783 WMI_SERVICE_READY_EVENTID = 0x1,
784 WMI_READY_EVENTID,
785
786 /* Scan specific events */
787 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
788
789 /* PDEV specific events */
790 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
791 WMI_CHAN_INFO_EVENTID,
792 WMI_PHYERR_EVENTID,
793
794 /* VDEV specific events */
795 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
796 WMI_VDEV_STOPPED_EVENTID,
797 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
798
799 /* peer specific events */
800 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
801
802 /* beacon/mgmt specific events */
803 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
804 WMI_HOST_SWBA_EVENTID,
805 WMI_TBTTOFFSET_UPDATE_EVENTID,
806
807 /* ADDBA Related WMI Events*/
808 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
809 WMI_TX_ADDBA_COMPLETE_EVENTID,
810
811 /* Roam event to trigger roaming on host */
812 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
813 WMI_PROFILE_MATCH,
814
815 /* WoW */
816 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
817
818 /* RTT */
819 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
820 WMI_TSF_MEASUREMENT_REPORT_EVENTID,
821 WMI_RTT_ERROR_REPORT_EVENTID,
822
823 /* GTK offload */
824 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
825 WMI_GTK_REKEY_FAIL_EVENTID,
826
827 /* CSA IE received event */
828 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
829
830 /* Misc events */
831 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
832 WMI_PDEV_UTF_EVENTID,
833 WMI_DEBUG_MESG_EVENTID,
834 WMI_UPDATE_STATS_EVENTID,
835 WMI_DEBUG_PRINT_EVENTID,
836 WMI_DCS_INTERFERENCE_EVENTID,
837 WMI_PDEV_QVIT_EVENTID,
838 WMI_WLAN_PROFILE_DATA_EVENTID,
839 WMI_PDEV_FTM_INTG_EVENTID,
840 WMI_WLAN_FREQ_AVOID_EVENTID,
841 WMI_VDEV_GET_KEEPALIVE_EVENTID,
842
843 /* GPIO Event */
844 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
845};
846
Bartosz Markowskib7e3adf2013-09-26 17:47:06 +0200847/* Command IDs and command events for 10.X firmware */
848enum wmi_10x_cmd_id {
849 WMI_10X_START_CMDID = 0x9000,
850 WMI_10X_END_CMDID = 0x9FFF,
851
852 /* initialize the wlan sub system */
853 WMI_10X_INIT_CMDID,
854
855 /* Scan specific commands */
856
857 WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
858 WMI_10X_STOP_SCAN_CMDID,
859 WMI_10X_SCAN_CHAN_LIST_CMDID,
860 WMI_10X_ECHO_CMDID,
861
862 /* PDEV(physical device) specific commands */
863 WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
864 WMI_10X_PDEV_SET_CHANNEL_CMDID,
865 WMI_10X_PDEV_SET_PARAM_CMDID,
866 WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
867 WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
868 WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
869 WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
870 WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
871 WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
872 WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
873 WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
874 WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
875 WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
876
877 /* VDEV(virtual device) specific commands */
878 WMI_10X_VDEV_CREATE_CMDID,
879 WMI_10X_VDEV_DELETE_CMDID,
880 WMI_10X_VDEV_START_REQUEST_CMDID,
881 WMI_10X_VDEV_RESTART_REQUEST_CMDID,
882 WMI_10X_VDEV_UP_CMDID,
883 WMI_10X_VDEV_STOP_CMDID,
884 WMI_10X_VDEV_DOWN_CMDID,
885 WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
886 WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
887 WMI_10X_VDEV_SET_PARAM_CMDID,
888 WMI_10X_VDEV_INSTALL_KEY_CMDID,
889
890 /* peer specific commands */
891 WMI_10X_PEER_CREATE_CMDID,
892 WMI_10X_PEER_DELETE_CMDID,
893 WMI_10X_PEER_FLUSH_TIDS_CMDID,
894 WMI_10X_PEER_SET_PARAM_CMDID,
895 WMI_10X_PEER_ASSOC_CMDID,
896 WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
897 WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
898 WMI_10X_PEER_MCAST_GROUP_CMDID,
899
900 /* beacon/management specific commands */
901
902 WMI_10X_BCN_TX_CMDID,
903 WMI_10X_BCN_PRB_TMPL_CMDID,
904 WMI_10X_BCN_FILTER_RX_CMDID,
905 WMI_10X_PRB_REQ_FILTER_RX_CMDID,
906 WMI_10X_MGMT_TX_CMDID,
907
908 /* commands to directly control ba negotiation directly from host. */
909 WMI_10X_ADDBA_CLEAR_RESP_CMDID,
910 WMI_10X_ADDBA_SEND_CMDID,
911 WMI_10X_ADDBA_STATUS_CMDID,
912 WMI_10X_DELBA_SEND_CMDID,
913 WMI_10X_ADDBA_SET_RESP_CMDID,
914 WMI_10X_SEND_SINGLEAMSDU_CMDID,
915
916 /* Station power save specific config */
917 WMI_10X_STA_POWERSAVE_MODE_CMDID,
918 WMI_10X_STA_POWERSAVE_PARAM_CMDID,
919 WMI_10X_STA_MIMO_PS_MODE_CMDID,
920
921 /* set debug log config */
922 WMI_10X_DBGLOG_CFG_CMDID,
923
924 /* DFS-specific commands */
925 WMI_10X_PDEV_DFS_ENABLE_CMDID,
926 WMI_10X_PDEV_DFS_DISABLE_CMDID,
927
928 /* QVIT specific command id */
929 WMI_10X_PDEV_QVIT_CMDID,
930
931 /* Offload Scan and Roaming related commands */
932 WMI_10X_ROAM_SCAN_MODE,
933 WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
934 WMI_10X_ROAM_SCAN_PERIOD,
935 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
936 WMI_10X_ROAM_AP_PROFILE,
937 WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
938 WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
939 WMI_10X_OFL_SCAN_PERIOD,
940
941 /* P2P specific commands */
942 WMI_10X_P2P_DEV_SET_DEVICE_INFO,
943 WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
944 WMI_10X_P2P_GO_SET_BEACON_IE,
945 WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
946
947 /* AP power save specific config */
948 WMI_10X_AP_PS_PEER_PARAM_CMDID,
949 WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
950
951 /* Rate-control specific commands */
952 WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
953
954 /* WLAN Profiling commands. */
955 WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
956 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
957 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
958 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
959 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
960
961 /* Suspend resume command Ids */
962 WMI_10X_PDEV_SUSPEND_CMDID,
963 WMI_10X_PDEV_RESUME_CMDID,
964
965 /* Beacon filter commands */
966 WMI_10X_ADD_BCN_FILTER_CMDID,
967 WMI_10X_RMV_BCN_FILTER_CMDID,
968
969 /* WOW Specific WMI commands*/
970 WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
971 WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
972 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
973 WMI_10X_WOW_ENABLE_CMDID,
974 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
975
976 /* RTT measurement related cmd */
977 WMI_10X_RTT_MEASREQ_CMDID,
978 WMI_10X_RTT_TSF_CMDID,
979
980 /* transmit beacon by value */
981 WMI_10X_PDEV_SEND_BCN_CMDID,
982
983 /* F/W stats */
984 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
985 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
986 WMI_10X_REQUEST_STATS_CMDID,
987
988 /* GPIO Configuration */
989 WMI_10X_GPIO_CONFIG_CMDID,
990 WMI_10X_GPIO_OUTPUT_CMDID,
991
992 WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
993};
994
995enum wmi_10x_event_id {
996 WMI_10X_SERVICE_READY_EVENTID = 0x8000,
997 WMI_10X_READY_EVENTID,
998 WMI_10X_START_EVENTID = 0x9000,
999 WMI_10X_END_EVENTID = 0x9FFF,
1000
1001 /* Scan specific events */
1002 WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
1003 WMI_10X_ECHO_EVENTID,
1004 WMI_10X_DEBUG_MESG_EVENTID,
1005 WMI_10X_UPDATE_STATS_EVENTID,
1006
1007 /* Instantaneous RSSI event */
1008 WMI_10X_INST_RSSI_STATS_EVENTID,
1009
1010 /* VDEV specific events */
1011 WMI_10X_VDEV_START_RESP_EVENTID,
1012 WMI_10X_VDEV_STANDBY_REQ_EVENTID,
1013 WMI_10X_VDEV_RESUME_REQ_EVENTID,
1014 WMI_10X_VDEV_STOPPED_EVENTID,
1015
1016 /* peer specific events */
1017 WMI_10X_PEER_STA_KICKOUT_EVENTID,
1018
1019 /* beacon/mgmt specific events */
1020 WMI_10X_HOST_SWBA_EVENTID,
1021 WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
1022 WMI_10X_MGMT_RX_EVENTID,
1023
1024 /* Channel stats event */
1025 WMI_10X_CHAN_INFO_EVENTID,
1026
1027 /* PHY Error specific WMI event */
1028 WMI_10X_PHYERR_EVENTID,
1029
1030 /* Roam event to trigger roaming on host */
1031 WMI_10X_ROAM_EVENTID,
1032
1033 /* matching AP found from list of profiles */
1034 WMI_10X_PROFILE_MATCH,
1035
1036 /* debug print message used for tracing FW code while debugging */
1037 WMI_10X_DEBUG_PRINT_EVENTID,
1038 /* VI spoecific event */
1039 WMI_10X_PDEV_QVIT_EVENTID,
1040 /* FW code profile data in response to profile request */
1041 WMI_10X_WLAN_PROFILE_DATA_EVENTID,
1042
1043 /*RTT related event ID*/
1044 WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
1045 WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
1046 WMI_10X_RTT_ERROR_REPORT_EVENTID,
1047
1048 WMI_10X_WOW_WAKEUP_HOST_EVENTID,
1049 WMI_10X_DCS_INTERFERENCE_EVENTID,
1050
1051 /* TPC config for the current operating channel */
1052 WMI_10X_PDEV_TPC_CONFIG_EVENTID,
1053
1054 WMI_10X_GPIO_INPUT_EVENTID,
1055 WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
1056};
1057
Michal Kazior24c88f72014-07-25 13:32:17 +02001058enum wmi_10_2_cmd_id {
1059 WMI_10_2_START_CMDID = 0x9000,
1060 WMI_10_2_END_CMDID = 0x9FFF,
1061 WMI_10_2_INIT_CMDID,
1062 WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
1063 WMI_10_2_STOP_SCAN_CMDID,
1064 WMI_10_2_SCAN_CHAN_LIST_CMDID,
1065 WMI_10_2_ECHO_CMDID,
1066 WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
1067 WMI_10_2_PDEV_SET_CHANNEL_CMDID,
1068 WMI_10_2_PDEV_SET_PARAM_CMDID,
1069 WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
1070 WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
1071 WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
1072 WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
1073 WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
1074 WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
1075 WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
1076 WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
1077 WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
1078 WMI_10_2_VDEV_CREATE_CMDID,
1079 WMI_10_2_VDEV_DELETE_CMDID,
1080 WMI_10_2_VDEV_START_REQUEST_CMDID,
1081 WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
1082 WMI_10_2_VDEV_UP_CMDID,
1083 WMI_10_2_VDEV_STOP_CMDID,
1084 WMI_10_2_VDEV_DOWN_CMDID,
1085 WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
1086 WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
1087 WMI_10_2_VDEV_SET_PARAM_CMDID,
1088 WMI_10_2_VDEV_INSTALL_KEY_CMDID,
1089 WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
1090 WMI_10_2_PEER_CREATE_CMDID,
1091 WMI_10_2_PEER_DELETE_CMDID,
1092 WMI_10_2_PEER_FLUSH_TIDS_CMDID,
1093 WMI_10_2_PEER_SET_PARAM_CMDID,
1094 WMI_10_2_PEER_ASSOC_CMDID,
1095 WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
1096 WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
1097 WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
1098 WMI_10_2_PEER_MCAST_GROUP_CMDID,
1099 WMI_10_2_BCN_TX_CMDID,
1100 WMI_10_2_BCN_PRB_TMPL_CMDID,
1101 WMI_10_2_BCN_FILTER_RX_CMDID,
1102 WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
1103 WMI_10_2_MGMT_TX_CMDID,
1104 WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
1105 WMI_10_2_ADDBA_SEND_CMDID,
1106 WMI_10_2_ADDBA_STATUS_CMDID,
1107 WMI_10_2_DELBA_SEND_CMDID,
1108 WMI_10_2_ADDBA_SET_RESP_CMDID,
1109 WMI_10_2_SEND_SINGLEAMSDU_CMDID,
1110 WMI_10_2_STA_POWERSAVE_MODE_CMDID,
1111 WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
1112 WMI_10_2_STA_MIMO_PS_MODE_CMDID,
1113 WMI_10_2_DBGLOG_CFG_CMDID,
1114 WMI_10_2_PDEV_DFS_ENABLE_CMDID,
1115 WMI_10_2_PDEV_DFS_DISABLE_CMDID,
1116 WMI_10_2_PDEV_QVIT_CMDID,
1117 WMI_10_2_ROAM_SCAN_MODE,
1118 WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
1119 WMI_10_2_ROAM_SCAN_PERIOD,
1120 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
1121 WMI_10_2_ROAM_AP_PROFILE,
1122 WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
1123 WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
1124 WMI_10_2_OFL_SCAN_PERIOD,
1125 WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
1126 WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
1127 WMI_10_2_P2P_GO_SET_BEACON_IE,
1128 WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
1129 WMI_10_2_AP_PS_PEER_PARAM_CMDID,
1130 WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
1131 WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
1132 WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
1133 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
1134 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
1135 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
1136 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
1137 WMI_10_2_PDEV_SUSPEND_CMDID,
1138 WMI_10_2_PDEV_RESUME_CMDID,
1139 WMI_10_2_ADD_BCN_FILTER_CMDID,
1140 WMI_10_2_RMV_BCN_FILTER_CMDID,
1141 WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
1142 WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
1143 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
1144 WMI_10_2_WOW_ENABLE_CMDID,
1145 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
1146 WMI_10_2_RTT_MEASREQ_CMDID,
1147 WMI_10_2_RTT_TSF_CMDID,
1148 WMI_10_2_RTT_KEEPALIVE_CMDID,
1149 WMI_10_2_PDEV_SEND_BCN_CMDID,
1150 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
1151 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
1152 WMI_10_2_REQUEST_STATS_CMDID,
1153 WMI_10_2_GPIO_CONFIG_CMDID,
1154 WMI_10_2_GPIO_OUTPUT_CMDID,
1155 WMI_10_2_VDEV_RATEMASK_CMDID,
1156 WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
1157 WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
1158 WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
1159 WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
1160 WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
1161 WMI_10_2_FORCE_FW_HANG_CMDID,
1162 WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
1163 WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
1164 WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
1165 WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
1166 WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001167 WMI_10_2_PDEV_GET_INFO,
1168 WMI_10_2_VDEV_GET_INFO,
1169 WMI_10_2_VDEV_ATF_REQUEST_CMDID,
1170 WMI_10_2_PEER_ATF_REQUEST_CMDID,
1171 WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
Michal Kazior24c88f72014-07-25 13:32:17 +02001172 WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
1173};
1174
1175enum wmi_10_2_event_id {
1176 WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
1177 WMI_10_2_READY_EVENTID,
1178 WMI_10_2_DEBUG_MESG_EVENTID,
1179 WMI_10_2_START_EVENTID = 0x9000,
1180 WMI_10_2_END_EVENTID = 0x9FFF,
1181 WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
1182 WMI_10_2_ECHO_EVENTID,
1183 WMI_10_2_UPDATE_STATS_EVENTID,
1184 WMI_10_2_INST_RSSI_STATS_EVENTID,
1185 WMI_10_2_VDEV_START_RESP_EVENTID,
1186 WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
1187 WMI_10_2_VDEV_RESUME_REQ_EVENTID,
1188 WMI_10_2_VDEV_STOPPED_EVENTID,
1189 WMI_10_2_PEER_STA_KICKOUT_EVENTID,
1190 WMI_10_2_HOST_SWBA_EVENTID,
1191 WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
1192 WMI_10_2_MGMT_RX_EVENTID,
1193 WMI_10_2_CHAN_INFO_EVENTID,
1194 WMI_10_2_PHYERR_EVENTID,
1195 WMI_10_2_ROAM_EVENTID,
1196 WMI_10_2_PROFILE_MATCH,
1197 WMI_10_2_DEBUG_PRINT_EVENTID,
1198 WMI_10_2_PDEV_QVIT_EVENTID,
1199 WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
1200 WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
1201 WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
1202 WMI_10_2_RTT_ERROR_REPORT_EVENTID,
1203 WMI_10_2_RTT_KEEPALIVE_EVENTID,
1204 WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
1205 WMI_10_2_DCS_INTERFERENCE_EVENTID,
1206 WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
1207 WMI_10_2_GPIO_INPUT_EVENTID,
1208 WMI_10_2_PEER_RATECODE_LIST_EVENTID,
1209 WMI_10_2_GENERIC_BUFFER_EVENTID,
1210 WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
1211 WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
1212 WMI_10_2_WDS_PEER_EVENTID,
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02001213 WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
1214 WMI_10_2_PDEV_TEMPERATURE_EVENTID,
Michal Kazior24c88f72014-07-25 13:32:17 +02001215 WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
1216};
1217
Kalle Valo5e3dd152013-06-12 20:52:10 +03001218enum wmi_phy_mode {
1219 MODE_11A = 0, /* 11a Mode */
1220 MODE_11G = 1, /* 11b/g Mode */
1221 MODE_11B = 2, /* 11b Mode */
1222 MODE_11GONLY = 3, /* 11g only Mode */
1223 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
1224 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
1225 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
1226 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
1227 MODE_11AC_VHT20 = 8,
1228 MODE_11AC_VHT40 = 9,
1229 MODE_11AC_VHT80 = 10,
1230 /* MODE_11AC_VHT160 = 11, */
1231 MODE_11AC_VHT20_2G = 11,
1232 MODE_11AC_VHT40_2G = 12,
1233 MODE_11AC_VHT80_2G = 13,
1234 MODE_UNKNOWN = 14,
1235 MODE_MAX = 14
1236};
1237
Kalle Valo38a1d472013-09-08 17:56:14 +03001238static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
1239{
1240 switch (mode) {
1241 case MODE_11A:
1242 return "11a";
1243 case MODE_11G:
1244 return "11g";
1245 case MODE_11B:
1246 return "11b";
1247 case MODE_11GONLY:
1248 return "11gonly";
1249 case MODE_11NA_HT20:
1250 return "11na-ht20";
1251 case MODE_11NG_HT20:
1252 return "11ng-ht20";
1253 case MODE_11NA_HT40:
1254 return "11na-ht40";
1255 case MODE_11NG_HT40:
1256 return "11ng-ht40";
1257 case MODE_11AC_VHT20:
1258 return "11ac-vht20";
1259 case MODE_11AC_VHT40:
1260 return "11ac-vht40";
1261 case MODE_11AC_VHT80:
1262 return "11ac-vht80";
1263 case MODE_11AC_VHT20_2G:
1264 return "11ac-vht20-2g";
1265 case MODE_11AC_VHT40_2G:
1266 return "11ac-vht40-2g";
1267 case MODE_11AC_VHT80_2G:
1268 return "11ac-vht80-2g";
1269 case MODE_UNKNOWN:
1270 /* skip */
1271 break;
1272
1273 /* no default handler to allow compiler to check that the
1274 * enum is fully handled */
1275 };
1276
1277 return "<unknown>";
1278}
1279
Kalle Valo5e3dd152013-06-12 20:52:10 +03001280#define WMI_CHAN_LIST_TAG 0x1
1281#define WMI_SSID_LIST_TAG 0x2
1282#define WMI_BSSID_LIST_TAG 0x3
1283#define WMI_IE_TAG 0x4
1284
1285struct wmi_channel {
1286 __le32 mhz;
1287 __le32 band_center_freq1;
1288 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
1289 union {
1290 __le32 flags; /* WMI_CHAN_FLAG_ */
1291 struct {
1292 u8 mode; /* only 6 LSBs */
1293 } __packed;
1294 } __packed;
1295 union {
1296 __le32 reginfo0;
1297 struct {
Michal Kazior02256932013-10-23 04:02:14 -07001298 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001299 u8 min_power;
1300 u8 max_power;
1301 u8 reg_power;
1302 u8 reg_classid;
1303 } __packed;
1304 } __packed;
1305 union {
1306 __le32 reginfo1;
1307 struct {
1308 u8 antenna_max;
1309 } __packed;
1310 } __packed;
1311} __packed;
1312
1313struct wmi_channel_arg {
1314 u32 freq;
1315 u32 band_center_freq1;
1316 bool passive;
1317 bool allow_ibss;
1318 bool allow_ht;
1319 bool allow_vht;
1320 bool ht40plus;
Marek Puzyniake8a50f82013-11-20 09:59:47 +02001321 bool chan_radar;
Michal Kazior02256932013-10-23 04:02:14 -07001322 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001323 u32 min_power;
1324 u32 max_power;
1325 u32 max_reg_power;
1326 u32 max_antenna_gain;
1327 u32 reg_class_id;
1328 enum wmi_phy_mode mode;
1329};
1330
1331enum wmi_channel_change_cause {
1332 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
1333 WMI_CHANNEL_CHANGE_CAUSE_CSA,
1334};
1335
1336#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
1337#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
1338#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
1339#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
1340#define WMI_CHAN_FLAG_DFS (1 << 10)
1341#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
1342#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
1343
1344/* Indicate reason for channel switch */
1345#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
1346
1347#define WMI_MAX_SPATIAL_STREAM 3
1348
1349/* HT Capabilities*/
1350#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
1351#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
1352#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
1353#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
1354#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
1355#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
1356#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
1357#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
1358#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
1359#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
1360#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
1361#define WMI_HT_CAP_HT40_SGI 0x0800
1362
1363#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
1364 WMI_HT_CAP_HT20_SGI | \
1365 WMI_HT_CAP_HT40_SGI | \
1366 WMI_HT_CAP_TX_STBC | \
1367 WMI_HT_CAP_RX_STBC | \
1368 WMI_HT_CAP_LDPC)
1369
Kalle Valo5e3dd152013-06-12 20:52:10 +03001370/*
1371 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
1372 * field. The fields not defined here are not supported, or reserved.
1373 * Do not change these masks and if you have to add new one follow the
1374 * bitmask as specified by 802.11ac draft.
1375 */
1376
1377#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
1378#define WMI_VHT_CAP_RX_LDPC 0x00000010
1379#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
1380#define WMI_VHT_CAP_TX_STBC 0x00000080
1381#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
1382#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
1383#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
1384#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
1385#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
1386#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
1387
1388/* The following also refer for max HT AMSDU */
1389#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
1390#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
1391#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
1392
1393#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
1394 WMI_VHT_CAP_RX_LDPC | \
1395 WMI_VHT_CAP_SGI_80MHZ | \
1396 WMI_VHT_CAP_TX_STBC | \
1397 WMI_VHT_CAP_RX_STBC_MASK | \
1398 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
1399 WMI_VHT_CAP_RX_FIXED_ANT | \
1400 WMI_VHT_CAP_TX_FIXED_ANT)
1401
1402/*
1403 * Interested readers refer to Rx/Tx MCS Map definition as defined in
1404 * 802.11ac
1405 */
1406#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
1407#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
1408#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
1409
1410enum {
1411 REGDMN_MODE_11A = 0x00001, /* 11a channels */
1412 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
1413 REGDMN_MODE_11B = 0x00004, /* 11b channels */
1414 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
1415 REGDMN_MODE_11G = 0x00008, /* XXX historical */
1416 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
1417 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
1418 REGDMN_MODE_XR = 0x00100, /* XR channels */
1419 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
1420 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
1421 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
1422 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
1423 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
1424 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
1425 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
1426 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
1427 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
1428 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
1429 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
1430 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
1431 REGDMN_MODE_ALL = 0xffffffff
1432};
1433
1434#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
1435#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
1436#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
1437
1438/* regulatory capabilities */
1439#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
1440#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
1441#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
1442#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
1443#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
1444#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
1445
1446struct hal_reg_capabilities {
1447 /* regdomain value specified in EEPROM */
1448 __le32 eeprom_rd;
1449 /*regdomain */
1450 __le32 eeprom_rd_ext;
1451 /* CAP1 capabilities bit map. */
1452 __le32 regcap1;
1453 /* REGDMN EEPROM CAP. */
1454 __le32 regcap2;
1455 /* REGDMN MODE */
1456 __le32 wireless_modes;
1457 __le32 low_2ghz_chan;
1458 __le32 high_2ghz_chan;
1459 __le32 low_5ghz_chan;
1460 __le32 high_5ghz_chan;
1461} __packed;
1462
1463enum wlan_mode_capability {
1464 WHAL_WLAN_11A_CAPABILITY = 0x1,
1465 WHAL_WLAN_11G_CAPABILITY = 0x2,
1466 WHAL_WLAN_11AG_CAPABILITY = 0x3,
1467};
1468
1469/* structure used by FW for requesting host memory */
1470struct wlan_host_mem_req {
1471 /* ID of the request */
1472 __le32 req_id;
1473 /* size of the of each unit */
1474 __le32 unit_size;
1475 /* flags to indicate that
1476 * the number units is dependent
1477 * on number of resources(num vdevs num peers .. etc)
1478 */
1479 __le32 num_unit_info;
1480 /*
1481 * actual number of units to allocate . if flags in the num_unit_info
1482 * indicate that number of units is tied to number of a particular
1483 * resource to allocate then num_units filed is set to 0 and host
1484 * will derive the number units from number of the resources it is
1485 * requesting.
1486 */
1487 __le32 num_units;
1488} __packed;
1489
Kalle Valo5e3dd152013-06-12 20:52:10 +03001490/*
1491 * The following struct holds optional payload for
1492 * wmi_service_ready_event,e.g., 11ac pass some of the
1493 * device capability to the host.
1494 */
1495struct wmi_service_ready_event {
1496 __le32 sw_version;
1497 __le32 sw_version_1;
1498 __le32 abi_version;
1499 /* WMI_PHY_CAPABILITY */
1500 __le32 phy_capability;
1501 /* Maximum number of frag table entries that SW will populate less 1 */
1502 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001503 __le32 wmi_service_bitmap[16];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001504 __le32 num_rf_chains;
1505 /*
1506 * The following field is only valid for service type
1507 * WMI_SERVICE_11AC
1508 */
1509 __le32 ht_cap_info; /* WMI HT Capability */
1510 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1511 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1512 __le32 hw_min_tx_power;
1513 __le32 hw_max_tx_power;
1514 struct hal_reg_capabilities hal_reg_capabilities;
1515 __le32 sys_cap_info;
1516 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1517 /*
1518 * Max beacon and Probe Response IE offload size
1519 * (includes optional P2P IEs)
1520 */
1521 __le32 max_bcn_ie_size;
1522 /*
1523 * request to host to allocate a chuck of memory and pss it down to FW
1524 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1525 * data structures. Only valid for low latency interfaces like PCIE
1526 * where FW can access this memory directly (or) by DMA.
1527 */
1528 __le32 num_mem_reqs;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001529 struct wlan_host_mem_req mem_reqs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03001530} __packed;
1531
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001532/* This is the definition from 10.X firmware branch */
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001533struct wmi_10x_service_ready_event {
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001534 __le32 sw_version;
1535 __le32 abi_version;
1536
1537 /* WMI_PHY_CAPABILITY */
1538 __le32 phy_capability;
1539
1540 /* Maximum number of frag table entries that SW will populate less 1 */
1541 __le32 max_frag_entry;
Michal Kaziorc4f8c832014-09-04 10:18:32 +02001542 __le32 wmi_service_bitmap[16];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001543 __le32 num_rf_chains;
1544
1545 /*
1546 * The following field is only valid for service type
1547 * WMI_SERVICE_11AC
1548 */
1549 __le32 ht_cap_info; /* WMI HT Capability */
1550 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1551 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1552 __le32 hw_min_tx_power;
1553 __le32 hw_max_tx_power;
1554
1555 struct hal_reg_capabilities hal_reg_capabilities;
1556
1557 __le32 sys_cap_info;
1558 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1559
1560 /*
1561 * request to host to allocate a chuck of memory and pss it down to FW
1562 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1563 * data structures. Only valid for low latency interfaces like PCIE
1564 * where FW can access this memory directly (or) by DMA.
1565 */
1566 __le32 num_mem_reqs;
1567
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02001568 struct wlan_host_mem_req mem_reqs[0];
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001569} __packed;
1570
Kalle Valo5e3dd152013-06-12 20:52:10 +03001571#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
1572#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
1573
1574struct wmi_ready_event {
1575 __le32 sw_version;
1576 __le32 abi_version;
1577 struct wmi_mac_addr mac_addr;
1578 __le32 status;
1579} __packed;
1580
1581struct wmi_resource_config {
1582 /* number of virtual devices (VAPs) to support */
1583 __le32 num_vdevs;
1584
1585 /* number of peer nodes to support */
1586 __le32 num_peers;
1587
1588 /*
1589 * In offload mode target supports features like WOW, chatter and
1590 * other protocol offloads. In order to support them some
1591 * functionalities like reorder buffering, PN checking need to be
1592 * done in target. This determines maximum number of peers suported
1593 * by target in offload mode
1594 */
1595 __le32 num_offload_peers;
1596
1597 /* For target-based RX reordering */
1598 __le32 num_offload_reorder_bufs;
1599
1600 /* number of keys per peer */
1601 __le32 num_peer_keys;
1602
1603 /* total number of TX/RX data TIDs */
1604 __le32 num_tids;
1605
1606 /*
1607 * max skid for resolving hash collisions
1608 *
1609 * The address search table is sparse, so that if two MAC addresses
1610 * result in the same hash value, the second of these conflicting
1611 * entries can slide to the next index in the address search table,
1612 * and use it, if it is unoccupied. This ast_skid_limit parameter
1613 * specifies the upper bound on how many subsequent indices to search
1614 * over to find an unoccupied space.
1615 */
1616 __le32 ast_skid_limit;
1617
1618 /*
1619 * the nominal chain mask for transmit
1620 *
1621 * The chain mask may be modified dynamically, e.g. to operate AP
1622 * tx with a reduced number of chains if no clients are associated.
1623 * This configuration parameter specifies the nominal chain-mask that
1624 * should be used when not operating with a reduced set of tx chains.
1625 */
1626 __le32 tx_chain_mask;
1627
1628 /*
1629 * the nominal chain mask for receive
1630 *
1631 * The chain mask may be modified dynamically, e.g. for a client
1632 * to use a reduced number of chains for receive if the traffic to
1633 * the client is low enough that it doesn't require downlink MIMO
1634 * or antenna diversity.
1635 * This configuration parameter specifies the nominal chain-mask that
1636 * should be used when not operating with a reduced set of rx chains.
1637 */
1638 __le32 rx_chain_mask;
1639
1640 /*
1641 * what rx reorder timeout (ms) to use for the AC
1642 *
1643 * Each WMM access class (voice, video, best-effort, background) will
1644 * have its own timeout value to dictate how long to wait for missing
1645 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1646 * already been received.
1647 * This parameter specifies the timeout in milliseconds for each
1648 * class.
1649 */
1650 __le32 rx_timeout_pri_vi;
1651 __le32 rx_timeout_pri_vo;
1652 __le32 rx_timeout_pri_be;
1653 __le32 rx_timeout_pri_bk;
1654
1655 /*
1656 * what mode the rx should decap packets to
1657 *
1658 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1659 * THis setting also determines the default TX behavior, however TX
1660 * behavior can be modified on a per VAP basis during VAP init
1661 */
1662 __le32 rx_decap_mode;
1663
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01001664 /* what is the maximum number of scan requests that can be queued */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001665 __le32 scan_max_pending_reqs;
1666
1667 /* maximum VDEV that could use BMISS offload */
1668 __le32 bmiss_offload_max_vdev;
1669
1670 /* maximum VDEV that could use offload roaming */
1671 __le32 roam_offload_max_vdev;
1672
1673 /* maximum AP profiles that would push to offload roaming */
1674 __le32 roam_offload_max_ap_profiles;
1675
1676 /*
1677 * how many groups to use for mcast->ucast conversion
1678 *
1679 * The target's WAL maintains a table to hold information regarding
1680 * which peers belong to a given multicast group, so that if
1681 * multicast->unicast conversion is enabled, the target can convert
1682 * multicast tx frames to a series of unicast tx frames, to each
1683 * peer within the multicast group.
1684 This num_mcast_groups configuration parameter tells the target how
1685 * many multicast groups to provide storage for within its multicast
1686 * group membership table.
1687 */
1688 __le32 num_mcast_groups;
1689
1690 /*
1691 * size to alloc for the mcast membership table
1692 *
1693 * This num_mcast_table_elems configuration parameter tells the
1694 * target how many peer elements it needs to provide storage for in
1695 * its multicast group membership table.
1696 * These multicast group membership table elements are shared by the
1697 * multicast groups stored within the table.
1698 */
1699 __le32 num_mcast_table_elems;
1700
1701 /*
1702 * whether/how to do multicast->unicast conversion
1703 *
1704 * This configuration parameter specifies whether the target should
1705 * perform multicast --> unicast conversion on transmit, and if so,
1706 * what to do if it finds no entries in its multicast group
1707 * membership table for the multicast IP address in the tx frame.
1708 * Configuration value:
1709 * 0 -> Do not perform multicast to unicast conversion.
1710 * 1 -> Convert multicast frames to unicast, if the IP multicast
1711 * address from the tx frame is found in the multicast group
1712 * membership table. If the IP multicast address is not found,
1713 * drop the frame.
1714 * 2 -> Convert multicast frames to unicast, if the IP multicast
1715 * address from the tx frame is found in the multicast group
1716 * membership table. If the IP multicast address is not found,
1717 * transmit the frame as multicast.
1718 */
1719 __le32 mcast2ucast_mode;
1720
1721 /*
1722 * how much memory to allocate for a tx PPDU dbg log
1723 *
1724 * This parameter controls how much memory the target will allocate
1725 * to store a log of tx PPDU meta-information (how large the PPDU
1726 * was, when it was sent, whether it was successful, etc.)
1727 */
1728 __le32 tx_dbg_log_size;
1729
1730 /* how many AST entries to be allocated for WDS */
1731 __le32 num_wds_entries;
1732
1733 /*
1734 * MAC DMA burst size, e.g., For target PCI limit can be
1735 * 0 -default, 1 256B
1736 */
1737 __le32 dma_burst_size;
1738
1739 /*
1740 * Fixed delimiters to be inserted after every MPDU to
1741 * account for interface latency to avoid underrun.
1742 */
1743 __le32 mac_aggr_delim;
1744
1745 /*
1746 * determine whether target is responsible for detecting duplicate
1747 * non-aggregate MPDU and timing out stale fragments.
1748 *
1749 * A-MPDU reordering is always performed on the target.
1750 *
1751 * 0: target responsible for frag timeout and dup checking
1752 * 1: host responsible for frag timeout and dup checking
1753 */
1754 __le32 rx_skip_defrag_timeout_dup_detection_check;
1755
1756 /*
1757 * Configuration for VoW :
1758 * No of Video Nodes to be supported
1759 * and Max no of descriptors for each Video link (node).
1760 */
1761 __le32 vow_config;
1762
1763 /* maximum VDEV that could use GTK offload */
1764 __le32 gtk_offload_max_vdev;
1765
1766 /* Number of msdu descriptors target should use */
1767 __le32 num_msdu_desc;
1768
1769 /*
1770 * Max. number of Tx fragments per MSDU
1771 * This parameter controls the max number of Tx fragments per MSDU.
1772 * This is sent by the target as part of the WMI_SERVICE_READY event
1773 * and is overriden by the OS shim as required.
1774 */
1775 __le32 max_frag_entries;
1776} __packed;
1777
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02001778struct wmi_resource_config_10x {
1779 /* number of virtual devices (VAPs) to support */
1780 __le32 num_vdevs;
1781
1782 /* number of peer nodes to support */
1783 __le32 num_peers;
1784
1785 /* number of keys per peer */
1786 __le32 num_peer_keys;
1787
1788 /* total number of TX/RX data TIDs */
1789 __le32 num_tids;
1790
1791 /*
1792 * max skid for resolving hash collisions
1793 *
1794 * The address search table is sparse, so that if two MAC addresses
1795 * result in the same hash value, the second of these conflicting
1796 * entries can slide to the next index in the address search table,
1797 * and use it, if it is unoccupied. This ast_skid_limit parameter
1798 * specifies the upper bound on how many subsequent indices to search
1799 * over to find an unoccupied space.
1800 */
1801 __le32 ast_skid_limit;
1802
1803 /*
1804 * the nominal chain mask for transmit
1805 *
1806 * The chain mask may be modified dynamically, e.g. to operate AP
1807 * tx with a reduced number of chains if no clients are associated.
1808 * This configuration parameter specifies the nominal chain-mask that
1809 * should be used when not operating with a reduced set of tx chains.
1810 */
1811 __le32 tx_chain_mask;
1812
1813 /*
1814 * the nominal chain mask for receive
1815 *
1816 * The chain mask may be modified dynamically, e.g. for a client
1817 * to use a reduced number of chains for receive if the traffic to
1818 * the client is low enough that it doesn't require downlink MIMO
1819 * or antenna diversity.
1820 * This configuration parameter specifies the nominal chain-mask that
1821 * should be used when not operating with a reduced set of rx chains.
1822 */
1823 __le32 rx_chain_mask;
1824
1825 /*
1826 * what rx reorder timeout (ms) to use for the AC
1827 *
1828 * Each WMM access class (voice, video, best-effort, background) will
1829 * have its own timeout value to dictate how long to wait for missing
1830 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1831 * already been received.
1832 * This parameter specifies the timeout in milliseconds for each
1833 * class.
1834 */
1835 __le32 rx_timeout_pri_vi;
1836 __le32 rx_timeout_pri_vo;
1837 __le32 rx_timeout_pri_be;
1838 __le32 rx_timeout_pri_bk;
1839
1840 /*
1841 * what mode the rx should decap packets to
1842 *
1843 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1844 * THis setting also determines the default TX behavior, however TX
1845 * behavior can be modified on a per VAP basis during VAP init
1846 */
1847 __le32 rx_decap_mode;
1848
Geert Uytterhoeven8e4a4f52014-03-11 11:23:45 +01001849 /* what is the maximum number of scan requests that can be queued */
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02001850 __le32 scan_max_pending_reqs;
1851
1852 /* maximum VDEV that could use BMISS offload */
1853 __le32 bmiss_offload_max_vdev;
1854
1855 /* maximum VDEV that could use offload roaming */
1856 __le32 roam_offload_max_vdev;
1857
1858 /* maximum AP profiles that would push to offload roaming */
1859 __le32 roam_offload_max_ap_profiles;
1860
1861 /*
1862 * how many groups to use for mcast->ucast conversion
1863 *
1864 * The target's WAL maintains a table to hold information regarding
1865 * which peers belong to a given multicast group, so that if
1866 * multicast->unicast conversion is enabled, the target can convert
1867 * multicast tx frames to a series of unicast tx frames, to each
1868 * peer within the multicast group.
1869 This num_mcast_groups configuration parameter tells the target how
1870 * many multicast groups to provide storage for within its multicast
1871 * group membership table.
1872 */
1873 __le32 num_mcast_groups;
1874
1875 /*
1876 * size to alloc for the mcast membership table
1877 *
1878 * This num_mcast_table_elems configuration parameter tells the
1879 * target how many peer elements it needs to provide storage for in
1880 * its multicast group membership table.
1881 * These multicast group membership table elements are shared by the
1882 * multicast groups stored within the table.
1883 */
1884 __le32 num_mcast_table_elems;
1885
1886 /*
1887 * whether/how to do multicast->unicast conversion
1888 *
1889 * This configuration parameter specifies whether the target should
1890 * perform multicast --> unicast conversion on transmit, and if so,
1891 * what to do if it finds no entries in its multicast group
1892 * membership table for the multicast IP address in the tx frame.
1893 * Configuration value:
1894 * 0 -> Do not perform multicast to unicast conversion.
1895 * 1 -> Convert multicast frames to unicast, if the IP multicast
1896 * address from the tx frame is found in the multicast group
1897 * membership table. If the IP multicast address is not found,
1898 * drop the frame.
1899 * 2 -> Convert multicast frames to unicast, if the IP multicast
1900 * address from the tx frame is found in the multicast group
1901 * membership table. If the IP multicast address is not found,
1902 * transmit the frame as multicast.
1903 */
1904 __le32 mcast2ucast_mode;
1905
1906 /*
1907 * how much memory to allocate for a tx PPDU dbg log
1908 *
1909 * This parameter controls how much memory the target will allocate
1910 * to store a log of tx PPDU meta-information (how large the PPDU
1911 * was, when it was sent, whether it was successful, etc.)
1912 */
1913 __le32 tx_dbg_log_size;
1914
1915 /* how many AST entries to be allocated for WDS */
1916 __le32 num_wds_entries;
1917
1918 /*
1919 * MAC DMA burst size, e.g., For target PCI limit can be
1920 * 0 -default, 1 256B
1921 */
1922 __le32 dma_burst_size;
1923
1924 /*
1925 * Fixed delimiters to be inserted after every MPDU to
1926 * account for interface latency to avoid underrun.
1927 */
1928 __le32 mac_aggr_delim;
1929
1930 /*
1931 * determine whether target is responsible for detecting duplicate
1932 * non-aggregate MPDU and timing out stale fragments.
1933 *
1934 * A-MPDU reordering is always performed on the target.
1935 *
1936 * 0: target responsible for frag timeout and dup checking
1937 * 1: host responsible for frag timeout and dup checking
1938 */
1939 __le32 rx_skip_defrag_timeout_dup_detection_check;
1940
1941 /*
1942 * Configuration for VoW :
1943 * No of Video Nodes to be supported
1944 * and Max no of descriptors for each Video link (node).
1945 */
1946 __le32 vow_config;
1947
1948 /* Number of msdu descriptors target should use */
1949 __le32 num_msdu_desc;
1950
1951 /*
1952 * Max. number of Tx fragments per MSDU
1953 * This parameter controls the max number of Tx fragments per MSDU.
1954 * This is sent by the target as part of the WMI_SERVICE_READY event
1955 * and is overriden by the OS shim as required.
1956 */
1957 __le32 max_frag_entries;
1958} __packed;
1959
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02001960enum wmi_10_2_feature_mask {
1961 WMI_10_2_RX_BATCH_MODE = BIT(0),
1962 WMI_10_2_ATF_CONFIG = BIT(1),
1963};
1964
Michal Kazior24c88f72014-07-25 13:32:17 +02001965struct wmi_resource_config_10_2 {
1966 struct wmi_resource_config_10x common;
1967 __le32 max_peer_ext_stats;
1968 __le32 smart_ant_cap; /* 0-disable, 1-enable */
1969 __le32 bk_min_free;
1970 __le32 be_min_free;
1971 __le32 vi_min_free;
1972 __le32 vo_min_free;
Rajkumar Manoharan4a16fbe2014-12-17 12:21:12 +02001973 __le32 feature_mask;
Michal Kazior24c88f72014-07-25 13:32:17 +02001974} __packed;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02001975
Bartosz Markowskib3effe62013-09-26 17:47:11 +02001976#define NUM_UNITS_IS_NUM_VDEVS 0x1
1977#define NUM_UNITS_IS_NUM_PEERS 0x2
1978
Kalle Valo5e3dd152013-06-12 20:52:10 +03001979/* strucutre describing host memory chunk. */
1980struct host_memory_chunk {
1981 /* id of the request that is passed up in service ready */
1982 __le32 req_id;
1983 /* the physical address the memory chunk */
1984 __le32 ptr;
1985 /* size of the chunk */
1986 __le32 size;
1987} __packed;
1988
Michal Kaziorcf9fca82014-09-18 15:21:22 +02001989struct wmi_host_mem_chunks {
1990 __le32 count;
1991 /* some fw revisions require at least 1 chunk regardless of count */
1992 struct host_memory_chunk items[1];
1993} __packed;
1994
Kalle Valo5e3dd152013-06-12 20:52:10 +03001995struct wmi_init_cmd {
1996 struct wmi_resource_config resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02001997 struct wmi_host_mem_chunks mem_chunks;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001998} __packed;
1999
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002000/* _10x stucture is from 10.X FW API */
2001struct wmi_init_cmd_10x {
2002 struct wmi_resource_config_10x resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002003 struct wmi_host_mem_chunks mem_chunks;
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02002004} __packed;
2005
Michal Kazior24c88f72014-07-25 13:32:17 +02002006struct wmi_init_cmd_10_2 {
2007 struct wmi_resource_config_10_2 resource_config;
Michal Kaziorcf9fca82014-09-18 15:21:22 +02002008 struct wmi_host_mem_chunks mem_chunks;
Michal Kazior24c88f72014-07-25 13:32:17 +02002009} __packed;
2010
2011struct wmi_chan_list_entry {
2012 __le16 freq;
2013 u8 phy_mode; /* valid for 10.2 only */
2014 u8 reserved;
2015} __packed;
2016
Kalle Valo5e3dd152013-06-12 20:52:10 +03002017/* TLV for channel list */
2018struct wmi_chan_list {
2019 __le32 tag; /* WMI_CHAN_LIST_TAG */
2020 __le32 num_chan;
Michal Kazior24c88f72014-07-25 13:32:17 +02002021 struct wmi_chan_list_entry channel_list[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002022} __packed;
2023
2024struct wmi_bssid_list {
2025 __le32 tag; /* WMI_BSSID_LIST_TAG */
2026 __le32 num_bssid;
2027 struct wmi_mac_addr bssid_list[0];
2028} __packed;
2029
2030struct wmi_ie_data {
2031 __le32 tag; /* WMI_IE_TAG */
2032 __le32 ie_len;
2033 u8 ie_data[0];
2034} __packed;
2035
2036struct wmi_ssid {
2037 __le32 ssid_len;
2038 u8 ssid[32];
2039} __packed;
2040
2041struct wmi_ssid_list {
2042 __le32 tag; /* WMI_SSID_LIST_TAG */
2043 __le32 num_ssids;
2044 struct wmi_ssid ssids[0];
2045} __packed;
2046
2047/* prefix used by scan requestor ids on the host */
2048#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
2049
2050/* prefix used by scan request ids generated on the host */
2051/* host cycles through the lower 12 bits to generate ids */
2052#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
2053
2054#define WLAN_SCAN_PARAMS_MAX_SSID 16
2055#define WLAN_SCAN_PARAMS_MAX_BSSID 4
2056#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
2057
Michal Kaziordcca0bd2014-11-24 14:58:32 +01002058/* Values lower than this may be refused by some firmware revisions with a scan
2059 * completion with a timedout reason.
2060 */
2061#define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
2062
Kalle Valo5e3dd152013-06-12 20:52:10 +03002063/* Scan priority numbers must be sequential, starting with 0 */
2064enum wmi_scan_priority {
2065 WMI_SCAN_PRIORITY_VERY_LOW = 0,
2066 WMI_SCAN_PRIORITY_LOW,
2067 WMI_SCAN_PRIORITY_MEDIUM,
2068 WMI_SCAN_PRIORITY_HIGH,
2069 WMI_SCAN_PRIORITY_VERY_HIGH,
2070 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
2071};
2072
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002073struct wmi_start_scan_common {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002074 /* Scan ID */
2075 __le32 scan_id;
2076 /* Scan requestor ID */
2077 __le32 scan_req_id;
2078 /* VDEV id(interface) that is requesting scan */
2079 __le32 vdev_id;
2080 /* Scan Priority, input to scan scheduler */
2081 __le32 scan_priority;
2082 /* Scan events subscription */
2083 __le32 notify_scan_events;
2084 /* dwell time in msec on active channels */
2085 __le32 dwell_time_active;
2086 /* dwell time in msec on passive channels */
2087 __le32 dwell_time_passive;
2088 /*
2089 * min time in msec on the BSS channel,only valid if atleast one
2090 * VDEV is active
2091 */
2092 __le32 min_rest_time;
2093 /*
2094 * max rest time in msec on the BSS channel,only valid if at least
2095 * one VDEV is active
2096 */
2097 /*
2098 * the scanner will rest on the bss channel at least min_rest_time
2099 * after min_rest_time the scanner will start checking for tx/rx
2100 * activity on all VDEVs. if there is no activity the scanner will
2101 * switch to off channel. if there is activity the scanner will let
2102 * the radio on the bss channel until max_rest_time expires.at
2103 * max_rest_time scanner will switch to off channel irrespective of
2104 * activity. activity is determined by the idle_time parameter.
2105 */
2106 __le32 max_rest_time;
2107 /*
2108 * time before sending next set of probe requests.
2109 * The scanner keeps repeating probe requests transmission with
2110 * period specified by repeat_probe_time.
2111 * The number of probe requests specified depends on the ssid_list
2112 * and bssid_list
2113 */
2114 __le32 repeat_probe_time;
2115 /* time in msec between 2 consequetive probe requests with in a set. */
2116 __le32 probe_spacing_time;
2117 /*
2118 * data inactivity time in msec on bss channel that will be used by
2119 * scanner for measuring the inactivity.
2120 */
2121 __le32 idle_time;
2122 /* maximum time in msec allowed for scan */
2123 __le32 max_scan_time;
2124 /*
2125 * delay in msec before sending first probe request after switching
2126 * to a channel
2127 */
2128 __le32 probe_delay;
2129 /* Scan control flags */
2130 __le32 scan_ctrl_flags;
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002131} __packed;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002132
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002133struct wmi_start_scan_tlvs {
2134 /* TLV parameters. These includes channel list, ssid list, bssid list,
2135 * extra ies.
Kalle Valo5e3dd152013-06-12 20:52:10 +03002136 */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002137 u8 tlvs[0];
2138} __packed;
2139
2140struct wmi_start_scan_cmd {
2141 struct wmi_start_scan_common common;
2142 __le32 burst_duration_ms;
2143 struct wmi_start_scan_tlvs tlvs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002144} __packed;
2145
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002146/* This is the definition from 10.X firmware branch */
Michal Kaziora6aa5da2014-09-18 15:21:27 +02002147struct wmi_10x_start_scan_cmd {
2148 struct wmi_start_scan_common common;
2149 struct wmi_start_scan_tlvs tlvs;
Bartosz Markowski89b7e762013-09-26 17:47:17 +02002150} __packed;
2151
Kalle Valo5e3dd152013-06-12 20:52:10 +03002152struct wmi_ssid_arg {
2153 int len;
2154 const u8 *ssid;
2155};
2156
2157struct wmi_bssid_arg {
2158 const u8 *bssid;
2159};
2160
2161struct wmi_start_scan_arg {
2162 u32 scan_id;
2163 u32 scan_req_id;
2164 u32 vdev_id;
2165 u32 scan_priority;
2166 u32 notify_scan_events;
2167 u32 dwell_time_active;
2168 u32 dwell_time_passive;
2169 u32 min_rest_time;
2170 u32 max_rest_time;
2171 u32 repeat_probe_time;
2172 u32 probe_spacing_time;
2173 u32 idle_time;
2174 u32 max_scan_time;
2175 u32 probe_delay;
2176 u32 scan_ctrl_flags;
Michal Kaziordbd3f9f2015-03-31 11:03:48 +00002177 u32 burst_duration_ms;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002178
2179 u32 ie_len;
2180 u32 n_channels;
2181 u32 n_ssids;
2182 u32 n_bssids;
2183
2184 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
Michal Kazior24c88f72014-07-25 13:32:17 +02002185 u16 channels[64];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002186 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
2187 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
2188};
2189
2190/* scan control flags */
2191
2192/* passively scan all channels including active channels */
2193#define WMI_SCAN_FLAG_PASSIVE 0x1
2194/* add wild card ssid probe request even though ssid_list is specified. */
2195#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
2196/* add cck rates to rates/xrate ie for the generated probe request */
2197#define WMI_SCAN_ADD_CCK_RATES 0x4
2198/* add ofdm rates to rates/xrate ie for the generated probe request */
2199#define WMI_SCAN_ADD_OFDM_RATES 0x8
2200/* To enable indication of Chan load and Noise floor to host */
2201#define WMI_SCAN_CHAN_STAT_EVENT 0x10
2202/* Filter Probe request frames */
2203#define WMI_SCAN_FILTER_PROBE_REQ 0x20
2204/* When set, DFS channels will not be scanned */
2205#define WMI_SCAN_BYPASS_DFS_CHN 0x40
2206/* Different FW scan engine may choose to bail out on errors.
2207 * Allow the driver to have influence over that. */
2208#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
2209
2210/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
2211#define WMI_SCAN_CLASS_MASK 0xFF000000
2212
Kalle Valo5e3dd152013-06-12 20:52:10 +03002213enum wmi_stop_scan_type {
2214 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
2215 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
2216 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
2217};
2218
2219struct wmi_stop_scan_cmd {
2220 __le32 scan_req_id;
2221 __le32 scan_id;
2222 __le32 req_type;
2223 __le32 vdev_id;
2224} __packed;
2225
2226struct wmi_stop_scan_arg {
2227 u32 req_id;
2228 enum wmi_stop_scan_type req_type;
2229 union {
2230 u32 scan_id;
2231 u32 vdev_id;
2232 } u;
2233};
2234
2235struct wmi_scan_chan_list_cmd {
2236 __le32 num_scan_chans;
2237 struct wmi_channel chan_info[0];
2238} __packed;
2239
2240struct wmi_scan_chan_list_arg {
2241 u32 n_channels;
2242 struct wmi_channel_arg *channels;
2243};
2244
2245enum wmi_bss_filter {
2246 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
2247 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
2248 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
2249 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
2250 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
2251 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
2252 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
2253 WMI_BSS_FILTER_LAST_BSS, /* marker only */
2254};
2255
2256enum wmi_scan_event_type {
2257 WMI_SCAN_EVENT_STARTED = 0x1,
2258 WMI_SCAN_EVENT_COMPLETED = 0x2,
2259 WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
2260 WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2261 WMI_SCAN_EVENT_DEQUEUED = 0x10,
2262 WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
2263 WMI_SCAN_EVENT_START_FAILED = 0x40,
2264 WMI_SCAN_EVENT_RESTARTED = 0x80,
2265 WMI_SCAN_EVENT_MAX = 0x8000
2266};
2267
2268enum wmi_scan_completion_reason {
2269 WMI_SCAN_REASON_COMPLETED,
2270 WMI_SCAN_REASON_CANCELLED,
2271 WMI_SCAN_REASON_PREEMPTED,
2272 WMI_SCAN_REASON_TIMEDOUT,
2273 WMI_SCAN_REASON_MAX,
2274};
2275
2276struct wmi_scan_event {
2277 __le32 event_type; /* %WMI_SCAN_EVENT_ */
2278 __le32 reason; /* %WMI_SCAN_REASON_ */
2279 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
2280 __le32 scan_req_id;
2281 __le32 scan_id;
2282 __le32 vdev_id;
2283} __packed;
2284
2285/*
2286 * This defines how much headroom is kept in the
2287 * receive frame between the descriptor and the
2288 * payload, in order for the WMI PHY error and
2289 * management handler to insert header contents.
2290 *
2291 * This is in bytes.
2292 */
2293#define WMI_MGMT_RX_HDR_HEADROOM 52
2294
2295/*
2296 * This event will be used for sending scan results
2297 * as well as rx mgmt frames to the host. The rx buffer
2298 * will be sent as part of this WMI event. It would be a
2299 * good idea to pass all the fields in the RX status
2300 * descriptor up to the host.
2301 */
Michal Kazior0d9b0432013-08-09 10:13:33 +02002302struct wmi_mgmt_rx_hdr_v1 {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002303 __le32 channel;
2304 __le32 snr;
2305 __le32 rate;
2306 __le32 phy_mode;
2307 __le32 buf_len;
2308 __le32 status; /* %WMI_RX_STATUS_ */
2309} __packed;
2310
Michal Kazior0d9b0432013-08-09 10:13:33 +02002311struct wmi_mgmt_rx_hdr_v2 {
2312 struct wmi_mgmt_rx_hdr_v1 v1;
2313 __le32 rssi_ctl[4];
2314} __packed;
2315
2316struct wmi_mgmt_rx_event_v1 {
2317 struct wmi_mgmt_rx_hdr_v1 hdr;
2318 u8 buf[0];
2319} __packed;
2320
2321struct wmi_mgmt_rx_event_v2 {
2322 struct wmi_mgmt_rx_hdr_v2 hdr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002323 u8 buf[0];
2324} __packed;
2325
2326#define WMI_RX_STATUS_OK 0x00
2327#define WMI_RX_STATUS_ERR_CRC 0x01
2328#define WMI_RX_STATUS_ERR_DECRYPT 0x08
2329#define WMI_RX_STATUS_ERR_MIC 0x10
2330#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
2331
Janusz Dziedzic9702c682013-11-20 09:59:41 +02002332#define PHY_ERROR_SPECTRAL_SCAN 0x26
2333#define PHY_ERROR_FALSE_RADAR_EXT 0x24
2334#define PHY_ERROR_RADAR 0x05
2335
Michal Kazior2332d0a2014-09-18 15:21:25 +02002336struct wmi_phyerr {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002337 __le32 tsf_timestamp;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002338 __le16 freq1;
2339 __le16 freq2;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002340 u8 rssi_combined;
2341 u8 chan_width_mhz;
2342 u8 phy_err_code;
2343 u8 rsvd0;
Michal Kazior2332d0a2014-09-18 15:21:25 +02002344 __le32 rssi_chains[4];
2345 __le16 nf_chains[4];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002346 __le32 buf_len;
Michal Kazior2332d0a2014-09-18 15:21:25 +02002347 u8 buf[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002348} __packed;
2349
Michal Kazior2332d0a2014-09-18 15:21:25 +02002350struct wmi_phyerr_event {
2351 __le32 num_phyerrs;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002352 __le32 tsf_l32;
2353 __le32 tsf_u32;
Michal Kazior2332d0a2014-09-18 15:21:25 +02002354 struct wmi_phyerr phyerrs[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03002355} __packed;
2356
Janusz Dziedzic9702c682013-11-20 09:59:41 +02002357#define PHYERR_TLV_SIG 0xBB
2358#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
2359#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
Simon Wunderlich855aed12014-08-02 09:12:54 +03002360#define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
Janusz Dziedzic9702c682013-11-20 09:59:41 +02002361
2362struct phyerr_radar_report {
2363 __le32 reg0; /* RADAR_REPORT_REG0_* */
2364 __le32 reg1; /* REDAR_REPORT_REG1_* */
2365} __packed;
2366
2367#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
2368#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
2369
2370#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
2371#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
2372
2373#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
2374#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
2375
2376#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
2377#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
2378
2379#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
2380#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
2381
2382#define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
2383#define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
2384
2385#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
2386#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
2387
2388#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
2389#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
2390
2391#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
2392#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
2393
2394#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
2395#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
2396
2397#define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
2398#define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
2399
2400struct phyerr_fft_report {
2401 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
2402 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
2403} __packed;
2404
2405#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
2406#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
2407
2408#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
2409#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
2410
2411#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
2412#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
2413
2414#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
2415#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
2416
2417#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
2418#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
2419
2420#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
2421#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
2422
2423#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
2424#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
2425
2426#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
2427#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
2428
Janusz Dziedzic9702c682013-11-20 09:59:41 +02002429struct phyerr_tlv {
2430 __le16 len;
2431 u8 tag;
2432 u8 sig;
2433} __packed;
2434
2435#define DFS_RSSI_POSSIBLY_FALSE 50
2436#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
2437
Kalle Valo5e3dd152013-06-12 20:52:10 +03002438struct wmi_mgmt_tx_hdr {
2439 __le32 vdev_id;
2440 struct wmi_mac_addr peer_macaddr;
2441 __le32 tx_rate;
2442 __le32 tx_power;
2443 __le32 buf_len;
2444} __packed;
2445
2446struct wmi_mgmt_tx_cmd {
2447 struct wmi_mgmt_tx_hdr hdr;
2448 u8 buf[0];
2449} __packed;
2450
2451struct wmi_echo_event {
2452 __le32 value;
2453} __packed;
2454
2455struct wmi_echo_cmd {
2456 __le32 value;
2457} __packed;
2458
Kalle Valo5e3dd152013-06-12 20:52:10 +03002459struct wmi_pdev_set_regdomain_cmd {
2460 __le32 reg_domain;
2461 __le32 reg_domain_2G;
2462 __le32 reg_domain_5G;
2463 __le32 conformance_test_limit_2G;
2464 __le32 conformance_test_limit_5G;
2465} __packed;
2466
Marek Puzyniak821af6a2014-03-21 17:46:57 +02002467enum wmi_dfs_region {
2468 /* Uninitialized dfs domain */
2469 WMI_UNINIT_DFS_DOMAIN = 0,
2470
2471 /* FCC3 dfs domain */
2472 WMI_FCC_DFS_DOMAIN = 1,
2473
2474 /* ETSI dfs domain */
2475 WMI_ETSI_DFS_DOMAIN = 2,
2476
2477 /*Japan dfs domain */
2478 WMI_MKK4_DFS_DOMAIN = 3,
2479};
2480
2481struct wmi_pdev_set_regdomain_cmd_10x {
2482 __le32 reg_domain;
2483 __le32 reg_domain_2G;
2484 __le32 reg_domain_5G;
2485 __le32 conformance_test_limit_2G;
2486 __le32 conformance_test_limit_5G;
2487
2488 /* dfs domain from wmi_dfs_region */
2489 __le32 dfs_domain;
2490} __packed;
2491
Kalle Valo5e3dd152013-06-12 20:52:10 +03002492/* Command to set/unset chip in quiet mode */
2493struct wmi_pdev_set_quiet_cmd {
2494 /* period in TUs */
2495 __le32 period;
2496
2497 /* duration in TUs */
2498 __le32 duration;
2499
2500 /* offset in TUs */
2501 __le32 next_start;
2502
2503 /* enable/disable */
2504 __le32 enabled;
2505} __packed;
2506
Kalle Valo5e3dd152013-06-12 20:52:10 +03002507/*
2508 * 802.11g protection mode.
2509 */
2510enum ath10k_protmode {
2511 ATH10K_PROT_NONE = 0, /* no protection */
2512 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
2513 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
2514};
2515
Marek Kwaczynskie81bd102014-03-11 12:58:00 +02002516enum wmi_rtscts_profile {
2517 WMI_RTSCTS_FOR_NO_RATESERIES = 0,
2518 WMI_RTSCTS_FOR_SECOND_RATESERIES,
2519 WMI_RTSCTS_ACROSS_SW_RETRIES
2520};
2521
2522#define WMI_RTSCTS_ENABLED 1
2523#define WMI_RTSCTS_SET_MASK 0x0f
2524#define WMI_RTSCTS_SET_LSB 0
2525
2526#define WMI_RTSCTS_PROFILE_MASK 0xf0
2527#define WMI_RTSCTS_PROFILE_LSB 4
2528
Kalle Valo5e3dd152013-06-12 20:52:10 +03002529enum wmi_beacon_gen_mode {
2530 WMI_BEACON_STAGGERED_MODE = 0,
2531 WMI_BEACON_BURST_MODE = 1
2532};
2533
2534enum wmi_csa_event_ies_present_flag {
2535 WMI_CSA_IE_PRESENT = 0x00000001,
2536 WMI_XCSA_IE_PRESENT = 0x00000002,
2537 WMI_WBW_IE_PRESENT = 0x00000004,
2538 WMI_CSWARP_IE_PRESENT = 0x00000008,
2539};
2540
2541/* wmi CSA receive event from beacon frame */
2542struct wmi_csa_event {
2543 __le32 i_fc_dur;
2544 /* Bit 0-15: FC */
2545 /* Bit 16-31: DUR */
2546 struct wmi_mac_addr i_addr1;
2547 struct wmi_mac_addr i_addr2;
2548 __le32 csa_ie[2];
2549 __le32 xcsa_ie[2];
2550 __le32 wb_ie[2];
2551 __le32 cswarp_ie;
2552 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
2553} __packed;
2554
2555/* the definition of different PDEV parameters */
2556#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2557#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2558#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
2559
Bartosz Markowski226a3392013-09-26 17:47:16 +02002560struct wmi_pdev_param_map {
2561 u32 tx_chain_mask;
2562 u32 rx_chain_mask;
2563 u32 txpower_limit2g;
2564 u32 txpower_limit5g;
2565 u32 txpower_scale;
2566 u32 beacon_gen_mode;
2567 u32 beacon_tx_mode;
2568 u32 resmgr_offchan_mode;
2569 u32 protection_mode;
2570 u32 dynamic_bw;
2571 u32 non_agg_sw_retry_th;
2572 u32 agg_sw_retry_th;
2573 u32 sta_kickout_th;
2574 u32 ac_aggrsize_scaling;
2575 u32 ltr_enable;
2576 u32 ltr_ac_latency_be;
2577 u32 ltr_ac_latency_bk;
2578 u32 ltr_ac_latency_vi;
2579 u32 ltr_ac_latency_vo;
2580 u32 ltr_ac_latency_timeout;
2581 u32 ltr_sleep_override;
2582 u32 ltr_rx_override;
2583 u32 ltr_tx_activity_timeout;
2584 u32 l1ss_enable;
2585 u32 dsleep_enable;
2586 u32 pcielp_txbuf_flush;
2587 u32 pcielp_txbuf_watermark;
2588 u32 pcielp_txbuf_tmo_en;
2589 u32 pcielp_txbuf_tmo_value;
2590 u32 pdev_stats_update_period;
2591 u32 vdev_stats_update_period;
2592 u32 peer_stats_update_period;
2593 u32 bcnflt_stats_update_period;
2594 u32 pmf_qos;
2595 u32 arp_ac_override;
Bartosz Markowski226a3392013-09-26 17:47:16 +02002596 u32 dcs;
2597 u32 ani_enable;
2598 u32 ani_poll_period;
2599 u32 ani_listen_period;
2600 u32 ani_ofdm_level;
2601 u32 ani_cck_level;
2602 u32 dyntxchain;
2603 u32 proxy_sta;
2604 u32 idle_ps_config;
2605 u32 power_gating_sleep;
2606 u32 fast_channel_reset;
2607 u32 burst_dur;
2608 u32 burst_enable;
Peter Oha7bd3e92014-12-02 13:07:14 +02002609 u32 cal_period;
Bartosz Markowski226a3392013-09-26 17:47:16 +02002610};
2611
2612#define WMI_PDEV_PARAM_UNSUPPORTED 0
2613
Kalle Valo5e3dd152013-06-12 20:52:10 +03002614enum wmi_pdev_param {
Ben Greeard0e0a552014-05-14 16:56:14 +03002615 /* TX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002616 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
Ben Greeard0e0a552014-05-14 16:56:14 +03002617 /* RX chain mask */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002618 WMI_PDEV_PARAM_RX_CHAIN_MASK,
2619 /* TX power limit for 2G Radio */
2620 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
2621 /* TX power limit for 5G Radio */
2622 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
2623 /* TX power scale */
2624 WMI_PDEV_PARAM_TXPOWER_SCALE,
2625 /* Beacon generation mode . 0: host, 1: target */
2626 WMI_PDEV_PARAM_BEACON_GEN_MODE,
2627 /* Beacon generation mode . 0: staggered 1: bursted */
2628 WMI_PDEV_PARAM_BEACON_TX_MODE,
2629 /*
2630 * Resource manager off chan mode .
2631 * 0: turn off off chan mode. 1: turn on offchan mode
2632 */
2633 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2634 /*
2635 * Protection mode:
2636 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2637 */
2638 WMI_PDEV_PARAM_PROTECTION_MODE,
Michal Kaziorc4dd0d02013-11-13 11:05:10 +01002639 /*
2640 * Dynamic bandwidth - 0: disable, 1: enable
2641 *
2642 * When enabled HW rate control tries different bandwidths when
2643 * retransmitting frames.
2644 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002645 WMI_PDEV_PARAM_DYNAMIC_BW,
2646 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2647 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2648 /* aggregrate sw retry threshold. 0-disable*/
2649 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
2650 /* Station kickout threshold (non of consecutive failures).0-disable */
2651 WMI_PDEV_PARAM_STA_KICKOUT_TH,
2652 /* Aggerate size scaling configuration per AC */
2653 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2654 /* LTR enable */
2655 WMI_PDEV_PARAM_LTR_ENABLE,
2656 /* LTR latency for BE, in us */
2657 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
2658 /* LTR latency for BK, in us */
2659 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
2660 /* LTR latency for VI, in us */
2661 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
2662 /* LTR latency for VO, in us */
2663 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
2664 /* LTR AC latency timeout, in ms */
2665 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2666 /* LTR platform latency override, in us */
2667 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2668 /* LTR-RX override, in us */
2669 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
2670 /* Tx activity timeout for LTR, in us */
2671 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2672 /* L1SS state machine enable */
2673 WMI_PDEV_PARAM_L1SS_ENABLE,
2674 /* Deep sleep state machine enable */
2675 WMI_PDEV_PARAM_DSLEEP_ENABLE,
2676 /* RX buffering flush enable */
2677 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
2678 /* RX buffering matermark */
2679 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
2680 /* RX buffering timeout enable */
2681 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
2682 /* RX buffering timeout value */
2683 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
2684 /* pdev level stats update period in ms */
2685 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2686 /* vdev level stats update period in ms */
2687 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2688 /* peer level stats update period in ms */
2689 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2690 /* beacon filter status update period */
2691 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2692 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2693 WMI_PDEV_PARAM_PMF_QOS,
2694 /* Access category on which ARP frames are sent */
2695 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
2696 /* DCS configuration */
2697 WMI_PDEV_PARAM_DCS,
2698 /* Enable/Disable ANI on target */
2699 WMI_PDEV_PARAM_ANI_ENABLE,
2700 /* configure the ANI polling period */
2701 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
2702 /* configure the ANI listening period */
2703 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
2704 /* configure OFDM immunity level */
2705 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
2706 /* configure CCK immunity level */
2707 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
2708 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2709 WMI_PDEV_PARAM_DYNTXCHAIN,
2710 /* Enable/Disable proxy STA */
2711 WMI_PDEV_PARAM_PROXY_STA,
2712 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
2713 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
2714 /* Enable/Disable power gating sleep */
2715 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
2716};
2717
Bartosz Markowski226a3392013-09-26 17:47:16 +02002718enum wmi_10x_pdev_param {
2719 /* TX chian mask */
2720 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
2721 /* RX chian mask */
2722 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
2723 /* TX power limit for 2G Radio */
2724 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
2725 /* TX power limit for 5G Radio */
2726 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
2727 /* TX power scale */
2728 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
2729 /* Beacon generation mode . 0: host, 1: target */
2730 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
2731 /* Beacon generation mode . 0: staggered 1: bursted */
2732 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
2733 /*
2734 * Resource manager off chan mode .
2735 * 0: turn off off chan mode. 1: turn on offchan mode
2736 */
2737 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2738 /*
2739 * Protection mode:
2740 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2741 */
2742 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
2743 /* Dynamic bandwidth 0: disable 1: enable */
2744 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
2745 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2746 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2747 /* aggregrate sw retry threshold. 0-disable*/
2748 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
2749 /* Station kickout threshold (non of consecutive failures).0-disable */
2750 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
2751 /* Aggerate size scaling configuration per AC */
2752 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2753 /* LTR enable */
2754 WMI_10X_PDEV_PARAM_LTR_ENABLE,
2755 /* LTR latency for BE, in us */
2756 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
2757 /* LTR latency for BK, in us */
2758 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
2759 /* LTR latency for VI, in us */
2760 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
2761 /* LTR latency for VO, in us */
2762 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
2763 /* LTR AC latency timeout, in ms */
2764 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2765 /* LTR platform latency override, in us */
2766 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2767 /* LTR-RX override, in us */
2768 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
2769 /* Tx activity timeout for LTR, in us */
2770 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2771 /* L1SS state machine enable */
2772 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
2773 /* Deep sleep state machine enable */
2774 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
2775 /* pdev level stats update period in ms */
2776 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2777 /* vdev level stats update period in ms */
2778 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2779 /* peer level stats update period in ms */
2780 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2781 /* beacon filter status update period */
2782 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2783 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2784 WMI_10X_PDEV_PARAM_PMF_QOS,
2785 /* Access category on which ARP and DHCP frames are sent */
2786 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
2787 /* DCS configuration */
2788 WMI_10X_PDEV_PARAM_DCS,
2789 /* Enable/Disable ANI on target */
2790 WMI_10X_PDEV_PARAM_ANI_ENABLE,
2791 /* configure the ANI polling period */
2792 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
2793 /* configure the ANI listening period */
2794 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
2795 /* configure OFDM immunity level */
2796 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
2797 /* configure CCK immunity level */
2798 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
2799 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2800 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
2801 /* Enable/Disable Fast channel reset*/
2802 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
2803 /* Set Bursting DUR */
2804 WMI_10X_PDEV_PARAM_BURST_DUR,
2805 /* Set Bursting Enable*/
2806 WMI_10X_PDEV_PARAM_BURST_ENABLE,
Michal Kazior24c88f72014-07-25 13:32:17 +02002807
2808 /* following are available as of firmware 10.2 */
2809 WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
2810 WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
2811 WMI_10X_PDEV_PARAM_IGMPMLD_TID,
2812 WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
2813 WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
2814 WMI_10X_PDEV_PARAM_RX_FILTER,
2815 WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
2816 WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
2817 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
2818 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
2819 WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
Peter Ohb43bf972014-12-02 13:06:53 +02002820 WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
2821 WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
2822 WMI_10X_PDEV_PARAM_CAL_PERIOD
Bartosz Markowski226a3392013-09-26 17:47:16 +02002823};
2824
Kalle Valo5e3dd152013-06-12 20:52:10 +03002825struct wmi_pdev_set_param_cmd {
2826 __le32 param_id;
2827 __le32 param_value;
2828} __packed;
2829
Peter Oha7bd3e92014-12-02 13:07:14 +02002830/* valid period is 1 ~ 60000ms, unit in millisecond */
2831#define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
2832
Kalle Valo5e3dd152013-06-12 20:52:10 +03002833struct wmi_pdev_get_tpc_config_cmd {
2834 /* parameter */
2835 __le32 param;
2836} __packed;
2837
2838#define WMI_TPC_RATE_MAX 160
2839#define WMI_TPC_TX_N_CHAIN 4
2840
2841enum wmi_tpc_config_event_flag {
2842 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
2843 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
2844 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
2845};
2846
2847struct wmi_pdev_tpc_config_event {
2848 __le32 reg_domain;
2849 __le32 chan_freq;
2850 __le32 phy_mode;
2851 __le32 twice_antenna_reduction;
2852 __le32 twice_max_rd_power;
2853 s32 twice_antenna_gain;
2854 __le32 power_limit;
2855 __le32 rate_max;
2856 __le32 num_tx_chain;
2857 __le32 ctl;
2858 __le32 flags;
2859 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
2860 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2861 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2862 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2863 u8 rates_array[WMI_TPC_RATE_MAX];
2864} __packed;
2865
2866/* Transmit power scale factor. */
2867enum wmi_tp_scale {
2868 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
2869 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
2870 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
2871 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
2872 WMI_TP_SCALE_MIN = 4, /* min, but still on */
2873 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
2874};
2875
Kalle Valo5e3dd152013-06-12 20:52:10 +03002876struct wmi_pdev_chanlist_update_event {
2877 /* number of channels */
2878 __le32 num_chan;
2879 /* array of channels */
2880 struct wmi_channel channel_list[1];
2881} __packed;
2882
2883#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
2884
2885struct wmi_debug_mesg_event {
2886 /* message buffer, NULL terminated */
2887 char bufp[WMI_MAX_DEBUG_MESG];
2888} __packed;
2889
2890enum {
2891 /* P2P device */
2892 VDEV_SUBTYPE_P2PDEV = 0,
2893 /* P2P client */
2894 VDEV_SUBTYPE_P2PCLI,
2895 /* P2P GO */
2896 VDEV_SUBTYPE_P2PGO,
2897 /* BT3.0 HS */
2898 VDEV_SUBTYPE_BT,
2899};
2900
2901struct wmi_pdev_set_channel_cmd {
2902 /* idnore power , only use flags , mode and freq */
2903 struct wmi_channel chan;
2904} __packed;
2905
Rajkumar Manoharan90174452014-10-03 08:02:33 +03002906struct wmi_pdev_pktlog_enable_cmd {
2907 __le32 ev_bitmap;
2908} __packed;
2909
Kalle Valo5e3dd152013-06-12 20:52:10 +03002910/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
2911#define WMI_DSCP_MAP_MAX (64)
2912struct wmi_pdev_set_dscp_tid_map_cmd {
2913 /* map indicating DSCP to TID conversion */
2914 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
2915} __packed;
2916
2917enum mcast_bcast_rate_id {
2918 WMI_SET_MCAST_RATE,
2919 WMI_SET_BCAST_RATE
2920};
2921
2922struct mcast_bcast_rate {
2923 enum mcast_bcast_rate_id rate_id;
2924 __le32 rate;
2925} __packed;
2926
2927struct wmi_wmm_params {
2928 __le32 cwmin;
2929 __le32 cwmax;
2930 __le32 aifs;
2931 __le32 txop;
2932 __le32 acm;
2933 __le32 no_ack;
2934} __packed;
2935
2936struct wmi_pdev_set_wmm_params {
2937 struct wmi_wmm_params ac_be;
2938 struct wmi_wmm_params ac_bk;
2939 struct wmi_wmm_params ac_vi;
2940 struct wmi_wmm_params ac_vo;
2941} __packed;
2942
2943struct wmi_wmm_params_arg {
2944 u32 cwmin;
2945 u32 cwmax;
2946 u32 aifs;
2947 u32 txop;
2948 u32 acm;
2949 u32 no_ack;
2950};
2951
Michal Kazior5e752e42015-01-19 09:53:41 +01002952struct wmi_wmm_params_all_arg {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002953 struct wmi_wmm_params_arg ac_be;
2954 struct wmi_wmm_params_arg ac_bk;
2955 struct wmi_wmm_params_arg ac_vi;
2956 struct wmi_wmm_params_arg ac_vo;
2957};
2958
Michal Kaziorb91251f2015-01-24 12:14:49 +02002959struct wmi_pdev_stats_tx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03002960 /* Num HTT cookies queued to dispatch list */
2961 __le32 comp_queued;
2962
2963 /* Num HTT cookies dispatched */
2964 __le32 comp_delivered;
2965
2966 /* Num MSDU queued to WAL */
2967 __le32 msdu_enqued;
2968
2969 /* Num MPDU queue to WAL */
2970 __le32 mpdu_enqued;
2971
2972 /* Num MSDUs dropped by WMM limit */
2973 __le32 wmm_drop;
2974
2975 /* Num Local frames queued */
2976 __le32 local_enqued;
2977
2978 /* Num Local frames done */
2979 __le32 local_freed;
2980
2981 /* Num queued to HW */
2982 __le32 hw_queued;
2983
2984 /* Num PPDU reaped from HW */
2985 __le32 hw_reaped;
2986
2987 /* Num underruns */
2988 __le32 underrun;
2989
2990 /* Num PPDUs cleaned up in TX abort */
2991 __le32 tx_abort;
2992
2993 /* Num MPDUs requed by SW */
2994 __le32 mpdus_requed;
2995
2996 /* excessive retries */
2997 __le32 tx_ko;
2998
2999 /* data hw rate code */
3000 __le32 data_rc;
3001
3002 /* Scheduler self triggers */
3003 __le32 self_triggers;
3004
3005 /* frames dropped due to excessive sw retries */
3006 __le32 sw_retry_failure;
3007
3008 /* illegal rate phy errors */
3009 __le32 illgl_rate_phy_err;
3010
3011 /* wal pdev continous xretry */
3012 __le32 pdev_cont_xretry;
3013
3014 /* wal pdev continous xretry */
3015 __le32 pdev_tx_timeout;
3016
3017 /* wal pdev resets */
3018 __le32 pdev_resets;
3019
Bartosz Markowski34d714e2014-03-28 14:35:16 +02003020 /* frames dropped due to non-availability of stateless TIDs */
3021 __le32 stateless_tid_alloc_failure;
3022
Kalle Valo5e3dd152013-06-12 20:52:10 +03003023 __le32 phy_underrun;
3024
3025 /* MPDU is more than txop limit */
3026 __le32 txop_ovf;
3027} __packed;
3028
Michal Kaziorb91251f2015-01-24 12:14:49 +02003029struct wmi_pdev_stats_rx {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003030 /* Cnts any change in ring routing mid-ppdu */
3031 __le32 mid_ppdu_route_change;
3032
3033 /* Total number of statuses processed */
3034 __le32 status_rcvd;
3035
3036 /* Extra frags on rings 0-3 */
3037 __le32 r0_frags;
3038 __le32 r1_frags;
3039 __le32 r2_frags;
3040 __le32 r3_frags;
3041
3042 /* MSDUs / MPDUs delivered to HTT */
3043 __le32 htt_msdus;
3044 __le32 htt_mpdus;
3045
3046 /* MSDUs / MPDUs delivered to local stack */
3047 __le32 loc_msdus;
3048 __le32 loc_mpdus;
3049
3050 /* AMSDUs that have more MSDUs than the status ring size */
3051 __le32 oversize_amsdu;
3052
3053 /* Number of PHY errors */
3054 __le32 phy_errs;
3055
3056 /* Number of PHY errors drops */
3057 __le32 phy_err_drop;
3058
3059 /* Number of mpdu errors - FCS, MIC, ENC etc. */
3060 __le32 mpdu_errs;
3061} __packed;
3062
Michal Kaziorb91251f2015-01-24 12:14:49 +02003063struct wmi_pdev_stats_peer {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003064 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
3065 __le32 dummy;
3066} __packed;
3067
Kalle Valo5e3dd152013-06-12 20:52:10 +03003068enum wmi_stats_id {
Michal Kazioreed55412015-02-15 16:50:41 +02003069 WMI_STAT_PEER = BIT(0),
3070 WMI_STAT_AP = BIT(1),
3071 WMI_STAT_PDEV = BIT(2),
3072 WMI_STAT_VDEV = BIT(3),
3073 WMI_STAT_BCNFLT = BIT(4),
3074 WMI_STAT_VDEV_RATE = BIT(5),
Kalle Valo5e3dd152013-06-12 20:52:10 +03003075};
3076
Ben Greeardb9cdda2014-03-28 14:35:15 +02003077struct wlan_inst_rssi_args {
3078 __le16 cfg_retry_count;
3079 __le16 retry_count;
3080};
3081
Kalle Valo5e3dd152013-06-12 20:52:10 +03003082struct wmi_request_stats_cmd {
3083 __le32 stats_id;
3084
Ben Greeardb9cdda2014-03-28 14:35:15 +02003085 __le32 vdev_id;
3086
3087 /* peer MAC address */
3088 struct wmi_mac_addr peer_macaddr;
3089
3090 /* Instantaneous RSSI arguments */
3091 struct wlan_inst_rssi_args inst_rssi_args;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003092} __packed;
3093
3094/* Suspend option */
3095enum {
3096 /* suspend */
3097 WMI_PDEV_SUSPEND,
3098
3099 /* suspend and disable all interrupts */
3100 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
3101};
3102
3103struct wmi_pdev_suspend_cmd {
3104 /* suspend option sent to target */
3105 __le32 suspend_opt;
3106} __packed;
3107
3108struct wmi_stats_event {
Michal Kazioreed55412015-02-15 16:50:41 +02003109 __le32 stats_id; /* WMI_STAT_ */
Kalle Valo5e3dd152013-06-12 20:52:10 +03003110 /*
3111 * number of pdev stats event structures
3112 * (wmi_pdev_stats) 0 or 1
3113 */
3114 __le32 num_pdev_stats;
3115 /*
3116 * number of vdev stats event structures
3117 * (wmi_vdev_stats) 0 or max vdevs
3118 */
3119 __le32 num_vdev_stats;
3120 /*
3121 * number of peer stats event structures
3122 * (wmi_peer_stats) 0 or max peers
3123 */
3124 __le32 num_peer_stats;
3125 __le32 num_bcnflt_stats;
3126 /*
3127 * followed by
3128 * num_pdev_stats * size of(struct wmi_pdev_stats)
3129 * num_vdev_stats * size of(struct wmi_vdev_stats)
3130 * num_peer_stats * size of(struct wmi_peer_stats)
3131 *
3132 * By having a zero sized array, the pointer to data area
3133 * becomes available without increasing the struct size
3134 */
3135 u8 data[0];
3136} __packed;
3137
Michal Kazior20de2222015-01-24 12:14:49 +02003138struct wmi_10_2_stats_event {
3139 __le32 stats_id; /* %WMI_REQUEST_ */
3140 __le32 num_pdev_stats;
3141 __le32 num_pdev_ext_stats;
3142 __le32 num_vdev_stats;
3143 __le32 num_peer_stats;
3144 __le32 num_bcnflt_stats;
3145 u8 data[0];
3146} __packed;
3147
Kalle Valo5e3dd152013-06-12 20:52:10 +03003148/*
3149 * PDEV statistics
3150 * TODO: add all PDEV stats here
3151 */
Michal Kaziorb91251f2015-01-24 12:14:49 +02003152struct wmi_pdev_stats_base {
3153 __le32 chan_nf;
3154 __le32 tx_frame_count;
3155 __le32 rx_frame_count;
3156 __le32 rx_clear_count;
3157 __le32 cycle_count;
3158 __le32 phy_err_count;
3159 __le32 chan_tx_pwr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03003160} __packed;
3161
Michal Kaziorb91251f2015-01-24 12:14:49 +02003162struct wmi_pdev_stats {
3163 struct wmi_pdev_stats_base base;
3164 struct wmi_pdev_stats_tx tx;
3165 struct wmi_pdev_stats_rx rx;
3166 struct wmi_pdev_stats_peer peer;
3167} __packed;
3168
3169struct wmi_pdev_stats_extra {
Chun-Yeow Yeoh52e346d2014-03-28 14:35:16 +02003170 __le32 ack_rx_bad;
3171 __le32 rts_bad;
3172 __le32 rts_good;
3173 __le32 fcs_bad;
3174 __le32 no_beacons;
3175 __le32 mib_int_count;
3176} __packed;
3177
Michal Kaziorb91251f2015-01-24 12:14:49 +02003178struct wmi_10x_pdev_stats {
3179 struct wmi_pdev_stats_base base;
3180 struct wmi_pdev_stats_tx tx;
3181 struct wmi_pdev_stats_rx rx;
3182 struct wmi_pdev_stats_peer peer;
3183 struct wmi_pdev_stats_extra extra;
3184} __packed;
3185
Michal Kazior20de2222015-01-24 12:14:49 +02003186struct wmi_pdev_stats_mem {
3187 __le32 dram_free;
3188 __le32 iram_free;
3189} __packed;
3190
3191struct wmi_10_2_pdev_stats {
3192 struct wmi_pdev_stats_base base;
3193 struct wmi_pdev_stats_tx tx;
3194 __le32 mc_drop;
3195 struct wmi_pdev_stats_rx rx;
3196 __le32 pdev_rx_timeout;
3197 struct wmi_pdev_stats_mem mem;
3198 struct wmi_pdev_stats_peer peer;
3199 struct wmi_pdev_stats_extra extra;
3200} __packed;
3201
Kalle Valo5e3dd152013-06-12 20:52:10 +03003202/*
3203 * VDEV statistics
3204 * TODO: add all VDEV stats here
3205 */
3206struct wmi_vdev_stats {
3207 __le32 vdev_id;
3208} __packed;
3209
3210/*
3211 * peer statistics.
3212 * TODO: add more stats
3213 */
Michal Kaziord15fb522014-09-25 12:33:47 +02003214struct wmi_peer_stats {
Kalle Valo5e3dd152013-06-12 20:52:10 +03003215 struct wmi_mac_addr peer_macaddr;
3216 __le32 peer_rssi;
3217 __le32 peer_tx_rate;
3218} __packed;
3219
Michal Kaziord15fb522014-09-25 12:33:47 +02003220struct wmi_10x_peer_stats {
3221 struct wmi_peer_stats old;
Ben Greear23c3aae2014-03-28 14:35:15 +02003222 __le32 peer_rx_rate;
3223} __packed;
3224
Michal Kazior20de2222015-01-24 12:14:49 +02003225struct wmi_10_2_peer_stats {
3226 struct wmi_peer_stats old;
3227 __le32 peer_rx_rate;
3228 __le32 current_per;
3229 __le32 retries;
3230 __le32 tx_rate_count;
3231 __le32 max_4ms_frame_len;
3232 __le32 total_sub_frames;
3233 __le32 tx_bytes;
3234 __le32 num_pkt_loss_overflow[4];
3235 __le32 num_pkt_loss_excess_retry[4];
3236} __packed;
3237
3238struct wmi_10_2_4_peer_stats {
3239 struct wmi_10_2_peer_stats common;
3240 __le32 unknown_value; /* FIXME: what is this word? */
3241} __packed;
3242
3243struct wmi_10_2_pdev_ext_stats {
3244 __le32 rx_rssi_comb;
3245 __le32 rx_rssi[4];
3246 __le32 rx_mcs[10];
3247 __le32 tx_mcs[10];
3248 __le32 ack_rssi;
3249} __packed;
3250
Kalle Valo5e3dd152013-06-12 20:52:10 +03003251struct wmi_vdev_create_cmd {
3252 __le32 vdev_id;
3253 __le32 vdev_type;
3254 __le32 vdev_subtype;
3255 struct wmi_mac_addr vdev_macaddr;
3256} __packed;
3257
3258enum wmi_vdev_type {
3259 WMI_VDEV_TYPE_AP = 1,
3260 WMI_VDEV_TYPE_STA = 2,
3261 WMI_VDEV_TYPE_IBSS = 3,
3262 WMI_VDEV_TYPE_MONITOR = 4,
3263};
3264
3265enum wmi_vdev_subtype {
3266 WMI_VDEV_SUBTYPE_NONE = 0,
3267 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
3268 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
3269 WMI_VDEV_SUBTYPE_P2P_GO = 3,
3270};
3271
3272/* values for vdev_subtype */
3273
3274/* values for vdev_start_request flags */
3275/*
3276 * Indicates that AP VDEV uses hidden ssid. only valid for
3277 * AP/GO */
3278#define WMI_VDEV_START_HIDDEN_SSID (1<<0)
3279/*
3280 * Indicates if robust management frame/management frame
3281 * protection is enabled. For GO/AP vdevs, it indicates that
3282 * it may support station/client associations with RMF enabled.
3283 * For STA/client vdevs, it indicates that sta will
3284 * associate with AP with RMF enabled. */
3285#define WMI_VDEV_START_PMF_ENABLED (1<<1)
3286
3287struct wmi_p2p_noa_descriptor {
3288 __le32 type_count; /* 255: continuous schedule, 0: reserved */
3289 __le32 duration; /* Absent period duration in micro seconds */
3290 __le32 interval; /* Absent period interval in micro seconds */
3291 __le32 start_time; /* 32 bit tsf time when in starts */
3292} __packed;
3293
3294struct wmi_vdev_start_request_cmd {
3295 /* WMI channel */
3296 struct wmi_channel chan;
3297 /* unique id identifying the VDEV, generated by the caller */
3298 __le32 vdev_id;
3299 /* requestor id identifying the caller module */
3300 __le32 requestor_id;
3301 /* beacon interval from received beacon */
3302 __le32 beacon_interval;
3303 /* DTIM Period from the received beacon */
3304 __le32 dtim_period;
3305 /* Flags */
3306 __le32 flags;
3307 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
3308 struct wmi_ssid ssid;
3309 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
3310 __le32 bcn_tx_rate;
3311 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
3312 __le32 bcn_tx_power;
3313 /* number of p2p NOA descriptor(s) from scan entry */
3314 __le32 num_noa_descriptors;
3315 /*
3316 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
3317 * During CAC, Our HW shouldn't ack ditected frames
3318 */
3319 __le32 disable_hw_ack;
3320 /* actual p2p NOA descriptor from scan entry */
3321 struct wmi_p2p_noa_descriptor noa_descriptors[2];
3322} __packed;
3323
3324struct wmi_vdev_restart_request_cmd {
3325 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
3326} __packed;
3327
3328struct wmi_vdev_start_request_arg {
3329 u32 vdev_id;
3330 struct wmi_channel_arg channel;
3331 u32 bcn_intval;
3332 u32 dtim_period;
3333 u8 *ssid;
3334 u32 ssid_len;
3335 u32 bcn_tx_rate;
3336 u32 bcn_tx_power;
3337 bool disable_hw_ack;
3338 bool hidden_ssid;
3339 bool pmf_enabled;
3340};
3341
3342struct wmi_vdev_delete_cmd {
3343 /* unique id identifying the VDEV, generated by the caller */
3344 __le32 vdev_id;
3345} __packed;
3346
3347struct wmi_vdev_up_cmd {
3348 __le32 vdev_id;
3349 __le32 vdev_assoc_id;
3350 struct wmi_mac_addr vdev_bssid;
3351} __packed;
3352
3353struct wmi_vdev_stop_cmd {
3354 __le32 vdev_id;
3355} __packed;
3356
3357struct wmi_vdev_down_cmd {
3358 __le32 vdev_id;
3359} __packed;
3360
3361struct wmi_vdev_standby_response_cmd {
3362 /* unique id identifying the VDEV, generated by the caller */
3363 __le32 vdev_id;
3364} __packed;
3365
3366struct wmi_vdev_resume_response_cmd {
3367 /* unique id identifying the VDEV, generated by the caller */
3368 __le32 vdev_id;
3369} __packed;
3370
3371struct wmi_vdev_set_param_cmd {
3372 __le32 vdev_id;
3373 __le32 param_id;
3374 __le32 param_value;
3375} __packed;
3376
3377#define WMI_MAX_KEY_INDEX 3
3378#define WMI_MAX_KEY_LEN 32
3379
3380#define WMI_KEY_PAIRWISE 0x00
3381#define WMI_KEY_GROUP 0x01
3382#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
3383
3384struct wmi_key_seq_counter {
3385 __le32 key_seq_counter_l;
3386 __le32 key_seq_counter_h;
3387} __packed;
3388
3389#define WMI_CIPHER_NONE 0x0 /* clear key */
3390#define WMI_CIPHER_WEP 0x1
3391#define WMI_CIPHER_TKIP 0x2
3392#define WMI_CIPHER_AES_OCB 0x3
3393#define WMI_CIPHER_AES_CCM 0x4
3394#define WMI_CIPHER_WAPI 0x5
3395#define WMI_CIPHER_CKIP 0x6
3396#define WMI_CIPHER_AES_CMAC 0x7
3397
3398struct wmi_vdev_install_key_cmd {
3399 __le32 vdev_id;
3400 struct wmi_mac_addr peer_macaddr;
3401 __le32 key_idx;
3402 __le32 key_flags;
3403 __le32 key_cipher; /* %WMI_CIPHER_ */
3404 struct wmi_key_seq_counter key_rsc_counter;
3405 struct wmi_key_seq_counter key_global_rsc_counter;
3406 struct wmi_key_seq_counter key_tsc_counter;
3407 u8 wpi_key_rsc_counter[16];
3408 u8 wpi_key_tsc_counter[16];
3409 __le32 key_len;
3410 __le32 key_txmic_len;
3411 __le32 key_rxmic_len;
3412
3413 /* contains key followed by tx mic followed by rx mic */
3414 u8 key_data[0];
3415} __packed;
3416
3417struct wmi_vdev_install_key_arg {
3418 u32 vdev_id;
3419 const u8 *macaddr;
3420 u32 key_idx;
3421 u32 key_flags;
3422 u32 key_cipher;
3423 u32 key_len;
3424 u32 key_txmic_len;
3425 u32 key_rxmic_len;
3426 const void *key_data;
3427};
3428
Janusz Dziedzic51ab1a02014-01-08 09:08:33 +01003429/*
3430 * vdev fixed rate format:
3431 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
3432 * - nss - b5:b4 - ss number (0 mean 1ss)
3433 * - rate_mcs - b3:b0 - as below
3434 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
3435 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
3436 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
3437 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
3438 * HT/VHT: MCS index
3439 */
3440
Kalle Valo5e3dd152013-06-12 20:52:10 +03003441/* Preamble types to be used with VDEV fixed rate configuration */
3442enum wmi_rate_preamble {
3443 WMI_RATE_PREAMBLE_OFDM,
3444 WMI_RATE_PREAMBLE_CCK,
3445 WMI_RATE_PREAMBLE_HT,
3446 WMI_RATE_PREAMBLE_VHT,
3447};
3448
3449/* Value to disable fixed rate setting */
3450#define WMI_FIXED_RATE_NONE (0xff)
3451
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02003452struct wmi_vdev_param_map {
3453 u32 rts_threshold;
3454 u32 fragmentation_threshold;
3455 u32 beacon_interval;
3456 u32 listen_interval;
3457 u32 multicast_rate;
3458 u32 mgmt_tx_rate;
3459 u32 slot_time;
3460 u32 preamble;
3461 u32 swba_time;
3462 u32 wmi_vdev_stats_update_period;
3463 u32 wmi_vdev_pwrsave_ageout_time;
3464 u32 wmi_vdev_host_swba_interval;
3465 u32 dtim_period;
3466 u32 wmi_vdev_oc_scheduler_air_time_limit;
3467 u32 wds;
3468 u32 atim_window;
3469 u32 bmiss_count_max;
3470 u32 bmiss_first_bcnt;
3471 u32 bmiss_final_bcnt;
3472 u32 feature_wmm;
3473 u32 chwidth;
3474 u32 chextoffset;
3475 u32 disable_htprotection;
3476 u32 sta_quickkickout;
3477 u32 mgmt_rate;
3478 u32 protection_mode;
3479 u32 fixed_rate;
3480 u32 sgi;
3481 u32 ldpc;
3482 u32 tx_stbc;
3483 u32 rx_stbc;
3484 u32 intra_bss_fwd;
3485 u32 def_keyid;
3486 u32 nss;
3487 u32 bcast_data_rate;
3488 u32 mcast_data_rate;
3489 u32 mcast_indicate;
3490 u32 dhcp_indicate;
3491 u32 unknown_dest_indicate;
3492 u32 ap_keepalive_min_idle_inactive_time_secs;
3493 u32 ap_keepalive_max_idle_inactive_time_secs;
3494 u32 ap_keepalive_max_unresponsive_time_secs;
3495 u32 ap_enable_nawds;
3496 u32 mcast2ucast_set;
3497 u32 enable_rtscts;
3498 u32 txbf;
3499 u32 packet_powersave;
3500 u32 drop_unencry;
3501 u32 tx_encap_type;
3502 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
3503};
3504
3505#define WMI_VDEV_PARAM_UNSUPPORTED 0
3506
Kalle Valo5e3dd152013-06-12 20:52:10 +03003507/* the definition of different VDEV parameters */
3508enum wmi_vdev_param {
3509 /* RTS Threshold */
3510 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
3511 /* Fragmentation threshold */
3512 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
3513 /* beacon interval in TUs */
3514 WMI_VDEV_PARAM_BEACON_INTERVAL,
3515 /* Listen interval in TUs */
3516 WMI_VDEV_PARAM_LISTEN_INTERVAL,
3517 /* muticast rate in Mbps */
3518 WMI_VDEV_PARAM_MULTICAST_RATE,
3519 /* management frame rate in Mbps */
3520 WMI_VDEV_PARAM_MGMT_TX_RATE,
3521 /* slot time (long vs short) */
3522 WMI_VDEV_PARAM_SLOT_TIME,
3523 /* preamble (long vs short) */
3524 WMI_VDEV_PARAM_PREAMBLE,
3525 /* SWBA time (time before tbtt in msec) */
3526 WMI_VDEV_PARAM_SWBA_TIME,
3527 /* time period for updating VDEV stats */
3528 WMI_VDEV_STATS_UPDATE_PERIOD,
3529 /* age out time in msec for frames queued for station in power save */
3530 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
3531 /*
3532 * Host SWBA interval (time in msec before tbtt for SWBA event
3533 * generation).
3534 */
3535 WMI_VDEV_HOST_SWBA_INTERVAL,
3536 /* DTIM period (specified in units of num beacon intervals) */
3537 WMI_VDEV_PARAM_DTIM_PERIOD,
3538 /*
3539 * scheduler air time limit for this VDEV. used by off chan
3540 * scheduler.
3541 */
3542 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3543 /* enable/dsiable WDS for this VDEV */
3544 WMI_VDEV_PARAM_WDS,
3545 /* ATIM Window */
3546 WMI_VDEV_PARAM_ATIM_WINDOW,
3547 /* BMISS max */
3548 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
3549 /* BMISS first time */
3550 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
3551 /* BMISS final time */
3552 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
3553 /* WMM enables/disabled */
3554 WMI_VDEV_PARAM_FEATURE_WMM,
3555 /* Channel width */
3556 WMI_VDEV_PARAM_CHWIDTH,
3557 /* Channel Offset */
3558 WMI_VDEV_PARAM_CHEXTOFFSET,
3559 /* Disable HT Protection */
3560 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
3561 /* Quick STA Kickout */
3562 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
3563 /* Rate to be used with Management frames */
3564 WMI_VDEV_PARAM_MGMT_RATE,
3565 /* Protection Mode */
3566 WMI_VDEV_PARAM_PROTECTION_MODE,
3567 /* Fixed rate setting */
3568 WMI_VDEV_PARAM_FIXED_RATE,
3569 /* Short GI Enable/Disable */
3570 WMI_VDEV_PARAM_SGI,
3571 /* Enable LDPC */
3572 WMI_VDEV_PARAM_LDPC,
3573 /* Enable Tx STBC */
3574 WMI_VDEV_PARAM_TX_STBC,
3575 /* Enable Rx STBC */
3576 WMI_VDEV_PARAM_RX_STBC,
3577 /* Intra BSS forwarding */
3578 WMI_VDEV_PARAM_INTRA_BSS_FWD,
3579 /* Setting Default xmit key for Vdev */
3580 WMI_VDEV_PARAM_DEF_KEYID,
3581 /* NSS width */
3582 WMI_VDEV_PARAM_NSS,
3583 /* Set the custom rate for the broadcast data frames */
3584 WMI_VDEV_PARAM_BCAST_DATA_RATE,
3585 /* Set the custom rate (rate-code) for multicast data frames */
3586 WMI_VDEV_PARAM_MCAST_DATA_RATE,
3587 /* Tx multicast packet indicate Enable/Disable */
3588 WMI_VDEV_PARAM_MCAST_INDICATE,
3589 /* Tx DHCP packet indicate Enable/Disable */
3590 WMI_VDEV_PARAM_DHCP_INDICATE,
3591 /* Enable host inspection of Tx unicast packet to unknown destination */
3592 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3593
3594 /* The minimum amount of time AP begins to consider STA inactive */
3595 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3596
3597 /*
3598 * An associated STA is considered inactive when there is no recent
3599 * TX/RX activity and no downlink frames are buffered for it. Once a
3600 * STA exceeds the maximum idle inactive time, the AP will send an
3601 * 802.11 data-null as a keep alive to verify the STA is still
3602 * associated. If the STA does ACK the data-null, or if the data-null
3603 * is buffered and the STA does not retrieve it, the STA will be
3604 * considered unresponsive
3605 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3606 */
3607 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3608
3609 /*
3610 * An associated STA is considered unresponsive if there is no recent
3611 * TX/RX activity and downlink frames are buffered for it. Once a STA
3612 * exceeds the maximum unresponsive time, the AP will send a
3613 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
3614 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3615
3616 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3617 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
3618 /* Enable/Disable RTS-CTS */
3619 WMI_VDEV_PARAM_ENABLE_RTSCTS,
3620 /* Enable TXBFee/er */
3621 WMI_VDEV_PARAM_TXBF,
3622
3623 /* Set packet power save */
3624 WMI_VDEV_PARAM_PACKET_POWERSAVE,
3625
3626 /*
3627 * Drops un-encrypted packets if eceived in an encrypted connection
3628 * otherwise forwards to host.
3629 */
3630 WMI_VDEV_PARAM_DROP_UNENCRY,
3631
3632 /*
3633 * Set the encapsulation type for frames.
3634 */
3635 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
3636};
3637
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02003638/* the definition of different VDEV parameters */
3639enum wmi_10x_vdev_param {
3640 /* RTS Threshold */
3641 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
3642 /* Fragmentation threshold */
3643 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
3644 /* beacon interval in TUs */
3645 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
3646 /* Listen interval in TUs */
3647 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
3648 /* muticast rate in Mbps */
3649 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
3650 /* management frame rate in Mbps */
3651 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
3652 /* slot time (long vs short) */
3653 WMI_10X_VDEV_PARAM_SLOT_TIME,
3654 /* preamble (long vs short) */
3655 WMI_10X_VDEV_PARAM_PREAMBLE,
3656 /* SWBA time (time before tbtt in msec) */
3657 WMI_10X_VDEV_PARAM_SWBA_TIME,
3658 /* time period for updating VDEV stats */
3659 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
3660 /* age out time in msec for frames queued for station in power save */
3661 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
3662 /*
3663 * Host SWBA interval (time in msec before tbtt for SWBA event
3664 * generation).
3665 */
3666 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
3667 /* DTIM period (specified in units of num beacon intervals) */
3668 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
3669 /*
3670 * scheduler air time limit for this VDEV. used by off chan
3671 * scheduler.
3672 */
3673 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3674 /* enable/dsiable WDS for this VDEV */
3675 WMI_10X_VDEV_PARAM_WDS,
3676 /* ATIM Window */
3677 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
3678 /* BMISS max */
3679 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
3680 /* WMM enables/disabled */
3681 WMI_10X_VDEV_PARAM_FEATURE_WMM,
3682 /* Channel width */
3683 WMI_10X_VDEV_PARAM_CHWIDTH,
3684 /* Channel Offset */
3685 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
3686 /* Disable HT Protection */
3687 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
3688 /* Quick STA Kickout */
3689 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
3690 /* Rate to be used with Management frames */
3691 WMI_10X_VDEV_PARAM_MGMT_RATE,
3692 /* Protection Mode */
3693 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
3694 /* Fixed rate setting */
3695 WMI_10X_VDEV_PARAM_FIXED_RATE,
3696 /* Short GI Enable/Disable */
3697 WMI_10X_VDEV_PARAM_SGI,
3698 /* Enable LDPC */
3699 WMI_10X_VDEV_PARAM_LDPC,
3700 /* Enable Tx STBC */
3701 WMI_10X_VDEV_PARAM_TX_STBC,
3702 /* Enable Rx STBC */
3703 WMI_10X_VDEV_PARAM_RX_STBC,
3704 /* Intra BSS forwarding */
3705 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
3706 /* Setting Default xmit key for Vdev */
3707 WMI_10X_VDEV_PARAM_DEF_KEYID,
3708 /* NSS width */
3709 WMI_10X_VDEV_PARAM_NSS,
3710 /* Set the custom rate for the broadcast data frames */
3711 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
3712 /* Set the custom rate (rate-code) for multicast data frames */
3713 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
3714 /* Tx multicast packet indicate Enable/Disable */
3715 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
3716 /* Tx DHCP packet indicate Enable/Disable */
3717 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
3718 /* Enable host inspection of Tx unicast packet to unknown destination */
3719 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3720
3721 /* The minimum amount of time AP begins to consider STA inactive */
3722 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3723
3724 /*
3725 * An associated STA is considered inactive when there is no recent
3726 * TX/RX activity and no downlink frames are buffered for it. Once a
3727 * STA exceeds the maximum idle inactive time, the AP will send an
3728 * 802.11 data-null as a keep alive to verify the STA is still
3729 * associated. If the STA does ACK the data-null, or if the data-null
3730 * is buffered and the STA does not retrieve it, the STA will be
3731 * considered unresponsive
3732 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3733 */
3734 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3735
3736 /*
3737 * An associated STA is considered unresponsive if there is no recent
3738 * TX/RX activity and downlink frames are buffered for it. Once a STA
3739 * exceeds the maximum unresponsive time, the AP will send a
3740 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
3741 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3742
3743 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3744 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
3745
3746 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
3747 /* Enable/Disable RTS-CTS */
3748 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
3749
3750 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
Michal Kazior24c88f72014-07-25 13:32:17 +02003751
3752 /* following are available as of firmware 10.2 */
3753 WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
3754 WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
3755 WMI_10X_VDEV_PARAM_MFPTEST_SET,
3756 WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
3757 WMI_10X_VDEV_PARAM_VHT_SGIMASK,
3758 WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02003759};
3760
Michal Kazior139e1702015-02-15 16:50:42 +02003761#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
3762#define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
3763#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
3764#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
3765
Kalle Valo5e3dd152013-06-12 20:52:10 +03003766/* slot time long */
3767#define WMI_VDEV_SLOT_TIME_LONG 0x1
3768/* slot time short */
3769#define WMI_VDEV_SLOT_TIME_SHORT 0x2
3770/* preablbe long */
3771#define WMI_VDEV_PREAMBLE_LONG 0x1
3772/* preablbe short */
3773#define WMI_VDEV_PREAMBLE_SHORT 0x2
3774
3775enum wmi_start_event_param {
3776 WMI_VDEV_RESP_START_EVENT = 0,
3777 WMI_VDEV_RESP_RESTART_EVENT,
3778};
3779
3780struct wmi_vdev_start_response_event {
3781 __le32 vdev_id;
3782 __le32 req_id;
3783 __le32 resp_type; /* %WMI_VDEV_RESP_ */
3784 __le32 status;
3785} __packed;
3786
3787struct wmi_vdev_standby_req_event {
3788 /* unique id identifying the VDEV, generated by the caller */
3789 __le32 vdev_id;
3790} __packed;
3791
3792struct wmi_vdev_resume_req_event {
3793 /* unique id identifying the VDEV, generated by the caller */
3794 __le32 vdev_id;
3795} __packed;
3796
3797struct wmi_vdev_stopped_event {
3798 /* unique id identifying the VDEV, generated by the caller */
3799 __le32 vdev_id;
3800} __packed;
3801
3802/*
3803 * common structure used for simple events
3804 * (stopped, resume_req, standby response)
3805 */
3806struct wmi_vdev_simple_event {
3807 /* unique id identifying the VDEV, generated by the caller */
3808 __le32 vdev_id;
3809} __packed;
3810
3811/* VDEV start response status codes */
3812/* VDEV succesfully started */
3813#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
3814
3815/* requested VDEV not found */
3816#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
3817
3818/* unsupported VDEV combination */
3819#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
3820
Simon Wunderlich855aed12014-08-02 09:12:54 +03003821/* TODO: please add more comments if you have in-depth information */
3822struct wmi_vdev_spectral_conf_cmd {
3823 __le32 vdev_id;
3824
3825 /* number of fft samples to send (0 for infinite) */
3826 __le32 scan_count;
3827 __le32 scan_period;
3828 __le32 scan_priority;
3829
3830 /* number of bins in the FFT: 2^(fft_size - bin_scale) */
3831 __le32 scan_fft_size;
3832 __le32 scan_gc_ena;
3833 __le32 scan_restart_ena;
3834 __le32 scan_noise_floor_ref;
3835 __le32 scan_init_delay;
3836 __le32 scan_nb_tone_thr;
3837 __le32 scan_str_bin_thr;
3838 __le32 scan_wb_rpt_mode;
3839 __le32 scan_rssi_rpt_mode;
3840 __le32 scan_rssi_thr;
3841 __le32 scan_pwr_format;
3842
3843 /* rpt_mode: Format of FFT report to software for spectral scan
3844 * triggered FFTs:
3845 * 0: No FFT report (only spectral scan summary report)
3846 * 1: 2-dword summary of metrics for each completed FFT + spectral
3847 * scan summary report
3848 * 2: 2-dword summary of metrics for each completed FFT +
3849 * 1x- oversampled bins(in-band) per FFT + spectral scan summary
3850 * report
3851 * 3: 2-dword summary of metrics for each completed FFT +
3852 * 2x- oversampled bins (all) per FFT + spectral scan summary
3853 */
3854 __le32 scan_rpt_mode;
3855 __le32 scan_bin_scale;
3856 __le32 scan_dbm_adj;
3857 __le32 scan_chn_mask;
3858} __packed;
3859
3860struct wmi_vdev_spectral_conf_arg {
3861 u32 vdev_id;
3862 u32 scan_count;
3863 u32 scan_period;
3864 u32 scan_priority;
3865 u32 scan_fft_size;
3866 u32 scan_gc_ena;
3867 u32 scan_restart_ena;
3868 u32 scan_noise_floor_ref;
3869 u32 scan_init_delay;
3870 u32 scan_nb_tone_thr;
3871 u32 scan_str_bin_thr;
3872 u32 scan_wb_rpt_mode;
3873 u32 scan_rssi_rpt_mode;
3874 u32 scan_rssi_thr;
3875 u32 scan_pwr_format;
3876 u32 scan_rpt_mode;
3877 u32 scan_bin_scale;
3878 u32 scan_dbm_adj;
3879 u32 scan_chn_mask;
3880};
3881
3882#define WMI_SPECTRAL_ENABLE_DEFAULT 0
3883#define WMI_SPECTRAL_COUNT_DEFAULT 0
3884#define WMI_SPECTRAL_PERIOD_DEFAULT 35
3885#define WMI_SPECTRAL_PRIORITY_DEFAULT 1
3886#define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
3887#define WMI_SPECTRAL_GC_ENA_DEFAULT 1
3888#define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
3889#define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
3890#define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
3891#define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
3892#define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
3893#define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
3894#define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
3895#define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
3896#define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
3897#define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
3898#define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
3899#define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
3900#define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
3901
3902struct wmi_vdev_spectral_enable_cmd {
3903 __le32 vdev_id;
3904 __le32 trigger_cmd;
3905 __le32 enable_cmd;
3906} __packed;
3907
3908#define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
3909#define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
3910#define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
3911#define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
3912
Kalle Valo5e3dd152013-06-12 20:52:10 +03003913/* Beacon processing related command and event structures */
3914struct wmi_bcn_tx_hdr {
3915 __le32 vdev_id;
3916 __le32 tx_rate;
3917 __le32 tx_power;
3918 __le32 bcn_len;
3919} __packed;
3920
3921struct wmi_bcn_tx_cmd {
3922 struct wmi_bcn_tx_hdr hdr;
3923 u8 *bcn[0];
3924} __packed;
3925
3926struct wmi_bcn_tx_arg {
3927 u32 vdev_id;
3928 u32 tx_rate;
3929 u32 tx_power;
3930 u32 bcn_len;
3931 const void *bcn;
3932};
3933
Michal Kazior748afc42014-01-23 12:48:21 +01003934enum wmi_bcn_tx_ref_flags {
3935 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
3936 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
3937};
3938
Michal Kazior24c88f72014-07-25 13:32:17 +02003939/* TODO: It is unclear why "no antenna" works while any other seemingly valid
3940 * chainmask yields no beacons on the air at all.
3941 */
3942#define WMI_BCN_TX_REF_DEF_ANTENNA 0
3943
Michal Kazior748afc42014-01-23 12:48:21 +01003944struct wmi_bcn_tx_ref_cmd {
3945 __le32 vdev_id;
3946 __le32 data_len;
3947 /* physical address of the frame - dma pointer */
3948 __le32 data_ptr;
3949 /* id for host to track */
3950 __le32 msdu_id;
3951 /* frame ctrl to setup PPDU desc */
3952 __le32 frame_control;
3953 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
3954 __le32 flags;
Michal Kazior24c88f72014-07-25 13:32:17 +02003955 /* introduced in 10.2 */
3956 __le32 antenna_mask;
Michal Kazior748afc42014-01-23 12:48:21 +01003957} __packed;
3958
Kalle Valo5e3dd152013-06-12 20:52:10 +03003959/* Beacon filter */
3960#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
3961#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
3962#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
3963#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
3964#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
3965
3966struct wmi_bcn_filter_rx_cmd {
3967 /* Filter ID */
3968 __le32 bcn_filter_id;
3969 /* Filter type - wmi_bcn_filter */
3970 __le32 bcn_filter;
3971 /* Buffer len */
3972 __le32 bcn_filter_len;
3973 /* Filter info (threshold, BSSID, RSSI) */
3974 u8 *bcn_filter_buf;
3975} __packed;
3976
3977/* Capabilities and IEs to be passed to firmware */
3978struct wmi_bcn_prb_info {
3979 /* Capabilities */
3980 __le32 caps;
3981 /* ERP info */
3982 __le32 erp;
3983 /* Advanced capabilities */
3984 /* HT capabilities */
3985 /* HT Info */
3986 /* ibss_dfs */
3987 /* wpa Info */
3988 /* rsn Info */
3989 /* rrm info */
3990 /* ath_ext */
3991 /* app IE */
3992} __packed;
3993
3994struct wmi_bcn_tmpl_cmd {
3995 /* unique id identifying the VDEV, generated by the caller */
3996 __le32 vdev_id;
3997 /* TIM IE offset from the beginning of the template. */
3998 __le32 tim_ie_offset;
3999 /* beacon probe capabilities and IEs */
4000 struct wmi_bcn_prb_info bcn_prb_info;
4001 /* beacon buffer length */
4002 __le32 buf_len;
4003 /* variable length data */
4004 u8 data[1];
4005} __packed;
4006
4007struct wmi_prb_tmpl_cmd {
4008 /* unique id identifying the VDEV, generated by the caller */
4009 __le32 vdev_id;
4010 /* beacon probe capabilities and IEs */
4011 struct wmi_bcn_prb_info bcn_prb_info;
4012 /* beacon buffer length */
4013 __le32 buf_len;
4014 /* Variable length data */
4015 u8 data[1];
4016} __packed;
4017
4018enum wmi_sta_ps_mode {
4019 /* enable power save for the given STA VDEV */
4020 WMI_STA_PS_MODE_DISABLED = 0,
4021 /* disable power save for a given STA VDEV */
4022 WMI_STA_PS_MODE_ENABLED = 1,
4023};
4024
4025struct wmi_sta_powersave_mode_cmd {
4026 /* unique id identifying the VDEV, generated by the caller */
4027 __le32 vdev_id;
4028
4029 /*
4030 * Power save mode
4031 * (see enum wmi_sta_ps_mode)
4032 */
4033 __le32 sta_ps_mode;
4034} __packed;
4035
4036enum wmi_csa_offload_en {
4037 WMI_CSA_OFFLOAD_DISABLE = 0,
4038 WMI_CSA_OFFLOAD_ENABLE = 1,
4039};
4040
4041struct wmi_csa_offload_enable_cmd {
4042 __le32 vdev_id;
4043 __le32 csa_offload_enable;
4044} __packed;
4045
4046struct wmi_csa_offload_chanswitch_cmd {
4047 __le32 vdev_id;
4048 struct wmi_channel chan;
4049} __packed;
4050
4051/*
4052 * This parameter controls the policy for retrieving frames from AP while the
4053 * STA is in sleep state.
4054 *
4055 * Only takes affect if the sta_ps_mode is enabled
4056 */
4057enum wmi_sta_ps_param_rx_wake_policy {
4058 /*
4059 * Wake up when ever there is an RX activity on the VDEV. In this mode
4060 * the Power save SM(state machine) will come out of sleep by either
4061 * sending null frame (or) a data frame (with PS==0) in response to TIM
4062 * bit set in the received beacon frame from AP.
4063 */
4064 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
4065
4066 /*
4067 * Here the power save state machine will not wakeup in response to TIM
4068 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
4069 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
4070 * access categories are delivery-enabled, the station will send a
4071 * UAPSD trigger frame, otherwise it will send a PS-Poll.
4072 */
4073 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
4074};
4075
4076/*
4077 * Number of tx frames/beacon that cause the power save SM to wake up.
4078 *
4079 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
4080 * meaning, It will cause the SM to never wake up. This is useful if you want
4081 * to keep the system to sleep all the time for some kind of test mode . host
4082 * can change this parameter any time. It will affect at the next tx frame.
4083 */
4084enum wmi_sta_ps_param_tx_wake_threshold {
4085 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
4086 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
4087
4088 /*
4089 * Values greater than one indicate that many TX attempts per beacon
4090 * interval before the STA will wake up
4091 */
4092};
4093
4094/*
4095 * The maximum number of PS-Poll frames the FW will send in response to
4096 * traffic advertised in TIM before waking up (by sending a null frame with PS
4097 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
4098 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
4099 * parameter is used when the RX wake policy is
4100 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
4101 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
4102 */
4103enum wmi_sta_ps_param_pspoll_count {
4104 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
4105 /*
4106 * Values greater than 0 indicate the maximum numer of PS-Poll frames
4107 * FW will send before waking up.
4108 */
Michal Kazior9f9b5742014-12-12 12:41:36 +01004109
4110 /* When u-APSD is enabled the firmware will be very reluctant to exit
4111 * STA PS. This could result in very poor Rx performance with STA doing
4112 * PS-Poll for each and every buffered frame. This value is a bit
4113 * arbitrary.
4114 */
4115 WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
Kalle Valo5e3dd152013-06-12 20:52:10 +03004116};
4117
4118/*
4119 * This will include the delivery and trigger enabled state for every AC.
4120 * This is the negotiated state with AP. The host MLME needs to set this based
4121 * on AP capability and the state Set in the association request by the
4122 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
4123 */
4124#define WMI_UAPSD_AC_TYPE_DELI 0
4125#define WMI_UAPSD_AC_TYPE_TRIG 1
4126
4127#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
4128 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
4129
4130enum wmi_sta_ps_param_uapsd {
4131 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
4132 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
4133 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
4134 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
4135 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
4136 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
4137 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
4138 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
4139};
4140
Janusz Dziedzic0c7e4772015-01-24 12:14:52 +02004141#define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
4142
4143struct wmi_sta_uapsd_auto_trig_param {
4144 __le32 wmm_ac;
4145 __le32 user_priority;
4146 __le32 service_interval;
4147 __le32 suspend_interval;
4148 __le32 delay_interval;
4149};
4150
4151struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
4152 __le32 vdev_id;
4153 struct wmi_mac_addr peer_macaddr;
4154 __le32 num_ac;
4155};
4156
4157struct wmi_sta_uapsd_auto_trig_arg {
4158 u32 wmm_ac;
4159 u32 user_priority;
4160 u32 service_interval;
4161 u32 suspend_interval;
4162 u32 delay_interval;
4163};
4164
Kalle Valo5e3dd152013-06-12 20:52:10 +03004165enum wmi_sta_powersave_param {
4166 /*
4167 * Controls how frames are retrievd from AP while STA is sleeping
4168 *
4169 * (see enum wmi_sta_ps_param_rx_wake_policy)
4170 */
4171 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
4172
4173 /*
4174 * The STA will go active after this many TX
4175 *
4176 * (see enum wmi_sta_ps_param_tx_wake_threshold)
4177 */
4178 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
4179
4180 /*
4181 * Number of PS-Poll to send before STA wakes up
4182 *
4183 * (see enum wmi_sta_ps_param_pspoll_count)
4184 *
4185 */
4186 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
4187
4188 /*
4189 * TX/RX inactivity time in msec before going to sleep.
4190 *
4191 * The power save SM will monitor tx/rx activity on the VDEV, if no
4192 * activity for the specified msec of the parameter the Power save
4193 * SM will go to sleep.
4194 */
4195 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
4196
4197 /*
4198 * Set uapsd configuration.
4199 *
4200 * (see enum wmi_sta_ps_param_uapsd)
4201 */
4202 WMI_STA_PS_PARAM_UAPSD = 4,
4203};
4204
4205struct wmi_sta_powersave_param_cmd {
4206 __le32 vdev_id;
4207 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
4208 __le32 param_value;
4209} __packed;
4210
4211/* No MIMO power save */
4212#define WMI_STA_MIMO_PS_MODE_DISABLE
4213/* mimo powersave mode static*/
4214#define WMI_STA_MIMO_PS_MODE_STATIC
4215/* mimo powersave mode dynamic */
4216#define WMI_STA_MIMO_PS_MODE_DYNAMIC
4217
4218struct wmi_sta_mimo_ps_mode_cmd {
4219 /* unique id identifying the VDEV, generated by the caller */
4220 __le32 vdev_id;
4221 /* mimo powersave mode as defined above */
4222 __le32 mimo_pwrsave_mode;
4223} __packed;
4224
4225/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
4226enum wmi_ap_ps_param_uapsd {
4227 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
4228 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
4229 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
4230 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
4231 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
4232 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
4233 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
4234 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
4235};
4236
4237/* U-APSD maximum service period of peer station */
4238enum wmi_ap_ps_peer_param_max_sp {
4239 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
4240 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
4241 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
4242 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
4243 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
4244};
4245
4246/*
4247 * AP power save parameter
4248 * Set a power save specific parameter for a peer station
4249 */
4250enum wmi_ap_ps_peer_param {
4251 /* Set uapsd configuration for a given peer.
4252 *
4253 * Include the delivery and trigger enabled state for every AC.
4254 * The host MLME needs to set this based on AP capability and stations
4255 * request Set in the association request received from the station.
4256 *
4257 * Lower 8 bits of the value specify the UAPSD configuration.
4258 *
4259 * (see enum wmi_ap_ps_param_uapsd)
4260 * The default value is 0.
4261 */
4262 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
4263
4264 /*
4265 * Set the service period for a UAPSD capable station
4266 *
4267 * The service period from wme ie in the (re)assoc request frame.
4268 *
4269 * (see enum wmi_ap_ps_peer_param_max_sp)
4270 */
4271 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
4272
4273 /* Time in seconds for aging out buffered frames for STA in PS */
4274 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
4275};
4276
4277struct wmi_ap_ps_peer_cmd {
4278 /* unique id identifying the VDEV, generated by the caller */
4279 __le32 vdev_id;
4280
4281 /* peer MAC address */
4282 struct wmi_mac_addr peer_macaddr;
4283
4284 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
4285 __le32 param_id;
4286
4287 /* AP powersave param value */
4288 __le32 param_value;
4289} __packed;
4290
4291/* 128 clients = 4 words */
4292#define WMI_TIM_BITMAP_ARRAY_SIZE 4
4293
4294struct wmi_tim_info {
4295 __le32 tim_len;
4296 __le32 tim_mcast;
4297 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
4298 __le32 tim_changed;
4299 __le32 tim_num_ps_pending;
4300} __packed;
4301
4302/* Maximum number of NOA Descriptors supported */
4303#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
4304#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
4305#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
4306#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
4307
4308struct wmi_p2p_noa_info {
4309 /* Bit 0 - Flag to indicate an update in NOA schedule
4310 Bits 7-1 - Reserved */
4311 u8 changed;
4312 /* NOA index */
4313 u8 index;
4314 /* Bit 0 - Opp PS state of the AP
4315 Bits 1-7 - Ctwindow in TUs */
4316 u8 ctwindow_oppps;
4317 /* Number of NOA descriptors */
4318 u8 num_descriptors;
4319
4320 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
4321} __packed;
4322
4323struct wmi_bcn_info {
4324 struct wmi_tim_info tim_info;
4325 struct wmi_p2p_noa_info p2p_noa_info;
4326} __packed;
4327
4328struct wmi_host_swba_event {
4329 __le32 vdev_map;
Michal Kazior32653cf2014-12-03 10:10:26 +02004330 struct wmi_bcn_info bcn_info[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +03004331} __packed;
4332
4333#define WMI_MAX_AP_VDEV 16
4334
4335struct wmi_tbtt_offset_event {
4336 __le32 vdev_map;
4337 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
4338} __packed;
4339
Kalle Valo5e3dd152013-06-12 20:52:10 +03004340struct wmi_peer_create_cmd {
4341 __le32 vdev_id;
4342 struct wmi_mac_addr peer_macaddr;
4343} __packed;
4344
Marek Puzyniak7390ed32015-03-30 09:51:52 +03004345enum wmi_peer_type {
4346 WMI_PEER_TYPE_DEFAULT = 0,
4347 WMI_PEER_TYPE_BSS = 1,
4348 WMI_PEER_TYPE_TDLS = 2,
4349};
4350
Kalle Valo5e3dd152013-06-12 20:52:10 +03004351struct wmi_peer_delete_cmd {
4352 __le32 vdev_id;
4353 struct wmi_mac_addr peer_macaddr;
4354} __packed;
4355
4356struct wmi_peer_flush_tids_cmd {
4357 __le32 vdev_id;
4358 struct wmi_mac_addr peer_macaddr;
4359 __le32 peer_tid_bitmap;
4360} __packed;
4361
4362struct wmi_fixed_rate {
4363 /*
4364 * rate mode . 0: disable fixed rate (auto rate)
4365 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
4366 * 2: ht20 11n rate specified as mcs index
4367 * 3: ht40 11n rate specified as mcs index
4368 */
4369 __le32 rate_mode;
4370 /*
4371 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
4372 * and series 3 is stored at byte 3 (MSB)
4373 */
4374 __le32 rate_series;
4375 /*
4376 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
4377 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
4378 * (MSB)
4379 */
4380 __le32 rate_retries;
4381} __packed;
4382
4383struct wmi_peer_fixed_rate_cmd {
4384 /* unique id identifying the VDEV, generated by the caller */
4385 __le32 vdev_id;
4386 /* peer MAC address */
4387 struct wmi_mac_addr peer_macaddr;
4388 /* fixed rate */
4389 struct wmi_fixed_rate peer_fixed_rate;
4390} __packed;
4391
4392#define WMI_MGMT_TID 17
4393
4394struct wmi_addba_clear_resp_cmd {
4395 /* unique id identifying the VDEV, generated by the caller */
4396 __le32 vdev_id;
4397 /* peer MAC address */
4398 struct wmi_mac_addr peer_macaddr;
4399} __packed;
4400
4401struct wmi_addba_send_cmd {
4402 /* unique id identifying the VDEV, generated by the caller */
4403 __le32 vdev_id;
4404 /* peer MAC address */
4405 struct wmi_mac_addr peer_macaddr;
4406 /* Tid number */
4407 __le32 tid;
4408 /* Buffer/Window size*/
4409 __le32 buffersize;
4410} __packed;
4411
4412struct wmi_delba_send_cmd {
4413 /* unique id identifying the VDEV, generated by the caller */
4414 __le32 vdev_id;
4415 /* peer MAC address */
4416 struct wmi_mac_addr peer_macaddr;
4417 /* Tid number */
4418 __le32 tid;
4419 /* Is Initiator */
4420 __le32 initiator;
4421 /* Reason code */
4422 __le32 reasoncode;
4423} __packed;
4424
4425struct wmi_addba_setresponse_cmd {
4426 /* unique id identifying the vdev, generated by the caller */
4427 __le32 vdev_id;
4428 /* peer mac address */
4429 struct wmi_mac_addr peer_macaddr;
4430 /* Tid number */
4431 __le32 tid;
4432 /* status code */
4433 __le32 statuscode;
4434} __packed;
4435
4436struct wmi_send_singleamsdu_cmd {
4437 /* unique id identifying the vdev, generated by the caller */
4438 __le32 vdev_id;
4439 /* peer mac address */
4440 struct wmi_mac_addr peer_macaddr;
4441 /* Tid number */
4442 __le32 tid;
4443} __packed;
4444
4445enum wmi_peer_smps_state {
4446 WMI_PEER_SMPS_PS_NONE = 0x0,
4447 WMI_PEER_SMPS_STATIC = 0x1,
4448 WMI_PEER_SMPS_DYNAMIC = 0x2
4449};
4450
Michal Kazior9797feb2014-02-14 14:49:48 +01004451enum wmi_peer_chwidth {
4452 WMI_PEER_CHWIDTH_20MHZ = 0,
4453 WMI_PEER_CHWIDTH_40MHZ = 1,
4454 WMI_PEER_CHWIDTH_80MHZ = 2,
4455};
4456
Kalle Valo5e3dd152013-06-12 20:52:10 +03004457enum wmi_peer_param {
4458 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
4459 WMI_PEER_AMPDU = 0x2,
4460 WMI_PEER_AUTHORIZE = 0x3,
4461 WMI_PEER_CHAN_WIDTH = 0x4,
4462 WMI_PEER_NSS = 0x5,
Michal Kazior0a987fb2015-02-13 13:30:15 +01004463 WMI_PEER_USE_4ADDR = 0x6,
4464 WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004465};
4466
4467struct wmi_peer_set_param_cmd {
4468 __le32 vdev_id;
4469 struct wmi_mac_addr peer_macaddr;
4470 __le32 param_id;
4471 __le32 param_value;
4472} __packed;
4473
4474#define MAX_SUPPORTED_RATES 128
4475
4476struct wmi_rate_set {
4477 /* total number of rates */
4478 __le32 num_rates;
4479 /*
4480 * rates (each 8bit value) packed into a 32 bit word.
4481 * the rates are filled from least significant byte to most
4482 * significant byte.
4483 */
4484 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
4485} __packed;
4486
4487struct wmi_rate_set_arg {
4488 unsigned int num_rates;
4489 u8 rates[MAX_SUPPORTED_RATES];
4490};
4491
4492/*
4493 * NOTE: It would bea good idea to represent the Tx MCS
4494 * info in one word and Rx in another word. This is split
4495 * into multiple words for convenience
4496 */
4497struct wmi_vht_rate_set {
4498 __le32 rx_max_rate; /* Max Rx data rate */
4499 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
4500 __le32 tx_max_rate; /* Max Tx data rate */
4501 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
4502} __packed;
4503
4504struct wmi_vht_rate_set_arg {
4505 u32 rx_max_rate;
4506 u32 rx_mcs_set;
4507 u32 tx_max_rate;
4508 u32 tx_mcs_set;
4509};
4510
4511struct wmi_peer_set_rates_cmd {
4512 /* peer MAC address */
4513 struct wmi_mac_addr peer_macaddr;
4514 /* legacy rate set */
4515 struct wmi_rate_set peer_legacy_rates;
4516 /* ht rate set */
4517 struct wmi_rate_set peer_ht_rates;
4518} __packed;
4519
4520struct wmi_peer_set_q_empty_callback_cmd {
4521 /* unique id identifying the VDEV, generated by the caller */
4522 __le32 vdev_id;
4523 /* peer MAC address */
4524 struct wmi_mac_addr peer_macaddr;
4525 __le32 callback_enable;
4526} __packed;
4527
4528#define WMI_PEER_AUTH 0x00000001
4529#define WMI_PEER_QOS 0x00000002
4530#define WMI_PEER_NEED_PTK_4_WAY 0x00000004
4531#define WMI_PEER_NEED_GTK_2_WAY 0x00000010
4532#define WMI_PEER_APSD 0x00000800
4533#define WMI_PEER_HT 0x00001000
4534#define WMI_PEER_40MHZ 0x00002000
4535#define WMI_PEER_STBC 0x00008000
4536#define WMI_PEER_LDPC 0x00010000
4537#define WMI_PEER_DYN_MIMOPS 0x00020000
4538#define WMI_PEER_STATIC_MIMOPS 0x00040000
4539#define WMI_PEER_SPATIAL_MUX 0x00200000
4540#define WMI_PEER_VHT 0x02000000
4541#define WMI_PEER_80MHZ 0x04000000
Yanbo Lid68bb122015-01-23 08:18:20 +08004542#define WMI_PEER_VHT_2G 0x08000000
Kalle Valo5e3dd152013-06-12 20:52:10 +03004543
4544/*
4545 * Peer rate capabilities.
4546 *
4547 * This is of interest to the ratecontrol
4548 * module which resides in the firmware. The bit definitions are
4549 * consistent with that defined in if_athrate.c.
4550 */
4551#define WMI_RC_DS_FLAG 0x01
4552#define WMI_RC_CW40_FLAG 0x02
4553#define WMI_RC_SGI_FLAG 0x04
4554#define WMI_RC_HT_FLAG 0x08
4555#define WMI_RC_RTSCTS_FLAG 0x10
4556#define WMI_RC_TX_STBC_FLAG 0x20
4557#define WMI_RC_RX_STBC_FLAG 0xC0
4558#define WMI_RC_RX_STBC_FLAG_S 6
4559#define WMI_RC_WEP_TKIP_FLAG 0x100
4560#define WMI_RC_TS_FLAG 0x200
4561#define WMI_RC_UAPSD_FLAG 0x400
4562
4563/* Maximum listen interval supported by hw in units of beacon interval */
4564#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
4565
Michal Kazior24c88f72014-07-25 13:32:17 +02004566struct wmi_common_peer_assoc_complete_cmd {
Kalle Valo5e3dd152013-06-12 20:52:10 +03004567 struct wmi_mac_addr peer_macaddr;
4568 __le32 vdev_id;
4569 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
4570 __le32 peer_associd; /* 16 LSBs */
4571 __le32 peer_flags;
4572 __le32 peer_caps; /* 16 LSBs */
4573 __le32 peer_listen_intval;
4574 __le32 peer_ht_caps;
4575 __le32 peer_max_mpdu;
4576 __le32 peer_mpdu_density; /* 0..16 */
4577 __le32 peer_rate_caps;
4578 struct wmi_rate_set peer_legacy_rates;
4579 struct wmi_rate_set peer_ht_rates;
4580 __le32 peer_nss; /* num of spatial streams */
4581 __le32 peer_vht_caps;
4582 __le32 peer_phymode;
4583 struct wmi_vht_rate_set peer_vht_rates;
Michal Kazior24c88f72014-07-25 13:32:17 +02004584};
4585
4586struct wmi_main_peer_assoc_complete_cmd {
4587 struct wmi_common_peer_assoc_complete_cmd cmd;
4588
Kalle Valo5e3dd152013-06-12 20:52:10 +03004589 /* HT Operation Element of the peer. Five bytes packed in 2
4590 * INT32 array and filled from lsb to msb. */
4591 __le32 peer_ht_info[2];
4592} __packed;
4593
Michal Kazior24c88f72014-07-25 13:32:17 +02004594struct wmi_10_1_peer_assoc_complete_cmd {
4595 struct wmi_common_peer_assoc_complete_cmd cmd;
4596} __packed;
4597
4598#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
4599#define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
4600#define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
4601#define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
4602
4603struct wmi_10_2_peer_assoc_complete_cmd {
4604 struct wmi_common_peer_assoc_complete_cmd cmd;
4605 __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
4606} __packed;
4607
Kalle Valo5e3dd152013-06-12 20:52:10 +03004608struct wmi_peer_assoc_complete_arg {
4609 u8 addr[ETH_ALEN];
4610 u32 vdev_id;
4611 bool peer_reassoc;
4612 u16 peer_aid;
4613 u32 peer_flags; /* see %WMI_PEER_ */
4614 u16 peer_caps;
4615 u32 peer_listen_intval;
4616 u32 peer_ht_caps;
4617 u32 peer_max_mpdu;
4618 u32 peer_mpdu_density; /* 0..16 */
4619 u32 peer_rate_caps; /* see %WMI_RC_ */
4620 struct wmi_rate_set_arg peer_legacy_rates;
4621 struct wmi_rate_set_arg peer_ht_rates;
4622 u32 peer_num_spatial_streams;
4623 u32 peer_vht_caps;
4624 enum wmi_phy_mode peer_phymode;
4625 struct wmi_vht_rate_set_arg peer_vht_rates;
4626};
4627
4628struct wmi_peer_add_wds_entry_cmd {
4629 /* peer MAC address */
4630 struct wmi_mac_addr peer_macaddr;
4631 /* wds MAC addr */
4632 struct wmi_mac_addr wds_macaddr;
4633} __packed;
4634
4635struct wmi_peer_remove_wds_entry_cmd {
4636 /* wds MAC addr */
4637 struct wmi_mac_addr wds_macaddr;
4638} __packed;
4639
4640struct wmi_peer_q_empty_callback_event {
4641 /* peer MAC address */
4642 struct wmi_mac_addr peer_macaddr;
4643} __packed;
4644
4645/*
4646 * Channel info WMI event
4647 */
4648struct wmi_chan_info_event {
4649 __le32 err_code;
4650 __le32 freq;
4651 __le32 cmd_flags;
4652 __le32 noise_floor;
4653 __le32 rx_clear_count;
4654 __le32 cycle_count;
4655} __packed;
4656
Kalle Valo5a13e762014-01-20 11:01:46 +02004657struct wmi_peer_sta_kickout_event {
4658 struct wmi_mac_addr peer_macaddr;
4659} __packed;
4660
Michal Kazior2e1dea42013-07-31 10:32:40 +02004661#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
Peter Oh7df37f72015-04-13 11:01:20 -07004662#define WMI_CHAN_INFO_MSEC(x) ((x) / 88000)
Michal Kazior2e1dea42013-07-31 10:32:40 +02004663
Kalle Valo5e3dd152013-06-12 20:52:10 +03004664/* Beacon filter wmi command info */
4665#define BCN_FLT_MAX_SUPPORTED_IES 256
4666#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
4667
4668struct bss_bcn_stats {
4669 __le32 vdev_id;
4670 __le32 bss_bcnsdropped;
4671 __le32 bss_bcnsdelivered;
4672} __packed;
4673
4674struct bcn_filter_stats {
4675 __le32 bcns_dropped;
4676 __le32 bcns_delivered;
4677 __le32 activefilters;
4678 struct bss_bcn_stats bss_stats;
4679} __packed;
4680
4681struct wmi_add_bcn_filter_cmd {
4682 u32 vdev_id;
4683 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
4684} __packed;
4685
4686enum wmi_sta_keepalive_method {
4687 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
4688 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
4689};
4690
Michal Kazior46725b152015-01-28 09:57:49 +02004691#define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
4692
4693/* Firmware crashes if keepalive interval exceeds this limit */
4694#define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
4695
Kalle Valo5e3dd152013-06-12 20:52:10 +03004696/* note: ip4 addresses are in network byte order, i.e. big endian */
4697struct wmi_sta_keepalive_arp_resp {
4698 __be32 src_ip4_addr;
4699 __be32 dest_ip4_addr;
4700 struct wmi_mac_addr dest_mac_addr;
4701} __packed;
4702
4703struct wmi_sta_keepalive_cmd {
4704 __le32 vdev_id;
4705 __le32 enabled;
4706 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
4707 __le32 interval; /* in seconds */
4708 struct wmi_sta_keepalive_arp_resp arp_resp;
4709} __packed;
4710
Janusz Dziedzic6e8b1882015-01-28 09:57:39 +02004711struct wmi_sta_keepalive_arg {
4712 u32 vdev_id;
4713 u32 enabled;
4714 u32 method;
4715 u32 interval;
4716 __be32 src_ip4_addr;
4717 __be32 dest_ip4_addr;
4718 const u8 dest_mac_addr[ETH_ALEN];
4719};
4720
Michal Kazior9cfbce72013-07-16 09:54:36 +02004721enum wmi_force_fw_hang_type {
4722 WMI_FORCE_FW_HANG_ASSERT = 1,
4723 WMI_FORCE_FW_HANG_NO_DETECT,
4724 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
4725 WMI_FORCE_FW_HANG_EMPTY_POINT,
4726 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
4727 WMI_FORCE_FW_HANG_INFINITE_LOOP,
4728};
4729
4730#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
4731
4732struct wmi_force_fw_hang_cmd {
4733 __le32 type;
4734 __le32 delay_ms;
4735} __packed;
4736
Kalle Valof118a3e2014-01-03 12:59:31 +02004737enum ath10k_dbglog_level {
4738 ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
4739 ATH10K_DBGLOG_LEVEL_INFO = 1,
4740 ATH10K_DBGLOG_LEVEL_WARN = 2,
4741 ATH10K_DBGLOG_LEVEL_ERR = 3,
4742};
4743
4744/* VAP ids to enable dbglog */
4745#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
4746#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
4747
4748/* to enable dbglog in the firmware */
4749#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
4750#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
4751
4752/* timestamp resolution */
4753#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
4754#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
4755
4756/* number of queued messages before sending them to the host */
4757#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
4758#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
4759
4760/*
4761 * Log levels to enable. This defines the minimum level to enable, this is
4762 * not a bitmask. See enum ath10k_dbglog_level for the values.
4763 */
4764#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
4765#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
4766
4767/*
4768 * Note: this is a cleaned up version of a struct firmware uses. For
4769 * example, config_valid was hidden inside an array.
4770 */
4771struct wmi_dbglog_cfg_cmd {
4772 /* bitmask to hold mod id config*/
4773 __le32 module_enable;
4774
4775 /* see ATH10K_DBGLOG_CFG_ */
4776 __le32 config_enable;
4777
4778 /* mask of module id bits to be changed */
4779 __le32 module_valid;
4780
4781 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
4782 __le32 config_valid;
4783} __packed;
4784
Michal Kaziorc1a46542015-03-10 16:21:54 +02004785enum wmi_roam_reason {
4786 WMI_ROAM_REASON_BETTER_AP = 1,
4787 WMI_ROAM_REASON_BEACON_MISS = 2,
4788 WMI_ROAM_REASON_LOW_RSSI = 3,
4789 WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
4790 WMI_ROAM_REASON_HO_FAILED = 5,
4791
4792 /* keep last */
4793 WMI_ROAM_REASON_MAX,
4794};
4795
4796struct wmi_roam_ev {
4797 __le32 vdev_id;
4798 __le32 reason;
4799} __packed;
4800
Kalle Valo5e3dd152013-06-12 20:52:10 +03004801#define ATH10K_FRAGMT_THRESHOLD_MIN 540
4802#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
4803
4804#define WMI_MAX_EVENT 0x1000
4805/* Maximum number of pending TXed WMI packets */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004806#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
4807
4808/* By default disable power save for IBSS */
4809#define ATH10K_DEFAULT_ATIM 0
4810
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02004811#define WMI_MAX_MEM_REQS 16
4812
Michal Kazior32653cf2014-12-03 10:10:26 +02004813struct wmi_scan_ev_arg {
4814 __le32 event_type; /* %WMI_SCAN_EVENT_ */
4815 __le32 reason; /* %WMI_SCAN_REASON_ */
4816 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
4817 __le32 scan_req_id;
4818 __le32 scan_id;
4819 __le32 vdev_id;
4820};
4821
4822struct wmi_mgmt_rx_ev_arg {
4823 __le32 channel;
4824 __le32 snr;
4825 __le32 rate;
4826 __le32 phy_mode;
4827 __le32 buf_len;
4828 __le32 status; /* %WMI_RX_STATUS_ */
4829};
4830
4831struct wmi_ch_info_ev_arg {
4832 __le32 err_code;
4833 __le32 freq;
4834 __le32 cmd_flags;
4835 __le32 noise_floor;
4836 __le32 rx_clear_count;
4837 __le32 cycle_count;
4838};
4839
4840struct wmi_vdev_start_ev_arg {
4841 __le32 vdev_id;
4842 __le32 req_id;
4843 __le32 resp_type; /* %WMI_VDEV_RESP_ */
4844 __le32 status;
4845};
4846
4847struct wmi_peer_kick_ev_arg {
4848 const u8 *mac_addr;
4849};
4850
4851struct wmi_swba_ev_arg {
4852 __le32 vdev_map;
4853 const struct wmi_tim_info *tim_info[WMI_MAX_AP_VDEV];
4854 const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
4855};
4856
4857struct wmi_phyerr_ev_arg {
4858 __le32 num_phyerrs;
4859 __le32 tsf_l32;
4860 __le32 tsf_u32;
4861 __le32 buf_len;
4862 const struct wmi_phyerr *phyerrs;
4863};
4864
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02004865struct wmi_svc_rdy_ev_arg {
4866 __le32 min_tx_power;
4867 __le32 max_tx_power;
4868 __le32 ht_cap;
4869 __le32 vht_cap;
4870 __le32 sw_ver0;
4871 __le32 sw_ver1;
Michal Kaziorca996ec2014-12-03 10:11:32 +02004872 __le32 fw_build;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02004873 __le32 phy_capab;
4874 __le32 num_rf_chains;
4875 __le32 eeprom_rd;
4876 __le32 num_mem_reqs;
4877 const __le32 *service_map;
Michal Kazior2a3e60d2014-11-27 10:11:15 +01004878 size_t service_map_len;
Michal Kazior5c01aa3d2014-09-18 15:21:24 +02004879 const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
4880};
4881
Michal Kazior32653cf2014-12-03 10:10:26 +02004882struct wmi_rdy_ev_arg {
4883 __le32 sw_version;
4884 __le32 abi_version;
4885 __le32 status;
4886 const u8 *mac_addr;
4887};
4888
Michal Kaziorc1a46542015-03-10 16:21:54 +02004889struct wmi_roam_ev_arg {
4890 __le32 vdev_id;
4891 __le32 reason;
4892 __le32 rssi;
4893};
4894
Rajkumar Manoharana57a6a22014-12-17 12:22:17 +02004895struct wmi_pdev_temperature_event {
4896 /* temperature value in Celcius degree */
4897 __le32 temperature;
4898} __packed;
4899
Janusz Dziedzicf5431e82015-03-23 17:32:53 +02004900/* WOW structures */
4901enum wmi_wow_wakeup_event {
4902 WOW_BMISS_EVENT = 0,
4903 WOW_BETTER_AP_EVENT,
4904 WOW_DEAUTH_RECVD_EVENT,
4905 WOW_MAGIC_PKT_RECVD_EVENT,
4906 WOW_GTK_ERR_EVENT,
4907 WOW_FOURWAY_HSHAKE_EVENT,
4908 WOW_EAPOL_RECVD_EVENT,
4909 WOW_NLO_DETECTED_EVENT,
4910 WOW_DISASSOC_RECVD_EVENT,
4911 WOW_PATTERN_MATCH_EVENT,
4912 WOW_CSA_IE_EVENT,
4913 WOW_PROBE_REQ_WPS_IE_EVENT,
4914 WOW_AUTH_REQ_EVENT,
4915 WOW_ASSOC_REQ_EVENT,
4916 WOW_HTT_EVENT,
4917 WOW_RA_MATCH_EVENT,
4918 WOW_HOST_AUTO_SHUTDOWN_EVENT,
4919 WOW_IOAC_MAGIC_EVENT,
4920 WOW_IOAC_SHORT_EVENT,
4921 WOW_IOAC_EXTEND_EVENT,
4922 WOW_IOAC_TIMER_EVENT,
4923 WOW_DFS_PHYERR_RADAR_EVENT,
4924 WOW_BEACON_EVENT,
4925 WOW_CLIENT_KICKOUT_EVENT,
4926 WOW_EVENT_MAX,
4927};
4928
4929#define C2S(x) case x: return #x
4930
4931static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
4932{
4933 switch (ev) {
4934 C2S(WOW_BMISS_EVENT);
4935 C2S(WOW_BETTER_AP_EVENT);
4936 C2S(WOW_DEAUTH_RECVD_EVENT);
4937 C2S(WOW_MAGIC_PKT_RECVD_EVENT);
4938 C2S(WOW_GTK_ERR_EVENT);
4939 C2S(WOW_FOURWAY_HSHAKE_EVENT);
4940 C2S(WOW_EAPOL_RECVD_EVENT);
4941 C2S(WOW_NLO_DETECTED_EVENT);
4942 C2S(WOW_DISASSOC_RECVD_EVENT);
4943 C2S(WOW_PATTERN_MATCH_EVENT);
4944 C2S(WOW_CSA_IE_EVENT);
4945 C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
4946 C2S(WOW_AUTH_REQ_EVENT);
4947 C2S(WOW_ASSOC_REQ_EVENT);
4948 C2S(WOW_HTT_EVENT);
4949 C2S(WOW_RA_MATCH_EVENT);
4950 C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
4951 C2S(WOW_IOAC_MAGIC_EVENT);
4952 C2S(WOW_IOAC_SHORT_EVENT);
4953 C2S(WOW_IOAC_EXTEND_EVENT);
4954 C2S(WOW_IOAC_TIMER_EVENT);
4955 C2S(WOW_DFS_PHYERR_RADAR_EVENT);
4956 C2S(WOW_BEACON_EVENT);
4957 C2S(WOW_CLIENT_KICKOUT_EVENT);
4958 C2S(WOW_EVENT_MAX);
4959 default:
4960 return NULL;
4961 }
4962}
4963
4964enum wmi_wow_wake_reason {
4965 WOW_REASON_UNSPECIFIED = -1,
4966 WOW_REASON_NLOD = 0,
4967 WOW_REASON_AP_ASSOC_LOST,
4968 WOW_REASON_LOW_RSSI,
4969 WOW_REASON_DEAUTH_RECVD,
4970 WOW_REASON_DISASSOC_RECVD,
4971 WOW_REASON_GTK_HS_ERR,
4972 WOW_REASON_EAP_REQ,
4973 WOW_REASON_FOURWAY_HS_RECV,
4974 WOW_REASON_TIMER_INTR_RECV,
4975 WOW_REASON_PATTERN_MATCH_FOUND,
4976 WOW_REASON_RECV_MAGIC_PATTERN,
4977 WOW_REASON_P2P_DISC,
4978 WOW_REASON_WLAN_HB,
4979 WOW_REASON_CSA_EVENT,
4980 WOW_REASON_PROBE_REQ_WPS_IE_RECV,
4981 WOW_REASON_AUTH_REQ_RECV,
4982 WOW_REASON_ASSOC_REQ_RECV,
4983 WOW_REASON_HTT_EVENT,
4984 WOW_REASON_RA_MATCH,
4985 WOW_REASON_HOST_AUTO_SHUTDOWN,
4986 WOW_REASON_IOAC_MAGIC_EVENT,
4987 WOW_REASON_IOAC_SHORT_EVENT,
4988 WOW_REASON_IOAC_EXTEND_EVENT,
4989 WOW_REASON_IOAC_TIMER_EVENT,
4990 WOW_REASON_ROAM_HO,
4991 WOW_REASON_DFS_PHYERR_RADADR_EVENT,
4992 WOW_REASON_BEACON_RECV,
4993 WOW_REASON_CLIENT_KICKOUT_EVENT,
4994 WOW_REASON_DEBUG_TEST = 0xFF,
4995};
4996
4997static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
4998{
4999 switch (reason) {
5000 C2S(WOW_REASON_UNSPECIFIED);
5001 C2S(WOW_REASON_NLOD);
5002 C2S(WOW_REASON_AP_ASSOC_LOST);
5003 C2S(WOW_REASON_LOW_RSSI);
5004 C2S(WOW_REASON_DEAUTH_RECVD);
5005 C2S(WOW_REASON_DISASSOC_RECVD);
5006 C2S(WOW_REASON_GTK_HS_ERR);
5007 C2S(WOW_REASON_EAP_REQ);
5008 C2S(WOW_REASON_FOURWAY_HS_RECV);
5009 C2S(WOW_REASON_TIMER_INTR_RECV);
5010 C2S(WOW_REASON_PATTERN_MATCH_FOUND);
5011 C2S(WOW_REASON_RECV_MAGIC_PATTERN);
5012 C2S(WOW_REASON_P2P_DISC);
5013 C2S(WOW_REASON_WLAN_HB);
5014 C2S(WOW_REASON_CSA_EVENT);
5015 C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
5016 C2S(WOW_REASON_AUTH_REQ_RECV);
5017 C2S(WOW_REASON_ASSOC_REQ_RECV);
5018 C2S(WOW_REASON_HTT_EVENT);
5019 C2S(WOW_REASON_RA_MATCH);
5020 C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
5021 C2S(WOW_REASON_IOAC_MAGIC_EVENT);
5022 C2S(WOW_REASON_IOAC_SHORT_EVENT);
5023 C2S(WOW_REASON_IOAC_EXTEND_EVENT);
5024 C2S(WOW_REASON_IOAC_TIMER_EVENT);
5025 C2S(WOW_REASON_ROAM_HO);
5026 C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
5027 C2S(WOW_REASON_BEACON_RECV);
5028 C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
5029 C2S(WOW_REASON_DEBUG_TEST);
5030 default:
5031 return NULL;
5032 }
5033}
5034
5035#undef C2S
5036
5037struct wmi_wow_ev_arg {
5038 u32 vdev_id;
5039 u32 flag;
5040 enum wmi_wow_wake_reason wake_reason;
5041 u32 data_len;
5042};
5043
Janusz Dziedzic25c86612015-03-23 17:32:54 +02005044#define WOW_MIN_PATTERN_SIZE 1
5045#define WOW_MAX_PATTERN_SIZE 148
5046#define WOW_MAX_PKT_OFFSET 128
5047
Marek Puzyniakad45c882015-03-30 09:51:53 +03005048enum wmi_tdls_state {
5049 WMI_TDLS_DISABLE,
5050 WMI_TDLS_ENABLE_PASSIVE,
5051 WMI_TDLS_ENABLE_ACTIVE,
5052};
5053
5054enum wmi_tdls_peer_state {
5055 WMI_TDLS_PEER_STATE_PEERING,
5056 WMI_TDLS_PEER_STATE_CONNECTED,
5057 WMI_TDLS_PEER_STATE_TEARDOWN,
5058};
5059
5060struct wmi_tdls_peer_update_cmd_arg {
5061 u32 vdev_id;
5062 enum wmi_tdls_peer_state peer_state;
5063 u8 addr[ETH_ALEN];
5064};
5065
5066#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
5067
5068struct wmi_tdls_peer_capab_arg {
5069 u8 peer_uapsd_queues;
5070 u8 peer_max_sp;
5071 u32 buff_sta_support;
5072 u32 off_chan_support;
5073 u32 peer_curr_operclass;
5074 u32 self_curr_operclass;
5075 u32 peer_chan_len;
5076 u32 peer_operclass_len;
5077 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
5078 u32 is_peer_responder;
5079 u32 pref_offchan_num;
5080 u32 pref_offchan_bw;
5081};
5082
Kalle Valo5e3dd152013-06-12 20:52:10 +03005083struct ath10k;
5084struct ath10k_vif;
Michal Kazior0226d602014-12-03 10:11:22 +02005085struct ath10k_fw_stats_pdev;
5086struct ath10k_fw_stats_peer;
Kalle Valo5e3dd152013-06-12 20:52:10 +03005087
5088int ath10k_wmi_attach(struct ath10k *ar);
5089void ath10k_wmi_detach(struct ath10k *ar);
5090int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
5091int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03005092
Michal Kazior0226d602014-12-03 10:11:22 +02005093struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
Michal Kazior95bf21f2014-05-16 17:15:39 +03005094int ath10k_wmi_connect(struct ath10k *ar);
Kalle Valo666a73f32014-09-10 18:23:23 +03005095
5096struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
5097int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
Michal Kaziord7579d12014-12-03 10:10:54 +02005098int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
5099 u32 cmd_id);
Kalle Valo5e3dd152013-06-12 20:52:10 +03005100void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
Kalle Valo5e3dd152013-06-12 20:52:10 +03005101
Michal Kaziorb91251f2015-01-24 12:14:49 +02005102void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
5103 struct ath10k_fw_stats_pdev *dst);
5104void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
5105 struct ath10k_fw_stats_pdev *dst);
5106void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
5107 struct ath10k_fw_stats_pdev *dst);
5108void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
5109 struct ath10k_fw_stats_pdev *dst);
Michal Kazior0226d602014-12-03 10:11:22 +02005110void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
5111 struct ath10k_fw_stats_peer *dst);
5112void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
5113 struct wmi_host_mem_chunks *chunks);
5114void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
5115 const struct wmi_start_scan_arg *arg);
Michal Kazior5e752e42015-01-19 09:53:41 +01005116void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
5117 const struct wmi_wmm_params_arg *arg);
Michal Kazior0226d602014-12-03 10:11:22 +02005118void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
5119 const struct wmi_channel_arg *arg);
5120int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
5121
5122int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
5123int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
5124void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
5125void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
5126int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
5127void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
5128void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
5129void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
5130void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
5131void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
5132void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
5133void ath10k_wmi_event_dfs(struct ath10k *ar,
5134 const struct wmi_phyerr *phyerr, u64 tsf);
5135void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
5136 const struct wmi_phyerr *phyerr,
5137 u64 tsf);
5138void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
5139void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
5140void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
5141void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
5142void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
5143void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
5144void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
5145 struct sk_buff *skb);
5146void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
5147 struct sk_buff *skb);
5148void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
5149void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
5150void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
5151void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
5152void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
5153void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
5154 struct sk_buff *skb);
5155void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
5156void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
5157void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
5158void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
5159 struct sk_buff *skb);
5160void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
5161void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
5162void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
5163void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
5164int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
5165
Kalle Valo5e3dd152013-06-12 20:52:10 +03005166#endif /* _WMI_H_ */