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