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