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