2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
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.
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.
21 #include <linux/types.h>
22 #include <net/mac80211.h>
25 * This file specifies the WMI interface for the Unified Software
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.
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.
36 * Guidelines for extending this interface are below.
38 * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
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.
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
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.
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
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.
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
73 #define HTC_PROTOCOL_VERSION 0x0002
74 #define WMI_PROTOCOL_VERSION 0x0002
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 */
111 WMI_MAX_SERVICE = 64 /* max service */
114 static inline char *wmi_service_name(int service_id)
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:
131 case WMI_SERVICE_AP_DFS:
133 case WMI_SERVICE_11AC:
135 case WMI_SERVICE_BLOCKACK:
137 case WMI_SERVICE_PHYERR:
139 case WMI_SERVICE_BCN_FILTER:
141 case WMI_SERVICE_RTT:
143 case WMI_SERVICE_RATECTRL:
145 case WMI_SERVICE_WOW:
147 case WMI_SERVICE_RATECTRL_CACHE:
148 return "RATECTRL CACHE";
149 case WMI_SERVICE_IRAM_TIDS:
151 case WMI_SERVICE_ARPNS_OFFLOAD:
152 return "ARPNS_OFFLOAD";
153 case WMI_SERVICE_NLO:
155 case WMI_SERVICE_GTK_OFFLOAD:
156 return "GTK_OFFLOAD";
157 case WMI_SERVICE_SCAN_SCH:
159 case WMI_SERVICE_CSA_OFFLOAD:
160 return "CSA_OFFLOAD";
161 case WMI_SERVICE_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:
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:
177 case WMI_SERVICE_STA_KEEP_ALIVE:
178 return "STA KEEP ALIVE";
179 case WMI_SERVICE_TX_ENCAP:
182 return "UNKNOWN SERVICE\n";
187 #define WMI_SERVICE_BM_SIZE \
188 ((WMI_MAX_SERVICE + sizeof(u32) - 1)/sizeof(u32))
190 /* 2 word representation of MAC addr */
191 struct wmi_mac_addr {
201 /* macro to convert MAC address from WMI word format to char array */
202 #define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
203 (c_macaddr)[0] = ((pwmi_mac_addr)->word0) & 0xff; \
204 (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \
205 (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \
206 (c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \
207 (c_macaddr)[4] = ((pwmi_mac_addr)->word1) & 0xff; \
208 (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \
212 * wmi command groups.
215 /* 0 to 2 are reserved */
217 WMI_GRP_SCAN = WMI_GRP_START,
247 #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
248 #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
250 /* Command IDs and commande events. */
252 WMI_INIT_CMDID = 0x1,
254 /* Scan specific commands */
255 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
257 WMI_SCAN_CHAN_LIST_CMDID,
258 WMI_SCAN_SCH_PRIO_TBL_CMDID,
260 /* PDEV (physical device) specific commands */
261 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
262 WMI_PDEV_SET_CHANNEL_CMDID,
263 WMI_PDEV_SET_PARAM_CMDID,
264 WMI_PDEV_PKTLOG_ENABLE_CMDID,
265 WMI_PDEV_PKTLOG_DISABLE_CMDID,
266 WMI_PDEV_SET_WMM_PARAMS_CMDID,
267 WMI_PDEV_SET_HT_CAP_IE_CMDID,
268 WMI_PDEV_SET_VHT_CAP_IE_CMDID,
269 WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
270 WMI_PDEV_SET_QUIET_MODE_CMDID,
271 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
272 WMI_PDEV_GET_TPC_CONFIG_CMDID,
273 WMI_PDEV_SET_BASE_MACADDR_CMDID,
275 /* VDEV (virtual device) specific commands */
276 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
277 WMI_VDEV_DELETE_CMDID,
278 WMI_VDEV_START_REQUEST_CMDID,
279 WMI_VDEV_RESTART_REQUEST_CMDID,
283 WMI_VDEV_SET_PARAM_CMDID,
284 WMI_VDEV_INSTALL_KEY_CMDID,
286 /* peer specific commands */
287 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
288 WMI_PEER_DELETE_CMDID,
289 WMI_PEER_FLUSH_TIDS_CMDID,
290 WMI_PEER_SET_PARAM_CMDID,
291 WMI_PEER_ASSOC_CMDID,
292 WMI_PEER_ADD_WDS_ENTRY_CMDID,
293 WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
294 WMI_PEER_MCAST_GROUP_CMDID,
296 /* beacon/management specific commands */
297 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
298 WMI_PDEV_SEND_BCN_CMDID,
300 WMI_BCN_FILTER_RX_CMDID,
301 WMI_PRB_REQ_FILTER_RX_CMDID,
305 /* commands to directly control BA negotiation directly from host. */
306 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
307 WMI_ADDBA_SEND_CMDID,
308 WMI_ADDBA_STATUS_CMDID,
309 WMI_DELBA_SEND_CMDID,
310 WMI_ADDBA_SET_RESP_CMDID,
311 WMI_SEND_SINGLEAMSDU_CMDID,
313 /* Station power save specific config */
314 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
315 WMI_STA_POWERSAVE_PARAM_CMDID,
316 WMI_STA_MIMO_PS_MODE_CMDID,
318 /** DFS-specific commands */
319 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
320 WMI_PDEV_DFS_DISABLE_CMDID,
322 /* Roaming specific commands */
323 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
324 WMI_ROAM_SCAN_RSSI_THRESHOLD,
325 WMI_ROAM_SCAN_PERIOD,
326 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
329 /* offload scan specific commands */
330 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
331 WMI_OFL_SCAN_REMOVE_AP_PROFILE,
334 /* P2P specific commands */
335 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
336 WMI_P2P_DEV_SET_DISCOVERABILITY,
337 WMI_P2P_GO_SET_BEACON_IE,
338 WMI_P2P_GO_SET_PROBE_RESP_IE,
339 WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
341 /* AP power save specific config */
342 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
343 WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
345 /* Rate-control specific commands */
346 WMI_PEER_RATE_RETRY_SCHED_CMDID =
347 WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
349 /* WLAN Profiling commands. */
350 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
351 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
352 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
353 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
354 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
356 /* Suspend resume command Ids */
357 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
358 WMI_PDEV_RESUME_CMDID,
360 /* Beacon filter commands */
361 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
362 WMI_RMV_BCN_FILTER_CMDID,
364 /* WOW Specific WMI commands*/
365 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
366 WMI_WOW_DEL_WAKE_PATTERN_CMDID,
367 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
368 WMI_WOW_ENABLE_CMDID,
369 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
371 /* RTT measurement related cmd */
372 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
375 /* spectral scan commands */
376 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
377 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
380 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
382 /* ARP OFFLOAD REQUEST*/
383 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
385 /* NS offload confid*/
386 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
388 /* GTK offload Specific WMI commands*/
389 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
391 /* CSA offload Specific WMI commands*/
392 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
393 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
395 /* Chatter commands*/
396 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
398 /* addba specific commands */
399 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
400 WMI_PEER_TID_DELBA_CMDID,
402 /* set station mimo powersave method */
403 WMI_STA_DTIM_PS_METHOD_CMDID,
404 /* Configure the Station UAPSD AC Auto Trigger Parameters */
405 WMI_STA_UAPSD_AUTO_TRIG_CMDID,
407 /* STA Keep alive parameter configuration,
408 Requires WMI_SERVICE_STA_KEEP_ALIVE */
409 WMI_STA_KEEPALIVE_CMD,
411 /* misc command group */
412 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
414 WMI_DBGLOG_CFG_CMDID,
416 WMI_PDEV_FTM_INTG_CMDID,
417 WMI_VDEV_SET_KEEPALIVE_CMDID,
418 WMI_VDEV_GET_KEEPALIVE_CMDID,
419 WMI_FORCE_FW_HANG_CMDID,
421 /* GPIO Configuration */
422 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
423 WMI_GPIO_OUTPUT_CMDID,
427 WMI_SERVICE_READY_EVENTID = 0x1,
430 /* Scan specific events */
431 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
433 /* PDEV specific events */
434 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
435 WMI_CHAN_INFO_EVENTID,
438 /* VDEV specific events */
439 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
440 WMI_VDEV_STOPPED_EVENTID,
441 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
443 /* peer specific events */
444 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
446 /* beacon/mgmt specific events */
447 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
448 WMI_HOST_SWBA_EVENTID,
449 WMI_TBTTOFFSET_UPDATE_EVENTID,
451 /* ADDBA Related WMI Events*/
452 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
453 WMI_TX_ADDBA_COMPLETE_EVENTID,
455 /* Roam event to trigger roaming on host */
456 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
460 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
463 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
464 WMI_TSF_MEASUREMENT_REPORT_EVENTID,
465 WMI_RTT_ERROR_REPORT_EVENTID,
468 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
469 WMI_GTK_REKEY_FAIL_EVENTID,
471 /* CSA IE received event */
472 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
475 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
476 WMI_PDEV_UTF_EVENTID,
477 WMI_DEBUG_MESG_EVENTID,
478 WMI_UPDATE_STATS_EVENTID,
479 WMI_DEBUG_PRINT_EVENTID,
480 WMI_DCS_INTERFERENCE_EVENTID,
481 WMI_PDEV_QVIT_EVENTID,
482 WMI_WLAN_PROFILE_DATA_EVENTID,
483 WMI_PDEV_FTM_INTG_EVENTID,
484 WMI_WLAN_FREQ_AVOID_EVENTID,
485 WMI_VDEV_GET_KEEPALIVE_EVENTID,
488 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
492 MODE_11A = 0, /* 11a Mode */
493 MODE_11G = 1, /* 11b/g Mode */
494 MODE_11B = 2, /* 11b Mode */
495 MODE_11GONLY = 3, /* 11g only Mode */
496 MODE_11NA_HT20 = 4, /* 11a HT20 mode */
497 MODE_11NG_HT20 = 5, /* 11g HT20 mode */
498 MODE_11NA_HT40 = 6, /* 11a HT40 mode */
499 MODE_11NG_HT40 = 7, /* 11g HT40 mode */
502 MODE_11AC_VHT80 = 10,
503 /* MODE_11AC_VHT160 = 11, */
504 MODE_11AC_VHT20_2G = 11,
505 MODE_11AC_VHT40_2G = 12,
506 MODE_11AC_VHT80_2G = 13,
511 #define WMI_CHAN_LIST_TAG 0x1
512 #define WMI_SSID_LIST_TAG 0x2
513 #define WMI_BSSID_LIST_TAG 0x3
514 #define WMI_IE_TAG 0x4
518 __le32 band_center_freq1;
519 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
521 __le32 flags; /* WMI_CHAN_FLAG_ */
523 u8 mode; /* only 6 LSBs */
543 struct wmi_channel_arg {
545 u32 band_center_freq1;
551 /* note: power unit is 1/4th of dBm */
555 u32 max_antenna_gain;
557 enum wmi_phy_mode mode;
560 enum wmi_channel_change_cause {
561 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
562 WMI_CHANNEL_CHANGE_CAUSE_CSA,
565 #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
566 #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
567 #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
568 #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
569 #define WMI_CHAN_FLAG_DFS (1 << 10)
570 #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
571 #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
573 /* Indicate reason for channel switch */
574 #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
576 #define WMI_MAX_SPATIAL_STREAM 3
579 #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
580 #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
581 #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
582 #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
583 #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
584 #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
585 #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
586 #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
587 #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
588 #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
589 #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
590 #define WMI_HT_CAP_HT40_SGI 0x0800
592 #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
593 WMI_HT_CAP_HT20_SGI | \
594 WMI_HT_CAP_HT40_SGI | \
595 WMI_HT_CAP_TX_STBC | \
596 WMI_HT_CAP_RX_STBC | \
601 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
602 * field. The fields not defined here are not supported, or reserved.
603 * Do not change these masks and if you have to add new one follow the
604 * bitmask as specified by 802.11ac draft.
607 #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
608 #define WMI_VHT_CAP_RX_LDPC 0x00000010
609 #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
610 #define WMI_VHT_CAP_TX_STBC 0x00000080
611 #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
612 #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
613 #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
614 #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
615 #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
616 #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
618 /* The following also refer for max HT AMSDU */
619 #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
620 #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
621 #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
623 #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
624 WMI_VHT_CAP_RX_LDPC | \
625 WMI_VHT_CAP_SGI_80MHZ | \
626 WMI_VHT_CAP_TX_STBC | \
627 WMI_VHT_CAP_RX_STBC_MASK | \
628 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
629 WMI_VHT_CAP_RX_FIXED_ANT | \
630 WMI_VHT_CAP_TX_FIXED_ANT)
633 * Interested readers refer to Rx/Tx MCS Map definition as defined in
636 #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
637 #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
638 #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
641 REGDMN_MODE_11A = 0x00001, /* 11a channels */
642 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
643 REGDMN_MODE_11B = 0x00004, /* 11b channels */
644 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
645 REGDMN_MODE_11G = 0x00008, /* XXX historical */
646 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
647 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
648 REGDMN_MODE_XR = 0x00100, /* XR channels */
649 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
650 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
651 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
652 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
653 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
654 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
655 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
656 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
657 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
658 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
659 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
660 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
661 REGDMN_MODE_ALL = 0xffffffff
664 #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
665 #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
666 #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
668 /* regulatory capabilities */
669 #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
670 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
671 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
672 #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
673 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
674 #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
676 struct hal_reg_capabilities {
677 /* regdomain value specified in EEPROM */
680 __le32 eeprom_rd_ext;
681 /* CAP1 capabilities bit map. */
683 /* REGDMN EEPROM CAP. */
686 __le32 wireless_modes;
687 __le32 low_2ghz_chan;
688 __le32 high_2ghz_chan;
689 __le32 low_5ghz_chan;
690 __le32 high_5ghz_chan;
693 enum wlan_mode_capability {
694 WHAL_WLAN_11A_CAPABILITY = 0x1,
695 WHAL_WLAN_11G_CAPABILITY = 0x2,
696 WHAL_WLAN_11AG_CAPABILITY = 0x3,
699 /* structure used by FW for requesting host memory */
700 struct wlan_host_mem_req {
701 /* ID of the request */
703 /* size of the of each unit */
705 /* flags to indicate that
706 * the number units is dependent
707 * on number of resources(num vdevs num peers .. etc)
709 __le32 num_unit_info;
711 * actual number of units to allocate . if flags in the num_unit_info
712 * indicate that number of units is tied to number of a particular
713 * resource to allocate then num_units filed is set to 0 and host
714 * will derive the number units from number of the resources it is
720 #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
721 ((((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
722 (1 << ((svc_id)%(sizeof(u32))))) != 0)
725 * The following struct holds optional payload for
726 * wmi_service_ready_event,e.g., 11ac pass some of the
727 * device capability to the host.
729 struct wmi_service_ready_event {
733 /* WMI_PHY_CAPABILITY */
734 __le32 phy_capability;
735 /* Maximum number of frag table entries that SW will populate less 1 */
736 __le32 max_frag_entry;
737 __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
738 __le32 num_rf_chains;
740 * The following field is only valid for service type
743 __le32 ht_cap_info; /* WMI HT Capability */
744 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
745 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
746 __le32 hw_min_tx_power;
747 __le32 hw_max_tx_power;
748 struct hal_reg_capabilities hal_reg_capabilities;
750 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
752 * Max beacon and Probe Response IE offload size
753 * (includes optional P2P IEs)
755 __le32 max_bcn_ie_size;
757 * request to host to allocate a chuck of memory and pss it down to FW
758 * via WM_INIT. FW uses this as FW extesnsion memory for saving its
759 * data structures. Only valid for low latency interfaces like PCIE
760 * where FW can access this memory directly (or) by DMA.
763 struct wlan_host_mem_req mem_reqs[1];
766 #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
767 #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
769 struct wmi_ready_event {
772 struct wmi_mac_addr mac_addr;
776 struct wmi_resource_config {
777 /* number of virtual devices (VAPs) to support */
780 /* number of peer nodes to support */
784 * In offload mode target supports features like WOW, chatter and
785 * other protocol offloads. In order to support them some
786 * functionalities like reorder buffering, PN checking need to be
787 * done in target. This determines maximum number of peers suported
788 * by target in offload mode
790 __le32 num_offload_peers;
792 /* For target-based RX reordering */
793 __le32 num_offload_reorder_bufs;
795 /* number of keys per peer */
796 __le32 num_peer_keys;
798 /* total number of TX/RX data TIDs */
802 * max skid for resolving hash collisions
804 * The address search table is sparse, so that if two MAC addresses
805 * result in the same hash value, the second of these conflicting
806 * entries can slide to the next index in the address search table,
807 * and use it, if it is unoccupied. This ast_skid_limit parameter
808 * specifies the upper bound on how many subsequent indices to search
809 * over to find an unoccupied space.
811 __le32 ast_skid_limit;
814 * the nominal chain mask for transmit
816 * The chain mask may be modified dynamically, e.g. to operate AP
817 * tx with a reduced number of chains if no clients are associated.
818 * This configuration parameter specifies the nominal chain-mask that
819 * should be used when not operating with a reduced set of tx chains.
821 __le32 tx_chain_mask;
824 * the nominal chain mask for receive
826 * The chain mask may be modified dynamically, e.g. for a client
827 * to use a reduced number of chains for receive if the traffic to
828 * the client is low enough that it doesn't require downlink MIMO
829 * or antenna diversity.
830 * This configuration parameter specifies the nominal chain-mask that
831 * should be used when not operating with a reduced set of rx chains.
833 __le32 rx_chain_mask;
836 * what rx reorder timeout (ms) to use for the AC
838 * Each WMM access class (voice, video, best-effort, background) will
839 * have its own timeout value to dictate how long to wait for missing
840 * rx MPDUs to arrive before flushing subsequent MPDUs that have
841 * already been received.
842 * This parameter specifies the timeout in milliseconds for each
845 __le32 rx_timeout_pri_vi;
846 __le32 rx_timeout_pri_vo;
847 __le32 rx_timeout_pri_be;
848 __le32 rx_timeout_pri_bk;
851 * what mode the rx should decap packets to
853 * MAC can decap to RAW (no decap), native wifi or Ethernet types
854 * THis setting also determines the default TX behavior, however TX
855 * behavior can be modified on a per VAP basis during VAP init
857 __le32 rx_decap_mode;
859 /* what is the maximum scan requests than can be queued */
860 __le32 scan_max_pending_reqs;
862 /* maximum VDEV that could use BMISS offload */
863 __le32 bmiss_offload_max_vdev;
865 /* maximum VDEV that could use offload roaming */
866 __le32 roam_offload_max_vdev;
868 /* maximum AP profiles that would push to offload roaming */
869 __le32 roam_offload_max_ap_profiles;
872 * how many groups to use for mcast->ucast conversion
874 * The target's WAL maintains a table to hold information regarding
875 * which peers belong to a given multicast group, so that if
876 * multicast->unicast conversion is enabled, the target can convert
877 * multicast tx frames to a series of unicast tx frames, to each
878 * peer within the multicast group.
879 This num_mcast_groups configuration parameter tells the target how
880 * many multicast groups to provide storage for within its multicast
881 * group membership table.
883 __le32 num_mcast_groups;
886 * size to alloc for the mcast membership table
888 * This num_mcast_table_elems configuration parameter tells the
889 * target how many peer elements it needs to provide storage for in
890 * its multicast group membership table.
891 * These multicast group membership table elements are shared by the
892 * multicast groups stored within the table.
894 __le32 num_mcast_table_elems;
897 * whether/how to do multicast->unicast conversion
899 * This configuration parameter specifies whether the target should
900 * perform multicast --> unicast conversion on transmit, and if so,
901 * what to do if it finds no entries in its multicast group
902 * membership table for the multicast IP address in the tx frame.
903 * Configuration value:
904 * 0 -> Do not perform multicast to unicast conversion.
905 * 1 -> Convert multicast frames to unicast, if the IP multicast
906 * address from the tx frame is found in the multicast group
907 * membership table. If the IP multicast address is not found,
909 * 2 -> Convert multicast frames to unicast, if the IP multicast
910 * address from the tx frame is found in the multicast group
911 * membership table. If the IP multicast address is not found,
912 * transmit the frame as multicast.
914 __le32 mcast2ucast_mode;
917 * how much memory to allocate for a tx PPDU dbg log
919 * This parameter controls how much memory the target will allocate
920 * to store a log of tx PPDU meta-information (how large the PPDU
921 * was, when it was sent, whether it was successful, etc.)
923 __le32 tx_dbg_log_size;
925 /* how many AST entries to be allocated for WDS */
926 __le32 num_wds_entries;
929 * MAC DMA burst size, e.g., For target PCI limit can be
932 __le32 dma_burst_size;
935 * Fixed delimiters to be inserted after every MPDU to
936 * account for interface latency to avoid underrun.
938 __le32 mac_aggr_delim;
941 * determine whether target is responsible for detecting duplicate
942 * non-aggregate MPDU and timing out stale fragments.
944 * A-MPDU reordering is always performed on the target.
946 * 0: target responsible for frag timeout and dup checking
947 * 1: host responsible for frag timeout and dup checking
949 __le32 rx_skip_defrag_timeout_dup_detection_check;
952 * Configuration for VoW :
953 * No of Video Nodes to be supported
954 * and Max no of descriptors for each Video link (node).
958 /* maximum VDEV that could use GTK offload */
959 __le32 gtk_offload_max_vdev;
961 /* Number of msdu descriptors target should use */
962 __le32 num_msdu_desc;
965 * Max. number of Tx fragments per MSDU
966 * This parameter controls the max number of Tx fragments per MSDU.
967 * This is sent by the target as part of the WMI_SERVICE_READY event
968 * and is overriden by the OS shim as required.
970 __le32 max_frag_entries;
973 /* strucutre describing host memory chunk. */
974 struct host_memory_chunk {
975 /* id of the request that is passed up in service ready */
977 /* the physical address the memory chunk */
979 /* size of the chunk */
983 struct wmi_init_cmd {
984 struct wmi_resource_config resource_config;
985 __le32 num_host_mem_chunks;
988 * variable number of host memory chunks.
989 * This should be the last element in the structure
991 struct host_memory_chunk host_mem_chunks[1];
994 /* TLV for channel list */
995 struct wmi_chan_list {
996 __le32 tag; /* WMI_CHAN_LIST_TAG */
998 __le32 channel_list[0];
1001 struct wmi_bssid_list {
1002 __le32 tag; /* WMI_BSSID_LIST_TAG */
1004 struct wmi_mac_addr bssid_list[0];
1007 struct wmi_ie_data {
1008 __le32 tag; /* WMI_IE_TAG */
1018 struct wmi_ssid_list {
1019 __le32 tag; /* WMI_SSID_LIST_TAG */
1021 struct wmi_ssid ssids[0];
1024 /* prefix used by scan requestor ids on the host */
1025 #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
1027 /* prefix used by scan request ids generated on the host */
1028 /* host cycles through the lower 12 bits to generate ids */
1029 #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
1031 #define WLAN_SCAN_PARAMS_MAX_SSID 16
1032 #define WLAN_SCAN_PARAMS_MAX_BSSID 4
1033 #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
1035 /* Scan priority numbers must be sequential, starting with 0 */
1036 enum wmi_scan_priority {
1037 WMI_SCAN_PRIORITY_VERY_LOW = 0,
1038 WMI_SCAN_PRIORITY_LOW,
1039 WMI_SCAN_PRIORITY_MEDIUM,
1040 WMI_SCAN_PRIORITY_HIGH,
1041 WMI_SCAN_PRIORITY_VERY_HIGH,
1042 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
1045 struct wmi_start_scan_cmd {
1048 /* Scan requestor ID */
1050 /* VDEV id(interface) that is requesting scan */
1052 /* Scan Priority, input to scan scheduler */
1053 __le32 scan_priority;
1054 /* Scan events subscription */
1055 __le32 notify_scan_events;
1056 /* dwell time in msec on active channels */
1057 __le32 dwell_time_active;
1058 /* dwell time in msec on passive channels */
1059 __le32 dwell_time_passive;
1061 * min time in msec on the BSS channel,only valid if atleast one
1064 __le32 min_rest_time;
1066 * max rest time in msec on the BSS channel,only valid if at least
1067 * one VDEV is active
1070 * the scanner will rest on the bss channel at least min_rest_time
1071 * after min_rest_time the scanner will start checking for tx/rx
1072 * activity on all VDEVs. if there is no activity the scanner will
1073 * switch to off channel. if there is activity the scanner will let
1074 * the radio on the bss channel until max_rest_time expires.at
1075 * max_rest_time scanner will switch to off channel irrespective of
1076 * activity. activity is determined by the idle_time parameter.
1078 __le32 max_rest_time;
1080 * time before sending next set of probe requests.
1081 * The scanner keeps repeating probe requests transmission with
1082 * period specified by repeat_probe_time.
1083 * The number of probe requests specified depends on the ssid_list
1086 __le32 repeat_probe_time;
1087 /* time in msec between 2 consequetive probe requests with in a set. */
1088 __le32 probe_spacing_time;
1090 * data inactivity time in msec on bss channel that will be used by
1091 * scanner for measuring the inactivity.
1094 /* maximum time in msec allowed for scan */
1095 __le32 max_scan_time;
1097 * delay in msec before sending first probe request after switching
1101 /* Scan control flags */
1102 __le32 scan_ctrl_flags;
1104 /* Burst duration time in msecs */
1105 __le32 burst_duration;
1107 * TLV (tag length value ) paramerters follow the scan_cmd structure.
1108 * TLV can contain channel list, bssid list, ssid list and
1109 * ie. the TLV tags are defined above;
1113 struct wmi_ssid_arg {
1118 struct wmi_bssid_arg {
1122 struct wmi_start_scan_arg {
1127 u32 notify_scan_events;
1128 u32 dwell_time_active;
1129 u32 dwell_time_passive;
1132 u32 repeat_probe_time;
1133 u32 probe_spacing_time;
1137 u32 scan_ctrl_flags;
1144 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
1146 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
1147 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
1150 /* scan control flags */
1152 /* passively scan all channels including active channels */
1153 #define WMI_SCAN_FLAG_PASSIVE 0x1
1154 /* add wild card ssid probe request even though ssid_list is specified. */
1155 #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
1156 /* add cck rates to rates/xrate ie for the generated probe request */
1157 #define WMI_SCAN_ADD_CCK_RATES 0x4
1158 /* add ofdm rates to rates/xrate ie for the generated probe request */
1159 #define WMI_SCAN_ADD_OFDM_RATES 0x8
1160 /* To enable indication of Chan load and Noise floor to host */
1161 #define WMI_SCAN_CHAN_STAT_EVENT 0x10
1162 /* Filter Probe request frames */
1163 #define WMI_SCAN_FILTER_PROBE_REQ 0x20
1164 /* When set, DFS channels will not be scanned */
1165 #define WMI_SCAN_BYPASS_DFS_CHN 0x40
1166 /* Different FW scan engine may choose to bail out on errors.
1167 * Allow the driver to have influence over that. */
1168 #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
1170 /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
1171 #define WMI_SCAN_CLASS_MASK 0xFF000000
1174 enum wmi_stop_scan_type {
1175 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
1176 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
1177 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
1180 struct wmi_stop_scan_cmd {
1187 struct wmi_stop_scan_arg {
1189 enum wmi_stop_scan_type req_type;
1196 struct wmi_scan_chan_list_cmd {
1197 __le32 num_scan_chans;
1198 struct wmi_channel chan_info[0];
1201 struct wmi_scan_chan_list_arg {
1203 struct wmi_channel_arg *channels;
1206 enum wmi_bss_filter {
1207 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
1208 WMI_BSS_FILTER_ALL, /* all beacons forwarded */
1209 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
1210 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
1211 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
1212 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
1213 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
1214 WMI_BSS_FILTER_LAST_BSS, /* marker only */
1217 enum wmi_scan_event_type {
1218 WMI_SCAN_EVENT_STARTED = 0x1,
1219 WMI_SCAN_EVENT_COMPLETED = 0x2,
1220 WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
1221 WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
1222 WMI_SCAN_EVENT_DEQUEUED = 0x10,
1223 WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
1224 WMI_SCAN_EVENT_START_FAILED = 0x40,
1225 WMI_SCAN_EVENT_RESTARTED = 0x80,
1226 WMI_SCAN_EVENT_MAX = 0x8000
1229 enum wmi_scan_completion_reason {
1230 WMI_SCAN_REASON_COMPLETED,
1231 WMI_SCAN_REASON_CANCELLED,
1232 WMI_SCAN_REASON_PREEMPTED,
1233 WMI_SCAN_REASON_TIMEDOUT,
1234 WMI_SCAN_REASON_MAX,
1237 struct wmi_scan_event {
1238 __le32 event_type; /* %WMI_SCAN_EVENT_ */
1239 __le32 reason; /* %WMI_SCAN_REASON_ */
1240 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
1247 * This defines how much headroom is kept in the
1248 * receive frame between the descriptor and the
1249 * payload, in order for the WMI PHY error and
1250 * management handler to insert header contents.
1254 #define WMI_MGMT_RX_HDR_HEADROOM 52
1257 * This event will be used for sending scan results
1258 * as well as rx mgmt frames to the host. The rx buffer
1259 * will be sent as part of this WMI event. It would be a
1260 * good idea to pass all the fields in the RX status
1261 * descriptor up to the host.
1263 struct wmi_mgmt_rx_hdr_v1 {
1269 __le32 status; /* %WMI_RX_STATUS_ */
1272 struct wmi_mgmt_rx_hdr_v2 {
1273 struct wmi_mgmt_rx_hdr_v1 v1;
1277 struct wmi_mgmt_rx_event_v1 {
1278 struct wmi_mgmt_rx_hdr_v1 hdr;
1282 struct wmi_mgmt_rx_event_v2 {
1283 struct wmi_mgmt_rx_hdr_v2 hdr;
1287 #define WMI_RX_STATUS_OK 0x00
1288 #define WMI_RX_STATUS_ERR_CRC 0x01
1289 #define WMI_RX_STATUS_ERR_DECRYPT 0x08
1290 #define WMI_RX_STATUS_ERR_MIC 0x10
1291 #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
1293 struct wmi_single_phyerr_rx_hdr {
1295 __le32 tsf_timestamp;
1298 * Current freq1, freq2
1301 * [15:8] : freq1[hi]
1302 * [23:16]: freq2[lo]
1303 * [31:24]: freq2[hi]
1309 * Combined RSSI over all chains and channel width for this PHY error
1311 * [7:0]: RSSI combined
1312 * [15:8]: Channel width (MHz)
1313 * [23:16]: PHY error code
1314 * [24:16]: reserved (future use)
1322 * RSSI on chain 0 through 3
1324 * This is formatted the same as the PPDU_START RX descriptor
1339 * Last calibrated NF value for chain 0 through 3
1343 * + [15:0] - chain 0
1344 * + [31:16] - chain 1
1348 * + [15:0] - chain 2
1349 * + [31:16] - chain 3
1355 /* Length of the frame */
1359 struct wmi_single_phyerr_rx_event {
1360 /* Phy error event header */
1361 struct wmi_single_phyerr_rx_hdr hdr;
1366 struct wmi_comb_phyerr_rx_hdr {
1367 /* Phy error phy error count */
1368 __le32 num_phyerr_events;
1373 struct wmi_comb_phyerr_rx_event {
1374 /* Phy error phy error count */
1375 struct wmi_comb_phyerr_rx_hdr hdr;
1377 * frame buffer - contains multiple payloads in the order:
1378 * header - payload, header - payload...
1379 * (The header is of type: wmi_single_phyerr_rx_hdr)
1384 struct wmi_mgmt_tx_hdr {
1386 struct wmi_mac_addr peer_macaddr;
1392 struct wmi_mgmt_tx_cmd {
1393 struct wmi_mgmt_tx_hdr hdr;
1397 struct wmi_echo_event {
1401 struct wmi_echo_cmd {
1406 struct wmi_pdev_set_regdomain_cmd {
1408 __le32 reg_domain_2G;
1409 __le32 reg_domain_5G;
1410 __le32 conformance_test_limit_2G;
1411 __le32 conformance_test_limit_5G;
1414 /* Command to set/unset chip in quiet mode */
1415 struct wmi_pdev_set_quiet_cmd {
1419 /* duration in TUs */
1425 /* enable/disable */
1431 * 802.11g protection mode.
1433 enum ath10k_protmode {
1434 ATH10K_PROT_NONE = 0, /* no protection */
1435 ATH10K_PROT_CTSONLY = 1, /* CTS to self */
1436 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
1439 enum wmi_beacon_gen_mode {
1440 WMI_BEACON_STAGGERED_MODE = 0,
1441 WMI_BEACON_BURST_MODE = 1
1444 enum wmi_csa_event_ies_present_flag {
1445 WMI_CSA_IE_PRESENT = 0x00000001,
1446 WMI_XCSA_IE_PRESENT = 0x00000002,
1447 WMI_WBW_IE_PRESENT = 0x00000004,
1448 WMI_CSWARP_IE_PRESENT = 0x00000008,
1451 /* wmi CSA receive event from beacon frame */
1452 struct wmi_csa_event {
1455 /* Bit 16-31: DUR */
1456 struct wmi_mac_addr i_addr1;
1457 struct wmi_mac_addr i_addr2;
1462 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
1465 /* the definition of different PDEV parameters */
1466 #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
1467 #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
1468 #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
1470 enum wmi_pdev_param {
1472 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
1474 WMI_PDEV_PARAM_RX_CHAIN_MASK,
1475 /* TX power limit for 2G Radio */
1476 WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
1477 /* TX power limit for 5G Radio */
1478 WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
1479 /* TX power scale */
1480 WMI_PDEV_PARAM_TXPOWER_SCALE,
1481 /* Beacon generation mode . 0: host, 1: target */
1482 WMI_PDEV_PARAM_BEACON_GEN_MODE,
1483 /* Beacon generation mode . 0: staggered 1: bursted */
1484 WMI_PDEV_PARAM_BEACON_TX_MODE,
1486 * Resource manager off chan mode .
1487 * 0: turn off off chan mode. 1: turn on offchan mode
1489 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
1492 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
1494 WMI_PDEV_PARAM_PROTECTION_MODE,
1495 /* Dynamic bandwidth 0: disable 1: enable */
1496 WMI_PDEV_PARAM_DYNAMIC_BW,
1497 /* Non aggregrate/ 11g sw retry threshold.0-disable */
1498 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
1499 /* aggregrate sw retry threshold. 0-disable*/
1500 WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
1501 /* Station kickout threshold (non of consecutive failures).0-disable */
1502 WMI_PDEV_PARAM_STA_KICKOUT_TH,
1503 /* Aggerate size scaling configuration per AC */
1504 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
1506 WMI_PDEV_PARAM_LTR_ENABLE,
1507 /* LTR latency for BE, in us */
1508 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
1509 /* LTR latency for BK, in us */
1510 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
1511 /* LTR latency for VI, in us */
1512 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
1513 /* LTR latency for VO, in us */
1514 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
1515 /* LTR AC latency timeout, in ms */
1516 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
1517 /* LTR platform latency override, in us */
1518 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
1519 /* LTR-RX override, in us */
1520 WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
1521 /* Tx activity timeout for LTR, in us */
1522 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
1523 /* L1SS state machine enable */
1524 WMI_PDEV_PARAM_L1SS_ENABLE,
1525 /* Deep sleep state machine enable */
1526 WMI_PDEV_PARAM_DSLEEP_ENABLE,
1527 /* RX buffering flush enable */
1528 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
1529 /* RX buffering matermark */
1530 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
1531 /* RX buffering timeout enable */
1532 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
1533 /* RX buffering timeout value */
1534 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
1535 /* pdev level stats update period in ms */
1536 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
1537 /* vdev level stats update period in ms */
1538 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
1539 /* peer level stats update period in ms */
1540 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
1541 /* beacon filter status update period */
1542 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
1543 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
1544 WMI_PDEV_PARAM_PMF_QOS,
1545 /* Access category on which ARP frames are sent */
1546 WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
1547 /* DCS configuration */
1549 /* Enable/Disable ANI on target */
1550 WMI_PDEV_PARAM_ANI_ENABLE,
1551 /* configure the ANI polling period */
1552 WMI_PDEV_PARAM_ANI_POLL_PERIOD,
1553 /* configure the ANI listening period */
1554 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
1555 /* configure OFDM immunity level */
1556 WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
1557 /* configure CCK immunity level */
1558 WMI_PDEV_PARAM_ANI_CCK_LEVEL,
1559 /* Enable/Disable CDD for 1x1 STAs in rate control module */
1560 WMI_PDEV_PARAM_DYNTXCHAIN,
1561 /* Enable/Disable proxy STA */
1562 WMI_PDEV_PARAM_PROXY_STA,
1563 /* Enable/Disable low power state when all VDEVs are inactive/idle. */
1564 WMI_PDEV_PARAM_IDLE_PS_CONFIG,
1565 /* Enable/Disable power gating sleep */
1566 WMI_PDEV_PARAM_POWER_GATING_SLEEP,
1569 struct wmi_pdev_set_param_cmd {
1574 struct wmi_pdev_get_tpc_config_cmd {
1579 #define WMI_TPC_RATE_MAX 160
1580 #define WMI_TPC_TX_N_CHAIN 4
1582 enum wmi_tpc_config_event_flag {
1583 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
1584 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
1585 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
1588 struct wmi_pdev_tpc_config_event {
1592 __le32 twice_antenna_reduction;
1593 __le32 twice_max_rd_power;
1594 s32 twice_antenna_gain;
1597 __le32 num_tx_chain;
1600 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
1601 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
1602 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
1603 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
1604 u8 rates_array[WMI_TPC_RATE_MAX];
1607 /* Transmit power scale factor. */
1609 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
1610 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
1611 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
1612 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
1613 WMI_TP_SCALE_MIN = 4, /* min, but still on */
1614 WMI_TP_SCALE_SIZE = 5, /* max num of enum */
1617 struct wmi_set_channel_cmd {
1618 /* channel (only frequency and mode info are used) */
1619 struct wmi_channel chan;
1622 struct wmi_pdev_chanlist_update_event {
1623 /* number of channels */
1625 /* array of channels */
1626 struct wmi_channel channel_list[1];
1629 #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
1631 struct wmi_debug_mesg_event {
1632 /* message buffer, NULL terminated */
1633 char bufp[WMI_MAX_DEBUG_MESG];
1638 VDEV_SUBTYPE_P2PDEV = 0,
1640 VDEV_SUBTYPE_P2PCLI,
1647 struct wmi_pdev_set_channel_cmd {
1648 /* idnore power , only use flags , mode and freq */
1649 struct wmi_channel chan;
1652 /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
1653 #define WMI_DSCP_MAP_MAX (64)
1654 struct wmi_pdev_set_dscp_tid_map_cmd {
1655 /* map indicating DSCP to TID conversion */
1656 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
1659 enum mcast_bcast_rate_id {
1664 struct mcast_bcast_rate {
1665 enum mcast_bcast_rate_id rate_id;
1669 struct wmi_wmm_params {
1678 struct wmi_pdev_set_wmm_params {
1679 struct wmi_wmm_params ac_be;
1680 struct wmi_wmm_params ac_bk;
1681 struct wmi_wmm_params ac_vi;
1682 struct wmi_wmm_params ac_vo;
1685 struct wmi_wmm_params_arg {
1694 struct wmi_pdev_set_wmm_params_arg {
1695 struct wmi_wmm_params_arg ac_be;
1696 struct wmi_wmm_params_arg ac_bk;
1697 struct wmi_wmm_params_arg ac_vi;
1698 struct wmi_wmm_params_arg ac_vo;
1701 struct wal_dbg_tx_stats {
1702 /* Num HTT cookies queued to dispatch list */
1705 /* Num HTT cookies dispatched */
1706 __le32 comp_delivered;
1708 /* Num MSDU queued to WAL */
1711 /* Num MPDU queue to WAL */
1714 /* Num MSDUs dropped by WMM limit */
1717 /* Num Local frames queued */
1718 __le32 local_enqued;
1720 /* Num Local frames done */
1723 /* Num queued to HW */
1726 /* Num PPDU reaped from HW */
1732 /* Num PPDUs cleaned up in TX abort */
1735 /* Num MPDUs requed by SW */
1736 __le32 mpdus_requed;
1738 /* excessive retries */
1741 /* data hw rate code */
1744 /* Scheduler self triggers */
1745 __le32 self_triggers;
1747 /* frames dropped due to excessive sw retries */
1748 __le32 sw_retry_failure;
1750 /* illegal rate phy errors */
1751 __le32 illgl_rate_phy_err;
1753 /* wal pdev continous xretry */
1754 __le32 pdev_cont_xretry;
1756 /* wal pdev continous xretry */
1757 __le32 pdev_tx_timeout;
1759 /* wal pdev resets */
1762 __le32 phy_underrun;
1764 /* MPDU is more than txop limit */
1768 struct wal_dbg_rx_stats {
1769 /* Cnts any change in ring routing mid-ppdu */
1770 __le32 mid_ppdu_route_change;
1772 /* Total number of statuses processed */
1775 /* Extra frags on rings 0-3 */
1781 /* MSDUs / MPDUs delivered to HTT */
1785 /* MSDUs / MPDUs delivered to local stack */
1789 /* AMSDUs that have more MSDUs than the status ring size */
1790 __le32 oversize_amsdu;
1792 /* Number of PHY errors */
1795 /* Number of PHY errors drops */
1796 __le32 phy_err_drop;
1798 /* Number of mpdu errors - FCS, MIC, ENC etc. */
1802 struct wal_dbg_peer_stats {
1803 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
1807 struct wal_dbg_stats {
1808 struct wal_dbg_tx_stats tx;
1809 struct wal_dbg_rx_stats rx;
1810 struct wal_dbg_peer_stats peer;
1814 WMI_REQUEST_PEER_STAT = 0x01,
1815 WMI_REQUEST_AP_STAT = 0x02
1818 struct wmi_request_stats_cmd {
1822 * Space to add parameters like
1827 /* Suspend option */
1832 /* suspend and disable all interrupts */
1833 WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
1836 struct wmi_pdev_suspend_cmd {
1837 /* suspend option sent to target */
1841 struct wmi_stats_event {
1842 __le32 stats_id; /* %WMI_REQUEST_ */
1844 * number of pdev stats event structures
1845 * (wmi_pdev_stats) 0 or 1
1847 __le32 num_pdev_stats;
1849 * number of vdev stats event structures
1850 * (wmi_vdev_stats) 0 or max vdevs
1852 __le32 num_vdev_stats;
1854 * number of peer stats event structures
1855 * (wmi_peer_stats) 0 or max peers
1857 __le32 num_peer_stats;
1858 __le32 num_bcnflt_stats;
1861 * num_pdev_stats * size of(struct wmi_pdev_stats)
1862 * num_vdev_stats * size of(struct wmi_vdev_stats)
1863 * num_peer_stats * size of(struct wmi_peer_stats)
1865 * By having a zero sized array, the pointer to data area
1866 * becomes available without increasing the struct size
1873 * TODO: add all PDEV stats here
1875 struct wmi_pdev_stats {
1876 __le32 chan_nf; /* Channel noise floor */
1877 __le32 tx_frame_count; /* TX frame count */
1878 __le32 rx_frame_count; /* RX frame count */
1879 __le32 rx_clear_count; /* rx clear count */
1880 __le32 cycle_count; /* cycle count */
1881 __le32 phy_err_count; /* Phy error count */
1882 __le32 chan_tx_pwr; /* channel tx power */
1883 struct wal_dbg_stats wal; /* WAL dbg stats */
1888 * TODO: add all VDEV stats here
1890 struct wmi_vdev_stats {
1896 * TODO: add more stats
1898 struct wmi_peer_stats {
1899 struct wmi_mac_addr peer_macaddr;
1901 __le32 peer_tx_rate;
1904 struct wmi_vdev_create_cmd {
1907 __le32 vdev_subtype;
1908 struct wmi_mac_addr vdev_macaddr;
1911 enum wmi_vdev_type {
1912 WMI_VDEV_TYPE_AP = 1,
1913 WMI_VDEV_TYPE_STA = 2,
1914 WMI_VDEV_TYPE_IBSS = 3,
1915 WMI_VDEV_TYPE_MONITOR = 4,
1918 enum wmi_vdev_subtype {
1919 WMI_VDEV_SUBTYPE_NONE = 0,
1920 WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
1921 WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
1922 WMI_VDEV_SUBTYPE_P2P_GO = 3,
1925 /* values for vdev_subtype */
1927 /* values for vdev_start_request flags */
1929 * Indicates that AP VDEV uses hidden ssid. only valid for
1931 #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
1933 * Indicates if robust management frame/management frame
1934 * protection is enabled. For GO/AP vdevs, it indicates that
1935 * it may support station/client associations with RMF enabled.
1936 * For STA/client vdevs, it indicates that sta will
1937 * associate with AP with RMF enabled. */
1938 #define WMI_VDEV_START_PMF_ENABLED (1<<1)
1940 struct wmi_p2p_noa_descriptor {
1941 __le32 type_count; /* 255: continuous schedule, 0: reserved */
1942 __le32 duration; /* Absent period duration in micro seconds */
1943 __le32 interval; /* Absent period interval in micro seconds */
1944 __le32 start_time; /* 32 bit tsf time when in starts */
1947 struct wmi_vdev_start_request_cmd {
1949 struct wmi_channel chan;
1950 /* unique id identifying the VDEV, generated by the caller */
1952 /* requestor id identifying the caller module */
1953 __le32 requestor_id;
1954 /* beacon interval from received beacon */
1955 __le32 beacon_interval;
1956 /* DTIM Period from the received beacon */
1960 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
1961 struct wmi_ssid ssid;
1962 /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
1964 /* beacon/probe reponse xmit power. Applicable for SoftAP. */
1965 __le32 bcn_tx_power;
1966 /* number of p2p NOA descriptor(s) from scan entry */
1967 __le32 num_noa_descriptors;
1969 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
1970 * During CAC, Our HW shouldn't ack ditected frames
1972 __le32 disable_hw_ack;
1973 /* actual p2p NOA descriptor from scan entry */
1974 struct wmi_p2p_noa_descriptor noa_descriptors[2];
1977 struct wmi_vdev_restart_request_cmd {
1978 struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
1981 struct wmi_vdev_start_request_arg {
1983 struct wmi_channel_arg channel;
1990 bool disable_hw_ack;
1995 struct wmi_vdev_delete_cmd {
1996 /* unique id identifying the VDEV, generated by the caller */
2000 struct wmi_vdev_up_cmd {
2002 __le32 vdev_assoc_id;
2003 struct wmi_mac_addr vdev_bssid;
2006 struct wmi_vdev_stop_cmd {
2010 struct wmi_vdev_down_cmd {
2014 struct wmi_vdev_standby_response_cmd {
2015 /* unique id identifying the VDEV, generated by the caller */
2019 struct wmi_vdev_resume_response_cmd {
2020 /* unique id identifying the VDEV, generated by the caller */
2024 struct wmi_vdev_set_param_cmd {
2030 #define WMI_MAX_KEY_INDEX 3
2031 #define WMI_MAX_KEY_LEN 32
2033 #define WMI_KEY_PAIRWISE 0x00
2034 #define WMI_KEY_GROUP 0x01
2035 #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
2037 struct wmi_key_seq_counter {
2038 __le32 key_seq_counter_l;
2039 __le32 key_seq_counter_h;
2042 #define WMI_CIPHER_NONE 0x0 /* clear key */
2043 #define WMI_CIPHER_WEP 0x1
2044 #define WMI_CIPHER_TKIP 0x2
2045 #define WMI_CIPHER_AES_OCB 0x3
2046 #define WMI_CIPHER_AES_CCM 0x4
2047 #define WMI_CIPHER_WAPI 0x5
2048 #define WMI_CIPHER_CKIP 0x6
2049 #define WMI_CIPHER_AES_CMAC 0x7
2051 struct wmi_vdev_install_key_cmd {
2053 struct wmi_mac_addr peer_macaddr;
2056 __le32 key_cipher; /* %WMI_CIPHER_ */
2057 struct wmi_key_seq_counter key_rsc_counter;
2058 struct wmi_key_seq_counter key_global_rsc_counter;
2059 struct wmi_key_seq_counter key_tsc_counter;
2060 u8 wpi_key_rsc_counter[16];
2061 u8 wpi_key_tsc_counter[16];
2063 __le32 key_txmic_len;
2064 __le32 key_rxmic_len;
2066 /* contains key followed by tx mic followed by rx mic */
2070 struct wmi_vdev_install_key_arg {
2079 const void *key_data;
2082 /* Preamble types to be used with VDEV fixed rate configuration */
2083 enum wmi_rate_preamble {
2084 WMI_RATE_PREAMBLE_OFDM,
2085 WMI_RATE_PREAMBLE_CCK,
2086 WMI_RATE_PREAMBLE_HT,
2087 WMI_RATE_PREAMBLE_VHT,
2090 /* Value to disable fixed rate setting */
2091 #define WMI_FIXED_RATE_NONE (0xff)
2093 /* the definition of different VDEV parameters */
2094 enum wmi_vdev_param {
2096 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
2097 /* Fragmentation threshold */
2098 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
2099 /* beacon interval in TUs */
2100 WMI_VDEV_PARAM_BEACON_INTERVAL,
2101 /* Listen interval in TUs */
2102 WMI_VDEV_PARAM_LISTEN_INTERVAL,
2103 /* muticast rate in Mbps */
2104 WMI_VDEV_PARAM_MULTICAST_RATE,
2105 /* management frame rate in Mbps */
2106 WMI_VDEV_PARAM_MGMT_TX_RATE,
2107 /* slot time (long vs short) */
2108 WMI_VDEV_PARAM_SLOT_TIME,
2109 /* preamble (long vs short) */
2110 WMI_VDEV_PARAM_PREAMBLE,
2111 /* SWBA time (time before tbtt in msec) */
2112 WMI_VDEV_PARAM_SWBA_TIME,
2113 /* time period for updating VDEV stats */
2114 WMI_VDEV_STATS_UPDATE_PERIOD,
2115 /* age out time in msec for frames queued for station in power save */
2116 WMI_VDEV_PWRSAVE_AGEOUT_TIME,
2118 * Host SWBA interval (time in msec before tbtt for SWBA event
2121 WMI_VDEV_HOST_SWBA_INTERVAL,
2122 /* DTIM period (specified in units of num beacon intervals) */
2123 WMI_VDEV_PARAM_DTIM_PERIOD,
2125 * scheduler air time limit for this VDEV. used by off chan
2128 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
2129 /* enable/dsiable WDS for this VDEV */
2132 WMI_VDEV_PARAM_ATIM_WINDOW,
2134 WMI_VDEV_PARAM_BMISS_COUNT_MAX,
2135 /* BMISS first time */
2136 WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
2137 /* BMISS final time */
2138 WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
2139 /* WMM enables/disabled */
2140 WMI_VDEV_PARAM_FEATURE_WMM,
2142 WMI_VDEV_PARAM_CHWIDTH,
2143 /* Channel Offset */
2144 WMI_VDEV_PARAM_CHEXTOFFSET,
2145 /* Disable HT Protection */
2146 WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
2147 /* Quick STA Kickout */
2148 WMI_VDEV_PARAM_STA_QUICKKICKOUT,
2149 /* Rate to be used with Management frames */
2150 WMI_VDEV_PARAM_MGMT_RATE,
2151 /* Protection Mode */
2152 WMI_VDEV_PARAM_PROTECTION_MODE,
2153 /* Fixed rate setting */
2154 WMI_VDEV_PARAM_FIXED_RATE,
2155 /* Short GI Enable/Disable */
2158 WMI_VDEV_PARAM_LDPC,
2159 /* Enable Tx STBC */
2160 WMI_VDEV_PARAM_TX_STBC,
2161 /* Enable Rx STBC */
2162 WMI_VDEV_PARAM_RX_STBC,
2163 /* Intra BSS forwarding */
2164 WMI_VDEV_PARAM_INTRA_BSS_FWD,
2165 /* Setting Default xmit key for Vdev */
2166 WMI_VDEV_PARAM_DEF_KEYID,
2169 /* Set the custom rate for the broadcast data frames */
2170 WMI_VDEV_PARAM_BCAST_DATA_RATE,
2171 /* Set the custom rate (rate-code) for multicast data frames */
2172 WMI_VDEV_PARAM_MCAST_DATA_RATE,
2173 /* Tx multicast packet indicate Enable/Disable */
2174 WMI_VDEV_PARAM_MCAST_INDICATE,
2175 /* Tx DHCP packet indicate Enable/Disable */
2176 WMI_VDEV_PARAM_DHCP_INDICATE,
2177 /* Enable host inspection of Tx unicast packet to unknown destination */
2178 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
2180 /* The minimum amount of time AP begins to consider STA inactive */
2181 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
2184 * An associated STA is considered inactive when there is no recent
2185 * TX/RX activity and no downlink frames are buffered for it. Once a
2186 * STA exceeds the maximum idle inactive time, the AP will send an
2187 * 802.11 data-null as a keep alive to verify the STA is still
2188 * associated. If the STA does ACK the data-null, or if the data-null
2189 * is buffered and the STA does not retrieve it, the STA will be
2190 * considered unresponsive
2191 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
2193 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
2196 * An associated STA is considered unresponsive if there is no recent
2197 * TX/RX activity and downlink frames are buffered for it. Once a STA
2198 * exceeds the maximum unresponsive time, the AP will send a
2199 * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
2200 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
2202 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
2203 WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
2204 /* Enable/Disable RTS-CTS */
2205 WMI_VDEV_PARAM_ENABLE_RTSCTS,
2206 /* Enable TXBFee/er */
2207 WMI_VDEV_PARAM_TXBF,
2209 /* Set packet power save */
2210 WMI_VDEV_PARAM_PACKET_POWERSAVE,
2213 * Drops un-encrypted packets if eceived in an encrypted connection
2214 * otherwise forwards to host.
2216 WMI_VDEV_PARAM_DROP_UNENCRY,
2219 * Set the encapsulation type for frames.
2221 WMI_VDEV_PARAM_TX_ENCAP_TYPE,
2224 /* slot time long */
2225 #define WMI_VDEV_SLOT_TIME_LONG 0x1
2226 /* slot time short */
2227 #define WMI_VDEV_SLOT_TIME_SHORT 0x2
2229 #define WMI_VDEV_PREAMBLE_LONG 0x1
2230 /* preablbe short */
2231 #define WMI_VDEV_PREAMBLE_SHORT 0x2
2233 enum wmi_start_event_param {
2234 WMI_VDEV_RESP_START_EVENT = 0,
2235 WMI_VDEV_RESP_RESTART_EVENT,
2238 struct wmi_vdev_start_response_event {
2241 __le32 resp_type; /* %WMI_VDEV_RESP_ */
2245 struct wmi_vdev_standby_req_event {
2246 /* unique id identifying the VDEV, generated by the caller */
2250 struct wmi_vdev_resume_req_event {
2251 /* unique id identifying the VDEV, generated by the caller */
2255 struct wmi_vdev_stopped_event {
2256 /* unique id identifying the VDEV, generated by the caller */
2261 * common structure used for simple events
2262 * (stopped, resume_req, standby response)
2264 struct wmi_vdev_simple_event {
2265 /* unique id identifying the VDEV, generated by the caller */
2269 /* VDEV start response status codes */
2270 /* VDEV succesfully started */
2271 #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
2273 /* requested VDEV not found */
2274 #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
2276 /* unsupported VDEV combination */
2277 #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
2279 /* Beacon processing related command and event structures */
2280 struct wmi_bcn_tx_hdr {
2287 struct wmi_bcn_tx_cmd {
2288 struct wmi_bcn_tx_hdr hdr;
2292 struct wmi_bcn_tx_arg {
2301 #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
2302 #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
2303 #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
2304 #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
2305 #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
2307 struct wmi_bcn_filter_rx_cmd {
2309 __le32 bcn_filter_id;
2310 /* Filter type - wmi_bcn_filter */
2313 __le32 bcn_filter_len;
2314 /* Filter info (threshold, BSSID, RSSI) */
2318 /* Capabilities and IEs to be passed to firmware */
2319 struct wmi_bcn_prb_info {
2324 /* Advanced capabilities */
2325 /* HT capabilities */
2335 struct wmi_bcn_tmpl_cmd {
2336 /* unique id identifying the VDEV, generated by the caller */
2338 /* TIM IE offset from the beginning of the template. */
2339 __le32 tim_ie_offset;
2340 /* beacon probe capabilities and IEs */
2341 struct wmi_bcn_prb_info bcn_prb_info;
2342 /* beacon buffer length */
2344 /* variable length data */
2348 struct wmi_prb_tmpl_cmd {
2349 /* unique id identifying the VDEV, generated by the caller */
2351 /* beacon probe capabilities and IEs */
2352 struct wmi_bcn_prb_info bcn_prb_info;
2353 /* beacon buffer length */
2355 /* Variable length data */
2359 enum wmi_sta_ps_mode {
2360 /* enable power save for the given STA VDEV */
2361 WMI_STA_PS_MODE_DISABLED = 0,
2362 /* disable power save for a given STA VDEV */
2363 WMI_STA_PS_MODE_ENABLED = 1,
2366 struct wmi_sta_powersave_mode_cmd {
2367 /* unique id identifying the VDEV, generated by the caller */
2372 * (see enum wmi_sta_ps_mode)
2377 enum wmi_csa_offload_en {
2378 WMI_CSA_OFFLOAD_DISABLE = 0,
2379 WMI_CSA_OFFLOAD_ENABLE = 1,
2382 struct wmi_csa_offload_enable_cmd {
2384 __le32 csa_offload_enable;
2387 struct wmi_csa_offload_chanswitch_cmd {
2389 struct wmi_channel chan;
2393 * This parameter controls the policy for retrieving frames from AP while the
2394 * STA is in sleep state.
2396 * Only takes affect if the sta_ps_mode is enabled
2398 enum wmi_sta_ps_param_rx_wake_policy {
2400 * Wake up when ever there is an RX activity on the VDEV. In this mode
2401 * the Power save SM(state machine) will come out of sleep by either
2402 * sending null frame (or) a data frame (with PS==0) in response to TIM
2403 * bit set in the received beacon frame from AP.
2405 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
2408 * Here the power save state machine will not wakeup in response to TIM
2409 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
2410 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
2411 * access categories are delivery-enabled, the station will send a
2412 * UAPSD trigger frame, otherwise it will send a PS-Poll.
2414 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
2418 * Number of tx frames/beacon that cause the power save SM to wake up.
2420 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
2421 * meaning, It will cause the SM to never wake up. This is useful if you want
2422 * to keep the system to sleep all the time for some kind of test mode . host
2423 * can change this parameter any time. It will affect at the next tx frame.
2425 enum wmi_sta_ps_param_tx_wake_threshold {
2426 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
2427 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
2430 * Values greater than one indicate that many TX attempts per beacon
2431 * interval before the STA will wake up
2436 * The maximum number of PS-Poll frames the FW will send in response to
2437 * traffic advertised in TIM before waking up (by sending a null frame with PS
2438 * = 0). Value 0 has a special meaning: there is no maximum count and the FW
2439 * will send as many PS-Poll as are necessary to retrieve buffered BU. This
2440 * parameter is used when the RX wake policy is
2441 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
2442 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
2444 enum wmi_sta_ps_param_pspoll_count {
2445 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
2447 * Values greater than 0 indicate the maximum numer of PS-Poll frames
2448 * FW will send before waking up.
2453 * This will include the delivery and trigger enabled state for every AC.
2454 * This is the negotiated state with AP. The host MLME needs to set this based
2455 * on AP capability and the state Set in the association request by the
2456 * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
2458 #define WMI_UAPSD_AC_TYPE_DELI 0
2459 #define WMI_UAPSD_AC_TYPE_TRIG 1
2461 #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
2462 ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
2464 enum wmi_sta_ps_param_uapsd {
2465 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
2466 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
2467 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
2468 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
2469 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
2470 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
2471 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
2472 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
2475 enum wmi_sta_powersave_param {
2477 * Controls how frames are retrievd from AP while STA is sleeping
2479 * (see enum wmi_sta_ps_param_rx_wake_policy)
2481 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
2484 * The STA will go active after this many TX
2486 * (see enum wmi_sta_ps_param_tx_wake_threshold)
2488 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
2491 * Number of PS-Poll to send before STA wakes up
2493 * (see enum wmi_sta_ps_param_pspoll_count)
2496 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
2499 * TX/RX inactivity time in msec before going to sleep.
2501 * The power save SM will monitor tx/rx activity on the VDEV, if no
2502 * activity for the specified msec of the parameter the Power save
2503 * SM will go to sleep.
2505 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
2508 * Set uapsd configuration.
2510 * (see enum wmi_sta_ps_param_uapsd)
2512 WMI_STA_PS_PARAM_UAPSD = 4,
2515 struct wmi_sta_powersave_param_cmd {
2517 __le32 param_id; /* %WMI_STA_PS_PARAM_ */
2521 /* No MIMO power save */
2522 #define WMI_STA_MIMO_PS_MODE_DISABLE
2523 /* mimo powersave mode static*/
2524 #define WMI_STA_MIMO_PS_MODE_STATIC
2525 /* mimo powersave mode dynamic */
2526 #define WMI_STA_MIMO_PS_MODE_DYNAMIC
2528 struct wmi_sta_mimo_ps_mode_cmd {
2529 /* unique id identifying the VDEV, generated by the caller */
2531 /* mimo powersave mode as defined above */
2532 __le32 mimo_pwrsave_mode;
2535 /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
2536 enum wmi_ap_ps_param_uapsd {
2537 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
2538 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
2539 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
2540 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
2541 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
2542 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
2543 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
2544 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
2547 /* U-APSD maximum service period of peer station */
2548 enum wmi_ap_ps_peer_param_max_sp {
2549 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
2550 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
2551 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
2552 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
2553 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
2557 * AP power save parameter
2558 * Set a power save specific parameter for a peer station
2560 enum wmi_ap_ps_peer_param {
2561 /* Set uapsd configuration for a given peer.
2563 * Include the delivery and trigger enabled state for every AC.
2564 * The host MLME needs to set this based on AP capability and stations
2565 * request Set in the association request received from the station.
2567 * Lower 8 bits of the value specify the UAPSD configuration.
2569 * (see enum wmi_ap_ps_param_uapsd)
2570 * The default value is 0.
2572 WMI_AP_PS_PEER_PARAM_UAPSD = 0,
2575 * Set the service period for a UAPSD capable station
2577 * The service period from wme ie in the (re)assoc request frame.
2579 * (see enum wmi_ap_ps_peer_param_max_sp)
2581 WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
2583 /* Time in seconds for aging out buffered frames for STA in PS */
2584 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
2587 struct wmi_ap_ps_peer_cmd {
2588 /* unique id identifying the VDEV, generated by the caller */
2591 /* peer MAC address */
2592 struct wmi_mac_addr peer_macaddr;
2594 /* AP powersave param (see enum wmi_ap_ps_peer_param) */
2597 /* AP powersave param value */
2601 /* 128 clients = 4 words */
2602 #define WMI_TIM_BITMAP_ARRAY_SIZE 4
2604 struct wmi_tim_info {
2607 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
2609 __le32 tim_num_ps_pending;
2612 /* Maximum number of NOA Descriptors supported */
2613 #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
2614 #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
2615 #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
2616 #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
2618 struct wmi_p2p_noa_info {
2619 /* Bit 0 - Flag to indicate an update in NOA schedule
2620 Bits 7-1 - Reserved */
2624 /* Bit 0 - Opp PS state of the AP
2625 Bits 1-7 - Ctwindow in TUs */
2627 /* Number of NOA descriptors */
2630 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
2633 struct wmi_bcn_info {
2634 struct wmi_tim_info tim_info;
2635 struct wmi_p2p_noa_info p2p_noa_info;
2638 struct wmi_host_swba_event {
2640 struct wmi_bcn_info bcn_info[1];
2643 #define WMI_MAX_AP_VDEV 16
2645 struct wmi_tbtt_offset_event {
2647 __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
2651 struct wmi_peer_create_cmd {
2653 struct wmi_mac_addr peer_macaddr;
2656 struct wmi_peer_delete_cmd {
2658 struct wmi_mac_addr peer_macaddr;
2661 struct wmi_peer_flush_tids_cmd {
2663 struct wmi_mac_addr peer_macaddr;
2664 __le32 peer_tid_bitmap;
2667 struct wmi_fixed_rate {
2669 * rate mode . 0: disable fixed rate (auto rate)
2670 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
2671 * 2: ht20 11n rate specified as mcs index
2672 * 3: ht40 11n rate specified as mcs index
2676 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
2677 * and series 3 is stored at byte 3 (MSB)
2681 * 4 retry counts for 4 rate series. retry count for rate 0 is stored
2682 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
2685 __le32 rate_retries;
2688 struct wmi_peer_fixed_rate_cmd {
2689 /* unique id identifying the VDEV, generated by the caller */
2691 /* peer MAC address */
2692 struct wmi_mac_addr peer_macaddr;
2694 struct wmi_fixed_rate peer_fixed_rate;
2697 #define WMI_MGMT_TID 17
2699 struct wmi_addba_clear_resp_cmd {
2700 /* unique id identifying the VDEV, generated by the caller */
2702 /* peer MAC address */
2703 struct wmi_mac_addr peer_macaddr;
2706 struct wmi_addba_send_cmd {
2707 /* unique id identifying the VDEV, generated by the caller */
2709 /* peer MAC address */
2710 struct wmi_mac_addr peer_macaddr;
2713 /* Buffer/Window size*/
2717 struct wmi_delba_send_cmd {
2718 /* unique id identifying the VDEV, generated by the caller */
2720 /* peer MAC address */
2721 struct wmi_mac_addr peer_macaddr;
2730 struct wmi_addba_setresponse_cmd {
2731 /* unique id identifying the vdev, generated by the caller */
2733 /* peer mac address */
2734 struct wmi_mac_addr peer_macaddr;
2741 struct wmi_send_singleamsdu_cmd {
2742 /* unique id identifying the vdev, generated by the caller */
2744 /* peer mac address */
2745 struct wmi_mac_addr peer_macaddr;
2750 enum wmi_peer_smps_state {
2751 WMI_PEER_SMPS_PS_NONE = 0x0,
2752 WMI_PEER_SMPS_STATIC = 0x1,
2753 WMI_PEER_SMPS_DYNAMIC = 0x2
2756 enum wmi_peer_param {
2757 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
2758 WMI_PEER_AMPDU = 0x2,
2759 WMI_PEER_AUTHORIZE = 0x3,
2760 WMI_PEER_CHAN_WIDTH = 0x4,
2762 WMI_PEER_USE_4ADDR = 0x6
2765 struct wmi_peer_set_param_cmd {
2767 struct wmi_mac_addr peer_macaddr;
2772 #define MAX_SUPPORTED_RATES 128
2774 struct wmi_rate_set {
2775 /* total number of rates */
2778 * rates (each 8bit value) packed into a 32 bit word.
2779 * the rates are filled from least significant byte to most
2782 __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
2785 struct wmi_rate_set_arg {
2786 unsigned int num_rates;
2787 u8 rates[MAX_SUPPORTED_RATES];
2791 * NOTE: It would bea good idea to represent the Tx MCS
2792 * info in one word and Rx in another word. This is split
2793 * into multiple words for convenience
2795 struct wmi_vht_rate_set {
2796 __le32 rx_max_rate; /* Max Rx data rate */
2797 __le32 rx_mcs_set; /* Negotiated RX VHT rates */
2798 __le32 tx_max_rate; /* Max Tx data rate */
2799 __le32 tx_mcs_set; /* Negotiated TX VHT rates */
2802 struct wmi_vht_rate_set_arg {
2809 struct wmi_peer_set_rates_cmd {
2810 /* peer MAC address */
2811 struct wmi_mac_addr peer_macaddr;
2812 /* legacy rate set */
2813 struct wmi_rate_set peer_legacy_rates;
2815 struct wmi_rate_set peer_ht_rates;
2818 struct wmi_peer_set_q_empty_callback_cmd {
2819 /* unique id identifying the VDEV, generated by the caller */
2821 /* peer MAC address */
2822 struct wmi_mac_addr peer_macaddr;
2823 __le32 callback_enable;
2826 #define WMI_PEER_AUTH 0x00000001
2827 #define WMI_PEER_QOS 0x00000002
2828 #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
2829 #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
2830 #define WMI_PEER_APSD 0x00000800
2831 #define WMI_PEER_HT 0x00001000
2832 #define WMI_PEER_40MHZ 0x00002000
2833 #define WMI_PEER_STBC 0x00008000
2834 #define WMI_PEER_LDPC 0x00010000
2835 #define WMI_PEER_DYN_MIMOPS 0x00020000
2836 #define WMI_PEER_STATIC_MIMOPS 0x00040000
2837 #define WMI_PEER_SPATIAL_MUX 0x00200000
2838 #define WMI_PEER_VHT 0x02000000
2839 #define WMI_PEER_80MHZ 0x04000000
2840 #define WMI_PEER_PMF 0x08000000
2843 * Peer rate capabilities.
2845 * This is of interest to the ratecontrol
2846 * module which resides in the firmware. The bit definitions are
2847 * consistent with that defined in if_athrate.c.
2849 #define WMI_RC_DS_FLAG 0x01
2850 #define WMI_RC_CW40_FLAG 0x02
2851 #define WMI_RC_SGI_FLAG 0x04
2852 #define WMI_RC_HT_FLAG 0x08
2853 #define WMI_RC_RTSCTS_FLAG 0x10
2854 #define WMI_RC_TX_STBC_FLAG 0x20
2855 #define WMI_RC_RX_STBC_FLAG 0xC0
2856 #define WMI_RC_RX_STBC_FLAG_S 6
2857 #define WMI_RC_WEP_TKIP_FLAG 0x100
2858 #define WMI_RC_TS_FLAG 0x200
2859 #define WMI_RC_UAPSD_FLAG 0x400
2861 /* Maximum listen interval supported by hw in units of beacon interval */
2862 #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
2864 struct wmi_peer_assoc_complete_cmd {
2865 struct wmi_mac_addr peer_macaddr;
2867 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
2868 __le32 peer_associd; /* 16 LSBs */
2870 __le32 peer_caps; /* 16 LSBs */
2871 __le32 peer_listen_intval;
2872 __le32 peer_ht_caps;
2873 __le32 peer_max_mpdu;
2874 __le32 peer_mpdu_density; /* 0..16 */
2875 __le32 peer_rate_caps;
2876 struct wmi_rate_set peer_legacy_rates;
2877 struct wmi_rate_set peer_ht_rates;
2878 __le32 peer_nss; /* num of spatial streams */
2879 __le32 peer_vht_caps;
2880 __le32 peer_phymode;
2881 struct wmi_vht_rate_set peer_vht_rates;
2882 /* HT Operation Element of the peer. Five bytes packed in 2
2883 * INT32 array and filled from lsb to msb. */
2884 __le32 peer_ht_info[2];
2887 struct wmi_peer_assoc_complete_arg {
2892 u32 peer_flags; /* see %WMI_PEER_ */
2894 u32 peer_listen_intval;
2897 u32 peer_mpdu_density; /* 0..16 */
2898 u32 peer_rate_caps; /* see %WMI_RC_ */
2899 struct wmi_rate_set_arg peer_legacy_rates;
2900 struct wmi_rate_set_arg peer_ht_rates;
2901 u32 peer_num_spatial_streams;
2903 enum wmi_phy_mode peer_phymode;
2904 struct wmi_vht_rate_set_arg peer_vht_rates;
2907 struct wmi_peer_add_wds_entry_cmd {
2908 /* peer MAC address */
2909 struct wmi_mac_addr peer_macaddr;
2911 struct wmi_mac_addr wds_macaddr;
2914 struct wmi_peer_remove_wds_entry_cmd {
2916 struct wmi_mac_addr wds_macaddr;
2919 struct wmi_peer_q_empty_callback_event {
2920 /* peer MAC address */
2921 struct wmi_mac_addr peer_macaddr;
2925 * Channel info WMI event
2927 struct wmi_chan_info_event {
2932 __le32 rx_clear_count;
2936 #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
2938 /* FIXME: empirically extrapolated */
2939 #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
2941 /* Beacon filter wmi command info */
2942 #define BCN_FLT_MAX_SUPPORTED_IES 256
2943 #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
2945 struct bss_bcn_stats {
2947 __le32 bss_bcnsdropped;
2948 __le32 bss_bcnsdelivered;
2951 struct bcn_filter_stats {
2952 __le32 bcns_dropped;
2953 __le32 bcns_delivered;
2954 __le32 activefilters;
2955 struct bss_bcn_stats bss_stats;
2958 struct wmi_add_bcn_filter_cmd {
2960 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
2963 enum wmi_sta_keepalive_method {
2964 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
2965 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
2968 /* note: ip4 addresses are in network byte order, i.e. big endian */
2969 struct wmi_sta_keepalive_arp_resp {
2970 __be32 src_ip4_addr;
2971 __be32 dest_ip4_addr;
2972 struct wmi_mac_addr dest_mac_addr;
2975 struct wmi_sta_keepalive_cmd {
2978 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
2979 __le32 interval; /* in seconds */
2980 struct wmi_sta_keepalive_arp_resp arp_resp;
2983 enum wmi_force_fw_hang_type {
2984 WMI_FORCE_FW_HANG_ASSERT = 1,
2985 WMI_FORCE_FW_HANG_NO_DETECT,
2986 WMI_FORCE_FW_HANG_CTRL_EP_FULL,
2987 WMI_FORCE_FW_HANG_EMPTY_POINT,
2988 WMI_FORCE_FW_HANG_STACK_OVERFLOW,
2989 WMI_FORCE_FW_HANG_INFINITE_LOOP,
2992 #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
2994 struct wmi_force_fw_hang_cmd {
2999 #define ATH10K_RTS_MAX 2347
3000 #define ATH10K_FRAGMT_THRESHOLD_MIN 540
3001 #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
3003 #define WMI_MAX_EVENT 0x1000
3004 /* Maximum number of pending TXed WMI packets */
3005 #define WMI_MAX_PENDING_TX_COUNT 128
3006 #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
3008 /* By default disable power save for IBSS */
3009 #define ATH10K_DEFAULT_ATIM 0
3014 int ath10k_wmi_attach(struct ath10k *ar);
3015 void ath10k_wmi_detach(struct ath10k *ar);
3016 int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
3017 int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
3018 void ath10k_wmi_flush_tx(struct ath10k *ar);
3020 int ath10k_wmi_connect_htc_service(struct ath10k *ar);
3021 int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
3022 const struct wmi_channel_arg *);
3023 int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
3024 int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
3025 int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
3026 u16 rd5g, u16 ctl2g, u16 ctl5g);
3027 int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
3029 int ath10k_wmi_cmd_init(struct ath10k *ar);
3030 int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
3031 void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
3032 int ath10k_wmi_stop_scan(struct ath10k *ar,
3033 const struct wmi_stop_scan_arg *arg);
3034 int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
3035 enum wmi_vdev_type type,
3036 enum wmi_vdev_subtype subtype,
3037 const u8 macaddr[ETH_ALEN]);
3038 int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
3039 int ath10k_wmi_vdev_start(struct ath10k *ar,
3040 const struct wmi_vdev_start_request_arg *);
3041 int ath10k_wmi_vdev_restart(struct ath10k *ar,
3042 const struct wmi_vdev_start_request_arg *);
3043 int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
3044 int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
3046 int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
3047 int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
3048 enum wmi_vdev_param param_id, u32 param_value);
3049 int ath10k_wmi_vdev_install_key(struct ath10k *ar,
3050 const struct wmi_vdev_install_key_arg *arg);
3051 int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
3052 const u8 peer_addr[ETH_ALEN]);
3053 int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
3054 const u8 peer_addr[ETH_ALEN]);
3055 int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
3056 const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
3057 int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
3058 const u8 *peer_addr,
3059 enum wmi_peer_param param_id, u32 param_value);
3060 int ath10k_wmi_peer_assoc(struct ath10k *ar,
3061 const struct wmi_peer_assoc_complete_arg *arg);
3062 int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
3063 enum wmi_sta_ps_mode psmode);
3064 int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
3065 enum wmi_sta_powersave_param param_id,
3067 int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
3068 enum wmi_ap_ps_peer_param param_id, u32 value);
3069 int ath10k_wmi_scan_chan_list(struct ath10k *ar,
3070 const struct wmi_scan_chan_list_arg *arg);
3071 int ath10k_wmi_beacon_send(struct ath10k *ar, const struct wmi_bcn_tx_arg *arg);
3072 int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
3073 const struct wmi_pdev_set_wmm_params_arg *arg);
3074 int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
3075 int ath10k_wmi_force_fw_hang(struct ath10k *ar,
3076 enum wmi_force_fw_hang_type type, u32 delay_ms);
3078 #endif /* _WMI_H_ */