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