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