ath10k: use proper tx power unit
[deliverable/linux.git] / drivers / net / wireless / ath / ath10k / wmi.h
CommitLineData
5e3dd157
KV
1/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _WMI_H_
19#define _WMI_H_
20
21#include <linux/types.h>
22#include <net/mac80211.h>
23
24/*
25 * This file specifies the WMI interface for the Unified Software
26 * Architecture.
27 *
28 * It includes definitions of all the commands and events. Commands are
29 * messages from the host to the target. Events and Replies are messages
30 * from the target to the host.
31 *
32 * Ownership of correctness in regards to WMI commands belongs to the host
33 * driver and the target is not required to validate parameters for value,
34 * proper range, or any other checking.
35 *
36 * Guidelines for extending this interface are below.
37 *
38 * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
39 *
40 * 2. Use ONLY u32 type for defining member variables within WMI
41 * command/event structures. Do not use u8, u16, bool or
42 * enum types within these structures.
43 *
44 * 3. DO NOT define bit fields within structures. Implement bit fields
45 * using masks if necessary. Do not use the programming language's bit
46 * field definition.
47 *
48 * 4. Define macros for encode/decode of u8, u16 fields within
49 * the u32 variables. Use these macros for set/get of these fields.
50 * Try to use this to optimize the structure without bloating it with
51 * u32 variables for every lower sized field.
52 *
53 * 5. Do not use PACK/UNPACK attributes for the structures as each member
54 * variable is already 4-byte aligned by virtue of being a u32
55 * type.
56 *
57 * 6. Comment each parameter part of the WMI command/event structure by
58 * using the 2 stars at the begining of C comment instead of one star to
59 * enable HTML document generation using Doxygen.
60 *
61 */
62
63/* Control Path */
64struct wmi_cmd_hdr {
65 __le32 cmd_id;
66} __packed;
67
68#define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
69#define WMI_CMD_HDR_CMD_ID_LSB 0
70#define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
71#define WMI_CMD_HDR_PLT_PRIV_LSB 24
72
73#define HTC_PROTOCOL_VERSION 0x0002
74#define WMI_PROTOCOL_VERSION 0x0002
75
76enum wmi_service_id {
77 WMI_SERVICE_BEACON_OFFLOAD = 0, /* beacon offload */
78 WMI_SERVICE_SCAN_OFFLOAD, /* scan offload */
79 WMI_SERVICE_ROAM_OFFLOAD, /* roam offload */
80 WMI_SERVICE_BCN_MISS_OFFLOAD, /* beacon miss offload */
81 WMI_SERVICE_STA_PWRSAVE, /* fake sleep + basic power save */
82 WMI_SERVICE_STA_ADVANCED_PWRSAVE, /* uapsd, pspoll, force sleep */
83 WMI_SERVICE_AP_UAPSD, /* uapsd on AP */
84 WMI_SERVICE_AP_DFS, /* DFS on AP */
85 WMI_SERVICE_11AC, /* supports 11ac */
86 WMI_SERVICE_BLOCKACK, /* Supports triggering ADDBA/DELBA from host*/
87 WMI_SERVICE_PHYERR, /* PHY error */
88 WMI_SERVICE_BCN_FILTER, /* Beacon filter support */
89 WMI_SERVICE_RTT, /* RTT (round trip time) support */
90 WMI_SERVICE_RATECTRL, /* Rate-control */
91 WMI_SERVICE_WOW, /* WOW Support */
92 WMI_SERVICE_RATECTRL_CACHE, /* Rate-control caching */
93 WMI_SERVICE_IRAM_TIDS, /* TIDs in IRAM */
94 WMI_SERVICE_ARPNS_OFFLOAD, /* ARP NS Offload support */
95 WMI_SERVICE_NLO, /* Network list offload service */
96 WMI_SERVICE_GTK_OFFLOAD, /* GTK offload */
97 WMI_SERVICE_SCAN_SCH, /* Scan Scheduler Service */
98 WMI_SERVICE_CSA_OFFLOAD, /* CSA offload service */
99 WMI_SERVICE_CHATTER, /* Chatter service */
100 WMI_SERVICE_COEX_FREQAVOID, /* FW report freq range to avoid */
101 WMI_SERVICE_PACKET_POWER_SAVE, /* packet power save service */
102 WMI_SERVICE_FORCE_FW_HANG, /* To test fw recovery mechanism */
103 WMI_SERVICE_GPIO, /* GPIO service */
104 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, /* Modulated DTIM support */
105 WMI_STA_UAPSD_BASIC_AUTO_TRIG, /* UAPSD AC Trigger Generation */
106 WMI_STA_UAPSD_VAR_AUTO_TRIG, /* -do- */
107 WMI_SERVICE_STA_KEEP_ALIVE, /* STA keep alive mechanism support */
108 WMI_SERVICE_TX_ENCAP, /* Packet type for TX encapsulation */
109
110 WMI_SERVICE_LAST,
111 WMI_MAX_SERVICE = 64 /* max service */
112};
113
114static inline char *wmi_service_name(int service_id)
115{
116 switch (service_id) {
117 case WMI_SERVICE_BEACON_OFFLOAD:
118 return "BEACON_OFFLOAD";
119 case WMI_SERVICE_SCAN_OFFLOAD:
120 return "SCAN_OFFLOAD";
121 case WMI_SERVICE_ROAM_OFFLOAD:
122 return "ROAM_OFFLOAD";
123 case WMI_SERVICE_BCN_MISS_OFFLOAD:
124 return "BCN_MISS_OFFLOAD";
125 case WMI_SERVICE_STA_PWRSAVE:
126 return "STA_PWRSAVE";
127 case WMI_SERVICE_STA_ADVANCED_PWRSAVE:
128 return "STA_ADVANCED_PWRSAVE";
129 case WMI_SERVICE_AP_UAPSD:
130 return "AP_UAPSD";
131 case WMI_SERVICE_AP_DFS:
132 return "AP_DFS";
133 case WMI_SERVICE_11AC:
134 return "11AC";
135 case WMI_SERVICE_BLOCKACK:
136 return "BLOCKACK";
137 case WMI_SERVICE_PHYERR:
138 return "PHYERR";
139 case WMI_SERVICE_BCN_FILTER:
140 return "BCN_FILTER";
141 case WMI_SERVICE_RTT:
142 return "RTT";
143 case WMI_SERVICE_RATECTRL:
144 return "RATECTRL";
145 case WMI_SERVICE_WOW:
146 return "WOW";
147 case WMI_SERVICE_RATECTRL_CACHE:
148 return "RATECTRL CACHE";
149 case WMI_SERVICE_IRAM_TIDS:
150 return "IRAM TIDS";
151 case WMI_SERVICE_ARPNS_OFFLOAD:
152 return "ARPNS_OFFLOAD";
153 case WMI_SERVICE_NLO:
154 return "NLO";
155 case WMI_SERVICE_GTK_OFFLOAD:
156 return "GTK_OFFLOAD";
157 case WMI_SERVICE_SCAN_SCH:
158 return "SCAN_SCH";
159 case WMI_SERVICE_CSA_OFFLOAD:
160 return "CSA_OFFLOAD";
161 case WMI_SERVICE_CHATTER:
162 return "CHATTER";
163 case WMI_SERVICE_COEX_FREQAVOID:
164 return "COEX_FREQAVOID";
165 case WMI_SERVICE_PACKET_POWER_SAVE:
166 return "PACKET_POWER_SAVE";
167 case WMI_SERVICE_FORCE_FW_HANG:
168 return "FORCE FW HANG";
169 case WMI_SERVICE_GPIO:
170 return "GPIO";
171 case WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM:
172 return "MODULATED DTIM";
173 case WMI_STA_UAPSD_BASIC_AUTO_TRIG:
174 return "BASIC UAPSD";
175 case WMI_STA_UAPSD_VAR_AUTO_TRIG:
176 return "VAR UAPSD";
177 case WMI_SERVICE_STA_KEEP_ALIVE:
178 return "STA KEEP ALIVE";
179 case WMI_SERVICE_TX_ENCAP:
180 return "TX ENCAP";
181 default:
182 return "UNKNOWN SERVICE\n";
183 }
184}
185
186
187#define WMI_SERVICE_BM_SIZE \
188 ((WMI_MAX_SERVICE + sizeof(u32) - 1)/sizeof(u32))
189
190/* 2 word representation of MAC addr */
191struct wmi_mac_addr {
192 union {
193 u8 addr[6];
194 struct {
195 u32 word0;
196 u32 word1;
197 } __packed;
198 } __packed;
199} __packed;
200
201/* macro to convert MAC address from WMI word format to char array */
202#define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
203 (c_macaddr)[0] = ((pwmi_mac_addr)->word0) & 0xff; \
204 (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \
205 (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \
206 (c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \
207 (c_macaddr)[4] = ((pwmi_mac_addr)->word1) & 0xff; \
208 (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \
209 } while (0)
210
ce42870e
BM
211struct wmi_cmd_map {
212 u32 init_cmdid;
213 u32 start_scan_cmdid;
214 u32 stop_scan_cmdid;
215 u32 scan_chan_list_cmdid;
216 u32 scan_sch_prio_tbl_cmdid;
217 u32 pdev_set_regdomain_cmdid;
218 u32 pdev_set_channel_cmdid;
219 u32 pdev_set_param_cmdid;
220 u32 pdev_pktlog_enable_cmdid;
221 u32 pdev_pktlog_disable_cmdid;
222 u32 pdev_set_wmm_params_cmdid;
223 u32 pdev_set_ht_cap_ie_cmdid;
224 u32 pdev_set_vht_cap_ie_cmdid;
225 u32 pdev_set_dscp_tid_map_cmdid;
226 u32 pdev_set_quiet_mode_cmdid;
227 u32 pdev_green_ap_ps_enable_cmdid;
228 u32 pdev_get_tpc_config_cmdid;
229 u32 pdev_set_base_macaddr_cmdid;
230 u32 vdev_create_cmdid;
231 u32 vdev_delete_cmdid;
232 u32 vdev_start_request_cmdid;
233 u32 vdev_restart_request_cmdid;
234 u32 vdev_up_cmdid;
235 u32 vdev_stop_cmdid;
236 u32 vdev_down_cmdid;
237 u32 vdev_set_param_cmdid;
238 u32 vdev_install_key_cmdid;
239 u32 peer_create_cmdid;
240 u32 peer_delete_cmdid;
241 u32 peer_flush_tids_cmdid;
242 u32 peer_set_param_cmdid;
243 u32 peer_assoc_cmdid;
244 u32 peer_add_wds_entry_cmdid;
245 u32 peer_remove_wds_entry_cmdid;
246 u32 peer_mcast_group_cmdid;
247 u32 bcn_tx_cmdid;
248 u32 pdev_send_bcn_cmdid;
249 u32 bcn_tmpl_cmdid;
250 u32 bcn_filter_rx_cmdid;
251 u32 prb_req_filter_rx_cmdid;
252 u32 mgmt_tx_cmdid;
253 u32 prb_tmpl_cmdid;
254 u32 addba_clear_resp_cmdid;
255 u32 addba_send_cmdid;
256 u32 addba_status_cmdid;
257 u32 delba_send_cmdid;
258 u32 addba_set_resp_cmdid;
259 u32 send_singleamsdu_cmdid;
260 u32 sta_powersave_mode_cmdid;
261 u32 sta_powersave_param_cmdid;
262 u32 sta_mimo_ps_mode_cmdid;
263 u32 pdev_dfs_enable_cmdid;
264 u32 pdev_dfs_disable_cmdid;
265 u32 roam_scan_mode;
266 u32 roam_scan_rssi_threshold;
267 u32 roam_scan_period;
268 u32 roam_scan_rssi_change_threshold;
269 u32 roam_ap_profile;
270 u32 ofl_scan_add_ap_profile;
271 u32 ofl_scan_remove_ap_profile;
272 u32 ofl_scan_period;
273 u32 p2p_dev_set_device_info;
274 u32 p2p_dev_set_discoverability;
275 u32 p2p_go_set_beacon_ie;
276 u32 p2p_go_set_probe_resp_ie;
277 u32 p2p_set_vendor_ie_data_cmdid;
278 u32 ap_ps_peer_param_cmdid;
279 u32 ap_ps_peer_uapsd_coex_cmdid;
280 u32 peer_rate_retry_sched_cmdid;
281 u32 wlan_profile_trigger_cmdid;
282 u32 wlan_profile_set_hist_intvl_cmdid;
283 u32 wlan_profile_get_profile_data_cmdid;
284 u32 wlan_profile_enable_profile_id_cmdid;
285 u32 wlan_profile_list_profile_id_cmdid;
286 u32 pdev_suspend_cmdid;
287 u32 pdev_resume_cmdid;
288 u32 add_bcn_filter_cmdid;
289 u32 rmv_bcn_filter_cmdid;
290 u32 wow_add_wake_pattern_cmdid;
291 u32 wow_del_wake_pattern_cmdid;
292 u32 wow_enable_disable_wake_event_cmdid;
293 u32 wow_enable_cmdid;
294 u32 wow_hostwakeup_from_sleep_cmdid;
295 u32 rtt_measreq_cmdid;
296 u32 rtt_tsf_cmdid;
297 u32 vdev_spectral_scan_configure_cmdid;
298 u32 vdev_spectral_scan_enable_cmdid;
299 u32 request_stats_cmdid;
300 u32 set_arp_ns_offload_cmdid;
301 u32 network_list_offload_config_cmdid;
302 u32 gtk_offload_cmdid;
303 u32 csa_offload_enable_cmdid;
304 u32 csa_offload_chanswitch_cmdid;
305 u32 chatter_set_mode_cmdid;
306 u32 peer_tid_addba_cmdid;
307 u32 peer_tid_delba_cmdid;
308 u32 sta_dtim_ps_method_cmdid;
309 u32 sta_uapsd_auto_trig_cmdid;
310 u32 sta_keepalive_cmd;
311 u32 echo_cmdid;
312 u32 pdev_utf_cmdid;
313 u32 dbglog_cfg_cmdid;
314 u32 pdev_qvit_cmdid;
315 u32 pdev_ftm_intg_cmdid;
316 u32 vdev_set_keepalive_cmdid;
317 u32 vdev_get_keepalive_cmdid;
318 u32 force_fw_hang_cmdid;
319 u32 gpio_config_cmdid;
320 u32 gpio_output_cmdid;
321};
322
5e3dd157
KV
323/*
324 * wmi command groups.
325 */
326enum wmi_cmd_group {
327 /* 0 to 2 are reserved */
328 WMI_GRP_START = 0x3,
329 WMI_GRP_SCAN = WMI_GRP_START,
330 WMI_GRP_PDEV,
331 WMI_GRP_VDEV,
332 WMI_GRP_PEER,
333 WMI_GRP_MGMT,
334 WMI_GRP_BA_NEG,
335 WMI_GRP_STA_PS,
336 WMI_GRP_DFS,
337 WMI_GRP_ROAM,
338 WMI_GRP_OFL_SCAN,
339 WMI_GRP_P2P,
340 WMI_GRP_AP_PS,
341 WMI_GRP_RATE_CTRL,
342 WMI_GRP_PROFILE,
343 WMI_GRP_SUSPEND,
344 WMI_GRP_BCN_FILTER,
345 WMI_GRP_WOW,
346 WMI_GRP_RTT,
347 WMI_GRP_SPECTRAL,
348 WMI_GRP_STATS,
349 WMI_GRP_ARP_NS_OFL,
350 WMI_GRP_NLO_OFL,
351 WMI_GRP_GTK_OFL,
352 WMI_GRP_CSA_OFL,
353 WMI_GRP_CHATTER,
354 WMI_GRP_TID_ADDBA,
355 WMI_GRP_MISC,
356 WMI_GRP_GPIO,
357};
358
359#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
360#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
361
34957b25 362#define WMI_CMD_UNSUPPORTED 0
b7e3adf9
BM
363
364/* Command IDs and command events for MAIN FW. */
5e3dd157
KV
365enum wmi_cmd_id {
366 WMI_INIT_CMDID = 0x1,
367
368 /* Scan specific commands */
369 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
370 WMI_STOP_SCAN_CMDID,
371 WMI_SCAN_CHAN_LIST_CMDID,
372 WMI_SCAN_SCH_PRIO_TBL_CMDID,
373
374 /* PDEV (physical device) specific commands */
375 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
376 WMI_PDEV_SET_CHANNEL_CMDID,
377 WMI_PDEV_SET_PARAM_CMDID,
378 WMI_PDEV_PKTLOG_ENABLE_CMDID,
379 WMI_PDEV_PKTLOG_DISABLE_CMDID,
380 WMI_PDEV_SET_WMM_PARAMS_CMDID,
381 WMI_PDEV_SET_HT_CAP_IE_CMDID,
382 WMI_PDEV_SET_VHT_CAP_IE_CMDID,
383 WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
384 WMI_PDEV_SET_QUIET_MODE_CMDID,
385 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
386 WMI_PDEV_GET_TPC_CONFIG_CMDID,
387 WMI_PDEV_SET_BASE_MACADDR_CMDID,
388
389 /* VDEV (virtual device) specific commands */
390 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
391 WMI_VDEV_DELETE_CMDID,
392 WMI_VDEV_START_REQUEST_CMDID,
393 WMI_VDEV_RESTART_REQUEST_CMDID,
394 WMI_VDEV_UP_CMDID,
395 WMI_VDEV_STOP_CMDID,
396 WMI_VDEV_DOWN_CMDID,
397 WMI_VDEV_SET_PARAM_CMDID,
398 WMI_VDEV_INSTALL_KEY_CMDID,
399
400 /* peer specific commands */
401 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
402 WMI_PEER_DELETE_CMDID,
403 WMI_PEER_FLUSH_TIDS_CMDID,
404 WMI_PEER_SET_PARAM_CMDID,
405 WMI_PEER_ASSOC_CMDID,
406 WMI_PEER_ADD_WDS_ENTRY_CMDID,
407 WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
408 WMI_PEER_MCAST_GROUP_CMDID,
409
410 /* beacon/management specific commands */
411 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
412 WMI_PDEV_SEND_BCN_CMDID,
413 WMI_BCN_TMPL_CMDID,
414 WMI_BCN_FILTER_RX_CMDID,
415 WMI_PRB_REQ_FILTER_RX_CMDID,
416 WMI_MGMT_TX_CMDID,
417 WMI_PRB_TMPL_CMDID,
418
419 /* commands to directly control BA negotiation directly from host. */
420 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
421 WMI_ADDBA_SEND_CMDID,
422 WMI_ADDBA_STATUS_CMDID,
423 WMI_DELBA_SEND_CMDID,
424 WMI_ADDBA_SET_RESP_CMDID,
425 WMI_SEND_SINGLEAMSDU_CMDID,
426
427 /* Station power save specific config */
428 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
429 WMI_STA_POWERSAVE_PARAM_CMDID,
430 WMI_STA_MIMO_PS_MODE_CMDID,
431
432 /** DFS-specific commands */
433 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
434 WMI_PDEV_DFS_DISABLE_CMDID,
435
436 /* Roaming specific commands */
437 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
438 WMI_ROAM_SCAN_RSSI_THRESHOLD,
439 WMI_ROAM_SCAN_PERIOD,
440 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
441 WMI_ROAM_AP_PROFILE,
442
443 /* offload scan specific commands */
444 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
445 WMI_OFL_SCAN_REMOVE_AP_PROFILE,
446 WMI_OFL_SCAN_PERIOD,
447
448 /* P2P specific commands */
449 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
450 WMI_P2P_DEV_SET_DISCOVERABILITY,
451 WMI_P2P_GO_SET_BEACON_IE,
452 WMI_P2P_GO_SET_PROBE_RESP_IE,
453 WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
454
455 /* AP power save specific config */
456 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
457 WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
458
459 /* Rate-control specific commands */
460 WMI_PEER_RATE_RETRY_SCHED_CMDID =
461 WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
462
463 /* WLAN Profiling commands. */
464 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
465 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
466 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
467 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
468 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
469
470 /* Suspend resume command Ids */
471 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
472 WMI_PDEV_RESUME_CMDID,
473
474 /* Beacon filter commands */
475 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
476 WMI_RMV_BCN_FILTER_CMDID,
477
478 /* WOW Specific WMI commands*/
479 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
480 WMI_WOW_DEL_WAKE_PATTERN_CMDID,
481 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
482 WMI_WOW_ENABLE_CMDID,
483 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
484
485 /* RTT measurement related cmd */
486 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
487 WMI_RTT_TSF_CMDID,
488
489 /* spectral scan commands */
490 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
491 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
492
493 /* F/W stats */
494 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
495
496 /* ARP OFFLOAD REQUEST*/
497 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
498
499 /* NS offload confid*/
500 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
501
502 /* GTK offload Specific WMI commands*/
503 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
504
505 /* CSA offload Specific WMI commands*/
506 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
507 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
508
509 /* Chatter commands*/
510 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
511
512 /* addba specific commands */
513 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
514 WMI_PEER_TID_DELBA_CMDID,
515
516 /* set station mimo powersave method */
517 WMI_STA_DTIM_PS_METHOD_CMDID,
518 /* Configure the Station UAPSD AC Auto Trigger Parameters */
519 WMI_STA_UAPSD_AUTO_TRIG_CMDID,
520
521 /* STA Keep alive parameter configuration,
522 Requires WMI_SERVICE_STA_KEEP_ALIVE */
523 WMI_STA_KEEPALIVE_CMD,
524
525 /* misc command group */
526 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
527 WMI_PDEV_UTF_CMDID,
528 WMI_DBGLOG_CFG_CMDID,
529 WMI_PDEV_QVIT_CMDID,
530 WMI_PDEV_FTM_INTG_CMDID,
531 WMI_VDEV_SET_KEEPALIVE_CMDID,
532 WMI_VDEV_GET_KEEPALIVE_CMDID,
9cfbce75 533 WMI_FORCE_FW_HANG_CMDID,
5e3dd157
KV
534
535 /* GPIO Configuration */
536 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
537 WMI_GPIO_OUTPUT_CMDID,
538};
539
540enum wmi_event_id {
541 WMI_SERVICE_READY_EVENTID = 0x1,
542 WMI_READY_EVENTID,
543
544 /* Scan specific events */
545 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
546
547 /* PDEV specific events */
548 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
549 WMI_CHAN_INFO_EVENTID,
550 WMI_PHYERR_EVENTID,
551
552 /* VDEV specific events */
553 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
554 WMI_VDEV_STOPPED_EVENTID,
555 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
556
557 /* peer specific events */
558 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
559
560 /* beacon/mgmt specific events */
561 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
562 WMI_HOST_SWBA_EVENTID,
563 WMI_TBTTOFFSET_UPDATE_EVENTID,
564
565 /* ADDBA Related WMI Events*/
566 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
567 WMI_TX_ADDBA_COMPLETE_EVENTID,
568
569 /* Roam event to trigger roaming on host */
570 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
571 WMI_PROFILE_MATCH,
572
573 /* WoW */
574 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
575
576 /* RTT */
577 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
578 WMI_TSF_MEASUREMENT_REPORT_EVENTID,
579 WMI_RTT_ERROR_REPORT_EVENTID,
580
581 /* GTK offload */
582 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
583 WMI_GTK_REKEY_FAIL_EVENTID,
584
585 /* CSA IE received event */
586 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
587
588 /* Misc events */
589 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
590 WMI_PDEV_UTF_EVENTID,
591 WMI_DEBUG_MESG_EVENTID,
592 WMI_UPDATE_STATS_EVENTID,
593 WMI_DEBUG_PRINT_EVENTID,
594 WMI_DCS_INTERFERENCE_EVENTID,
595 WMI_PDEV_QVIT_EVENTID,
596 WMI_WLAN_PROFILE_DATA_EVENTID,
597 WMI_PDEV_FTM_INTG_EVENTID,
598 WMI_WLAN_FREQ_AVOID_EVENTID,
599 WMI_VDEV_GET_KEEPALIVE_EVENTID,
600
601 /* GPIO Event */
602 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
603};
604
b7e3adf9
BM
605/* Command IDs and command events for 10.X firmware */
606enum wmi_10x_cmd_id {
607 WMI_10X_START_CMDID = 0x9000,
608 WMI_10X_END_CMDID = 0x9FFF,
609
610 /* initialize the wlan sub system */
611 WMI_10X_INIT_CMDID,
612
613 /* Scan specific commands */
614
615 WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
616 WMI_10X_STOP_SCAN_CMDID,
617 WMI_10X_SCAN_CHAN_LIST_CMDID,
618 WMI_10X_ECHO_CMDID,
619
620 /* PDEV(physical device) specific commands */
621 WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
622 WMI_10X_PDEV_SET_CHANNEL_CMDID,
623 WMI_10X_PDEV_SET_PARAM_CMDID,
624 WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
625 WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
626 WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
627 WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
628 WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
629 WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
630 WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
631 WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
632 WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
633 WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
634
635 /* VDEV(virtual device) specific commands */
636 WMI_10X_VDEV_CREATE_CMDID,
637 WMI_10X_VDEV_DELETE_CMDID,
638 WMI_10X_VDEV_START_REQUEST_CMDID,
639 WMI_10X_VDEV_RESTART_REQUEST_CMDID,
640 WMI_10X_VDEV_UP_CMDID,
641 WMI_10X_VDEV_STOP_CMDID,
642 WMI_10X_VDEV_DOWN_CMDID,
643 WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
644 WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
645 WMI_10X_VDEV_SET_PARAM_CMDID,
646 WMI_10X_VDEV_INSTALL_KEY_CMDID,
647
648 /* peer specific commands */
649 WMI_10X_PEER_CREATE_CMDID,
650 WMI_10X_PEER_DELETE_CMDID,
651 WMI_10X_PEER_FLUSH_TIDS_CMDID,
652 WMI_10X_PEER_SET_PARAM_CMDID,
653 WMI_10X_PEER_ASSOC_CMDID,
654 WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
655 WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
656 WMI_10X_PEER_MCAST_GROUP_CMDID,
657
658 /* beacon/management specific commands */
659
660 WMI_10X_BCN_TX_CMDID,
661 WMI_10X_BCN_PRB_TMPL_CMDID,
662 WMI_10X_BCN_FILTER_RX_CMDID,
663 WMI_10X_PRB_REQ_FILTER_RX_CMDID,
664 WMI_10X_MGMT_TX_CMDID,
665
666 /* commands to directly control ba negotiation directly from host. */
667 WMI_10X_ADDBA_CLEAR_RESP_CMDID,
668 WMI_10X_ADDBA_SEND_CMDID,
669 WMI_10X_ADDBA_STATUS_CMDID,
670 WMI_10X_DELBA_SEND_CMDID,
671 WMI_10X_ADDBA_SET_RESP_CMDID,
672 WMI_10X_SEND_SINGLEAMSDU_CMDID,
673
674 /* Station power save specific config */
675 WMI_10X_STA_POWERSAVE_MODE_CMDID,
676 WMI_10X_STA_POWERSAVE_PARAM_CMDID,
677 WMI_10X_STA_MIMO_PS_MODE_CMDID,
678
679 /* set debug log config */
680 WMI_10X_DBGLOG_CFG_CMDID,
681
682 /* DFS-specific commands */
683 WMI_10X_PDEV_DFS_ENABLE_CMDID,
684 WMI_10X_PDEV_DFS_DISABLE_CMDID,
685
686 /* QVIT specific command id */
687 WMI_10X_PDEV_QVIT_CMDID,
688
689 /* Offload Scan and Roaming related commands */
690 WMI_10X_ROAM_SCAN_MODE,
691 WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
692 WMI_10X_ROAM_SCAN_PERIOD,
693 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
694 WMI_10X_ROAM_AP_PROFILE,
695 WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
696 WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
697 WMI_10X_OFL_SCAN_PERIOD,
698
699 /* P2P specific commands */
700 WMI_10X_P2P_DEV_SET_DEVICE_INFO,
701 WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
702 WMI_10X_P2P_GO_SET_BEACON_IE,
703 WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
704
705 /* AP power save specific config */
706 WMI_10X_AP_PS_PEER_PARAM_CMDID,
707 WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
708
709 /* Rate-control specific commands */
710 WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
711
712 /* WLAN Profiling commands. */
713 WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
714 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
715 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
716 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
717 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
718
719 /* Suspend resume command Ids */
720 WMI_10X_PDEV_SUSPEND_CMDID,
721 WMI_10X_PDEV_RESUME_CMDID,
722
723 /* Beacon filter commands */
724 WMI_10X_ADD_BCN_FILTER_CMDID,
725 WMI_10X_RMV_BCN_FILTER_CMDID,
726
727 /* WOW Specific WMI commands*/
728 WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
729 WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
730 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
731 WMI_10X_WOW_ENABLE_CMDID,
732 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
733
734 /* RTT measurement related cmd */
735 WMI_10X_RTT_MEASREQ_CMDID,
736 WMI_10X_RTT_TSF_CMDID,
737
738 /* transmit beacon by value */
739 WMI_10X_PDEV_SEND_BCN_CMDID,
740
741 /* F/W stats */
742 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
743 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
744 WMI_10X_REQUEST_STATS_CMDID,
745
746 /* GPIO Configuration */
747 WMI_10X_GPIO_CONFIG_CMDID,
748 WMI_10X_GPIO_OUTPUT_CMDID,
749
750 WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
751};
752
753enum wmi_10x_event_id {
754 WMI_10X_SERVICE_READY_EVENTID = 0x8000,
755 WMI_10X_READY_EVENTID,
756 WMI_10X_START_EVENTID = 0x9000,
757 WMI_10X_END_EVENTID = 0x9FFF,
758
759 /* Scan specific events */
760 WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
761 WMI_10X_ECHO_EVENTID,
762 WMI_10X_DEBUG_MESG_EVENTID,
763 WMI_10X_UPDATE_STATS_EVENTID,
764
765 /* Instantaneous RSSI event */
766 WMI_10X_INST_RSSI_STATS_EVENTID,
767
768 /* VDEV specific events */
769 WMI_10X_VDEV_START_RESP_EVENTID,
770 WMI_10X_VDEV_STANDBY_REQ_EVENTID,
771 WMI_10X_VDEV_RESUME_REQ_EVENTID,
772 WMI_10X_VDEV_STOPPED_EVENTID,
773
774 /* peer specific events */
775 WMI_10X_PEER_STA_KICKOUT_EVENTID,
776
777 /* beacon/mgmt specific events */
778 WMI_10X_HOST_SWBA_EVENTID,
779 WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
780 WMI_10X_MGMT_RX_EVENTID,
781
782 /* Channel stats event */
783 WMI_10X_CHAN_INFO_EVENTID,
784
785 /* PHY Error specific WMI event */
786 WMI_10X_PHYERR_EVENTID,
787
788 /* Roam event to trigger roaming on host */
789 WMI_10X_ROAM_EVENTID,
790
791 /* matching AP found from list of profiles */
792 WMI_10X_PROFILE_MATCH,
793
794 /* debug print message used for tracing FW code while debugging */
795 WMI_10X_DEBUG_PRINT_EVENTID,
796 /* VI spoecific event */
797 WMI_10X_PDEV_QVIT_EVENTID,
798 /* FW code profile data in response to profile request */
799 WMI_10X_WLAN_PROFILE_DATA_EVENTID,
800
801 /*RTT related event ID*/
802 WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
803 WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
804 WMI_10X_RTT_ERROR_REPORT_EVENTID,
805
806 WMI_10X_WOW_WAKEUP_HOST_EVENTID,
807 WMI_10X_DCS_INTERFERENCE_EVENTID,
808
809 /* TPC config for the current operating channel */
810 WMI_10X_PDEV_TPC_CONFIG_EVENTID,
811
812 WMI_10X_GPIO_INPUT_EVENTID,
813 WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
814};
815
5e3dd157
KV
816enum wmi_phy_mode {
817 MODE_11A = 0, /* 11a Mode */
818 MODE_11G = 1, /* 11b/g Mode */
819 MODE_11B = 2, /* 11b Mode */
820 MODE_11GONLY = 3, /* 11g only Mode */
821 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
822 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
823 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
824 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
825 MODE_11AC_VHT20 = 8,
826 MODE_11AC_VHT40 = 9,
827 MODE_11AC_VHT80 = 10,
828 /* MODE_11AC_VHT160 = 11, */
829 MODE_11AC_VHT20_2G = 11,
830 MODE_11AC_VHT40_2G = 12,
831 MODE_11AC_VHT80_2G = 13,
832 MODE_UNKNOWN = 14,
833 MODE_MAX = 14
834};
835
38a1d47e
KV
836static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
837{
838 switch (mode) {
839 case MODE_11A:
840 return "11a";
841 case MODE_11G:
842 return "11g";
843 case MODE_11B:
844 return "11b";
845 case MODE_11GONLY:
846 return "11gonly";
847 case MODE_11NA_HT20:
848 return "11na-ht20";
849 case MODE_11NG_HT20:
850 return "11ng-ht20";
851 case MODE_11NA_HT40:
852 return "11na-ht40";
853 case MODE_11NG_HT40:
854 return "11ng-ht40";
855 case MODE_11AC_VHT20:
856 return "11ac-vht20";
857 case MODE_11AC_VHT40:
858 return "11ac-vht40";
859 case MODE_11AC_VHT80:
860 return "11ac-vht80";
861 case MODE_11AC_VHT20_2G:
862 return "11ac-vht20-2g";
863 case MODE_11AC_VHT40_2G:
864 return "11ac-vht40-2g";
865 case MODE_11AC_VHT80_2G:
866 return "11ac-vht80-2g";
867 case MODE_UNKNOWN:
868 /* skip */
869 break;
870
871 /* no default handler to allow compiler to check that the
872 * enum is fully handled */
873 };
874
875 return "<unknown>";
876}
877
5e3dd157
KV
878#define WMI_CHAN_LIST_TAG 0x1
879#define WMI_SSID_LIST_TAG 0x2
880#define WMI_BSSID_LIST_TAG 0x3
881#define WMI_IE_TAG 0x4
882
883struct wmi_channel {
884 __le32 mhz;
885 __le32 band_center_freq1;
886 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
887 union {
888 __le32 flags; /* WMI_CHAN_FLAG_ */
889 struct {
890 u8 mode; /* only 6 LSBs */
891 } __packed;
892 } __packed;
893 union {
894 __le32 reginfo0;
895 struct {
02256930 896 /* note: power unit is 0.5 dBm */
5e3dd157
KV
897 u8 min_power;
898 u8 max_power;
899 u8 reg_power;
900 u8 reg_classid;
901 } __packed;
902 } __packed;
903 union {
904 __le32 reginfo1;
905 struct {
906 u8 antenna_max;
907 } __packed;
908 } __packed;
909} __packed;
910
911struct wmi_channel_arg {
912 u32 freq;
913 u32 band_center_freq1;
914 bool passive;
915 bool allow_ibss;
916 bool allow_ht;
917 bool allow_vht;
918 bool ht40plus;
02256930 919 /* note: power unit is 0.5 dBm */
5e3dd157
KV
920 u32 min_power;
921 u32 max_power;
922 u32 max_reg_power;
923 u32 max_antenna_gain;
924 u32 reg_class_id;
925 enum wmi_phy_mode mode;
926};
927
928enum wmi_channel_change_cause {
929 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
930 WMI_CHANNEL_CHANGE_CAUSE_CSA,
931};
932
933#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
934#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
935#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
936#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
937#define WMI_CHAN_FLAG_DFS (1 << 10)
938#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
939#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
940
941/* Indicate reason for channel switch */
942#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
943
944#define WMI_MAX_SPATIAL_STREAM 3
945
946/* HT Capabilities*/
947#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
948#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
949#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
950#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
951#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
952#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
953#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
954#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
955#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
956#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
957#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
958#define WMI_HT_CAP_HT40_SGI 0x0800
959
960#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
961 WMI_HT_CAP_HT20_SGI | \
962 WMI_HT_CAP_HT40_SGI | \
963 WMI_HT_CAP_TX_STBC | \
964 WMI_HT_CAP_RX_STBC | \
965 WMI_HT_CAP_LDPC)
966
967
968/*
969 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
970 * field. The fields not defined here are not supported, or reserved.
971 * Do not change these masks and if you have to add new one follow the
972 * bitmask as specified by 802.11ac draft.
973 */
974
975#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
976#define WMI_VHT_CAP_RX_LDPC 0x00000010
977#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
978#define WMI_VHT_CAP_TX_STBC 0x00000080
979#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
980#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
981#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
982#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
983#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
984#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
985
986/* The following also refer for max HT AMSDU */
987#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
988#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
989#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
990
991#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
992 WMI_VHT_CAP_RX_LDPC | \
993 WMI_VHT_CAP_SGI_80MHZ | \
994 WMI_VHT_CAP_TX_STBC | \
995 WMI_VHT_CAP_RX_STBC_MASK | \
996 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
997 WMI_VHT_CAP_RX_FIXED_ANT | \
998 WMI_VHT_CAP_TX_FIXED_ANT)
999
1000/*
1001 * Interested readers refer to Rx/Tx MCS Map definition as defined in
1002 * 802.11ac
1003 */
1004#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
1005#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
1006#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
1007
1008enum {
1009 REGDMN_MODE_11A = 0x00001, /* 11a channels */
1010 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
1011 REGDMN_MODE_11B = 0x00004, /* 11b channels */
1012 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
1013 REGDMN_MODE_11G = 0x00008, /* XXX historical */
1014 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
1015 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
1016 REGDMN_MODE_XR = 0x00100, /* XR channels */
1017 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
1018 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
1019 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
1020 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
1021 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
1022 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
1023 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
1024 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
1025 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
1026 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
1027 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
1028 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
1029 REGDMN_MODE_ALL = 0xffffffff
1030};
1031
1032#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
1033#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
1034#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
1035
1036/* regulatory capabilities */
1037#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
1038#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
1039#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
1040#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
1041#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
1042#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
1043
1044struct hal_reg_capabilities {
1045 /* regdomain value specified in EEPROM */
1046 __le32 eeprom_rd;
1047 /*regdomain */
1048 __le32 eeprom_rd_ext;
1049 /* CAP1 capabilities bit map. */
1050 __le32 regcap1;
1051 /* REGDMN EEPROM CAP. */
1052 __le32 regcap2;
1053 /* REGDMN MODE */
1054 __le32 wireless_modes;
1055 __le32 low_2ghz_chan;
1056 __le32 high_2ghz_chan;
1057 __le32 low_5ghz_chan;
1058 __le32 high_5ghz_chan;
1059} __packed;
1060
1061enum wlan_mode_capability {
1062 WHAL_WLAN_11A_CAPABILITY = 0x1,
1063 WHAL_WLAN_11G_CAPABILITY = 0x2,
1064 WHAL_WLAN_11AG_CAPABILITY = 0x3,
1065};
1066
1067/* structure used by FW for requesting host memory */
1068struct wlan_host_mem_req {
1069 /* ID of the request */
1070 __le32 req_id;
1071 /* size of the of each unit */
1072 __le32 unit_size;
1073 /* flags to indicate that
1074 * the number units is dependent
1075 * on number of resources(num vdevs num peers .. etc)
1076 */
1077 __le32 num_unit_info;
1078 /*
1079 * actual number of units to allocate . if flags in the num_unit_info
1080 * indicate that number of units is tied to number of a particular
1081 * resource to allocate then num_units filed is set to 0 and host
1082 * will derive the number units from number of the resources it is
1083 * requesting.
1084 */
1085 __le32 num_units;
1086} __packed;
1087
1088#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
1089 ((((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
1090 (1 << ((svc_id)%(sizeof(u32))))) != 0)
1091
1092/*
1093 * The following struct holds optional payload for
1094 * wmi_service_ready_event,e.g., 11ac pass some of the
1095 * device capability to the host.
1096 */
1097struct wmi_service_ready_event {
1098 __le32 sw_version;
1099 __le32 sw_version_1;
1100 __le32 abi_version;
1101 /* WMI_PHY_CAPABILITY */
1102 __le32 phy_capability;
1103 /* Maximum number of frag table entries that SW will populate less 1 */
1104 __le32 max_frag_entry;
1105 __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1106 __le32 num_rf_chains;
1107 /*
1108 * The following field is only valid for service type
1109 * WMI_SERVICE_11AC
1110 */
1111 __le32 ht_cap_info; /* WMI HT Capability */
1112 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1113 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1114 __le32 hw_min_tx_power;
1115 __le32 hw_max_tx_power;
1116 struct hal_reg_capabilities hal_reg_capabilities;
1117 __le32 sys_cap_info;
1118 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1119 /*
1120 * Max beacon and Probe Response IE offload size
1121 * (includes optional P2P IEs)
1122 */
1123 __le32 max_bcn_ie_size;
1124 /*
1125 * request to host to allocate a chuck of memory and pss it down to FW
1126 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1127 * data structures. Only valid for low latency interfaces like PCIE
1128 * where FW can access this memory directly (or) by DMA.
1129 */
1130 __le32 num_mem_reqs;
1131 struct wlan_host_mem_req mem_reqs[1];
1132} __packed;
1133
6f97d256
BM
1134/* This is the definition from 10.X firmware branch */
1135struct wmi_service_ready_event_10x {
1136 __le32 sw_version;
1137 __le32 abi_version;
1138
1139 /* WMI_PHY_CAPABILITY */
1140 __le32 phy_capability;
1141
1142 /* Maximum number of frag table entries that SW will populate less 1 */
1143 __le32 max_frag_entry;
1144 __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1145 __le32 num_rf_chains;
1146
1147 /*
1148 * The following field is only valid for service type
1149 * WMI_SERVICE_11AC
1150 */
1151 __le32 ht_cap_info; /* WMI HT Capability */
1152 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1153 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1154 __le32 hw_min_tx_power;
1155 __le32 hw_max_tx_power;
1156
1157 struct hal_reg_capabilities hal_reg_capabilities;
1158
1159 __le32 sys_cap_info;
1160 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1161
1162 /*
1163 * request to host to allocate a chuck of memory and pss it down to FW
1164 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1165 * data structures. Only valid for low latency interfaces like PCIE
1166 * where FW can access this memory directly (or) by DMA.
1167 */
1168 __le32 num_mem_reqs;
1169
1170 struct wlan_host_mem_req mem_reqs[1];
1171} __packed;
1172
1173
5e3dd157
KV
1174#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
1175#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
1176
1177struct wmi_ready_event {
1178 __le32 sw_version;
1179 __le32 abi_version;
1180 struct wmi_mac_addr mac_addr;
1181 __le32 status;
1182} __packed;
1183
1184struct wmi_resource_config {
1185 /* number of virtual devices (VAPs) to support */
1186 __le32 num_vdevs;
1187
1188 /* number of peer nodes to support */
1189 __le32 num_peers;
1190
1191 /*
1192 * In offload mode target supports features like WOW, chatter and
1193 * other protocol offloads. In order to support them some
1194 * functionalities like reorder buffering, PN checking need to be
1195 * done in target. This determines maximum number of peers suported
1196 * by target in offload mode
1197 */
1198 __le32 num_offload_peers;
1199
1200 /* For target-based RX reordering */
1201 __le32 num_offload_reorder_bufs;
1202
1203 /* number of keys per peer */
1204 __le32 num_peer_keys;
1205
1206 /* total number of TX/RX data TIDs */
1207 __le32 num_tids;
1208
1209 /*
1210 * max skid for resolving hash collisions
1211 *
1212 * The address search table is sparse, so that if two MAC addresses
1213 * result in the same hash value, the second of these conflicting
1214 * entries can slide to the next index in the address search table,
1215 * and use it, if it is unoccupied. This ast_skid_limit parameter
1216 * specifies the upper bound on how many subsequent indices to search
1217 * over to find an unoccupied space.
1218 */
1219 __le32 ast_skid_limit;
1220
1221 /*
1222 * the nominal chain mask for transmit
1223 *
1224 * The chain mask may be modified dynamically, e.g. to operate AP
1225 * tx with a reduced number of chains if no clients are associated.
1226 * This configuration parameter specifies the nominal chain-mask that
1227 * should be used when not operating with a reduced set of tx chains.
1228 */
1229 __le32 tx_chain_mask;
1230
1231 /*
1232 * the nominal chain mask for receive
1233 *
1234 * The chain mask may be modified dynamically, e.g. for a client
1235 * to use a reduced number of chains for receive if the traffic to
1236 * the client is low enough that it doesn't require downlink MIMO
1237 * or antenna diversity.
1238 * This configuration parameter specifies the nominal chain-mask that
1239 * should be used when not operating with a reduced set of rx chains.
1240 */
1241 __le32 rx_chain_mask;
1242
1243 /*
1244 * what rx reorder timeout (ms) to use for the AC
1245 *
1246 * Each WMM access class (voice, video, best-effort, background) will
1247 * have its own timeout value to dictate how long to wait for missing
1248 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1249 * already been received.
1250 * This parameter specifies the timeout in milliseconds for each
1251 * class.
1252 */
1253 __le32 rx_timeout_pri_vi;
1254 __le32 rx_timeout_pri_vo;
1255 __le32 rx_timeout_pri_be;
1256 __le32 rx_timeout_pri_bk;
1257
1258 /*
1259 * what mode the rx should decap packets to
1260 *
1261 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1262 * THis setting also determines the default TX behavior, however TX
1263 * behavior can be modified on a per VAP basis during VAP init
1264 */
1265 __le32 rx_decap_mode;
1266
1267 /* what is the maximum scan requests than can be queued */
1268 __le32 scan_max_pending_reqs;
1269
1270 /* maximum VDEV that could use BMISS offload */
1271 __le32 bmiss_offload_max_vdev;
1272
1273 /* maximum VDEV that could use offload roaming */
1274 __le32 roam_offload_max_vdev;
1275
1276 /* maximum AP profiles that would push to offload roaming */
1277 __le32 roam_offload_max_ap_profiles;
1278
1279 /*
1280 * how many groups to use for mcast->ucast conversion
1281 *
1282 * The target's WAL maintains a table to hold information regarding
1283 * which peers belong to a given multicast group, so that if
1284 * multicast->unicast conversion is enabled, the target can convert
1285 * multicast tx frames to a series of unicast tx frames, to each
1286 * peer within the multicast group.
1287 This num_mcast_groups configuration parameter tells the target how
1288 * many multicast groups to provide storage for within its multicast
1289 * group membership table.
1290 */
1291 __le32 num_mcast_groups;
1292
1293 /*
1294 * size to alloc for the mcast membership table
1295 *
1296 * This num_mcast_table_elems configuration parameter tells the
1297 * target how many peer elements it needs to provide storage for in
1298 * its multicast group membership table.
1299 * These multicast group membership table elements are shared by the
1300 * multicast groups stored within the table.
1301 */
1302 __le32 num_mcast_table_elems;
1303
1304 /*
1305 * whether/how to do multicast->unicast conversion
1306 *
1307 * This configuration parameter specifies whether the target should
1308 * perform multicast --> unicast conversion on transmit, and if so,
1309 * what to do if it finds no entries in its multicast group
1310 * membership table for the multicast IP address in the tx frame.
1311 * Configuration value:
1312 * 0 -> Do not perform multicast to unicast conversion.
1313 * 1 -> Convert multicast frames to unicast, if the IP multicast
1314 * address from the tx frame is found in the multicast group
1315 * membership table. If the IP multicast address is not found,
1316 * drop the frame.
1317 * 2 -> Convert multicast frames to unicast, if the IP multicast
1318 * address from the tx frame is found in the multicast group
1319 * membership table. If the IP multicast address is not found,
1320 * transmit the frame as multicast.
1321 */
1322 __le32 mcast2ucast_mode;
1323
1324 /*
1325 * how much memory to allocate for a tx PPDU dbg log
1326 *
1327 * This parameter controls how much memory the target will allocate
1328 * to store a log of tx PPDU meta-information (how large the PPDU
1329 * was, when it was sent, whether it was successful, etc.)
1330 */
1331 __le32 tx_dbg_log_size;
1332
1333 /* how many AST entries to be allocated for WDS */
1334 __le32 num_wds_entries;
1335
1336 /*
1337 * MAC DMA burst size, e.g., For target PCI limit can be
1338 * 0 -default, 1 256B
1339 */
1340 __le32 dma_burst_size;
1341
1342 /*
1343 * Fixed delimiters to be inserted after every MPDU to
1344 * account for interface latency to avoid underrun.
1345 */
1346 __le32 mac_aggr_delim;
1347
1348 /*
1349 * determine whether target is responsible for detecting duplicate
1350 * non-aggregate MPDU and timing out stale fragments.
1351 *
1352 * A-MPDU reordering is always performed on the target.
1353 *
1354 * 0: target responsible for frag timeout and dup checking
1355 * 1: host responsible for frag timeout and dup checking
1356 */
1357 __le32 rx_skip_defrag_timeout_dup_detection_check;
1358
1359 /*
1360 * Configuration for VoW :
1361 * No of Video Nodes to be supported
1362 * and Max no of descriptors for each Video link (node).
1363 */
1364 __le32 vow_config;
1365
1366 /* maximum VDEV that could use GTK offload */
1367 __le32 gtk_offload_max_vdev;
1368
1369 /* Number of msdu descriptors target should use */
1370 __le32 num_msdu_desc;
1371
1372 /*
1373 * Max. number of Tx fragments per MSDU
1374 * This parameter controls the max number of Tx fragments per MSDU.
1375 * This is sent by the target as part of the WMI_SERVICE_READY event
1376 * and is overriden by the OS shim as required.
1377 */
1378 __le32 max_frag_entries;
1379} __packed;
1380
12b2b9e3
BM
1381struct wmi_resource_config_10x {
1382 /* number of virtual devices (VAPs) to support */
1383 __le32 num_vdevs;
1384
1385 /* number of peer nodes to support */
1386 __le32 num_peers;
1387
1388 /* number of keys per peer */
1389 __le32 num_peer_keys;
1390
1391 /* total number of TX/RX data TIDs */
1392 __le32 num_tids;
1393
1394 /*
1395 * max skid for resolving hash collisions
1396 *
1397 * The address search table is sparse, so that if two MAC addresses
1398 * result in the same hash value, the second of these conflicting
1399 * entries can slide to the next index in the address search table,
1400 * and use it, if it is unoccupied. This ast_skid_limit parameter
1401 * specifies the upper bound on how many subsequent indices to search
1402 * over to find an unoccupied space.
1403 */
1404 __le32 ast_skid_limit;
1405
1406 /*
1407 * the nominal chain mask for transmit
1408 *
1409 * The chain mask may be modified dynamically, e.g. to operate AP
1410 * tx with a reduced number of chains if no clients are associated.
1411 * This configuration parameter specifies the nominal chain-mask that
1412 * should be used when not operating with a reduced set of tx chains.
1413 */
1414 __le32 tx_chain_mask;
1415
1416 /*
1417 * the nominal chain mask for receive
1418 *
1419 * The chain mask may be modified dynamically, e.g. for a client
1420 * to use a reduced number of chains for receive if the traffic to
1421 * the client is low enough that it doesn't require downlink MIMO
1422 * or antenna diversity.
1423 * This configuration parameter specifies the nominal chain-mask that
1424 * should be used when not operating with a reduced set of rx chains.
1425 */
1426 __le32 rx_chain_mask;
1427
1428 /*
1429 * what rx reorder timeout (ms) to use for the AC
1430 *
1431 * Each WMM access class (voice, video, best-effort, background) will
1432 * have its own timeout value to dictate how long to wait for missing
1433 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1434 * already been received.
1435 * This parameter specifies the timeout in milliseconds for each
1436 * class.
1437 */
1438 __le32 rx_timeout_pri_vi;
1439 __le32 rx_timeout_pri_vo;
1440 __le32 rx_timeout_pri_be;
1441 __le32 rx_timeout_pri_bk;
1442
1443 /*
1444 * what mode the rx should decap packets to
1445 *
1446 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1447 * THis setting also determines the default TX behavior, however TX
1448 * behavior can be modified on a per VAP basis during VAP init
1449 */
1450 __le32 rx_decap_mode;
1451
1452 /* what is the maximum scan requests than can be queued */
1453 __le32 scan_max_pending_reqs;
1454
1455 /* maximum VDEV that could use BMISS offload */
1456 __le32 bmiss_offload_max_vdev;
1457
1458 /* maximum VDEV that could use offload roaming */
1459 __le32 roam_offload_max_vdev;
1460
1461 /* maximum AP profiles that would push to offload roaming */
1462 __le32 roam_offload_max_ap_profiles;
1463
1464 /*
1465 * how many groups to use for mcast->ucast conversion
1466 *
1467 * The target's WAL maintains a table to hold information regarding
1468 * which peers belong to a given multicast group, so that if
1469 * multicast->unicast conversion is enabled, the target can convert
1470 * multicast tx frames to a series of unicast tx frames, to each
1471 * peer within the multicast group.
1472 This num_mcast_groups configuration parameter tells the target how
1473 * many multicast groups to provide storage for within its multicast
1474 * group membership table.
1475 */
1476 __le32 num_mcast_groups;
1477
1478 /*
1479 * size to alloc for the mcast membership table
1480 *
1481 * This num_mcast_table_elems configuration parameter tells the
1482 * target how many peer elements it needs to provide storage for in
1483 * its multicast group membership table.
1484 * These multicast group membership table elements are shared by the
1485 * multicast groups stored within the table.
1486 */
1487 __le32 num_mcast_table_elems;
1488
1489 /*
1490 * whether/how to do multicast->unicast conversion
1491 *
1492 * This configuration parameter specifies whether the target should
1493 * perform multicast --> unicast conversion on transmit, and if so,
1494 * what to do if it finds no entries in its multicast group
1495 * membership table for the multicast IP address in the tx frame.
1496 * Configuration value:
1497 * 0 -> Do not perform multicast to unicast conversion.
1498 * 1 -> Convert multicast frames to unicast, if the IP multicast
1499 * address from the tx frame is found in the multicast group
1500 * membership table. If the IP multicast address is not found,
1501 * drop the frame.
1502 * 2 -> Convert multicast frames to unicast, if the IP multicast
1503 * address from the tx frame is found in the multicast group
1504 * membership table. If the IP multicast address is not found,
1505 * transmit the frame as multicast.
1506 */
1507 __le32 mcast2ucast_mode;
1508
1509 /*
1510 * how much memory to allocate for a tx PPDU dbg log
1511 *
1512 * This parameter controls how much memory the target will allocate
1513 * to store a log of tx PPDU meta-information (how large the PPDU
1514 * was, when it was sent, whether it was successful, etc.)
1515 */
1516 __le32 tx_dbg_log_size;
1517
1518 /* how many AST entries to be allocated for WDS */
1519 __le32 num_wds_entries;
1520
1521 /*
1522 * MAC DMA burst size, e.g., For target PCI limit can be
1523 * 0 -default, 1 256B
1524 */
1525 __le32 dma_burst_size;
1526
1527 /*
1528 * Fixed delimiters to be inserted after every MPDU to
1529 * account for interface latency to avoid underrun.
1530 */
1531 __le32 mac_aggr_delim;
1532
1533 /*
1534 * determine whether target is responsible for detecting duplicate
1535 * non-aggregate MPDU and timing out stale fragments.
1536 *
1537 * A-MPDU reordering is always performed on the target.
1538 *
1539 * 0: target responsible for frag timeout and dup checking
1540 * 1: host responsible for frag timeout and dup checking
1541 */
1542 __le32 rx_skip_defrag_timeout_dup_detection_check;
1543
1544 /*
1545 * Configuration for VoW :
1546 * No of Video Nodes to be supported
1547 * and Max no of descriptors for each Video link (node).
1548 */
1549 __le32 vow_config;
1550
1551 /* Number of msdu descriptors target should use */
1552 __le32 num_msdu_desc;
1553
1554 /*
1555 * Max. number of Tx fragments per MSDU
1556 * This parameter controls the max number of Tx fragments per MSDU.
1557 * This is sent by the target as part of the WMI_SERVICE_READY event
1558 * and is overriden by the OS shim as required.
1559 */
1560 __le32 max_frag_entries;
1561} __packed;
1562
1563
b3effe61
BM
1564#define NUM_UNITS_IS_NUM_VDEVS 0x1
1565#define NUM_UNITS_IS_NUM_PEERS 0x2
1566
5e3dd157
KV
1567/* strucutre describing host memory chunk. */
1568struct host_memory_chunk {
1569 /* id of the request that is passed up in service ready */
1570 __le32 req_id;
1571 /* the physical address the memory chunk */
1572 __le32 ptr;
1573 /* size of the chunk */
1574 __le32 size;
1575} __packed;
1576
1577struct wmi_init_cmd {
1578 struct wmi_resource_config resource_config;
1579 __le32 num_host_mem_chunks;
1580
1581 /*
1582 * variable number of host memory chunks.
1583 * This should be the last element in the structure
1584 */
1585 struct host_memory_chunk host_mem_chunks[1];
1586} __packed;
1587
12b2b9e3
BM
1588/* _10x stucture is from 10.X FW API */
1589struct wmi_init_cmd_10x {
1590 struct wmi_resource_config_10x resource_config;
1591 __le32 num_host_mem_chunks;
1592
1593 /*
1594 * variable number of host memory chunks.
1595 * This should be the last element in the structure
1596 */
1597 struct host_memory_chunk host_mem_chunks[1];
1598} __packed;
1599
5e3dd157
KV
1600/* TLV for channel list */
1601struct wmi_chan_list {
1602 __le32 tag; /* WMI_CHAN_LIST_TAG */
1603 __le32 num_chan;
1604 __le32 channel_list[0];
1605} __packed;
1606
1607struct wmi_bssid_list {
1608 __le32 tag; /* WMI_BSSID_LIST_TAG */
1609 __le32 num_bssid;
1610 struct wmi_mac_addr bssid_list[0];
1611} __packed;
1612
1613struct wmi_ie_data {
1614 __le32 tag; /* WMI_IE_TAG */
1615 __le32 ie_len;
1616 u8 ie_data[0];
1617} __packed;
1618
1619struct wmi_ssid {
1620 __le32 ssid_len;
1621 u8 ssid[32];
1622} __packed;
1623
1624struct wmi_ssid_list {
1625 __le32 tag; /* WMI_SSID_LIST_TAG */
1626 __le32 num_ssids;
1627 struct wmi_ssid ssids[0];
1628} __packed;
1629
1630/* prefix used by scan requestor ids on the host */
1631#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
1632
1633/* prefix used by scan request ids generated on the host */
1634/* host cycles through the lower 12 bits to generate ids */
1635#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
1636
1637#define WLAN_SCAN_PARAMS_MAX_SSID 16
1638#define WLAN_SCAN_PARAMS_MAX_BSSID 4
1639#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
1640
1641/* Scan priority numbers must be sequential, starting with 0 */
1642enum wmi_scan_priority {
1643 WMI_SCAN_PRIORITY_VERY_LOW = 0,
1644 WMI_SCAN_PRIORITY_LOW,
1645 WMI_SCAN_PRIORITY_MEDIUM,
1646 WMI_SCAN_PRIORITY_HIGH,
1647 WMI_SCAN_PRIORITY_VERY_HIGH,
1648 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
1649};
1650
1651struct wmi_start_scan_cmd {
1652 /* Scan ID */
1653 __le32 scan_id;
1654 /* Scan requestor ID */
1655 __le32 scan_req_id;
1656 /* VDEV id(interface) that is requesting scan */
1657 __le32 vdev_id;
1658 /* Scan Priority, input to scan scheduler */
1659 __le32 scan_priority;
1660 /* Scan events subscription */
1661 __le32 notify_scan_events;
1662 /* dwell time in msec on active channels */
1663 __le32 dwell_time_active;
1664 /* dwell time in msec on passive channels */
1665 __le32 dwell_time_passive;
1666 /*
1667 * min time in msec on the BSS channel,only valid if atleast one
1668 * VDEV is active
1669 */
1670 __le32 min_rest_time;
1671 /*
1672 * max rest time in msec on the BSS channel,only valid if at least
1673 * one VDEV is active
1674 */
1675 /*
1676 * the scanner will rest on the bss channel at least min_rest_time
1677 * after min_rest_time the scanner will start checking for tx/rx
1678 * activity on all VDEVs. if there is no activity the scanner will
1679 * switch to off channel. if there is activity the scanner will let
1680 * the radio on the bss channel until max_rest_time expires.at
1681 * max_rest_time scanner will switch to off channel irrespective of
1682 * activity. activity is determined by the idle_time parameter.
1683 */
1684 __le32 max_rest_time;
1685 /*
1686 * time before sending next set of probe requests.
1687 * The scanner keeps repeating probe requests transmission with
1688 * period specified by repeat_probe_time.
1689 * The number of probe requests specified depends on the ssid_list
1690 * and bssid_list
1691 */
1692 __le32 repeat_probe_time;
1693 /* time in msec between 2 consequetive probe requests with in a set. */
1694 __le32 probe_spacing_time;
1695 /*
1696 * data inactivity time in msec on bss channel that will be used by
1697 * scanner for measuring the inactivity.
1698 */
1699 __le32 idle_time;
1700 /* maximum time in msec allowed for scan */
1701 __le32 max_scan_time;
1702 /*
1703 * delay in msec before sending first probe request after switching
1704 * to a channel
1705 */
1706 __le32 probe_delay;
1707 /* Scan control flags */
1708 __le32 scan_ctrl_flags;
1709
1710 /* Burst duration time in msecs */
1711 __le32 burst_duration;
1712 /*
1713 * TLV (tag length value ) paramerters follow the scan_cmd structure.
1714 * TLV can contain channel list, bssid list, ssid list and
1715 * ie. the TLV tags are defined above;
1716 */
1717} __packed;
1718
89b7e766
BM
1719/* This is the definition from 10.X firmware branch */
1720struct wmi_start_scan_cmd_10x {
1721 /* Scan ID */
1722 __le32 scan_id;
1723
1724 /* Scan requestor ID */
1725 __le32 scan_req_id;
1726
1727 /* VDEV id(interface) that is requesting scan */
1728 __le32 vdev_id;
1729
1730 /* Scan Priority, input to scan scheduler */
1731 __le32 scan_priority;
1732
1733 /* Scan events subscription */
1734 __le32 notify_scan_events;
1735
1736 /* dwell time in msec on active channels */
1737 __le32 dwell_time_active;
1738
1739 /* dwell time in msec on passive channels */
1740 __le32 dwell_time_passive;
1741
1742 /*
1743 * min time in msec on the BSS channel,only valid if atleast one
1744 * VDEV is active
1745 */
1746 __le32 min_rest_time;
1747
1748 /*
1749 * max rest time in msec on the BSS channel,only valid if at least
1750 * one VDEV is active
1751 */
1752 /*
1753 * the scanner will rest on the bss channel at least min_rest_time
1754 * after min_rest_time the scanner will start checking for tx/rx
1755 * activity on all VDEVs. if there is no activity the scanner will
1756 * switch to off channel. if there is activity the scanner will let
1757 * the radio on the bss channel until max_rest_time expires.at
1758 * max_rest_time scanner will switch to off channel irrespective of
1759 * activity. activity is determined by the idle_time parameter.
1760 */
1761 __le32 max_rest_time;
1762
1763 /*
1764 * time before sending next set of probe requests.
1765 * The scanner keeps repeating probe requests transmission with
1766 * period specified by repeat_probe_time.
1767 * The number of probe requests specified depends on the ssid_list
1768 * and bssid_list
1769 */
1770 __le32 repeat_probe_time;
1771
1772 /* time in msec between 2 consequetive probe requests with in a set. */
1773 __le32 probe_spacing_time;
1774
1775 /*
1776 * data inactivity time in msec on bss channel that will be used by
1777 * scanner for measuring the inactivity.
1778 */
1779 __le32 idle_time;
1780
1781 /* maximum time in msec allowed for scan */
1782 __le32 max_scan_time;
1783
1784 /*
1785 * delay in msec before sending first probe request after switching
1786 * to a channel
1787 */
1788 __le32 probe_delay;
1789
1790 /* Scan control flags */
1791 __le32 scan_ctrl_flags;
1792
1793 /*
1794 * TLV (tag length value ) paramerters follow the scan_cmd structure.
1795 * TLV can contain channel list, bssid list, ssid list and
1796 * ie. the TLV tags are defined above;
1797 */
1798} __packed;
1799
1800
5e3dd157
KV
1801struct wmi_ssid_arg {
1802 int len;
1803 const u8 *ssid;
1804};
1805
1806struct wmi_bssid_arg {
1807 const u8 *bssid;
1808};
1809
1810struct wmi_start_scan_arg {
1811 u32 scan_id;
1812 u32 scan_req_id;
1813 u32 vdev_id;
1814 u32 scan_priority;
1815 u32 notify_scan_events;
1816 u32 dwell_time_active;
1817 u32 dwell_time_passive;
1818 u32 min_rest_time;
1819 u32 max_rest_time;
1820 u32 repeat_probe_time;
1821 u32 probe_spacing_time;
1822 u32 idle_time;
1823 u32 max_scan_time;
1824 u32 probe_delay;
1825 u32 scan_ctrl_flags;
1826
1827 u32 ie_len;
1828 u32 n_channels;
1829 u32 n_ssids;
1830 u32 n_bssids;
1831
1832 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
1833 u32 channels[64];
1834 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
1835 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
1836};
1837
1838/* scan control flags */
1839
1840/* passively scan all channels including active channels */
1841#define WMI_SCAN_FLAG_PASSIVE 0x1
1842/* add wild card ssid probe request even though ssid_list is specified. */
1843#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
1844/* add cck rates to rates/xrate ie for the generated probe request */
1845#define WMI_SCAN_ADD_CCK_RATES 0x4
1846/* add ofdm rates to rates/xrate ie for the generated probe request */
1847#define WMI_SCAN_ADD_OFDM_RATES 0x8
1848/* To enable indication of Chan load and Noise floor to host */
1849#define WMI_SCAN_CHAN_STAT_EVENT 0x10
1850/* Filter Probe request frames */
1851#define WMI_SCAN_FILTER_PROBE_REQ 0x20
1852/* When set, DFS channels will not be scanned */
1853#define WMI_SCAN_BYPASS_DFS_CHN 0x40
1854/* Different FW scan engine may choose to bail out on errors.
1855 * Allow the driver to have influence over that. */
1856#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
1857
1858/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
1859#define WMI_SCAN_CLASS_MASK 0xFF000000
1860
1861
1862enum wmi_stop_scan_type {
1863 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
1864 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
1865 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
1866};
1867
1868struct wmi_stop_scan_cmd {
1869 __le32 scan_req_id;
1870 __le32 scan_id;
1871 __le32 req_type;
1872 __le32 vdev_id;
1873} __packed;
1874
1875struct wmi_stop_scan_arg {
1876 u32 req_id;
1877 enum wmi_stop_scan_type req_type;
1878 union {
1879 u32 scan_id;
1880 u32 vdev_id;
1881 } u;
1882};
1883
1884struct wmi_scan_chan_list_cmd {
1885 __le32 num_scan_chans;
1886 struct wmi_channel chan_info[0];
1887} __packed;
1888
1889struct wmi_scan_chan_list_arg {
1890 u32 n_channels;
1891 struct wmi_channel_arg *channels;
1892};
1893
1894enum wmi_bss_filter {
1895 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
1896 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
1897 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
1898 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
1899 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
1900 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
1901 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
1902 WMI_BSS_FILTER_LAST_BSS, /* marker only */
1903};
1904
1905enum wmi_scan_event_type {
1906 WMI_SCAN_EVENT_STARTED = 0x1,
1907 WMI_SCAN_EVENT_COMPLETED = 0x2,
1908 WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
1909 WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
1910 WMI_SCAN_EVENT_DEQUEUED = 0x10,
1911 WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
1912 WMI_SCAN_EVENT_START_FAILED = 0x40,
1913 WMI_SCAN_EVENT_RESTARTED = 0x80,
1914 WMI_SCAN_EVENT_MAX = 0x8000
1915};
1916
1917enum wmi_scan_completion_reason {
1918 WMI_SCAN_REASON_COMPLETED,
1919 WMI_SCAN_REASON_CANCELLED,
1920 WMI_SCAN_REASON_PREEMPTED,
1921 WMI_SCAN_REASON_TIMEDOUT,
1922 WMI_SCAN_REASON_MAX,
1923};
1924
1925struct wmi_scan_event {
1926 __le32 event_type; /* %WMI_SCAN_EVENT_ */
1927 __le32 reason; /* %WMI_SCAN_REASON_ */
1928 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
1929 __le32 scan_req_id;
1930 __le32 scan_id;
1931 __le32 vdev_id;
1932} __packed;
1933
1934/*
1935 * This defines how much headroom is kept in the
1936 * receive frame between the descriptor and the
1937 * payload, in order for the WMI PHY error and
1938 * management handler to insert header contents.
1939 *
1940 * This is in bytes.
1941 */
1942#define WMI_MGMT_RX_HDR_HEADROOM 52
1943
1944/*
1945 * This event will be used for sending scan results
1946 * as well as rx mgmt frames to the host. The rx buffer
1947 * will be sent as part of this WMI event. It would be a
1948 * good idea to pass all the fields in the RX status
1949 * descriptor up to the host.
1950 */
0d9b0438 1951struct wmi_mgmt_rx_hdr_v1 {
5e3dd157
KV
1952 __le32 channel;
1953 __le32 snr;
1954 __le32 rate;
1955 __le32 phy_mode;
1956 __le32 buf_len;
1957 __le32 status; /* %WMI_RX_STATUS_ */
1958} __packed;
1959
0d9b0438
MK
1960struct wmi_mgmt_rx_hdr_v2 {
1961 struct wmi_mgmt_rx_hdr_v1 v1;
1962 __le32 rssi_ctl[4];
1963} __packed;
1964
1965struct wmi_mgmt_rx_event_v1 {
1966 struct wmi_mgmt_rx_hdr_v1 hdr;
1967 u8 buf[0];
1968} __packed;
1969
1970struct wmi_mgmt_rx_event_v2 {
1971 struct wmi_mgmt_rx_hdr_v2 hdr;
5e3dd157
KV
1972 u8 buf[0];
1973} __packed;
1974
1975#define WMI_RX_STATUS_OK 0x00
1976#define WMI_RX_STATUS_ERR_CRC 0x01
1977#define WMI_RX_STATUS_ERR_DECRYPT 0x08
1978#define WMI_RX_STATUS_ERR_MIC 0x10
1979#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
1980
1981struct wmi_single_phyerr_rx_hdr {
1982 /* TSF timestamp */
1983 __le32 tsf_timestamp;
1984
1985 /*
1986 * Current freq1, freq2
1987 *
1988 * [7:0]: freq1[lo]
1989 * [15:8] : freq1[hi]
1990 * [23:16]: freq2[lo]
1991 * [31:24]: freq2[hi]
1992 */
1993 __le16 freq1;
1994 __le16 freq2;
1995
1996 /*
1997 * Combined RSSI over all chains and channel width for this PHY error
1998 *
1999 * [7:0]: RSSI combined
2000 * [15:8]: Channel width (MHz)
2001 * [23:16]: PHY error code
2002 * [24:16]: reserved (future use)
2003 */
2004 u8 rssi_combined;
2005 u8 chan_width_mhz;
2006 u8 phy_err_code;
2007 u8 rsvd0;
2008
2009 /*
2010 * RSSI on chain 0 through 3
2011 *
2012 * This is formatted the same as the PPDU_START RX descriptor
2013 * field:
2014 *
2015 * [7:0]: pri20
2016 * [15:8]: sec20
2017 * [23:16]: sec40
2018 * [31:24]: sec80
2019 */
2020
2021 __le32 rssi_chain0;
2022 __le32 rssi_chain1;
2023 __le32 rssi_chain2;
2024 __le32 rssi_chain3;
2025
2026 /*
2027 * Last calibrated NF value for chain 0 through 3
2028 *
2029 * nf_list_1:
2030 *
2031 * + [15:0] - chain 0
2032 * + [31:16] - chain 1
2033 *
2034 * nf_list_2:
2035 *
2036 * + [15:0] - chain 2
2037 * + [31:16] - chain 3
2038 */
2039 __le32 nf_list_1;
2040 __le32 nf_list_2;
2041
2042
2043 /* Length of the frame */
2044 __le32 buf_len;
2045} __packed;
2046
2047struct wmi_single_phyerr_rx_event {
2048 /* Phy error event header */
2049 struct wmi_single_phyerr_rx_hdr hdr;
2050 /* frame buffer */
2051 u8 bufp[0];
2052} __packed;
2053
2054struct wmi_comb_phyerr_rx_hdr {
2055 /* Phy error phy error count */
2056 __le32 num_phyerr_events;
2057 __le32 tsf_l32;
2058 __le32 tsf_u32;
2059} __packed;
2060
2061struct wmi_comb_phyerr_rx_event {
2062 /* Phy error phy error count */
2063 struct wmi_comb_phyerr_rx_hdr hdr;
2064 /*
2065 * frame buffer - contains multiple payloads in the order:
2066 * header - payload, header - payload...
2067 * (The header is of type: wmi_single_phyerr_rx_hdr)
2068 */
2069 u8 bufp[0];
2070} __packed;
2071
2072struct wmi_mgmt_tx_hdr {
2073 __le32 vdev_id;
2074 struct wmi_mac_addr peer_macaddr;
2075 __le32 tx_rate;
2076 __le32 tx_power;
2077 __le32 buf_len;
2078} __packed;
2079
2080struct wmi_mgmt_tx_cmd {
2081 struct wmi_mgmt_tx_hdr hdr;
2082 u8 buf[0];
2083} __packed;
2084
2085struct wmi_echo_event {
2086 __le32 value;
2087} __packed;
2088
2089struct wmi_echo_cmd {
2090 __le32 value;
2091} __packed;
2092
2093
2094struct wmi_pdev_set_regdomain_cmd {
2095 __le32 reg_domain;
2096 __le32 reg_domain_2G;
2097 __le32 reg_domain_5G;
2098 __le32 conformance_test_limit_2G;
2099 __le32 conformance_test_limit_5G;
2100} __packed;
2101
2102/* Command to set/unset chip in quiet mode */
2103struct wmi_pdev_set_quiet_cmd {
2104 /* period in TUs */
2105 __le32 period;
2106
2107 /* duration in TUs */
2108 __le32 duration;
2109
2110 /* offset in TUs */
2111 __le32 next_start;
2112
2113 /* enable/disable */
2114 __le32 enabled;
2115} __packed;
2116
2117
2118/*
2119 * 802.11g protection mode.
2120 */
2121enum ath10k_protmode {
2122 ATH10K_PROT_NONE = 0, /* no protection */
2123 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
2124 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
2125};
2126
2127enum wmi_beacon_gen_mode {
2128 WMI_BEACON_STAGGERED_MODE = 0,
2129 WMI_BEACON_BURST_MODE = 1
2130};
2131
2132enum wmi_csa_event_ies_present_flag {
2133 WMI_CSA_IE_PRESENT = 0x00000001,
2134 WMI_XCSA_IE_PRESENT = 0x00000002,
2135 WMI_WBW_IE_PRESENT = 0x00000004,
2136 WMI_CSWARP_IE_PRESENT = 0x00000008,
2137};
2138
2139/* wmi CSA receive event from beacon frame */
2140struct wmi_csa_event {
2141 __le32 i_fc_dur;
2142 /* Bit 0-15: FC */
2143 /* Bit 16-31: DUR */
2144 struct wmi_mac_addr i_addr1;
2145 struct wmi_mac_addr i_addr2;
2146 __le32 csa_ie[2];
2147 __le32 xcsa_ie[2];
2148 __le32 wb_ie[2];
2149 __le32 cswarp_ie;
2150 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
2151} __packed;
2152
2153/* the definition of different PDEV parameters */
2154#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2155#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2156#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
2157
226a339b
BM
2158struct wmi_pdev_param_map {
2159 u32 tx_chain_mask;
2160 u32 rx_chain_mask;
2161 u32 txpower_limit2g;
2162 u32 txpower_limit5g;
2163 u32 txpower_scale;
2164 u32 beacon_gen_mode;
2165 u32 beacon_tx_mode;
2166 u32 resmgr_offchan_mode;
2167 u32 protection_mode;
2168 u32 dynamic_bw;
2169 u32 non_agg_sw_retry_th;
2170 u32 agg_sw_retry_th;
2171 u32 sta_kickout_th;
2172 u32 ac_aggrsize_scaling;
2173 u32 ltr_enable;
2174 u32 ltr_ac_latency_be;
2175 u32 ltr_ac_latency_bk;
2176 u32 ltr_ac_latency_vi;
2177 u32 ltr_ac_latency_vo;
2178 u32 ltr_ac_latency_timeout;
2179 u32 ltr_sleep_override;
2180 u32 ltr_rx_override;
2181 u32 ltr_tx_activity_timeout;
2182 u32 l1ss_enable;
2183 u32 dsleep_enable;
2184 u32 pcielp_txbuf_flush;
2185 u32 pcielp_txbuf_watermark;
2186 u32 pcielp_txbuf_tmo_en;
2187 u32 pcielp_txbuf_tmo_value;
2188 u32 pdev_stats_update_period;
2189 u32 vdev_stats_update_period;
2190 u32 peer_stats_update_period;
2191 u32 bcnflt_stats_update_period;
2192 u32 pmf_qos;
2193 u32 arp_ac_override;
2194 u32 arpdhcp_ac_override;
2195 u32 dcs;
2196 u32 ani_enable;
2197 u32 ani_poll_period;
2198 u32 ani_listen_period;
2199 u32 ani_ofdm_level;
2200 u32 ani_cck_level;
2201 u32 dyntxchain;
2202 u32 proxy_sta;
2203 u32 idle_ps_config;
2204 u32 power_gating_sleep;
2205 u32 fast_channel_reset;
2206 u32 burst_dur;
2207 u32 burst_enable;
2208};
2209
2210#define WMI_PDEV_PARAM_UNSUPPORTED 0
2211
5e3dd157
KV
2212enum wmi_pdev_param {
2213 /* TX chian mask */
2214 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
2215 /* RX chian mask */
2216 WMI_PDEV_PARAM_RX_CHAIN_MASK,
2217 /* TX power limit for 2G Radio */
2218 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
2219 /* TX power limit for 5G Radio */
2220 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
2221 /* TX power scale */
2222 WMI_PDEV_PARAM_TXPOWER_SCALE,
2223 /* Beacon generation mode . 0: host, 1: target */
2224 WMI_PDEV_PARAM_BEACON_GEN_MODE,
2225 /* Beacon generation mode . 0: staggered 1: bursted */
2226 WMI_PDEV_PARAM_BEACON_TX_MODE,
2227 /*
2228 * Resource manager off chan mode .
2229 * 0: turn off off chan mode. 1: turn on offchan mode
2230 */
2231 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2232 /*
2233 * Protection mode:
2234 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2235 */
2236 WMI_PDEV_PARAM_PROTECTION_MODE,
2237 /* Dynamic bandwidth 0: disable 1: enable */
2238 WMI_PDEV_PARAM_DYNAMIC_BW,
2239 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2240 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2241 /* aggregrate sw retry threshold. 0-disable*/
2242 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
2243 /* Station kickout threshold (non of consecutive failures).0-disable */
2244 WMI_PDEV_PARAM_STA_KICKOUT_TH,
2245 /* Aggerate size scaling configuration per AC */
2246 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2247 /* LTR enable */
2248 WMI_PDEV_PARAM_LTR_ENABLE,
2249 /* LTR latency for BE, in us */
2250 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
2251 /* LTR latency for BK, in us */
2252 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
2253 /* LTR latency for VI, in us */
2254 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
2255 /* LTR latency for VO, in us */
2256 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
2257 /* LTR AC latency timeout, in ms */
2258 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2259 /* LTR platform latency override, in us */
2260 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2261 /* LTR-RX override, in us */
2262 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
2263 /* Tx activity timeout for LTR, in us */
2264 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2265 /* L1SS state machine enable */
2266 WMI_PDEV_PARAM_L1SS_ENABLE,
2267 /* Deep sleep state machine enable */
2268 WMI_PDEV_PARAM_DSLEEP_ENABLE,
2269 /* RX buffering flush enable */
2270 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
2271 /* RX buffering matermark */
2272 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
2273 /* RX buffering timeout enable */
2274 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
2275 /* RX buffering timeout value */
2276 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
2277 /* pdev level stats update period in ms */
2278 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2279 /* vdev level stats update period in ms */
2280 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2281 /* peer level stats update period in ms */
2282 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2283 /* beacon filter status update period */
2284 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2285 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2286 WMI_PDEV_PARAM_PMF_QOS,
2287 /* Access category on which ARP frames are sent */
2288 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
2289 /* DCS configuration */
2290 WMI_PDEV_PARAM_DCS,
2291 /* Enable/Disable ANI on target */
2292 WMI_PDEV_PARAM_ANI_ENABLE,
2293 /* configure the ANI polling period */
2294 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
2295 /* configure the ANI listening period */
2296 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
2297 /* configure OFDM immunity level */
2298 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
2299 /* configure CCK immunity level */
2300 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
2301 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2302 WMI_PDEV_PARAM_DYNTXCHAIN,
2303 /* Enable/Disable proxy STA */
2304 WMI_PDEV_PARAM_PROXY_STA,
2305 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
2306 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
2307 /* Enable/Disable power gating sleep */
2308 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
2309};
2310
226a339b
BM
2311enum wmi_10x_pdev_param {
2312 /* TX chian mask */
2313 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
2314 /* RX chian mask */
2315 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
2316 /* TX power limit for 2G Radio */
2317 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
2318 /* TX power limit for 5G Radio */
2319 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
2320 /* TX power scale */
2321 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
2322 /* Beacon generation mode . 0: host, 1: target */
2323 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
2324 /* Beacon generation mode . 0: staggered 1: bursted */
2325 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
2326 /*
2327 * Resource manager off chan mode .
2328 * 0: turn off off chan mode. 1: turn on offchan mode
2329 */
2330 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2331 /*
2332 * Protection mode:
2333 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2334 */
2335 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
2336 /* Dynamic bandwidth 0: disable 1: enable */
2337 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
2338 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2339 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2340 /* aggregrate sw retry threshold. 0-disable*/
2341 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
2342 /* Station kickout threshold (non of consecutive failures).0-disable */
2343 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
2344 /* Aggerate size scaling configuration per AC */
2345 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2346 /* LTR enable */
2347 WMI_10X_PDEV_PARAM_LTR_ENABLE,
2348 /* LTR latency for BE, in us */
2349 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
2350 /* LTR latency for BK, in us */
2351 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
2352 /* LTR latency for VI, in us */
2353 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
2354 /* LTR latency for VO, in us */
2355 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
2356 /* LTR AC latency timeout, in ms */
2357 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2358 /* LTR platform latency override, in us */
2359 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2360 /* LTR-RX override, in us */
2361 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
2362 /* Tx activity timeout for LTR, in us */
2363 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2364 /* L1SS state machine enable */
2365 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
2366 /* Deep sleep state machine enable */
2367 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
2368 /* pdev level stats update period in ms */
2369 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2370 /* vdev level stats update period in ms */
2371 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2372 /* peer level stats update period in ms */
2373 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2374 /* beacon filter status update period */
2375 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2376 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2377 WMI_10X_PDEV_PARAM_PMF_QOS,
2378 /* Access category on which ARP and DHCP frames are sent */
2379 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
2380 /* DCS configuration */
2381 WMI_10X_PDEV_PARAM_DCS,
2382 /* Enable/Disable ANI on target */
2383 WMI_10X_PDEV_PARAM_ANI_ENABLE,
2384 /* configure the ANI polling period */
2385 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
2386 /* configure the ANI listening period */
2387 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
2388 /* configure OFDM immunity level */
2389 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
2390 /* configure CCK immunity level */
2391 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
2392 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2393 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
2394 /* Enable/Disable Fast channel reset*/
2395 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
2396 /* Set Bursting DUR */
2397 WMI_10X_PDEV_PARAM_BURST_DUR,
2398 /* Set Bursting Enable*/
2399 WMI_10X_PDEV_PARAM_BURST_ENABLE,
2400};
2401
5e3dd157
KV
2402struct wmi_pdev_set_param_cmd {
2403 __le32 param_id;
2404 __le32 param_value;
2405} __packed;
2406
2407struct wmi_pdev_get_tpc_config_cmd {
2408 /* parameter */
2409 __le32 param;
2410} __packed;
2411
2412#define WMI_TPC_RATE_MAX 160
2413#define WMI_TPC_TX_N_CHAIN 4
2414
2415enum wmi_tpc_config_event_flag {
2416 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
2417 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
2418 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
2419};
2420
2421struct wmi_pdev_tpc_config_event {
2422 __le32 reg_domain;
2423 __le32 chan_freq;
2424 __le32 phy_mode;
2425 __le32 twice_antenna_reduction;
2426 __le32 twice_max_rd_power;
2427 s32 twice_antenna_gain;
2428 __le32 power_limit;
2429 __le32 rate_max;
2430 __le32 num_tx_chain;
2431 __le32 ctl;
2432 __le32 flags;
2433 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
2434 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2435 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2436 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2437 u8 rates_array[WMI_TPC_RATE_MAX];
2438} __packed;
2439
2440/* Transmit power scale factor. */
2441enum wmi_tp_scale {
2442 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
2443 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
2444 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
2445 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
2446 WMI_TP_SCALE_MIN = 4, /* min, but still on */
2447 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
2448};
2449
2450struct wmi_set_channel_cmd {
2451 /* channel (only frequency and mode info are used) */
2452 struct wmi_channel chan;
2453} __packed;
2454
2455struct wmi_pdev_chanlist_update_event {
2456 /* number of channels */
2457 __le32 num_chan;
2458 /* array of channels */
2459 struct wmi_channel channel_list[1];
2460} __packed;
2461
2462#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
2463
2464struct wmi_debug_mesg_event {
2465 /* message buffer, NULL terminated */
2466 char bufp[WMI_MAX_DEBUG_MESG];
2467} __packed;
2468
2469enum {
2470 /* P2P device */
2471 VDEV_SUBTYPE_P2PDEV = 0,
2472 /* P2P client */
2473 VDEV_SUBTYPE_P2PCLI,
2474 /* P2P GO */
2475 VDEV_SUBTYPE_P2PGO,
2476 /* BT3.0 HS */
2477 VDEV_SUBTYPE_BT,
2478};
2479
2480struct wmi_pdev_set_channel_cmd {
2481 /* idnore power , only use flags , mode and freq */
2482 struct wmi_channel chan;
2483} __packed;
2484
2485/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
2486#define WMI_DSCP_MAP_MAX (64)
2487struct wmi_pdev_set_dscp_tid_map_cmd {
2488 /* map indicating DSCP to TID conversion */
2489 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
2490} __packed;
2491
2492enum mcast_bcast_rate_id {
2493 WMI_SET_MCAST_RATE,
2494 WMI_SET_BCAST_RATE
2495};
2496
2497struct mcast_bcast_rate {
2498 enum mcast_bcast_rate_id rate_id;
2499 __le32 rate;
2500} __packed;
2501
2502struct wmi_wmm_params {
2503 __le32 cwmin;
2504 __le32 cwmax;
2505 __le32 aifs;
2506 __le32 txop;
2507 __le32 acm;
2508 __le32 no_ack;
2509} __packed;
2510
2511struct wmi_pdev_set_wmm_params {
2512 struct wmi_wmm_params ac_be;
2513 struct wmi_wmm_params ac_bk;
2514 struct wmi_wmm_params ac_vi;
2515 struct wmi_wmm_params ac_vo;
2516} __packed;
2517
2518struct wmi_wmm_params_arg {
2519 u32 cwmin;
2520 u32 cwmax;
2521 u32 aifs;
2522 u32 txop;
2523 u32 acm;
2524 u32 no_ack;
2525};
2526
2527struct wmi_pdev_set_wmm_params_arg {
2528 struct wmi_wmm_params_arg ac_be;
2529 struct wmi_wmm_params_arg ac_bk;
2530 struct wmi_wmm_params_arg ac_vi;
2531 struct wmi_wmm_params_arg ac_vo;
2532};
2533
2534struct wal_dbg_tx_stats {
2535 /* Num HTT cookies queued to dispatch list */
2536 __le32 comp_queued;
2537
2538 /* Num HTT cookies dispatched */
2539 __le32 comp_delivered;
2540
2541 /* Num MSDU queued to WAL */
2542 __le32 msdu_enqued;
2543
2544 /* Num MPDU queue to WAL */
2545 __le32 mpdu_enqued;
2546
2547 /* Num MSDUs dropped by WMM limit */
2548 __le32 wmm_drop;
2549
2550 /* Num Local frames queued */
2551 __le32 local_enqued;
2552
2553 /* Num Local frames done */
2554 __le32 local_freed;
2555
2556 /* Num queued to HW */
2557 __le32 hw_queued;
2558
2559 /* Num PPDU reaped from HW */
2560 __le32 hw_reaped;
2561
2562 /* Num underruns */
2563 __le32 underrun;
2564
2565 /* Num PPDUs cleaned up in TX abort */
2566 __le32 tx_abort;
2567
2568 /* Num MPDUs requed by SW */
2569 __le32 mpdus_requed;
2570
2571 /* excessive retries */
2572 __le32 tx_ko;
2573
2574 /* data hw rate code */
2575 __le32 data_rc;
2576
2577 /* Scheduler self triggers */
2578 __le32 self_triggers;
2579
2580 /* frames dropped due to excessive sw retries */
2581 __le32 sw_retry_failure;
2582
2583 /* illegal rate phy errors */
2584 __le32 illgl_rate_phy_err;
2585
2586 /* wal pdev continous xretry */
2587 __le32 pdev_cont_xretry;
2588
2589 /* wal pdev continous xretry */
2590 __le32 pdev_tx_timeout;
2591
2592 /* wal pdev resets */
2593 __le32 pdev_resets;
2594
2595 __le32 phy_underrun;
2596
2597 /* MPDU is more than txop limit */
2598 __le32 txop_ovf;
2599} __packed;
2600
2601struct wal_dbg_rx_stats {
2602 /* Cnts any change in ring routing mid-ppdu */
2603 __le32 mid_ppdu_route_change;
2604
2605 /* Total number of statuses processed */
2606 __le32 status_rcvd;
2607
2608 /* Extra frags on rings 0-3 */
2609 __le32 r0_frags;
2610 __le32 r1_frags;
2611 __le32 r2_frags;
2612 __le32 r3_frags;
2613
2614 /* MSDUs / MPDUs delivered to HTT */
2615 __le32 htt_msdus;
2616 __le32 htt_mpdus;
2617
2618 /* MSDUs / MPDUs delivered to local stack */
2619 __le32 loc_msdus;
2620 __le32 loc_mpdus;
2621
2622 /* AMSDUs that have more MSDUs than the status ring size */
2623 __le32 oversize_amsdu;
2624
2625 /* Number of PHY errors */
2626 __le32 phy_errs;
2627
2628 /* Number of PHY errors drops */
2629 __le32 phy_err_drop;
2630
2631 /* Number of mpdu errors - FCS, MIC, ENC etc. */
2632 __le32 mpdu_errs;
2633} __packed;
2634
2635struct wal_dbg_peer_stats {
2636 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
2637 __le32 dummy;
2638} __packed;
2639
2640struct wal_dbg_stats {
2641 struct wal_dbg_tx_stats tx;
2642 struct wal_dbg_rx_stats rx;
2643 struct wal_dbg_peer_stats peer;
2644} __packed;
2645
2646enum wmi_stats_id {
2647 WMI_REQUEST_PEER_STAT = 0x01,
2648 WMI_REQUEST_AP_STAT = 0x02
2649};
2650
2651struct wmi_request_stats_cmd {
2652 __le32 stats_id;
2653
2654 /*
2655 * Space to add parameters like
2656 * peer mac addr
2657 */
2658} __packed;
2659
2660/* Suspend option */
2661enum {
2662 /* suspend */
2663 WMI_PDEV_SUSPEND,
2664
2665 /* suspend and disable all interrupts */
2666 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
2667};
2668
2669struct wmi_pdev_suspend_cmd {
2670 /* suspend option sent to target */
2671 __le32 suspend_opt;
2672} __packed;
2673
2674struct wmi_stats_event {
2675 __le32 stats_id; /* %WMI_REQUEST_ */
2676 /*
2677 * number of pdev stats event structures
2678 * (wmi_pdev_stats) 0 or 1
2679 */
2680 __le32 num_pdev_stats;
2681 /*
2682 * number of vdev stats event structures
2683 * (wmi_vdev_stats) 0 or max vdevs
2684 */
2685 __le32 num_vdev_stats;
2686 /*
2687 * number of peer stats event structures
2688 * (wmi_peer_stats) 0 or max peers
2689 */
2690 __le32 num_peer_stats;
2691 __le32 num_bcnflt_stats;
2692 /*
2693 * followed by
2694 * num_pdev_stats * size of(struct wmi_pdev_stats)
2695 * num_vdev_stats * size of(struct wmi_vdev_stats)
2696 * num_peer_stats * size of(struct wmi_peer_stats)
2697 *
2698 * By having a zero sized array, the pointer to data area
2699 * becomes available without increasing the struct size
2700 */
2701 u8 data[0];
2702} __packed;
2703
2704/*
2705 * PDEV statistics
2706 * TODO: add all PDEV stats here
2707 */
2708struct wmi_pdev_stats {
2709 __le32 chan_nf; /* Channel noise floor */
2710 __le32 tx_frame_count; /* TX frame count */
2711 __le32 rx_frame_count; /* RX frame count */
2712 __le32 rx_clear_count; /* rx clear count */
2713 __le32 cycle_count; /* cycle count */
2714 __le32 phy_err_count; /* Phy error count */
2715 __le32 chan_tx_pwr; /* channel tx power */
2716 struct wal_dbg_stats wal; /* WAL dbg stats */
2717} __packed;
2718
2719/*
2720 * VDEV statistics
2721 * TODO: add all VDEV stats here
2722 */
2723struct wmi_vdev_stats {
2724 __le32 vdev_id;
2725} __packed;
2726
2727/*
2728 * peer statistics.
2729 * TODO: add more stats
2730 */
2731struct wmi_peer_stats {
2732 struct wmi_mac_addr peer_macaddr;
2733 __le32 peer_rssi;
2734 __le32 peer_tx_rate;
2735} __packed;
2736
2737struct wmi_vdev_create_cmd {
2738 __le32 vdev_id;
2739 __le32 vdev_type;
2740 __le32 vdev_subtype;
2741 struct wmi_mac_addr vdev_macaddr;
2742} __packed;
2743
2744enum wmi_vdev_type {
2745 WMI_VDEV_TYPE_AP = 1,
2746 WMI_VDEV_TYPE_STA = 2,
2747 WMI_VDEV_TYPE_IBSS = 3,
2748 WMI_VDEV_TYPE_MONITOR = 4,
2749};
2750
2751enum wmi_vdev_subtype {
2752 WMI_VDEV_SUBTYPE_NONE = 0,
2753 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
2754 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
2755 WMI_VDEV_SUBTYPE_P2P_GO = 3,
2756};
2757
2758/* values for vdev_subtype */
2759
2760/* values for vdev_start_request flags */
2761/*
2762 * Indicates that AP VDEV uses hidden ssid. only valid for
2763 * AP/GO */
2764#define WMI_VDEV_START_HIDDEN_SSID (1<<0)
2765/*
2766 * Indicates if robust management frame/management frame
2767 * protection is enabled. For GO/AP vdevs, it indicates that
2768 * it may support station/client associations with RMF enabled.
2769 * For STA/client vdevs, it indicates that sta will
2770 * associate with AP with RMF enabled. */
2771#define WMI_VDEV_START_PMF_ENABLED (1<<1)
2772
2773struct wmi_p2p_noa_descriptor {
2774 __le32 type_count; /* 255: continuous schedule, 0: reserved */
2775 __le32 duration; /* Absent period duration in micro seconds */
2776 __le32 interval; /* Absent period interval in micro seconds */
2777 __le32 start_time; /* 32 bit tsf time when in starts */
2778} __packed;
2779
2780struct wmi_vdev_start_request_cmd {
2781 /* WMI channel */
2782 struct wmi_channel chan;
2783 /* unique id identifying the VDEV, generated by the caller */
2784 __le32 vdev_id;
2785 /* requestor id identifying the caller module */
2786 __le32 requestor_id;
2787 /* beacon interval from received beacon */
2788 __le32 beacon_interval;
2789 /* DTIM Period from the received beacon */
2790 __le32 dtim_period;
2791 /* Flags */
2792 __le32 flags;
2793 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
2794 struct wmi_ssid ssid;
2795 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
2796 __le32 bcn_tx_rate;
2797 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
2798 __le32 bcn_tx_power;
2799 /* number of p2p NOA descriptor(s) from scan entry */
2800 __le32 num_noa_descriptors;
2801 /*
2802 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
2803 * During CAC, Our HW shouldn't ack ditected frames
2804 */
2805 __le32 disable_hw_ack;
2806 /* actual p2p NOA descriptor from scan entry */
2807 struct wmi_p2p_noa_descriptor noa_descriptors[2];
2808} __packed;
2809
2810struct wmi_vdev_restart_request_cmd {
2811 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
2812} __packed;
2813
2814struct wmi_vdev_start_request_arg {
2815 u32 vdev_id;
2816 struct wmi_channel_arg channel;
2817 u32 bcn_intval;
2818 u32 dtim_period;
2819 u8 *ssid;
2820 u32 ssid_len;
2821 u32 bcn_tx_rate;
2822 u32 bcn_tx_power;
2823 bool disable_hw_ack;
2824 bool hidden_ssid;
2825 bool pmf_enabled;
2826};
2827
2828struct wmi_vdev_delete_cmd {
2829 /* unique id identifying the VDEV, generated by the caller */
2830 __le32 vdev_id;
2831} __packed;
2832
2833struct wmi_vdev_up_cmd {
2834 __le32 vdev_id;
2835 __le32 vdev_assoc_id;
2836 struct wmi_mac_addr vdev_bssid;
2837} __packed;
2838
2839struct wmi_vdev_stop_cmd {
2840 __le32 vdev_id;
2841} __packed;
2842
2843struct wmi_vdev_down_cmd {
2844 __le32 vdev_id;
2845} __packed;
2846
2847struct wmi_vdev_standby_response_cmd {
2848 /* unique id identifying the VDEV, generated by the caller */
2849 __le32 vdev_id;
2850} __packed;
2851
2852struct wmi_vdev_resume_response_cmd {
2853 /* unique id identifying the VDEV, generated by the caller */
2854 __le32 vdev_id;
2855} __packed;
2856
2857struct wmi_vdev_set_param_cmd {
2858 __le32 vdev_id;
2859 __le32 param_id;
2860 __le32 param_value;
2861} __packed;
2862
2863#define WMI_MAX_KEY_INDEX 3
2864#define WMI_MAX_KEY_LEN 32
2865
2866#define WMI_KEY_PAIRWISE 0x00
2867#define WMI_KEY_GROUP 0x01
2868#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
2869
2870struct wmi_key_seq_counter {
2871 __le32 key_seq_counter_l;
2872 __le32 key_seq_counter_h;
2873} __packed;
2874
2875#define WMI_CIPHER_NONE 0x0 /* clear key */
2876#define WMI_CIPHER_WEP 0x1
2877#define WMI_CIPHER_TKIP 0x2
2878#define WMI_CIPHER_AES_OCB 0x3
2879#define WMI_CIPHER_AES_CCM 0x4
2880#define WMI_CIPHER_WAPI 0x5
2881#define WMI_CIPHER_CKIP 0x6
2882#define WMI_CIPHER_AES_CMAC 0x7
2883
2884struct wmi_vdev_install_key_cmd {
2885 __le32 vdev_id;
2886 struct wmi_mac_addr peer_macaddr;
2887 __le32 key_idx;
2888 __le32 key_flags;
2889 __le32 key_cipher; /* %WMI_CIPHER_ */
2890 struct wmi_key_seq_counter key_rsc_counter;
2891 struct wmi_key_seq_counter key_global_rsc_counter;
2892 struct wmi_key_seq_counter key_tsc_counter;
2893 u8 wpi_key_rsc_counter[16];
2894 u8 wpi_key_tsc_counter[16];
2895 __le32 key_len;
2896 __le32 key_txmic_len;
2897 __le32 key_rxmic_len;
2898
2899 /* contains key followed by tx mic followed by rx mic */
2900 u8 key_data[0];
2901} __packed;
2902
2903struct wmi_vdev_install_key_arg {
2904 u32 vdev_id;
2905 const u8 *macaddr;
2906 u32 key_idx;
2907 u32 key_flags;
2908 u32 key_cipher;
2909 u32 key_len;
2910 u32 key_txmic_len;
2911 u32 key_rxmic_len;
2912 const void *key_data;
2913};
2914
2915/* Preamble types to be used with VDEV fixed rate configuration */
2916enum wmi_rate_preamble {
2917 WMI_RATE_PREAMBLE_OFDM,
2918 WMI_RATE_PREAMBLE_CCK,
2919 WMI_RATE_PREAMBLE_HT,
2920 WMI_RATE_PREAMBLE_VHT,
2921};
2922
2923/* Value to disable fixed rate setting */
2924#define WMI_FIXED_RATE_NONE (0xff)
2925
6d1506e7
BM
2926struct wmi_vdev_param_map {
2927 u32 rts_threshold;
2928 u32 fragmentation_threshold;
2929 u32 beacon_interval;
2930 u32 listen_interval;
2931 u32 multicast_rate;
2932 u32 mgmt_tx_rate;
2933 u32 slot_time;
2934 u32 preamble;
2935 u32 swba_time;
2936 u32 wmi_vdev_stats_update_period;
2937 u32 wmi_vdev_pwrsave_ageout_time;
2938 u32 wmi_vdev_host_swba_interval;
2939 u32 dtim_period;
2940 u32 wmi_vdev_oc_scheduler_air_time_limit;
2941 u32 wds;
2942 u32 atim_window;
2943 u32 bmiss_count_max;
2944 u32 bmiss_first_bcnt;
2945 u32 bmiss_final_bcnt;
2946 u32 feature_wmm;
2947 u32 chwidth;
2948 u32 chextoffset;
2949 u32 disable_htprotection;
2950 u32 sta_quickkickout;
2951 u32 mgmt_rate;
2952 u32 protection_mode;
2953 u32 fixed_rate;
2954 u32 sgi;
2955 u32 ldpc;
2956 u32 tx_stbc;
2957 u32 rx_stbc;
2958 u32 intra_bss_fwd;
2959 u32 def_keyid;
2960 u32 nss;
2961 u32 bcast_data_rate;
2962 u32 mcast_data_rate;
2963 u32 mcast_indicate;
2964 u32 dhcp_indicate;
2965 u32 unknown_dest_indicate;
2966 u32 ap_keepalive_min_idle_inactive_time_secs;
2967 u32 ap_keepalive_max_idle_inactive_time_secs;
2968 u32 ap_keepalive_max_unresponsive_time_secs;
2969 u32 ap_enable_nawds;
2970 u32 mcast2ucast_set;
2971 u32 enable_rtscts;
2972 u32 txbf;
2973 u32 packet_powersave;
2974 u32 drop_unencry;
2975 u32 tx_encap_type;
2976 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
2977};
2978
2979#define WMI_VDEV_PARAM_UNSUPPORTED 0
2980
5e3dd157
KV
2981/* the definition of different VDEV parameters */
2982enum wmi_vdev_param {
2983 /* RTS Threshold */
2984 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
2985 /* Fragmentation threshold */
2986 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
2987 /* beacon interval in TUs */
2988 WMI_VDEV_PARAM_BEACON_INTERVAL,
2989 /* Listen interval in TUs */
2990 WMI_VDEV_PARAM_LISTEN_INTERVAL,
2991 /* muticast rate in Mbps */
2992 WMI_VDEV_PARAM_MULTICAST_RATE,
2993 /* management frame rate in Mbps */
2994 WMI_VDEV_PARAM_MGMT_TX_RATE,
2995 /* slot time (long vs short) */
2996 WMI_VDEV_PARAM_SLOT_TIME,
2997 /* preamble (long vs short) */
2998 WMI_VDEV_PARAM_PREAMBLE,
2999 /* SWBA time (time before tbtt in msec) */
3000 WMI_VDEV_PARAM_SWBA_TIME,
3001 /* time period for updating VDEV stats */
3002 WMI_VDEV_STATS_UPDATE_PERIOD,
3003 /* age out time in msec for frames queued for station in power save */
3004 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
3005 /*
3006 * Host SWBA interval (time in msec before tbtt for SWBA event
3007 * generation).
3008 */
3009 WMI_VDEV_HOST_SWBA_INTERVAL,
3010 /* DTIM period (specified in units of num beacon intervals) */
3011 WMI_VDEV_PARAM_DTIM_PERIOD,
3012 /*
3013 * scheduler air time limit for this VDEV. used by off chan
3014 * scheduler.
3015 */
3016 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3017 /* enable/dsiable WDS for this VDEV */
3018 WMI_VDEV_PARAM_WDS,
3019 /* ATIM Window */
3020 WMI_VDEV_PARAM_ATIM_WINDOW,
3021 /* BMISS max */
3022 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
3023 /* BMISS first time */
3024 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
3025 /* BMISS final time */
3026 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
3027 /* WMM enables/disabled */
3028 WMI_VDEV_PARAM_FEATURE_WMM,
3029 /* Channel width */
3030 WMI_VDEV_PARAM_CHWIDTH,
3031 /* Channel Offset */
3032 WMI_VDEV_PARAM_CHEXTOFFSET,
3033 /* Disable HT Protection */
3034 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
3035 /* Quick STA Kickout */
3036 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
3037 /* Rate to be used with Management frames */
3038 WMI_VDEV_PARAM_MGMT_RATE,
3039 /* Protection Mode */
3040 WMI_VDEV_PARAM_PROTECTION_MODE,
3041 /* Fixed rate setting */
3042 WMI_VDEV_PARAM_FIXED_RATE,
3043 /* Short GI Enable/Disable */
3044 WMI_VDEV_PARAM_SGI,
3045 /* Enable LDPC */
3046 WMI_VDEV_PARAM_LDPC,
3047 /* Enable Tx STBC */
3048 WMI_VDEV_PARAM_TX_STBC,
3049 /* Enable Rx STBC */
3050 WMI_VDEV_PARAM_RX_STBC,
3051 /* Intra BSS forwarding */
3052 WMI_VDEV_PARAM_INTRA_BSS_FWD,
3053 /* Setting Default xmit key for Vdev */
3054 WMI_VDEV_PARAM_DEF_KEYID,
3055 /* NSS width */
3056 WMI_VDEV_PARAM_NSS,
3057 /* Set the custom rate for the broadcast data frames */
3058 WMI_VDEV_PARAM_BCAST_DATA_RATE,
3059 /* Set the custom rate (rate-code) for multicast data frames */
3060 WMI_VDEV_PARAM_MCAST_DATA_RATE,
3061 /* Tx multicast packet indicate Enable/Disable */
3062 WMI_VDEV_PARAM_MCAST_INDICATE,
3063 /* Tx DHCP packet indicate Enable/Disable */
3064 WMI_VDEV_PARAM_DHCP_INDICATE,
3065 /* Enable host inspection of Tx unicast packet to unknown destination */
3066 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3067
3068 /* The minimum amount of time AP begins to consider STA inactive */
3069 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3070
3071 /*
3072 * An associated STA is considered inactive when there is no recent
3073 * TX/RX activity and no downlink frames are buffered for it. Once a
3074 * STA exceeds the maximum idle inactive time, the AP will send an
3075 * 802.11 data-null as a keep alive to verify the STA is still
3076 * associated. If the STA does ACK the data-null, or if the data-null
3077 * is buffered and the STA does not retrieve it, the STA will be
3078 * considered unresponsive
3079 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3080 */
3081 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3082
3083 /*
3084 * An associated STA is considered unresponsive if there is no recent
3085 * TX/RX activity and downlink frames are buffered for it. Once a STA
3086 * exceeds the maximum unresponsive time, the AP will send a
3087 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
3088 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3089
3090 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3091 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
3092 /* Enable/Disable RTS-CTS */
3093 WMI_VDEV_PARAM_ENABLE_RTSCTS,
3094 /* Enable TXBFee/er */
3095 WMI_VDEV_PARAM_TXBF,
3096
3097 /* Set packet power save */
3098 WMI_VDEV_PARAM_PACKET_POWERSAVE,
3099
3100 /*
3101 * Drops un-encrypted packets if eceived in an encrypted connection
3102 * otherwise forwards to host.
3103 */
3104 WMI_VDEV_PARAM_DROP_UNENCRY,
3105
3106 /*
3107 * Set the encapsulation type for frames.
3108 */
3109 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
3110};
3111
6d1506e7
BM
3112/* the definition of different VDEV parameters */
3113enum wmi_10x_vdev_param {
3114 /* RTS Threshold */
3115 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
3116 /* Fragmentation threshold */
3117 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
3118 /* beacon interval in TUs */
3119 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
3120 /* Listen interval in TUs */
3121 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
3122 /* muticast rate in Mbps */
3123 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
3124 /* management frame rate in Mbps */
3125 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
3126 /* slot time (long vs short) */
3127 WMI_10X_VDEV_PARAM_SLOT_TIME,
3128 /* preamble (long vs short) */
3129 WMI_10X_VDEV_PARAM_PREAMBLE,
3130 /* SWBA time (time before tbtt in msec) */
3131 WMI_10X_VDEV_PARAM_SWBA_TIME,
3132 /* time period for updating VDEV stats */
3133 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
3134 /* age out time in msec for frames queued for station in power save */
3135 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
3136 /*
3137 * Host SWBA interval (time in msec before tbtt for SWBA event
3138 * generation).
3139 */
3140 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
3141 /* DTIM period (specified in units of num beacon intervals) */
3142 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
3143 /*
3144 * scheduler air time limit for this VDEV. used by off chan
3145 * scheduler.
3146 */
3147 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3148 /* enable/dsiable WDS for this VDEV */
3149 WMI_10X_VDEV_PARAM_WDS,
3150 /* ATIM Window */
3151 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
3152 /* BMISS max */
3153 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
3154 /* WMM enables/disabled */
3155 WMI_10X_VDEV_PARAM_FEATURE_WMM,
3156 /* Channel width */
3157 WMI_10X_VDEV_PARAM_CHWIDTH,
3158 /* Channel Offset */
3159 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
3160 /* Disable HT Protection */
3161 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
3162 /* Quick STA Kickout */
3163 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
3164 /* Rate to be used with Management frames */
3165 WMI_10X_VDEV_PARAM_MGMT_RATE,
3166 /* Protection Mode */
3167 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
3168 /* Fixed rate setting */
3169 WMI_10X_VDEV_PARAM_FIXED_RATE,
3170 /* Short GI Enable/Disable */
3171 WMI_10X_VDEV_PARAM_SGI,
3172 /* Enable LDPC */
3173 WMI_10X_VDEV_PARAM_LDPC,
3174 /* Enable Tx STBC */
3175 WMI_10X_VDEV_PARAM_TX_STBC,
3176 /* Enable Rx STBC */
3177 WMI_10X_VDEV_PARAM_RX_STBC,
3178 /* Intra BSS forwarding */
3179 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
3180 /* Setting Default xmit key for Vdev */
3181 WMI_10X_VDEV_PARAM_DEF_KEYID,
3182 /* NSS width */
3183 WMI_10X_VDEV_PARAM_NSS,
3184 /* Set the custom rate for the broadcast data frames */
3185 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
3186 /* Set the custom rate (rate-code) for multicast data frames */
3187 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
3188 /* Tx multicast packet indicate Enable/Disable */
3189 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
3190 /* Tx DHCP packet indicate Enable/Disable */
3191 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
3192 /* Enable host inspection of Tx unicast packet to unknown destination */
3193 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3194
3195 /* The minimum amount of time AP begins to consider STA inactive */
3196 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3197
3198 /*
3199 * An associated STA is considered inactive when there is no recent
3200 * TX/RX activity and no downlink frames are buffered for it. Once a
3201 * STA exceeds the maximum idle inactive time, the AP will send an
3202 * 802.11 data-null as a keep alive to verify the STA is still
3203 * associated. If the STA does ACK the data-null, or if the data-null
3204 * is buffered and the STA does not retrieve it, the STA will be
3205 * considered unresponsive
3206 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3207 */
3208 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3209
3210 /*
3211 * An associated STA is considered unresponsive if there is no recent
3212 * TX/RX activity and downlink frames are buffered for it. Once a STA
3213 * exceeds the maximum unresponsive time, the AP will send a
3214 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
3215 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3216
3217 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3218 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
3219
3220 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
3221 /* Enable/Disable RTS-CTS */
3222 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
3223
3224 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
3225};
3226
5e3dd157
KV
3227/* slot time long */
3228#define WMI_VDEV_SLOT_TIME_LONG 0x1
3229/* slot time short */
3230#define WMI_VDEV_SLOT_TIME_SHORT 0x2
3231/* preablbe long */
3232#define WMI_VDEV_PREAMBLE_LONG 0x1
3233/* preablbe short */
3234#define WMI_VDEV_PREAMBLE_SHORT 0x2
3235
3236enum wmi_start_event_param {
3237 WMI_VDEV_RESP_START_EVENT = 0,
3238 WMI_VDEV_RESP_RESTART_EVENT,
3239};
3240
3241struct wmi_vdev_start_response_event {
3242 __le32 vdev_id;
3243 __le32 req_id;
3244 __le32 resp_type; /* %WMI_VDEV_RESP_ */
3245 __le32 status;
3246} __packed;
3247
3248struct wmi_vdev_standby_req_event {
3249 /* unique id identifying the VDEV, generated by the caller */
3250 __le32 vdev_id;
3251} __packed;
3252
3253struct wmi_vdev_resume_req_event {
3254 /* unique id identifying the VDEV, generated by the caller */
3255 __le32 vdev_id;
3256} __packed;
3257
3258struct wmi_vdev_stopped_event {
3259 /* unique id identifying the VDEV, generated by the caller */
3260 __le32 vdev_id;
3261} __packed;
3262
3263/*
3264 * common structure used for simple events
3265 * (stopped, resume_req, standby response)
3266 */
3267struct wmi_vdev_simple_event {
3268 /* unique id identifying the VDEV, generated by the caller */
3269 __le32 vdev_id;
3270} __packed;
3271
3272/* VDEV start response status codes */
3273/* VDEV succesfully started */
3274#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
3275
3276/* requested VDEV not found */
3277#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
3278
3279/* unsupported VDEV combination */
3280#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
3281
3282/* Beacon processing related command and event structures */
3283struct wmi_bcn_tx_hdr {
3284 __le32 vdev_id;
3285 __le32 tx_rate;
3286 __le32 tx_power;
3287 __le32 bcn_len;
3288} __packed;
3289
3290struct wmi_bcn_tx_cmd {
3291 struct wmi_bcn_tx_hdr hdr;
3292 u8 *bcn[0];
3293} __packed;
3294
3295struct wmi_bcn_tx_arg {
3296 u32 vdev_id;
3297 u32 tx_rate;
3298 u32 tx_power;
3299 u32 bcn_len;
3300 const void *bcn;
3301};
3302
3303/* Beacon filter */
3304#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
3305#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
3306#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
3307#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
3308#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
3309
3310struct wmi_bcn_filter_rx_cmd {
3311 /* Filter ID */
3312 __le32 bcn_filter_id;
3313 /* Filter type - wmi_bcn_filter */
3314 __le32 bcn_filter;
3315 /* Buffer len */
3316 __le32 bcn_filter_len;
3317 /* Filter info (threshold, BSSID, RSSI) */
3318 u8 *bcn_filter_buf;
3319} __packed;
3320
3321/* Capabilities and IEs to be passed to firmware */
3322struct wmi_bcn_prb_info {
3323 /* Capabilities */
3324 __le32 caps;
3325 /* ERP info */
3326 __le32 erp;
3327 /* Advanced capabilities */
3328 /* HT capabilities */
3329 /* HT Info */
3330 /* ibss_dfs */
3331 /* wpa Info */
3332 /* rsn Info */
3333 /* rrm info */
3334 /* ath_ext */
3335 /* app IE */
3336} __packed;
3337
3338struct wmi_bcn_tmpl_cmd {
3339 /* unique id identifying the VDEV, generated by the caller */
3340 __le32 vdev_id;
3341 /* TIM IE offset from the beginning of the template. */
3342 __le32 tim_ie_offset;
3343 /* beacon probe capabilities and IEs */
3344 struct wmi_bcn_prb_info bcn_prb_info;
3345 /* beacon buffer length */
3346 __le32 buf_len;
3347 /* variable length data */
3348 u8 data[1];
3349} __packed;
3350
3351struct wmi_prb_tmpl_cmd {
3352 /* unique id identifying the VDEV, generated by the caller */
3353 __le32 vdev_id;
3354 /* beacon probe capabilities and IEs */
3355 struct wmi_bcn_prb_info bcn_prb_info;
3356 /* beacon buffer length */
3357 __le32 buf_len;
3358 /* Variable length data */
3359 u8 data[1];
3360} __packed;
3361
3362enum wmi_sta_ps_mode {
3363 /* enable power save for the given STA VDEV */
3364 WMI_STA_PS_MODE_DISABLED = 0,
3365 /* disable power save for a given STA VDEV */
3366 WMI_STA_PS_MODE_ENABLED = 1,
3367};
3368
3369struct wmi_sta_powersave_mode_cmd {
3370 /* unique id identifying the VDEV, generated by the caller */
3371 __le32 vdev_id;
3372
3373 /*
3374 * Power save mode
3375 * (see enum wmi_sta_ps_mode)
3376 */
3377 __le32 sta_ps_mode;
3378} __packed;
3379
3380enum wmi_csa_offload_en {
3381 WMI_CSA_OFFLOAD_DISABLE = 0,
3382 WMI_CSA_OFFLOAD_ENABLE = 1,
3383};
3384
3385struct wmi_csa_offload_enable_cmd {
3386 __le32 vdev_id;
3387 __le32 csa_offload_enable;
3388} __packed;
3389
3390struct wmi_csa_offload_chanswitch_cmd {
3391 __le32 vdev_id;
3392 struct wmi_channel chan;
3393} __packed;
3394
3395/*
3396 * This parameter controls the policy for retrieving frames from AP while the
3397 * STA is in sleep state.
3398 *
3399 * Only takes affect if the sta_ps_mode is enabled
3400 */
3401enum wmi_sta_ps_param_rx_wake_policy {
3402 /*
3403 * Wake up when ever there is an RX activity on the VDEV. In this mode
3404 * the Power save SM(state machine) will come out of sleep by either
3405 * sending null frame (or) a data frame (with PS==0) in response to TIM
3406 * bit set in the received beacon frame from AP.
3407 */
3408 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
3409
3410 /*
3411 * Here the power save state machine will not wakeup in response to TIM
3412 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
3413 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
3414 * access categories are delivery-enabled, the station will send a
3415 * UAPSD trigger frame, otherwise it will send a PS-Poll.
3416 */
3417 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
3418};
3419
3420/*
3421 * Number of tx frames/beacon that cause the power save SM to wake up.
3422 *
3423 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
3424 * meaning, It will cause the SM to never wake up. This is useful if you want
3425 * to keep the system to sleep all the time for some kind of test mode . host
3426 * can change this parameter any time. It will affect at the next tx frame.
3427 */
3428enum wmi_sta_ps_param_tx_wake_threshold {
3429 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
3430 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
3431
3432 /*
3433 * Values greater than one indicate that many TX attempts per beacon
3434 * interval before the STA will wake up
3435 */
3436};
3437
3438/*
3439 * The maximum number of PS-Poll frames the FW will send in response to
3440 * traffic advertised in TIM before waking up (by sending a null frame with PS
3441 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
3442 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
3443 * parameter is used when the RX wake policy is
3444 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
3445 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
3446 */
3447enum wmi_sta_ps_param_pspoll_count {
3448 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
3449 /*
3450 * Values greater than 0 indicate the maximum numer of PS-Poll frames
3451 * FW will send before waking up.
3452 */
3453};
3454
3455/*
3456 * This will include the delivery and trigger enabled state for every AC.
3457 * This is the negotiated state with AP. The host MLME needs to set this based
3458 * on AP capability and the state Set in the association request by the
3459 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
3460 */
3461#define WMI_UAPSD_AC_TYPE_DELI 0
3462#define WMI_UAPSD_AC_TYPE_TRIG 1
3463
3464#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
3465 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
3466
3467enum wmi_sta_ps_param_uapsd {
3468 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
3469 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
3470 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
3471 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
3472 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
3473 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
3474 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
3475 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
3476};
3477
3478enum wmi_sta_powersave_param {
3479 /*
3480 * Controls how frames are retrievd from AP while STA is sleeping
3481 *
3482 * (see enum wmi_sta_ps_param_rx_wake_policy)
3483 */
3484 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
3485
3486 /*
3487 * The STA will go active after this many TX
3488 *
3489 * (see enum wmi_sta_ps_param_tx_wake_threshold)
3490 */
3491 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
3492
3493 /*
3494 * Number of PS-Poll to send before STA wakes up
3495 *
3496 * (see enum wmi_sta_ps_param_pspoll_count)
3497 *
3498 */
3499 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
3500
3501 /*
3502 * TX/RX inactivity time in msec before going to sleep.
3503 *
3504 * The power save SM will monitor tx/rx activity on the VDEV, if no
3505 * activity for the specified msec of the parameter the Power save
3506 * SM will go to sleep.
3507 */
3508 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
3509
3510 /*
3511 * Set uapsd configuration.
3512 *
3513 * (see enum wmi_sta_ps_param_uapsd)
3514 */
3515 WMI_STA_PS_PARAM_UAPSD = 4,
3516};
3517
3518struct wmi_sta_powersave_param_cmd {
3519 __le32 vdev_id;
3520 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
3521 __le32 param_value;
3522} __packed;
3523
3524/* No MIMO power save */
3525#define WMI_STA_MIMO_PS_MODE_DISABLE
3526/* mimo powersave mode static*/
3527#define WMI_STA_MIMO_PS_MODE_STATIC
3528/* mimo powersave mode dynamic */
3529#define WMI_STA_MIMO_PS_MODE_DYNAMIC
3530
3531struct wmi_sta_mimo_ps_mode_cmd {
3532 /* unique id identifying the VDEV, generated by the caller */
3533 __le32 vdev_id;
3534 /* mimo powersave mode as defined above */
3535 __le32 mimo_pwrsave_mode;
3536} __packed;
3537
3538/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
3539enum wmi_ap_ps_param_uapsd {
3540 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
3541 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
3542 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
3543 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
3544 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
3545 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
3546 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
3547 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
3548};
3549
3550/* U-APSD maximum service period of peer station */
3551enum wmi_ap_ps_peer_param_max_sp {
3552 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
3553 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
3554 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
3555 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
3556 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
3557};
3558
3559/*
3560 * AP power save parameter
3561 * Set a power save specific parameter for a peer station
3562 */
3563enum wmi_ap_ps_peer_param {
3564 /* Set uapsd configuration for a given peer.
3565 *
3566 * Include the delivery and trigger enabled state for every AC.
3567 * The host MLME needs to set this based on AP capability and stations
3568 * request Set in the association request received from the station.
3569 *
3570 * Lower 8 bits of the value specify the UAPSD configuration.
3571 *
3572 * (see enum wmi_ap_ps_param_uapsd)
3573 * The default value is 0.
3574 */
3575 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
3576
3577 /*
3578 * Set the service period for a UAPSD capable station
3579 *
3580 * The service period from wme ie in the (re)assoc request frame.
3581 *
3582 * (see enum wmi_ap_ps_peer_param_max_sp)
3583 */
3584 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
3585
3586 /* Time in seconds for aging out buffered frames for STA in PS */
3587 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
3588};
3589
3590struct wmi_ap_ps_peer_cmd {
3591 /* unique id identifying the VDEV, generated by the caller */
3592 __le32 vdev_id;
3593
3594 /* peer MAC address */
3595 struct wmi_mac_addr peer_macaddr;
3596
3597 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
3598 __le32 param_id;
3599
3600 /* AP powersave param value */
3601 __le32 param_value;
3602} __packed;
3603
3604/* 128 clients = 4 words */
3605#define WMI_TIM_BITMAP_ARRAY_SIZE 4
3606
3607struct wmi_tim_info {
3608 __le32 tim_len;
3609 __le32 tim_mcast;
3610 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
3611 __le32 tim_changed;
3612 __le32 tim_num_ps_pending;
3613} __packed;
3614
3615/* Maximum number of NOA Descriptors supported */
3616#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
3617#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
3618#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
3619#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
3620
3621struct wmi_p2p_noa_info {
3622 /* Bit 0 - Flag to indicate an update in NOA schedule
3623 Bits 7-1 - Reserved */
3624 u8 changed;
3625 /* NOA index */
3626 u8 index;
3627 /* Bit 0 - Opp PS state of the AP
3628 Bits 1-7 - Ctwindow in TUs */
3629 u8 ctwindow_oppps;
3630 /* Number of NOA descriptors */
3631 u8 num_descriptors;
3632
3633 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
3634} __packed;
3635
3636struct wmi_bcn_info {
3637 struct wmi_tim_info tim_info;
3638 struct wmi_p2p_noa_info p2p_noa_info;
3639} __packed;
3640
3641struct wmi_host_swba_event {
3642 __le32 vdev_map;
3643 struct wmi_bcn_info bcn_info[1];
3644} __packed;
3645
3646#define WMI_MAX_AP_VDEV 16
3647
3648struct wmi_tbtt_offset_event {
3649 __le32 vdev_map;
3650 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
3651} __packed;
3652
3653
3654struct wmi_peer_create_cmd {
3655 __le32 vdev_id;
3656 struct wmi_mac_addr peer_macaddr;
3657} __packed;
3658
3659struct wmi_peer_delete_cmd {
3660 __le32 vdev_id;
3661 struct wmi_mac_addr peer_macaddr;
3662} __packed;
3663
3664struct wmi_peer_flush_tids_cmd {
3665 __le32 vdev_id;
3666 struct wmi_mac_addr peer_macaddr;
3667 __le32 peer_tid_bitmap;
3668} __packed;
3669
3670struct wmi_fixed_rate {
3671 /*
3672 * rate mode . 0: disable fixed rate (auto rate)
3673 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
3674 * 2: ht20 11n rate specified as mcs index
3675 * 3: ht40 11n rate specified as mcs index
3676 */
3677 __le32 rate_mode;
3678 /*
3679 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
3680 * and series 3 is stored at byte 3 (MSB)
3681 */
3682 __le32 rate_series;
3683 /*
3684 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
3685 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
3686 * (MSB)
3687 */
3688 __le32 rate_retries;
3689} __packed;
3690
3691struct wmi_peer_fixed_rate_cmd {
3692 /* unique id identifying the VDEV, generated by the caller */
3693 __le32 vdev_id;
3694 /* peer MAC address */
3695 struct wmi_mac_addr peer_macaddr;
3696 /* fixed rate */
3697 struct wmi_fixed_rate peer_fixed_rate;
3698} __packed;
3699
3700#define WMI_MGMT_TID 17
3701
3702struct wmi_addba_clear_resp_cmd {
3703 /* unique id identifying the VDEV, generated by the caller */
3704 __le32 vdev_id;
3705 /* peer MAC address */
3706 struct wmi_mac_addr peer_macaddr;
3707} __packed;
3708
3709struct wmi_addba_send_cmd {
3710 /* unique id identifying the VDEV, generated by the caller */
3711 __le32 vdev_id;
3712 /* peer MAC address */
3713 struct wmi_mac_addr peer_macaddr;
3714 /* Tid number */
3715 __le32 tid;
3716 /* Buffer/Window size*/
3717 __le32 buffersize;
3718} __packed;
3719
3720struct wmi_delba_send_cmd {
3721 /* unique id identifying the VDEV, generated by the caller */
3722 __le32 vdev_id;
3723 /* peer MAC address */
3724 struct wmi_mac_addr peer_macaddr;
3725 /* Tid number */
3726 __le32 tid;
3727 /* Is Initiator */
3728 __le32 initiator;
3729 /* Reason code */
3730 __le32 reasoncode;
3731} __packed;
3732
3733struct wmi_addba_setresponse_cmd {
3734 /* unique id identifying the vdev, generated by the caller */
3735 __le32 vdev_id;
3736 /* peer mac address */
3737 struct wmi_mac_addr peer_macaddr;
3738 /* Tid number */
3739 __le32 tid;
3740 /* status code */
3741 __le32 statuscode;
3742} __packed;
3743
3744struct wmi_send_singleamsdu_cmd {
3745 /* unique id identifying the vdev, generated by the caller */
3746 __le32 vdev_id;
3747 /* peer mac address */
3748 struct wmi_mac_addr peer_macaddr;
3749 /* Tid number */
3750 __le32 tid;
3751} __packed;
3752
3753enum wmi_peer_smps_state {
3754 WMI_PEER_SMPS_PS_NONE = 0x0,
3755 WMI_PEER_SMPS_STATIC = 0x1,
3756 WMI_PEER_SMPS_DYNAMIC = 0x2
3757};
3758
3759enum wmi_peer_param {
3760 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
3761 WMI_PEER_AMPDU = 0x2,
3762 WMI_PEER_AUTHORIZE = 0x3,
3763 WMI_PEER_CHAN_WIDTH = 0x4,
3764 WMI_PEER_NSS = 0x5,
3765 WMI_PEER_USE_4ADDR = 0x6
3766};
3767
3768struct wmi_peer_set_param_cmd {
3769 __le32 vdev_id;
3770 struct wmi_mac_addr peer_macaddr;
3771 __le32 param_id;
3772 __le32 param_value;
3773} __packed;
3774
3775#define MAX_SUPPORTED_RATES 128
3776
3777struct wmi_rate_set {
3778 /* total number of rates */
3779 __le32 num_rates;
3780 /*
3781 * rates (each 8bit value) packed into a 32 bit word.
3782 * the rates are filled from least significant byte to most
3783 * significant byte.
3784 */
3785 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
3786} __packed;
3787
3788struct wmi_rate_set_arg {
3789 unsigned int num_rates;
3790 u8 rates[MAX_SUPPORTED_RATES];
3791};
3792
3793/*
3794 * NOTE: It would bea good idea to represent the Tx MCS
3795 * info in one word and Rx in another word. This is split
3796 * into multiple words for convenience
3797 */
3798struct wmi_vht_rate_set {
3799 __le32 rx_max_rate; /* Max Rx data rate */
3800 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
3801 __le32 tx_max_rate; /* Max Tx data rate */
3802 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
3803} __packed;
3804
3805struct wmi_vht_rate_set_arg {
3806 u32 rx_max_rate;
3807 u32 rx_mcs_set;
3808 u32 tx_max_rate;
3809 u32 tx_mcs_set;
3810};
3811
3812struct wmi_peer_set_rates_cmd {
3813 /* peer MAC address */
3814 struct wmi_mac_addr peer_macaddr;
3815 /* legacy rate set */
3816 struct wmi_rate_set peer_legacy_rates;
3817 /* ht rate set */
3818 struct wmi_rate_set peer_ht_rates;
3819} __packed;
3820
3821struct wmi_peer_set_q_empty_callback_cmd {
3822 /* unique id identifying the VDEV, generated by the caller */
3823 __le32 vdev_id;
3824 /* peer MAC address */
3825 struct wmi_mac_addr peer_macaddr;
3826 __le32 callback_enable;
3827} __packed;
3828
3829#define WMI_PEER_AUTH 0x00000001
3830#define WMI_PEER_QOS 0x00000002
3831#define WMI_PEER_NEED_PTK_4_WAY 0x00000004
3832#define WMI_PEER_NEED_GTK_2_WAY 0x00000010
3833#define WMI_PEER_APSD 0x00000800
3834#define WMI_PEER_HT 0x00001000
3835#define WMI_PEER_40MHZ 0x00002000
3836#define WMI_PEER_STBC 0x00008000
3837#define WMI_PEER_LDPC 0x00010000
3838#define WMI_PEER_DYN_MIMOPS 0x00020000
3839#define WMI_PEER_STATIC_MIMOPS 0x00040000
3840#define WMI_PEER_SPATIAL_MUX 0x00200000
3841#define WMI_PEER_VHT 0x02000000
3842#define WMI_PEER_80MHZ 0x04000000
3843#define WMI_PEER_PMF 0x08000000
3844
3845/*
3846 * Peer rate capabilities.
3847 *
3848 * This is of interest to the ratecontrol
3849 * module which resides in the firmware. The bit definitions are
3850 * consistent with that defined in if_athrate.c.
3851 */
3852#define WMI_RC_DS_FLAG 0x01
3853#define WMI_RC_CW40_FLAG 0x02
3854#define WMI_RC_SGI_FLAG 0x04
3855#define WMI_RC_HT_FLAG 0x08
3856#define WMI_RC_RTSCTS_FLAG 0x10
3857#define WMI_RC_TX_STBC_FLAG 0x20
3858#define WMI_RC_RX_STBC_FLAG 0xC0
3859#define WMI_RC_RX_STBC_FLAG_S 6
3860#define WMI_RC_WEP_TKIP_FLAG 0x100
3861#define WMI_RC_TS_FLAG 0x200
3862#define WMI_RC_UAPSD_FLAG 0x400
3863
3864/* Maximum listen interval supported by hw in units of beacon interval */
3865#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
3866
3867struct wmi_peer_assoc_complete_cmd {
3868 struct wmi_mac_addr peer_macaddr;
3869 __le32 vdev_id;
3870 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
3871 __le32 peer_associd; /* 16 LSBs */
3872 __le32 peer_flags;
3873 __le32 peer_caps; /* 16 LSBs */
3874 __le32 peer_listen_intval;
3875 __le32 peer_ht_caps;
3876 __le32 peer_max_mpdu;
3877 __le32 peer_mpdu_density; /* 0..16 */
3878 __le32 peer_rate_caps;
3879 struct wmi_rate_set peer_legacy_rates;
3880 struct wmi_rate_set peer_ht_rates;
3881 __le32 peer_nss; /* num of spatial streams */
3882 __le32 peer_vht_caps;
3883 __le32 peer_phymode;
3884 struct wmi_vht_rate_set peer_vht_rates;
3885 /* HT Operation Element of the peer. Five bytes packed in 2
3886 * INT32 array and filled from lsb to msb. */
3887 __le32 peer_ht_info[2];
3888} __packed;
3889
3890struct wmi_peer_assoc_complete_arg {
3891 u8 addr[ETH_ALEN];
3892 u32 vdev_id;
3893 bool peer_reassoc;
3894 u16 peer_aid;
3895 u32 peer_flags; /* see %WMI_PEER_ */
3896 u16 peer_caps;
3897 u32 peer_listen_intval;
3898 u32 peer_ht_caps;
3899 u32 peer_max_mpdu;
3900 u32 peer_mpdu_density; /* 0..16 */
3901 u32 peer_rate_caps; /* see %WMI_RC_ */
3902 struct wmi_rate_set_arg peer_legacy_rates;
3903 struct wmi_rate_set_arg peer_ht_rates;
3904 u32 peer_num_spatial_streams;
3905 u32 peer_vht_caps;
3906 enum wmi_phy_mode peer_phymode;
3907 struct wmi_vht_rate_set_arg peer_vht_rates;
3908};
3909
3910struct wmi_peer_add_wds_entry_cmd {
3911 /* peer MAC address */
3912 struct wmi_mac_addr peer_macaddr;
3913 /* wds MAC addr */
3914 struct wmi_mac_addr wds_macaddr;
3915} __packed;
3916
3917struct wmi_peer_remove_wds_entry_cmd {
3918 /* wds MAC addr */
3919 struct wmi_mac_addr wds_macaddr;
3920} __packed;
3921
3922struct wmi_peer_q_empty_callback_event {
3923 /* peer MAC address */
3924 struct wmi_mac_addr peer_macaddr;
3925} __packed;
3926
3927/*
3928 * Channel info WMI event
3929 */
3930struct wmi_chan_info_event {
3931 __le32 err_code;
3932 __le32 freq;
3933 __le32 cmd_flags;
3934 __le32 noise_floor;
3935 __le32 rx_clear_count;
3936 __le32 cycle_count;
3937} __packed;
3938
2e1dea40
MK
3939#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
3940
3941/* FIXME: empirically extrapolated */
3942#define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
3943
5e3dd157
KV
3944/* Beacon filter wmi command info */
3945#define BCN_FLT_MAX_SUPPORTED_IES 256
3946#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
3947
3948struct bss_bcn_stats {
3949 __le32 vdev_id;
3950 __le32 bss_bcnsdropped;
3951 __le32 bss_bcnsdelivered;
3952} __packed;
3953
3954struct bcn_filter_stats {
3955 __le32 bcns_dropped;
3956 __le32 bcns_delivered;
3957 __le32 activefilters;
3958 struct bss_bcn_stats bss_stats;
3959} __packed;
3960
3961struct wmi_add_bcn_filter_cmd {
3962 u32 vdev_id;
3963 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
3964} __packed;
3965
3966enum wmi_sta_keepalive_method {
3967 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
3968 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
3969};
3970
3971/* note: ip4 addresses are in network byte order, i.e. big endian */
3972struct wmi_sta_keepalive_arp_resp {
3973 __be32 src_ip4_addr;
3974 __be32 dest_ip4_addr;
3975 struct wmi_mac_addr dest_mac_addr;
3976} __packed;
3977
3978struct wmi_sta_keepalive_cmd {
3979 __le32 vdev_id;
3980 __le32 enabled;
3981 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
3982 __le32 interval; /* in seconds */
3983 struct wmi_sta_keepalive_arp_resp arp_resp;
3984} __packed;
3985
9cfbce75
MK
3986enum wmi_force_fw_hang_type {
3987 WMI_FORCE_FW_HANG_ASSERT = 1,
3988 WMI_FORCE_FW_HANG_NO_DETECT,
3989 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
3990 WMI_FORCE_FW_HANG_EMPTY_POINT,
3991 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
3992 WMI_FORCE_FW_HANG_INFINITE_LOOP,
3993};
3994
3995#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
3996
3997struct wmi_force_fw_hang_cmd {
3998 __le32 type;
3999 __le32 delay_ms;
4000} __packed;
4001
5e3dd157
KV
4002#define ATH10K_RTS_MAX 2347
4003#define ATH10K_FRAGMT_THRESHOLD_MIN 540
4004#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
4005
4006#define WMI_MAX_EVENT 0x1000
4007/* Maximum number of pending TXed WMI packets */
5e3dd157
KV
4008#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
4009
4010/* By default disable power save for IBSS */
4011#define ATH10K_DEFAULT_ATIM 0
4012
4013struct ath10k;
4014struct ath10k_vif;
4015
4016int ath10k_wmi_attach(struct ath10k *ar);
4017void ath10k_wmi_detach(struct ath10k *ar);
4018int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
4019int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
5e3dd157
KV
4020
4021int ath10k_wmi_connect_htc_service(struct ath10k *ar);
4022int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
4023 const struct wmi_channel_arg *);
4024int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
4025int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
4026int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
4027 u16 rd5g, u16 ctl2g, u16 ctl5g);
226a339b 4028int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
5e3dd157
KV
4029int ath10k_wmi_cmd_init(struct ath10k *ar);
4030int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
4031void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
4032int ath10k_wmi_stop_scan(struct ath10k *ar,
4033 const struct wmi_stop_scan_arg *arg);
4034int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
4035 enum wmi_vdev_type type,
4036 enum wmi_vdev_subtype subtype,
4037 const u8 macaddr[ETH_ALEN]);
4038int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
4039int ath10k_wmi_vdev_start(struct ath10k *ar,
4040 const struct wmi_vdev_start_request_arg *);
4041int ath10k_wmi_vdev_restart(struct ath10k *ar,
4042 const struct wmi_vdev_start_request_arg *);
4043int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
4044int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
4045 const u8 *bssid);
4046int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
4047int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
6d1506e7 4048 u32 param_id, u32 param_value);
5e3dd157
KV
4049int ath10k_wmi_vdev_install_key(struct ath10k *ar,
4050 const struct wmi_vdev_install_key_arg *arg);
4051int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
4052 const u8 peer_addr[ETH_ALEN]);
4053int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
4054 const u8 peer_addr[ETH_ALEN]);
4055int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
4056 const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
4057int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
4058 const u8 *peer_addr,
4059 enum wmi_peer_param param_id, u32 param_value);
4060int ath10k_wmi_peer_assoc(struct ath10k *ar,
4061 const struct wmi_peer_assoc_complete_arg *arg);
4062int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
4063 enum wmi_sta_ps_mode psmode);
4064int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
4065 enum wmi_sta_powersave_param param_id,
4066 u32 value);
4067int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
4068 enum wmi_ap_ps_peer_param param_id, u32 value);
4069int ath10k_wmi_scan_chan_list(struct ath10k *ar,
4070 const struct wmi_scan_chan_list_arg *arg);
ed54388a
MK
4071int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
4072 const struct wmi_bcn_tx_arg *arg);
5e3dd157
KV
4073int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
4074 const struct wmi_pdev_set_wmm_params_arg *arg);
4075int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
9cfbce75
MK
4076int ath10k_wmi_force_fw_hang(struct ath10k *ar,
4077 enum wmi_force_fw_hang_type type, u32 delay_ms);
5e00d31a 4078int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
5e3dd157
KV
4079
4080#endif /* _WMI_H_ */
This page took 0.450726 seconds and 5 git commands to generate.