blob: 65eb3439211f025da7018f8c1ef668dc922467ed [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
Kalle Valo5e3dd152013-06-12 20:52:10 +0300806enum wmi_phy_mode {
807 MODE_11A = 0, /* 11a Mode */
808 MODE_11G = 1, /* 11b/g Mode */
809 MODE_11B = 2, /* 11b Mode */
810 MODE_11GONLY = 3, /* 11g only Mode */
811 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
812 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
813 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
814 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
815 MODE_11AC_VHT20 = 8,
816 MODE_11AC_VHT40 = 9,
817 MODE_11AC_VHT80 = 10,
818 /* MODE_11AC_VHT160 = 11, */
819 MODE_11AC_VHT20_2G = 11,
820 MODE_11AC_VHT40_2G = 12,
821 MODE_11AC_VHT80_2G = 13,
822 MODE_UNKNOWN = 14,
823 MODE_MAX = 14
824};
825
Kalle Valo38a1d472013-09-08 17:56:14 +0300826static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
827{
828 switch (mode) {
829 case MODE_11A:
830 return "11a";
831 case MODE_11G:
832 return "11g";
833 case MODE_11B:
834 return "11b";
835 case MODE_11GONLY:
836 return "11gonly";
837 case MODE_11NA_HT20:
838 return "11na-ht20";
839 case MODE_11NG_HT20:
840 return "11ng-ht20";
841 case MODE_11NA_HT40:
842 return "11na-ht40";
843 case MODE_11NG_HT40:
844 return "11ng-ht40";
845 case MODE_11AC_VHT20:
846 return "11ac-vht20";
847 case MODE_11AC_VHT40:
848 return "11ac-vht40";
849 case MODE_11AC_VHT80:
850 return "11ac-vht80";
851 case MODE_11AC_VHT20_2G:
852 return "11ac-vht20-2g";
853 case MODE_11AC_VHT40_2G:
854 return "11ac-vht40-2g";
855 case MODE_11AC_VHT80_2G:
856 return "11ac-vht80-2g";
857 case MODE_UNKNOWN:
858 /* skip */
859 break;
860
861 /* no default handler to allow compiler to check that the
862 * enum is fully handled */
863 };
864
865 return "<unknown>";
866}
867
Kalle Valo5e3dd152013-06-12 20:52:10 +0300868#define WMI_CHAN_LIST_TAG 0x1
869#define WMI_SSID_LIST_TAG 0x2
870#define WMI_BSSID_LIST_TAG 0x3
871#define WMI_IE_TAG 0x4
872
873struct wmi_channel {
874 __le32 mhz;
875 __le32 band_center_freq1;
876 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
877 union {
878 __le32 flags; /* WMI_CHAN_FLAG_ */
879 struct {
880 u8 mode; /* only 6 LSBs */
881 } __packed;
882 } __packed;
883 union {
884 __le32 reginfo0;
885 struct {
Michal Kazior02256932013-10-23 04:02:14 -0700886 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +0300887 u8 min_power;
888 u8 max_power;
889 u8 reg_power;
890 u8 reg_classid;
891 } __packed;
892 } __packed;
893 union {
894 __le32 reginfo1;
895 struct {
896 u8 antenna_max;
897 } __packed;
898 } __packed;
899} __packed;
900
901struct wmi_channel_arg {
902 u32 freq;
903 u32 band_center_freq1;
904 bool passive;
905 bool allow_ibss;
906 bool allow_ht;
907 bool allow_vht;
908 bool ht40plus;
Marek Puzyniake8a50f82013-11-20 09:59:47 +0200909 bool chan_radar;
Michal Kazior02256932013-10-23 04:02:14 -0700910 /* note: power unit is 0.5 dBm */
Kalle Valo5e3dd152013-06-12 20:52:10 +0300911 u32 min_power;
912 u32 max_power;
913 u32 max_reg_power;
914 u32 max_antenna_gain;
915 u32 reg_class_id;
916 enum wmi_phy_mode mode;
917};
918
919enum wmi_channel_change_cause {
920 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
921 WMI_CHANNEL_CHANGE_CAUSE_CSA,
922};
923
924#define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
925#define WMI_CHAN_FLAG_PASSIVE (1 << 7)
926#define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
927#define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
928#define WMI_CHAN_FLAG_DFS (1 << 10)
929#define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
930#define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
931
932/* Indicate reason for channel switch */
933#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
934
935#define WMI_MAX_SPATIAL_STREAM 3
936
937/* HT Capabilities*/
938#define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
939#define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
940#define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
941#define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
942#define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
943#define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
944#define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
945#define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
946#define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
947#define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
948#define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
949#define WMI_HT_CAP_HT40_SGI 0x0800
950
951#define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
952 WMI_HT_CAP_HT20_SGI | \
953 WMI_HT_CAP_HT40_SGI | \
954 WMI_HT_CAP_TX_STBC | \
955 WMI_HT_CAP_RX_STBC | \
956 WMI_HT_CAP_LDPC)
957
958
959/*
960 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
961 * field. The fields not defined here are not supported, or reserved.
962 * Do not change these masks and if you have to add new one follow the
963 * bitmask as specified by 802.11ac draft.
964 */
965
966#define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
967#define WMI_VHT_CAP_RX_LDPC 0x00000010
968#define WMI_VHT_CAP_SGI_80MHZ 0x00000020
969#define WMI_VHT_CAP_TX_STBC 0x00000080
970#define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
971#define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
972#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
973#define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
974#define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
975#define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
976
977/* The following also refer for max HT AMSDU */
978#define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
979#define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
980#define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
981
982#define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
983 WMI_VHT_CAP_RX_LDPC | \
984 WMI_VHT_CAP_SGI_80MHZ | \
985 WMI_VHT_CAP_TX_STBC | \
986 WMI_VHT_CAP_RX_STBC_MASK | \
987 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
988 WMI_VHT_CAP_RX_FIXED_ANT | \
989 WMI_VHT_CAP_TX_FIXED_ANT)
990
991/*
992 * Interested readers refer to Rx/Tx MCS Map definition as defined in
993 * 802.11ac
994 */
995#define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
996#define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
997#define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
998
999enum {
1000 REGDMN_MODE_11A = 0x00001, /* 11a channels */
1001 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
1002 REGDMN_MODE_11B = 0x00004, /* 11b channels */
1003 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
1004 REGDMN_MODE_11G = 0x00008, /* XXX historical */
1005 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
1006 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
1007 REGDMN_MODE_XR = 0x00100, /* XR channels */
1008 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
1009 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
1010 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
1011 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
1012 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
1013 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
1014 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
1015 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
1016 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
1017 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
1018 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
1019 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
1020 REGDMN_MODE_ALL = 0xffffffff
1021};
1022
1023#define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
1024#define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
1025#define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
1026
1027/* regulatory capabilities */
1028#define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
1029#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
1030#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
1031#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
1032#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
1033#define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
1034
1035struct hal_reg_capabilities {
1036 /* regdomain value specified in EEPROM */
1037 __le32 eeprom_rd;
1038 /*regdomain */
1039 __le32 eeprom_rd_ext;
1040 /* CAP1 capabilities bit map. */
1041 __le32 regcap1;
1042 /* REGDMN EEPROM CAP. */
1043 __le32 regcap2;
1044 /* REGDMN MODE */
1045 __le32 wireless_modes;
1046 __le32 low_2ghz_chan;
1047 __le32 high_2ghz_chan;
1048 __le32 low_5ghz_chan;
1049 __le32 high_5ghz_chan;
1050} __packed;
1051
1052enum wlan_mode_capability {
1053 WHAL_WLAN_11A_CAPABILITY = 0x1,
1054 WHAL_WLAN_11G_CAPABILITY = 0x2,
1055 WHAL_WLAN_11AG_CAPABILITY = 0x3,
1056};
1057
1058/* structure used by FW for requesting host memory */
1059struct wlan_host_mem_req {
1060 /* ID of the request */
1061 __le32 req_id;
1062 /* size of the of each unit */
1063 __le32 unit_size;
1064 /* flags to indicate that
1065 * the number units is dependent
1066 * on number of resources(num vdevs num peers .. etc)
1067 */
1068 __le32 num_unit_info;
1069 /*
1070 * actual number of units to allocate . if flags in the num_unit_info
1071 * indicate that number of units is tied to number of a particular
1072 * resource to allocate then num_units filed is set to 0 and host
1073 * will derive the number units from number of the resources it is
1074 * requesting.
1075 */
1076 __le32 num_units;
1077} __packed;
1078
1079#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
1080 ((((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
1081 (1 << ((svc_id)%(sizeof(u32))))) != 0)
1082
1083/*
1084 * The following struct holds optional payload for
1085 * wmi_service_ready_event,e.g., 11ac pass some of the
1086 * device capability to the host.
1087 */
1088struct wmi_service_ready_event {
1089 __le32 sw_version;
1090 __le32 sw_version_1;
1091 __le32 abi_version;
1092 /* WMI_PHY_CAPABILITY */
1093 __le32 phy_capability;
1094 /* Maximum number of frag table entries that SW will populate less 1 */
1095 __le32 max_frag_entry;
1096 __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1097 __le32 num_rf_chains;
1098 /*
1099 * The following field is only valid for service type
1100 * WMI_SERVICE_11AC
1101 */
1102 __le32 ht_cap_info; /* WMI HT Capability */
1103 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1104 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1105 __le32 hw_min_tx_power;
1106 __le32 hw_max_tx_power;
1107 struct hal_reg_capabilities hal_reg_capabilities;
1108 __le32 sys_cap_info;
1109 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1110 /*
1111 * Max beacon and Probe Response IE offload size
1112 * (includes optional P2P IEs)
1113 */
1114 __le32 max_bcn_ie_size;
1115 /*
1116 * request to host to allocate a chuck of memory and pss it down to FW
1117 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1118 * data structures. Only valid for low latency interfaces like PCIE
1119 * where FW can access this memory directly (or) by DMA.
1120 */
1121 __le32 num_mem_reqs;
1122 struct wlan_host_mem_req mem_reqs[1];
1123} __packed;
1124
Bartosz Markowski6f97d252013-09-26 17:47:09 +02001125/* This is the definition from 10.X firmware branch */
1126struct wmi_service_ready_event_10x {
1127 __le32 sw_version;
1128 __le32 abi_version;
1129
1130 /* WMI_PHY_CAPABILITY */
1131 __le32 phy_capability;
1132
1133 /* Maximum number of frag table entries that SW will populate less 1 */
1134 __le32 max_frag_entry;
1135 __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
1136 __le32 num_rf_chains;
1137
1138 /*
1139 * The following field is only valid for service type
1140 * WMI_SERVICE_11AC
1141 */
1142 __le32 ht_cap_info; /* WMI HT Capability */
1143 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
1144 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
1145 __le32 hw_min_tx_power;
1146 __le32 hw_max_tx_power;
1147
1148 struct hal_reg_capabilities hal_reg_capabilities;
1149
1150 __le32 sys_cap_info;
1151 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
1152
1153 /*
1154 * request to host to allocate a chuck of memory and pss it down to FW
1155 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
1156 * data structures. Only valid for low latency interfaces like PCIE
1157 * where FW can access this memory directly (or) by DMA.
1158 */
1159 __le32 num_mem_reqs;
1160
1161 struct wlan_host_mem_req mem_reqs[1];
1162} __packed;
1163
1164
Kalle Valo5e3dd152013-06-12 20:52:10 +03001165#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
1166#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
1167
1168struct wmi_ready_event {
1169 __le32 sw_version;
1170 __le32 abi_version;
1171 struct wmi_mac_addr mac_addr;
1172 __le32 status;
1173} __packed;
1174
1175struct wmi_resource_config {
1176 /* number of virtual devices (VAPs) to support */
1177 __le32 num_vdevs;
1178
1179 /* number of peer nodes to support */
1180 __le32 num_peers;
1181
1182 /*
1183 * In offload mode target supports features like WOW, chatter and
1184 * other protocol offloads. In order to support them some
1185 * functionalities like reorder buffering, PN checking need to be
1186 * done in target. This determines maximum number of peers suported
1187 * by target in offload mode
1188 */
1189 __le32 num_offload_peers;
1190
1191 /* For target-based RX reordering */
1192 __le32 num_offload_reorder_bufs;
1193
1194 /* number of keys per peer */
1195 __le32 num_peer_keys;
1196
1197 /* total number of TX/RX data TIDs */
1198 __le32 num_tids;
1199
1200 /*
1201 * max skid for resolving hash collisions
1202 *
1203 * The address search table is sparse, so that if two MAC addresses
1204 * result in the same hash value, the second of these conflicting
1205 * entries can slide to the next index in the address search table,
1206 * and use it, if it is unoccupied. This ast_skid_limit parameter
1207 * specifies the upper bound on how many subsequent indices to search
1208 * over to find an unoccupied space.
1209 */
1210 __le32 ast_skid_limit;
1211
1212 /*
1213 * the nominal chain mask for transmit
1214 *
1215 * The chain mask may be modified dynamically, e.g. to operate AP
1216 * tx with a reduced number of chains if no clients are associated.
1217 * This configuration parameter specifies the nominal chain-mask that
1218 * should be used when not operating with a reduced set of tx chains.
1219 */
1220 __le32 tx_chain_mask;
1221
1222 /*
1223 * the nominal chain mask for receive
1224 *
1225 * The chain mask may be modified dynamically, e.g. for a client
1226 * to use a reduced number of chains for receive if the traffic to
1227 * the client is low enough that it doesn't require downlink MIMO
1228 * or antenna diversity.
1229 * This configuration parameter specifies the nominal chain-mask that
1230 * should be used when not operating with a reduced set of rx chains.
1231 */
1232 __le32 rx_chain_mask;
1233
1234 /*
1235 * what rx reorder timeout (ms) to use for the AC
1236 *
1237 * Each WMM access class (voice, video, best-effort, background) will
1238 * have its own timeout value to dictate how long to wait for missing
1239 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1240 * already been received.
1241 * This parameter specifies the timeout in milliseconds for each
1242 * class.
1243 */
1244 __le32 rx_timeout_pri_vi;
1245 __le32 rx_timeout_pri_vo;
1246 __le32 rx_timeout_pri_be;
1247 __le32 rx_timeout_pri_bk;
1248
1249 /*
1250 * what mode the rx should decap packets to
1251 *
1252 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1253 * THis setting also determines the default TX behavior, however TX
1254 * behavior can be modified on a per VAP basis during VAP init
1255 */
1256 __le32 rx_decap_mode;
1257
1258 /* what is the maximum scan requests than can be queued */
1259 __le32 scan_max_pending_reqs;
1260
1261 /* maximum VDEV that could use BMISS offload */
1262 __le32 bmiss_offload_max_vdev;
1263
1264 /* maximum VDEV that could use offload roaming */
1265 __le32 roam_offload_max_vdev;
1266
1267 /* maximum AP profiles that would push to offload roaming */
1268 __le32 roam_offload_max_ap_profiles;
1269
1270 /*
1271 * how many groups to use for mcast->ucast conversion
1272 *
1273 * The target's WAL maintains a table to hold information regarding
1274 * which peers belong to a given multicast group, so that if
1275 * multicast->unicast conversion is enabled, the target can convert
1276 * multicast tx frames to a series of unicast tx frames, to each
1277 * peer within the multicast group.
1278 This num_mcast_groups configuration parameter tells the target how
1279 * many multicast groups to provide storage for within its multicast
1280 * group membership table.
1281 */
1282 __le32 num_mcast_groups;
1283
1284 /*
1285 * size to alloc for the mcast membership table
1286 *
1287 * This num_mcast_table_elems configuration parameter tells the
1288 * target how many peer elements it needs to provide storage for in
1289 * its multicast group membership table.
1290 * These multicast group membership table elements are shared by the
1291 * multicast groups stored within the table.
1292 */
1293 __le32 num_mcast_table_elems;
1294
1295 /*
1296 * whether/how to do multicast->unicast conversion
1297 *
1298 * This configuration parameter specifies whether the target should
1299 * perform multicast --> unicast conversion on transmit, and if so,
1300 * what to do if it finds no entries in its multicast group
1301 * membership table for the multicast IP address in the tx frame.
1302 * Configuration value:
1303 * 0 -> Do not perform multicast to unicast conversion.
1304 * 1 -> Convert multicast frames to unicast, if the IP multicast
1305 * address from the tx frame is found in the multicast group
1306 * membership table. If the IP multicast address is not found,
1307 * drop the frame.
1308 * 2 -> Convert multicast frames to unicast, if the IP multicast
1309 * address from the tx frame is found in the multicast group
1310 * membership table. If the IP multicast address is not found,
1311 * transmit the frame as multicast.
1312 */
1313 __le32 mcast2ucast_mode;
1314
1315 /*
1316 * how much memory to allocate for a tx PPDU dbg log
1317 *
1318 * This parameter controls how much memory the target will allocate
1319 * to store a log of tx PPDU meta-information (how large the PPDU
1320 * was, when it was sent, whether it was successful, etc.)
1321 */
1322 __le32 tx_dbg_log_size;
1323
1324 /* how many AST entries to be allocated for WDS */
1325 __le32 num_wds_entries;
1326
1327 /*
1328 * MAC DMA burst size, e.g., For target PCI limit can be
1329 * 0 -default, 1 256B
1330 */
1331 __le32 dma_burst_size;
1332
1333 /*
1334 * Fixed delimiters to be inserted after every MPDU to
1335 * account for interface latency to avoid underrun.
1336 */
1337 __le32 mac_aggr_delim;
1338
1339 /*
1340 * determine whether target is responsible for detecting duplicate
1341 * non-aggregate MPDU and timing out stale fragments.
1342 *
1343 * A-MPDU reordering is always performed on the target.
1344 *
1345 * 0: target responsible for frag timeout and dup checking
1346 * 1: host responsible for frag timeout and dup checking
1347 */
1348 __le32 rx_skip_defrag_timeout_dup_detection_check;
1349
1350 /*
1351 * Configuration for VoW :
1352 * No of Video Nodes to be supported
1353 * and Max no of descriptors for each Video link (node).
1354 */
1355 __le32 vow_config;
1356
1357 /* maximum VDEV that could use GTK offload */
1358 __le32 gtk_offload_max_vdev;
1359
1360 /* Number of msdu descriptors target should use */
1361 __le32 num_msdu_desc;
1362
1363 /*
1364 * Max. number of Tx fragments per MSDU
1365 * This parameter controls the max number of Tx fragments per MSDU.
1366 * This is sent by the target as part of the WMI_SERVICE_READY event
1367 * and is overriden by the OS shim as required.
1368 */
1369 __le32 max_frag_entries;
1370} __packed;
1371
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02001372struct wmi_resource_config_10x {
1373 /* number of virtual devices (VAPs) to support */
1374 __le32 num_vdevs;
1375
1376 /* number of peer nodes to support */
1377 __le32 num_peers;
1378
1379 /* number of keys per peer */
1380 __le32 num_peer_keys;
1381
1382 /* total number of TX/RX data TIDs */
1383 __le32 num_tids;
1384
1385 /*
1386 * max skid for resolving hash collisions
1387 *
1388 * The address search table is sparse, so that if two MAC addresses
1389 * result in the same hash value, the second of these conflicting
1390 * entries can slide to the next index in the address search table,
1391 * and use it, if it is unoccupied. This ast_skid_limit parameter
1392 * specifies the upper bound on how many subsequent indices to search
1393 * over to find an unoccupied space.
1394 */
1395 __le32 ast_skid_limit;
1396
1397 /*
1398 * the nominal chain mask for transmit
1399 *
1400 * The chain mask may be modified dynamically, e.g. to operate AP
1401 * tx with a reduced number of chains if no clients are associated.
1402 * This configuration parameter specifies the nominal chain-mask that
1403 * should be used when not operating with a reduced set of tx chains.
1404 */
1405 __le32 tx_chain_mask;
1406
1407 /*
1408 * the nominal chain mask for receive
1409 *
1410 * The chain mask may be modified dynamically, e.g. for a client
1411 * to use a reduced number of chains for receive if the traffic to
1412 * the client is low enough that it doesn't require downlink MIMO
1413 * or antenna diversity.
1414 * This configuration parameter specifies the nominal chain-mask that
1415 * should be used when not operating with a reduced set of rx chains.
1416 */
1417 __le32 rx_chain_mask;
1418
1419 /*
1420 * what rx reorder timeout (ms) to use for the AC
1421 *
1422 * Each WMM access class (voice, video, best-effort, background) will
1423 * have its own timeout value to dictate how long to wait for missing
1424 * rx MPDUs to arrive before flushing subsequent MPDUs that have
1425 * already been received.
1426 * This parameter specifies the timeout in milliseconds for each
1427 * class.
1428 */
1429 __le32 rx_timeout_pri_vi;
1430 __le32 rx_timeout_pri_vo;
1431 __le32 rx_timeout_pri_be;
1432 __le32 rx_timeout_pri_bk;
1433
1434 /*
1435 * what mode the rx should decap packets to
1436 *
1437 * MAC can decap to RAW (no decap), native wifi or Ethernet types
1438 * THis setting also determines the default TX behavior, however TX
1439 * behavior can be modified on a per VAP basis during VAP init
1440 */
1441 __le32 rx_decap_mode;
1442
1443 /* what is the maximum scan requests than can be queued */
1444 __le32 scan_max_pending_reqs;
1445
1446 /* maximum VDEV that could use BMISS offload */
1447 __le32 bmiss_offload_max_vdev;
1448
1449 /* maximum VDEV that could use offload roaming */
1450 __le32 roam_offload_max_vdev;
1451
1452 /* maximum AP profiles that would push to offload roaming */
1453 __le32 roam_offload_max_ap_profiles;
1454
1455 /*
1456 * how many groups to use for mcast->ucast conversion
1457 *
1458 * The target's WAL maintains a table to hold information regarding
1459 * which peers belong to a given multicast group, so that if
1460 * multicast->unicast conversion is enabled, the target can convert
1461 * multicast tx frames to a series of unicast tx frames, to each
1462 * peer within the multicast group.
1463 This num_mcast_groups configuration parameter tells the target how
1464 * many multicast groups to provide storage for within its multicast
1465 * group membership table.
1466 */
1467 __le32 num_mcast_groups;
1468
1469 /*
1470 * size to alloc for the mcast membership table
1471 *
1472 * This num_mcast_table_elems configuration parameter tells the
1473 * target how many peer elements it needs to provide storage for in
1474 * its multicast group membership table.
1475 * These multicast group membership table elements are shared by the
1476 * multicast groups stored within the table.
1477 */
1478 __le32 num_mcast_table_elems;
1479
1480 /*
1481 * whether/how to do multicast->unicast conversion
1482 *
1483 * This configuration parameter specifies whether the target should
1484 * perform multicast --> unicast conversion on transmit, and if so,
1485 * what to do if it finds no entries in its multicast group
1486 * membership table for the multicast IP address in the tx frame.
1487 * Configuration value:
1488 * 0 -> Do not perform multicast to unicast conversion.
1489 * 1 -> Convert multicast frames to unicast, if the IP multicast
1490 * address from the tx frame is found in the multicast group
1491 * membership table. If the IP multicast address is not found,
1492 * drop the frame.
1493 * 2 -> Convert multicast frames to unicast, if the IP multicast
1494 * address from the tx frame is found in the multicast group
1495 * membership table. If the IP multicast address is not found,
1496 * transmit the frame as multicast.
1497 */
1498 __le32 mcast2ucast_mode;
1499
1500 /*
1501 * how much memory to allocate for a tx PPDU dbg log
1502 *
1503 * This parameter controls how much memory the target will allocate
1504 * to store a log of tx PPDU meta-information (how large the PPDU
1505 * was, when it was sent, whether it was successful, etc.)
1506 */
1507 __le32 tx_dbg_log_size;
1508
1509 /* how many AST entries to be allocated for WDS */
1510 __le32 num_wds_entries;
1511
1512 /*
1513 * MAC DMA burst size, e.g., For target PCI limit can be
1514 * 0 -default, 1 256B
1515 */
1516 __le32 dma_burst_size;
1517
1518 /*
1519 * Fixed delimiters to be inserted after every MPDU to
1520 * account for interface latency to avoid underrun.
1521 */
1522 __le32 mac_aggr_delim;
1523
1524 /*
1525 * determine whether target is responsible for detecting duplicate
1526 * non-aggregate MPDU and timing out stale fragments.
1527 *
1528 * A-MPDU reordering is always performed on the target.
1529 *
1530 * 0: target responsible for frag timeout and dup checking
1531 * 1: host responsible for frag timeout and dup checking
1532 */
1533 __le32 rx_skip_defrag_timeout_dup_detection_check;
1534
1535 /*
1536 * Configuration for VoW :
1537 * No of Video Nodes to be supported
1538 * and Max no of descriptors for each Video link (node).
1539 */
1540 __le32 vow_config;
1541
1542 /* Number of msdu descriptors target should use */
1543 __le32 num_msdu_desc;
1544
1545 /*
1546 * Max. number of Tx fragments per MSDU
1547 * This parameter controls the max number of Tx fragments per MSDU.
1548 * This is sent by the target as part of the WMI_SERVICE_READY event
1549 * and is overriden by the OS shim as required.
1550 */
1551 __le32 max_frag_entries;
1552} __packed;
1553
1554
Bartosz Markowskib3effe62013-09-26 17:47:11 +02001555#define NUM_UNITS_IS_NUM_VDEVS 0x1
1556#define NUM_UNITS_IS_NUM_PEERS 0x2
1557
Kalle Valo5e3dd152013-06-12 20:52:10 +03001558/* strucutre describing host memory chunk. */
1559struct host_memory_chunk {
1560 /* id of the request that is passed up in service ready */
1561 __le32 req_id;
1562 /* the physical address the memory chunk */
1563 __le32 ptr;
1564 /* size of the chunk */
1565 __le32 size;
1566} __packed;
1567
1568struct wmi_init_cmd {
1569 struct wmi_resource_config resource_config;
1570 __le32 num_host_mem_chunks;
1571
1572 /*
1573 * variable number of host memory chunks.
1574 * This should be the last element in the structure
1575 */
1576 struct host_memory_chunk host_mem_chunks[1];
1577} __packed;
1578
Bartosz Markowski12b2b9e2013-09-26 17:47:13 +02001579/* _10x stucture is from 10.X FW API */
1580struct wmi_init_cmd_10x {
1581 struct wmi_resource_config_10x resource_config;
1582 __le32 num_host_mem_chunks;
1583
1584 /*
1585 * variable number of host memory chunks.
1586 * This should be the last element in the structure
1587 */
1588 struct host_memory_chunk host_mem_chunks[1];
1589} __packed;
1590
Kalle Valo5e3dd152013-06-12 20:52:10 +03001591/* TLV for channel list */
1592struct wmi_chan_list {
1593 __le32 tag; /* WMI_CHAN_LIST_TAG */
1594 __le32 num_chan;
1595 __le32 channel_list[0];
1596} __packed;
1597
1598struct wmi_bssid_list {
1599 __le32 tag; /* WMI_BSSID_LIST_TAG */
1600 __le32 num_bssid;
1601 struct wmi_mac_addr bssid_list[0];
1602} __packed;
1603
1604struct wmi_ie_data {
1605 __le32 tag; /* WMI_IE_TAG */
1606 __le32 ie_len;
1607 u8 ie_data[0];
1608} __packed;
1609
1610struct wmi_ssid {
1611 __le32 ssid_len;
1612 u8 ssid[32];
1613} __packed;
1614
1615struct wmi_ssid_list {
1616 __le32 tag; /* WMI_SSID_LIST_TAG */
1617 __le32 num_ssids;
1618 struct wmi_ssid ssids[0];
1619} __packed;
1620
1621/* prefix used by scan requestor ids on the host */
1622#define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
1623
1624/* prefix used by scan request ids generated on the host */
1625/* host cycles through the lower 12 bits to generate ids */
1626#define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
1627
1628#define WLAN_SCAN_PARAMS_MAX_SSID 16
1629#define WLAN_SCAN_PARAMS_MAX_BSSID 4
1630#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
1631
1632/* Scan priority numbers must be sequential, starting with 0 */
1633enum wmi_scan_priority {
1634 WMI_SCAN_PRIORITY_VERY_LOW = 0,
1635 WMI_SCAN_PRIORITY_LOW,
1636 WMI_SCAN_PRIORITY_MEDIUM,
1637 WMI_SCAN_PRIORITY_HIGH,
1638 WMI_SCAN_PRIORITY_VERY_HIGH,
1639 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
1640};
1641
1642struct wmi_start_scan_cmd {
1643 /* Scan ID */
1644 __le32 scan_id;
1645 /* Scan requestor ID */
1646 __le32 scan_req_id;
1647 /* VDEV id(interface) that is requesting scan */
1648 __le32 vdev_id;
1649 /* Scan Priority, input to scan scheduler */
1650 __le32 scan_priority;
1651 /* Scan events subscription */
1652 __le32 notify_scan_events;
1653 /* dwell time in msec on active channels */
1654 __le32 dwell_time_active;
1655 /* dwell time in msec on passive channels */
1656 __le32 dwell_time_passive;
1657 /*
1658 * min time in msec on the BSS channel,only valid if atleast one
1659 * VDEV is active
1660 */
1661 __le32 min_rest_time;
1662 /*
1663 * max rest time in msec on the BSS channel,only valid if at least
1664 * one VDEV is active
1665 */
1666 /*
1667 * the scanner will rest on the bss channel at least min_rest_time
1668 * after min_rest_time the scanner will start checking for tx/rx
1669 * activity on all VDEVs. if there is no activity the scanner will
1670 * switch to off channel. if there is activity the scanner will let
1671 * the radio on the bss channel until max_rest_time expires.at
1672 * max_rest_time scanner will switch to off channel irrespective of
1673 * activity. activity is determined by the idle_time parameter.
1674 */
1675 __le32 max_rest_time;
1676 /*
1677 * time before sending next set of probe requests.
1678 * The scanner keeps repeating probe requests transmission with
1679 * period specified by repeat_probe_time.
1680 * The number of probe requests specified depends on the ssid_list
1681 * and bssid_list
1682 */
1683 __le32 repeat_probe_time;
1684 /* time in msec between 2 consequetive probe requests with in a set. */
1685 __le32 probe_spacing_time;
1686 /*
1687 * data inactivity time in msec on bss channel that will be used by
1688 * scanner for measuring the inactivity.
1689 */
1690 __le32 idle_time;
1691 /* maximum time in msec allowed for scan */
1692 __le32 max_scan_time;
1693 /*
1694 * delay in msec before sending first probe request after switching
1695 * to a channel
1696 */
1697 __le32 probe_delay;
1698 /* Scan control flags */
1699 __le32 scan_ctrl_flags;
1700
1701 /* Burst duration time in msecs */
1702 __le32 burst_duration;
1703 /*
1704 * TLV (tag length value ) paramerters follow the scan_cmd structure.
1705 * TLV can contain channel list, bssid list, ssid list and
1706 * ie. the TLV tags are defined above;
1707 */
1708} __packed;
1709
Bartosz Markowski89b7e762013-09-26 17:47:17 +02001710/* This is the definition from 10.X firmware branch */
1711struct wmi_start_scan_cmd_10x {
1712 /* Scan ID */
1713 __le32 scan_id;
1714
1715 /* Scan requestor ID */
1716 __le32 scan_req_id;
1717
1718 /* VDEV id(interface) that is requesting scan */
1719 __le32 vdev_id;
1720
1721 /* Scan Priority, input to scan scheduler */
1722 __le32 scan_priority;
1723
1724 /* Scan events subscription */
1725 __le32 notify_scan_events;
1726
1727 /* dwell time in msec on active channels */
1728 __le32 dwell_time_active;
1729
1730 /* dwell time in msec on passive channels */
1731 __le32 dwell_time_passive;
1732
1733 /*
1734 * min time in msec on the BSS channel,only valid if atleast one
1735 * VDEV is active
1736 */
1737 __le32 min_rest_time;
1738
1739 /*
1740 * max rest time in msec on the BSS channel,only valid if at least
1741 * one VDEV is active
1742 */
1743 /*
1744 * the scanner will rest on the bss channel at least min_rest_time
1745 * after min_rest_time the scanner will start checking for tx/rx
1746 * activity on all VDEVs. if there is no activity the scanner will
1747 * switch to off channel. if there is activity the scanner will let
1748 * the radio on the bss channel until max_rest_time expires.at
1749 * max_rest_time scanner will switch to off channel irrespective of
1750 * activity. activity is determined by the idle_time parameter.
1751 */
1752 __le32 max_rest_time;
1753
1754 /*
1755 * time before sending next set of probe requests.
1756 * The scanner keeps repeating probe requests transmission with
1757 * period specified by repeat_probe_time.
1758 * The number of probe requests specified depends on the ssid_list
1759 * and bssid_list
1760 */
1761 __le32 repeat_probe_time;
1762
1763 /* time in msec between 2 consequetive probe requests with in a set. */
1764 __le32 probe_spacing_time;
1765
1766 /*
1767 * data inactivity time in msec on bss channel that will be used by
1768 * scanner for measuring the inactivity.
1769 */
1770 __le32 idle_time;
1771
1772 /* maximum time in msec allowed for scan */
1773 __le32 max_scan_time;
1774
1775 /*
1776 * delay in msec before sending first probe request after switching
1777 * to a channel
1778 */
1779 __le32 probe_delay;
1780
1781 /* Scan control flags */
1782 __le32 scan_ctrl_flags;
1783
1784 /*
1785 * TLV (tag length value ) paramerters follow the scan_cmd structure.
1786 * TLV can contain channel list, bssid list, ssid list and
1787 * ie. the TLV tags are defined above;
1788 */
1789} __packed;
1790
1791
Kalle Valo5e3dd152013-06-12 20:52:10 +03001792struct wmi_ssid_arg {
1793 int len;
1794 const u8 *ssid;
1795};
1796
1797struct wmi_bssid_arg {
1798 const u8 *bssid;
1799};
1800
1801struct wmi_start_scan_arg {
1802 u32 scan_id;
1803 u32 scan_req_id;
1804 u32 vdev_id;
1805 u32 scan_priority;
1806 u32 notify_scan_events;
1807 u32 dwell_time_active;
1808 u32 dwell_time_passive;
1809 u32 min_rest_time;
1810 u32 max_rest_time;
1811 u32 repeat_probe_time;
1812 u32 probe_spacing_time;
1813 u32 idle_time;
1814 u32 max_scan_time;
1815 u32 probe_delay;
1816 u32 scan_ctrl_flags;
1817
1818 u32 ie_len;
1819 u32 n_channels;
1820 u32 n_ssids;
1821 u32 n_bssids;
1822
1823 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
1824 u32 channels[64];
1825 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
1826 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
1827};
1828
1829/* scan control flags */
1830
1831/* passively scan all channels including active channels */
1832#define WMI_SCAN_FLAG_PASSIVE 0x1
1833/* add wild card ssid probe request even though ssid_list is specified. */
1834#define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
1835/* add cck rates to rates/xrate ie for the generated probe request */
1836#define WMI_SCAN_ADD_CCK_RATES 0x4
1837/* add ofdm rates to rates/xrate ie for the generated probe request */
1838#define WMI_SCAN_ADD_OFDM_RATES 0x8
1839/* To enable indication of Chan load and Noise floor to host */
1840#define WMI_SCAN_CHAN_STAT_EVENT 0x10
1841/* Filter Probe request frames */
1842#define WMI_SCAN_FILTER_PROBE_REQ 0x20
1843/* When set, DFS channels will not be scanned */
1844#define WMI_SCAN_BYPASS_DFS_CHN 0x40
1845/* Different FW scan engine may choose to bail out on errors.
1846 * Allow the driver to have influence over that. */
1847#define WMI_SCAN_CONTINUE_ON_ERROR 0x80
1848
1849/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
1850#define WMI_SCAN_CLASS_MASK 0xFF000000
1851
1852
1853enum wmi_stop_scan_type {
1854 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
1855 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
1856 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
1857};
1858
1859struct wmi_stop_scan_cmd {
1860 __le32 scan_req_id;
1861 __le32 scan_id;
1862 __le32 req_type;
1863 __le32 vdev_id;
1864} __packed;
1865
1866struct wmi_stop_scan_arg {
1867 u32 req_id;
1868 enum wmi_stop_scan_type req_type;
1869 union {
1870 u32 scan_id;
1871 u32 vdev_id;
1872 } u;
1873};
1874
1875struct wmi_scan_chan_list_cmd {
1876 __le32 num_scan_chans;
1877 struct wmi_channel chan_info[0];
1878} __packed;
1879
1880struct wmi_scan_chan_list_arg {
1881 u32 n_channels;
1882 struct wmi_channel_arg *channels;
1883};
1884
1885enum wmi_bss_filter {
1886 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
1887 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
1888 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
1889 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
1890 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
1891 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
1892 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
1893 WMI_BSS_FILTER_LAST_BSS, /* marker only */
1894};
1895
1896enum wmi_scan_event_type {
1897 WMI_SCAN_EVENT_STARTED = 0x1,
1898 WMI_SCAN_EVENT_COMPLETED = 0x2,
1899 WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
1900 WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
1901 WMI_SCAN_EVENT_DEQUEUED = 0x10,
1902 WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
1903 WMI_SCAN_EVENT_START_FAILED = 0x40,
1904 WMI_SCAN_EVENT_RESTARTED = 0x80,
1905 WMI_SCAN_EVENT_MAX = 0x8000
1906};
1907
1908enum wmi_scan_completion_reason {
1909 WMI_SCAN_REASON_COMPLETED,
1910 WMI_SCAN_REASON_CANCELLED,
1911 WMI_SCAN_REASON_PREEMPTED,
1912 WMI_SCAN_REASON_TIMEDOUT,
1913 WMI_SCAN_REASON_MAX,
1914};
1915
1916struct wmi_scan_event {
1917 __le32 event_type; /* %WMI_SCAN_EVENT_ */
1918 __le32 reason; /* %WMI_SCAN_REASON_ */
1919 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
1920 __le32 scan_req_id;
1921 __le32 scan_id;
1922 __le32 vdev_id;
1923} __packed;
1924
1925/*
1926 * This defines how much headroom is kept in the
1927 * receive frame between the descriptor and the
1928 * payload, in order for the WMI PHY error and
1929 * management handler to insert header contents.
1930 *
1931 * This is in bytes.
1932 */
1933#define WMI_MGMT_RX_HDR_HEADROOM 52
1934
1935/*
1936 * This event will be used for sending scan results
1937 * as well as rx mgmt frames to the host. The rx buffer
1938 * will be sent as part of this WMI event. It would be a
1939 * good idea to pass all the fields in the RX status
1940 * descriptor up to the host.
1941 */
Michal Kazior0d9b0432013-08-09 10:13:33 +02001942struct wmi_mgmt_rx_hdr_v1 {
Kalle Valo5e3dd152013-06-12 20:52:10 +03001943 __le32 channel;
1944 __le32 snr;
1945 __le32 rate;
1946 __le32 phy_mode;
1947 __le32 buf_len;
1948 __le32 status; /* %WMI_RX_STATUS_ */
1949} __packed;
1950
Michal Kazior0d9b0432013-08-09 10:13:33 +02001951struct wmi_mgmt_rx_hdr_v2 {
1952 struct wmi_mgmt_rx_hdr_v1 v1;
1953 __le32 rssi_ctl[4];
1954} __packed;
1955
1956struct wmi_mgmt_rx_event_v1 {
1957 struct wmi_mgmt_rx_hdr_v1 hdr;
1958 u8 buf[0];
1959} __packed;
1960
1961struct wmi_mgmt_rx_event_v2 {
1962 struct wmi_mgmt_rx_hdr_v2 hdr;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001963 u8 buf[0];
1964} __packed;
1965
1966#define WMI_RX_STATUS_OK 0x00
1967#define WMI_RX_STATUS_ERR_CRC 0x01
1968#define WMI_RX_STATUS_ERR_DECRYPT 0x08
1969#define WMI_RX_STATUS_ERR_MIC 0x10
1970#define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
1971
Janusz Dziedzic9702c682013-11-20 09:59:41 +02001972#define PHY_ERROR_SPECTRAL_SCAN 0x26
1973#define PHY_ERROR_FALSE_RADAR_EXT 0x24
1974#define PHY_ERROR_RADAR 0x05
1975
Kalle Valo5e3dd152013-06-12 20:52:10 +03001976struct wmi_single_phyerr_rx_hdr {
1977 /* TSF timestamp */
1978 __le32 tsf_timestamp;
1979
1980 /*
1981 * Current freq1, freq2
1982 *
1983 * [7:0]: freq1[lo]
1984 * [15:8] : freq1[hi]
1985 * [23:16]: freq2[lo]
1986 * [31:24]: freq2[hi]
1987 */
1988 __le16 freq1;
1989 __le16 freq2;
1990
1991 /*
1992 * Combined RSSI over all chains and channel width for this PHY error
1993 *
1994 * [7:0]: RSSI combined
1995 * [15:8]: Channel width (MHz)
1996 * [23:16]: PHY error code
1997 * [24:16]: reserved (future use)
1998 */
1999 u8 rssi_combined;
2000 u8 chan_width_mhz;
2001 u8 phy_err_code;
2002 u8 rsvd0;
2003
2004 /*
2005 * RSSI on chain 0 through 3
2006 *
2007 * This is formatted the same as the PPDU_START RX descriptor
2008 * field:
2009 *
2010 * [7:0]: pri20
2011 * [15:8]: sec20
2012 * [23:16]: sec40
2013 * [31:24]: sec80
2014 */
2015
2016 __le32 rssi_chain0;
2017 __le32 rssi_chain1;
2018 __le32 rssi_chain2;
2019 __le32 rssi_chain3;
2020
2021 /*
2022 * Last calibrated NF value for chain 0 through 3
2023 *
2024 * nf_list_1:
2025 *
2026 * + [15:0] - chain 0
2027 * + [31:16] - chain 1
2028 *
2029 * nf_list_2:
2030 *
2031 * + [15:0] - chain 2
2032 * + [31:16] - chain 3
2033 */
2034 __le32 nf_list_1;
2035 __le32 nf_list_2;
2036
2037
2038 /* Length of the frame */
2039 __le32 buf_len;
2040} __packed;
2041
2042struct wmi_single_phyerr_rx_event {
2043 /* Phy error event header */
2044 struct wmi_single_phyerr_rx_hdr hdr;
2045 /* frame buffer */
2046 u8 bufp[0];
2047} __packed;
2048
2049struct wmi_comb_phyerr_rx_hdr {
2050 /* Phy error phy error count */
2051 __le32 num_phyerr_events;
2052 __le32 tsf_l32;
2053 __le32 tsf_u32;
2054} __packed;
2055
2056struct wmi_comb_phyerr_rx_event {
2057 /* Phy error phy error count */
2058 struct wmi_comb_phyerr_rx_hdr hdr;
2059 /*
2060 * frame buffer - contains multiple payloads in the order:
2061 * header - payload, header - payload...
2062 * (The header is of type: wmi_single_phyerr_rx_hdr)
2063 */
2064 u8 bufp[0];
2065} __packed;
2066
Janusz Dziedzic9702c682013-11-20 09:59:41 +02002067#define PHYERR_TLV_SIG 0xBB
2068#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
2069#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
2070
2071struct phyerr_radar_report {
2072 __le32 reg0; /* RADAR_REPORT_REG0_* */
2073 __le32 reg1; /* REDAR_REPORT_REG1_* */
2074} __packed;
2075
2076#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
2077#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
2078
2079#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
2080#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
2081
2082#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
2083#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
2084
2085#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
2086#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
2087
2088#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
2089#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
2090
2091#define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
2092#define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
2093
2094#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
2095#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
2096
2097#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
2098#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
2099
2100#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
2101#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
2102
2103#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
2104#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
2105
2106#define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
2107#define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
2108
2109struct phyerr_fft_report {
2110 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
2111 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
2112} __packed;
2113
2114#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
2115#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
2116
2117#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
2118#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
2119
2120#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
2121#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
2122
2123#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
2124#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
2125
2126#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
2127#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
2128
2129#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
2130#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
2131
2132#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
2133#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
2134
2135#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
2136#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
2137
2138
2139struct phyerr_tlv {
2140 __le16 len;
2141 u8 tag;
2142 u8 sig;
2143} __packed;
2144
2145#define DFS_RSSI_POSSIBLY_FALSE 50
2146#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
2147
Kalle Valo5e3dd152013-06-12 20:52:10 +03002148struct wmi_mgmt_tx_hdr {
2149 __le32 vdev_id;
2150 struct wmi_mac_addr peer_macaddr;
2151 __le32 tx_rate;
2152 __le32 tx_power;
2153 __le32 buf_len;
2154} __packed;
2155
2156struct wmi_mgmt_tx_cmd {
2157 struct wmi_mgmt_tx_hdr hdr;
2158 u8 buf[0];
2159} __packed;
2160
2161struct wmi_echo_event {
2162 __le32 value;
2163} __packed;
2164
2165struct wmi_echo_cmd {
2166 __le32 value;
2167} __packed;
2168
2169
2170struct wmi_pdev_set_regdomain_cmd {
2171 __le32 reg_domain;
2172 __le32 reg_domain_2G;
2173 __le32 reg_domain_5G;
2174 __le32 conformance_test_limit_2G;
2175 __le32 conformance_test_limit_5G;
2176} __packed;
2177
Marek Puzyniak821af6a2014-03-21 17:46:57 +02002178enum wmi_dfs_region {
2179 /* Uninitialized dfs domain */
2180 WMI_UNINIT_DFS_DOMAIN = 0,
2181
2182 /* FCC3 dfs domain */
2183 WMI_FCC_DFS_DOMAIN = 1,
2184
2185 /* ETSI dfs domain */
2186 WMI_ETSI_DFS_DOMAIN = 2,
2187
2188 /*Japan dfs domain */
2189 WMI_MKK4_DFS_DOMAIN = 3,
2190};
2191
2192struct wmi_pdev_set_regdomain_cmd_10x {
2193 __le32 reg_domain;
2194 __le32 reg_domain_2G;
2195 __le32 reg_domain_5G;
2196 __le32 conformance_test_limit_2G;
2197 __le32 conformance_test_limit_5G;
2198
2199 /* dfs domain from wmi_dfs_region */
2200 __le32 dfs_domain;
2201} __packed;
2202
Kalle Valo5e3dd152013-06-12 20:52:10 +03002203/* Command to set/unset chip in quiet mode */
2204struct wmi_pdev_set_quiet_cmd {
2205 /* period in TUs */
2206 __le32 period;
2207
2208 /* duration in TUs */
2209 __le32 duration;
2210
2211 /* offset in TUs */
2212 __le32 next_start;
2213
2214 /* enable/disable */
2215 __le32 enabled;
2216} __packed;
2217
2218
2219/*
2220 * 802.11g protection mode.
2221 */
2222enum ath10k_protmode {
2223 ATH10K_PROT_NONE = 0, /* no protection */
2224 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
2225 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
2226};
2227
Marek Kwaczynskie81bd102014-03-11 12:58:00 +02002228enum wmi_rtscts_profile {
2229 WMI_RTSCTS_FOR_NO_RATESERIES = 0,
2230 WMI_RTSCTS_FOR_SECOND_RATESERIES,
2231 WMI_RTSCTS_ACROSS_SW_RETRIES
2232};
2233
2234#define WMI_RTSCTS_ENABLED 1
2235#define WMI_RTSCTS_SET_MASK 0x0f
2236#define WMI_RTSCTS_SET_LSB 0
2237
2238#define WMI_RTSCTS_PROFILE_MASK 0xf0
2239#define WMI_RTSCTS_PROFILE_LSB 4
2240
Kalle Valo5e3dd152013-06-12 20:52:10 +03002241enum wmi_beacon_gen_mode {
2242 WMI_BEACON_STAGGERED_MODE = 0,
2243 WMI_BEACON_BURST_MODE = 1
2244};
2245
2246enum wmi_csa_event_ies_present_flag {
2247 WMI_CSA_IE_PRESENT = 0x00000001,
2248 WMI_XCSA_IE_PRESENT = 0x00000002,
2249 WMI_WBW_IE_PRESENT = 0x00000004,
2250 WMI_CSWARP_IE_PRESENT = 0x00000008,
2251};
2252
2253/* wmi CSA receive event from beacon frame */
2254struct wmi_csa_event {
2255 __le32 i_fc_dur;
2256 /* Bit 0-15: FC */
2257 /* Bit 16-31: DUR */
2258 struct wmi_mac_addr i_addr1;
2259 struct wmi_mac_addr i_addr2;
2260 __le32 csa_ie[2];
2261 __le32 xcsa_ie[2];
2262 __le32 wb_ie[2];
2263 __le32 cswarp_ie;
2264 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
2265} __packed;
2266
2267/* the definition of different PDEV parameters */
2268#define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2269#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
2270#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
2271
Bartosz Markowski226a3392013-09-26 17:47:16 +02002272struct wmi_pdev_param_map {
2273 u32 tx_chain_mask;
2274 u32 rx_chain_mask;
2275 u32 txpower_limit2g;
2276 u32 txpower_limit5g;
2277 u32 txpower_scale;
2278 u32 beacon_gen_mode;
2279 u32 beacon_tx_mode;
2280 u32 resmgr_offchan_mode;
2281 u32 protection_mode;
2282 u32 dynamic_bw;
2283 u32 non_agg_sw_retry_th;
2284 u32 agg_sw_retry_th;
2285 u32 sta_kickout_th;
2286 u32 ac_aggrsize_scaling;
2287 u32 ltr_enable;
2288 u32 ltr_ac_latency_be;
2289 u32 ltr_ac_latency_bk;
2290 u32 ltr_ac_latency_vi;
2291 u32 ltr_ac_latency_vo;
2292 u32 ltr_ac_latency_timeout;
2293 u32 ltr_sleep_override;
2294 u32 ltr_rx_override;
2295 u32 ltr_tx_activity_timeout;
2296 u32 l1ss_enable;
2297 u32 dsleep_enable;
2298 u32 pcielp_txbuf_flush;
2299 u32 pcielp_txbuf_watermark;
2300 u32 pcielp_txbuf_tmo_en;
2301 u32 pcielp_txbuf_tmo_value;
2302 u32 pdev_stats_update_period;
2303 u32 vdev_stats_update_period;
2304 u32 peer_stats_update_period;
2305 u32 bcnflt_stats_update_period;
2306 u32 pmf_qos;
2307 u32 arp_ac_override;
Bartosz Markowski226a3392013-09-26 17:47:16 +02002308 u32 dcs;
2309 u32 ani_enable;
2310 u32 ani_poll_period;
2311 u32 ani_listen_period;
2312 u32 ani_ofdm_level;
2313 u32 ani_cck_level;
2314 u32 dyntxchain;
2315 u32 proxy_sta;
2316 u32 idle_ps_config;
2317 u32 power_gating_sleep;
2318 u32 fast_channel_reset;
2319 u32 burst_dur;
2320 u32 burst_enable;
2321};
2322
2323#define WMI_PDEV_PARAM_UNSUPPORTED 0
2324
Kalle Valo5e3dd152013-06-12 20:52:10 +03002325enum wmi_pdev_param {
2326 /* TX chian mask */
2327 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
2328 /* RX chian mask */
2329 WMI_PDEV_PARAM_RX_CHAIN_MASK,
2330 /* TX power limit for 2G Radio */
2331 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
2332 /* TX power limit for 5G Radio */
2333 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
2334 /* TX power scale */
2335 WMI_PDEV_PARAM_TXPOWER_SCALE,
2336 /* Beacon generation mode . 0: host, 1: target */
2337 WMI_PDEV_PARAM_BEACON_GEN_MODE,
2338 /* Beacon generation mode . 0: staggered 1: bursted */
2339 WMI_PDEV_PARAM_BEACON_TX_MODE,
2340 /*
2341 * Resource manager off chan mode .
2342 * 0: turn off off chan mode. 1: turn on offchan mode
2343 */
2344 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2345 /*
2346 * Protection mode:
2347 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2348 */
2349 WMI_PDEV_PARAM_PROTECTION_MODE,
Michal Kaziorc4dd0d02013-11-13 11:05:10 +01002350 /*
2351 * Dynamic bandwidth - 0: disable, 1: enable
2352 *
2353 * When enabled HW rate control tries different bandwidths when
2354 * retransmitting frames.
2355 */
Kalle Valo5e3dd152013-06-12 20:52:10 +03002356 WMI_PDEV_PARAM_DYNAMIC_BW,
2357 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2358 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2359 /* aggregrate sw retry threshold. 0-disable*/
2360 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
2361 /* Station kickout threshold (non of consecutive failures).0-disable */
2362 WMI_PDEV_PARAM_STA_KICKOUT_TH,
2363 /* Aggerate size scaling configuration per AC */
2364 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2365 /* LTR enable */
2366 WMI_PDEV_PARAM_LTR_ENABLE,
2367 /* LTR latency for BE, in us */
2368 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
2369 /* LTR latency for BK, in us */
2370 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
2371 /* LTR latency for VI, in us */
2372 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
2373 /* LTR latency for VO, in us */
2374 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
2375 /* LTR AC latency timeout, in ms */
2376 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2377 /* LTR platform latency override, in us */
2378 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2379 /* LTR-RX override, in us */
2380 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
2381 /* Tx activity timeout for LTR, in us */
2382 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2383 /* L1SS state machine enable */
2384 WMI_PDEV_PARAM_L1SS_ENABLE,
2385 /* Deep sleep state machine enable */
2386 WMI_PDEV_PARAM_DSLEEP_ENABLE,
2387 /* RX buffering flush enable */
2388 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
2389 /* RX buffering matermark */
2390 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
2391 /* RX buffering timeout enable */
2392 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
2393 /* RX buffering timeout value */
2394 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
2395 /* pdev level stats update period in ms */
2396 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2397 /* vdev level stats update period in ms */
2398 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2399 /* peer level stats update period in ms */
2400 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2401 /* beacon filter status update period */
2402 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2403 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2404 WMI_PDEV_PARAM_PMF_QOS,
2405 /* Access category on which ARP frames are sent */
2406 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
2407 /* DCS configuration */
2408 WMI_PDEV_PARAM_DCS,
2409 /* Enable/Disable ANI on target */
2410 WMI_PDEV_PARAM_ANI_ENABLE,
2411 /* configure the ANI polling period */
2412 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
2413 /* configure the ANI listening period */
2414 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
2415 /* configure OFDM immunity level */
2416 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
2417 /* configure CCK immunity level */
2418 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
2419 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2420 WMI_PDEV_PARAM_DYNTXCHAIN,
2421 /* Enable/Disable proxy STA */
2422 WMI_PDEV_PARAM_PROXY_STA,
2423 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
2424 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
2425 /* Enable/Disable power gating sleep */
2426 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
2427};
2428
Bartosz Markowski226a3392013-09-26 17:47:16 +02002429enum wmi_10x_pdev_param {
2430 /* TX chian mask */
2431 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
2432 /* RX chian mask */
2433 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
2434 /* TX power limit for 2G Radio */
2435 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
2436 /* TX power limit for 5G Radio */
2437 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
2438 /* TX power scale */
2439 WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
2440 /* Beacon generation mode . 0: host, 1: target */
2441 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
2442 /* Beacon generation mode . 0: staggered 1: bursted */
2443 WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
2444 /*
2445 * Resource manager off chan mode .
2446 * 0: turn off off chan mode. 1: turn on offchan mode
2447 */
2448 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
2449 /*
2450 * Protection mode:
2451 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
2452 */
2453 WMI_10X_PDEV_PARAM_PROTECTION_MODE,
2454 /* Dynamic bandwidth 0: disable 1: enable */
2455 WMI_10X_PDEV_PARAM_DYNAMIC_BW,
2456 /* Non aggregrate/ 11g sw retry threshold.0-disable */
2457 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
2458 /* aggregrate sw retry threshold. 0-disable*/
2459 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
2460 /* Station kickout threshold (non of consecutive failures).0-disable */
2461 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
2462 /* Aggerate size scaling configuration per AC */
2463 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
2464 /* LTR enable */
2465 WMI_10X_PDEV_PARAM_LTR_ENABLE,
2466 /* LTR latency for BE, in us */
2467 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
2468 /* LTR latency for BK, in us */
2469 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
2470 /* LTR latency for VI, in us */
2471 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
2472 /* LTR latency for VO, in us */
2473 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
2474 /* LTR AC latency timeout, in ms */
2475 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
2476 /* LTR platform latency override, in us */
2477 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
2478 /* LTR-RX override, in us */
2479 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
2480 /* Tx activity timeout for LTR, in us */
2481 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
2482 /* L1SS state machine enable */
2483 WMI_10X_PDEV_PARAM_L1SS_ENABLE,
2484 /* Deep sleep state machine enable */
2485 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
2486 /* pdev level stats update period in ms */
2487 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
2488 /* vdev level stats update period in ms */
2489 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
2490 /* peer level stats update period in ms */
2491 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
2492 /* beacon filter status update period */
2493 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
2494 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
2495 WMI_10X_PDEV_PARAM_PMF_QOS,
2496 /* Access category on which ARP and DHCP frames are sent */
2497 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
2498 /* DCS configuration */
2499 WMI_10X_PDEV_PARAM_DCS,
2500 /* Enable/Disable ANI on target */
2501 WMI_10X_PDEV_PARAM_ANI_ENABLE,
2502 /* configure the ANI polling period */
2503 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
2504 /* configure the ANI listening period */
2505 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
2506 /* configure OFDM immunity level */
2507 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
2508 /* configure CCK immunity level */
2509 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
2510 /* Enable/Disable CDD for 1x1 STAs in rate control module */
2511 WMI_10X_PDEV_PARAM_DYNTXCHAIN,
2512 /* Enable/Disable Fast channel reset*/
2513 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
2514 /* Set Bursting DUR */
2515 WMI_10X_PDEV_PARAM_BURST_DUR,
2516 /* Set Bursting Enable*/
2517 WMI_10X_PDEV_PARAM_BURST_ENABLE,
2518};
2519
Kalle Valo5e3dd152013-06-12 20:52:10 +03002520struct wmi_pdev_set_param_cmd {
2521 __le32 param_id;
2522 __le32 param_value;
2523} __packed;
2524
2525struct wmi_pdev_get_tpc_config_cmd {
2526 /* parameter */
2527 __le32 param;
2528} __packed;
2529
2530#define WMI_TPC_RATE_MAX 160
2531#define WMI_TPC_TX_N_CHAIN 4
2532
2533enum wmi_tpc_config_event_flag {
2534 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
2535 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
2536 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
2537};
2538
2539struct wmi_pdev_tpc_config_event {
2540 __le32 reg_domain;
2541 __le32 chan_freq;
2542 __le32 phy_mode;
2543 __le32 twice_antenna_reduction;
2544 __le32 twice_max_rd_power;
2545 s32 twice_antenna_gain;
2546 __le32 power_limit;
2547 __le32 rate_max;
2548 __le32 num_tx_chain;
2549 __le32 ctl;
2550 __le32 flags;
2551 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
2552 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2553 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2554 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
2555 u8 rates_array[WMI_TPC_RATE_MAX];
2556} __packed;
2557
2558/* Transmit power scale factor. */
2559enum wmi_tp_scale {
2560 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
2561 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
2562 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
2563 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
2564 WMI_TP_SCALE_MIN = 4, /* min, but still on */
2565 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
2566};
2567
2568struct wmi_set_channel_cmd {
2569 /* channel (only frequency and mode info are used) */
2570 struct wmi_channel chan;
2571} __packed;
2572
2573struct wmi_pdev_chanlist_update_event {
2574 /* number of channels */
2575 __le32 num_chan;
2576 /* array of channels */
2577 struct wmi_channel channel_list[1];
2578} __packed;
2579
2580#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
2581
2582struct wmi_debug_mesg_event {
2583 /* message buffer, NULL terminated */
2584 char bufp[WMI_MAX_DEBUG_MESG];
2585} __packed;
2586
2587enum {
2588 /* P2P device */
2589 VDEV_SUBTYPE_P2PDEV = 0,
2590 /* P2P client */
2591 VDEV_SUBTYPE_P2PCLI,
2592 /* P2P GO */
2593 VDEV_SUBTYPE_P2PGO,
2594 /* BT3.0 HS */
2595 VDEV_SUBTYPE_BT,
2596};
2597
2598struct wmi_pdev_set_channel_cmd {
2599 /* idnore power , only use flags , mode and freq */
2600 struct wmi_channel chan;
2601} __packed;
2602
2603/* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
2604#define WMI_DSCP_MAP_MAX (64)
2605struct wmi_pdev_set_dscp_tid_map_cmd {
2606 /* map indicating DSCP to TID conversion */
2607 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
2608} __packed;
2609
2610enum mcast_bcast_rate_id {
2611 WMI_SET_MCAST_RATE,
2612 WMI_SET_BCAST_RATE
2613};
2614
2615struct mcast_bcast_rate {
2616 enum mcast_bcast_rate_id rate_id;
2617 __le32 rate;
2618} __packed;
2619
2620struct wmi_wmm_params {
2621 __le32 cwmin;
2622 __le32 cwmax;
2623 __le32 aifs;
2624 __le32 txop;
2625 __le32 acm;
2626 __le32 no_ack;
2627} __packed;
2628
2629struct wmi_pdev_set_wmm_params {
2630 struct wmi_wmm_params ac_be;
2631 struct wmi_wmm_params ac_bk;
2632 struct wmi_wmm_params ac_vi;
2633 struct wmi_wmm_params ac_vo;
2634} __packed;
2635
2636struct wmi_wmm_params_arg {
2637 u32 cwmin;
2638 u32 cwmax;
2639 u32 aifs;
2640 u32 txop;
2641 u32 acm;
2642 u32 no_ack;
2643};
2644
2645struct wmi_pdev_set_wmm_params_arg {
2646 struct wmi_wmm_params_arg ac_be;
2647 struct wmi_wmm_params_arg ac_bk;
2648 struct wmi_wmm_params_arg ac_vi;
2649 struct wmi_wmm_params_arg ac_vo;
2650};
2651
2652struct wal_dbg_tx_stats {
2653 /* Num HTT cookies queued to dispatch list */
2654 __le32 comp_queued;
2655
2656 /* Num HTT cookies dispatched */
2657 __le32 comp_delivered;
2658
2659 /* Num MSDU queued to WAL */
2660 __le32 msdu_enqued;
2661
2662 /* Num MPDU queue to WAL */
2663 __le32 mpdu_enqued;
2664
2665 /* Num MSDUs dropped by WMM limit */
2666 __le32 wmm_drop;
2667
2668 /* Num Local frames queued */
2669 __le32 local_enqued;
2670
2671 /* Num Local frames done */
2672 __le32 local_freed;
2673
2674 /* Num queued to HW */
2675 __le32 hw_queued;
2676
2677 /* Num PPDU reaped from HW */
2678 __le32 hw_reaped;
2679
2680 /* Num underruns */
2681 __le32 underrun;
2682
2683 /* Num PPDUs cleaned up in TX abort */
2684 __le32 tx_abort;
2685
2686 /* Num MPDUs requed by SW */
2687 __le32 mpdus_requed;
2688
2689 /* excessive retries */
2690 __le32 tx_ko;
2691
2692 /* data hw rate code */
2693 __le32 data_rc;
2694
2695 /* Scheduler self triggers */
2696 __le32 self_triggers;
2697
2698 /* frames dropped due to excessive sw retries */
2699 __le32 sw_retry_failure;
2700
2701 /* illegal rate phy errors */
2702 __le32 illgl_rate_phy_err;
2703
2704 /* wal pdev continous xretry */
2705 __le32 pdev_cont_xretry;
2706
2707 /* wal pdev continous xretry */
2708 __le32 pdev_tx_timeout;
2709
2710 /* wal pdev resets */
2711 __le32 pdev_resets;
2712
Bartosz Markowski34d714e2014-03-28 14:35:16 +02002713 /* frames dropped due to non-availability of stateless TIDs */
2714 __le32 stateless_tid_alloc_failure;
2715
Kalle Valo5e3dd152013-06-12 20:52:10 +03002716 __le32 phy_underrun;
2717
2718 /* MPDU is more than txop limit */
2719 __le32 txop_ovf;
2720} __packed;
2721
2722struct wal_dbg_rx_stats {
2723 /* Cnts any change in ring routing mid-ppdu */
2724 __le32 mid_ppdu_route_change;
2725
2726 /* Total number of statuses processed */
2727 __le32 status_rcvd;
2728
2729 /* Extra frags on rings 0-3 */
2730 __le32 r0_frags;
2731 __le32 r1_frags;
2732 __le32 r2_frags;
2733 __le32 r3_frags;
2734
2735 /* MSDUs / MPDUs delivered to HTT */
2736 __le32 htt_msdus;
2737 __le32 htt_mpdus;
2738
2739 /* MSDUs / MPDUs delivered to local stack */
2740 __le32 loc_msdus;
2741 __le32 loc_mpdus;
2742
2743 /* AMSDUs that have more MSDUs than the status ring size */
2744 __le32 oversize_amsdu;
2745
2746 /* Number of PHY errors */
2747 __le32 phy_errs;
2748
2749 /* Number of PHY errors drops */
2750 __le32 phy_err_drop;
2751
2752 /* Number of mpdu errors - FCS, MIC, ENC etc. */
2753 __le32 mpdu_errs;
2754} __packed;
2755
2756struct wal_dbg_peer_stats {
2757 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
2758 __le32 dummy;
2759} __packed;
2760
2761struct wal_dbg_stats {
2762 struct wal_dbg_tx_stats tx;
2763 struct wal_dbg_rx_stats rx;
2764 struct wal_dbg_peer_stats peer;
2765} __packed;
2766
2767enum wmi_stats_id {
2768 WMI_REQUEST_PEER_STAT = 0x01,
2769 WMI_REQUEST_AP_STAT = 0x02
2770};
2771
Ben Greeardb9cdda2014-03-28 14:35:15 +02002772struct wlan_inst_rssi_args {
2773 __le16 cfg_retry_count;
2774 __le16 retry_count;
2775};
2776
Kalle Valo5e3dd152013-06-12 20:52:10 +03002777struct wmi_request_stats_cmd {
2778 __le32 stats_id;
2779
Ben Greeardb9cdda2014-03-28 14:35:15 +02002780 __le32 vdev_id;
2781
2782 /* peer MAC address */
2783 struct wmi_mac_addr peer_macaddr;
2784
2785 /* Instantaneous RSSI arguments */
2786 struct wlan_inst_rssi_args inst_rssi_args;
Kalle Valo5e3dd152013-06-12 20:52:10 +03002787} __packed;
2788
2789/* Suspend option */
2790enum {
2791 /* suspend */
2792 WMI_PDEV_SUSPEND,
2793
2794 /* suspend and disable all interrupts */
2795 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
2796};
2797
2798struct wmi_pdev_suspend_cmd {
2799 /* suspend option sent to target */
2800 __le32 suspend_opt;
2801} __packed;
2802
2803struct wmi_stats_event {
2804 __le32 stats_id; /* %WMI_REQUEST_ */
2805 /*
2806 * number of pdev stats event structures
2807 * (wmi_pdev_stats) 0 or 1
2808 */
2809 __le32 num_pdev_stats;
2810 /*
2811 * number of vdev stats event structures
2812 * (wmi_vdev_stats) 0 or max vdevs
2813 */
2814 __le32 num_vdev_stats;
2815 /*
2816 * number of peer stats event structures
2817 * (wmi_peer_stats) 0 or max peers
2818 */
2819 __le32 num_peer_stats;
2820 __le32 num_bcnflt_stats;
2821 /*
2822 * followed by
2823 * num_pdev_stats * size of(struct wmi_pdev_stats)
2824 * num_vdev_stats * size of(struct wmi_vdev_stats)
2825 * num_peer_stats * size of(struct wmi_peer_stats)
2826 *
2827 * By having a zero sized array, the pointer to data area
2828 * becomes available without increasing the struct size
2829 */
2830 u8 data[0];
2831} __packed;
2832
2833/*
2834 * PDEV statistics
2835 * TODO: add all PDEV stats here
2836 */
2837struct wmi_pdev_stats {
2838 __le32 chan_nf; /* Channel noise floor */
2839 __le32 tx_frame_count; /* TX frame count */
2840 __le32 rx_frame_count; /* RX frame count */
2841 __le32 rx_clear_count; /* rx clear count */
2842 __le32 cycle_count; /* cycle count */
2843 __le32 phy_err_count; /* Phy error count */
2844 __le32 chan_tx_pwr; /* channel tx power */
2845 struct wal_dbg_stats wal; /* WAL dbg stats */
2846} __packed;
2847
2848/*
2849 * VDEV statistics
2850 * TODO: add all VDEV stats here
2851 */
2852struct wmi_vdev_stats {
2853 __le32 vdev_id;
2854} __packed;
2855
2856/*
2857 * peer statistics.
2858 * TODO: add more stats
2859 */
2860struct wmi_peer_stats {
2861 struct wmi_mac_addr peer_macaddr;
2862 __le32 peer_rssi;
2863 __le32 peer_tx_rate;
2864} __packed;
2865
2866struct wmi_vdev_create_cmd {
2867 __le32 vdev_id;
2868 __le32 vdev_type;
2869 __le32 vdev_subtype;
2870 struct wmi_mac_addr vdev_macaddr;
2871} __packed;
2872
2873enum wmi_vdev_type {
2874 WMI_VDEV_TYPE_AP = 1,
2875 WMI_VDEV_TYPE_STA = 2,
2876 WMI_VDEV_TYPE_IBSS = 3,
2877 WMI_VDEV_TYPE_MONITOR = 4,
2878};
2879
2880enum wmi_vdev_subtype {
2881 WMI_VDEV_SUBTYPE_NONE = 0,
2882 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
2883 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
2884 WMI_VDEV_SUBTYPE_P2P_GO = 3,
2885};
2886
2887/* values for vdev_subtype */
2888
2889/* values for vdev_start_request flags */
2890/*
2891 * Indicates that AP VDEV uses hidden ssid. only valid for
2892 * AP/GO */
2893#define WMI_VDEV_START_HIDDEN_SSID (1<<0)
2894/*
2895 * Indicates if robust management frame/management frame
2896 * protection is enabled. For GO/AP vdevs, it indicates that
2897 * it may support station/client associations with RMF enabled.
2898 * For STA/client vdevs, it indicates that sta will
2899 * associate with AP with RMF enabled. */
2900#define WMI_VDEV_START_PMF_ENABLED (1<<1)
2901
2902struct wmi_p2p_noa_descriptor {
2903 __le32 type_count; /* 255: continuous schedule, 0: reserved */
2904 __le32 duration; /* Absent period duration in micro seconds */
2905 __le32 interval; /* Absent period interval in micro seconds */
2906 __le32 start_time; /* 32 bit tsf time when in starts */
2907} __packed;
2908
2909struct wmi_vdev_start_request_cmd {
2910 /* WMI channel */
2911 struct wmi_channel chan;
2912 /* unique id identifying the VDEV, generated by the caller */
2913 __le32 vdev_id;
2914 /* requestor id identifying the caller module */
2915 __le32 requestor_id;
2916 /* beacon interval from received beacon */
2917 __le32 beacon_interval;
2918 /* DTIM Period from the received beacon */
2919 __le32 dtim_period;
2920 /* Flags */
2921 __le32 flags;
2922 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
2923 struct wmi_ssid ssid;
2924 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
2925 __le32 bcn_tx_rate;
2926 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
2927 __le32 bcn_tx_power;
2928 /* number of p2p NOA descriptor(s) from scan entry */
2929 __le32 num_noa_descriptors;
2930 /*
2931 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
2932 * During CAC, Our HW shouldn't ack ditected frames
2933 */
2934 __le32 disable_hw_ack;
2935 /* actual p2p NOA descriptor from scan entry */
2936 struct wmi_p2p_noa_descriptor noa_descriptors[2];
2937} __packed;
2938
2939struct wmi_vdev_restart_request_cmd {
2940 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
2941} __packed;
2942
2943struct wmi_vdev_start_request_arg {
2944 u32 vdev_id;
2945 struct wmi_channel_arg channel;
2946 u32 bcn_intval;
2947 u32 dtim_period;
2948 u8 *ssid;
2949 u32 ssid_len;
2950 u32 bcn_tx_rate;
2951 u32 bcn_tx_power;
2952 bool disable_hw_ack;
2953 bool hidden_ssid;
2954 bool pmf_enabled;
2955};
2956
2957struct wmi_vdev_delete_cmd {
2958 /* unique id identifying the VDEV, generated by the caller */
2959 __le32 vdev_id;
2960} __packed;
2961
2962struct wmi_vdev_up_cmd {
2963 __le32 vdev_id;
2964 __le32 vdev_assoc_id;
2965 struct wmi_mac_addr vdev_bssid;
2966} __packed;
2967
2968struct wmi_vdev_stop_cmd {
2969 __le32 vdev_id;
2970} __packed;
2971
2972struct wmi_vdev_down_cmd {
2973 __le32 vdev_id;
2974} __packed;
2975
2976struct wmi_vdev_standby_response_cmd {
2977 /* unique id identifying the VDEV, generated by the caller */
2978 __le32 vdev_id;
2979} __packed;
2980
2981struct wmi_vdev_resume_response_cmd {
2982 /* unique id identifying the VDEV, generated by the caller */
2983 __le32 vdev_id;
2984} __packed;
2985
2986struct wmi_vdev_set_param_cmd {
2987 __le32 vdev_id;
2988 __le32 param_id;
2989 __le32 param_value;
2990} __packed;
2991
2992#define WMI_MAX_KEY_INDEX 3
2993#define WMI_MAX_KEY_LEN 32
2994
2995#define WMI_KEY_PAIRWISE 0x00
2996#define WMI_KEY_GROUP 0x01
2997#define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
2998
2999struct wmi_key_seq_counter {
3000 __le32 key_seq_counter_l;
3001 __le32 key_seq_counter_h;
3002} __packed;
3003
3004#define WMI_CIPHER_NONE 0x0 /* clear key */
3005#define WMI_CIPHER_WEP 0x1
3006#define WMI_CIPHER_TKIP 0x2
3007#define WMI_CIPHER_AES_OCB 0x3
3008#define WMI_CIPHER_AES_CCM 0x4
3009#define WMI_CIPHER_WAPI 0x5
3010#define WMI_CIPHER_CKIP 0x6
3011#define WMI_CIPHER_AES_CMAC 0x7
3012
3013struct wmi_vdev_install_key_cmd {
3014 __le32 vdev_id;
3015 struct wmi_mac_addr peer_macaddr;
3016 __le32 key_idx;
3017 __le32 key_flags;
3018 __le32 key_cipher; /* %WMI_CIPHER_ */
3019 struct wmi_key_seq_counter key_rsc_counter;
3020 struct wmi_key_seq_counter key_global_rsc_counter;
3021 struct wmi_key_seq_counter key_tsc_counter;
3022 u8 wpi_key_rsc_counter[16];
3023 u8 wpi_key_tsc_counter[16];
3024 __le32 key_len;
3025 __le32 key_txmic_len;
3026 __le32 key_rxmic_len;
3027
3028 /* contains key followed by tx mic followed by rx mic */
3029 u8 key_data[0];
3030} __packed;
3031
3032struct wmi_vdev_install_key_arg {
3033 u32 vdev_id;
3034 const u8 *macaddr;
3035 u32 key_idx;
3036 u32 key_flags;
3037 u32 key_cipher;
3038 u32 key_len;
3039 u32 key_txmic_len;
3040 u32 key_rxmic_len;
3041 const void *key_data;
3042};
3043
Janusz Dziedzic51ab1a02014-01-08 09:08:33 +01003044/*
3045 * vdev fixed rate format:
3046 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
3047 * - nss - b5:b4 - ss number (0 mean 1ss)
3048 * - rate_mcs - b3:b0 - as below
3049 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
3050 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
3051 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
3052 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
3053 * HT/VHT: MCS index
3054 */
3055
Kalle Valo5e3dd152013-06-12 20:52:10 +03003056/* Preamble types to be used with VDEV fixed rate configuration */
3057enum wmi_rate_preamble {
3058 WMI_RATE_PREAMBLE_OFDM,
3059 WMI_RATE_PREAMBLE_CCK,
3060 WMI_RATE_PREAMBLE_HT,
3061 WMI_RATE_PREAMBLE_VHT,
3062};
3063
3064/* Value to disable fixed rate setting */
3065#define WMI_FIXED_RATE_NONE (0xff)
3066
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02003067struct wmi_vdev_param_map {
3068 u32 rts_threshold;
3069 u32 fragmentation_threshold;
3070 u32 beacon_interval;
3071 u32 listen_interval;
3072 u32 multicast_rate;
3073 u32 mgmt_tx_rate;
3074 u32 slot_time;
3075 u32 preamble;
3076 u32 swba_time;
3077 u32 wmi_vdev_stats_update_period;
3078 u32 wmi_vdev_pwrsave_ageout_time;
3079 u32 wmi_vdev_host_swba_interval;
3080 u32 dtim_period;
3081 u32 wmi_vdev_oc_scheduler_air_time_limit;
3082 u32 wds;
3083 u32 atim_window;
3084 u32 bmiss_count_max;
3085 u32 bmiss_first_bcnt;
3086 u32 bmiss_final_bcnt;
3087 u32 feature_wmm;
3088 u32 chwidth;
3089 u32 chextoffset;
3090 u32 disable_htprotection;
3091 u32 sta_quickkickout;
3092 u32 mgmt_rate;
3093 u32 protection_mode;
3094 u32 fixed_rate;
3095 u32 sgi;
3096 u32 ldpc;
3097 u32 tx_stbc;
3098 u32 rx_stbc;
3099 u32 intra_bss_fwd;
3100 u32 def_keyid;
3101 u32 nss;
3102 u32 bcast_data_rate;
3103 u32 mcast_data_rate;
3104 u32 mcast_indicate;
3105 u32 dhcp_indicate;
3106 u32 unknown_dest_indicate;
3107 u32 ap_keepalive_min_idle_inactive_time_secs;
3108 u32 ap_keepalive_max_idle_inactive_time_secs;
3109 u32 ap_keepalive_max_unresponsive_time_secs;
3110 u32 ap_enable_nawds;
3111 u32 mcast2ucast_set;
3112 u32 enable_rtscts;
3113 u32 txbf;
3114 u32 packet_powersave;
3115 u32 drop_unencry;
3116 u32 tx_encap_type;
3117 u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
3118};
3119
3120#define WMI_VDEV_PARAM_UNSUPPORTED 0
3121
Kalle Valo5e3dd152013-06-12 20:52:10 +03003122/* the definition of different VDEV parameters */
3123enum wmi_vdev_param {
3124 /* RTS Threshold */
3125 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
3126 /* Fragmentation threshold */
3127 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
3128 /* beacon interval in TUs */
3129 WMI_VDEV_PARAM_BEACON_INTERVAL,
3130 /* Listen interval in TUs */
3131 WMI_VDEV_PARAM_LISTEN_INTERVAL,
3132 /* muticast rate in Mbps */
3133 WMI_VDEV_PARAM_MULTICAST_RATE,
3134 /* management frame rate in Mbps */
3135 WMI_VDEV_PARAM_MGMT_TX_RATE,
3136 /* slot time (long vs short) */
3137 WMI_VDEV_PARAM_SLOT_TIME,
3138 /* preamble (long vs short) */
3139 WMI_VDEV_PARAM_PREAMBLE,
3140 /* SWBA time (time before tbtt in msec) */
3141 WMI_VDEV_PARAM_SWBA_TIME,
3142 /* time period for updating VDEV stats */
3143 WMI_VDEV_STATS_UPDATE_PERIOD,
3144 /* age out time in msec for frames queued for station in power save */
3145 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
3146 /*
3147 * Host SWBA interval (time in msec before tbtt for SWBA event
3148 * generation).
3149 */
3150 WMI_VDEV_HOST_SWBA_INTERVAL,
3151 /* DTIM period (specified in units of num beacon intervals) */
3152 WMI_VDEV_PARAM_DTIM_PERIOD,
3153 /*
3154 * scheduler air time limit for this VDEV. used by off chan
3155 * scheduler.
3156 */
3157 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3158 /* enable/dsiable WDS for this VDEV */
3159 WMI_VDEV_PARAM_WDS,
3160 /* ATIM Window */
3161 WMI_VDEV_PARAM_ATIM_WINDOW,
3162 /* BMISS max */
3163 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
3164 /* BMISS first time */
3165 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
3166 /* BMISS final time */
3167 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
3168 /* WMM enables/disabled */
3169 WMI_VDEV_PARAM_FEATURE_WMM,
3170 /* Channel width */
3171 WMI_VDEV_PARAM_CHWIDTH,
3172 /* Channel Offset */
3173 WMI_VDEV_PARAM_CHEXTOFFSET,
3174 /* Disable HT Protection */
3175 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
3176 /* Quick STA Kickout */
3177 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
3178 /* Rate to be used with Management frames */
3179 WMI_VDEV_PARAM_MGMT_RATE,
3180 /* Protection Mode */
3181 WMI_VDEV_PARAM_PROTECTION_MODE,
3182 /* Fixed rate setting */
3183 WMI_VDEV_PARAM_FIXED_RATE,
3184 /* Short GI Enable/Disable */
3185 WMI_VDEV_PARAM_SGI,
3186 /* Enable LDPC */
3187 WMI_VDEV_PARAM_LDPC,
3188 /* Enable Tx STBC */
3189 WMI_VDEV_PARAM_TX_STBC,
3190 /* Enable Rx STBC */
3191 WMI_VDEV_PARAM_RX_STBC,
3192 /* Intra BSS forwarding */
3193 WMI_VDEV_PARAM_INTRA_BSS_FWD,
3194 /* Setting Default xmit key for Vdev */
3195 WMI_VDEV_PARAM_DEF_KEYID,
3196 /* NSS width */
3197 WMI_VDEV_PARAM_NSS,
3198 /* Set the custom rate for the broadcast data frames */
3199 WMI_VDEV_PARAM_BCAST_DATA_RATE,
3200 /* Set the custom rate (rate-code) for multicast data frames */
3201 WMI_VDEV_PARAM_MCAST_DATA_RATE,
3202 /* Tx multicast packet indicate Enable/Disable */
3203 WMI_VDEV_PARAM_MCAST_INDICATE,
3204 /* Tx DHCP packet indicate Enable/Disable */
3205 WMI_VDEV_PARAM_DHCP_INDICATE,
3206 /* Enable host inspection of Tx unicast packet to unknown destination */
3207 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3208
3209 /* The minimum amount of time AP begins to consider STA inactive */
3210 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3211
3212 /*
3213 * An associated STA is considered inactive when there is no recent
3214 * TX/RX activity and no downlink frames are buffered for it. Once a
3215 * STA exceeds the maximum idle inactive time, the AP will send an
3216 * 802.11 data-null as a keep alive to verify the STA is still
3217 * associated. If the STA does ACK the data-null, or if the data-null
3218 * is buffered and the STA does not retrieve it, the STA will be
3219 * considered unresponsive
3220 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3221 */
3222 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3223
3224 /*
3225 * An associated STA is considered unresponsive if there is no recent
3226 * TX/RX activity and downlink frames are buffered for it. Once a STA
3227 * exceeds the maximum unresponsive time, the AP will send a
3228 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
3229 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3230
3231 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3232 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
3233 /* Enable/Disable RTS-CTS */
3234 WMI_VDEV_PARAM_ENABLE_RTSCTS,
3235 /* Enable TXBFee/er */
3236 WMI_VDEV_PARAM_TXBF,
3237
3238 /* Set packet power save */
3239 WMI_VDEV_PARAM_PACKET_POWERSAVE,
3240
3241 /*
3242 * Drops un-encrypted packets if eceived in an encrypted connection
3243 * otherwise forwards to host.
3244 */
3245 WMI_VDEV_PARAM_DROP_UNENCRY,
3246
3247 /*
3248 * Set the encapsulation type for frames.
3249 */
3250 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
3251};
3252
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02003253/* the definition of different VDEV parameters */
3254enum wmi_10x_vdev_param {
3255 /* RTS Threshold */
3256 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
3257 /* Fragmentation threshold */
3258 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
3259 /* beacon interval in TUs */
3260 WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
3261 /* Listen interval in TUs */
3262 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
3263 /* muticast rate in Mbps */
3264 WMI_10X_VDEV_PARAM_MULTICAST_RATE,
3265 /* management frame rate in Mbps */
3266 WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
3267 /* slot time (long vs short) */
3268 WMI_10X_VDEV_PARAM_SLOT_TIME,
3269 /* preamble (long vs short) */
3270 WMI_10X_VDEV_PARAM_PREAMBLE,
3271 /* SWBA time (time before tbtt in msec) */
3272 WMI_10X_VDEV_PARAM_SWBA_TIME,
3273 /* time period for updating VDEV stats */
3274 WMI_10X_VDEV_STATS_UPDATE_PERIOD,
3275 /* age out time in msec for frames queued for station in power save */
3276 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
3277 /*
3278 * Host SWBA interval (time in msec before tbtt for SWBA event
3279 * generation).
3280 */
3281 WMI_10X_VDEV_HOST_SWBA_INTERVAL,
3282 /* DTIM period (specified in units of num beacon intervals) */
3283 WMI_10X_VDEV_PARAM_DTIM_PERIOD,
3284 /*
3285 * scheduler air time limit for this VDEV. used by off chan
3286 * scheduler.
3287 */
3288 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
3289 /* enable/dsiable WDS for this VDEV */
3290 WMI_10X_VDEV_PARAM_WDS,
3291 /* ATIM Window */
3292 WMI_10X_VDEV_PARAM_ATIM_WINDOW,
3293 /* BMISS max */
3294 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
3295 /* WMM enables/disabled */
3296 WMI_10X_VDEV_PARAM_FEATURE_WMM,
3297 /* Channel width */
3298 WMI_10X_VDEV_PARAM_CHWIDTH,
3299 /* Channel Offset */
3300 WMI_10X_VDEV_PARAM_CHEXTOFFSET,
3301 /* Disable HT Protection */
3302 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
3303 /* Quick STA Kickout */
3304 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
3305 /* Rate to be used with Management frames */
3306 WMI_10X_VDEV_PARAM_MGMT_RATE,
3307 /* Protection Mode */
3308 WMI_10X_VDEV_PARAM_PROTECTION_MODE,
3309 /* Fixed rate setting */
3310 WMI_10X_VDEV_PARAM_FIXED_RATE,
3311 /* Short GI Enable/Disable */
3312 WMI_10X_VDEV_PARAM_SGI,
3313 /* Enable LDPC */
3314 WMI_10X_VDEV_PARAM_LDPC,
3315 /* Enable Tx STBC */
3316 WMI_10X_VDEV_PARAM_TX_STBC,
3317 /* Enable Rx STBC */
3318 WMI_10X_VDEV_PARAM_RX_STBC,
3319 /* Intra BSS forwarding */
3320 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
3321 /* Setting Default xmit key for Vdev */
3322 WMI_10X_VDEV_PARAM_DEF_KEYID,
3323 /* NSS width */
3324 WMI_10X_VDEV_PARAM_NSS,
3325 /* Set the custom rate for the broadcast data frames */
3326 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
3327 /* Set the custom rate (rate-code) for multicast data frames */
3328 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
3329 /* Tx multicast packet indicate Enable/Disable */
3330 WMI_10X_VDEV_PARAM_MCAST_INDICATE,
3331 /* Tx DHCP packet indicate Enable/Disable */
3332 WMI_10X_VDEV_PARAM_DHCP_INDICATE,
3333 /* Enable host inspection of Tx unicast packet to unknown destination */
3334 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
3335
3336 /* The minimum amount of time AP begins to consider STA inactive */
3337 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
3338
3339 /*
3340 * An associated STA is considered inactive when there is no recent
3341 * TX/RX activity and no downlink frames are buffered for it. Once a
3342 * STA exceeds the maximum idle inactive time, the AP will send an
3343 * 802.11 data-null as a keep alive to verify the STA is still
3344 * associated. If the STA does ACK the data-null, or if the data-null
3345 * is buffered and the STA does not retrieve it, the STA will be
3346 * considered unresponsive
3347 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
3348 */
3349 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
3350
3351 /*
3352 * An associated STA is considered unresponsive if there is no recent
3353 * TX/RX activity and downlink frames are buffered for it. Once a STA
3354 * exceeds the maximum unresponsive time, the AP will send a
3355 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
3356 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
3357
3358 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
3359 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
3360
3361 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
3362 /* Enable/Disable RTS-CTS */
3363 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
3364
3365 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
3366};
3367
Kalle Valo5e3dd152013-06-12 20:52:10 +03003368/* slot time long */
3369#define WMI_VDEV_SLOT_TIME_LONG 0x1
3370/* slot time short */
3371#define WMI_VDEV_SLOT_TIME_SHORT 0x2
3372/* preablbe long */
3373#define WMI_VDEV_PREAMBLE_LONG 0x1
3374/* preablbe short */
3375#define WMI_VDEV_PREAMBLE_SHORT 0x2
3376
3377enum wmi_start_event_param {
3378 WMI_VDEV_RESP_START_EVENT = 0,
3379 WMI_VDEV_RESP_RESTART_EVENT,
3380};
3381
3382struct wmi_vdev_start_response_event {
3383 __le32 vdev_id;
3384 __le32 req_id;
3385 __le32 resp_type; /* %WMI_VDEV_RESP_ */
3386 __le32 status;
3387} __packed;
3388
3389struct wmi_vdev_standby_req_event {
3390 /* unique id identifying the VDEV, generated by the caller */
3391 __le32 vdev_id;
3392} __packed;
3393
3394struct wmi_vdev_resume_req_event {
3395 /* unique id identifying the VDEV, generated by the caller */
3396 __le32 vdev_id;
3397} __packed;
3398
3399struct wmi_vdev_stopped_event {
3400 /* unique id identifying the VDEV, generated by the caller */
3401 __le32 vdev_id;
3402} __packed;
3403
3404/*
3405 * common structure used for simple events
3406 * (stopped, resume_req, standby response)
3407 */
3408struct wmi_vdev_simple_event {
3409 /* unique id identifying the VDEV, generated by the caller */
3410 __le32 vdev_id;
3411} __packed;
3412
3413/* VDEV start response status codes */
3414/* VDEV succesfully started */
3415#define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
3416
3417/* requested VDEV not found */
3418#define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
3419
3420/* unsupported VDEV combination */
3421#define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
3422
3423/* Beacon processing related command and event structures */
3424struct wmi_bcn_tx_hdr {
3425 __le32 vdev_id;
3426 __le32 tx_rate;
3427 __le32 tx_power;
3428 __le32 bcn_len;
3429} __packed;
3430
3431struct wmi_bcn_tx_cmd {
3432 struct wmi_bcn_tx_hdr hdr;
3433 u8 *bcn[0];
3434} __packed;
3435
3436struct wmi_bcn_tx_arg {
3437 u32 vdev_id;
3438 u32 tx_rate;
3439 u32 tx_power;
3440 u32 bcn_len;
3441 const void *bcn;
3442};
3443
Michal Kazior748afc42014-01-23 12:48:21 +01003444enum wmi_bcn_tx_ref_flags {
3445 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
3446 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
3447};
3448
3449struct wmi_bcn_tx_ref_cmd {
3450 __le32 vdev_id;
3451 __le32 data_len;
3452 /* physical address of the frame - dma pointer */
3453 __le32 data_ptr;
3454 /* id for host to track */
3455 __le32 msdu_id;
3456 /* frame ctrl to setup PPDU desc */
3457 __le32 frame_control;
3458 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
3459 __le32 flags;
3460} __packed;
3461
Kalle Valo5e3dd152013-06-12 20:52:10 +03003462/* Beacon filter */
3463#define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
3464#define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
3465#define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
3466#define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
3467#define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
3468
3469struct wmi_bcn_filter_rx_cmd {
3470 /* Filter ID */
3471 __le32 bcn_filter_id;
3472 /* Filter type - wmi_bcn_filter */
3473 __le32 bcn_filter;
3474 /* Buffer len */
3475 __le32 bcn_filter_len;
3476 /* Filter info (threshold, BSSID, RSSI) */
3477 u8 *bcn_filter_buf;
3478} __packed;
3479
3480/* Capabilities and IEs to be passed to firmware */
3481struct wmi_bcn_prb_info {
3482 /* Capabilities */
3483 __le32 caps;
3484 /* ERP info */
3485 __le32 erp;
3486 /* Advanced capabilities */
3487 /* HT capabilities */
3488 /* HT Info */
3489 /* ibss_dfs */
3490 /* wpa Info */
3491 /* rsn Info */
3492 /* rrm info */
3493 /* ath_ext */
3494 /* app IE */
3495} __packed;
3496
3497struct wmi_bcn_tmpl_cmd {
3498 /* unique id identifying the VDEV, generated by the caller */
3499 __le32 vdev_id;
3500 /* TIM IE offset from the beginning of the template. */
3501 __le32 tim_ie_offset;
3502 /* beacon probe capabilities and IEs */
3503 struct wmi_bcn_prb_info bcn_prb_info;
3504 /* beacon buffer length */
3505 __le32 buf_len;
3506 /* variable length data */
3507 u8 data[1];
3508} __packed;
3509
3510struct wmi_prb_tmpl_cmd {
3511 /* unique id identifying the VDEV, generated by the caller */
3512 __le32 vdev_id;
3513 /* beacon probe capabilities and IEs */
3514 struct wmi_bcn_prb_info bcn_prb_info;
3515 /* beacon buffer length */
3516 __le32 buf_len;
3517 /* Variable length data */
3518 u8 data[1];
3519} __packed;
3520
3521enum wmi_sta_ps_mode {
3522 /* enable power save for the given STA VDEV */
3523 WMI_STA_PS_MODE_DISABLED = 0,
3524 /* disable power save for a given STA VDEV */
3525 WMI_STA_PS_MODE_ENABLED = 1,
3526};
3527
3528struct wmi_sta_powersave_mode_cmd {
3529 /* unique id identifying the VDEV, generated by the caller */
3530 __le32 vdev_id;
3531
3532 /*
3533 * Power save mode
3534 * (see enum wmi_sta_ps_mode)
3535 */
3536 __le32 sta_ps_mode;
3537} __packed;
3538
3539enum wmi_csa_offload_en {
3540 WMI_CSA_OFFLOAD_DISABLE = 0,
3541 WMI_CSA_OFFLOAD_ENABLE = 1,
3542};
3543
3544struct wmi_csa_offload_enable_cmd {
3545 __le32 vdev_id;
3546 __le32 csa_offload_enable;
3547} __packed;
3548
3549struct wmi_csa_offload_chanswitch_cmd {
3550 __le32 vdev_id;
3551 struct wmi_channel chan;
3552} __packed;
3553
3554/*
3555 * This parameter controls the policy for retrieving frames from AP while the
3556 * STA is in sleep state.
3557 *
3558 * Only takes affect if the sta_ps_mode is enabled
3559 */
3560enum wmi_sta_ps_param_rx_wake_policy {
3561 /*
3562 * Wake up when ever there is an RX activity on the VDEV. In this mode
3563 * the Power save SM(state machine) will come out of sleep by either
3564 * sending null frame (or) a data frame (with PS==0) in response to TIM
3565 * bit set in the received beacon frame from AP.
3566 */
3567 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
3568
3569 /*
3570 * Here the power save state machine will not wakeup in response to TIM
3571 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
3572 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
3573 * access categories are delivery-enabled, the station will send a
3574 * UAPSD trigger frame, otherwise it will send a PS-Poll.
3575 */
3576 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
3577};
3578
3579/*
3580 * Number of tx frames/beacon that cause the power save SM to wake up.
3581 *
3582 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
3583 * meaning, It will cause the SM to never wake up. This is useful if you want
3584 * to keep the system to sleep all the time for some kind of test mode . host
3585 * can change this parameter any time. It will affect at the next tx frame.
3586 */
3587enum wmi_sta_ps_param_tx_wake_threshold {
3588 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
3589 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
3590
3591 /*
3592 * Values greater than one indicate that many TX attempts per beacon
3593 * interval before the STA will wake up
3594 */
3595};
3596
3597/*
3598 * The maximum number of PS-Poll frames the FW will send in response to
3599 * traffic advertised in TIM before waking up (by sending a null frame with PS
3600 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
3601 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
3602 * parameter is used when the RX wake policy is
3603 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
3604 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
3605 */
3606enum wmi_sta_ps_param_pspoll_count {
3607 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
3608 /*
3609 * Values greater than 0 indicate the maximum numer of PS-Poll frames
3610 * FW will send before waking up.
3611 */
3612};
3613
3614/*
3615 * This will include the delivery and trigger enabled state for every AC.
3616 * This is the negotiated state with AP. The host MLME needs to set this based
3617 * on AP capability and the state Set in the association request by the
3618 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
3619 */
3620#define WMI_UAPSD_AC_TYPE_DELI 0
3621#define WMI_UAPSD_AC_TYPE_TRIG 1
3622
3623#define WMI_UAPSD_AC_BIT_MASK(ac, type) \
3624 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
3625
3626enum wmi_sta_ps_param_uapsd {
3627 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
3628 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
3629 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
3630 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
3631 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
3632 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
3633 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
3634 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
3635};
3636
3637enum wmi_sta_powersave_param {
3638 /*
3639 * Controls how frames are retrievd from AP while STA is sleeping
3640 *
3641 * (see enum wmi_sta_ps_param_rx_wake_policy)
3642 */
3643 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
3644
3645 /*
3646 * The STA will go active after this many TX
3647 *
3648 * (see enum wmi_sta_ps_param_tx_wake_threshold)
3649 */
3650 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
3651
3652 /*
3653 * Number of PS-Poll to send before STA wakes up
3654 *
3655 * (see enum wmi_sta_ps_param_pspoll_count)
3656 *
3657 */
3658 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
3659
3660 /*
3661 * TX/RX inactivity time in msec before going to sleep.
3662 *
3663 * The power save SM will monitor tx/rx activity on the VDEV, if no
3664 * activity for the specified msec of the parameter the Power save
3665 * SM will go to sleep.
3666 */
3667 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
3668
3669 /*
3670 * Set uapsd configuration.
3671 *
3672 * (see enum wmi_sta_ps_param_uapsd)
3673 */
3674 WMI_STA_PS_PARAM_UAPSD = 4,
3675};
3676
3677struct wmi_sta_powersave_param_cmd {
3678 __le32 vdev_id;
3679 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
3680 __le32 param_value;
3681} __packed;
3682
3683/* No MIMO power save */
3684#define WMI_STA_MIMO_PS_MODE_DISABLE
3685/* mimo powersave mode static*/
3686#define WMI_STA_MIMO_PS_MODE_STATIC
3687/* mimo powersave mode dynamic */
3688#define WMI_STA_MIMO_PS_MODE_DYNAMIC
3689
3690struct wmi_sta_mimo_ps_mode_cmd {
3691 /* unique id identifying the VDEV, generated by the caller */
3692 __le32 vdev_id;
3693 /* mimo powersave mode as defined above */
3694 __le32 mimo_pwrsave_mode;
3695} __packed;
3696
3697/* U-APSD configuration of peer station from (re)assoc request and TSPECs */
3698enum wmi_ap_ps_param_uapsd {
3699 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
3700 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
3701 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
3702 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
3703 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
3704 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
3705 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
3706 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
3707};
3708
3709/* U-APSD maximum service period of peer station */
3710enum wmi_ap_ps_peer_param_max_sp {
3711 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
3712 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
3713 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
3714 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
3715 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
3716};
3717
3718/*
3719 * AP power save parameter
3720 * Set a power save specific parameter for a peer station
3721 */
3722enum wmi_ap_ps_peer_param {
3723 /* Set uapsd configuration for a given peer.
3724 *
3725 * Include the delivery and trigger enabled state for every AC.
3726 * The host MLME needs to set this based on AP capability and stations
3727 * request Set in the association request received from the station.
3728 *
3729 * Lower 8 bits of the value specify the UAPSD configuration.
3730 *
3731 * (see enum wmi_ap_ps_param_uapsd)
3732 * The default value is 0.
3733 */
3734 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
3735
3736 /*
3737 * Set the service period for a UAPSD capable station
3738 *
3739 * The service period from wme ie in the (re)assoc request frame.
3740 *
3741 * (see enum wmi_ap_ps_peer_param_max_sp)
3742 */
3743 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
3744
3745 /* Time in seconds for aging out buffered frames for STA in PS */
3746 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
3747};
3748
3749struct wmi_ap_ps_peer_cmd {
3750 /* unique id identifying the VDEV, generated by the caller */
3751 __le32 vdev_id;
3752
3753 /* peer MAC address */
3754 struct wmi_mac_addr peer_macaddr;
3755
3756 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
3757 __le32 param_id;
3758
3759 /* AP powersave param value */
3760 __le32 param_value;
3761} __packed;
3762
3763/* 128 clients = 4 words */
3764#define WMI_TIM_BITMAP_ARRAY_SIZE 4
3765
3766struct wmi_tim_info {
3767 __le32 tim_len;
3768 __le32 tim_mcast;
3769 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
3770 __le32 tim_changed;
3771 __le32 tim_num_ps_pending;
3772} __packed;
3773
3774/* Maximum number of NOA Descriptors supported */
3775#define WMI_P2P_MAX_NOA_DESCRIPTORS 4
3776#define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
3777#define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
3778#define WMI_P2P_NOA_CHANGED_BIT BIT(0)
3779
3780struct wmi_p2p_noa_info {
3781 /* Bit 0 - Flag to indicate an update in NOA schedule
3782 Bits 7-1 - Reserved */
3783 u8 changed;
3784 /* NOA index */
3785 u8 index;
3786 /* Bit 0 - Opp PS state of the AP
3787 Bits 1-7 - Ctwindow in TUs */
3788 u8 ctwindow_oppps;
3789 /* Number of NOA descriptors */
3790 u8 num_descriptors;
3791
3792 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
3793} __packed;
3794
3795struct wmi_bcn_info {
3796 struct wmi_tim_info tim_info;
3797 struct wmi_p2p_noa_info p2p_noa_info;
3798} __packed;
3799
3800struct wmi_host_swba_event {
3801 __le32 vdev_map;
3802 struct wmi_bcn_info bcn_info[1];
3803} __packed;
3804
3805#define WMI_MAX_AP_VDEV 16
3806
3807struct wmi_tbtt_offset_event {
3808 __le32 vdev_map;
3809 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
3810} __packed;
3811
3812
3813struct wmi_peer_create_cmd {
3814 __le32 vdev_id;
3815 struct wmi_mac_addr peer_macaddr;
3816} __packed;
3817
3818struct wmi_peer_delete_cmd {
3819 __le32 vdev_id;
3820 struct wmi_mac_addr peer_macaddr;
3821} __packed;
3822
3823struct wmi_peer_flush_tids_cmd {
3824 __le32 vdev_id;
3825 struct wmi_mac_addr peer_macaddr;
3826 __le32 peer_tid_bitmap;
3827} __packed;
3828
3829struct wmi_fixed_rate {
3830 /*
3831 * rate mode . 0: disable fixed rate (auto rate)
3832 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
3833 * 2: ht20 11n rate specified as mcs index
3834 * 3: ht40 11n rate specified as mcs index
3835 */
3836 __le32 rate_mode;
3837 /*
3838 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
3839 * and series 3 is stored at byte 3 (MSB)
3840 */
3841 __le32 rate_series;
3842 /*
3843 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
3844 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
3845 * (MSB)
3846 */
3847 __le32 rate_retries;
3848} __packed;
3849
3850struct wmi_peer_fixed_rate_cmd {
3851 /* unique id identifying the VDEV, generated by the caller */
3852 __le32 vdev_id;
3853 /* peer MAC address */
3854 struct wmi_mac_addr peer_macaddr;
3855 /* fixed rate */
3856 struct wmi_fixed_rate peer_fixed_rate;
3857} __packed;
3858
3859#define WMI_MGMT_TID 17
3860
3861struct wmi_addba_clear_resp_cmd {
3862 /* unique id identifying the VDEV, generated by the caller */
3863 __le32 vdev_id;
3864 /* peer MAC address */
3865 struct wmi_mac_addr peer_macaddr;
3866} __packed;
3867
3868struct wmi_addba_send_cmd {
3869 /* unique id identifying the VDEV, generated by the caller */
3870 __le32 vdev_id;
3871 /* peer MAC address */
3872 struct wmi_mac_addr peer_macaddr;
3873 /* Tid number */
3874 __le32 tid;
3875 /* Buffer/Window size*/
3876 __le32 buffersize;
3877} __packed;
3878
3879struct wmi_delba_send_cmd {
3880 /* unique id identifying the VDEV, generated by the caller */
3881 __le32 vdev_id;
3882 /* peer MAC address */
3883 struct wmi_mac_addr peer_macaddr;
3884 /* Tid number */
3885 __le32 tid;
3886 /* Is Initiator */
3887 __le32 initiator;
3888 /* Reason code */
3889 __le32 reasoncode;
3890} __packed;
3891
3892struct wmi_addba_setresponse_cmd {
3893 /* unique id identifying the vdev, generated by the caller */
3894 __le32 vdev_id;
3895 /* peer mac address */
3896 struct wmi_mac_addr peer_macaddr;
3897 /* Tid number */
3898 __le32 tid;
3899 /* status code */
3900 __le32 statuscode;
3901} __packed;
3902
3903struct wmi_send_singleamsdu_cmd {
3904 /* unique id identifying the vdev, generated by the caller */
3905 __le32 vdev_id;
3906 /* peer mac address */
3907 struct wmi_mac_addr peer_macaddr;
3908 /* Tid number */
3909 __le32 tid;
3910} __packed;
3911
3912enum wmi_peer_smps_state {
3913 WMI_PEER_SMPS_PS_NONE = 0x0,
3914 WMI_PEER_SMPS_STATIC = 0x1,
3915 WMI_PEER_SMPS_DYNAMIC = 0x2
3916};
3917
Michal Kazior9797feb2014-02-14 14:49:48 +01003918enum wmi_peer_chwidth {
3919 WMI_PEER_CHWIDTH_20MHZ = 0,
3920 WMI_PEER_CHWIDTH_40MHZ = 1,
3921 WMI_PEER_CHWIDTH_80MHZ = 2,
3922};
3923
Kalle Valo5e3dd152013-06-12 20:52:10 +03003924enum wmi_peer_param {
3925 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
3926 WMI_PEER_AMPDU = 0x2,
3927 WMI_PEER_AUTHORIZE = 0x3,
3928 WMI_PEER_CHAN_WIDTH = 0x4,
3929 WMI_PEER_NSS = 0x5,
3930 WMI_PEER_USE_4ADDR = 0x6
3931};
3932
3933struct wmi_peer_set_param_cmd {
3934 __le32 vdev_id;
3935 struct wmi_mac_addr peer_macaddr;
3936 __le32 param_id;
3937 __le32 param_value;
3938} __packed;
3939
3940#define MAX_SUPPORTED_RATES 128
3941
3942struct wmi_rate_set {
3943 /* total number of rates */
3944 __le32 num_rates;
3945 /*
3946 * rates (each 8bit value) packed into a 32 bit word.
3947 * the rates are filled from least significant byte to most
3948 * significant byte.
3949 */
3950 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
3951} __packed;
3952
3953struct wmi_rate_set_arg {
3954 unsigned int num_rates;
3955 u8 rates[MAX_SUPPORTED_RATES];
3956};
3957
3958/*
3959 * NOTE: It would bea good idea to represent the Tx MCS
3960 * info in one word and Rx in another word. This is split
3961 * into multiple words for convenience
3962 */
3963struct wmi_vht_rate_set {
3964 __le32 rx_max_rate; /* Max Rx data rate */
3965 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
3966 __le32 tx_max_rate; /* Max Tx data rate */
3967 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
3968} __packed;
3969
3970struct wmi_vht_rate_set_arg {
3971 u32 rx_max_rate;
3972 u32 rx_mcs_set;
3973 u32 tx_max_rate;
3974 u32 tx_mcs_set;
3975};
3976
3977struct wmi_peer_set_rates_cmd {
3978 /* peer MAC address */
3979 struct wmi_mac_addr peer_macaddr;
3980 /* legacy rate set */
3981 struct wmi_rate_set peer_legacy_rates;
3982 /* ht rate set */
3983 struct wmi_rate_set peer_ht_rates;
3984} __packed;
3985
3986struct wmi_peer_set_q_empty_callback_cmd {
3987 /* unique id identifying the VDEV, generated by the caller */
3988 __le32 vdev_id;
3989 /* peer MAC address */
3990 struct wmi_mac_addr peer_macaddr;
3991 __le32 callback_enable;
3992} __packed;
3993
3994#define WMI_PEER_AUTH 0x00000001
3995#define WMI_PEER_QOS 0x00000002
3996#define WMI_PEER_NEED_PTK_4_WAY 0x00000004
3997#define WMI_PEER_NEED_GTK_2_WAY 0x00000010
3998#define WMI_PEER_APSD 0x00000800
3999#define WMI_PEER_HT 0x00001000
4000#define WMI_PEER_40MHZ 0x00002000
4001#define WMI_PEER_STBC 0x00008000
4002#define WMI_PEER_LDPC 0x00010000
4003#define WMI_PEER_DYN_MIMOPS 0x00020000
4004#define WMI_PEER_STATIC_MIMOPS 0x00040000
4005#define WMI_PEER_SPATIAL_MUX 0x00200000
4006#define WMI_PEER_VHT 0x02000000
4007#define WMI_PEER_80MHZ 0x04000000
4008#define WMI_PEER_PMF 0x08000000
4009
4010/*
4011 * Peer rate capabilities.
4012 *
4013 * This is of interest to the ratecontrol
4014 * module which resides in the firmware. The bit definitions are
4015 * consistent with that defined in if_athrate.c.
4016 */
4017#define WMI_RC_DS_FLAG 0x01
4018#define WMI_RC_CW40_FLAG 0x02
4019#define WMI_RC_SGI_FLAG 0x04
4020#define WMI_RC_HT_FLAG 0x08
4021#define WMI_RC_RTSCTS_FLAG 0x10
4022#define WMI_RC_TX_STBC_FLAG 0x20
4023#define WMI_RC_RX_STBC_FLAG 0xC0
4024#define WMI_RC_RX_STBC_FLAG_S 6
4025#define WMI_RC_WEP_TKIP_FLAG 0x100
4026#define WMI_RC_TS_FLAG 0x200
4027#define WMI_RC_UAPSD_FLAG 0x400
4028
4029/* Maximum listen interval supported by hw in units of beacon interval */
4030#define ATH10K_MAX_HW_LISTEN_INTERVAL 5
4031
4032struct wmi_peer_assoc_complete_cmd {
4033 struct wmi_mac_addr peer_macaddr;
4034 __le32 vdev_id;
4035 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
4036 __le32 peer_associd; /* 16 LSBs */
4037 __le32 peer_flags;
4038 __le32 peer_caps; /* 16 LSBs */
4039 __le32 peer_listen_intval;
4040 __le32 peer_ht_caps;
4041 __le32 peer_max_mpdu;
4042 __le32 peer_mpdu_density; /* 0..16 */
4043 __le32 peer_rate_caps;
4044 struct wmi_rate_set peer_legacy_rates;
4045 struct wmi_rate_set peer_ht_rates;
4046 __le32 peer_nss; /* num of spatial streams */
4047 __le32 peer_vht_caps;
4048 __le32 peer_phymode;
4049 struct wmi_vht_rate_set peer_vht_rates;
4050 /* HT Operation Element of the peer. Five bytes packed in 2
4051 * INT32 array and filled from lsb to msb. */
4052 __le32 peer_ht_info[2];
4053} __packed;
4054
4055struct wmi_peer_assoc_complete_arg {
4056 u8 addr[ETH_ALEN];
4057 u32 vdev_id;
4058 bool peer_reassoc;
4059 u16 peer_aid;
4060 u32 peer_flags; /* see %WMI_PEER_ */
4061 u16 peer_caps;
4062 u32 peer_listen_intval;
4063 u32 peer_ht_caps;
4064 u32 peer_max_mpdu;
4065 u32 peer_mpdu_density; /* 0..16 */
4066 u32 peer_rate_caps; /* see %WMI_RC_ */
4067 struct wmi_rate_set_arg peer_legacy_rates;
4068 struct wmi_rate_set_arg peer_ht_rates;
4069 u32 peer_num_spatial_streams;
4070 u32 peer_vht_caps;
4071 enum wmi_phy_mode peer_phymode;
4072 struct wmi_vht_rate_set_arg peer_vht_rates;
4073};
4074
4075struct wmi_peer_add_wds_entry_cmd {
4076 /* peer MAC address */
4077 struct wmi_mac_addr peer_macaddr;
4078 /* wds MAC addr */
4079 struct wmi_mac_addr wds_macaddr;
4080} __packed;
4081
4082struct wmi_peer_remove_wds_entry_cmd {
4083 /* wds MAC addr */
4084 struct wmi_mac_addr wds_macaddr;
4085} __packed;
4086
4087struct wmi_peer_q_empty_callback_event {
4088 /* peer MAC address */
4089 struct wmi_mac_addr peer_macaddr;
4090} __packed;
4091
4092/*
4093 * Channel info WMI event
4094 */
4095struct wmi_chan_info_event {
4096 __le32 err_code;
4097 __le32 freq;
4098 __le32 cmd_flags;
4099 __le32 noise_floor;
4100 __le32 rx_clear_count;
4101 __le32 cycle_count;
4102} __packed;
4103
Kalle Valo5a13e762014-01-20 11:01:46 +02004104struct wmi_peer_sta_kickout_event {
4105 struct wmi_mac_addr peer_macaddr;
4106} __packed;
4107
Michal Kazior2e1dea42013-07-31 10:32:40 +02004108#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
4109
4110/* FIXME: empirically extrapolated */
4111#define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
4112
Kalle Valo5e3dd152013-06-12 20:52:10 +03004113/* Beacon filter wmi command info */
4114#define BCN_FLT_MAX_SUPPORTED_IES 256
4115#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
4116
4117struct bss_bcn_stats {
4118 __le32 vdev_id;
4119 __le32 bss_bcnsdropped;
4120 __le32 bss_bcnsdelivered;
4121} __packed;
4122
4123struct bcn_filter_stats {
4124 __le32 bcns_dropped;
4125 __le32 bcns_delivered;
4126 __le32 activefilters;
4127 struct bss_bcn_stats bss_stats;
4128} __packed;
4129
4130struct wmi_add_bcn_filter_cmd {
4131 u32 vdev_id;
4132 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
4133} __packed;
4134
4135enum wmi_sta_keepalive_method {
4136 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
4137 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
4138};
4139
4140/* note: ip4 addresses are in network byte order, i.e. big endian */
4141struct wmi_sta_keepalive_arp_resp {
4142 __be32 src_ip4_addr;
4143 __be32 dest_ip4_addr;
4144 struct wmi_mac_addr dest_mac_addr;
4145} __packed;
4146
4147struct wmi_sta_keepalive_cmd {
4148 __le32 vdev_id;
4149 __le32 enabled;
4150 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
4151 __le32 interval; /* in seconds */
4152 struct wmi_sta_keepalive_arp_resp arp_resp;
4153} __packed;
4154
Michal Kazior9cfbce72013-07-16 09:54:36 +02004155enum wmi_force_fw_hang_type {
4156 WMI_FORCE_FW_HANG_ASSERT = 1,
4157 WMI_FORCE_FW_HANG_NO_DETECT,
4158 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
4159 WMI_FORCE_FW_HANG_EMPTY_POINT,
4160 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
4161 WMI_FORCE_FW_HANG_INFINITE_LOOP,
4162};
4163
4164#define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
4165
4166struct wmi_force_fw_hang_cmd {
4167 __le32 type;
4168 __le32 delay_ms;
4169} __packed;
4170
Kalle Valof118a3e2014-01-03 12:59:31 +02004171enum ath10k_dbglog_level {
4172 ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
4173 ATH10K_DBGLOG_LEVEL_INFO = 1,
4174 ATH10K_DBGLOG_LEVEL_WARN = 2,
4175 ATH10K_DBGLOG_LEVEL_ERR = 3,
4176};
4177
4178/* VAP ids to enable dbglog */
4179#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
4180#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
4181
4182/* to enable dbglog in the firmware */
4183#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
4184#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
4185
4186/* timestamp resolution */
4187#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
4188#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
4189
4190/* number of queued messages before sending them to the host */
4191#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
4192#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
4193
4194/*
4195 * Log levels to enable. This defines the minimum level to enable, this is
4196 * not a bitmask. See enum ath10k_dbglog_level for the values.
4197 */
4198#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
4199#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
4200
4201/*
4202 * Note: this is a cleaned up version of a struct firmware uses. For
4203 * example, config_valid was hidden inside an array.
4204 */
4205struct wmi_dbglog_cfg_cmd {
4206 /* bitmask to hold mod id config*/
4207 __le32 module_enable;
4208
4209 /* see ATH10K_DBGLOG_CFG_ */
4210 __le32 config_enable;
4211
4212 /* mask of module id bits to be changed */
4213 __le32 module_valid;
4214
4215 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
4216 __le32 config_valid;
4217} __packed;
4218
Kalle Valo5e3dd152013-06-12 20:52:10 +03004219#define ATH10K_RTS_MAX 2347
4220#define ATH10K_FRAGMT_THRESHOLD_MIN 540
4221#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
4222
4223#define WMI_MAX_EVENT 0x1000
4224/* Maximum number of pending TXed WMI packets */
Kalle Valo5e3dd152013-06-12 20:52:10 +03004225#define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
4226
4227/* By default disable power save for IBSS */
4228#define ATH10K_DEFAULT_ATIM 0
4229
4230struct ath10k;
4231struct ath10k_vif;
4232
4233int ath10k_wmi_attach(struct ath10k *ar);
4234void ath10k_wmi_detach(struct ath10k *ar);
4235int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
4236int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004237
4238int ath10k_wmi_connect_htc_service(struct ath10k *ar);
4239int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
4240 const struct wmi_channel_arg *);
Marek Puzyniak00f54822014-02-10 17:14:24 +01004241int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004242int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
4243int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
Marek Puzyniak821af6a2014-03-21 17:46:57 +02004244 u16 rd5g, u16 ctl2g, u16 ctl5g,
4245 enum wmi_dfs_region dfs_reg);
Bartosz Markowski226a3392013-09-26 17:47:16 +02004246int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004247int ath10k_wmi_cmd_init(struct ath10k *ar);
4248int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
4249void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
4250int ath10k_wmi_stop_scan(struct ath10k *ar,
4251 const struct wmi_stop_scan_arg *arg);
4252int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
4253 enum wmi_vdev_type type,
4254 enum wmi_vdev_subtype subtype,
4255 const u8 macaddr[ETH_ALEN]);
4256int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
4257int ath10k_wmi_vdev_start(struct ath10k *ar,
4258 const struct wmi_vdev_start_request_arg *);
4259int ath10k_wmi_vdev_restart(struct ath10k *ar,
4260 const struct wmi_vdev_start_request_arg *);
4261int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
4262int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
4263 const u8 *bssid);
4264int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
4265int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
Bartosz Markowski6d1506e2013-09-26 17:47:15 +02004266 u32 param_id, u32 param_value);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004267int ath10k_wmi_vdev_install_key(struct ath10k *ar,
4268 const struct wmi_vdev_install_key_arg *arg);
4269int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
4270 const u8 peer_addr[ETH_ALEN]);
4271int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
4272 const u8 peer_addr[ETH_ALEN]);
4273int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
4274 const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
4275int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
4276 const u8 *peer_addr,
4277 enum wmi_peer_param param_id, u32 param_value);
4278int ath10k_wmi_peer_assoc(struct ath10k *ar,
4279 const struct wmi_peer_assoc_complete_arg *arg);
4280int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
4281 enum wmi_sta_ps_mode psmode);
4282int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
4283 enum wmi_sta_powersave_param param_id,
4284 u32 value);
4285int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
4286 enum wmi_ap_ps_peer_param param_id, u32 value);
4287int ath10k_wmi_scan_chan_list(struct ath10k *ar,
4288 const struct wmi_scan_chan_list_arg *arg);
Michal Kazior748afc42014-01-23 12:48:21 +01004289int ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004290int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
4291 const struct wmi_pdev_set_wmm_params_arg *arg);
4292int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
Michal Kazior9cfbce72013-07-16 09:54:36 +02004293int ath10k_wmi_force_fw_hang(struct ath10k *ar,
4294 enum wmi_force_fw_hang_type type, u32 delay_ms);
Bartosz Markowski5e00d312013-09-26 17:47:12 +02004295int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
Kalle Valof118a3e2014-01-03 12:59:31 +02004296int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable);
Kalle Valo5e3dd152013-06-12 20:52:10 +03004297
4298#endif /* _WMI_H_ */