1 /* 2 * Copyright (c) 2005-2011 Atheros Communications Inc. 3 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. 4 * Copyright (c) 2018, The Linux Foundation. All rights reserved. 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef _WMI_H_ 20 #define _WMI_H_ 21 22 #include <linux/types.h> 23 #include <net/mac80211.h> 24 25 /* 26 * This file specifies the WMI interface for the Unified Software 27 * Architecture. 28 * 29 * It includes definitions of all the commands and events. Commands are 30 * messages from the host to the target. Events and Replies are messages 31 * from the target to the host. 32 * 33 * Ownership of correctness in regards to WMI commands belongs to the host 34 * driver and the target is not required to validate parameters for value, 35 * proper range, or any other checking. 36 * 37 * Guidelines for extending this interface are below. 38 * 39 * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff 40 * 41 * 2. Use ONLY u32 type for defining member variables within WMI 42 * command/event structures. Do not use u8, u16, bool or 43 * enum types within these structures. 44 * 45 * 3. DO NOT define bit fields within structures. Implement bit fields 46 * using masks if necessary. Do not use the programming language's bit 47 * field definition. 48 * 49 * 4. Define macros for encode/decode of u8, u16 fields within 50 * the u32 variables. Use these macros for set/get of these fields. 51 * Try to use this to optimize the structure without bloating it with 52 * u32 variables for every lower sized field. 53 * 54 * 5. Do not use PACK/UNPACK attributes for the structures as each member 55 * variable is already 4-byte aligned by virtue of being a u32 56 * type. 57 * 58 * 6. Comment each parameter part of the WMI command/event structure by 59 * using the 2 stars at the beginning of C comment instead of one star to 60 * enable HTML document generation using Doxygen. 61 * 62 */ 63 64 /* Control Path */ 65 struct wmi_cmd_hdr { 66 __le32 cmd_id; 67 } __packed; 68 69 #define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF 70 #define WMI_CMD_HDR_CMD_ID_LSB 0 71 #define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000 72 #define WMI_CMD_HDR_PLT_PRIV_LSB 24 73 74 #define HTC_PROTOCOL_VERSION 0x0002 75 #define WMI_PROTOCOL_VERSION 0x0002 76 77 /* 78 * There is no signed version of __le32, so for a temporary solution come 79 * up with our own version. The idea is from fs/ntfs/endian.h. 80 * 81 * Use a_ prefix so that it doesn't conflict if we get proper support to 82 * linux/types.h. 83 */ 84 typedef __s32 __bitwise a_sle32; 85 86 static inline a_sle32 a_cpu_to_sle32(s32 val) 87 { 88 return (__force a_sle32)cpu_to_le32(val); 89 } 90 91 static inline s32 a_sle32_to_cpu(a_sle32 val) 92 { 93 return le32_to_cpu((__force __le32)val); 94 } 95 96 enum wmi_service { 97 WMI_SERVICE_BEACON_OFFLOAD = 0, 98 WMI_SERVICE_SCAN_OFFLOAD, 99 WMI_SERVICE_ROAM_OFFLOAD, 100 WMI_SERVICE_BCN_MISS_OFFLOAD, 101 WMI_SERVICE_STA_PWRSAVE, 102 WMI_SERVICE_STA_ADVANCED_PWRSAVE, 103 WMI_SERVICE_AP_UAPSD, 104 WMI_SERVICE_AP_DFS, 105 WMI_SERVICE_11AC, 106 WMI_SERVICE_BLOCKACK, 107 WMI_SERVICE_PHYERR, 108 WMI_SERVICE_BCN_FILTER, 109 WMI_SERVICE_RTT, 110 WMI_SERVICE_RATECTRL, 111 WMI_SERVICE_WOW, 112 WMI_SERVICE_RATECTRL_CACHE, 113 WMI_SERVICE_IRAM_TIDS, 114 WMI_SERVICE_ARPNS_OFFLOAD, 115 WMI_SERVICE_NLO, 116 WMI_SERVICE_GTK_OFFLOAD, 117 WMI_SERVICE_SCAN_SCH, 118 WMI_SERVICE_CSA_OFFLOAD, 119 WMI_SERVICE_CHATTER, 120 WMI_SERVICE_COEX_FREQAVOID, 121 WMI_SERVICE_PACKET_POWER_SAVE, 122 WMI_SERVICE_FORCE_FW_HANG, 123 WMI_SERVICE_GPIO, 124 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, 125 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, 126 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, 127 WMI_SERVICE_STA_KEEP_ALIVE, 128 WMI_SERVICE_TX_ENCAP, 129 WMI_SERVICE_BURST, 130 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, 131 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, 132 WMI_SERVICE_ROAM_SCAN_OFFLOAD, 133 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, 134 WMI_SERVICE_EARLY_RX, 135 WMI_SERVICE_STA_SMPS, 136 WMI_SERVICE_FWTEST, 137 WMI_SERVICE_STA_WMMAC, 138 WMI_SERVICE_TDLS, 139 WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE, 140 WMI_SERVICE_ADAPTIVE_OCS, 141 WMI_SERVICE_BA_SSN_SUPPORT, 142 WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE, 143 WMI_SERVICE_WLAN_HB, 144 WMI_SERVICE_LTE_ANT_SHARE_SUPPORT, 145 WMI_SERVICE_BATCH_SCAN, 146 WMI_SERVICE_QPOWER, 147 WMI_SERVICE_PLMREQ, 148 WMI_SERVICE_THERMAL_MGMT, 149 WMI_SERVICE_RMC, 150 WMI_SERVICE_MHF_OFFLOAD, 151 WMI_SERVICE_COEX_SAR, 152 WMI_SERVICE_BCN_TXRATE_OVERRIDE, 153 WMI_SERVICE_NAN, 154 WMI_SERVICE_L1SS_STAT, 155 WMI_SERVICE_ESTIMATE_LINKSPEED, 156 WMI_SERVICE_OBSS_SCAN, 157 WMI_SERVICE_TDLS_OFFCHAN, 158 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA, 159 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA, 160 WMI_SERVICE_IBSS_PWRSAVE, 161 WMI_SERVICE_LPASS, 162 WMI_SERVICE_EXTSCAN, 163 WMI_SERVICE_D0WOW, 164 WMI_SERVICE_HSOFFLOAD, 165 WMI_SERVICE_ROAM_HO_OFFLOAD, 166 WMI_SERVICE_RX_FULL_REORDER, 167 WMI_SERVICE_DHCP_OFFLOAD, 168 WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT, 169 WMI_SERVICE_MDNS_OFFLOAD, 170 WMI_SERVICE_SAP_AUTH_OFFLOAD, 171 WMI_SERVICE_ATF, 172 WMI_SERVICE_COEX_GPIO, 173 WMI_SERVICE_ENHANCED_PROXY_STA, 174 WMI_SERVICE_TT, 175 WMI_SERVICE_PEER_CACHING, 176 WMI_SERVICE_AUX_SPECTRAL_INTF, 177 WMI_SERVICE_AUX_CHAN_LOAD_INTF, 178 WMI_SERVICE_BSS_CHANNEL_INFO_64, 179 WMI_SERVICE_EXT_RES_CFG_SUPPORT, 180 WMI_SERVICE_MESH_11S, 181 WMI_SERVICE_MESH_NON_11S, 182 WMI_SERVICE_PEER_STATS, 183 WMI_SERVICE_RESTRT_CHNL_SUPPORT, 184 WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, 185 WMI_SERVICE_TX_MODE_PUSH_ONLY, 186 WMI_SERVICE_TX_MODE_PUSH_PULL, 187 WMI_SERVICE_TX_MODE_DYNAMIC, 188 WMI_SERVICE_VDEV_RX_FILTER, 189 WMI_SERVICE_BTCOEX, 190 WMI_SERVICE_CHECK_CAL_VERSION, 191 WMI_SERVICE_DBGLOG_WARN2, 192 WMI_SERVICE_BTCOEX_DUTY_CYCLE, 193 WMI_SERVICE_4_WIRE_COEX_SUPPORT, 194 WMI_SERVICE_EXTENDED_NSS_SUPPORT, 195 WMI_SERVICE_PROG_GPIO_BAND_SELECT, 196 WMI_SERVICE_SMART_LOGGING_SUPPORT, 197 WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, 198 WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, 199 WMI_SERVICE_MGMT_TX_WMI, 200 WMI_SERVICE_TDLS_WIDER_BANDWIDTH, 201 WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, 202 WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, 203 WMI_SERVICE_TPC_STATS_FINAL, 204 WMI_SERVICE_RESET_CHIP, 205 206 /* keep last */ 207 WMI_SERVICE_MAX, 208 }; 209 210 enum wmi_10x_service { 211 WMI_10X_SERVICE_BEACON_OFFLOAD = 0, 212 WMI_10X_SERVICE_SCAN_OFFLOAD, 213 WMI_10X_SERVICE_ROAM_OFFLOAD, 214 WMI_10X_SERVICE_BCN_MISS_OFFLOAD, 215 WMI_10X_SERVICE_STA_PWRSAVE, 216 WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE, 217 WMI_10X_SERVICE_AP_UAPSD, 218 WMI_10X_SERVICE_AP_DFS, 219 WMI_10X_SERVICE_11AC, 220 WMI_10X_SERVICE_BLOCKACK, 221 WMI_10X_SERVICE_PHYERR, 222 WMI_10X_SERVICE_BCN_FILTER, 223 WMI_10X_SERVICE_RTT, 224 WMI_10X_SERVICE_RATECTRL, 225 WMI_10X_SERVICE_WOW, 226 WMI_10X_SERVICE_RATECTRL_CACHE, 227 WMI_10X_SERVICE_IRAM_TIDS, 228 WMI_10X_SERVICE_BURST, 229 230 /* introduced in 10.2 */ 231 WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT, 232 WMI_10X_SERVICE_FORCE_FW_HANG, 233 WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT, 234 WMI_10X_SERVICE_ATF, 235 WMI_10X_SERVICE_COEX_GPIO, 236 WMI_10X_SERVICE_AUX_SPECTRAL_INTF, 237 WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF, 238 WMI_10X_SERVICE_BSS_CHANNEL_INFO_64, 239 WMI_10X_SERVICE_MESH, 240 WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT, 241 WMI_10X_SERVICE_PEER_STATS, 242 WMI_10X_SERVICE_RESET_CHIP, 243 WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, 244 }; 245 246 enum wmi_main_service { 247 WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0, 248 WMI_MAIN_SERVICE_SCAN_OFFLOAD, 249 WMI_MAIN_SERVICE_ROAM_OFFLOAD, 250 WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD, 251 WMI_MAIN_SERVICE_STA_PWRSAVE, 252 WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE, 253 WMI_MAIN_SERVICE_AP_UAPSD, 254 WMI_MAIN_SERVICE_AP_DFS, 255 WMI_MAIN_SERVICE_11AC, 256 WMI_MAIN_SERVICE_BLOCKACK, 257 WMI_MAIN_SERVICE_PHYERR, 258 WMI_MAIN_SERVICE_BCN_FILTER, 259 WMI_MAIN_SERVICE_RTT, 260 WMI_MAIN_SERVICE_RATECTRL, 261 WMI_MAIN_SERVICE_WOW, 262 WMI_MAIN_SERVICE_RATECTRL_CACHE, 263 WMI_MAIN_SERVICE_IRAM_TIDS, 264 WMI_MAIN_SERVICE_ARPNS_OFFLOAD, 265 WMI_MAIN_SERVICE_NLO, 266 WMI_MAIN_SERVICE_GTK_OFFLOAD, 267 WMI_MAIN_SERVICE_SCAN_SCH, 268 WMI_MAIN_SERVICE_CSA_OFFLOAD, 269 WMI_MAIN_SERVICE_CHATTER, 270 WMI_MAIN_SERVICE_COEX_FREQAVOID, 271 WMI_MAIN_SERVICE_PACKET_POWER_SAVE, 272 WMI_MAIN_SERVICE_FORCE_FW_HANG, 273 WMI_MAIN_SERVICE_GPIO, 274 WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM, 275 WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, 276 WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, 277 WMI_MAIN_SERVICE_STA_KEEP_ALIVE, 278 WMI_MAIN_SERVICE_TX_ENCAP, 279 }; 280 281 enum wmi_10_4_service { 282 WMI_10_4_SERVICE_BEACON_OFFLOAD = 0, 283 WMI_10_4_SERVICE_SCAN_OFFLOAD, 284 WMI_10_4_SERVICE_ROAM_OFFLOAD, 285 WMI_10_4_SERVICE_BCN_MISS_OFFLOAD, 286 WMI_10_4_SERVICE_STA_PWRSAVE, 287 WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE, 288 WMI_10_4_SERVICE_AP_UAPSD, 289 WMI_10_4_SERVICE_AP_DFS, 290 WMI_10_4_SERVICE_11AC, 291 WMI_10_4_SERVICE_BLOCKACK, 292 WMI_10_4_SERVICE_PHYERR, 293 WMI_10_4_SERVICE_BCN_FILTER, 294 WMI_10_4_SERVICE_RTT, 295 WMI_10_4_SERVICE_RATECTRL, 296 WMI_10_4_SERVICE_WOW, 297 WMI_10_4_SERVICE_RATECTRL_CACHE, 298 WMI_10_4_SERVICE_IRAM_TIDS, 299 WMI_10_4_SERVICE_BURST, 300 WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT, 301 WMI_10_4_SERVICE_GTK_OFFLOAD, 302 WMI_10_4_SERVICE_SCAN_SCH, 303 WMI_10_4_SERVICE_CSA_OFFLOAD, 304 WMI_10_4_SERVICE_CHATTER, 305 WMI_10_4_SERVICE_COEX_FREQAVOID, 306 WMI_10_4_SERVICE_PACKET_POWER_SAVE, 307 WMI_10_4_SERVICE_FORCE_FW_HANG, 308 WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT, 309 WMI_10_4_SERVICE_GPIO, 310 WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, 311 WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, 312 WMI_10_4_SERVICE_STA_KEEP_ALIVE, 313 WMI_10_4_SERVICE_TX_ENCAP, 314 WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, 315 WMI_10_4_SERVICE_EARLY_RX, 316 WMI_10_4_SERVICE_ENHANCED_PROXY_STA, 317 WMI_10_4_SERVICE_TT, 318 WMI_10_4_SERVICE_ATF, 319 WMI_10_4_SERVICE_PEER_CACHING, 320 WMI_10_4_SERVICE_COEX_GPIO, 321 WMI_10_4_SERVICE_AUX_SPECTRAL_INTF, 322 WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF, 323 WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64, 324 WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT, 325 WMI_10_4_SERVICE_MESH_NON_11S, 326 WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT, 327 WMI_10_4_SERVICE_PEER_STATS, 328 WMI_10_4_SERVICE_MESH_11S, 329 WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, 330 WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY, 331 WMI_10_4_SERVICE_TX_MODE_PUSH_PULL, 332 WMI_10_4_SERVICE_TX_MODE_DYNAMIC, 333 WMI_10_4_SERVICE_VDEV_RX_FILTER, 334 WMI_10_4_SERVICE_BTCOEX, 335 WMI_10_4_SERVICE_CHECK_CAL_VERSION, 336 WMI_10_4_SERVICE_DBGLOG_WARN2, 337 WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE, 338 WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT, 339 WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT, 340 WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT, 341 WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT, 342 WMI_10_4_SERVICE_TDLS, 343 WMI_10_4_SERVICE_TDLS_OFFCHAN, 344 WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA, 345 WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA, 346 WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, 347 WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY, 348 WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH, 349 WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, 350 WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT, 351 WMI_10_4_SERVICE_TPC_STATS_FINAL, 352 }; 353 354 static inline char *wmi_service_name(int service_id) 355 { 356 #define SVCSTR(x) case x: return #x 357 358 switch (service_id) { 359 SVCSTR(WMI_SERVICE_BEACON_OFFLOAD); 360 SVCSTR(WMI_SERVICE_SCAN_OFFLOAD); 361 SVCSTR(WMI_SERVICE_ROAM_OFFLOAD); 362 SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD); 363 SVCSTR(WMI_SERVICE_STA_PWRSAVE); 364 SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE); 365 SVCSTR(WMI_SERVICE_AP_UAPSD); 366 SVCSTR(WMI_SERVICE_AP_DFS); 367 SVCSTR(WMI_SERVICE_11AC); 368 SVCSTR(WMI_SERVICE_BLOCKACK); 369 SVCSTR(WMI_SERVICE_PHYERR); 370 SVCSTR(WMI_SERVICE_BCN_FILTER); 371 SVCSTR(WMI_SERVICE_RTT); 372 SVCSTR(WMI_SERVICE_RATECTRL); 373 SVCSTR(WMI_SERVICE_WOW); 374 SVCSTR(WMI_SERVICE_RATECTRL_CACHE); 375 SVCSTR(WMI_SERVICE_IRAM_TIDS); 376 SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD); 377 SVCSTR(WMI_SERVICE_NLO); 378 SVCSTR(WMI_SERVICE_GTK_OFFLOAD); 379 SVCSTR(WMI_SERVICE_SCAN_SCH); 380 SVCSTR(WMI_SERVICE_CSA_OFFLOAD); 381 SVCSTR(WMI_SERVICE_CHATTER); 382 SVCSTR(WMI_SERVICE_COEX_FREQAVOID); 383 SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE); 384 SVCSTR(WMI_SERVICE_FORCE_FW_HANG); 385 SVCSTR(WMI_SERVICE_GPIO); 386 SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM); 387 SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG); 388 SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG); 389 SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE); 390 SVCSTR(WMI_SERVICE_TX_ENCAP); 391 SVCSTR(WMI_SERVICE_BURST); 392 SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT); 393 SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT); 394 SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD); 395 SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC); 396 SVCSTR(WMI_SERVICE_EARLY_RX); 397 SVCSTR(WMI_SERVICE_STA_SMPS); 398 SVCSTR(WMI_SERVICE_FWTEST); 399 SVCSTR(WMI_SERVICE_STA_WMMAC); 400 SVCSTR(WMI_SERVICE_TDLS); 401 SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE); 402 SVCSTR(WMI_SERVICE_ADAPTIVE_OCS); 403 SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT); 404 SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE); 405 SVCSTR(WMI_SERVICE_WLAN_HB); 406 SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT); 407 SVCSTR(WMI_SERVICE_BATCH_SCAN); 408 SVCSTR(WMI_SERVICE_QPOWER); 409 SVCSTR(WMI_SERVICE_PLMREQ); 410 SVCSTR(WMI_SERVICE_THERMAL_MGMT); 411 SVCSTR(WMI_SERVICE_RMC); 412 SVCSTR(WMI_SERVICE_MHF_OFFLOAD); 413 SVCSTR(WMI_SERVICE_COEX_SAR); 414 SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE); 415 SVCSTR(WMI_SERVICE_NAN); 416 SVCSTR(WMI_SERVICE_L1SS_STAT); 417 SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED); 418 SVCSTR(WMI_SERVICE_OBSS_SCAN); 419 SVCSTR(WMI_SERVICE_TDLS_OFFCHAN); 420 SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA); 421 SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA); 422 SVCSTR(WMI_SERVICE_IBSS_PWRSAVE); 423 SVCSTR(WMI_SERVICE_LPASS); 424 SVCSTR(WMI_SERVICE_EXTSCAN); 425 SVCSTR(WMI_SERVICE_D0WOW); 426 SVCSTR(WMI_SERVICE_HSOFFLOAD); 427 SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD); 428 SVCSTR(WMI_SERVICE_RX_FULL_REORDER); 429 SVCSTR(WMI_SERVICE_DHCP_OFFLOAD); 430 SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT); 431 SVCSTR(WMI_SERVICE_MDNS_OFFLOAD); 432 SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD); 433 SVCSTR(WMI_SERVICE_ATF); 434 SVCSTR(WMI_SERVICE_COEX_GPIO); 435 SVCSTR(WMI_SERVICE_ENHANCED_PROXY_STA); 436 SVCSTR(WMI_SERVICE_TT); 437 SVCSTR(WMI_SERVICE_PEER_CACHING); 438 SVCSTR(WMI_SERVICE_AUX_SPECTRAL_INTF); 439 SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF); 440 SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64); 441 SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT); 442 SVCSTR(WMI_SERVICE_MESH_11S); 443 SVCSTR(WMI_SERVICE_MESH_NON_11S); 444 SVCSTR(WMI_SERVICE_PEER_STATS); 445 SVCSTR(WMI_SERVICE_RESTRT_CHNL_SUPPORT); 446 SVCSTR(WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT); 447 SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY); 448 SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL); 449 SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC); 450 SVCSTR(WMI_SERVICE_VDEV_RX_FILTER); 451 SVCSTR(WMI_SERVICE_CHECK_CAL_VERSION); 452 SVCSTR(WMI_SERVICE_DBGLOG_WARN2); 453 SVCSTR(WMI_SERVICE_BTCOEX_DUTY_CYCLE); 454 SVCSTR(WMI_SERVICE_4_WIRE_COEX_SUPPORT); 455 SVCSTR(WMI_SERVICE_EXTENDED_NSS_SUPPORT); 456 SVCSTR(WMI_SERVICE_PROG_GPIO_BAND_SELECT); 457 SVCSTR(WMI_SERVICE_SMART_LOGGING_SUPPORT); 458 SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE); 459 SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY); 460 SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH); 461 SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS); 462 SVCSTR(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT); 463 SVCSTR(WMI_SERVICE_TPC_STATS_FINAL); 464 default: 465 return NULL; 466 } 467 468 #undef SVCSTR 469 } 470 471 #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \ 472 ((svc_id) < (len) && \ 473 __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \ 474 BIT((svc_id) % (sizeof(u32)))) 475 476 /* This extension is required to accommodate new services, current limit 477 * for wmi_services is 64 as target is using only 4-bits of each 32-bit 478 * wmi_service word. Extending this to make use of remaining unused bits 479 * for new services. 480 */ 481 #define WMI_EXT_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \ 482 ((svc_id) >= (len) && \ 483 __le32_to_cpu((wmi_svc_bmap)[((svc_id) - (len)) / 28]) & \ 484 BIT(((((svc_id) - (len)) % 28) & 0x1f) + 4)) 485 486 #define SVCMAP(x, y, len) \ 487 do { \ 488 if ((WMI_SERVICE_IS_ENABLED((in), (x), (len))) || \ 489 (WMI_EXT_SERVICE_IS_ENABLED((in), (x), (len)))) \ 490 __set_bit(y, out); \ 491 } while (0) 492 493 static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out, 494 size_t len) 495 { 496 SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD, 497 WMI_SERVICE_BEACON_OFFLOAD, len); 498 SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD, 499 WMI_SERVICE_SCAN_OFFLOAD, len); 500 SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD, 501 WMI_SERVICE_ROAM_OFFLOAD, len); 502 SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD, 503 WMI_SERVICE_BCN_MISS_OFFLOAD, len); 504 SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE, 505 WMI_SERVICE_STA_PWRSAVE, len); 506 SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE, 507 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len); 508 SVCMAP(WMI_10X_SERVICE_AP_UAPSD, 509 WMI_SERVICE_AP_UAPSD, len); 510 SVCMAP(WMI_10X_SERVICE_AP_DFS, 511 WMI_SERVICE_AP_DFS, len); 512 SVCMAP(WMI_10X_SERVICE_11AC, 513 WMI_SERVICE_11AC, len); 514 SVCMAP(WMI_10X_SERVICE_BLOCKACK, 515 WMI_SERVICE_BLOCKACK, len); 516 SVCMAP(WMI_10X_SERVICE_PHYERR, 517 WMI_SERVICE_PHYERR, len); 518 SVCMAP(WMI_10X_SERVICE_BCN_FILTER, 519 WMI_SERVICE_BCN_FILTER, len); 520 SVCMAP(WMI_10X_SERVICE_RTT, 521 WMI_SERVICE_RTT, len); 522 SVCMAP(WMI_10X_SERVICE_RATECTRL, 523 WMI_SERVICE_RATECTRL, len); 524 SVCMAP(WMI_10X_SERVICE_WOW, 525 WMI_SERVICE_WOW, len); 526 SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE, 527 WMI_SERVICE_RATECTRL_CACHE, len); 528 SVCMAP(WMI_10X_SERVICE_IRAM_TIDS, 529 WMI_SERVICE_IRAM_TIDS, len); 530 SVCMAP(WMI_10X_SERVICE_BURST, 531 WMI_SERVICE_BURST, len); 532 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT, 533 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len); 534 SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG, 535 WMI_SERVICE_FORCE_FW_HANG, len); 536 SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT, 537 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len); 538 SVCMAP(WMI_10X_SERVICE_ATF, 539 WMI_SERVICE_ATF, len); 540 SVCMAP(WMI_10X_SERVICE_COEX_GPIO, 541 WMI_SERVICE_COEX_GPIO, len); 542 SVCMAP(WMI_10X_SERVICE_AUX_SPECTRAL_INTF, 543 WMI_SERVICE_AUX_SPECTRAL_INTF, len); 544 SVCMAP(WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF, 545 WMI_SERVICE_AUX_CHAN_LOAD_INTF, len); 546 SVCMAP(WMI_10X_SERVICE_BSS_CHANNEL_INFO_64, 547 WMI_SERVICE_BSS_CHANNEL_INFO_64, len); 548 SVCMAP(WMI_10X_SERVICE_MESH, 549 WMI_SERVICE_MESH_11S, len); 550 SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT, 551 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len); 552 SVCMAP(WMI_10X_SERVICE_PEER_STATS, 553 WMI_SERVICE_PEER_STATS, len); 554 SVCMAP(WMI_10X_SERVICE_RESET_CHIP, 555 WMI_SERVICE_RESET_CHIP, len); 556 SVCMAP(WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, 557 WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len); 558 } 559 560 static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out, 561 size_t len) 562 { 563 SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD, 564 WMI_SERVICE_BEACON_OFFLOAD, len); 565 SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD, 566 WMI_SERVICE_SCAN_OFFLOAD, len); 567 SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD, 568 WMI_SERVICE_ROAM_OFFLOAD, len); 569 SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD, 570 WMI_SERVICE_BCN_MISS_OFFLOAD, len); 571 SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE, 572 WMI_SERVICE_STA_PWRSAVE, len); 573 SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE, 574 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len); 575 SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD, 576 WMI_SERVICE_AP_UAPSD, len); 577 SVCMAP(WMI_MAIN_SERVICE_AP_DFS, 578 WMI_SERVICE_AP_DFS, len); 579 SVCMAP(WMI_MAIN_SERVICE_11AC, 580 WMI_SERVICE_11AC, len); 581 SVCMAP(WMI_MAIN_SERVICE_BLOCKACK, 582 WMI_SERVICE_BLOCKACK, len); 583 SVCMAP(WMI_MAIN_SERVICE_PHYERR, 584 WMI_SERVICE_PHYERR, len); 585 SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER, 586 WMI_SERVICE_BCN_FILTER, len); 587 SVCMAP(WMI_MAIN_SERVICE_RTT, 588 WMI_SERVICE_RTT, len); 589 SVCMAP(WMI_MAIN_SERVICE_RATECTRL, 590 WMI_SERVICE_RATECTRL, len); 591 SVCMAP(WMI_MAIN_SERVICE_WOW, 592 WMI_SERVICE_WOW, len); 593 SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE, 594 WMI_SERVICE_RATECTRL_CACHE, len); 595 SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS, 596 WMI_SERVICE_IRAM_TIDS, len); 597 SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD, 598 WMI_SERVICE_ARPNS_OFFLOAD, len); 599 SVCMAP(WMI_MAIN_SERVICE_NLO, 600 WMI_SERVICE_NLO, len); 601 SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD, 602 WMI_SERVICE_GTK_OFFLOAD, len); 603 SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH, 604 WMI_SERVICE_SCAN_SCH, len); 605 SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD, 606 WMI_SERVICE_CSA_OFFLOAD, len); 607 SVCMAP(WMI_MAIN_SERVICE_CHATTER, 608 WMI_SERVICE_CHATTER, len); 609 SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID, 610 WMI_SERVICE_COEX_FREQAVOID, len); 611 SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE, 612 WMI_SERVICE_PACKET_POWER_SAVE, len); 613 SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG, 614 WMI_SERVICE_FORCE_FW_HANG, len); 615 SVCMAP(WMI_MAIN_SERVICE_GPIO, 616 WMI_SERVICE_GPIO, len); 617 SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM, 618 WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len); 619 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, 620 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len); 621 SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, 622 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len); 623 SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE, 624 WMI_SERVICE_STA_KEEP_ALIVE, len); 625 SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP, 626 WMI_SERVICE_TX_ENCAP, len); 627 } 628 629 static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out, 630 size_t len) 631 { 632 SVCMAP(WMI_10_4_SERVICE_BEACON_OFFLOAD, 633 WMI_SERVICE_BEACON_OFFLOAD, len); 634 SVCMAP(WMI_10_4_SERVICE_SCAN_OFFLOAD, 635 WMI_SERVICE_SCAN_OFFLOAD, len); 636 SVCMAP(WMI_10_4_SERVICE_ROAM_OFFLOAD, 637 WMI_SERVICE_ROAM_OFFLOAD, len); 638 SVCMAP(WMI_10_4_SERVICE_BCN_MISS_OFFLOAD, 639 WMI_SERVICE_BCN_MISS_OFFLOAD, len); 640 SVCMAP(WMI_10_4_SERVICE_STA_PWRSAVE, 641 WMI_SERVICE_STA_PWRSAVE, len); 642 SVCMAP(WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE, 643 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len); 644 SVCMAP(WMI_10_4_SERVICE_AP_UAPSD, 645 WMI_SERVICE_AP_UAPSD, len); 646 SVCMAP(WMI_10_4_SERVICE_AP_DFS, 647 WMI_SERVICE_AP_DFS, len); 648 SVCMAP(WMI_10_4_SERVICE_11AC, 649 WMI_SERVICE_11AC, len); 650 SVCMAP(WMI_10_4_SERVICE_BLOCKACK, 651 WMI_SERVICE_BLOCKACK, len); 652 SVCMAP(WMI_10_4_SERVICE_PHYERR, 653 WMI_SERVICE_PHYERR, len); 654 SVCMAP(WMI_10_4_SERVICE_BCN_FILTER, 655 WMI_SERVICE_BCN_FILTER, len); 656 SVCMAP(WMI_10_4_SERVICE_RTT, 657 WMI_SERVICE_RTT, len); 658 SVCMAP(WMI_10_4_SERVICE_RATECTRL, 659 WMI_SERVICE_RATECTRL, len); 660 SVCMAP(WMI_10_4_SERVICE_WOW, 661 WMI_SERVICE_WOW, len); 662 SVCMAP(WMI_10_4_SERVICE_RATECTRL_CACHE, 663 WMI_SERVICE_RATECTRL_CACHE, len); 664 SVCMAP(WMI_10_4_SERVICE_IRAM_TIDS, 665 WMI_SERVICE_IRAM_TIDS, len); 666 SVCMAP(WMI_10_4_SERVICE_BURST, 667 WMI_SERVICE_BURST, len); 668 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT, 669 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len); 670 SVCMAP(WMI_10_4_SERVICE_GTK_OFFLOAD, 671 WMI_SERVICE_GTK_OFFLOAD, len); 672 SVCMAP(WMI_10_4_SERVICE_SCAN_SCH, 673 WMI_SERVICE_SCAN_SCH, len); 674 SVCMAP(WMI_10_4_SERVICE_CSA_OFFLOAD, 675 WMI_SERVICE_CSA_OFFLOAD, len); 676 SVCMAP(WMI_10_4_SERVICE_CHATTER, 677 WMI_SERVICE_CHATTER, len); 678 SVCMAP(WMI_10_4_SERVICE_COEX_FREQAVOID, 679 WMI_SERVICE_COEX_FREQAVOID, len); 680 SVCMAP(WMI_10_4_SERVICE_PACKET_POWER_SAVE, 681 WMI_SERVICE_PACKET_POWER_SAVE, len); 682 SVCMAP(WMI_10_4_SERVICE_FORCE_FW_HANG, 683 WMI_SERVICE_FORCE_FW_HANG, len); 684 SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT, 685 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len); 686 SVCMAP(WMI_10_4_SERVICE_GPIO, 687 WMI_SERVICE_GPIO, len); 688 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, 689 WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len); 690 SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, 691 WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len); 692 SVCMAP(WMI_10_4_SERVICE_STA_KEEP_ALIVE, 693 WMI_SERVICE_STA_KEEP_ALIVE, len); 694 SVCMAP(WMI_10_4_SERVICE_TX_ENCAP, 695 WMI_SERVICE_TX_ENCAP, len); 696 SVCMAP(WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, 697 WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, len); 698 SVCMAP(WMI_10_4_SERVICE_EARLY_RX, 699 WMI_SERVICE_EARLY_RX, len); 700 SVCMAP(WMI_10_4_SERVICE_ENHANCED_PROXY_STA, 701 WMI_SERVICE_ENHANCED_PROXY_STA, len); 702 SVCMAP(WMI_10_4_SERVICE_TT, 703 WMI_SERVICE_TT, len); 704 SVCMAP(WMI_10_4_SERVICE_ATF, 705 WMI_SERVICE_ATF, len); 706 SVCMAP(WMI_10_4_SERVICE_PEER_CACHING, 707 WMI_SERVICE_PEER_CACHING, len); 708 SVCMAP(WMI_10_4_SERVICE_COEX_GPIO, 709 WMI_SERVICE_COEX_GPIO, len); 710 SVCMAP(WMI_10_4_SERVICE_AUX_SPECTRAL_INTF, 711 WMI_SERVICE_AUX_SPECTRAL_INTF, len); 712 SVCMAP(WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF, 713 WMI_SERVICE_AUX_CHAN_LOAD_INTF, len); 714 SVCMAP(WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64, 715 WMI_SERVICE_BSS_CHANNEL_INFO_64, len); 716 SVCMAP(WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT, 717 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len); 718 SVCMAP(WMI_10_4_SERVICE_MESH_NON_11S, 719 WMI_SERVICE_MESH_NON_11S, len); 720 SVCMAP(WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT, 721 WMI_SERVICE_RESTRT_CHNL_SUPPORT, len); 722 SVCMAP(WMI_10_4_SERVICE_PEER_STATS, 723 WMI_SERVICE_PEER_STATS, len); 724 SVCMAP(WMI_10_4_SERVICE_MESH_11S, 725 WMI_SERVICE_MESH_11S, len); 726 SVCMAP(WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, 727 WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, len); 728 SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY, 729 WMI_SERVICE_TX_MODE_PUSH_ONLY, len); 730 SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_PULL, 731 WMI_SERVICE_TX_MODE_PUSH_PULL, len); 732 SVCMAP(WMI_10_4_SERVICE_TX_MODE_DYNAMIC, 733 WMI_SERVICE_TX_MODE_DYNAMIC, len); 734 SVCMAP(WMI_10_4_SERVICE_VDEV_RX_FILTER, 735 WMI_SERVICE_VDEV_RX_FILTER, len); 736 SVCMAP(WMI_10_4_SERVICE_BTCOEX, 737 WMI_SERVICE_BTCOEX, len); 738 SVCMAP(WMI_10_4_SERVICE_CHECK_CAL_VERSION, 739 WMI_SERVICE_CHECK_CAL_VERSION, len); 740 SVCMAP(WMI_10_4_SERVICE_DBGLOG_WARN2, 741 WMI_SERVICE_DBGLOG_WARN2, len); 742 SVCMAP(WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE, 743 WMI_SERVICE_BTCOEX_DUTY_CYCLE, len); 744 SVCMAP(WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT, 745 WMI_SERVICE_4_WIRE_COEX_SUPPORT, len); 746 SVCMAP(WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT, 747 WMI_SERVICE_EXTENDED_NSS_SUPPORT, len); 748 SVCMAP(WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT, 749 WMI_SERVICE_PROG_GPIO_BAND_SELECT, len); 750 SVCMAP(WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT, 751 WMI_SERVICE_SMART_LOGGING_SUPPORT, len); 752 SVCMAP(WMI_10_4_SERVICE_TDLS, 753 WMI_SERVICE_TDLS, len); 754 SVCMAP(WMI_10_4_SERVICE_TDLS_OFFCHAN, 755 WMI_SERVICE_TDLS_OFFCHAN, len); 756 SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA, 757 WMI_SERVICE_TDLS_UAPSD_BUFFER_STA, len); 758 SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA, 759 WMI_SERVICE_TDLS_UAPSD_SLEEP_STA, len); 760 SVCMAP(WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, 761 WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, len); 762 SVCMAP(WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY, 763 WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len); 764 SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH, 765 WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len); 766 SVCMAP(WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, 767 WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len); 768 SVCMAP(WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT, 769 WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, len); 770 SVCMAP(WMI_10_4_SERVICE_TPC_STATS_FINAL, 771 WMI_SERVICE_TPC_STATS_FINAL, len); 772 } 773 774 #undef SVCMAP 775 776 /* 2 word representation of MAC addr */ 777 struct wmi_mac_addr { 778 union { 779 u8 addr[6]; 780 struct { 781 u32 word0; 782 u32 word1; 783 } __packed; 784 } __packed; 785 } __packed; 786 787 struct wmi_cmd_map { 788 u32 init_cmdid; 789 u32 start_scan_cmdid; 790 u32 stop_scan_cmdid; 791 u32 scan_chan_list_cmdid; 792 u32 scan_sch_prio_tbl_cmdid; 793 u32 pdev_set_regdomain_cmdid; 794 u32 pdev_set_channel_cmdid; 795 u32 pdev_set_param_cmdid; 796 u32 pdev_pktlog_enable_cmdid; 797 u32 pdev_pktlog_disable_cmdid; 798 u32 pdev_set_wmm_params_cmdid; 799 u32 pdev_set_ht_cap_ie_cmdid; 800 u32 pdev_set_vht_cap_ie_cmdid; 801 u32 pdev_set_dscp_tid_map_cmdid; 802 u32 pdev_set_quiet_mode_cmdid; 803 u32 pdev_green_ap_ps_enable_cmdid; 804 u32 pdev_get_tpc_config_cmdid; 805 u32 pdev_set_base_macaddr_cmdid; 806 u32 vdev_create_cmdid; 807 u32 vdev_delete_cmdid; 808 u32 vdev_start_request_cmdid; 809 u32 vdev_restart_request_cmdid; 810 u32 vdev_up_cmdid; 811 u32 vdev_stop_cmdid; 812 u32 vdev_down_cmdid; 813 u32 vdev_set_param_cmdid; 814 u32 vdev_install_key_cmdid; 815 u32 peer_create_cmdid; 816 u32 peer_delete_cmdid; 817 u32 peer_flush_tids_cmdid; 818 u32 peer_set_param_cmdid; 819 u32 peer_assoc_cmdid; 820 u32 peer_add_wds_entry_cmdid; 821 u32 peer_remove_wds_entry_cmdid; 822 u32 peer_mcast_group_cmdid; 823 u32 bcn_tx_cmdid; 824 u32 pdev_send_bcn_cmdid; 825 u32 bcn_tmpl_cmdid; 826 u32 bcn_filter_rx_cmdid; 827 u32 prb_req_filter_rx_cmdid; 828 u32 mgmt_tx_cmdid; 829 u32 mgmt_tx_send_cmdid; 830 u32 prb_tmpl_cmdid; 831 u32 addba_clear_resp_cmdid; 832 u32 addba_send_cmdid; 833 u32 addba_status_cmdid; 834 u32 delba_send_cmdid; 835 u32 addba_set_resp_cmdid; 836 u32 send_singleamsdu_cmdid; 837 u32 sta_powersave_mode_cmdid; 838 u32 sta_powersave_param_cmdid; 839 u32 sta_mimo_ps_mode_cmdid; 840 u32 pdev_dfs_enable_cmdid; 841 u32 pdev_dfs_disable_cmdid; 842 u32 roam_scan_mode; 843 u32 roam_scan_rssi_threshold; 844 u32 roam_scan_period; 845 u32 roam_scan_rssi_change_threshold; 846 u32 roam_ap_profile; 847 u32 ofl_scan_add_ap_profile; 848 u32 ofl_scan_remove_ap_profile; 849 u32 ofl_scan_period; 850 u32 p2p_dev_set_device_info; 851 u32 p2p_dev_set_discoverability; 852 u32 p2p_go_set_beacon_ie; 853 u32 p2p_go_set_probe_resp_ie; 854 u32 p2p_set_vendor_ie_data_cmdid; 855 u32 ap_ps_peer_param_cmdid; 856 u32 ap_ps_peer_uapsd_coex_cmdid; 857 u32 peer_rate_retry_sched_cmdid; 858 u32 wlan_profile_trigger_cmdid; 859 u32 wlan_profile_set_hist_intvl_cmdid; 860 u32 wlan_profile_get_profile_data_cmdid; 861 u32 wlan_profile_enable_profile_id_cmdid; 862 u32 wlan_profile_list_profile_id_cmdid; 863 u32 pdev_suspend_cmdid; 864 u32 pdev_resume_cmdid; 865 u32 add_bcn_filter_cmdid; 866 u32 rmv_bcn_filter_cmdid; 867 u32 wow_add_wake_pattern_cmdid; 868 u32 wow_del_wake_pattern_cmdid; 869 u32 wow_enable_disable_wake_event_cmdid; 870 u32 wow_enable_cmdid; 871 u32 wow_hostwakeup_from_sleep_cmdid; 872 u32 rtt_measreq_cmdid; 873 u32 rtt_tsf_cmdid; 874 u32 vdev_spectral_scan_configure_cmdid; 875 u32 vdev_spectral_scan_enable_cmdid; 876 u32 request_stats_cmdid; 877 u32 set_arp_ns_offload_cmdid; 878 u32 network_list_offload_config_cmdid; 879 u32 gtk_offload_cmdid; 880 u32 csa_offload_enable_cmdid; 881 u32 csa_offload_chanswitch_cmdid; 882 u32 chatter_set_mode_cmdid; 883 u32 peer_tid_addba_cmdid; 884 u32 peer_tid_delba_cmdid; 885 u32 sta_dtim_ps_method_cmdid; 886 u32 sta_uapsd_auto_trig_cmdid; 887 u32 sta_keepalive_cmd; 888 u32 echo_cmdid; 889 u32 pdev_utf_cmdid; 890 u32 dbglog_cfg_cmdid; 891 u32 pdev_qvit_cmdid; 892 u32 pdev_ftm_intg_cmdid; 893 u32 vdev_set_keepalive_cmdid; 894 u32 vdev_get_keepalive_cmdid; 895 u32 force_fw_hang_cmdid; 896 u32 gpio_config_cmdid; 897 u32 gpio_output_cmdid; 898 u32 pdev_get_temperature_cmdid; 899 u32 vdev_set_wmm_params_cmdid; 900 u32 tdls_set_state_cmdid; 901 u32 tdls_peer_update_cmdid; 902 u32 adaptive_qcs_cmdid; 903 u32 scan_update_request_cmdid; 904 u32 vdev_standby_response_cmdid; 905 u32 vdev_resume_response_cmdid; 906 u32 wlan_peer_caching_add_peer_cmdid; 907 u32 wlan_peer_caching_evict_peer_cmdid; 908 u32 wlan_peer_caching_restore_peer_cmdid; 909 u32 wlan_peer_caching_print_all_peers_info_cmdid; 910 u32 peer_update_wds_entry_cmdid; 911 u32 peer_add_proxy_sta_entry_cmdid; 912 u32 rtt_keepalive_cmdid; 913 u32 oem_req_cmdid; 914 u32 nan_cmdid; 915 u32 vdev_ratemask_cmdid; 916 u32 qboost_cfg_cmdid; 917 u32 pdev_smart_ant_enable_cmdid; 918 u32 pdev_smart_ant_set_rx_antenna_cmdid; 919 u32 peer_smart_ant_set_tx_antenna_cmdid; 920 u32 peer_smart_ant_set_train_info_cmdid; 921 u32 peer_smart_ant_set_node_config_ops_cmdid; 922 u32 pdev_set_antenna_switch_table_cmdid; 923 u32 pdev_set_ctl_table_cmdid; 924 u32 pdev_set_mimogain_table_cmdid; 925 u32 pdev_ratepwr_table_cmdid; 926 u32 pdev_ratepwr_chainmsk_table_cmdid; 927 u32 pdev_fips_cmdid; 928 u32 tt_set_conf_cmdid; 929 u32 fwtest_cmdid; 930 u32 vdev_atf_request_cmdid; 931 u32 peer_atf_request_cmdid; 932 u32 pdev_get_ani_cck_config_cmdid; 933 u32 pdev_get_ani_ofdm_config_cmdid; 934 u32 pdev_reserve_ast_entry_cmdid; 935 u32 pdev_get_nfcal_power_cmdid; 936 u32 pdev_get_tpc_cmdid; 937 u32 pdev_get_ast_info_cmdid; 938 u32 vdev_set_dscp_tid_map_cmdid; 939 u32 pdev_get_info_cmdid; 940 u32 vdev_get_info_cmdid; 941 u32 vdev_filter_neighbor_rx_packets_cmdid; 942 u32 mu_cal_start_cmdid; 943 u32 set_cca_params_cmdid; 944 u32 pdev_bss_chan_info_request_cmdid; 945 u32 pdev_enable_adaptive_cca_cmdid; 946 u32 ext_resource_cfg_cmdid; 947 u32 vdev_set_ie_cmdid; 948 u32 set_lteu_config_cmdid; 949 u32 atf_ssid_grouping_request_cmdid; 950 u32 peer_atf_ext_request_cmdid; 951 u32 set_periodic_channel_stats_cfg_cmdid; 952 u32 peer_bwf_request_cmdid; 953 u32 btcoex_cfg_cmdid; 954 u32 peer_tx_mu_txmit_count_cmdid; 955 u32 peer_tx_mu_txmit_rstcnt_cmdid; 956 u32 peer_gid_userpos_list_cmdid; 957 u32 pdev_check_cal_version_cmdid; 958 u32 coex_version_cfg_cmid; 959 u32 pdev_get_rx_filter_cmdid; 960 u32 pdev_extended_nss_cfg_cmdid; 961 u32 vdev_set_scan_nac_rssi_cmdid; 962 u32 prog_gpio_band_select_cmdid; 963 u32 config_smart_logging_cmdid; 964 u32 debug_fatal_condition_cmdid; 965 u32 get_tsf_timer_cmdid; 966 u32 pdev_get_tpc_table_cmdid; 967 u32 vdev_sifs_trigger_time_cmdid; 968 u32 pdev_wds_entry_list_cmdid; 969 u32 tdls_set_offchan_mode_cmdid; 970 }; 971 972 /* 973 * wmi command groups. 974 */ 975 enum wmi_cmd_group { 976 /* 0 to 2 are reserved */ 977 WMI_GRP_START = 0x3, 978 WMI_GRP_SCAN = WMI_GRP_START, 979 WMI_GRP_PDEV, 980 WMI_GRP_VDEV, 981 WMI_GRP_PEER, 982 WMI_GRP_MGMT, 983 WMI_GRP_BA_NEG, 984 WMI_GRP_STA_PS, 985 WMI_GRP_DFS, 986 WMI_GRP_ROAM, 987 WMI_GRP_OFL_SCAN, 988 WMI_GRP_P2P, 989 WMI_GRP_AP_PS, 990 WMI_GRP_RATE_CTRL, 991 WMI_GRP_PROFILE, 992 WMI_GRP_SUSPEND, 993 WMI_GRP_BCN_FILTER, 994 WMI_GRP_WOW, 995 WMI_GRP_RTT, 996 WMI_GRP_SPECTRAL, 997 WMI_GRP_STATS, 998 WMI_GRP_ARP_NS_OFL, 999 WMI_GRP_NLO_OFL, 1000 WMI_GRP_GTK_OFL, 1001 WMI_GRP_CSA_OFL, 1002 WMI_GRP_CHATTER, 1003 WMI_GRP_TID_ADDBA, 1004 WMI_GRP_MISC, 1005 WMI_GRP_GPIO, 1006 }; 1007 1008 #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1) 1009 #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1) 1010 1011 #define WMI_CMD_UNSUPPORTED 0 1012 1013 /* Command IDs and command events for MAIN FW. */ 1014 enum wmi_cmd_id { 1015 WMI_INIT_CMDID = 0x1, 1016 1017 /* Scan specific commands */ 1018 WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN), 1019 WMI_STOP_SCAN_CMDID, 1020 WMI_SCAN_CHAN_LIST_CMDID, 1021 WMI_SCAN_SCH_PRIO_TBL_CMDID, 1022 1023 /* PDEV (physical device) specific commands */ 1024 WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV), 1025 WMI_PDEV_SET_CHANNEL_CMDID, 1026 WMI_PDEV_SET_PARAM_CMDID, 1027 WMI_PDEV_PKTLOG_ENABLE_CMDID, 1028 WMI_PDEV_PKTLOG_DISABLE_CMDID, 1029 WMI_PDEV_SET_WMM_PARAMS_CMDID, 1030 WMI_PDEV_SET_HT_CAP_IE_CMDID, 1031 WMI_PDEV_SET_VHT_CAP_IE_CMDID, 1032 WMI_PDEV_SET_DSCP_TID_MAP_CMDID, 1033 WMI_PDEV_SET_QUIET_MODE_CMDID, 1034 WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID, 1035 WMI_PDEV_GET_TPC_CONFIG_CMDID, 1036 WMI_PDEV_SET_BASE_MACADDR_CMDID, 1037 1038 /* VDEV (virtual device) specific commands */ 1039 WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV), 1040 WMI_VDEV_DELETE_CMDID, 1041 WMI_VDEV_START_REQUEST_CMDID, 1042 WMI_VDEV_RESTART_REQUEST_CMDID, 1043 WMI_VDEV_UP_CMDID, 1044 WMI_VDEV_STOP_CMDID, 1045 WMI_VDEV_DOWN_CMDID, 1046 WMI_VDEV_SET_PARAM_CMDID, 1047 WMI_VDEV_INSTALL_KEY_CMDID, 1048 1049 /* peer specific commands */ 1050 WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER), 1051 WMI_PEER_DELETE_CMDID, 1052 WMI_PEER_FLUSH_TIDS_CMDID, 1053 WMI_PEER_SET_PARAM_CMDID, 1054 WMI_PEER_ASSOC_CMDID, 1055 WMI_PEER_ADD_WDS_ENTRY_CMDID, 1056 WMI_PEER_REMOVE_WDS_ENTRY_CMDID, 1057 WMI_PEER_MCAST_GROUP_CMDID, 1058 1059 /* beacon/management specific commands */ 1060 WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT), 1061 WMI_PDEV_SEND_BCN_CMDID, 1062 WMI_BCN_TMPL_CMDID, 1063 WMI_BCN_FILTER_RX_CMDID, 1064 WMI_PRB_REQ_FILTER_RX_CMDID, 1065 WMI_MGMT_TX_CMDID, 1066 WMI_PRB_TMPL_CMDID, 1067 1068 /* commands to directly control BA negotiation directly from host. */ 1069 WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG), 1070 WMI_ADDBA_SEND_CMDID, 1071 WMI_ADDBA_STATUS_CMDID, 1072 WMI_DELBA_SEND_CMDID, 1073 WMI_ADDBA_SET_RESP_CMDID, 1074 WMI_SEND_SINGLEAMSDU_CMDID, 1075 1076 /* Station power save specific config */ 1077 WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS), 1078 WMI_STA_POWERSAVE_PARAM_CMDID, 1079 WMI_STA_MIMO_PS_MODE_CMDID, 1080 1081 /** DFS-specific commands */ 1082 WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS), 1083 WMI_PDEV_DFS_DISABLE_CMDID, 1084 1085 /* Roaming specific commands */ 1086 WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM), 1087 WMI_ROAM_SCAN_RSSI_THRESHOLD, 1088 WMI_ROAM_SCAN_PERIOD, 1089 WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD, 1090 WMI_ROAM_AP_PROFILE, 1091 1092 /* offload scan specific commands */ 1093 WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN), 1094 WMI_OFL_SCAN_REMOVE_AP_PROFILE, 1095 WMI_OFL_SCAN_PERIOD, 1096 1097 /* P2P specific commands */ 1098 WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P), 1099 WMI_P2P_DEV_SET_DISCOVERABILITY, 1100 WMI_P2P_GO_SET_BEACON_IE, 1101 WMI_P2P_GO_SET_PROBE_RESP_IE, 1102 WMI_P2P_SET_VENDOR_IE_DATA_CMDID, 1103 1104 /* AP power save specific config */ 1105 WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS), 1106 WMI_AP_PS_PEER_UAPSD_COEX_CMDID, 1107 1108 /* Rate-control specific commands */ 1109 WMI_PEER_RATE_RETRY_SCHED_CMDID = 1110 WMI_CMD_GRP(WMI_GRP_RATE_CTRL), 1111 1112 /* WLAN Profiling commands. */ 1113 WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE), 1114 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, 1115 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, 1116 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, 1117 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID, 1118 1119 /* Suspend resume command Ids */ 1120 WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND), 1121 WMI_PDEV_RESUME_CMDID, 1122 1123 /* Beacon filter commands */ 1124 WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER), 1125 WMI_RMV_BCN_FILTER_CMDID, 1126 1127 /* WOW Specific WMI commands*/ 1128 WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW), 1129 WMI_WOW_DEL_WAKE_PATTERN_CMDID, 1130 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID, 1131 WMI_WOW_ENABLE_CMDID, 1132 WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, 1133 1134 /* RTT measurement related cmd */ 1135 WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT), 1136 WMI_RTT_TSF_CMDID, 1137 1138 /* spectral scan commands */ 1139 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL), 1140 WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID, 1141 1142 /* F/W stats */ 1143 WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS), 1144 1145 /* ARP OFFLOAD REQUEST*/ 1146 WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL), 1147 1148 /* NS offload confid*/ 1149 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL), 1150 1151 /* GTK offload Specific WMI commands*/ 1152 WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL), 1153 1154 /* CSA offload Specific WMI commands*/ 1155 WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL), 1156 WMI_CSA_OFFLOAD_CHANSWITCH_CMDID, 1157 1158 /* Chatter commands*/ 1159 WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER), 1160 1161 /* addba specific commands */ 1162 WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA), 1163 WMI_PEER_TID_DELBA_CMDID, 1164 1165 /* set station mimo powersave method */ 1166 WMI_STA_DTIM_PS_METHOD_CMDID, 1167 /* Configure the Station UAPSD AC Auto Trigger Parameters */ 1168 WMI_STA_UAPSD_AUTO_TRIG_CMDID, 1169 1170 /* STA Keep alive parameter configuration, 1171 * Requires WMI_SERVICE_STA_KEEP_ALIVE 1172 */ 1173 WMI_STA_KEEPALIVE_CMD, 1174 1175 /* misc command group */ 1176 WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC), 1177 WMI_PDEV_UTF_CMDID, 1178 WMI_DBGLOG_CFG_CMDID, 1179 WMI_PDEV_QVIT_CMDID, 1180 WMI_PDEV_FTM_INTG_CMDID, 1181 WMI_VDEV_SET_KEEPALIVE_CMDID, 1182 WMI_VDEV_GET_KEEPALIVE_CMDID, 1183 WMI_FORCE_FW_HANG_CMDID, 1184 1185 /* GPIO Configuration */ 1186 WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO), 1187 WMI_GPIO_OUTPUT_CMDID, 1188 }; 1189 1190 enum wmi_event_id { 1191 WMI_SERVICE_READY_EVENTID = 0x1, 1192 WMI_READY_EVENTID, 1193 1194 /* Scan specific events */ 1195 WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN), 1196 1197 /* PDEV specific events */ 1198 WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV), 1199 WMI_CHAN_INFO_EVENTID, 1200 WMI_PHYERR_EVENTID, 1201 1202 /* VDEV specific events */ 1203 WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV), 1204 WMI_VDEV_STOPPED_EVENTID, 1205 WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID, 1206 1207 /* peer specific events */ 1208 WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER), 1209 1210 /* beacon/mgmt specific events */ 1211 WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT), 1212 WMI_HOST_SWBA_EVENTID, 1213 WMI_TBTTOFFSET_UPDATE_EVENTID, 1214 1215 /* ADDBA Related WMI Events*/ 1216 WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG), 1217 WMI_TX_ADDBA_COMPLETE_EVENTID, 1218 1219 /* Roam event to trigger roaming on host */ 1220 WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM), 1221 WMI_PROFILE_MATCH, 1222 1223 /* WoW */ 1224 WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW), 1225 1226 /* RTT */ 1227 WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT), 1228 WMI_TSF_MEASUREMENT_REPORT_EVENTID, 1229 WMI_RTT_ERROR_REPORT_EVENTID, 1230 1231 /* GTK offload */ 1232 WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL), 1233 WMI_GTK_REKEY_FAIL_EVENTID, 1234 1235 /* CSA IE received event */ 1236 WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL), 1237 1238 /* Misc events */ 1239 WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC), 1240 WMI_PDEV_UTF_EVENTID, 1241 WMI_DEBUG_MESG_EVENTID, 1242 WMI_UPDATE_STATS_EVENTID, 1243 WMI_DEBUG_PRINT_EVENTID, 1244 WMI_DCS_INTERFERENCE_EVENTID, 1245 WMI_PDEV_QVIT_EVENTID, 1246 WMI_WLAN_PROFILE_DATA_EVENTID, 1247 WMI_PDEV_FTM_INTG_EVENTID, 1248 WMI_WLAN_FREQ_AVOID_EVENTID, 1249 WMI_VDEV_GET_KEEPALIVE_EVENTID, 1250 1251 /* GPIO Event */ 1252 WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO), 1253 }; 1254 1255 /* Command IDs and command events for 10.X firmware */ 1256 enum wmi_10x_cmd_id { 1257 WMI_10X_START_CMDID = 0x9000, 1258 WMI_10X_END_CMDID = 0x9FFF, 1259 1260 /* initialize the wlan sub system */ 1261 WMI_10X_INIT_CMDID, 1262 1263 /* Scan specific commands */ 1264 1265 WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID, 1266 WMI_10X_STOP_SCAN_CMDID, 1267 WMI_10X_SCAN_CHAN_LIST_CMDID, 1268 WMI_10X_ECHO_CMDID, 1269 1270 /* PDEV(physical device) specific commands */ 1271 WMI_10X_PDEV_SET_REGDOMAIN_CMDID, 1272 WMI_10X_PDEV_SET_CHANNEL_CMDID, 1273 WMI_10X_PDEV_SET_PARAM_CMDID, 1274 WMI_10X_PDEV_PKTLOG_ENABLE_CMDID, 1275 WMI_10X_PDEV_PKTLOG_DISABLE_CMDID, 1276 WMI_10X_PDEV_SET_WMM_PARAMS_CMDID, 1277 WMI_10X_PDEV_SET_HT_CAP_IE_CMDID, 1278 WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID, 1279 WMI_10X_PDEV_SET_BASE_MACADDR_CMDID, 1280 WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID, 1281 WMI_10X_PDEV_SET_QUIET_MODE_CMDID, 1282 WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID, 1283 WMI_10X_PDEV_GET_TPC_CONFIG_CMDID, 1284 1285 /* VDEV(virtual device) specific commands */ 1286 WMI_10X_VDEV_CREATE_CMDID, 1287 WMI_10X_VDEV_DELETE_CMDID, 1288 WMI_10X_VDEV_START_REQUEST_CMDID, 1289 WMI_10X_VDEV_RESTART_REQUEST_CMDID, 1290 WMI_10X_VDEV_UP_CMDID, 1291 WMI_10X_VDEV_STOP_CMDID, 1292 WMI_10X_VDEV_DOWN_CMDID, 1293 WMI_10X_VDEV_STANDBY_RESPONSE_CMDID, 1294 WMI_10X_VDEV_RESUME_RESPONSE_CMDID, 1295 WMI_10X_VDEV_SET_PARAM_CMDID, 1296 WMI_10X_VDEV_INSTALL_KEY_CMDID, 1297 1298 /* peer specific commands */ 1299 WMI_10X_PEER_CREATE_CMDID, 1300 WMI_10X_PEER_DELETE_CMDID, 1301 WMI_10X_PEER_FLUSH_TIDS_CMDID, 1302 WMI_10X_PEER_SET_PARAM_CMDID, 1303 WMI_10X_PEER_ASSOC_CMDID, 1304 WMI_10X_PEER_ADD_WDS_ENTRY_CMDID, 1305 WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID, 1306 WMI_10X_PEER_MCAST_GROUP_CMDID, 1307 1308 /* beacon/management specific commands */ 1309 1310 WMI_10X_BCN_TX_CMDID, 1311 WMI_10X_BCN_PRB_TMPL_CMDID, 1312 WMI_10X_BCN_FILTER_RX_CMDID, 1313 WMI_10X_PRB_REQ_FILTER_RX_CMDID, 1314 WMI_10X_MGMT_TX_CMDID, 1315 1316 /* commands to directly control ba negotiation directly from host. */ 1317 WMI_10X_ADDBA_CLEAR_RESP_CMDID, 1318 WMI_10X_ADDBA_SEND_CMDID, 1319 WMI_10X_ADDBA_STATUS_CMDID, 1320 WMI_10X_DELBA_SEND_CMDID, 1321 WMI_10X_ADDBA_SET_RESP_CMDID, 1322 WMI_10X_SEND_SINGLEAMSDU_CMDID, 1323 1324 /* Station power save specific config */ 1325 WMI_10X_STA_POWERSAVE_MODE_CMDID, 1326 WMI_10X_STA_POWERSAVE_PARAM_CMDID, 1327 WMI_10X_STA_MIMO_PS_MODE_CMDID, 1328 1329 /* set debug log config */ 1330 WMI_10X_DBGLOG_CFG_CMDID, 1331 1332 /* DFS-specific commands */ 1333 WMI_10X_PDEV_DFS_ENABLE_CMDID, 1334 WMI_10X_PDEV_DFS_DISABLE_CMDID, 1335 1336 /* QVIT specific command id */ 1337 WMI_10X_PDEV_QVIT_CMDID, 1338 1339 /* Offload Scan and Roaming related commands */ 1340 WMI_10X_ROAM_SCAN_MODE, 1341 WMI_10X_ROAM_SCAN_RSSI_THRESHOLD, 1342 WMI_10X_ROAM_SCAN_PERIOD, 1343 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD, 1344 WMI_10X_ROAM_AP_PROFILE, 1345 WMI_10X_OFL_SCAN_ADD_AP_PROFILE, 1346 WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE, 1347 WMI_10X_OFL_SCAN_PERIOD, 1348 1349 /* P2P specific commands */ 1350 WMI_10X_P2P_DEV_SET_DEVICE_INFO, 1351 WMI_10X_P2P_DEV_SET_DISCOVERABILITY, 1352 WMI_10X_P2P_GO_SET_BEACON_IE, 1353 WMI_10X_P2P_GO_SET_PROBE_RESP_IE, 1354 1355 /* AP power save specific config */ 1356 WMI_10X_AP_PS_PEER_PARAM_CMDID, 1357 WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID, 1358 1359 /* Rate-control specific commands */ 1360 WMI_10X_PEER_RATE_RETRY_SCHED_CMDID, 1361 1362 /* WLAN Profiling commands. */ 1363 WMI_10X_WLAN_PROFILE_TRIGGER_CMDID, 1364 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID, 1365 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, 1366 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, 1367 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID, 1368 1369 /* Suspend resume command Ids */ 1370 WMI_10X_PDEV_SUSPEND_CMDID, 1371 WMI_10X_PDEV_RESUME_CMDID, 1372 1373 /* Beacon filter commands */ 1374 WMI_10X_ADD_BCN_FILTER_CMDID, 1375 WMI_10X_RMV_BCN_FILTER_CMDID, 1376 1377 /* WOW Specific WMI commands*/ 1378 WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID, 1379 WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID, 1380 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID, 1381 WMI_10X_WOW_ENABLE_CMDID, 1382 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, 1383 1384 /* RTT measurement related cmd */ 1385 WMI_10X_RTT_MEASREQ_CMDID, 1386 WMI_10X_RTT_TSF_CMDID, 1387 1388 /* transmit beacon by value */ 1389 WMI_10X_PDEV_SEND_BCN_CMDID, 1390 1391 /* F/W stats */ 1392 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID, 1393 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID, 1394 WMI_10X_REQUEST_STATS_CMDID, 1395 1396 /* GPIO Configuration */ 1397 WMI_10X_GPIO_CONFIG_CMDID, 1398 WMI_10X_GPIO_OUTPUT_CMDID, 1399 1400 WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1, 1401 }; 1402 1403 enum wmi_10x_event_id { 1404 WMI_10X_SERVICE_READY_EVENTID = 0x8000, 1405 WMI_10X_READY_EVENTID, 1406 WMI_10X_START_EVENTID = 0x9000, 1407 WMI_10X_END_EVENTID = 0x9FFF, 1408 1409 /* Scan specific events */ 1410 WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID, 1411 WMI_10X_ECHO_EVENTID, 1412 WMI_10X_DEBUG_MESG_EVENTID, 1413 WMI_10X_UPDATE_STATS_EVENTID, 1414 1415 /* Instantaneous RSSI event */ 1416 WMI_10X_INST_RSSI_STATS_EVENTID, 1417 1418 /* VDEV specific events */ 1419 WMI_10X_VDEV_START_RESP_EVENTID, 1420 WMI_10X_VDEV_STANDBY_REQ_EVENTID, 1421 WMI_10X_VDEV_RESUME_REQ_EVENTID, 1422 WMI_10X_VDEV_STOPPED_EVENTID, 1423 1424 /* peer specific events */ 1425 WMI_10X_PEER_STA_KICKOUT_EVENTID, 1426 1427 /* beacon/mgmt specific events */ 1428 WMI_10X_HOST_SWBA_EVENTID, 1429 WMI_10X_TBTTOFFSET_UPDATE_EVENTID, 1430 WMI_10X_MGMT_RX_EVENTID, 1431 1432 /* Channel stats event */ 1433 WMI_10X_CHAN_INFO_EVENTID, 1434 1435 /* PHY Error specific WMI event */ 1436 WMI_10X_PHYERR_EVENTID, 1437 1438 /* Roam event to trigger roaming on host */ 1439 WMI_10X_ROAM_EVENTID, 1440 1441 /* matching AP found from list of profiles */ 1442 WMI_10X_PROFILE_MATCH, 1443 1444 /* debug print message used for tracing FW code while debugging */ 1445 WMI_10X_DEBUG_PRINT_EVENTID, 1446 /* VI spoecific event */ 1447 WMI_10X_PDEV_QVIT_EVENTID, 1448 /* FW code profile data in response to profile request */ 1449 WMI_10X_WLAN_PROFILE_DATA_EVENTID, 1450 1451 /*RTT related event ID*/ 1452 WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID, 1453 WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID, 1454 WMI_10X_RTT_ERROR_REPORT_EVENTID, 1455 1456 WMI_10X_WOW_WAKEUP_HOST_EVENTID, 1457 WMI_10X_DCS_INTERFERENCE_EVENTID, 1458 1459 /* TPC config for the current operating channel */ 1460 WMI_10X_PDEV_TPC_CONFIG_EVENTID, 1461 1462 WMI_10X_GPIO_INPUT_EVENTID, 1463 WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID - 1, 1464 }; 1465 1466 enum wmi_10_2_cmd_id { 1467 WMI_10_2_START_CMDID = 0x9000, 1468 WMI_10_2_END_CMDID = 0x9FFF, 1469 WMI_10_2_INIT_CMDID, 1470 WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID, 1471 WMI_10_2_STOP_SCAN_CMDID, 1472 WMI_10_2_SCAN_CHAN_LIST_CMDID, 1473 WMI_10_2_ECHO_CMDID, 1474 WMI_10_2_PDEV_SET_REGDOMAIN_CMDID, 1475 WMI_10_2_PDEV_SET_CHANNEL_CMDID, 1476 WMI_10_2_PDEV_SET_PARAM_CMDID, 1477 WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID, 1478 WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID, 1479 WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID, 1480 WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID, 1481 WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID, 1482 WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID, 1483 WMI_10_2_PDEV_SET_QUIET_MODE_CMDID, 1484 WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID, 1485 WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID, 1486 WMI_10_2_VDEV_CREATE_CMDID, 1487 WMI_10_2_VDEV_DELETE_CMDID, 1488 WMI_10_2_VDEV_START_REQUEST_CMDID, 1489 WMI_10_2_VDEV_RESTART_REQUEST_CMDID, 1490 WMI_10_2_VDEV_UP_CMDID, 1491 WMI_10_2_VDEV_STOP_CMDID, 1492 WMI_10_2_VDEV_DOWN_CMDID, 1493 WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID, 1494 WMI_10_2_VDEV_RESUME_RESPONSE_CMDID, 1495 WMI_10_2_VDEV_SET_PARAM_CMDID, 1496 WMI_10_2_VDEV_INSTALL_KEY_CMDID, 1497 WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID, 1498 WMI_10_2_PEER_CREATE_CMDID, 1499 WMI_10_2_PEER_DELETE_CMDID, 1500 WMI_10_2_PEER_FLUSH_TIDS_CMDID, 1501 WMI_10_2_PEER_SET_PARAM_CMDID, 1502 WMI_10_2_PEER_ASSOC_CMDID, 1503 WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID, 1504 WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID, 1505 WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID, 1506 WMI_10_2_PEER_MCAST_GROUP_CMDID, 1507 WMI_10_2_BCN_TX_CMDID, 1508 WMI_10_2_BCN_PRB_TMPL_CMDID, 1509 WMI_10_2_BCN_FILTER_RX_CMDID, 1510 WMI_10_2_PRB_REQ_FILTER_RX_CMDID, 1511 WMI_10_2_MGMT_TX_CMDID, 1512 WMI_10_2_ADDBA_CLEAR_RESP_CMDID, 1513 WMI_10_2_ADDBA_SEND_CMDID, 1514 WMI_10_2_ADDBA_STATUS_CMDID, 1515 WMI_10_2_DELBA_SEND_CMDID, 1516 WMI_10_2_ADDBA_SET_RESP_CMDID, 1517 WMI_10_2_SEND_SINGLEAMSDU_CMDID, 1518 WMI_10_2_STA_POWERSAVE_MODE_CMDID, 1519 WMI_10_2_STA_POWERSAVE_PARAM_CMDID, 1520 WMI_10_2_STA_MIMO_PS_MODE_CMDID, 1521 WMI_10_2_DBGLOG_CFG_CMDID, 1522 WMI_10_2_PDEV_DFS_ENABLE_CMDID, 1523 WMI_10_2_PDEV_DFS_DISABLE_CMDID, 1524 WMI_10_2_PDEV_QVIT_CMDID, 1525 WMI_10_2_ROAM_SCAN_MODE, 1526 WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD, 1527 WMI_10_2_ROAM_SCAN_PERIOD, 1528 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD, 1529 WMI_10_2_ROAM_AP_PROFILE, 1530 WMI_10_2_OFL_SCAN_ADD_AP_PROFILE, 1531 WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE, 1532 WMI_10_2_OFL_SCAN_PERIOD, 1533 WMI_10_2_P2P_DEV_SET_DEVICE_INFO, 1534 WMI_10_2_P2P_DEV_SET_DISCOVERABILITY, 1535 WMI_10_2_P2P_GO_SET_BEACON_IE, 1536 WMI_10_2_P2P_GO_SET_PROBE_RESP_IE, 1537 WMI_10_2_AP_PS_PEER_PARAM_CMDID, 1538 WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID, 1539 WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID, 1540 WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID, 1541 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID, 1542 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, 1543 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, 1544 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID, 1545 WMI_10_2_PDEV_SUSPEND_CMDID, 1546 WMI_10_2_PDEV_RESUME_CMDID, 1547 WMI_10_2_ADD_BCN_FILTER_CMDID, 1548 WMI_10_2_RMV_BCN_FILTER_CMDID, 1549 WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID, 1550 WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID, 1551 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID, 1552 WMI_10_2_WOW_ENABLE_CMDID, 1553 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, 1554 WMI_10_2_RTT_MEASREQ_CMDID, 1555 WMI_10_2_RTT_TSF_CMDID, 1556 WMI_10_2_RTT_KEEPALIVE_CMDID, 1557 WMI_10_2_PDEV_SEND_BCN_CMDID, 1558 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID, 1559 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID, 1560 WMI_10_2_REQUEST_STATS_CMDID, 1561 WMI_10_2_GPIO_CONFIG_CMDID, 1562 WMI_10_2_GPIO_OUTPUT_CMDID, 1563 WMI_10_2_VDEV_RATEMASK_CMDID, 1564 WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID, 1565 WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID, 1566 WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID, 1567 WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID, 1568 WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID, 1569 WMI_10_2_FORCE_FW_HANG_CMDID, 1570 WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID, 1571 WMI_10_2_PDEV_SET_CTL_TABLE_CMDID, 1572 WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID, 1573 WMI_10_2_PDEV_RATEPWR_TABLE_CMDID, 1574 WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID, 1575 WMI_10_2_PDEV_GET_INFO, 1576 WMI_10_2_VDEV_GET_INFO, 1577 WMI_10_2_VDEV_ATF_REQUEST_CMDID, 1578 WMI_10_2_PEER_ATF_REQUEST_CMDID, 1579 WMI_10_2_PDEV_GET_TEMPERATURE_CMDID, 1580 WMI_10_2_MU_CAL_START_CMDID, 1581 WMI_10_2_SET_LTEU_CONFIG_CMDID, 1582 WMI_10_2_SET_CCA_PARAMS, 1583 WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, 1584 WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1, 1585 }; 1586 1587 enum wmi_10_2_event_id { 1588 WMI_10_2_SERVICE_READY_EVENTID = 0x8000, 1589 WMI_10_2_READY_EVENTID, 1590 WMI_10_2_DEBUG_MESG_EVENTID, 1591 WMI_10_2_START_EVENTID = 0x9000, 1592 WMI_10_2_END_EVENTID = 0x9FFF, 1593 WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID, 1594 WMI_10_2_ECHO_EVENTID, 1595 WMI_10_2_UPDATE_STATS_EVENTID, 1596 WMI_10_2_INST_RSSI_STATS_EVENTID, 1597 WMI_10_2_VDEV_START_RESP_EVENTID, 1598 WMI_10_2_VDEV_STANDBY_REQ_EVENTID, 1599 WMI_10_2_VDEV_RESUME_REQ_EVENTID, 1600 WMI_10_2_VDEV_STOPPED_EVENTID, 1601 WMI_10_2_PEER_STA_KICKOUT_EVENTID, 1602 WMI_10_2_HOST_SWBA_EVENTID, 1603 WMI_10_2_TBTTOFFSET_UPDATE_EVENTID, 1604 WMI_10_2_MGMT_RX_EVENTID, 1605 WMI_10_2_CHAN_INFO_EVENTID, 1606 WMI_10_2_PHYERR_EVENTID, 1607 WMI_10_2_ROAM_EVENTID, 1608 WMI_10_2_PROFILE_MATCH, 1609 WMI_10_2_DEBUG_PRINT_EVENTID, 1610 WMI_10_2_PDEV_QVIT_EVENTID, 1611 WMI_10_2_WLAN_PROFILE_DATA_EVENTID, 1612 WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID, 1613 WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID, 1614 WMI_10_2_RTT_ERROR_REPORT_EVENTID, 1615 WMI_10_2_RTT_KEEPALIVE_EVENTID, 1616 WMI_10_2_WOW_WAKEUP_HOST_EVENTID, 1617 WMI_10_2_DCS_INTERFERENCE_EVENTID, 1618 WMI_10_2_PDEV_TPC_CONFIG_EVENTID, 1619 WMI_10_2_GPIO_INPUT_EVENTID, 1620 WMI_10_2_PEER_RATECODE_LIST_EVENTID, 1621 WMI_10_2_GENERIC_BUFFER_EVENTID, 1622 WMI_10_2_MCAST_BUF_RELEASE_EVENTID, 1623 WMI_10_2_MCAST_LIST_AGEOUT_EVENTID, 1624 WMI_10_2_WDS_PEER_EVENTID, 1625 WMI_10_2_PEER_STA_PS_STATECHG_EVENTID, 1626 WMI_10_2_PDEV_TEMPERATURE_EVENTID, 1627 WMI_10_2_MU_REPORT_EVENTID, 1628 WMI_10_2_PDEV_BSS_CHAN_INFO_EVENTID, 1629 WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1, 1630 }; 1631 1632 enum wmi_10_4_cmd_id { 1633 WMI_10_4_START_CMDID = 0x9000, 1634 WMI_10_4_END_CMDID = 0x9FFF, 1635 WMI_10_4_INIT_CMDID, 1636 WMI_10_4_START_SCAN_CMDID = WMI_10_4_START_CMDID, 1637 WMI_10_4_STOP_SCAN_CMDID, 1638 WMI_10_4_SCAN_CHAN_LIST_CMDID, 1639 WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID, 1640 WMI_10_4_SCAN_UPDATE_REQUEST_CMDID, 1641 WMI_10_4_ECHO_CMDID, 1642 WMI_10_4_PDEV_SET_REGDOMAIN_CMDID, 1643 WMI_10_4_PDEV_SET_CHANNEL_CMDID, 1644 WMI_10_4_PDEV_SET_PARAM_CMDID, 1645 WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID, 1646 WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID, 1647 WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID, 1648 WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID, 1649 WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID, 1650 WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID, 1651 WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID, 1652 WMI_10_4_PDEV_SET_QUIET_MODE_CMDID, 1653 WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID, 1654 WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID, 1655 WMI_10_4_VDEV_CREATE_CMDID, 1656 WMI_10_4_VDEV_DELETE_CMDID, 1657 WMI_10_4_VDEV_START_REQUEST_CMDID, 1658 WMI_10_4_VDEV_RESTART_REQUEST_CMDID, 1659 WMI_10_4_VDEV_UP_CMDID, 1660 WMI_10_4_VDEV_STOP_CMDID, 1661 WMI_10_4_VDEV_DOWN_CMDID, 1662 WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID, 1663 WMI_10_4_VDEV_RESUME_RESPONSE_CMDID, 1664 WMI_10_4_VDEV_SET_PARAM_CMDID, 1665 WMI_10_4_VDEV_INSTALL_KEY_CMDID, 1666 WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID, 1667 WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID, 1668 WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID, 1669 WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID, 1670 WMI_10_4_PEER_CREATE_CMDID, 1671 WMI_10_4_PEER_DELETE_CMDID, 1672 WMI_10_4_PEER_FLUSH_TIDS_CMDID, 1673 WMI_10_4_PEER_SET_PARAM_CMDID, 1674 WMI_10_4_PEER_ASSOC_CMDID, 1675 WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID, 1676 WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID, 1677 WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID, 1678 WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID, 1679 WMI_10_4_PEER_MCAST_GROUP_CMDID, 1680 WMI_10_4_BCN_TX_CMDID, 1681 WMI_10_4_PDEV_SEND_BCN_CMDID, 1682 WMI_10_4_BCN_PRB_TMPL_CMDID, 1683 WMI_10_4_BCN_FILTER_RX_CMDID, 1684 WMI_10_4_PRB_REQ_FILTER_RX_CMDID, 1685 WMI_10_4_MGMT_TX_CMDID, 1686 WMI_10_4_PRB_TMPL_CMDID, 1687 WMI_10_4_ADDBA_CLEAR_RESP_CMDID, 1688 WMI_10_4_ADDBA_SEND_CMDID, 1689 WMI_10_4_ADDBA_STATUS_CMDID, 1690 WMI_10_4_DELBA_SEND_CMDID, 1691 WMI_10_4_ADDBA_SET_RESP_CMDID, 1692 WMI_10_4_SEND_SINGLEAMSDU_CMDID, 1693 WMI_10_4_STA_POWERSAVE_MODE_CMDID, 1694 WMI_10_4_STA_POWERSAVE_PARAM_CMDID, 1695 WMI_10_4_STA_MIMO_PS_MODE_CMDID, 1696 WMI_10_4_DBGLOG_CFG_CMDID, 1697 WMI_10_4_PDEV_DFS_ENABLE_CMDID, 1698 WMI_10_4_PDEV_DFS_DISABLE_CMDID, 1699 WMI_10_4_PDEV_QVIT_CMDID, 1700 WMI_10_4_ROAM_SCAN_MODE, 1701 WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD, 1702 WMI_10_4_ROAM_SCAN_PERIOD, 1703 WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD, 1704 WMI_10_4_ROAM_AP_PROFILE, 1705 WMI_10_4_OFL_SCAN_ADD_AP_PROFILE, 1706 WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE, 1707 WMI_10_4_OFL_SCAN_PERIOD, 1708 WMI_10_4_P2P_DEV_SET_DEVICE_INFO, 1709 WMI_10_4_P2P_DEV_SET_DISCOVERABILITY, 1710 WMI_10_4_P2P_GO_SET_BEACON_IE, 1711 WMI_10_4_P2P_GO_SET_PROBE_RESP_IE, 1712 WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID, 1713 WMI_10_4_AP_PS_PEER_PARAM_CMDID, 1714 WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID, 1715 WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID, 1716 WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID, 1717 WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID, 1718 WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, 1719 WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, 1720 WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID, 1721 WMI_10_4_PDEV_SUSPEND_CMDID, 1722 WMI_10_4_PDEV_RESUME_CMDID, 1723 WMI_10_4_ADD_BCN_FILTER_CMDID, 1724 WMI_10_4_RMV_BCN_FILTER_CMDID, 1725 WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID, 1726 WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID, 1727 WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID, 1728 WMI_10_4_WOW_ENABLE_CMDID, 1729 WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, 1730 WMI_10_4_RTT_MEASREQ_CMDID, 1731 WMI_10_4_RTT_TSF_CMDID, 1732 WMI_10_4_RTT_KEEPALIVE_CMDID, 1733 WMI_10_4_OEM_REQ_CMDID, 1734 WMI_10_4_NAN_CMDID, 1735 WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID, 1736 WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID, 1737 WMI_10_4_REQUEST_STATS_CMDID, 1738 WMI_10_4_GPIO_CONFIG_CMDID, 1739 WMI_10_4_GPIO_OUTPUT_CMDID, 1740 WMI_10_4_VDEV_RATEMASK_CMDID, 1741 WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID, 1742 WMI_10_4_GTK_OFFLOAD_CMDID, 1743 WMI_10_4_QBOOST_CFG_CMDID, 1744 WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID, 1745 WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID, 1746 WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID, 1747 WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID, 1748 WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID, 1749 WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID, 1750 WMI_10_4_VDEV_SET_KEEPALIVE_CMDID, 1751 WMI_10_4_VDEV_GET_KEEPALIVE_CMDID, 1752 WMI_10_4_FORCE_FW_HANG_CMDID, 1753 WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID, 1754 WMI_10_4_PDEV_SET_CTL_TABLE_CMDID, 1755 WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID, 1756 WMI_10_4_PDEV_RATEPWR_TABLE_CMDID, 1757 WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID, 1758 WMI_10_4_PDEV_FIPS_CMDID, 1759 WMI_10_4_TT_SET_CONF_CMDID, 1760 WMI_10_4_FWTEST_CMDID, 1761 WMI_10_4_VDEV_ATF_REQUEST_CMDID, 1762 WMI_10_4_PEER_ATF_REQUEST_CMDID, 1763 WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID, 1764 WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID, 1765 WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID, 1766 WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID, 1767 WMI_10_4_PDEV_GET_TPC_CMDID, 1768 WMI_10_4_PDEV_GET_AST_INFO_CMDID, 1769 WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID, 1770 WMI_10_4_PDEV_GET_TEMPERATURE_CMDID, 1771 WMI_10_4_PDEV_GET_INFO_CMDID, 1772 WMI_10_4_VDEV_GET_INFO_CMDID, 1773 WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID, 1774 WMI_10_4_MU_CAL_START_CMDID, 1775 WMI_10_4_SET_CCA_PARAMS_CMDID, 1776 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, 1777 WMI_10_4_EXT_RESOURCE_CFG_CMDID, 1778 WMI_10_4_VDEV_SET_IE_CMDID, 1779 WMI_10_4_SET_LTEU_CONFIG_CMDID, 1780 WMI_10_4_ATF_SSID_GROUPING_REQUEST_CMDID, 1781 WMI_10_4_PEER_ATF_EXT_REQUEST_CMDID, 1782 WMI_10_4_SET_PERIODIC_CHANNEL_STATS_CONFIG, 1783 WMI_10_4_PEER_BWF_REQUEST_CMDID, 1784 WMI_10_4_BTCOEX_CFG_CMDID, 1785 WMI_10_4_PEER_TX_MU_TXMIT_COUNT_CMDID, 1786 WMI_10_4_PEER_TX_MU_TXMIT_RSTCNT_CMDID, 1787 WMI_10_4_PEER_GID_USERPOS_LIST_CMDID, 1788 WMI_10_4_PDEV_CHECK_CAL_VERSION_CMDID, 1789 WMI_10_4_COEX_VERSION_CFG_CMID, 1790 WMI_10_4_PDEV_GET_RX_FILTER_CMDID, 1791 WMI_10_4_PDEV_EXTENDED_NSS_CFG_CMDID, 1792 WMI_10_4_VDEV_SET_SCAN_NAC_RSSI_CMDID, 1793 WMI_10_4_PROG_GPIO_BAND_SELECT_CMDID, 1794 WMI_10_4_CONFIG_SMART_LOGGING_CMDID, 1795 WMI_10_4_DEBUG_FATAL_CONDITION_CMDID, 1796 WMI_10_4_GET_TSF_TIMER_CMDID, 1797 WMI_10_4_PDEV_GET_TPC_TABLE_CMDID, 1798 WMI_10_4_VDEV_SIFS_TRIGGER_TIME_CMDID, 1799 WMI_10_4_PDEV_WDS_ENTRY_LIST_CMDID, 1800 WMI_10_4_TDLS_SET_STATE_CMDID, 1801 WMI_10_4_TDLS_PEER_UPDATE_CMDID, 1802 WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID, 1803 WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1, 1804 }; 1805 1806 enum wmi_10_4_event_id { 1807 WMI_10_4_SERVICE_READY_EVENTID = 0x8000, 1808 WMI_10_4_READY_EVENTID, 1809 WMI_10_4_DEBUG_MESG_EVENTID, 1810 WMI_10_4_START_EVENTID = 0x9000, 1811 WMI_10_4_END_EVENTID = 0x9FFF, 1812 WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID, 1813 WMI_10_4_ECHO_EVENTID, 1814 WMI_10_4_UPDATE_STATS_EVENTID, 1815 WMI_10_4_INST_RSSI_STATS_EVENTID, 1816 WMI_10_4_VDEV_START_RESP_EVENTID, 1817 WMI_10_4_VDEV_STANDBY_REQ_EVENTID, 1818 WMI_10_4_VDEV_RESUME_REQ_EVENTID, 1819 WMI_10_4_VDEV_STOPPED_EVENTID, 1820 WMI_10_4_PEER_STA_KICKOUT_EVENTID, 1821 WMI_10_4_HOST_SWBA_EVENTID, 1822 WMI_10_4_TBTTOFFSET_UPDATE_EVENTID, 1823 WMI_10_4_MGMT_RX_EVENTID, 1824 WMI_10_4_CHAN_INFO_EVENTID, 1825 WMI_10_4_PHYERR_EVENTID, 1826 WMI_10_4_ROAM_EVENTID, 1827 WMI_10_4_PROFILE_MATCH, 1828 WMI_10_4_DEBUG_PRINT_EVENTID, 1829 WMI_10_4_PDEV_QVIT_EVENTID, 1830 WMI_10_4_WLAN_PROFILE_DATA_EVENTID, 1831 WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID, 1832 WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID, 1833 WMI_10_4_RTT_ERROR_REPORT_EVENTID, 1834 WMI_10_4_RTT_KEEPALIVE_EVENTID, 1835 WMI_10_4_OEM_CAPABILITY_EVENTID, 1836 WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID, 1837 WMI_10_4_OEM_ERROR_REPORT_EVENTID, 1838 WMI_10_4_NAN_EVENTID, 1839 WMI_10_4_WOW_WAKEUP_HOST_EVENTID, 1840 WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID, 1841 WMI_10_4_GTK_REKEY_FAIL_EVENTID, 1842 WMI_10_4_DCS_INTERFERENCE_EVENTID, 1843 WMI_10_4_PDEV_TPC_CONFIG_EVENTID, 1844 WMI_10_4_CSA_HANDLING_EVENTID, 1845 WMI_10_4_GPIO_INPUT_EVENTID, 1846 WMI_10_4_PEER_RATECODE_LIST_EVENTID, 1847 WMI_10_4_GENERIC_BUFFER_EVENTID, 1848 WMI_10_4_MCAST_BUF_RELEASE_EVENTID, 1849 WMI_10_4_MCAST_LIST_AGEOUT_EVENTID, 1850 WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID, 1851 WMI_10_4_WDS_PEER_EVENTID, 1852 WMI_10_4_PEER_STA_PS_STATECHG_EVENTID, 1853 WMI_10_4_PDEV_FIPS_EVENTID, 1854 WMI_10_4_TT_STATS_EVENTID, 1855 WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID, 1856 WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID, 1857 WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID, 1858 WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID, 1859 WMI_10_4_PDEV_NFCAL_POWER_EVENTID, 1860 WMI_10_4_PDEV_TPC_EVENTID, 1861 WMI_10_4_PDEV_GET_AST_INFO_EVENTID, 1862 WMI_10_4_PDEV_TEMPERATURE_EVENTID, 1863 WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID, 1864 WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID, 1865 WMI_10_4_MU_REPORT_EVENTID, 1866 WMI_10_4_TX_DATA_TRAFFIC_CTRL_EVENTID, 1867 WMI_10_4_PEER_TX_MU_TXMIT_COUNT_EVENTID, 1868 WMI_10_4_PEER_GID_USERPOS_LIST_EVENTID, 1869 WMI_10_4_PDEV_CHECK_CAL_VERSION_EVENTID, 1870 WMI_10_4_ATF_PEER_STATS_EVENTID, 1871 WMI_10_4_PDEV_GET_RX_FILTER_EVENTID, 1872 WMI_10_4_NAC_RSSI_EVENTID, 1873 WMI_10_4_DEBUG_FATAL_CONDITION_EVENTID, 1874 WMI_10_4_GET_TSF_TIMER_RESP_EVENTID, 1875 WMI_10_4_PDEV_TPC_TABLE_EVENTID, 1876 WMI_10_4_PDEV_WDS_ENTRY_LIST_EVENTID, 1877 WMI_10_4_TDLS_PEER_EVENTID, 1878 WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1, 1879 }; 1880 1881 enum wmi_phy_mode { 1882 MODE_11A = 0, /* 11a Mode */ 1883 MODE_11G = 1, /* 11b/g Mode */ 1884 MODE_11B = 2, /* 11b Mode */ 1885 MODE_11GONLY = 3, /* 11g only Mode */ 1886 MODE_11NA_HT20 = 4, /* 11a HT20 mode */ 1887 MODE_11NG_HT20 = 5, /* 11g HT20 mode */ 1888 MODE_11NA_HT40 = 6, /* 11a HT40 mode */ 1889 MODE_11NG_HT40 = 7, /* 11g HT40 mode */ 1890 MODE_11AC_VHT20 = 8, 1891 MODE_11AC_VHT40 = 9, 1892 MODE_11AC_VHT80 = 10, 1893 /* MODE_11AC_VHT160 = 11, */ 1894 MODE_11AC_VHT20_2G = 11, 1895 MODE_11AC_VHT40_2G = 12, 1896 MODE_11AC_VHT80_2G = 13, 1897 MODE_11AC_VHT80_80 = 14, 1898 MODE_11AC_VHT160 = 15, 1899 MODE_UNKNOWN = 16, 1900 MODE_MAX = 16 1901 }; 1902 1903 static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode) 1904 { 1905 switch (mode) { 1906 case MODE_11A: 1907 return "11a"; 1908 case MODE_11G: 1909 return "11g"; 1910 case MODE_11B: 1911 return "11b"; 1912 case MODE_11GONLY: 1913 return "11gonly"; 1914 case MODE_11NA_HT20: 1915 return "11na-ht20"; 1916 case MODE_11NG_HT20: 1917 return "11ng-ht20"; 1918 case MODE_11NA_HT40: 1919 return "11na-ht40"; 1920 case MODE_11NG_HT40: 1921 return "11ng-ht40"; 1922 case MODE_11AC_VHT20: 1923 return "11ac-vht20"; 1924 case MODE_11AC_VHT40: 1925 return "11ac-vht40"; 1926 case MODE_11AC_VHT80: 1927 return "11ac-vht80"; 1928 case MODE_11AC_VHT160: 1929 return "11ac-vht160"; 1930 case MODE_11AC_VHT80_80: 1931 return "11ac-vht80+80"; 1932 case MODE_11AC_VHT20_2G: 1933 return "11ac-vht20-2g"; 1934 case MODE_11AC_VHT40_2G: 1935 return "11ac-vht40-2g"; 1936 case MODE_11AC_VHT80_2G: 1937 return "11ac-vht80-2g"; 1938 case MODE_UNKNOWN: 1939 /* skip */ 1940 break; 1941 1942 /* no default handler to allow compiler to check that the 1943 * enum is fully handled 1944 */ 1945 }; 1946 1947 return "<unknown>"; 1948 } 1949 1950 #define WMI_CHAN_LIST_TAG 0x1 1951 #define WMI_SSID_LIST_TAG 0x2 1952 #define WMI_BSSID_LIST_TAG 0x3 1953 #define WMI_IE_TAG 0x4 1954 1955 struct wmi_channel { 1956 __le32 mhz; 1957 __le32 band_center_freq1; 1958 __le32 band_center_freq2; /* valid for 11ac, 80plus80 */ 1959 union { 1960 __le32 flags; /* WMI_CHAN_FLAG_ */ 1961 struct { 1962 u8 mode; /* only 6 LSBs */ 1963 } __packed; 1964 } __packed; 1965 union { 1966 __le32 reginfo0; 1967 struct { 1968 /* note: power unit is 0.5 dBm */ 1969 u8 min_power; 1970 u8 max_power; 1971 u8 reg_power; 1972 u8 reg_classid; 1973 } __packed; 1974 } __packed; 1975 union { 1976 __le32 reginfo1; 1977 struct { 1978 u8 antenna_max; 1979 u8 max_tx_power; 1980 } __packed; 1981 } __packed; 1982 } __packed; 1983 1984 struct wmi_channel_arg { 1985 u32 freq; 1986 u32 band_center_freq1; 1987 u32 band_center_freq2; 1988 bool passive; 1989 bool allow_ibss; 1990 bool allow_ht; 1991 bool allow_vht; 1992 bool ht40plus; 1993 bool chan_radar; 1994 /* note: power unit is 0.5 dBm */ 1995 u32 min_power; 1996 u32 max_power; 1997 u32 max_reg_power; 1998 u32 max_antenna_gain; 1999 u32 reg_class_id; 2000 enum wmi_phy_mode mode; 2001 }; 2002 2003 enum wmi_channel_change_cause { 2004 WMI_CHANNEL_CHANGE_CAUSE_NONE = 0, 2005 WMI_CHANNEL_CHANGE_CAUSE_CSA, 2006 }; 2007 2008 #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6) 2009 #define WMI_CHAN_FLAG_PASSIVE (1 << 7) 2010 #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8) 2011 #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9) 2012 #define WMI_CHAN_FLAG_DFS (1 << 10) 2013 #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11) 2014 #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12) 2015 2016 /* Indicate reason for channel switch */ 2017 #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13) 2018 2019 #define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */ 2020 2021 /* HT Capabilities*/ 2022 #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */ 2023 #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */ 2024 #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */ 2025 #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */ 2026 #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3 2027 #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */ 2028 #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4 2029 #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */ 2030 #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */ 2031 #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */ 2032 #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8 2033 #define WMI_HT_CAP_HT40_SGI 0x0800 2034 2035 #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \ 2036 WMI_HT_CAP_HT20_SGI | \ 2037 WMI_HT_CAP_HT40_SGI | \ 2038 WMI_HT_CAP_TX_STBC | \ 2039 WMI_HT_CAP_RX_STBC | \ 2040 WMI_HT_CAP_LDPC) 2041 2042 /* 2043 * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information 2044 * field. The fields not defined here are not supported, or reserved. 2045 * Do not change these masks and if you have to add new one follow the 2046 * bitmask as specified by 802.11ac draft. 2047 */ 2048 2049 #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003 2050 #define WMI_VHT_CAP_RX_LDPC 0x00000010 2051 #define WMI_VHT_CAP_SGI_80MHZ 0x00000020 2052 #define WMI_VHT_CAP_SGI_160MHZ 0x00000040 2053 #define WMI_VHT_CAP_TX_STBC 0x00000080 2054 #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300 2055 #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8 2056 #define WMI_VHT_CAP_SU_BFER 0x00000800 2057 #define WMI_VHT_CAP_SU_BFEE 0x00001000 2058 #define WMI_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000 2059 #define WMI_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13 2060 #define WMI_VHT_CAP_MAX_SND_DIM_MASK 0x00070000 2061 #define WMI_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16 2062 #define WMI_VHT_CAP_MU_BFER 0x00080000 2063 #define WMI_VHT_CAP_MU_BFEE 0x00100000 2064 #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000 2065 #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23 2066 #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000 2067 #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000 2068 2069 /* The following also refer for max HT AMSDU */ 2070 #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000 2071 #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001 2072 #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002 2073 2074 #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \ 2075 WMI_VHT_CAP_RX_LDPC | \ 2076 WMI_VHT_CAP_SGI_80MHZ | \ 2077 WMI_VHT_CAP_TX_STBC | \ 2078 WMI_VHT_CAP_RX_STBC_MASK | \ 2079 WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \ 2080 WMI_VHT_CAP_RX_FIXED_ANT | \ 2081 WMI_VHT_CAP_TX_FIXED_ANT) 2082 2083 /* 2084 * Interested readers refer to Rx/Tx MCS Map definition as defined in 2085 * 802.11ac 2086 */ 2087 #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1)) 2088 #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000 2089 #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16 2090 2091 enum { 2092 REGDMN_MODE_11A = 0x00001, /* 11a channels */ 2093 REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */ 2094 REGDMN_MODE_11B = 0x00004, /* 11b channels */ 2095 REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */ 2096 REGDMN_MODE_11G = 0x00008, /* XXX historical */ 2097 REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */ 2098 REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */ 2099 REGDMN_MODE_XR = 0x00100, /* XR channels */ 2100 REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */ 2101 REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */ 2102 REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */ 2103 REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */ 2104 REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */ 2105 REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */ 2106 REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */ 2107 REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */ 2108 REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */ 2109 REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */ 2110 REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */ 2111 REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */ 2112 REGDMN_MODE_11AC_VHT160 = 0x200000, /* 5Ghz, VHT160 channels */ 2113 REGDMN_MODE_11AC_VHT80_80 = 0x400000, /* 5Ghz, VHT80+80 channels */ 2114 REGDMN_MODE_ALL = 0xffffffff 2115 }; 2116 2117 #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001 2118 #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002 2119 #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004 2120 2121 /* regulatory capabilities */ 2122 #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040 2123 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080 2124 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100 2125 #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200 2126 #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400 2127 #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800 2128 2129 struct hal_reg_capabilities { 2130 /* regdomain value specified in EEPROM */ 2131 __le32 eeprom_rd; 2132 /*regdomain */ 2133 __le32 eeprom_rd_ext; 2134 /* CAP1 capabilities bit map. */ 2135 __le32 regcap1; 2136 /* REGDMN EEPROM CAP. */ 2137 __le32 regcap2; 2138 /* REGDMN MODE */ 2139 __le32 wireless_modes; 2140 __le32 low_2ghz_chan; 2141 __le32 high_2ghz_chan; 2142 __le32 low_5ghz_chan; 2143 __le32 high_5ghz_chan; 2144 } __packed; 2145 2146 enum wlan_mode_capability { 2147 WHAL_WLAN_11A_CAPABILITY = 0x1, 2148 WHAL_WLAN_11G_CAPABILITY = 0x2, 2149 WHAL_WLAN_11AG_CAPABILITY = 0x3, 2150 }; 2151 2152 /* structure used by FW for requesting host memory */ 2153 struct wlan_host_mem_req { 2154 /* ID of the request */ 2155 __le32 req_id; 2156 /* size of the of each unit */ 2157 __le32 unit_size; 2158 /* flags to indicate that 2159 * the number units is dependent 2160 * on number of resources(num vdevs num peers .. etc) 2161 */ 2162 __le32 num_unit_info; 2163 /* 2164 * actual number of units to allocate . if flags in the num_unit_info 2165 * indicate that number of units is tied to number of a particular 2166 * resource to allocate then num_units filed is set to 0 and host 2167 * will derive the number units from number of the resources it is 2168 * requesting. 2169 */ 2170 __le32 num_units; 2171 } __packed; 2172 2173 /* 2174 * The following struct holds optional payload for 2175 * wmi_service_ready_event,e.g., 11ac pass some of the 2176 * device capability to the host. 2177 */ 2178 struct wmi_service_ready_event { 2179 __le32 sw_version; 2180 __le32 sw_version_1; 2181 __le32 abi_version; 2182 /* WMI_PHY_CAPABILITY */ 2183 __le32 phy_capability; 2184 /* Maximum number of frag table entries that SW will populate less 1 */ 2185 __le32 max_frag_entry; 2186 __le32 wmi_service_bitmap[16]; 2187 __le32 num_rf_chains; 2188 /* 2189 * The following field is only valid for service type 2190 * WMI_SERVICE_11AC 2191 */ 2192 __le32 ht_cap_info; /* WMI HT Capability */ 2193 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */ 2194 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */ 2195 __le32 hw_min_tx_power; 2196 __le32 hw_max_tx_power; 2197 struct hal_reg_capabilities hal_reg_capabilities; 2198 __le32 sys_cap_info; 2199 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */ 2200 /* 2201 * Max beacon and Probe Response IE offload size 2202 * (includes optional P2P IEs) 2203 */ 2204 __le32 max_bcn_ie_size; 2205 /* 2206 * request to host to allocate a chuck of memory and pss it down to FW 2207 * via WM_INIT. FW uses this as FW extesnsion memory for saving its 2208 * data structures. Only valid for low latency interfaces like PCIE 2209 * where FW can access this memory directly (or) by DMA. 2210 */ 2211 __le32 num_mem_reqs; 2212 struct wlan_host_mem_req mem_reqs[0]; 2213 } __packed; 2214 2215 /* This is the definition from 10.X firmware branch */ 2216 struct wmi_10x_service_ready_event { 2217 __le32 sw_version; 2218 __le32 abi_version; 2219 2220 /* WMI_PHY_CAPABILITY */ 2221 __le32 phy_capability; 2222 2223 /* Maximum number of frag table entries that SW will populate less 1 */ 2224 __le32 max_frag_entry; 2225 __le32 wmi_service_bitmap[16]; 2226 __le32 num_rf_chains; 2227 2228 /* 2229 * The following field is only valid for service type 2230 * WMI_SERVICE_11AC 2231 */ 2232 __le32 ht_cap_info; /* WMI HT Capability */ 2233 __le32 vht_cap_info; /* VHT capability info field of 802.11ac */ 2234 __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */ 2235 __le32 hw_min_tx_power; 2236 __le32 hw_max_tx_power; 2237 2238 struct hal_reg_capabilities hal_reg_capabilities; 2239 2240 __le32 sys_cap_info; 2241 __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */ 2242 2243 /* 2244 * request to host to allocate a chuck of memory and pss it down to FW 2245 * via WM_INIT. FW uses this as FW extesnsion memory for saving its 2246 * data structures. Only valid for low latency interfaces like PCIE 2247 * where FW can access this memory directly (or) by DMA. 2248 */ 2249 __le32 num_mem_reqs; 2250 2251 struct wlan_host_mem_req mem_reqs[0]; 2252 } __packed; 2253 2254 #define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ) 2255 #define WMI_UNIFIED_READY_TIMEOUT_HZ (5 * HZ) 2256 2257 struct wmi_ready_event { 2258 __le32 sw_version; 2259 __le32 abi_version; 2260 struct wmi_mac_addr mac_addr; 2261 __le32 status; 2262 } __packed; 2263 2264 struct wmi_resource_config { 2265 /* number of virtual devices (VAPs) to support */ 2266 __le32 num_vdevs; 2267 2268 /* number of peer nodes to support */ 2269 __le32 num_peers; 2270 2271 /* 2272 * In offload mode target supports features like WOW, chatter and 2273 * other protocol offloads. In order to support them some 2274 * functionalities like reorder buffering, PN checking need to be 2275 * done in target. This determines maximum number of peers supported 2276 * by target in offload mode 2277 */ 2278 __le32 num_offload_peers; 2279 2280 /* For target-based RX reordering */ 2281 __le32 num_offload_reorder_bufs; 2282 2283 /* number of keys per peer */ 2284 __le32 num_peer_keys; 2285 2286 /* total number of TX/RX data TIDs */ 2287 __le32 num_tids; 2288 2289 /* 2290 * max skid for resolving hash collisions 2291 * 2292 * The address search table is sparse, so that if two MAC addresses 2293 * result in the same hash value, the second of these conflicting 2294 * entries can slide to the next index in the address search table, 2295 * and use it, if it is unoccupied. This ast_skid_limit parameter 2296 * specifies the upper bound on how many subsequent indices to search 2297 * over to find an unoccupied space. 2298 */ 2299 __le32 ast_skid_limit; 2300 2301 /* 2302 * the nominal chain mask for transmit 2303 * 2304 * The chain mask may be modified dynamically, e.g. to operate AP 2305 * tx with a reduced number of chains if no clients are associated. 2306 * This configuration parameter specifies the nominal chain-mask that 2307 * should be used when not operating with a reduced set of tx chains. 2308 */ 2309 __le32 tx_chain_mask; 2310 2311 /* 2312 * the nominal chain mask for receive 2313 * 2314 * The chain mask may be modified dynamically, e.g. for a client 2315 * to use a reduced number of chains for receive if the traffic to 2316 * the client is low enough that it doesn't require downlink MIMO 2317 * or antenna diversity. 2318 * This configuration parameter specifies the nominal chain-mask that 2319 * should be used when not operating with a reduced set of rx chains. 2320 */ 2321 __le32 rx_chain_mask; 2322 2323 /* 2324 * what rx reorder timeout (ms) to use for the AC 2325 * 2326 * Each WMM access class (voice, video, best-effort, background) will 2327 * have its own timeout value to dictate how long to wait for missing 2328 * rx MPDUs to arrive before flushing subsequent MPDUs that have 2329 * already been received. 2330 * This parameter specifies the timeout in milliseconds for each 2331 * class. 2332 */ 2333 __le32 rx_timeout_pri_vi; 2334 __le32 rx_timeout_pri_vo; 2335 __le32 rx_timeout_pri_be; 2336 __le32 rx_timeout_pri_bk; 2337 2338 /* 2339 * what mode the rx should decap packets to 2340 * 2341 * MAC can decap to RAW (no decap), native wifi or Ethernet types 2342 * THis setting also determines the default TX behavior, however TX 2343 * behavior can be modified on a per VAP basis during VAP init 2344 */ 2345 __le32 rx_decap_mode; 2346 2347 /* what is the maximum number of scan requests that can be queued */ 2348 __le32 scan_max_pending_reqs; 2349 2350 /* maximum VDEV that could use BMISS offload */ 2351 __le32 bmiss_offload_max_vdev; 2352 2353 /* maximum VDEV that could use offload roaming */ 2354 __le32 roam_offload_max_vdev; 2355 2356 /* maximum AP profiles that would push to offload roaming */ 2357 __le32 roam_offload_max_ap_profiles; 2358 2359 /* 2360 * how many groups to use for mcast->ucast conversion 2361 * 2362 * The target's WAL maintains a table to hold information regarding 2363 * which peers belong to a given multicast group, so that if 2364 * multicast->unicast conversion is enabled, the target can convert 2365 * multicast tx frames to a series of unicast tx frames, to each 2366 * peer within the multicast group. 2367 This num_mcast_groups configuration parameter tells the target how 2368 * many multicast groups to provide storage for within its multicast 2369 * group membership table. 2370 */ 2371 __le32 num_mcast_groups; 2372 2373 /* 2374 * size to alloc for the mcast membership table 2375 * 2376 * This num_mcast_table_elems configuration parameter tells the 2377 * target how many peer elements it needs to provide storage for in 2378 * its multicast group membership table. 2379 * These multicast group membership table elements are shared by the 2380 * multicast groups stored within the table. 2381 */ 2382 __le32 num_mcast_table_elems; 2383 2384 /* 2385 * whether/how to do multicast->unicast conversion 2386 * 2387 * This configuration parameter specifies whether the target should 2388 * perform multicast --> unicast conversion on transmit, and if so, 2389 * what to do if it finds no entries in its multicast group 2390 * membership table for the multicast IP address in the tx frame. 2391 * Configuration value: 2392 * 0 -> Do not perform multicast to unicast conversion. 2393 * 1 -> Convert multicast frames to unicast, if the IP multicast 2394 * address from the tx frame is found in the multicast group 2395 * membership table. If the IP multicast address is not found, 2396 * drop the frame. 2397 * 2 -> Convert multicast frames to unicast, if the IP multicast 2398 * address from the tx frame is found in the multicast group 2399 * membership table. If the IP multicast address is not found, 2400 * transmit the frame as multicast. 2401 */ 2402 __le32 mcast2ucast_mode; 2403 2404 /* 2405 * how much memory to allocate for a tx PPDU dbg log 2406 * 2407 * This parameter controls how much memory the target will allocate 2408 * to store a log of tx PPDU meta-information (how large the PPDU 2409 * was, when it was sent, whether it was successful, etc.) 2410 */ 2411 __le32 tx_dbg_log_size; 2412 2413 /* how many AST entries to be allocated for WDS */ 2414 __le32 num_wds_entries; 2415 2416 /* 2417 * MAC DMA burst size, e.g., For target PCI limit can be 2418 * 0 -default, 1 256B 2419 */ 2420 __le32 dma_burst_size; 2421 2422 /* 2423 * Fixed delimiters to be inserted after every MPDU to 2424 * account for interface latency to avoid underrun. 2425 */ 2426 __le32 mac_aggr_delim; 2427 2428 /* 2429 * determine whether target is responsible for detecting duplicate 2430 * non-aggregate MPDU and timing out stale fragments. 2431 * 2432 * A-MPDU reordering is always performed on the target. 2433 * 2434 * 0: target responsible for frag timeout and dup checking 2435 * 1: host responsible for frag timeout and dup checking 2436 */ 2437 __le32 rx_skip_defrag_timeout_dup_detection_check; 2438 2439 /* 2440 * Configuration for VoW : 2441 * No of Video Nodes to be supported 2442 * and Max no of descriptors for each Video link (node). 2443 */ 2444 __le32 vow_config; 2445 2446 /* maximum VDEV that could use GTK offload */ 2447 __le32 gtk_offload_max_vdev; 2448 2449 /* Number of msdu descriptors target should use */ 2450 __le32 num_msdu_desc; 2451 2452 /* 2453 * Max. number of Tx fragments per MSDU 2454 * This parameter controls the max number of Tx fragments per MSDU. 2455 * This is sent by the target as part of the WMI_SERVICE_READY event 2456 * and is overridden by the OS shim as required. 2457 */ 2458 __le32 max_frag_entries; 2459 } __packed; 2460 2461 struct wmi_resource_config_10x { 2462 /* number of virtual devices (VAPs) to support */ 2463 __le32 num_vdevs; 2464 2465 /* number of peer nodes to support */ 2466 __le32 num_peers; 2467 2468 /* number of keys per peer */ 2469 __le32 num_peer_keys; 2470 2471 /* total number of TX/RX data TIDs */ 2472 __le32 num_tids; 2473 2474 /* 2475 * max skid for resolving hash collisions 2476 * 2477 * The address search table is sparse, so that if two MAC addresses 2478 * result in the same hash value, the second of these conflicting 2479 * entries can slide to the next index in the address search table, 2480 * and use it, if it is unoccupied. This ast_skid_limit parameter 2481 * specifies the upper bound on how many subsequent indices to search 2482 * over to find an unoccupied space. 2483 */ 2484 __le32 ast_skid_limit; 2485 2486 /* 2487 * the nominal chain mask for transmit 2488 * 2489 * The chain mask may be modified dynamically, e.g. to operate AP 2490 * tx with a reduced number of chains if no clients are associated. 2491 * This configuration parameter specifies the nominal chain-mask that 2492 * should be used when not operating with a reduced set of tx chains. 2493 */ 2494 __le32 tx_chain_mask; 2495 2496 /* 2497 * the nominal chain mask for receive 2498 * 2499 * The chain mask may be modified dynamically, e.g. for a client 2500 * to use a reduced number of chains for receive if the traffic to 2501 * the client is low enough that it doesn't require downlink MIMO 2502 * or antenna diversity. 2503 * This configuration parameter specifies the nominal chain-mask that 2504 * should be used when not operating with a reduced set of rx chains. 2505 */ 2506 __le32 rx_chain_mask; 2507 2508 /* 2509 * what rx reorder timeout (ms) to use for the AC 2510 * 2511 * Each WMM access class (voice, video, best-effort, background) will 2512 * have its own timeout value to dictate how long to wait for missing 2513 * rx MPDUs to arrive before flushing subsequent MPDUs that have 2514 * already been received. 2515 * This parameter specifies the timeout in milliseconds for each 2516 * class. 2517 */ 2518 __le32 rx_timeout_pri_vi; 2519 __le32 rx_timeout_pri_vo; 2520 __le32 rx_timeout_pri_be; 2521 __le32 rx_timeout_pri_bk; 2522 2523 /* 2524 * what mode the rx should decap packets to 2525 * 2526 * MAC can decap to RAW (no decap), native wifi or Ethernet types 2527 * THis setting also determines the default TX behavior, however TX 2528 * behavior can be modified on a per VAP basis during VAP init 2529 */ 2530 __le32 rx_decap_mode; 2531 2532 /* what is the maximum number of scan requests that can be queued */ 2533 __le32 scan_max_pending_reqs; 2534 2535 /* maximum VDEV that could use BMISS offload */ 2536 __le32 bmiss_offload_max_vdev; 2537 2538 /* maximum VDEV that could use offload roaming */ 2539 __le32 roam_offload_max_vdev; 2540 2541 /* maximum AP profiles that would push to offload roaming */ 2542 __le32 roam_offload_max_ap_profiles; 2543 2544 /* 2545 * how many groups to use for mcast->ucast conversion 2546 * 2547 * The target's WAL maintains a table to hold information regarding 2548 * which peers belong to a given multicast group, so that if 2549 * multicast->unicast conversion is enabled, the target can convert 2550 * multicast tx frames to a series of unicast tx frames, to each 2551 * peer within the multicast group. 2552 This num_mcast_groups configuration parameter tells the target how 2553 * many multicast groups to provide storage for within its multicast 2554 * group membership table. 2555 */ 2556 __le32 num_mcast_groups; 2557 2558 /* 2559 * size to alloc for the mcast membership table 2560 * 2561 * This num_mcast_table_elems configuration parameter tells the 2562 * target how many peer elements it needs to provide storage for in 2563 * its multicast group membership table. 2564 * These multicast group membership table elements are shared by the 2565 * multicast groups stored within the table. 2566 */ 2567 __le32 num_mcast_table_elems; 2568 2569 /* 2570 * whether/how to do multicast->unicast conversion 2571 * 2572 * This configuration parameter specifies whether the target should 2573 * perform multicast --> unicast conversion on transmit, and if so, 2574 * what to do if it finds no entries in its multicast group 2575 * membership table for the multicast IP address in the tx frame. 2576 * Configuration value: 2577 * 0 -> Do not perform multicast to unicast conversion. 2578 * 1 -> Convert multicast frames to unicast, if the IP multicast 2579 * address from the tx frame is found in the multicast group 2580 * membership table. If the IP multicast address is not found, 2581 * drop the frame. 2582 * 2 -> Convert multicast frames to unicast, if the IP multicast 2583 * address from the tx frame is found in the multicast group 2584 * membership table. If the IP multicast address is not found, 2585 * transmit the frame as multicast. 2586 */ 2587 __le32 mcast2ucast_mode; 2588 2589 /* 2590 * how much memory to allocate for a tx PPDU dbg log 2591 * 2592 * This parameter controls how much memory the target will allocate 2593 * to store a log of tx PPDU meta-information (how large the PPDU 2594 * was, when it was sent, whether it was successful, etc.) 2595 */ 2596 __le32 tx_dbg_log_size; 2597 2598 /* how many AST entries to be allocated for WDS */ 2599 __le32 num_wds_entries; 2600 2601 /* 2602 * MAC DMA burst size, e.g., For target PCI limit can be 2603 * 0 -default, 1 256B 2604 */ 2605 __le32 dma_burst_size; 2606 2607 /* 2608 * Fixed delimiters to be inserted after every MPDU to 2609 * account for interface latency to avoid underrun. 2610 */ 2611 __le32 mac_aggr_delim; 2612 2613 /* 2614 * determine whether target is responsible for detecting duplicate 2615 * non-aggregate MPDU and timing out stale fragments. 2616 * 2617 * A-MPDU reordering is always performed on the target. 2618 * 2619 * 0: target responsible for frag timeout and dup checking 2620 * 1: host responsible for frag timeout and dup checking 2621 */ 2622 __le32 rx_skip_defrag_timeout_dup_detection_check; 2623 2624 /* 2625 * Configuration for VoW : 2626 * No of Video Nodes to be supported 2627 * and Max no of descriptors for each Video link (node). 2628 */ 2629 __le32 vow_config; 2630 2631 /* Number of msdu descriptors target should use */ 2632 __le32 num_msdu_desc; 2633 2634 /* 2635 * Max. number of Tx fragments per MSDU 2636 * This parameter controls the max number of Tx fragments per MSDU. 2637 * This is sent by the target as part of the WMI_SERVICE_READY event 2638 * and is overridden by the OS shim as required. 2639 */ 2640 __le32 max_frag_entries; 2641 } __packed; 2642 2643 enum wmi_10_2_feature_mask { 2644 WMI_10_2_RX_BATCH_MODE = BIT(0), 2645 WMI_10_2_ATF_CONFIG = BIT(1), 2646 WMI_10_2_COEX_GPIO = BIT(3), 2647 WMI_10_2_BSS_CHAN_INFO = BIT(6), 2648 WMI_10_2_PEER_STATS = BIT(7), 2649 }; 2650 2651 struct wmi_resource_config_10_2 { 2652 struct wmi_resource_config_10x common; 2653 __le32 max_peer_ext_stats; 2654 __le32 smart_ant_cap; /* 0-disable, 1-enable */ 2655 __le32 bk_min_free; 2656 __le32 be_min_free; 2657 __le32 vi_min_free; 2658 __le32 vo_min_free; 2659 __le32 feature_mask; 2660 } __packed; 2661 2662 #define NUM_UNITS_IS_NUM_VDEVS BIT(0) 2663 #define NUM_UNITS_IS_NUM_PEERS BIT(1) 2664 #define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2) 2665 2666 struct wmi_resource_config_10_4 { 2667 /* Number of virtual devices (VAPs) to support */ 2668 __le32 num_vdevs; 2669 2670 /* Number of peer nodes to support */ 2671 __le32 num_peers; 2672 2673 /* Number of active peer nodes to support */ 2674 __le32 num_active_peers; 2675 2676 /* In offload mode, target supports features like WOW, chatter and other 2677 * protocol offloads. In order to support them some functionalities like 2678 * reorder buffering, PN checking need to be done in target. 2679 * This determines maximum number of peers supported by target in 2680 * offload mode. 2681 */ 2682 __le32 num_offload_peers; 2683 2684 /* Number of reorder buffers available for doing target based reorder 2685 * Rx reorder buffering 2686 */ 2687 __le32 num_offload_reorder_buffs; 2688 2689 /* Number of keys per peer */ 2690 __le32 num_peer_keys; 2691 2692 /* Total number of TX/RX data TIDs */ 2693 __le32 num_tids; 2694 2695 /* Max skid for resolving hash collisions. 2696 * The address search table is sparse, so that if two MAC addresses 2697 * result in the same hash value, the second of these conflicting 2698 * entries can slide to the next index in the address search table, 2699 * and use it, if it is unoccupied. This ast_skid_limit parameter 2700 * specifies the upper bound on how many subsequent indices to search 2701 * over to find an unoccupied space. 2702 */ 2703 __le32 ast_skid_limit; 2704 2705 /* The nominal chain mask for transmit. 2706 * The chain mask may be modified dynamically, e.g. to operate AP tx 2707 * with a reduced number of chains if no clients are associated. 2708 * This configuration parameter specifies the nominal chain-mask that 2709 * should be used when not operating with a reduced set of tx chains. 2710 */ 2711 __le32 tx_chain_mask; 2712 2713 /* The nominal chain mask for receive. 2714 * The chain mask may be modified dynamically, e.g. for a client to use 2715 * a reduced number of chains for receive if the traffic to the client 2716 * is low enough that it doesn't require downlink MIMO or antenna 2717 * diversity. This configuration parameter specifies the nominal 2718 * chain-mask that should be used when not operating with a reduced 2719 * set of rx chains. 2720 */ 2721 __le32 rx_chain_mask; 2722 2723 /* What rx reorder timeout (ms) to use for the AC. 2724 * Each WMM access class (voice, video, best-effort, background) will 2725 * have its own timeout value to dictate how long to wait for missing 2726 * rx MPDUs to arrive before flushing subsequent MPDUs that have already 2727 * been received. This parameter specifies the timeout in milliseconds 2728 * for each class. 2729 */ 2730 __le32 rx_timeout_pri[4]; 2731 2732 /* What mode the rx should decap packets to. 2733 * MAC can decap to RAW (no decap), native wifi or Ethernet types. 2734 * This setting also determines the default TX behavior, however TX 2735 * behavior can be modified on a per VAP basis during VAP init 2736 */ 2737 __le32 rx_decap_mode; 2738 2739 __le32 scan_max_pending_req; 2740 2741 __le32 bmiss_offload_max_vdev; 2742 2743 __le32 roam_offload_max_vdev; 2744 2745 __le32 roam_offload_max_ap_profiles; 2746 2747 /* How many groups to use for mcast->ucast conversion. 2748 * The target's WAL maintains a table to hold information regarding 2749 * which peers belong to a given multicast group, so that if 2750 * multicast->unicast conversion is enabled, the target can convert 2751 * multicast tx frames to a series of unicast tx frames, to each peer 2752 * within the multicast group. This num_mcast_groups configuration 2753 * parameter tells the target how many multicast groups to provide 2754 * storage for within its multicast group membership table. 2755 */ 2756 __le32 num_mcast_groups; 2757 2758 /* Size to alloc for the mcast membership table. 2759 * This num_mcast_table_elems configuration parameter tells the target 2760 * how many peer elements it needs to provide storage for in its 2761 * multicast group membership table. These multicast group membership 2762 * table elements are shared by the multicast groups stored within 2763 * the table. 2764 */ 2765 __le32 num_mcast_table_elems; 2766 2767 /* Whether/how to do multicast->unicast conversion. 2768 * This configuration parameter specifies whether the target should 2769 * perform multicast --> unicast conversion on transmit, and if so, 2770 * what to do if it finds no entries in its multicast group membership 2771 * table for the multicast IP address in the tx frame. 2772 * Configuration value: 2773 * 0 -> Do not perform multicast to unicast conversion. 2774 * 1 -> Convert multicast frames to unicast, if the IP multicast address 2775 * from the tx frame is found in the multicast group membership 2776 * table. If the IP multicast address is not found, drop the frame 2777 * 2 -> Convert multicast frames to unicast, if the IP multicast address 2778 * from the tx frame is found in the multicast group membership 2779 * table. If the IP multicast address is not found, transmit the 2780 * frame as multicast. 2781 */ 2782 __le32 mcast2ucast_mode; 2783 2784 /* How much memory to allocate for a tx PPDU dbg log. 2785 * This parameter controls how much memory the target will allocate to 2786 * store a log of tx PPDU meta-information (how large the PPDU was, 2787 * when it was sent, whether it was successful, etc.) 2788 */ 2789 __le32 tx_dbg_log_size; 2790 2791 /* How many AST entries to be allocated for WDS */ 2792 __le32 num_wds_entries; 2793 2794 /* MAC DMA burst size. 0 -default, 1 -256B */ 2795 __le32 dma_burst_size; 2796 2797 /* Fixed delimiters to be inserted after every MPDU to account for 2798 * interface latency to avoid underrun. 2799 */ 2800 __le32 mac_aggr_delim; 2801 2802 /* Determine whether target is responsible for detecting duplicate 2803 * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering 2804 * is always performed on the target. 2805 * 2806 * 0: target responsible for frag timeout and dup checking 2807 * 1: host responsible for frag timeout and dup checking 2808 */ 2809 __le32 rx_skip_defrag_timeout_dup_detection_check; 2810 2811 /* Configuration for VoW : No of Video nodes to be supported and max 2812 * no of descriptors for each video link (node). 2813 */ 2814 __le32 vow_config; 2815 2816 /* Maximum vdev that could use gtk offload */ 2817 __le32 gtk_offload_max_vdev; 2818 2819 /* Number of msdu descriptors target should use */ 2820 __le32 num_msdu_desc; 2821 2822 /* Max number of tx fragments per MSDU. 2823 * This parameter controls the max number of tx fragments per MSDU. 2824 * This will passed by target as part of the WMI_SERVICE_READY event 2825 * and is overridden by the OS shim as required. 2826 */ 2827 __le32 max_frag_entries; 2828 2829 /* Max number of extended peer stats. 2830 * This parameter controls the max number of peers for which extended 2831 * statistics are supported by target 2832 */ 2833 __le32 max_peer_ext_stats; 2834 2835 /* Smart antenna capabilities information. 2836 * 1 - Smart antenna is enabled 2837 * 0 - Smart antenna is disabled 2838 * In future this can contain smart antenna specific capabilities. 2839 */ 2840 __le32 smart_ant_cap; 2841 2842 /* User can configure the buffers allocated for each AC (BE, BK, VI, VO) 2843 * during init. 2844 */ 2845 __le32 bk_minfree; 2846 __le32 be_minfree; 2847 __le32 vi_minfree; 2848 __le32 vo_minfree; 2849 2850 /* Rx batch mode capability. 2851 * 1 - Rx batch mode enabled 2852 * 0 - Rx batch mode disabled 2853 */ 2854 __le32 rx_batchmode; 2855 2856 /* Thermal throttling capability. 2857 * 1 - Capable of thermal throttling 2858 * 0 - Not capable of thermal throttling 2859 */ 2860 __le32 tt_support; 2861 2862 /* ATF configuration. 2863 * 1 - Enable ATF 2864 * 0 - Disable ATF 2865 */ 2866 __le32 atf_config; 2867 2868 /* Configure padding to manage IP header un-alignment 2869 * 1 - Enable padding 2870 * 0 - Disable padding 2871 */ 2872 __le32 iphdr_pad_config; 2873 2874 /* qwrap configuration (bits 15-0) 2875 * 1 - This is qwrap configuration 2876 * 0 - This is not qwrap 2877 * 2878 * Bits 31-16 is alloc_frag_desc_for_data_pkt (1 enables, 0 disables) 2879 * In order to get ack-RSSI reporting and to specify the tx-rate for 2880 * individual frames, this option must be enabled. This uses an extra 2881 * 4 bytes per tx-msdu descriptor, so don't enable it unless you need it. 2882 */ 2883 __le32 qwrap_config; 2884 } __packed; 2885 2886 enum wmi_coex_version { 2887 WMI_NO_COEX_VERSION_SUPPORT = 0, 2888 /* 3 wire coex support*/ 2889 WMI_COEX_VERSION_1 = 1, 2890 /* 2.5 wire coex support*/ 2891 WMI_COEX_VERSION_2 = 2, 2892 /* 2.5 wire coex with duty cycle support */ 2893 WMI_COEX_VERSION_3 = 3, 2894 /* 4 wire coex support*/ 2895 WMI_COEX_VERSION_4 = 4, 2896 }; 2897 2898 /** 2899 * enum wmi_10_4_feature_mask - WMI 10.4 feature enable/disable flags 2900 * @WMI_10_4_LTEU_SUPPORT: LTEU config 2901 * @WMI_10_4_COEX_GPIO_SUPPORT: COEX GPIO config 2902 * @WMI_10_4_AUX_RADIO_SPECTRAL_INTF: AUX Radio Enhancement for spectral scan 2903 * @WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF: AUX Radio Enhancement for chan load scan 2904 * @WMI_10_4_BSS_CHANNEL_INFO_64: BSS channel info stats 2905 * @WMI_10_4_PEER_STATS: Per station stats 2906 * @WMI_10_4_VDEV_STATS: Per vdev stats 2907 * @WMI_10_4_TDLS: Implicit TDLS support in firmware enable/disable 2908 * @WMI_10_4_TDLS_OFFCHAN: TDLS offchannel support enable/disable 2909 * @WMI_10_4_TDLS_UAPSD_BUFFER_STA: TDLS buffer sta support enable/disable 2910 * @WMI_10_4_TDLS_UAPSD_SLEEP_STA: TDLS sleep sta support enable/disable 2911 * @WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE: TDLS connection tracker in host 2912 * enable/disable 2913 * @WMI_10_4_TDLS_EXPLICIT_MODE_ONLY:Explicit TDLS mode enable/disable 2914 */ 2915 enum wmi_10_4_feature_mask { 2916 WMI_10_4_LTEU_SUPPORT = BIT(0), 2917 WMI_10_4_COEX_GPIO_SUPPORT = BIT(1), 2918 WMI_10_4_AUX_RADIO_SPECTRAL_INTF = BIT(2), 2919 WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF = BIT(3), 2920 WMI_10_4_BSS_CHANNEL_INFO_64 = BIT(4), 2921 WMI_10_4_PEER_STATS = BIT(5), 2922 WMI_10_4_VDEV_STATS = BIT(6), 2923 WMI_10_4_TDLS = BIT(7), 2924 WMI_10_4_TDLS_OFFCHAN = BIT(8), 2925 WMI_10_4_TDLS_UAPSD_BUFFER_STA = BIT(9), 2926 WMI_10_4_TDLS_UAPSD_SLEEP_STA = BIT(10), 2927 WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE = BIT(11), 2928 WMI_10_4_TDLS_EXPLICIT_MODE_ONLY = BIT(12), 2929 2930 }; 2931 2932 struct wmi_ext_resource_config_10_4_cmd { 2933 /* contains enum wmi_host_platform_type */ 2934 __le32 host_platform_config; 2935 /* see enum wmi_10_4_feature_mask */ 2936 __le32 fw_feature_bitmap; 2937 /* WLAN priority GPIO number */ 2938 __le32 wlan_gpio_priority; 2939 /* see enum wmi_coex_version */ 2940 __le32 coex_version; 2941 /* COEX GPIO config */ 2942 __le32 coex_gpio_pin1; 2943 __le32 coex_gpio_pin2; 2944 __le32 coex_gpio_pin3; 2945 /* number of vdevs allowed to perform tdls */ 2946 __le32 num_tdls_vdevs; 2947 /* number of peers to track per TDLS vdev */ 2948 __le32 num_tdls_conn_table_entries; 2949 /* number of tdls sleep sta supported */ 2950 __le32 max_tdls_concurrent_sleep_sta; 2951 /* number of tdls buffer sta supported */ 2952 __le32 max_tdls_concurrent_buffer_sta; 2953 }; 2954 2955 /* structure describing host memory chunk. */ 2956 struct host_memory_chunk { 2957 /* id of the request that is passed up in service ready */ 2958 __le32 req_id; 2959 /* the physical address the memory chunk */ 2960 __le32 ptr; 2961 /* size of the chunk */ 2962 __le32 size; 2963 } __packed; 2964 2965 struct wmi_host_mem_chunks { 2966 __le32 count; 2967 /* some fw revisions require at least 1 chunk regardless of count */ 2968 struct host_memory_chunk items[1]; 2969 } __packed; 2970 2971 struct wmi_init_cmd { 2972 struct wmi_resource_config resource_config; 2973 struct wmi_host_mem_chunks mem_chunks; 2974 } __packed; 2975 2976 /* _10x structure is from 10.X FW API */ 2977 struct wmi_init_cmd_10x { 2978 struct wmi_resource_config_10x resource_config; 2979 struct wmi_host_mem_chunks mem_chunks; 2980 } __packed; 2981 2982 struct wmi_init_cmd_10_2 { 2983 struct wmi_resource_config_10_2 resource_config; 2984 struct wmi_host_mem_chunks mem_chunks; 2985 } __packed; 2986 2987 struct wmi_init_cmd_10_4 { 2988 struct wmi_resource_config_10_4 resource_config; 2989 struct wmi_host_mem_chunks mem_chunks; 2990 } __packed; 2991 2992 struct wmi_chan_list_entry { 2993 __le16 freq; 2994 u8 phy_mode; /* valid for 10.2 only */ 2995 u8 reserved; 2996 } __packed; 2997 2998 /* TLV for channel list */ 2999 struct wmi_chan_list { 3000 __le32 tag; /* WMI_CHAN_LIST_TAG */ 3001 __le32 num_chan; 3002 struct wmi_chan_list_entry channel_list[0]; 3003 } __packed; 3004 3005 struct wmi_bssid_list { 3006 __le32 tag; /* WMI_BSSID_LIST_TAG */ 3007 __le32 num_bssid; 3008 struct wmi_mac_addr bssid_list[0]; 3009 } __packed; 3010 3011 struct wmi_ie_data { 3012 __le32 tag; /* WMI_IE_TAG */ 3013 __le32 ie_len; 3014 u8 ie_data[0]; 3015 } __packed; 3016 3017 struct wmi_ssid { 3018 __le32 ssid_len; 3019 u8 ssid[32]; 3020 } __packed; 3021 3022 struct wmi_ssid_list { 3023 __le32 tag; /* WMI_SSID_LIST_TAG */ 3024 __le32 num_ssids; 3025 struct wmi_ssid ssids[0]; 3026 } __packed; 3027 3028 /* prefix used by scan requestor ids on the host */ 3029 #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000 3030 3031 /* prefix used by scan request ids generated on the host */ 3032 /* host cycles through the lower 12 bits to generate ids */ 3033 #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000 3034 3035 #define WLAN_SCAN_PARAMS_MAX_SSID 16 3036 #define WLAN_SCAN_PARAMS_MAX_BSSID 4 3037 #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256 3038 3039 /* Values lower than this may be refused by some firmware revisions with a scan 3040 * completion with a timedout reason. 3041 */ 3042 #define WMI_SCAN_CHAN_MIN_TIME_MSEC 40 3043 3044 /* Scan priority numbers must be sequential, starting with 0 */ 3045 enum wmi_scan_priority { 3046 WMI_SCAN_PRIORITY_VERY_LOW = 0, 3047 WMI_SCAN_PRIORITY_LOW, 3048 WMI_SCAN_PRIORITY_MEDIUM, 3049 WMI_SCAN_PRIORITY_HIGH, 3050 WMI_SCAN_PRIORITY_VERY_HIGH, 3051 WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */ 3052 }; 3053 3054 struct wmi_start_scan_common { 3055 /* Scan ID */ 3056 __le32 scan_id; 3057 /* Scan requestor ID */ 3058 __le32 scan_req_id; 3059 /* VDEV id(interface) that is requesting scan */ 3060 __le32 vdev_id; 3061 /* Scan Priority, input to scan scheduler */ 3062 __le32 scan_priority; 3063 /* Scan events subscription */ 3064 __le32 notify_scan_events; 3065 /* dwell time in msec on active channels */ 3066 __le32 dwell_time_active; 3067 /* dwell time in msec on passive channels */ 3068 __le32 dwell_time_passive; 3069 /* 3070 * min time in msec on the BSS channel,only valid if atleast one 3071 * VDEV is active 3072 */ 3073 __le32 min_rest_time; 3074 /* 3075 * max rest time in msec on the BSS channel,only valid if at least 3076 * one VDEV is active 3077 */ 3078 /* 3079 * the scanner will rest on the bss channel at least min_rest_time 3080 * after min_rest_time the scanner will start checking for tx/rx 3081 * activity on all VDEVs. if there is no activity the scanner will 3082 * switch to off channel. if there is activity the scanner will let 3083 * the radio on the bss channel until max_rest_time expires.at 3084 * max_rest_time scanner will switch to off channel irrespective of 3085 * activity. activity is determined by the idle_time parameter. 3086 */ 3087 __le32 max_rest_time; 3088 /* 3089 * time before sending next set of probe requests. 3090 * The scanner keeps repeating probe requests transmission with 3091 * period specified by repeat_probe_time. 3092 * The number of probe requests specified depends on the ssid_list 3093 * and bssid_list 3094 */ 3095 __le32 repeat_probe_time; 3096 /* time in msec between 2 consequetive probe requests with in a set. */ 3097 __le32 probe_spacing_time; 3098 /* 3099 * data inactivity time in msec on bss channel that will be used by 3100 * scanner for measuring the inactivity. 3101 */ 3102 __le32 idle_time; 3103 /* maximum time in msec allowed for scan */ 3104 __le32 max_scan_time; 3105 /* 3106 * delay in msec before sending first probe request after switching 3107 * to a channel 3108 */ 3109 __le32 probe_delay; 3110 /* Scan control flags */ 3111 __le32 scan_ctrl_flags; 3112 } __packed; 3113 3114 struct wmi_start_scan_tlvs { 3115 /* TLV parameters. These includes channel list, ssid list, bssid list, 3116 * extra ies. 3117 */ 3118 u8 tlvs[0]; 3119 } __packed; 3120 3121 struct wmi_start_scan_cmd { 3122 struct wmi_start_scan_common common; 3123 __le32 burst_duration_ms; 3124 struct wmi_start_scan_tlvs tlvs; 3125 } __packed; 3126 3127 /* This is the definition from 10.X firmware branch */ 3128 struct wmi_10x_start_scan_cmd { 3129 struct wmi_start_scan_common common; 3130 struct wmi_start_scan_tlvs tlvs; 3131 } __packed; 3132 3133 struct wmi_ssid_arg { 3134 int len; 3135 const u8 *ssid; 3136 }; 3137 3138 struct wmi_bssid_arg { 3139 const u8 *bssid; 3140 }; 3141 3142 struct wmi_start_scan_arg { 3143 u32 scan_id; 3144 u32 scan_req_id; 3145 u32 vdev_id; 3146 u32 scan_priority; 3147 u32 notify_scan_events; 3148 u32 dwell_time_active; 3149 u32 dwell_time_passive; 3150 u32 min_rest_time; 3151 u32 max_rest_time; 3152 u32 repeat_probe_time; 3153 u32 probe_spacing_time; 3154 u32 idle_time; 3155 u32 max_scan_time; 3156 u32 probe_delay; 3157 u32 scan_ctrl_flags; 3158 u32 burst_duration_ms; 3159 3160 u32 ie_len; 3161 u32 n_channels; 3162 u32 n_ssids; 3163 u32 n_bssids; 3164 3165 u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN]; 3166 u16 channels[64]; 3167 struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID]; 3168 struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID]; 3169 }; 3170 3171 /* scan control flags */ 3172 3173 /* passively scan all channels including active channels */ 3174 #define WMI_SCAN_FLAG_PASSIVE 0x1 3175 /* add wild card ssid probe request even though ssid_list is specified. */ 3176 #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2 3177 /* add cck rates to rates/xrate ie for the generated probe request */ 3178 #define WMI_SCAN_ADD_CCK_RATES 0x4 3179 /* add ofdm rates to rates/xrate ie for the generated probe request */ 3180 #define WMI_SCAN_ADD_OFDM_RATES 0x8 3181 /* To enable indication of Chan load and Noise floor to host */ 3182 #define WMI_SCAN_CHAN_STAT_EVENT 0x10 3183 /* Filter Probe request frames */ 3184 #define WMI_SCAN_FILTER_PROBE_REQ 0x20 3185 /* When set, DFS channels will not be scanned */ 3186 #define WMI_SCAN_BYPASS_DFS_CHN 0x40 3187 /* Different FW scan engine may choose to bail out on errors. 3188 * Allow the driver to have influence over that. 3189 */ 3190 #define WMI_SCAN_CONTINUE_ON_ERROR 0x80 3191 3192 /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */ 3193 #define WMI_SCAN_CLASS_MASK 0xFF000000 3194 3195 enum wmi_stop_scan_type { 3196 WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */ 3197 WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */ 3198 WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */ 3199 }; 3200 3201 struct wmi_stop_scan_cmd { 3202 __le32 scan_req_id; 3203 __le32 scan_id; 3204 __le32 req_type; 3205 __le32 vdev_id; 3206 } __packed; 3207 3208 struct wmi_stop_scan_arg { 3209 u32 req_id; 3210 enum wmi_stop_scan_type req_type; 3211 union { 3212 u32 scan_id; 3213 u32 vdev_id; 3214 } u; 3215 }; 3216 3217 struct wmi_scan_chan_list_cmd { 3218 __le32 num_scan_chans; 3219 struct wmi_channel chan_info[0]; 3220 } __packed; 3221 3222 struct wmi_scan_chan_list_arg { 3223 u32 n_channels; 3224 struct wmi_channel_arg *channels; 3225 }; 3226 3227 enum wmi_bss_filter { 3228 WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */ 3229 WMI_BSS_FILTER_ALL, /* all beacons forwarded */ 3230 WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */ 3231 WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */ 3232 WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */ 3233 WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */ 3234 WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */ 3235 WMI_BSS_FILTER_LAST_BSS, /* marker only */ 3236 }; 3237 3238 enum wmi_scan_event_type { 3239 WMI_SCAN_EVENT_STARTED = BIT(0), 3240 WMI_SCAN_EVENT_COMPLETED = BIT(1), 3241 WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2), 3242 WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3), 3243 WMI_SCAN_EVENT_DEQUEUED = BIT(4), 3244 /* possibly by high-prio scan */ 3245 WMI_SCAN_EVENT_PREEMPTED = BIT(5), 3246 WMI_SCAN_EVENT_START_FAILED = BIT(6), 3247 WMI_SCAN_EVENT_RESTARTED = BIT(7), 3248 WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8), 3249 WMI_SCAN_EVENT_MAX = BIT(15), 3250 }; 3251 3252 enum wmi_scan_completion_reason { 3253 WMI_SCAN_REASON_COMPLETED, 3254 WMI_SCAN_REASON_CANCELLED, 3255 WMI_SCAN_REASON_PREEMPTED, 3256 WMI_SCAN_REASON_TIMEDOUT, 3257 WMI_SCAN_REASON_INTERNAL_FAILURE, 3258 WMI_SCAN_REASON_MAX, 3259 }; 3260 3261 struct wmi_scan_event { 3262 __le32 event_type; /* %WMI_SCAN_EVENT_ */ 3263 __le32 reason; /* %WMI_SCAN_REASON_ */ 3264 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */ 3265 __le32 scan_req_id; 3266 __le32 scan_id; 3267 __le32 vdev_id; 3268 } __packed; 3269 3270 /* 3271 * This defines how much headroom is kept in the 3272 * receive frame between the descriptor and the 3273 * payload, in order for the WMI PHY error and 3274 * management handler to insert header contents. 3275 * 3276 * This is in bytes. 3277 */ 3278 #define WMI_MGMT_RX_HDR_HEADROOM 52 3279 3280 /* 3281 * This event will be used for sending scan results 3282 * as well as rx mgmt frames to the host. The rx buffer 3283 * will be sent as part of this WMI event. It would be a 3284 * good idea to pass all the fields in the RX status 3285 * descriptor up to the host. 3286 */ 3287 struct wmi_mgmt_rx_hdr_v1 { 3288 __le32 channel; 3289 __le32 snr; 3290 __le32 rate; 3291 __le32 phy_mode; 3292 __le32 buf_len; 3293 __le32 status; /* %WMI_RX_STATUS_ */ 3294 } __packed; 3295 3296 struct wmi_mgmt_rx_hdr_v2 { 3297 struct wmi_mgmt_rx_hdr_v1 v1; 3298 __le32 rssi_ctl[4]; 3299 } __packed; 3300 3301 struct wmi_mgmt_rx_event_v1 { 3302 struct wmi_mgmt_rx_hdr_v1 hdr; 3303 u8 buf[0]; 3304 } __packed; 3305 3306 struct wmi_mgmt_rx_event_v2 { 3307 struct wmi_mgmt_rx_hdr_v2 hdr; 3308 u8 buf[0]; 3309 } __packed; 3310 3311 struct wmi_10_4_mgmt_rx_hdr { 3312 __le32 channel; 3313 __le32 snr; 3314 u8 rssi_ctl[4]; 3315 __le32 rate; 3316 __le32 phy_mode; 3317 __le32 buf_len; 3318 __le32 status; 3319 } __packed; 3320 3321 struct wmi_10_4_mgmt_rx_event { 3322 struct wmi_10_4_mgmt_rx_hdr hdr; 3323 u8 buf[0]; 3324 } __packed; 3325 3326 struct wmi_mgmt_rx_ext_info { 3327 __le64 rx_mac_timestamp; 3328 } __packed __aligned(4); 3329 3330 #define WMI_RX_STATUS_OK 0x00 3331 #define WMI_RX_STATUS_ERR_CRC 0x01 3332 #define WMI_RX_STATUS_ERR_DECRYPT 0x08 3333 #define WMI_RX_STATUS_ERR_MIC 0x10 3334 #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20 3335 /* Extension data at the end of mgmt frame */ 3336 #define WMI_RX_STATUS_EXT_INFO 0x40 3337 3338 #define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26 3339 #define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24 3340 #define PHY_ERROR_GEN_RADAR 0x05 3341 3342 #define PHY_ERROR_10_4_RADAR_MASK 0x4 3343 #define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000 3344 3345 enum phy_err_type { 3346 PHY_ERROR_UNKNOWN, 3347 PHY_ERROR_SPECTRAL_SCAN, 3348 PHY_ERROR_FALSE_RADAR_EXT, 3349 PHY_ERROR_RADAR 3350 }; 3351 3352 struct wmi_phyerr { 3353 __le32 tsf_timestamp; 3354 __le16 freq1; 3355 __le16 freq2; 3356 u8 rssi_combined; 3357 u8 chan_width_mhz; 3358 u8 phy_err_code; 3359 u8 rsvd0; 3360 __le32 rssi_chains[4]; 3361 __le16 nf_chains[4]; 3362 __le32 buf_len; 3363 u8 buf[0]; 3364 } __packed; 3365 3366 struct wmi_phyerr_event { 3367 __le32 num_phyerrs; 3368 __le32 tsf_l32; 3369 __le32 tsf_u32; 3370 struct wmi_phyerr phyerrs[0]; 3371 } __packed; 3372 3373 struct wmi_10_4_phyerr_event { 3374 __le32 tsf_l32; 3375 __le32 tsf_u32; 3376 __le16 freq1; 3377 __le16 freq2; 3378 u8 rssi_combined; 3379 u8 chan_width_mhz; 3380 u8 phy_err_code; 3381 u8 rsvd0; 3382 __le32 rssi_chains[4]; 3383 __le16 nf_chains[4]; 3384 __le32 phy_err_mask[2]; 3385 __le32 tsf_timestamp; 3386 __le32 buf_len; 3387 u8 buf[0]; 3388 } __packed; 3389 3390 #define PHYERR_TLV_SIG 0xBB 3391 #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB 3392 #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8 3393 #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9 3394 3395 struct phyerr_radar_report { 3396 __le32 reg0; /* RADAR_REPORT_REG0_* */ 3397 __le32 reg1; /* RADAR_REPORT_REG1_* */ 3398 } __packed; 3399 3400 #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000 3401 #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31 3402 3403 #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000 3404 #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30 3405 3406 #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000 3407 #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20 3408 3409 #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000 3410 #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16 3411 3412 #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00 3413 #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10 3414 3415 #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF 3416 #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0 3417 3418 #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000 3419 #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31 3420 3421 #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000 3422 #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24 3423 3424 #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000 3425 #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16 3426 3427 #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00 3428 #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8 3429 3430 #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF 3431 #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0 3432 3433 struct phyerr_fft_report { 3434 __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */ 3435 __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */ 3436 } __packed; 3437 3438 #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000 3439 #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23 3440 3441 #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000 3442 #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14 3443 3444 #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000 3445 #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12 3446 3447 #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF 3448 #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0 3449 3450 #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000 3451 #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26 3452 3453 #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000 3454 #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18 3455 3456 #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00 3457 #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8 3458 3459 #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF 3460 #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0 3461 3462 struct phyerr_tlv { 3463 __le16 len; 3464 u8 tag; 3465 u8 sig; 3466 } __packed; 3467 3468 #define DFS_RSSI_POSSIBLY_FALSE 50 3469 #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40 3470 3471 struct wmi_mgmt_tx_hdr { 3472 __le32 vdev_id; 3473 struct wmi_mac_addr peer_macaddr; 3474 __le32 tx_rate; 3475 __le32 tx_power; 3476 __le32 buf_len; 3477 } __packed; 3478 3479 struct wmi_mgmt_tx_cmd { 3480 struct wmi_mgmt_tx_hdr hdr; 3481 u8 buf[0]; 3482 } __packed; 3483 3484 struct wmi_echo_event { 3485 __le32 value; 3486 } __packed; 3487 3488 struct wmi_echo_cmd { 3489 __le32 value; 3490 } __packed; 3491 3492 struct wmi_pdev_set_regdomain_cmd { 3493 __le32 reg_domain; 3494 __le32 reg_domain_2G; 3495 __le32 reg_domain_5G; 3496 __le32 conformance_test_limit_2G; 3497 __le32 conformance_test_limit_5G; 3498 } __packed; 3499 3500 enum wmi_dfs_region { 3501 /* Uninitialized dfs domain */ 3502 WMI_UNINIT_DFS_DOMAIN = 0, 3503 3504 /* FCC3 dfs domain */ 3505 WMI_FCC_DFS_DOMAIN = 1, 3506 3507 /* ETSI dfs domain */ 3508 WMI_ETSI_DFS_DOMAIN = 2, 3509 3510 /*Japan dfs domain */ 3511 WMI_MKK4_DFS_DOMAIN = 3, 3512 }; 3513 3514 struct wmi_pdev_set_regdomain_cmd_10x { 3515 __le32 reg_domain; 3516 __le32 reg_domain_2G; 3517 __le32 reg_domain_5G; 3518 __le32 conformance_test_limit_2G; 3519 __le32 conformance_test_limit_5G; 3520 3521 /* dfs domain from wmi_dfs_region */ 3522 __le32 dfs_domain; 3523 } __packed; 3524 3525 /* Command to set/unset chip in quiet mode */ 3526 struct wmi_pdev_set_quiet_cmd { 3527 /* period in TUs */ 3528 __le32 period; 3529 3530 /* duration in TUs */ 3531 __le32 duration; 3532 3533 /* offset in TUs */ 3534 __le32 next_start; 3535 3536 /* enable/disable */ 3537 __le32 enabled; 3538 } __packed; 3539 3540 /* 3541 * 802.11g protection mode. 3542 */ 3543 enum ath10k_protmode { 3544 ATH10K_PROT_NONE = 0, /* no protection */ 3545 ATH10K_PROT_CTSONLY = 1, /* CTS to self */ 3546 ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */ 3547 }; 3548 3549 enum wmi_rtscts_profile { 3550 WMI_RTSCTS_FOR_NO_RATESERIES = 0, 3551 WMI_RTSCTS_FOR_SECOND_RATESERIES, 3552 WMI_RTSCTS_ACROSS_SW_RETRIES 3553 }; 3554 3555 #define WMI_RTSCTS_ENABLED 1 3556 #define WMI_RTSCTS_SET_MASK 0x0f 3557 #define WMI_RTSCTS_SET_LSB 0 3558 3559 #define WMI_RTSCTS_PROFILE_MASK 0xf0 3560 #define WMI_RTSCTS_PROFILE_LSB 4 3561 3562 enum wmi_beacon_gen_mode { 3563 WMI_BEACON_STAGGERED_MODE = 0, 3564 WMI_BEACON_BURST_MODE = 1 3565 }; 3566 3567 enum wmi_csa_event_ies_present_flag { 3568 WMI_CSA_IE_PRESENT = 0x00000001, 3569 WMI_XCSA_IE_PRESENT = 0x00000002, 3570 WMI_WBW_IE_PRESENT = 0x00000004, 3571 WMI_CSWARP_IE_PRESENT = 0x00000008, 3572 }; 3573 3574 /* wmi CSA receive event from beacon frame */ 3575 struct wmi_csa_event { 3576 __le32 i_fc_dur; 3577 /* Bit 0-15: FC */ 3578 /* Bit 16-31: DUR */ 3579 struct wmi_mac_addr i_addr1; 3580 struct wmi_mac_addr i_addr2; 3581 __le32 csa_ie[2]; 3582 __le32 xcsa_ie[2]; 3583 __le32 wb_ie[2]; 3584 __le32 cswarp_ie; 3585 __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */ 3586 } __packed; 3587 3588 /* the definition of different PDEV parameters */ 3589 #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500 3590 #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500 3591 #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500 3592 3593 struct wmi_pdev_param_map { 3594 u32 tx_chain_mask; 3595 u32 rx_chain_mask; 3596 u32 txpower_limit2g; 3597 u32 txpower_limit5g; 3598 u32 txpower_scale; 3599 u32 beacon_gen_mode; 3600 u32 beacon_tx_mode; 3601 u32 resmgr_offchan_mode; 3602 u32 protection_mode; 3603 u32 dynamic_bw; 3604 u32 non_agg_sw_retry_th; 3605 u32 agg_sw_retry_th; 3606 u32 sta_kickout_th; 3607 u32 ac_aggrsize_scaling; 3608 u32 ltr_enable; 3609 u32 ltr_ac_latency_be; 3610 u32 ltr_ac_latency_bk; 3611 u32 ltr_ac_latency_vi; 3612 u32 ltr_ac_latency_vo; 3613 u32 ltr_ac_latency_timeout; 3614 u32 ltr_sleep_override; 3615 u32 ltr_rx_override; 3616 u32 ltr_tx_activity_timeout; 3617 u32 l1ss_enable; 3618 u32 dsleep_enable; 3619 u32 pcielp_txbuf_flush; 3620 u32 pcielp_txbuf_watermark; 3621 u32 pcielp_txbuf_tmo_en; 3622 u32 pcielp_txbuf_tmo_value; 3623 u32 pdev_stats_update_period; 3624 u32 vdev_stats_update_period; 3625 u32 peer_stats_update_period; 3626 u32 bcnflt_stats_update_period; 3627 u32 pmf_qos; 3628 u32 arp_ac_override; 3629 u32 dcs; 3630 u32 ani_enable; 3631 u32 ani_poll_period; 3632 u32 ani_listen_period; 3633 u32 ani_ofdm_level; 3634 u32 ani_cck_level; 3635 u32 dyntxchain; 3636 u32 proxy_sta; 3637 u32 idle_ps_config; 3638 u32 power_gating_sleep; 3639 u32 fast_channel_reset; 3640 u32 burst_dur; 3641 u32 burst_enable; 3642 u32 cal_period; 3643 u32 aggr_burst; 3644 u32 rx_decap_mode; 3645 u32 smart_antenna_default_antenna; 3646 u32 igmpmld_override; 3647 u32 igmpmld_tid; 3648 u32 antenna_gain; 3649 u32 rx_filter; 3650 u32 set_mcast_to_ucast_tid; 3651 u32 proxy_sta_mode; 3652 u32 set_mcast2ucast_mode; 3653 u32 set_mcast2ucast_buffer; 3654 u32 remove_mcast2ucast_buffer; 3655 u32 peer_sta_ps_statechg_enable; 3656 u32 igmpmld_ac_override; 3657 u32 block_interbss; 3658 u32 set_disable_reset_cmdid; 3659 u32 set_msdu_ttl_cmdid; 3660 u32 set_ppdu_duration_cmdid; 3661 u32 txbf_sound_period_cmdid; 3662 u32 set_promisc_mode_cmdid; 3663 u32 set_burst_mode_cmdid; 3664 u32 en_stats; 3665 u32 mu_group_policy; 3666 u32 noise_detection; 3667 u32 noise_threshold; 3668 u32 dpd_enable; 3669 u32 set_mcast_bcast_echo; 3670 u32 atf_strict_sch; 3671 u32 atf_sched_duration; 3672 u32 ant_plzn; 3673 u32 mgmt_retry_limit; 3674 u32 sensitivity_level; 3675 u32 signed_txpower_2g; 3676 u32 signed_txpower_5g; 3677 u32 enable_per_tid_amsdu; 3678 u32 enable_per_tid_ampdu; 3679 u32 cca_threshold; 3680 u32 rts_fixed_rate; 3681 u32 pdev_reset; 3682 u32 wapi_mbssid_offset; 3683 u32 arp_srcaddr; 3684 u32 arp_dstaddr; 3685 u32 enable_btcoex; 3686 }; 3687 3688 #define WMI_PDEV_PARAM_UNSUPPORTED 0 3689 3690 enum wmi_pdev_param { 3691 /* TX chain mask */ 3692 WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1, 3693 /* RX chain mask */ 3694 WMI_PDEV_PARAM_RX_CHAIN_MASK, 3695 /* TX power limit for 2G Radio */ 3696 WMI_PDEV_PARAM_TXPOWER_LIMIT2G, 3697 /* TX power limit for 5G Radio */ 3698 WMI_PDEV_PARAM_TXPOWER_LIMIT5G, 3699 /* TX power scale */ 3700 WMI_PDEV_PARAM_TXPOWER_SCALE, 3701 /* Beacon generation mode . 0: host, 1: target */ 3702 WMI_PDEV_PARAM_BEACON_GEN_MODE, 3703 /* Beacon generation mode . 0: staggered 1: bursted */ 3704 WMI_PDEV_PARAM_BEACON_TX_MODE, 3705 /* 3706 * Resource manager off chan mode . 3707 * 0: turn off off chan mode. 1: turn on offchan mode 3708 */ 3709 WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE, 3710 /* 3711 * Protection mode: 3712 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS 3713 */ 3714 WMI_PDEV_PARAM_PROTECTION_MODE, 3715 /* 3716 * Dynamic bandwidth - 0: disable, 1: enable 3717 * 3718 * When enabled HW rate control tries different bandwidths when 3719 * retransmitting frames. 3720 */ 3721 WMI_PDEV_PARAM_DYNAMIC_BW, 3722 /* Non aggregrate/ 11g sw retry threshold.0-disable */ 3723 WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH, 3724 /* aggregrate sw retry threshold. 0-disable*/ 3725 WMI_PDEV_PARAM_AGG_SW_RETRY_TH, 3726 /* Station kickout threshold (non of consecutive failures).0-disable */ 3727 WMI_PDEV_PARAM_STA_KICKOUT_TH, 3728 /* Aggerate size scaling configuration per AC */ 3729 WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING, 3730 /* LTR enable */ 3731 WMI_PDEV_PARAM_LTR_ENABLE, 3732 /* LTR latency for BE, in us */ 3733 WMI_PDEV_PARAM_LTR_AC_LATENCY_BE, 3734 /* LTR latency for BK, in us */ 3735 WMI_PDEV_PARAM_LTR_AC_LATENCY_BK, 3736 /* LTR latency for VI, in us */ 3737 WMI_PDEV_PARAM_LTR_AC_LATENCY_VI, 3738 /* LTR latency for VO, in us */ 3739 WMI_PDEV_PARAM_LTR_AC_LATENCY_VO, 3740 /* LTR AC latency timeout, in ms */ 3741 WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT, 3742 /* LTR platform latency override, in us */ 3743 WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE, 3744 /* LTR-RX override, in us */ 3745 WMI_PDEV_PARAM_LTR_RX_OVERRIDE, 3746 /* Tx activity timeout for LTR, in us */ 3747 WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT, 3748 /* L1SS state machine enable */ 3749 WMI_PDEV_PARAM_L1SS_ENABLE, 3750 /* Deep sleep state machine enable */ 3751 WMI_PDEV_PARAM_DSLEEP_ENABLE, 3752 /* RX buffering flush enable */ 3753 WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH, 3754 /* RX buffering matermark */ 3755 WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK, 3756 /* RX buffering timeout enable */ 3757 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN, 3758 /* RX buffering timeout value */ 3759 WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE, 3760 /* pdev level stats update period in ms */ 3761 WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD, 3762 /* vdev level stats update period in ms */ 3763 WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD, 3764 /* peer level stats update period in ms */ 3765 WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD, 3766 /* beacon filter status update period */ 3767 WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD, 3768 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */ 3769 WMI_PDEV_PARAM_PMF_QOS, 3770 /* Access category on which ARP frames are sent */ 3771 WMI_PDEV_PARAM_ARP_AC_OVERRIDE, 3772 /* DCS configuration */ 3773 WMI_PDEV_PARAM_DCS, 3774 /* Enable/Disable ANI on target */ 3775 WMI_PDEV_PARAM_ANI_ENABLE, 3776 /* configure the ANI polling period */ 3777 WMI_PDEV_PARAM_ANI_POLL_PERIOD, 3778 /* configure the ANI listening period */ 3779 WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, 3780 /* configure OFDM immunity level */ 3781 WMI_PDEV_PARAM_ANI_OFDM_LEVEL, 3782 /* configure CCK immunity level */ 3783 WMI_PDEV_PARAM_ANI_CCK_LEVEL, 3784 /* Enable/Disable CDD for 1x1 STAs in rate control module */ 3785 WMI_PDEV_PARAM_DYNTXCHAIN, 3786 /* Enable/Disable proxy STA */ 3787 WMI_PDEV_PARAM_PROXY_STA, 3788 /* Enable/Disable low power state when all VDEVs are inactive/idle. */ 3789 WMI_PDEV_PARAM_IDLE_PS_CONFIG, 3790 /* Enable/Disable power gating sleep */ 3791 WMI_PDEV_PARAM_POWER_GATING_SLEEP, 3792 }; 3793 3794 enum wmi_10x_pdev_param { 3795 /* TX chian mask */ 3796 WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1, 3797 /* RX chian mask */ 3798 WMI_10X_PDEV_PARAM_RX_CHAIN_MASK, 3799 /* TX power limit for 2G Radio */ 3800 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G, 3801 /* TX power limit for 5G Radio */ 3802 WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G, 3803 /* TX power scale */ 3804 WMI_10X_PDEV_PARAM_TXPOWER_SCALE, 3805 /* Beacon generation mode . 0: host, 1: target */ 3806 WMI_10X_PDEV_PARAM_BEACON_GEN_MODE, 3807 /* Beacon generation mode . 0: staggered 1: bursted */ 3808 WMI_10X_PDEV_PARAM_BEACON_TX_MODE, 3809 /* 3810 * Resource manager off chan mode . 3811 * 0: turn off off chan mode. 1: turn on offchan mode 3812 */ 3813 WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE, 3814 /* 3815 * Protection mode: 3816 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS 3817 */ 3818 WMI_10X_PDEV_PARAM_PROTECTION_MODE, 3819 /* Dynamic bandwidth 0: disable 1: enable */ 3820 WMI_10X_PDEV_PARAM_DYNAMIC_BW, 3821 /* Non aggregrate/ 11g sw retry threshold.0-disable */ 3822 WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH, 3823 /* aggregrate sw retry threshold. 0-disable*/ 3824 WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH, 3825 /* Station kickout threshold (non of consecutive failures).0-disable */ 3826 WMI_10X_PDEV_PARAM_STA_KICKOUT_TH, 3827 /* Aggerate size scaling configuration per AC */ 3828 WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING, 3829 /* LTR enable */ 3830 WMI_10X_PDEV_PARAM_LTR_ENABLE, 3831 /* LTR latency for BE, in us */ 3832 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE, 3833 /* LTR latency for BK, in us */ 3834 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK, 3835 /* LTR latency for VI, in us */ 3836 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI, 3837 /* LTR latency for VO, in us */ 3838 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO, 3839 /* LTR AC latency timeout, in ms */ 3840 WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT, 3841 /* LTR platform latency override, in us */ 3842 WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE, 3843 /* LTR-RX override, in us */ 3844 WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE, 3845 /* Tx activity timeout for LTR, in us */ 3846 WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT, 3847 /* L1SS state machine enable */ 3848 WMI_10X_PDEV_PARAM_L1SS_ENABLE, 3849 /* Deep sleep state machine enable */ 3850 WMI_10X_PDEV_PARAM_DSLEEP_ENABLE, 3851 /* pdev level stats update period in ms */ 3852 WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD, 3853 /* vdev level stats update period in ms */ 3854 WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD, 3855 /* peer level stats update period in ms */ 3856 WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD, 3857 /* beacon filter status update period */ 3858 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD, 3859 /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */ 3860 WMI_10X_PDEV_PARAM_PMF_QOS, 3861 /* Access category on which ARP and DHCP frames are sent */ 3862 WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE, 3863 /* DCS configuration */ 3864 WMI_10X_PDEV_PARAM_DCS, 3865 /* Enable/Disable ANI on target */ 3866 WMI_10X_PDEV_PARAM_ANI_ENABLE, 3867 /* configure the ANI polling period */ 3868 WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD, 3869 /* configure the ANI listening period */ 3870 WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD, 3871 /* configure OFDM immunity level */ 3872 WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL, 3873 /* configure CCK immunity level */ 3874 WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL, 3875 /* Enable/Disable CDD for 1x1 STAs in rate control module */ 3876 WMI_10X_PDEV_PARAM_DYNTXCHAIN, 3877 /* Enable/Disable Fast channel reset*/ 3878 WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET, 3879 /* Set Bursting DUR */ 3880 WMI_10X_PDEV_PARAM_BURST_DUR, 3881 /* Set Bursting Enable*/ 3882 WMI_10X_PDEV_PARAM_BURST_ENABLE, 3883 3884 /* following are available as of firmware 10.2 */ 3885 WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA, 3886 WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE, 3887 WMI_10X_PDEV_PARAM_IGMPMLD_TID, 3888 WMI_10X_PDEV_PARAM_ANTENNA_GAIN, 3889 WMI_10X_PDEV_PARAM_RX_DECAP_MODE, 3890 WMI_10X_PDEV_PARAM_RX_FILTER, 3891 WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID, 3892 WMI_10X_PDEV_PARAM_PROXY_STA_MODE, 3893 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE, 3894 WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER, 3895 WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER, 3896 WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE, 3897 WMI_10X_PDEV_PARAM_RTS_FIXED_RATE, 3898 WMI_10X_PDEV_PARAM_CAL_PERIOD 3899 }; 3900 3901 enum wmi_10_4_pdev_param { 3902 WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1, 3903 WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK, 3904 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G, 3905 WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G, 3906 WMI_10_4_PDEV_PARAM_TXPOWER_SCALE, 3907 WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE, 3908 WMI_10_4_PDEV_PARAM_BEACON_TX_MODE, 3909 WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE, 3910 WMI_10_4_PDEV_PARAM_PROTECTION_MODE, 3911 WMI_10_4_PDEV_PARAM_DYNAMIC_BW, 3912 WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH, 3913 WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH, 3914 WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH, 3915 WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING, 3916 WMI_10_4_PDEV_PARAM_LTR_ENABLE, 3917 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE, 3918 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK, 3919 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI, 3920 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO, 3921 WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT, 3922 WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE, 3923 WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE, 3924 WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT, 3925 WMI_10_4_PDEV_PARAM_L1SS_ENABLE, 3926 WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE, 3927 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH, 3928 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK, 3929 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN, 3930 WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE, 3931 WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD, 3932 WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD, 3933 WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD, 3934 WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD, 3935 WMI_10_4_PDEV_PARAM_PMF_QOS, 3936 WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE, 3937 WMI_10_4_PDEV_PARAM_DCS, 3938 WMI_10_4_PDEV_PARAM_ANI_ENABLE, 3939 WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD, 3940 WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD, 3941 WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL, 3942 WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL, 3943 WMI_10_4_PDEV_PARAM_DYNTXCHAIN, 3944 WMI_10_4_PDEV_PARAM_PROXY_STA, 3945 WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG, 3946 WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP, 3947 WMI_10_4_PDEV_PARAM_AGGR_BURST, 3948 WMI_10_4_PDEV_PARAM_RX_DECAP_MODE, 3949 WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET, 3950 WMI_10_4_PDEV_PARAM_BURST_DUR, 3951 WMI_10_4_PDEV_PARAM_BURST_ENABLE, 3952 WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA, 3953 WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE, 3954 WMI_10_4_PDEV_PARAM_IGMPMLD_TID, 3955 WMI_10_4_PDEV_PARAM_ANTENNA_GAIN, 3956 WMI_10_4_PDEV_PARAM_RX_FILTER, 3957 WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID, 3958 WMI_10_4_PDEV_PARAM_PROXY_STA_MODE, 3959 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE, 3960 WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER, 3961 WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER, 3962 WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE, 3963 WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE, 3964 WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS, 3965 WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID, 3966 WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID, 3967 WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID, 3968 WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID, 3969 WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID, 3970 WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID, 3971 WMI_10_4_PDEV_PARAM_EN_STATS, 3972 WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY, 3973 WMI_10_4_PDEV_PARAM_NOISE_DETECTION, 3974 WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD, 3975 WMI_10_4_PDEV_PARAM_DPD_ENABLE, 3976 WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO, 3977 WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH, 3978 WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION, 3979 WMI_10_4_PDEV_PARAM_ANT_PLZN, 3980 WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT, 3981 WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL, 3982 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G, 3983 WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G, 3984 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU, 3985 WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU, 3986 WMI_10_4_PDEV_PARAM_CCA_THRESHOLD, 3987 WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE, 3988 WMI_10_4_PDEV_PARAM_CAL_PERIOD, 3989 WMI_10_4_PDEV_PARAM_PDEV_RESET, 3990 WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET, 3991 WMI_10_4_PDEV_PARAM_ARP_SRCADDR, 3992 WMI_10_4_PDEV_PARAM_ARP_DSTADDR, 3993 WMI_10_4_PDEV_PARAM_TXPOWER_DECR_DB, 3994 WMI_10_4_PDEV_PARAM_RX_BATCHMODE, 3995 WMI_10_4_PDEV_PARAM_PACKET_AGGR_DELAY, 3996 WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCH, 3997 WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCALING_FACTOR, 3998 WMI_10_4_PDEV_PARAM_CUST_TXPOWER_SCALE, 3999 WMI_10_4_PDEV_PARAM_ATF_DYNAMIC_ENABLE, 4000 WMI_10_4_PDEV_PARAM_ATF_SSID_GROUP_POLICY, 4001 WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX, 4002 }; 4003 4004 struct wmi_pdev_set_param_cmd { 4005 __le32 param_id; 4006 __le32 param_value; 4007 } __packed; 4008 4009 /* valid period is 1 ~ 60000ms, unit in millisecond */ 4010 #define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000 4011 4012 struct wmi_pdev_get_tpc_config_cmd { 4013 /* parameter */ 4014 __le32 param; 4015 } __packed; 4016 4017 #define WMI_TPC_CONFIG_PARAM 1 4018 #define WMI_TPC_RATE_MAX 160 4019 #define WMI_TPC_FINAL_RATE_MAX 240 4020 #define WMI_TPC_TX_N_CHAIN 4 4021 #define WMI_TPC_PREAM_TABLE_MAX 10 4022 #define WMI_TPC_FLAG 3 4023 #define WMI_TPC_BUF_SIZE 10 4024 #define WMI_TPC_BEAMFORMING 2 4025 4026 enum wmi_tpc_table_type { 4027 WMI_TPC_TABLE_TYPE_CDD = 0, 4028 WMI_TPC_TABLE_TYPE_STBC = 1, 4029 WMI_TPC_TABLE_TYPE_TXBF = 2, 4030 }; 4031 4032 enum wmi_tpc_config_event_flag { 4033 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1, 4034 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2, 4035 WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4, 4036 }; 4037 4038 struct wmi_pdev_tpc_config_event { 4039 __le32 reg_domain; 4040 __le32 chan_freq; 4041 __le32 phy_mode; 4042 __le32 twice_antenna_reduction; 4043 __le32 twice_max_rd_power; 4044 a_sle32 twice_antenna_gain; 4045 __le32 power_limit; 4046 __le32 rate_max; 4047 __le32 num_tx_chain; 4048 __le32 ctl; 4049 __le32 flags; 4050 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN]; 4051 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4052 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4053 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4054 u8 rates_array[WMI_TPC_RATE_MAX]; 4055 } __packed; 4056 4057 /* Transmit power scale factor. */ 4058 enum wmi_tp_scale { 4059 WMI_TP_SCALE_MAX = 0, /* no scaling (default) */ 4060 WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */ 4061 WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */ 4062 WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */ 4063 WMI_TP_SCALE_MIN = 4, /* min, but still on */ 4064 WMI_TP_SCALE_SIZE = 5, /* max num of enum */ 4065 }; 4066 4067 struct wmi_pdev_tpc_final_table_event { 4068 __le32 reg_domain; 4069 __le32 chan_freq; 4070 __le32 phy_mode; 4071 __le32 twice_antenna_reduction; 4072 __le32 twice_max_rd_power; 4073 a_sle32 twice_antenna_gain; 4074 __le32 power_limit; 4075 __le32 rate_max; 4076 __le32 num_tx_chain; 4077 __le32 ctl; 4078 __le32 flags; 4079 s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN]; 4080 s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4081 s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4082 s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN]; 4083 u8 rates_array[WMI_TPC_FINAL_RATE_MAX]; 4084 u8 ctl_power_table[WMI_TPC_BEAMFORMING][WMI_TPC_TX_N_CHAIN] 4085 [WMI_TPC_TX_N_CHAIN]; 4086 } __packed; 4087 4088 struct wmi_pdev_get_tpc_table_cmd { 4089 __le32 param; 4090 } __packed; 4091 4092 enum wmi_tpc_pream_2ghz { 4093 WMI_TPC_PREAM_2GHZ_CCK = 0, 4094 WMI_TPC_PREAM_2GHZ_OFDM, 4095 WMI_TPC_PREAM_2GHZ_HT20, 4096 WMI_TPC_PREAM_2GHZ_HT40, 4097 WMI_TPC_PREAM_2GHZ_VHT20, 4098 WMI_TPC_PREAM_2GHZ_VHT40, 4099 WMI_TPC_PREAM_2GHZ_VHT80, 4100 }; 4101 4102 enum wmi_tpc_pream_5ghz { 4103 WMI_TPC_PREAM_5GHZ_OFDM = 1, 4104 WMI_TPC_PREAM_5GHZ_HT20, 4105 WMI_TPC_PREAM_5GHZ_HT40, 4106 WMI_TPC_PREAM_5GHZ_VHT20, 4107 WMI_TPC_PREAM_5GHZ_VHT40, 4108 WMI_TPC_PREAM_5GHZ_VHT80, 4109 WMI_TPC_PREAM_5GHZ_HTCUP, 4110 }; 4111 4112 struct wmi_pdev_chanlist_update_event { 4113 /* number of channels */ 4114 __le32 num_chan; 4115 /* array of channels */ 4116 struct wmi_channel channel_list[1]; 4117 } __packed; 4118 4119 #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32) 4120 4121 struct wmi_debug_mesg_event { 4122 /* message buffer, NULL terminated */ 4123 char bufp[WMI_MAX_DEBUG_MESG]; 4124 } __packed; 4125 4126 enum { 4127 /* P2P device */ 4128 VDEV_SUBTYPE_P2PDEV = 0, 4129 /* P2P client */ 4130 VDEV_SUBTYPE_P2PCLI, 4131 /* P2P GO */ 4132 VDEV_SUBTYPE_P2PGO, 4133 /* BT3.0 HS */ 4134 VDEV_SUBTYPE_BT, 4135 }; 4136 4137 struct wmi_pdev_set_channel_cmd { 4138 /* idnore power , only use flags , mode and freq */ 4139 struct wmi_channel chan; 4140 } __packed; 4141 4142 struct wmi_pdev_pktlog_enable_cmd { 4143 __le32 ev_bitmap; 4144 } __packed; 4145 4146 /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */ 4147 #define WMI_DSCP_MAP_MAX (64) 4148 struct wmi_pdev_set_dscp_tid_map_cmd { 4149 /* map indicating DSCP to TID conversion */ 4150 __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX]; 4151 } __packed; 4152 4153 enum mcast_bcast_rate_id { 4154 WMI_SET_MCAST_RATE, 4155 WMI_SET_BCAST_RATE 4156 }; 4157 4158 struct mcast_bcast_rate { 4159 enum mcast_bcast_rate_id rate_id; 4160 __le32 rate; 4161 } __packed; 4162 4163 struct wmi_wmm_params { 4164 __le32 cwmin; 4165 __le32 cwmax; 4166 __le32 aifs; 4167 __le32 txop; 4168 __le32 acm; 4169 __le32 no_ack; 4170 } __packed; 4171 4172 struct wmi_pdev_set_wmm_params { 4173 struct wmi_wmm_params ac_be; 4174 struct wmi_wmm_params ac_bk; 4175 struct wmi_wmm_params ac_vi; 4176 struct wmi_wmm_params ac_vo; 4177 } __packed; 4178 4179 struct wmi_wmm_params_arg { 4180 u32 cwmin; 4181 u32 cwmax; 4182 u32 aifs; 4183 u32 txop; 4184 u32 acm; 4185 u32 no_ack; 4186 }; 4187 4188 struct wmi_wmm_params_all_arg { 4189 struct wmi_wmm_params_arg ac_be; 4190 struct wmi_wmm_params_arg ac_bk; 4191 struct wmi_wmm_params_arg ac_vi; 4192 struct wmi_wmm_params_arg ac_vo; 4193 }; 4194 4195 struct wmi_pdev_stats_tx { 4196 /* Num HTT cookies queued to dispatch list */ 4197 __le32 comp_queued; 4198 4199 /* Num HTT cookies dispatched */ 4200 __le32 comp_delivered; 4201 4202 /* Num MSDU queued to WAL */ 4203 __le32 msdu_enqued; 4204 4205 /* Num MPDU queue to WAL */ 4206 __le32 mpdu_enqued; 4207 4208 /* Num MSDUs dropped by WMM limit */ 4209 __le32 wmm_drop; 4210 4211 /* Num Local frames queued */ 4212 __le32 local_enqued; 4213 4214 /* Num Local frames done */ 4215 __le32 local_freed; 4216 4217 /* Num queued to HW */ 4218 __le32 hw_queued; 4219 4220 /* Num PPDU reaped from HW */ 4221 __le32 hw_reaped; 4222 4223 /* Num underruns */ 4224 __le32 underrun; 4225 4226 /* Num PPDUs cleaned up in TX abort */ 4227 __le32 tx_abort; 4228 4229 /* Num MPDUs requed by SW */ 4230 __le32 mpdus_requed; 4231 4232 /* excessive retries */ 4233 __le32 tx_ko; 4234 4235 /* data hw rate code */ 4236 __le32 data_rc; 4237 4238 /* Scheduler self triggers */ 4239 __le32 self_triggers; 4240 4241 /* frames dropped due to excessive sw retries */ 4242 __le32 sw_retry_failure; 4243 4244 /* illegal rate phy errors */ 4245 __le32 illgl_rate_phy_err; 4246 4247 /* wal pdev continuous xretry */ 4248 __le32 pdev_cont_xretry; 4249 4250 /* wal pdev continous xretry */ 4251 __le32 pdev_tx_timeout; 4252 4253 /* wal pdev resets */ 4254 __le32 pdev_resets; 4255 4256 /* frames dropped due to non-availability of stateless TIDs */ 4257 __le32 stateless_tid_alloc_failure; 4258 4259 __le32 phy_underrun; 4260 4261 /* MPDU is more than txop limit */ 4262 __le32 txop_ovf; 4263 } __packed; 4264 4265 struct wmi_10_4_pdev_stats_tx { 4266 /* Num HTT cookies queued to dispatch list */ 4267 __le32 comp_queued; 4268 4269 /* Num HTT cookies dispatched */ 4270 __le32 comp_delivered; 4271 4272 /* Num MSDU queued to WAL */ 4273 __le32 msdu_enqued; 4274 4275 /* Num MPDU queue to WAL */ 4276 __le32 mpdu_enqued; 4277 4278 /* Num MSDUs dropped by WMM limit */ 4279 __le32 wmm_drop; 4280 4281 /* Num Local frames queued */ 4282 __le32 local_enqued; 4283 4284 /* Num Local frames done */ 4285 __le32 local_freed; 4286 4287 /* Num queued to HW */ 4288 __le32 hw_queued; 4289 4290 /* Num PPDU reaped from HW */ 4291 __le32 hw_reaped; 4292 4293 /* Num underruns */ 4294 __le32 underrun; 4295 4296 /* HW Paused. */ 4297 __le32 hw_paused; 4298 4299 /* Num PPDUs cleaned up in TX abort */ 4300 __le32 tx_abort; 4301 4302 /* Num MPDUs requed by SW */ 4303 __le32 mpdus_requed; 4304 4305 /* excessive retries */ 4306 __le32 tx_ko; 4307 4308 /* data hw rate code */ 4309 __le32 data_rc; 4310 4311 /* Scheduler self triggers */ 4312 __le32 self_triggers; 4313 4314 /* frames dropped due to excessive sw retries */ 4315 __le32 sw_retry_failure; 4316 4317 /* illegal rate phy errors */ 4318 __le32 illgl_rate_phy_err; 4319 4320 /* wal pdev continuous xretry */ 4321 __le32 pdev_cont_xretry; 4322 4323 /* wal pdev tx timeouts */ 4324 __le32 pdev_tx_timeout; 4325 4326 /* wal pdev resets */ 4327 __le32 pdev_resets; 4328 4329 /* frames dropped due to non-availability of stateless TIDs */ 4330 __le32 stateless_tid_alloc_failure; 4331 4332 __le32 phy_underrun; 4333 4334 /* MPDU is more than txop limit */ 4335 __le32 txop_ovf; 4336 4337 /* Number of Sequences posted */ 4338 __le32 seq_posted; 4339 4340 /* Number of Sequences failed queueing */ 4341 __le32 seq_failed_queueing; 4342 4343 /* Number of Sequences completed */ 4344 __le32 seq_completed; 4345 4346 /* Number of Sequences restarted */ 4347 __le32 seq_restarted; 4348 4349 /* Number of MU Sequences posted */ 4350 __le32 mu_seq_posted; 4351 4352 /* Num MPDUs flushed by SW, HWPAUSED,SW TXABORT(Reset,channel change) */ 4353 __le32 mpdus_sw_flush; 4354 4355 /* Num MPDUs filtered by HW, all filter condition (TTL expired) */ 4356 __le32 mpdus_hw_filter; 4357 4358 /* Num MPDUs truncated by PDG 4359 * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) 4360 */ 4361 __le32 mpdus_truncated; 4362 4363 /* Num MPDUs that was tried but didn't receive ACK or BA */ 4364 __le32 mpdus_ack_failed; 4365 4366 /* Num MPDUs that was dropped due to expiry. */ 4367 __le32 mpdus_expired; 4368 } __packed; 4369 4370 struct wmi_pdev_stats_rx { 4371 /* Cnts any change in ring routing mid-ppdu */ 4372 __le32 mid_ppdu_route_change; 4373 4374 /* Total number of statuses processed */ 4375 __le32 status_rcvd; 4376 4377 /* Extra frags on rings 0-3 */ 4378 __le32 r0_frags; 4379 __le32 r1_frags; 4380 __le32 r2_frags; 4381 __le32 r3_frags; 4382 4383 /* MSDUs / MPDUs delivered to HTT */ 4384 __le32 htt_msdus; 4385 __le32 htt_mpdus; 4386 4387 /* MSDUs / MPDUs delivered to local stack */ 4388 __le32 loc_msdus; 4389 __le32 loc_mpdus; 4390 4391 /* AMSDUs that have more MSDUs than the status ring size */ 4392 __le32 oversize_amsdu; 4393 4394 /* Number of PHY errors */ 4395 __le32 phy_errs; 4396 4397 /* Number of PHY errors drops */ 4398 __le32 phy_err_drop; 4399 4400 /* Number of mpdu errors - FCS, MIC, ENC etc. */ 4401 __le32 mpdu_errs; 4402 } __packed; 4403 4404 struct wmi_pdev_stats_peer { 4405 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */ 4406 __le32 dummy; 4407 } __packed; 4408 4409 enum wmi_stats_id { 4410 WMI_STAT_PEER = BIT(0), 4411 WMI_STAT_AP = BIT(1), 4412 WMI_STAT_PDEV = BIT(2), 4413 WMI_STAT_VDEV = BIT(3), 4414 WMI_STAT_BCNFLT = BIT(4), 4415 WMI_STAT_VDEV_RATE = BIT(5), 4416 }; 4417 4418 enum wmi_10_4_stats_id { 4419 WMI_10_4_STAT_PEER = BIT(0), 4420 WMI_10_4_STAT_AP = BIT(1), 4421 WMI_10_4_STAT_INST = BIT(2), 4422 WMI_10_4_STAT_PEER_EXTD = BIT(3), 4423 WMI_10_4_STAT_VDEV_EXTD = BIT(4), 4424 }; 4425 4426 struct wlan_inst_rssi_args { 4427 __le16 cfg_retry_count; 4428 __le16 retry_count; 4429 }; 4430 4431 struct wmi_request_stats_cmd { 4432 __le32 stats_id; 4433 4434 __le32 vdev_id; 4435 4436 /* peer MAC address */ 4437 struct wmi_mac_addr peer_macaddr; 4438 4439 /* Instantaneous RSSI arguments */ 4440 struct wlan_inst_rssi_args inst_rssi_args; 4441 } __packed; 4442 4443 /* Suspend option */ 4444 enum { 4445 /* suspend */ 4446 WMI_PDEV_SUSPEND, 4447 4448 /* suspend and disable all interrupts */ 4449 WMI_PDEV_SUSPEND_AND_DISABLE_INTR, 4450 }; 4451 4452 struct wmi_pdev_suspend_cmd { 4453 /* suspend option sent to target */ 4454 __le32 suspend_opt; 4455 } __packed; 4456 4457 struct wmi_stats_event { 4458 __le32 stats_id; /* WMI_STAT_ */ 4459 /* 4460 * number of pdev stats event structures 4461 * (wmi_pdev_stats) 0 or 1 4462 */ 4463 __le32 num_pdev_stats; 4464 /* 4465 * number of vdev stats event structures 4466 * (wmi_vdev_stats) 0 or max vdevs 4467 */ 4468 __le32 num_vdev_stats; 4469 /* 4470 * number of peer stats event structures 4471 * (wmi_peer_stats) 0 or max peers 4472 */ 4473 __le32 num_peer_stats; 4474 __le32 num_bcnflt_stats; 4475 /* 4476 * followed by 4477 * num_pdev_stats * size of(struct wmi_pdev_stats) 4478 * num_vdev_stats * size of(struct wmi_vdev_stats) 4479 * num_peer_stats * size of(struct wmi_peer_stats) 4480 * 4481 * By having a zero sized array, the pointer to data area 4482 * becomes available without increasing the struct size 4483 */ 4484 u8 data[0]; 4485 } __packed; 4486 4487 struct wmi_10_2_stats_event { 4488 __le32 stats_id; /* %WMI_REQUEST_ */ 4489 __le32 num_pdev_stats; 4490 __le32 num_pdev_ext_stats; 4491 __le32 num_vdev_stats; 4492 __le32 num_peer_stats; 4493 __le32 num_bcnflt_stats; 4494 u8 data[0]; 4495 } __packed; 4496 4497 /* 4498 * PDEV statistics 4499 * TODO: add all PDEV stats here 4500 */ 4501 struct wmi_pdev_stats_base { 4502 __le32 chan_nf; 4503 __le32 tx_frame_count; /* Cycles spent transmitting frames */ 4504 __le32 rx_frame_count; /* Cycles spent receiving frames */ 4505 __le32 rx_clear_count; /* Total channel busy time, evidently */ 4506 __le32 cycle_count; /* Total on-channel time */ 4507 __le32 phy_err_count; 4508 __le32 chan_tx_pwr; 4509 } __packed; 4510 4511 struct wmi_pdev_stats { 4512 struct wmi_pdev_stats_base base; 4513 struct wmi_pdev_stats_tx tx; 4514 struct wmi_pdev_stats_rx rx; 4515 struct wmi_pdev_stats_peer peer; 4516 } __packed; 4517 4518 struct wmi_pdev_stats_extra { 4519 __le32 ack_rx_bad; 4520 __le32 rts_bad; 4521 __le32 rts_good; 4522 __le32 fcs_bad; 4523 __le32 no_beacons; 4524 __le32 mib_int_count; 4525 } __packed; 4526 4527 struct wmi_10x_pdev_stats { 4528 struct wmi_pdev_stats_base base; 4529 struct wmi_pdev_stats_tx tx; 4530 struct wmi_pdev_stats_rx rx; 4531 struct wmi_pdev_stats_peer peer; 4532 struct wmi_pdev_stats_extra extra; 4533 } __packed; 4534 4535 struct wmi_pdev_stats_mem { 4536 __le32 dram_free; 4537 __le32 iram_free; 4538 } __packed; 4539 4540 struct wmi_10_2_pdev_stats { 4541 struct wmi_pdev_stats_base base; 4542 struct wmi_pdev_stats_tx tx; 4543 __le32 mc_drop; 4544 struct wmi_pdev_stats_rx rx; 4545 __le32 pdev_rx_timeout; 4546 struct wmi_pdev_stats_mem mem; 4547 struct wmi_pdev_stats_peer peer; 4548 struct wmi_pdev_stats_extra extra; 4549 } __packed; 4550 4551 struct wmi_10_4_pdev_stats { 4552 struct wmi_pdev_stats_base base; 4553 struct wmi_10_4_pdev_stats_tx tx; 4554 struct wmi_pdev_stats_rx rx; 4555 __le32 rx_ovfl_errs; 4556 struct wmi_pdev_stats_mem mem; 4557 __le32 sram_free_size; 4558 struct wmi_pdev_stats_extra extra; 4559 } __packed; 4560 4561 /* 4562 * VDEV statistics 4563 */ 4564 4565 #define WMI_VDEV_STATS_FTM_COUNT_VALID BIT(31) 4566 #define WMI_VDEV_STATS_FTM_COUNT_LSB 0 4567 #define WMI_VDEV_STATS_FTM_COUNT_MASK 0x7fffffff 4568 4569 struct wmi_vdev_stats { 4570 __le32 vdev_id; 4571 } __packed; 4572 4573 struct wmi_vdev_stats_extd { 4574 __le32 vdev_id; 4575 __le32 ppdu_aggr_cnt; 4576 __le32 ppdu_noack; 4577 __le32 mpdu_queued; 4578 __le32 ppdu_nonaggr_cnt; 4579 __le32 mpdu_sw_requeued; 4580 __le32 mpdu_suc_retry; 4581 __le32 mpdu_suc_multitry; 4582 __le32 mpdu_fail_retry; 4583 __le32 tx_ftm_suc; 4584 __le32 tx_ftm_suc_retry; 4585 __le32 tx_ftm_fail; 4586 __le32 rx_ftmr_cnt; 4587 __le32 rx_ftmr_dup_cnt; 4588 __le32 rx_iftmr_cnt; 4589 __le32 rx_iftmr_dup_cnt; 4590 __le32 reserved[6]; 4591 } __packed; 4592 4593 /* 4594 * peer statistics. 4595 * TODO: add more stats 4596 */ 4597 struct wmi_peer_stats { 4598 struct wmi_mac_addr peer_macaddr; 4599 __le32 peer_rssi; 4600 __le32 peer_tx_rate; 4601 } __packed; 4602 4603 struct wmi_10x_peer_stats { 4604 struct wmi_peer_stats old; 4605 __le32 peer_rx_rate; 4606 } __packed; 4607 4608 struct wmi_10_2_peer_stats { 4609 struct wmi_peer_stats old; 4610 __le32 peer_rx_rate; 4611 __le32 current_per; 4612 __le32 retries; 4613 __le32 tx_rate_count; 4614 __le32 max_4ms_frame_len; 4615 __le32 total_sub_frames; 4616 __le32 tx_bytes; 4617 __le32 num_pkt_loss_overflow[4]; 4618 __le32 num_pkt_loss_excess_retry[4]; 4619 } __packed; 4620 4621 struct wmi_10_2_4_peer_stats { 4622 struct wmi_10_2_peer_stats common; 4623 __le32 peer_rssi_changed; 4624 } __packed; 4625 4626 struct wmi_10_2_4_ext_peer_stats { 4627 struct wmi_10_2_peer_stats common; 4628 __le32 peer_rssi_changed; 4629 __le32 rx_duration; 4630 } __packed; 4631 4632 struct wmi_10_4_peer_stats { 4633 struct wmi_mac_addr peer_macaddr; 4634 __le32 peer_rssi; 4635 __le32 peer_rssi_seq_num; 4636 __le32 peer_tx_rate; 4637 __le32 peer_rx_rate; 4638 __le32 current_per; 4639 __le32 retries; 4640 __le32 tx_rate_count; 4641 __le32 max_4ms_frame_len; 4642 __le32 total_sub_frames; 4643 __le32 tx_bytes; 4644 __le32 num_pkt_loss_overflow[4]; 4645 __le32 num_pkt_loss_excess_retry[4]; 4646 __le32 peer_rssi_changed; 4647 } __packed; 4648 4649 struct wmi_10_4_peer_extd_stats { 4650 struct wmi_mac_addr peer_macaddr; 4651 __le32 inactive_time; 4652 __le32 peer_chain_rssi; 4653 __le32 rx_duration; 4654 __le32 reserved[10]; 4655 } __packed; 4656 4657 struct wmi_10_4_bss_bcn_stats { 4658 __le32 vdev_id; 4659 __le32 bss_bcns_dropped; 4660 __le32 bss_bcn_delivered; 4661 } __packed; 4662 4663 struct wmi_10_4_bss_bcn_filter_stats { 4664 __le32 bcns_dropped; 4665 __le32 bcns_delivered; 4666 __le32 active_filters; 4667 struct wmi_10_4_bss_bcn_stats bss_stats; 4668 } __packed; 4669 4670 struct wmi_10_2_pdev_ext_stats { 4671 __le32 rx_rssi_comb; 4672 __le32 rx_rssi[4]; 4673 __le32 rx_mcs[10]; 4674 __le32 tx_mcs[10]; 4675 __le32 ack_rssi; 4676 } __packed; 4677 4678 struct wmi_vdev_create_cmd { 4679 __le32 vdev_id; 4680 __le32 vdev_type; 4681 __le32 vdev_subtype; 4682 struct wmi_mac_addr vdev_macaddr; 4683 } __packed; 4684 4685 enum wmi_vdev_type { 4686 WMI_VDEV_TYPE_AP = 1, 4687 WMI_VDEV_TYPE_STA = 2, 4688 WMI_VDEV_TYPE_IBSS = 3, 4689 WMI_VDEV_TYPE_MONITOR = 4, 4690 }; 4691 4692 enum wmi_vdev_subtype { 4693 WMI_VDEV_SUBTYPE_NONE, 4694 WMI_VDEV_SUBTYPE_P2P_DEVICE, 4695 WMI_VDEV_SUBTYPE_P2P_CLIENT, 4696 WMI_VDEV_SUBTYPE_P2P_GO, 4697 WMI_VDEV_SUBTYPE_PROXY_STA, 4698 WMI_VDEV_SUBTYPE_MESH_11S, 4699 WMI_VDEV_SUBTYPE_MESH_NON_11S, 4700 }; 4701 4702 enum wmi_vdev_subtype_legacy { 4703 WMI_VDEV_SUBTYPE_LEGACY_NONE = 0, 4704 WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV = 1, 4705 WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI = 2, 4706 WMI_VDEV_SUBTYPE_LEGACY_P2P_GO = 3, 4707 WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA = 4, 4708 }; 4709 4710 enum wmi_vdev_subtype_10_2_4 { 4711 WMI_VDEV_SUBTYPE_10_2_4_NONE = 0, 4712 WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV = 1, 4713 WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI = 2, 4714 WMI_VDEV_SUBTYPE_10_2_4_P2P_GO = 3, 4715 WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA = 4, 4716 WMI_VDEV_SUBTYPE_10_2_4_MESH_11S = 5, 4717 }; 4718 4719 enum wmi_vdev_subtype_10_4 { 4720 WMI_VDEV_SUBTYPE_10_4_NONE = 0, 4721 WMI_VDEV_SUBTYPE_10_4_P2P_DEV = 1, 4722 WMI_VDEV_SUBTYPE_10_4_P2P_CLI = 2, 4723 WMI_VDEV_SUBTYPE_10_4_P2P_GO = 3, 4724 WMI_VDEV_SUBTYPE_10_4_PROXY_STA = 4, 4725 WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S = 5, 4726 WMI_VDEV_SUBTYPE_10_4_MESH_11S = 6, 4727 }; 4728 4729 /* values for vdev_subtype */ 4730 4731 /* values for vdev_start_request flags */ 4732 /* 4733 * Indicates that AP VDEV uses hidden ssid. only valid for 4734 * AP/GO 4735 */ 4736 #define WMI_VDEV_START_HIDDEN_SSID (1 << 0) 4737 /* 4738 * Indicates if robust management frame/management frame 4739 * protection is enabled. For GO/AP vdevs, it indicates that 4740 * it may support station/client associations with RMF enabled. 4741 * For STA/client vdevs, it indicates that sta will 4742 * associate with AP with RMF enabled. 4743 */ 4744 #define WMI_VDEV_START_PMF_ENABLED (1 << 1) 4745 4746 struct wmi_p2p_noa_descriptor { 4747 __le32 type_count; /* 255: continuous schedule, 0: reserved */ 4748 __le32 duration; /* Absent period duration in micro seconds */ 4749 __le32 interval; /* Absent period interval in micro seconds */ 4750 __le32 start_time; /* 32 bit tsf time when in starts */ 4751 } __packed; 4752 4753 struct wmi_vdev_start_request_cmd { 4754 /* WMI channel */ 4755 struct wmi_channel chan; 4756 /* unique id identifying the VDEV, generated by the caller */ 4757 __le32 vdev_id; 4758 /* requestor id identifying the caller module */ 4759 __le32 requestor_id; 4760 /* beacon interval from received beacon */ 4761 __le32 beacon_interval; 4762 /* DTIM Period from the received beacon */ 4763 __le32 dtim_period; 4764 /* Flags */ 4765 __le32 flags; 4766 /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */ 4767 struct wmi_ssid ssid; 4768 /* beacon/probe response xmit rate. Applicable for SoftAP. */ 4769 __le32 bcn_tx_rate; 4770 /* beacon/probe response xmit power. Applicable for SoftAP. */ 4771 __le32 bcn_tx_power; 4772 /* number of p2p NOA descriptor(s) from scan entry */ 4773 __le32 num_noa_descriptors; 4774 /* 4775 * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID. 4776 * During CAC, Our HW shouldn't ack ditected frames 4777 */ 4778 __le32 disable_hw_ack; 4779 /* actual p2p NOA descriptor from scan entry */ 4780 struct wmi_p2p_noa_descriptor noa_descriptors[2]; 4781 } __packed; 4782 4783 struct wmi_vdev_restart_request_cmd { 4784 struct wmi_vdev_start_request_cmd vdev_start_request_cmd; 4785 } __packed; 4786 4787 struct wmi_vdev_start_request_arg { 4788 u32 vdev_id; 4789 struct wmi_channel_arg channel; 4790 u32 bcn_intval; 4791 u32 dtim_period; 4792 u8 *ssid; 4793 u32 ssid_len; 4794 u32 bcn_tx_rate; 4795 u32 bcn_tx_power; 4796 bool disable_hw_ack; 4797 bool hidden_ssid; 4798 bool pmf_enabled; 4799 }; 4800 4801 struct wmi_vdev_delete_cmd { 4802 /* unique id identifying the VDEV, generated by the caller */ 4803 __le32 vdev_id; 4804 } __packed; 4805 4806 struct wmi_vdev_up_cmd { 4807 __le32 vdev_id; 4808 __le32 vdev_assoc_id; 4809 struct wmi_mac_addr vdev_bssid; 4810 } __packed; 4811 4812 struct wmi_vdev_stop_cmd { 4813 __le32 vdev_id; 4814 } __packed; 4815 4816 struct wmi_vdev_down_cmd { 4817 __le32 vdev_id; 4818 } __packed; 4819 4820 struct wmi_vdev_standby_response_cmd { 4821 /* unique id identifying the VDEV, generated by the caller */ 4822 __le32 vdev_id; 4823 } __packed; 4824 4825 struct wmi_vdev_resume_response_cmd { 4826 /* unique id identifying the VDEV, generated by the caller */ 4827 __le32 vdev_id; 4828 } __packed; 4829 4830 struct wmi_vdev_set_param_cmd { 4831 __le32 vdev_id; 4832 __le32 param_id; 4833 __le32 param_value; 4834 } __packed; 4835 4836 #define WMI_MAX_KEY_INDEX 3 4837 #define WMI_MAX_KEY_LEN 32 4838 4839 #define WMI_KEY_PAIRWISE 0x00 4840 #define WMI_KEY_GROUP 0x01 4841 #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */ 4842 4843 struct wmi_key_seq_counter { 4844 __le32 key_seq_counter_l; 4845 __le32 key_seq_counter_h; 4846 } __packed; 4847 4848 #define WMI_CIPHER_NONE 0x0 /* clear key */ 4849 #define WMI_CIPHER_WEP 0x1 4850 #define WMI_CIPHER_TKIP 0x2 4851 #define WMI_CIPHER_AES_OCB 0x3 4852 #define WMI_CIPHER_AES_CCM 0x4 4853 #define WMI_CIPHER_WAPI 0x5 4854 #define WMI_CIPHER_CKIP 0x6 4855 #define WMI_CIPHER_AES_CMAC 0x7 4856 #define WMI_CIPHER_AES_GCM 0x8 4857 4858 struct wmi_vdev_install_key_cmd { 4859 __le32 vdev_id; 4860 struct wmi_mac_addr peer_macaddr; 4861 __le32 key_idx; 4862 __le32 key_flags; 4863 __le32 key_cipher; /* %WMI_CIPHER_ */ 4864 struct wmi_key_seq_counter key_rsc_counter; 4865 struct wmi_key_seq_counter key_global_rsc_counter; 4866 struct wmi_key_seq_counter key_tsc_counter; 4867 u8 wpi_key_rsc_counter[16]; 4868 u8 wpi_key_tsc_counter[16]; 4869 __le32 key_len; 4870 __le32 key_txmic_len; 4871 __le32 key_rxmic_len; 4872 4873 /* contains key followed by tx mic followed by rx mic */ 4874 u8 key_data[0]; 4875 } __packed; 4876 4877 struct wmi_vdev_install_key_arg { 4878 u32 vdev_id; 4879 const u8 *macaddr; 4880 u32 key_idx; 4881 u32 key_flags; 4882 u32 key_cipher; 4883 u32 key_len; 4884 u32 key_txmic_len; 4885 u32 key_rxmic_len; 4886 const void *key_data; 4887 }; 4888 4889 /* 4890 * vdev fixed rate format: 4891 * - preamble - b7:b6 - see WMI_RATE_PREMABLE_ 4892 * - nss - b5:b4 - ss number (0 mean 1ss) 4893 * - rate_mcs - b3:b0 - as below 4894 * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps, 4895 * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s) 4896 * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps, 4897 * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps 4898 * HT/VHT: MCS index 4899 */ 4900 4901 /* Preamble types to be used with VDEV fixed rate configuration */ 4902 enum wmi_rate_preamble { 4903 WMI_RATE_PREAMBLE_OFDM, 4904 WMI_RATE_PREAMBLE_CCK, 4905 WMI_RATE_PREAMBLE_HT, 4906 WMI_RATE_PREAMBLE_VHT, 4907 }; 4908 4909 #define ATH10K_HW_NSS(rate) (1 + (((rate) >> 4) & 0x3)) 4910 #define ATH10K_HW_PREAMBLE(rate) (((rate) >> 6) & 0x3) 4911 #define ATH10K_HW_MCS_RATE(rate) ((rate) & 0xf) 4912 #define ATH10K_HW_LEGACY_RATE(rate) ((rate) & 0x3f) 4913 #define ATH10K_HW_BW(flags) (((flags) >> 3) & 0x3) 4914 #define ATH10K_HW_GI(flags) (((flags) >> 5) & 0x1) 4915 #define ATH10K_HW_RATECODE(rate, nss, preamble) \ 4916 (((preamble) << 6) | ((nss) << 4) | (rate)) 4917 4918 #define VHT_MCS_NUM 10 4919 #define VHT_BW_NUM 4 4920 #define VHT_NSS_NUM 4 4921 4922 /* Value to disable fixed rate setting */ 4923 #define WMI_FIXED_RATE_NONE (0xff) 4924 4925 struct wmi_vdev_param_map { 4926 u32 rts_threshold; 4927 u32 fragmentation_threshold; 4928 u32 beacon_interval; 4929 u32 listen_interval; 4930 u32 multicast_rate; 4931 u32 mgmt_tx_rate; 4932 u32 slot_time; 4933 u32 preamble; 4934 u32 swba_time; 4935 u32 wmi_vdev_stats_update_period; 4936 u32 wmi_vdev_pwrsave_ageout_time; 4937 u32 wmi_vdev_host_swba_interval; 4938 u32 dtim_period; 4939 u32 wmi_vdev_oc_scheduler_air_time_limit; 4940 u32 wds; 4941 u32 atim_window; 4942 u32 bmiss_count_max; 4943 u32 bmiss_first_bcnt; 4944 u32 bmiss_final_bcnt; 4945 u32 feature_wmm; 4946 u32 chwidth; 4947 u32 chextoffset; 4948 u32 disable_htprotection; 4949 u32 sta_quickkickout; 4950 u32 mgmt_rate; 4951 u32 protection_mode; 4952 u32 fixed_rate; 4953 u32 sgi; 4954 u32 ldpc; 4955 u32 tx_stbc; 4956 u32 rx_stbc; 4957 u32 intra_bss_fwd; 4958 u32 def_keyid; 4959 u32 nss; 4960 u32 bcast_data_rate; 4961 u32 mcast_data_rate; 4962 u32 mcast_indicate; 4963 u32 dhcp_indicate; 4964 u32 unknown_dest_indicate; 4965 u32 ap_keepalive_min_idle_inactive_time_secs; 4966 u32 ap_keepalive_max_idle_inactive_time_secs; 4967 u32 ap_keepalive_max_unresponsive_time_secs; 4968 u32 ap_enable_nawds; 4969 u32 mcast2ucast_set; 4970 u32 enable_rtscts; 4971 u32 txbf; 4972 u32 packet_powersave; 4973 u32 drop_unencry; 4974 u32 tx_encap_type; 4975 u32 ap_detect_out_of_sync_sleeping_sta_time_secs; 4976 u32 rc_num_retries; 4977 u32 cabq_maxdur; 4978 u32 mfptest_set; 4979 u32 rts_fixed_rate; 4980 u32 vht_sgimask; 4981 u32 vht80_ratemask; 4982 u32 early_rx_adjust_enable; 4983 u32 early_rx_tgt_bmiss_num; 4984 u32 early_rx_bmiss_sample_cycle; 4985 u32 early_rx_slop_step; 4986 u32 early_rx_init_slop; 4987 u32 early_rx_adjust_pause; 4988 u32 proxy_sta; 4989 u32 meru_vc; 4990 u32 rx_decap_type; 4991 u32 bw_nss_ratemask; 4992 u32 inc_tsf; 4993 u32 dec_tsf; 4994 }; 4995 4996 #define WMI_VDEV_PARAM_UNSUPPORTED 0 4997 4998 /* the definition of different VDEV parameters */ 4999 enum wmi_vdev_param { 5000 /* RTS Threshold */ 5001 WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1, 5002 /* Fragmentation threshold */ 5003 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD, 5004 /* beacon interval in TUs */ 5005 WMI_VDEV_PARAM_BEACON_INTERVAL, 5006 /* Listen interval in TUs */ 5007 WMI_VDEV_PARAM_LISTEN_INTERVAL, 5008 /* multicast rate in Mbps */ 5009 WMI_VDEV_PARAM_MULTICAST_RATE, 5010 /* management frame rate in Mbps */ 5011 WMI_VDEV_PARAM_MGMT_TX_RATE, 5012 /* slot time (long vs short) */ 5013 WMI_VDEV_PARAM_SLOT_TIME, 5014 /* preamble (long vs short) */ 5015 WMI_VDEV_PARAM_PREAMBLE, 5016 /* SWBA time (time before tbtt in msec) */ 5017 WMI_VDEV_PARAM_SWBA_TIME, 5018 /* time period for updating VDEV stats */ 5019 WMI_VDEV_STATS_UPDATE_PERIOD, 5020 /* age out time in msec for frames queued for station in power save */ 5021 WMI_VDEV_PWRSAVE_AGEOUT_TIME, 5022 /* 5023 * Host SWBA interval (time in msec before tbtt for SWBA event 5024 * generation). 5025 */ 5026 WMI_VDEV_HOST_SWBA_INTERVAL, 5027 /* DTIM period (specified in units of num beacon intervals) */ 5028 WMI_VDEV_PARAM_DTIM_PERIOD, 5029 /* 5030 * scheduler air time limit for this VDEV. used by off chan 5031 * scheduler. 5032 */ 5033 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT, 5034 /* enable/dsiable WDS for this VDEV */ 5035 WMI_VDEV_PARAM_WDS, 5036 /* ATIM Window */ 5037 WMI_VDEV_PARAM_ATIM_WINDOW, 5038 /* BMISS max */ 5039 WMI_VDEV_PARAM_BMISS_COUNT_MAX, 5040 /* BMISS first time */ 5041 WMI_VDEV_PARAM_BMISS_FIRST_BCNT, 5042 /* BMISS final time */ 5043 WMI_VDEV_PARAM_BMISS_FINAL_BCNT, 5044 /* WMM enables/disabled */ 5045 WMI_VDEV_PARAM_FEATURE_WMM, 5046 /* Channel width */ 5047 WMI_VDEV_PARAM_CHWIDTH, 5048 /* Channel Offset */ 5049 WMI_VDEV_PARAM_CHEXTOFFSET, 5050 /* Disable HT Protection */ 5051 WMI_VDEV_PARAM_DISABLE_HTPROTECTION, 5052 /* Quick STA Kickout */ 5053 WMI_VDEV_PARAM_STA_QUICKKICKOUT, 5054 /* Rate to be used with Management frames */ 5055 WMI_VDEV_PARAM_MGMT_RATE, 5056 /* Protection Mode */ 5057 WMI_VDEV_PARAM_PROTECTION_MODE, 5058 /* Fixed rate setting */ 5059 WMI_VDEV_PARAM_FIXED_RATE, 5060 /* Short GI Enable/Disable */ 5061 WMI_VDEV_PARAM_SGI, 5062 /* Enable LDPC */ 5063 WMI_VDEV_PARAM_LDPC, 5064 /* Enable Tx STBC */ 5065 WMI_VDEV_PARAM_TX_STBC, 5066 /* Enable Rx STBC */ 5067 WMI_VDEV_PARAM_RX_STBC, 5068 /* Intra BSS forwarding */ 5069 WMI_VDEV_PARAM_INTRA_BSS_FWD, 5070 /* Setting Default xmit key for Vdev */ 5071 WMI_VDEV_PARAM_DEF_KEYID, 5072 /* NSS width */ 5073 WMI_VDEV_PARAM_NSS, 5074 /* Set the custom rate for the broadcast data frames */ 5075 WMI_VDEV_PARAM_BCAST_DATA_RATE, 5076 /* Set the custom rate (rate-code) for multicast data frames */ 5077 WMI_VDEV_PARAM_MCAST_DATA_RATE, 5078 /* Tx multicast packet indicate Enable/Disable */ 5079 WMI_VDEV_PARAM_MCAST_INDICATE, 5080 /* Tx DHCP packet indicate Enable/Disable */ 5081 WMI_VDEV_PARAM_DHCP_INDICATE, 5082 /* Enable host inspection of Tx unicast packet to unknown destination */ 5083 WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE, 5084 5085 /* The minimum amount of time AP begins to consider STA inactive */ 5086 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, 5087 5088 /* 5089 * An associated STA is considered inactive when there is no recent 5090 * TX/RX activity and no downlink frames are buffered for it. Once a 5091 * STA exceeds the maximum idle inactive time, the AP will send an 5092 * 802.11 data-null as a keep alive to verify the STA is still 5093 * associated. If the STA does ACK the data-null, or if the data-null 5094 * is buffered and the STA does not retrieve it, the STA will be 5095 * considered unresponsive 5096 * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS). 5097 */ 5098 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, 5099 5100 /* 5101 * An associated STA is considered unresponsive if there is no recent 5102 * TX/RX activity and downlink frames are buffered for it. Once a STA 5103 * exceeds the maximum unresponsive time, the AP will send a 5104 * WMI_STA_KICKOUT event to the host so the STA can be deleted. 5105 */ 5106 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, 5107 5108 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */ 5109 WMI_VDEV_PARAM_AP_ENABLE_NAWDS, 5110 /* Enable/Disable RTS-CTS */ 5111 WMI_VDEV_PARAM_ENABLE_RTSCTS, 5112 /* Enable TXBFee/er */ 5113 WMI_VDEV_PARAM_TXBF, 5114 5115 /* Set packet power save */ 5116 WMI_VDEV_PARAM_PACKET_POWERSAVE, 5117 5118 /* 5119 * Drops un-encrypted packets if eceived in an encrypted connection 5120 * otherwise forwards to host. 5121 */ 5122 WMI_VDEV_PARAM_DROP_UNENCRY, 5123 5124 /* 5125 * Set the encapsulation type for frames. 5126 */ 5127 WMI_VDEV_PARAM_TX_ENCAP_TYPE, 5128 }; 5129 5130 /* the definition of different VDEV parameters */ 5131 enum wmi_10x_vdev_param { 5132 /* RTS Threshold */ 5133 WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1, 5134 /* Fragmentation threshold */ 5135 WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD, 5136 /* beacon interval in TUs */ 5137 WMI_10X_VDEV_PARAM_BEACON_INTERVAL, 5138 /* Listen interval in TUs */ 5139 WMI_10X_VDEV_PARAM_LISTEN_INTERVAL, 5140 /* multicast rate in Mbps */ 5141 WMI_10X_VDEV_PARAM_MULTICAST_RATE, 5142 /* management frame rate in Mbps */ 5143 WMI_10X_VDEV_PARAM_MGMT_TX_RATE, 5144 /* slot time (long vs short) */ 5145 WMI_10X_VDEV_PARAM_SLOT_TIME, 5146 /* preamble (long vs short) */ 5147 WMI_10X_VDEV_PARAM_PREAMBLE, 5148 /* SWBA time (time before tbtt in msec) */ 5149 WMI_10X_VDEV_PARAM_SWBA_TIME, 5150 /* time period for updating VDEV stats */ 5151 WMI_10X_VDEV_STATS_UPDATE_PERIOD, 5152 /* age out time in msec for frames queued for station in power save */ 5153 WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME, 5154 /* 5155 * Host SWBA interval (time in msec before tbtt for SWBA event 5156 * generation). 5157 */ 5158 WMI_10X_VDEV_HOST_SWBA_INTERVAL, 5159 /* DTIM period (specified in units of num beacon intervals) */ 5160 WMI_10X_VDEV_PARAM_DTIM_PERIOD, 5161 /* 5162 * scheduler air time limit for this VDEV. used by off chan 5163 * scheduler. 5164 */ 5165 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT, 5166 /* enable/dsiable WDS for this VDEV */ 5167 WMI_10X_VDEV_PARAM_WDS, 5168 /* ATIM Window */ 5169 WMI_10X_VDEV_PARAM_ATIM_WINDOW, 5170 /* BMISS max */ 5171 WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX, 5172 /* WMM enables/disabled */ 5173 WMI_10X_VDEV_PARAM_FEATURE_WMM, 5174 /* Channel width */ 5175 WMI_10X_VDEV_PARAM_CHWIDTH, 5176 /* Channel Offset */ 5177 WMI_10X_VDEV_PARAM_CHEXTOFFSET, 5178 /* Disable HT Protection */ 5179 WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION, 5180 /* Quick STA Kickout */ 5181 WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT, 5182 /* Rate to be used with Management frames */ 5183 WMI_10X_VDEV_PARAM_MGMT_RATE, 5184 /* Protection Mode */ 5185 WMI_10X_VDEV_PARAM_PROTECTION_MODE, 5186 /* Fixed rate setting */ 5187 WMI_10X_VDEV_PARAM_FIXED_RATE, 5188 /* Short GI Enable/Disable */ 5189 WMI_10X_VDEV_PARAM_SGI, 5190 /* Enable LDPC */ 5191 WMI_10X_VDEV_PARAM_LDPC, 5192 /* Enable Tx STBC */ 5193 WMI_10X_VDEV_PARAM_TX_STBC, 5194 /* Enable Rx STBC */ 5195 WMI_10X_VDEV_PARAM_RX_STBC, 5196 /* Intra BSS forwarding */ 5197 WMI_10X_VDEV_PARAM_INTRA_BSS_FWD, 5198 /* Setting Default xmit key for Vdev */ 5199 WMI_10X_VDEV_PARAM_DEF_KEYID, 5200 /* NSS width */ 5201 WMI_10X_VDEV_PARAM_NSS, 5202 /* Set the custom rate for the broadcast data frames */ 5203 WMI_10X_VDEV_PARAM_BCAST_DATA_RATE, 5204 /* Set the custom rate (rate-code) for multicast data frames */ 5205 WMI_10X_VDEV_PARAM_MCAST_DATA_RATE, 5206 /* Tx multicast packet indicate Enable/Disable */ 5207 WMI_10X_VDEV_PARAM_MCAST_INDICATE, 5208 /* Tx DHCP packet indicate Enable/Disable */ 5209 WMI_10X_VDEV_PARAM_DHCP_INDICATE, 5210 /* Enable host inspection of Tx unicast packet to unknown destination */ 5211 WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE, 5212 5213 /* The minimum amount of time AP begins to consider STA inactive */ 5214 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, 5215 5216 /* 5217 * An associated STA is considered inactive when there is no recent 5218 * TX/RX activity and no downlink frames are buffered for it. Once a 5219 * STA exceeds the maximum idle inactive time, the AP will send an 5220 * 802.11 data-null as a keep alive to verify the STA is still 5221 * associated. If the STA does ACK the data-null, or if the data-null 5222 * is buffered and the STA does not retrieve it, the STA will be 5223 * considered unresponsive 5224 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS). 5225 */ 5226 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, 5227 5228 /* 5229 * An associated STA is considered unresponsive if there is no recent 5230 * TX/RX activity and downlink frames are buffered for it. Once a STA 5231 * exceeds the maximum unresponsive time, the AP will send a 5232 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. 5233 */ 5234 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, 5235 5236 /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */ 5237 WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS, 5238 5239 WMI_10X_VDEV_PARAM_MCAST2UCAST_SET, 5240 /* Enable/Disable RTS-CTS */ 5241 WMI_10X_VDEV_PARAM_ENABLE_RTSCTS, 5242 5243 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS, 5244 5245 /* following are available as of firmware 10.2 */ 5246 WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE, 5247 WMI_10X_VDEV_PARAM_CABQ_MAXDUR, 5248 WMI_10X_VDEV_PARAM_MFPTEST_SET, 5249 WMI_10X_VDEV_PARAM_RTS_FIXED_RATE, 5250 WMI_10X_VDEV_PARAM_VHT_SGIMASK, 5251 WMI_10X_VDEV_PARAM_VHT80_RATEMASK, 5252 WMI_10X_VDEV_PARAM_TSF_INCREMENT, 5253 }; 5254 5255 enum wmi_10_4_vdev_param { 5256 WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1, 5257 WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD, 5258 WMI_10_4_VDEV_PARAM_BEACON_INTERVAL, 5259 WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL, 5260 WMI_10_4_VDEV_PARAM_MULTICAST_RATE, 5261 WMI_10_4_VDEV_PARAM_MGMT_TX_RATE, 5262 WMI_10_4_VDEV_PARAM_SLOT_TIME, 5263 WMI_10_4_VDEV_PARAM_PREAMBLE, 5264 WMI_10_4_VDEV_PARAM_SWBA_TIME, 5265 WMI_10_4_VDEV_STATS_UPDATE_PERIOD, 5266 WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME, 5267 WMI_10_4_VDEV_HOST_SWBA_INTERVAL, 5268 WMI_10_4_VDEV_PARAM_DTIM_PERIOD, 5269 WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT, 5270 WMI_10_4_VDEV_PARAM_WDS, 5271 WMI_10_4_VDEV_PARAM_ATIM_WINDOW, 5272 WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX, 5273 WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT, 5274 WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT, 5275 WMI_10_4_VDEV_PARAM_FEATURE_WMM, 5276 WMI_10_4_VDEV_PARAM_CHWIDTH, 5277 WMI_10_4_VDEV_PARAM_CHEXTOFFSET, 5278 WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION, 5279 WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT, 5280 WMI_10_4_VDEV_PARAM_MGMT_RATE, 5281 WMI_10_4_VDEV_PARAM_PROTECTION_MODE, 5282 WMI_10_4_VDEV_PARAM_FIXED_RATE, 5283 WMI_10_4_VDEV_PARAM_SGI, 5284 WMI_10_4_VDEV_PARAM_LDPC, 5285 WMI_10_4_VDEV_PARAM_TX_STBC, 5286 WMI_10_4_VDEV_PARAM_RX_STBC, 5287 WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD, 5288 WMI_10_4_VDEV_PARAM_DEF_KEYID, 5289 WMI_10_4_VDEV_PARAM_NSS, 5290 WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE, 5291 WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE, 5292 WMI_10_4_VDEV_PARAM_MCAST_INDICATE, 5293 WMI_10_4_VDEV_PARAM_DHCP_INDICATE, 5294 WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE, 5295 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, 5296 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, 5297 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, 5298 WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS, 5299 WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET, 5300 WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS, 5301 WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES, 5302 WMI_10_4_VDEV_PARAM_TXBF, 5303 WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE, 5304 WMI_10_4_VDEV_PARAM_DROP_UNENCRY, 5305 WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE, 5306 WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS, 5307 WMI_10_4_VDEV_PARAM_CABQ_MAXDUR, 5308 WMI_10_4_VDEV_PARAM_MFPTEST_SET, 5309 WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE, 5310 WMI_10_4_VDEV_PARAM_VHT_SGIMASK, 5311 WMI_10_4_VDEV_PARAM_VHT80_RATEMASK, 5312 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, 5313 WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, 5314 WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, 5315 WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP, 5316 WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP, 5317 WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, 5318 WMI_10_4_VDEV_PARAM_PROXY_STA, 5319 WMI_10_4_VDEV_PARAM_MERU_VC, 5320 WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE, 5321 WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, 5322 WMI_10_4_VDEV_PARAM_SENSOR_AP, 5323 WMI_10_4_VDEV_PARAM_BEACON_RATE, 5324 WMI_10_4_VDEV_PARAM_DTIM_ENABLE_CTS, 5325 WMI_10_4_VDEV_PARAM_STA_KICKOUT, 5326 WMI_10_4_VDEV_PARAM_CAPABILITIES, 5327 WMI_10_4_VDEV_PARAM_TSF_INCREMENT, 5328 WMI_10_4_VDEV_PARAM_RX_FILTER, 5329 WMI_10_4_VDEV_PARAM_MGMT_TX_POWER, 5330 WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY, 5331 WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS, 5332 WMI_10_4_VDEV_PARAM_TSF_DECREMENT, 5333 }; 5334 5335 #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0) 5336 #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1) 5337 #define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2) 5338 #define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3) 5339 5340 #define WMI_TXBF_STS_CAP_OFFSET_LSB 4 5341 #define WMI_TXBF_STS_CAP_OFFSET_MASK 0x70 5342 #define WMI_TXBF_CONF_IMPLICIT_BF BIT(7) 5343 #define WMI_BF_SOUND_DIM_OFFSET_LSB 8 5344 #define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00 5345 5346 /* slot time long */ 5347 #define WMI_VDEV_SLOT_TIME_LONG 0x1 5348 /* slot time short */ 5349 #define WMI_VDEV_SLOT_TIME_SHORT 0x2 5350 /* preablbe long */ 5351 #define WMI_VDEV_PREAMBLE_LONG 0x1 5352 /* preablbe short */ 5353 #define WMI_VDEV_PREAMBLE_SHORT 0x2 5354 5355 enum wmi_start_event_param { 5356 WMI_VDEV_RESP_START_EVENT = 0, 5357 WMI_VDEV_RESP_RESTART_EVENT, 5358 }; 5359 5360 struct wmi_vdev_start_response_event { 5361 __le32 vdev_id; 5362 __le32 req_id; 5363 __le32 resp_type; /* %WMI_VDEV_RESP_ */ 5364 __le32 status; 5365 } __packed; 5366 5367 struct wmi_vdev_standby_req_event { 5368 /* unique id identifying the VDEV, generated by the caller */ 5369 __le32 vdev_id; 5370 } __packed; 5371 5372 struct wmi_vdev_resume_req_event { 5373 /* unique id identifying the VDEV, generated by the caller */ 5374 __le32 vdev_id; 5375 } __packed; 5376 5377 struct wmi_vdev_stopped_event { 5378 /* unique id identifying the VDEV, generated by the caller */ 5379 __le32 vdev_id; 5380 } __packed; 5381 5382 /* 5383 * common structure used for simple events 5384 * (stopped, resume_req, standby response) 5385 */ 5386 struct wmi_vdev_simple_event { 5387 /* unique id identifying the VDEV, generated by the caller */ 5388 __le32 vdev_id; 5389 } __packed; 5390 5391 /* VDEV start response status codes */ 5392 /* VDEV successfully started */ 5393 #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0 5394 5395 /* requested VDEV not found */ 5396 #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1 5397 5398 /* unsupported VDEV combination */ 5399 #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2 5400 5401 /* TODO: please add more comments if you have in-depth information */ 5402 struct wmi_vdev_spectral_conf_cmd { 5403 __le32 vdev_id; 5404 5405 /* number of fft samples to send (0 for infinite) */ 5406 __le32 scan_count; 5407 __le32 scan_period; 5408 __le32 scan_priority; 5409 5410 /* number of bins in the FFT: 2^(fft_size - bin_scale) */ 5411 __le32 scan_fft_size; 5412 __le32 scan_gc_ena; 5413 __le32 scan_restart_ena; 5414 __le32 scan_noise_floor_ref; 5415 __le32 scan_init_delay; 5416 __le32 scan_nb_tone_thr; 5417 __le32 scan_str_bin_thr; 5418 __le32 scan_wb_rpt_mode; 5419 __le32 scan_rssi_rpt_mode; 5420 __le32 scan_rssi_thr; 5421 __le32 scan_pwr_format; 5422 5423 /* rpt_mode: Format of FFT report to software for spectral scan 5424 * triggered FFTs: 5425 * 0: No FFT report (only spectral scan summary report) 5426 * 1: 2-dword summary of metrics for each completed FFT + spectral 5427 * scan summary report 5428 * 2: 2-dword summary of metrics for each completed FFT + 5429 * 1x- oversampled bins(in-band) per FFT + spectral scan summary 5430 * report 5431 * 3: 2-dword summary of metrics for each completed FFT + 5432 * 2x- oversampled bins (all) per FFT + spectral scan summary 5433 */ 5434 __le32 scan_rpt_mode; 5435 __le32 scan_bin_scale; 5436 __le32 scan_dbm_adj; 5437 __le32 scan_chn_mask; 5438 } __packed; 5439 5440 struct wmi_vdev_spectral_conf_arg { 5441 u32 vdev_id; 5442 u32 scan_count; 5443 u32 scan_period; 5444 u32 scan_priority; 5445 u32 scan_fft_size; 5446 u32 scan_gc_ena; 5447 u32 scan_restart_ena; 5448 u32 scan_noise_floor_ref; 5449 u32 scan_init_delay; 5450 u32 scan_nb_tone_thr; 5451 u32 scan_str_bin_thr; 5452 u32 scan_wb_rpt_mode; 5453 u32 scan_rssi_rpt_mode; 5454 u32 scan_rssi_thr; 5455 u32 scan_pwr_format; 5456 u32 scan_rpt_mode; 5457 u32 scan_bin_scale; 5458 u32 scan_dbm_adj; 5459 u32 scan_chn_mask; 5460 }; 5461 5462 #define WMI_SPECTRAL_ENABLE_DEFAULT 0 5463 #define WMI_SPECTRAL_COUNT_DEFAULT 0 5464 #define WMI_SPECTRAL_PERIOD_DEFAULT 35 5465 #define WMI_SPECTRAL_PRIORITY_DEFAULT 1 5466 #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7 5467 #define WMI_SPECTRAL_GC_ENA_DEFAULT 1 5468 #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0 5469 #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96 5470 #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80 5471 #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12 5472 #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8 5473 #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0 5474 #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0 5475 #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0 5476 #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0 5477 #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2 5478 #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1 5479 #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1 5480 #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1 5481 5482 struct wmi_vdev_spectral_enable_cmd { 5483 __le32 vdev_id; 5484 __le32 trigger_cmd; 5485 __le32 enable_cmd; 5486 } __packed; 5487 5488 #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1 5489 #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2 5490 #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1 5491 #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2 5492 5493 /* Beacon processing related command and event structures */ 5494 struct wmi_bcn_tx_hdr { 5495 __le32 vdev_id; 5496 __le32 tx_rate; 5497 __le32 tx_power; 5498 __le32 bcn_len; 5499 } __packed; 5500 5501 struct wmi_bcn_tx_cmd { 5502 struct wmi_bcn_tx_hdr hdr; 5503 u8 *bcn[0]; 5504 } __packed; 5505 5506 struct wmi_bcn_tx_arg { 5507 u32 vdev_id; 5508 u32 tx_rate; 5509 u32 tx_power; 5510 u32 bcn_len; 5511 const void *bcn; 5512 }; 5513 5514 enum wmi_bcn_tx_ref_flags { 5515 WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1, 5516 WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2, 5517 }; 5518 5519 /* TODO: It is unclear why "no antenna" works while any other seemingly valid 5520 * chainmask yields no beacons on the air at all. 5521 */ 5522 #define WMI_BCN_TX_REF_DEF_ANTENNA 0 5523 5524 struct wmi_bcn_tx_ref_cmd { 5525 __le32 vdev_id; 5526 __le32 data_len; 5527 /* physical address of the frame - dma pointer */ 5528 __le32 data_ptr; 5529 /* id for host to track */ 5530 __le32 msdu_id; 5531 /* frame ctrl to setup PPDU desc */ 5532 __le32 frame_control; 5533 /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */ 5534 __le32 flags; 5535 /* introduced in 10.2 */ 5536 __le32 antenna_mask; 5537 } __packed; 5538 5539 /* Beacon filter */ 5540 #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */ 5541 #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */ 5542 #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */ 5543 #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */ 5544 #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */ 5545 5546 struct wmi_bcn_filter_rx_cmd { 5547 /* Filter ID */ 5548 __le32 bcn_filter_id; 5549 /* Filter type - wmi_bcn_filter */ 5550 __le32 bcn_filter; 5551 /* Buffer len */ 5552 __le32 bcn_filter_len; 5553 /* Filter info (threshold, BSSID, RSSI) */ 5554 u8 *bcn_filter_buf; 5555 } __packed; 5556 5557 /* Capabilities and IEs to be passed to firmware */ 5558 struct wmi_bcn_prb_info { 5559 /* Capabilities */ 5560 __le32 caps; 5561 /* ERP info */ 5562 __le32 erp; 5563 /* Advanced capabilities */ 5564 /* HT capabilities */ 5565 /* HT Info */ 5566 /* ibss_dfs */ 5567 /* wpa Info */ 5568 /* rsn Info */ 5569 /* rrm info */ 5570 /* ath_ext */ 5571 /* app IE */ 5572 } __packed; 5573 5574 struct wmi_bcn_tmpl_cmd { 5575 /* unique id identifying the VDEV, generated by the caller */ 5576 __le32 vdev_id; 5577 /* TIM IE offset from the beginning of the template. */ 5578 __le32 tim_ie_offset; 5579 /* beacon probe capabilities and IEs */ 5580 struct wmi_bcn_prb_info bcn_prb_info; 5581 /* beacon buffer length */ 5582 __le32 buf_len; 5583 /* variable length data */ 5584 u8 data[1]; 5585 } __packed; 5586 5587 struct wmi_prb_tmpl_cmd { 5588 /* unique id identifying the VDEV, generated by the caller */ 5589 __le32 vdev_id; 5590 /* beacon probe capabilities and IEs */ 5591 struct wmi_bcn_prb_info bcn_prb_info; 5592 /* beacon buffer length */ 5593 __le32 buf_len; 5594 /* Variable length data */ 5595 u8 data[1]; 5596 } __packed; 5597 5598 enum wmi_sta_ps_mode { 5599 /* enable power save for the given STA VDEV */ 5600 WMI_STA_PS_MODE_DISABLED = 0, 5601 /* disable power save for a given STA VDEV */ 5602 WMI_STA_PS_MODE_ENABLED = 1, 5603 }; 5604 5605 struct wmi_sta_powersave_mode_cmd { 5606 /* unique id identifying the VDEV, generated by the caller */ 5607 __le32 vdev_id; 5608 5609 /* 5610 * Power save mode 5611 * (see enum wmi_sta_ps_mode) 5612 */ 5613 __le32 sta_ps_mode; 5614 } __packed; 5615 5616 enum wmi_csa_offload_en { 5617 WMI_CSA_OFFLOAD_DISABLE = 0, 5618 WMI_CSA_OFFLOAD_ENABLE = 1, 5619 }; 5620 5621 struct wmi_csa_offload_enable_cmd { 5622 __le32 vdev_id; 5623 __le32 csa_offload_enable; 5624 } __packed; 5625 5626 struct wmi_csa_offload_chanswitch_cmd { 5627 __le32 vdev_id; 5628 struct wmi_channel chan; 5629 } __packed; 5630 5631 /* 5632 * This parameter controls the policy for retrieving frames from AP while the 5633 * STA is in sleep state. 5634 * 5635 * Only takes affect if the sta_ps_mode is enabled 5636 */ 5637 enum wmi_sta_ps_param_rx_wake_policy { 5638 /* 5639 * Wake up when ever there is an RX activity on the VDEV. In this mode 5640 * the Power save SM(state machine) will come out of sleep by either 5641 * sending null frame (or) a data frame (with PS==0) in response to TIM 5642 * bit set in the received beacon frame from AP. 5643 */ 5644 WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0, 5645 5646 /* 5647 * Here the power save state machine will not wakeup in response to TIM 5648 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD 5649 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all 5650 * access categories are delivery-enabled, the station will send a 5651 * UAPSD trigger frame, otherwise it will send a PS-Poll. 5652 */ 5653 WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1, 5654 }; 5655 5656 /* 5657 * Number of tx frames/beacon that cause the power save SM to wake up. 5658 * 5659 * Value 1 causes the SM to wake up for every TX. Value 0 has a special 5660 * meaning, It will cause the SM to never wake up. This is useful if you want 5661 * to keep the system to sleep all the time for some kind of test mode . host 5662 * can change this parameter any time. It will affect at the next tx frame. 5663 */ 5664 enum wmi_sta_ps_param_tx_wake_threshold { 5665 WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0, 5666 WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1, 5667 5668 /* 5669 * Values greater than one indicate that many TX attempts per beacon 5670 * interval before the STA will wake up 5671 */ 5672 }; 5673 5674 /* 5675 * The maximum number of PS-Poll frames the FW will send in response to 5676 * traffic advertised in TIM before waking up (by sending a null frame with PS 5677 * = 0). Value 0 has a special meaning: there is no maximum count and the FW 5678 * will send as many PS-Poll as are necessary to retrieve buffered BU. This 5679 * parameter is used when the RX wake policy is 5680 * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake 5681 * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE. 5682 */ 5683 enum wmi_sta_ps_param_pspoll_count { 5684 WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0, 5685 /* 5686 * Values greater than 0 indicate the maximum numer of PS-Poll frames 5687 * FW will send before waking up. 5688 */ 5689 5690 /* When u-APSD is enabled the firmware will be very reluctant to exit 5691 * STA PS. This could result in very poor Rx performance with STA doing 5692 * PS-Poll for each and every buffered frame. This value is a bit 5693 * arbitrary. 5694 */ 5695 WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3, 5696 }; 5697 5698 /* 5699 * This will include the delivery and trigger enabled state for every AC. 5700 * This is the negotiated state with AP. The host MLME needs to set this based 5701 * on AP capability and the state Set in the association request by the 5702 * station MLME.Lower 8 bits of the value specify the UAPSD configuration. 5703 */ 5704 #define WMI_UAPSD_AC_TYPE_DELI 0 5705 #define WMI_UAPSD_AC_TYPE_TRIG 1 5706 5707 #define WMI_UAPSD_AC_BIT_MASK(ac, type) \ 5708 (type == WMI_UAPSD_AC_TYPE_DELI ? 1 << (ac << 1) : 1 << ((ac << 1) + 1)) 5709 5710 enum wmi_sta_ps_param_uapsd { 5711 WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0), 5712 WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1), 5713 WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2), 5714 WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3), 5715 WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4), 5716 WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5), 5717 WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6), 5718 WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7), 5719 }; 5720 5721 #define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX 5722 5723 struct wmi_sta_uapsd_auto_trig_param { 5724 __le32 wmm_ac; 5725 __le32 user_priority; 5726 __le32 service_interval; 5727 __le32 suspend_interval; 5728 __le32 delay_interval; 5729 }; 5730 5731 struct wmi_sta_uapsd_auto_trig_cmd_fixed_param { 5732 __le32 vdev_id; 5733 struct wmi_mac_addr peer_macaddr; 5734 __le32 num_ac; 5735 }; 5736 5737 struct wmi_sta_uapsd_auto_trig_arg { 5738 u32 wmm_ac; 5739 u32 user_priority; 5740 u32 service_interval; 5741 u32 suspend_interval; 5742 u32 delay_interval; 5743 }; 5744 5745 enum wmi_sta_powersave_param { 5746 /* 5747 * Controls how frames are retrievd from AP while STA is sleeping 5748 * 5749 * (see enum wmi_sta_ps_param_rx_wake_policy) 5750 */ 5751 WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0, 5752 5753 /* 5754 * The STA will go active after this many TX 5755 * 5756 * (see enum wmi_sta_ps_param_tx_wake_threshold) 5757 */ 5758 WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1, 5759 5760 /* 5761 * Number of PS-Poll to send before STA wakes up 5762 * 5763 * (see enum wmi_sta_ps_param_pspoll_count) 5764 * 5765 */ 5766 WMI_STA_PS_PARAM_PSPOLL_COUNT = 2, 5767 5768 /* 5769 * TX/RX inactivity time in msec before going to sleep. 5770 * 5771 * The power save SM will monitor tx/rx activity on the VDEV, if no 5772 * activity for the specified msec of the parameter the Power save 5773 * SM will go to sleep. 5774 */ 5775 WMI_STA_PS_PARAM_INACTIVITY_TIME = 3, 5776 5777 /* 5778 * Set uapsd configuration. 5779 * 5780 * (see enum wmi_sta_ps_param_uapsd) 5781 */ 5782 WMI_STA_PS_PARAM_UAPSD = 4, 5783 }; 5784 5785 struct wmi_sta_powersave_param_cmd { 5786 __le32 vdev_id; 5787 __le32 param_id; /* %WMI_STA_PS_PARAM_ */ 5788 __le32 param_value; 5789 } __packed; 5790 5791 /* No MIMO power save */ 5792 #define WMI_STA_MIMO_PS_MODE_DISABLE 5793 /* mimo powersave mode static*/ 5794 #define WMI_STA_MIMO_PS_MODE_STATIC 5795 /* mimo powersave mode dynamic */ 5796 #define WMI_STA_MIMO_PS_MODE_DYNAMIC 5797 5798 struct wmi_sta_mimo_ps_mode_cmd { 5799 /* unique id identifying the VDEV, generated by the caller */ 5800 __le32 vdev_id; 5801 /* mimo powersave mode as defined above */ 5802 __le32 mimo_pwrsave_mode; 5803 } __packed; 5804 5805 /* U-APSD configuration of peer station from (re)assoc request and TSPECs */ 5806 enum wmi_ap_ps_param_uapsd { 5807 WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0), 5808 WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1), 5809 WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2), 5810 WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3), 5811 WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4), 5812 WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5), 5813 WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6), 5814 WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7), 5815 }; 5816 5817 /* U-APSD maximum service period of peer station */ 5818 enum wmi_ap_ps_peer_param_max_sp { 5819 WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0, 5820 WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1, 5821 WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2, 5822 WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3, 5823 MAX_WMI_AP_PS_PEER_PARAM_MAX_SP, 5824 }; 5825 5826 /* 5827 * AP power save parameter 5828 * Set a power save specific parameter for a peer station 5829 */ 5830 enum wmi_ap_ps_peer_param { 5831 /* Set uapsd configuration for a given peer. 5832 * 5833 * Include the delivery and trigger enabled state for every AC. 5834 * The host MLME needs to set this based on AP capability and stations 5835 * request Set in the association request received from the station. 5836 * 5837 * Lower 8 bits of the value specify the UAPSD configuration. 5838 * 5839 * (see enum wmi_ap_ps_param_uapsd) 5840 * The default value is 0. 5841 */ 5842 WMI_AP_PS_PEER_PARAM_UAPSD = 0, 5843 5844 /* 5845 * Set the service period for a UAPSD capable station 5846 * 5847 * The service period from wme ie in the (re)assoc request frame. 5848 * 5849 * (see enum wmi_ap_ps_peer_param_max_sp) 5850 */ 5851 WMI_AP_PS_PEER_PARAM_MAX_SP = 1, 5852 5853 /* Time in seconds for aging out buffered frames for STA in PS */ 5854 WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2, 5855 }; 5856 5857 struct wmi_ap_ps_peer_cmd { 5858 /* unique id identifying the VDEV, generated by the caller */ 5859 __le32 vdev_id; 5860 5861 /* peer MAC address */ 5862 struct wmi_mac_addr peer_macaddr; 5863 5864 /* AP powersave param (see enum wmi_ap_ps_peer_param) */ 5865 __le32 param_id; 5866 5867 /* AP powersave param value */ 5868 __le32 param_value; 5869 } __packed; 5870 5871 /* 128 clients = 4 words */ 5872 #define WMI_TIM_BITMAP_ARRAY_SIZE 4 5873 5874 struct wmi_tim_info { 5875 __le32 tim_len; 5876 __le32 tim_mcast; 5877 __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE]; 5878 __le32 tim_changed; 5879 __le32 tim_num_ps_pending; 5880 } __packed; 5881 5882 struct wmi_tim_info_arg { 5883 __le32 tim_len; 5884 __le32 tim_mcast; 5885 const __le32 *tim_bitmap; 5886 __le32 tim_changed; 5887 __le32 tim_num_ps_pending; 5888 } __packed; 5889 5890 /* Maximum number of NOA Descriptors supported */ 5891 #define WMI_P2P_MAX_NOA_DESCRIPTORS 4 5892 #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0) 5893 #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1 5894 #define WMI_P2P_NOA_CHANGED_BIT BIT(0) 5895 5896 struct wmi_p2p_noa_info { 5897 /* Bit 0 - Flag to indicate an update in NOA schedule 5898 * Bits 7-1 - Reserved 5899 */ 5900 u8 changed; 5901 /* NOA index */ 5902 u8 index; 5903 /* Bit 0 - Opp PS state of the AP 5904 * Bits 1-7 - Ctwindow in TUs 5905 */ 5906 u8 ctwindow_oppps; 5907 /* Number of NOA descriptors */ 5908 u8 num_descriptors; 5909 5910 struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS]; 5911 } __packed; 5912 5913 struct wmi_bcn_info { 5914 struct wmi_tim_info tim_info; 5915 struct wmi_p2p_noa_info p2p_noa_info; 5916 } __packed; 5917 5918 struct wmi_host_swba_event { 5919 __le32 vdev_map; 5920 struct wmi_bcn_info bcn_info[0]; 5921 } __packed; 5922 5923 struct wmi_10_2_4_bcn_info { 5924 struct wmi_tim_info tim_info; 5925 /* The 10.2.4 FW doesn't have p2p NOA info */ 5926 } __packed; 5927 5928 struct wmi_10_2_4_host_swba_event { 5929 __le32 vdev_map; 5930 struct wmi_10_2_4_bcn_info bcn_info[0]; 5931 } __packed; 5932 5933 /* 16 words = 512 client + 1 word = for guard */ 5934 #define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17 5935 5936 struct wmi_10_4_tim_info { 5937 __le32 tim_len; 5938 __le32 tim_mcast; 5939 __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE]; 5940 __le32 tim_changed; 5941 __le32 tim_num_ps_pending; 5942 } __packed; 5943 5944 #define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1 5945 5946 struct wmi_10_4_p2p_noa_info { 5947 /* Bit 0 - Flag to indicate an update in NOA schedule 5948 * Bits 7-1 - Reserved 5949 */ 5950 u8 changed; 5951 /* NOA index */ 5952 u8 index; 5953 /* Bit 0 - Opp PS state of the AP 5954 * Bits 1-7 - Ctwindow in TUs 5955 */ 5956 u8 ctwindow_oppps; 5957 /* Number of NOA descriptors */ 5958 u8 num_descriptors; 5959 5960 struct wmi_p2p_noa_descriptor 5961 noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS]; 5962 } __packed; 5963 5964 struct wmi_10_4_bcn_info { 5965 struct wmi_10_4_tim_info tim_info; 5966 struct wmi_10_4_p2p_noa_info p2p_noa_info; 5967 } __packed; 5968 5969 struct wmi_10_4_host_swba_event { 5970 __le32 vdev_map; 5971 struct wmi_10_4_bcn_info bcn_info[0]; 5972 } __packed; 5973 5974 #define WMI_MAX_AP_VDEV 16 5975 5976 struct wmi_tbtt_offset_event { 5977 __le32 vdev_map; 5978 __le32 tbttoffset_list[WMI_MAX_AP_VDEV]; 5979 } __packed; 5980 5981 struct wmi_peer_create_cmd { 5982 __le32 vdev_id; 5983 struct wmi_mac_addr peer_macaddr; 5984 __le32 peer_type; 5985 } __packed; 5986 5987 enum wmi_peer_type { 5988 WMI_PEER_TYPE_DEFAULT = 0, 5989 WMI_PEER_TYPE_BSS = 1, 5990 WMI_PEER_TYPE_TDLS = 2, 5991 }; 5992 5993 struct wmi_peer_delete_cmd { 5994 __le32 vdev_id; 5995 struct wmi_mac_addr peer_macaddr; 5996 } __packed; 5997 5998 struct wmi_peer_flush_tids_cmd { 5999 __le32 vdev_id; 6000 struct wmi_mac_addr peer_macaddr; 6001 __le32 peer_tid_bitmap; 6002 } __packed; 6003 6004 struct wmi_fixed_rate { 6005 /* 6006 * rate mode . 0: disable fixed rate (auto rate) 6007 * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps 6008 * 2: ht20 11n rate specified as mcs index 6009 * 3: ht40 11n rate specified as mcs index 6010 */ 6011 __le32 rate_mode; 6012 /* 6013 * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB) 6014 * and series 3 is stored at byte 3 (MSB) 6015 */ 6016 __le32 rate_series; 6017 /* 6018 * 4 retry counts for 4 rate series. retry count for rate 0 is stored 6019 * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3 6020 * (MSB) 6021 */ 6022 __le32 rate_retries; 6023 } __packed; 6024 6025 struct wmi_peer_fixed_rate_cmd { 6026 /* unique id identifying the VDEV, generated by the caller */ 6027 __le32 vdev_id; 6028 /* peer MAC address */ 6029 struct wmi_mac_addr peer_macaddr; 6030 /* fixed rate */ 6031 struct wmi_fixed_rate peer_fixed_rate; 6032 } __packed; 6033 6034 #define WMI_MGMT_TID 17 6035 6036 struct wmi_addba_clear_resp_cmd { 6037 /* unique id identifying the VDEV, generated by the caller */ 6038 __le32 vdev_id; 6039 /* peer MAC address */ 6040 struct wmi_mac_addr peer_macaddr; 6041 } __packed; 6042 6043 struct wmi_addba_send_cmd { 6044 /* unique id identifying the VDEV, generated by the caller */ 6045 __le32 vdev_id; 6046 /* peer MAC address */ 6047 struct wmi_mac_addr peer_macaddr; 6048 /* Tid number */ 6049 __le32 tid; 6050 /* Buffer/Window size*/ 6051 __le32 buffersize; 6052 } __packed; 6053 6054 struct wmi_delba_send_cmd { 6055 /* unique id identifying the VDEV, generated by the caller */ 6056 __le32 vdev_id; 6057 /* peer MAC address */ 6058 struct wmi_mac_addr peer_macaddr; 6059 /* Tid number */ 6060 __le32 tid; 6061 /* Is Initiator */ 6062 __le32 initiator; 6063 /* Reason code */ 6064 __le32 reasoncode; 6065 } __packed; 6066 6067 struct wmi_addba_setresponse_cmd { 6068 /* unique id identifying the vdev, generated by the caller */ 6069 __le32 vdev_id; 6070 /* peer mac address */ 6071 struct wmi_mac_addr peer_macaddr; 6072 /* Tid number */ 6073 __le32 tid; 6074 /* status code */ 6075 __le32 statuscode; 6076 } __packed; 6077 6078 struct wmi_send_singleamsdu_cmd { 6079 /* unique id identifying the vdev, generated by the caller */ 6080 __le32 vdev_id; 6081 /* peer mac address */ 6082 struct wmi_mac_addr peer_macaddr; 6083 /* Tid number */ 6084 __le32 tid; 6085 } __packed; 6086 6087 enum wmi_peer_smps_state { 6088 WMI_PEER_SMPS_PS_NONE = 0x0, 6089 WMI_PEER_SMPS_STATIC = 0x1, 6090 WMI_PEER_SMPS_DYNAMIC = 0x2 6091 }; 6092 6093 enum wmi_peer_chwidth { 6094 WMI_PEER_CHWIDTH_20MHZ = 0, 6095 WMI_PEER_CHWIDTH_40MHZ = 1, 6096 WMI_PEER_CHWIDTH_80MHZ = 2, 6097 WMI_PEER_CHWIDTH_160MHZ = 3, 6098 }; 6099 6100 enum wmi_peer_param { 6101 WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */ 6102 WMI_PEER_AMPDU = 0x2, 6103 WMI_PEER_AUTHORIZE = 0x3, 6104 WMI_PEER_CHAN_WIDTH = 0x4, 6105 WMI_PEER_NSS = 0x5, 6106 WMI_PEER_USE_4ADDR = 0x6, 6107 WMI_PEER_DEBUG = 0xa, 6108 WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */ 6109 }; 6110 6111 struct wmi_peer_set_param_cmd { 6112 __le32 vdev_id; 6113 struct wmi_mac_addr peer_macaddr; 6114 __le32 param_id; 6115 __le32 param_value; 6116 } __packed; 6117 6118 #define MAX_SUPPORTED_RATES 128 6119 6120 struct wmi_rate_set { 6121 /* total number of rates */ 6122 __le32 num_rates; 6123 /* 6124 * rates (each 8bit value) packed into a 32 bit word. 6125 * the rates are filled from least significant byte to most 6126 * significant byte. 6127 */ 6128 __le32 rates[(MAX_SUPPORTED_RATES / 4) + 1]; 6129 } __packed; 6130 6131 struct wmi_rate_set_arg { 6132 unsigned int num_rates; 6133 u8 rates[MAX_SUPPORTED_RATES]; 6134 }; 6135 6136 /* 6137 * NOTE: It would bea good idea to represent the Tx MCS 6138 * info in one word and Rx in another word. This is split 6139 * into multiple words for convenience 6140 */ 6141 struct wmi_vht_rate_set { 6142 __le32 rx_max_rate; /* Max Rx data rate */ 6143 __le32 rx_mcs_set; /* Negotiated RX VHT rates */ 6144 __le32 tx_max_rate; /* Max Tx data rate */ 6145 __le32 tx_mcs_set; /* Negotiated TX VHT rates */ 6146 } __packed; 6147 6148 struct wmi_vht_rate_set_arg { 6149 u32 rx_max_rate; 6150 u32 rx_mcs_set; 6151 u32 tx_max_rate; 6152 u32 tx_mcs_set; 6153 }; 6154 6155 struct wmi_peer_set_rates_cmd { 6156 /* peer MAC address */ 6157 struct wmi_mac_addr peer_macaddr; 6158 /* legacy rate set */ 6159 struct wmi_rate_set peer_legacy_rates; 6160 /* ht rate set */ 6161 struct wmi_rate_set peer_ht_rates; 6162 } __packed; 6163 6164 struct wmi_peer_set_q_empty_callback_cmd { 6165 /* unique id identifying the VDEV, generated by the caller */ 6166 __le32 vdev_id; 6167 /* peer MAC address */ 6168 struct wmi_mac_addr peer_macaddr; 6169 __le32 callback_enable; 6170 } __packed; 6171 6172 struct wmi_peer_flags_map { 6173 u32 auth; 6174 u32 qos; 6175 u32 need_ptk_4_way; 6176 u32 need_gtk_2_way; 6177 u32 apsd; 6178 u32 ht; 6179 u32 bw40; 6180 u32 stbc; 6181 u32 ldbc; 6182 u32 dyn_mimops; 6183 u32 static_mimops; 6184 u32 spatial_mux; 6185 u32 vht; 6186 u32 bw80; 6187 u32 vht_2g; 6188 u32 pmf; 6189 u32 bw160; 6190 }; 6191 6192 enum wmi_peer_flags { 6193 WMI_PEER_AUTH = 0x00000001, 6194 WMI_PEER_QOS = 0x00000002, 6195 WMI_PEER_NEED_PTK_4_WAY = 0x00000004, 6196 WMI_PEER_NEED_GTK_2_WAY = 0x00000010, 6197 WMI_PEER_APSD = 0x00000800, 6198 WMI_PEER_HT = 0x00001000, 6199 WMI_PEER_40MHZ = 0x00002000, 6200 WMI_PEER_STBC = 0x00008000, 6201 WMI_PEER_LDPC = 0x00010000, 6202 WMI_PEER_DYN_MIMOPS = 0x00020000, 6203 WMI_PEER_STATIC_MIMOPS = 0x00040000, 6204 WMI_PEER_SPATIAL_MUX = 0x00200000, 6205 WMI_PEER_VHT = 0x02000000, 6206 WMI_PEER_80MHZ = 0x04000000, 6207 WMI_PEER_VHT_2G = 0x08000000, 6208 WMI_PEER_PMF = 0x10000000, 6209 WMI_PEER_160MHZ = 0x20000000 6210 }; 6211 6212 enum wmi_10x_peer_flags { 6213 WMI_10X_PEER_AUTH = 0x00000001, 6214 WMI_10X_PEER_QOS = 0x00000002, 6215 WMI_10X_PEER_NEED_PTK_4_WAY = 0x00000004, 6216 WMI_10X_PEER_NEED_GTK_2_WAY = 0x00000010, 6217 WMI_10X_PEER_APSD = 0x00000800, 6218 WMI_10X_PEER_HT = 0x00001000, 6219 WMI_10X_PEER_40MHZ = 0x00002000, 6220 WMI_10X_PEER_STBC = 0x00008000, 6221 WMI_10X_PEER_LDPC = 0x00010000, 6222 WMI_10X_PEER_DYN_MIMOPS = 0x00020000, 6223 WMI_10X_PEER_STATIC_MIMOPS = 0x00040000, 6224 WMI_10X_PEER_SPATIAL_MUX = 0x00200000, 6225 WMI_10X_PEER_VHT = 0x02000000, 6226 WMI_10X_PEER_80MHZ = 0x04000000, 6227 WMI_10X_PEER_160MHZ = 0x20000000 6228 }; 6229 6230 enum wmi_10_2_peer_flags { 6231 WMI_10_2_PEER_AUTH = 0x00000001, 6232 WMI_10_2_PEER_QOS = 0x00000002, 6233 WMI_10_2_PEER_NEED_PTK_4_WAY = 0x00000004, 6234 WMI_10_2_PEER_NEED_GTK_2_WAY = 0x00000010, 6235 WMI_10_2_PEER_APSD = 0x00000800, 6236 WMI_10_2_PEER_HT = 0x00001000, 6237 WMI_10_2_PEER_40MHZ = 0x00002000, 6238 WMI_10_2_PEER_STBC = 0x00008000, 6239 WMI_10_2_PEER_LDPC = 0x00010000, 6240 WMI_10_2_PEER_DYN_MIMOPS = 0x00020000, 6241 WMI_10_2_PEER_STATIC_MIMOPS = 0x00040000, 6242 WMI_10_2_PEER_SPATIAL_MUX = 0x00200000, 6243 WMI_10_2_PEER_VHT = 0x02000000, 6244 WMI_10_2_PEER_80MHZ = 0x04000000, 6245 WMI_10_2_PEER_VHT_2G = 0x08000000, 6246 WMI_10_2_PEER_PMF = 0x10000000, 6247 WMI_10_2_PEER_160MHZ = 0x20000000 6248 }; 6249 6250 /* 6251 * Peer rate capabilities. 6252 * 6253 * This is of interest to the ratecontrol 6254 * module which resides in the firmware. The bit definitions are 6255 * consistent with that defined in if_athrate.c. 6256 */ 6257 #define WMI_RC_DS_FLAG 0x01 6258 #define WMI_RC_CW40_FLAG 0x02 6259 #define WMI_RC_SGI_FLAG 0x04 6260 #define WMI_RC_HT_FLAG 0x08 6261 #define WMI_RC_RTSCTS_FLAG 0x10 6262 #define WMI_RC_TX_STBC_FLAG 0x20 6263 #define WMI_RC_RX_STBC_FLAG 0xC0 6264 #define WMI_RC_RX_STBC_FLAG_S 6 6265 #define WMI_RC_WEP_TKIP_FLAG 0x100 6266 #define WMI_RC_TS_FLAG 0x200 6267 #define WMI_RC_UAPSD_FLAG 0x400 6268 6269 /* Maximum listen interval supported by hw in units of beacon interval */ 6270 #define ATH10K_MAX_HW_LISTEN_INTERVAL 5 6271 6272 struct wmi_common_peer_assoc_complete_cmd { 6273 struct wmi_mac_addr peer_macaddr; 6274 __le32 vdev_id; 6275 __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */ 6276 __le32 peer_associd; /* 16 LSBs */ 6277 __le32 peer_flags; 6278 __le32 peer_caps; /* 16 LSBs */ 6279 __le32 peer_listen_intval; 6280 __le32 peer_ht_caps; 6281 __le32 peer_max_mpdu; 6282 __le32 peer_mpdu_density; /* 0..16 */ 6283 __le32 peer_rate_caps; 6284 struct wmi_rate_set peer_legacy_rates; 6285 struct wmi_rate_set peer_ht_rates; 6286 __le32 peer_nss; /* num of spatial streams */ 6287 __le32 peer_vht_caps; 6288 __le32 peer_phymode; 6289 struct wmi_vht_rate_set peer_vht_rates; 6290 }; 6291 6292 struct wmi_main_peer_assoc_complete_cmd { 6293 struct wmi_common_peer_assoc_complete_cmd cmd; 6294 6295 /* HT Operation Element of the peer. Five bytes packed in 2 6296 * INT32 array and filled from lsb to msb. 6297 */ 6298 __le32 peer_ht_info[2]; 6299 } __packed; 6300 6301 struct wmi_10_1_peer_assoc_complete_cmd { 6302 struct wmi_common_peer_assoc_complete_cmd cmd; 6303 } __packed; 6304 6305 #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0 6306 #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f 6307 #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4 6308 #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0 6309 6310 struct wmi_10_2_peer_assoc_complete_cmd { 6311 struct wmi_common_peer_assoc_complete_cmd cmd; 6312 __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */ 6313 } __packed; 6314 6315 #define PEER_BW_RXNSS_OVERRIDE_OFFSET 31 6316 6317 struct wmi_10_4_peer_assoc_complete_cmd { 6318 struct wmi_10_2_peer_assoc_complete_cmd cmd; 6319 __le32 peer_bw_rxnss_override; 6320 } __packed; 6321 6322 struct wmi_peer_assoc_complete_arg { 6323 u8 addr[ETH_ALEN]; 6324 u32 vdev_id; 6325 bool peer_reassoc; 6326 u16 peer_aid; 6327 u32 peer_flags; /* see %WMI_PEER_ */ 6328 u16 peer_caps; 6329 u32 peer_listen_intval; 6330 u32 peer_ht_caps; 6331 u32 peer_max_mpdu; 6332 u32 peer_mpdu_density; /* 0..16 */ 6333 u32 peer_rate_caps; /* see %WMI_RC_ */ 6334 struct wmi_rate_set_arg peer_legacy_rates; 6335 struct wmi_rate_set_arg peer_ht_rates; 6336 u32 peer_num_spatial_streams; 6337 u32 peer_vht_caps; 6338 enum wmi_phy_mode peer_phymode; 6339 struct wmi_vht_rate_set_arg peer_vht_rates; 6340 u32 peer_bw_rxnss_override; 6341 }; 6342 6343 struct wmi_peer_add_wds_entry_cmd { 6344 /* peer MAC address */ 6345 struct wmi_mac_addr peer_macaddr; 6346 /* wds MAC addr */ 6347 struct wmi_mac_addr wds_macaddr; 6348 } __packed; 6349 6350 struct wmi_peer_remove_wds_entry_cmd { 6351 /* wds MAC addr */ 6352 struct wmi_mac_addr wds_macaddr; 6353 } __packed; 6354 6355 struct wmi_peer_q_empty_callback_event { 6356 /* peer MAC address */ 6357 struct wmi_mac_addr peer_macaddr; 6358 } __packed; 6359 6360 /* 6361 * Channel info WMI event 6362 */ 6363 struct wmi_chan_info_event { 6364 __le32 err_code; 6365 __le32 freq; 6366 __le32 cmd_flags; 6367 __le32 noise_floor; 6368 __le32 rx_clear_count; 6369 __le32 cycle_count; 6370 } __packed; 6371 6372 struct wmi_10_4_chan_info_event { 6373 __le32 err_code; 6374 __le32 freq; 6375 __le32 cmd_flags; 6376 __le32 noise_floor; 6377 __le32 rx_clear_count; 6378 __le32 cycle_count; 6379 __le32 chan_tx_pwr_range; 6380 __le32 chan_tx_pwr_tp; 6381 __le32 rx_frame_count; 6382 } __packed; 6383 6384 struct wmi_peer_sta_kickout_event { 6385 struct wmi_mac_addr peer_macaddr; 6386 } __packed; 6387 6388 #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0) 6389 #define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1) 6390 6391 /* Beacon filter wmi command info */ 6392 #define BCN_FLT_MAX_SUPPORTED_IES 256 6393 #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32) 6394 6395 struct bss_bcn_stats { 6396 __le32 vdev_id; 6397 __le32 bss_bcnsdropped; 6398 __le32 bss_bcnsdelivered; 6399 } __packed; 6400 6401 struct bcn_filter_stats { 6402 __le32 bcns_dropped; 6403 __le32 bcns_delivered; 6404 __le32 activefilters; 6405 struct bss_bcn_stats bss_stats; 6406 } __packed; 6407 6408 struct wmi_add_bcn_filter_cmd { 6409 u32 vdev_id; 6410 u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST]; 6411 } __packed; 6412 6413 enum wmi_sta_keepalive_method { 6414 WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1, 6415 WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2, 6416 }; 6417 6418 #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0 6419 6420 /* Firmware crashes if keepalive interval exceeds this limit */ 6421 #define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff 6422 6423 /* note: ip4 addresses are in network byte order, i.e. big endian */ 6424 struct wmi_sta_keepalive_arp_resp { 6425 __be32 src_ip4_addr; 6426 __be32 dest_ip4_addr; 6427 struct wmi_mac_addr dest_mac_addr; 6428 } __packed; 6429 6430 struct wmi_sta_keepalive_cmd { 6431 __le32 vdev_id; 6432 __le32 enabled; 6433 __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */ 6434 __le32 interval; /* in seconds */ 6435 struct wmi_sta_keepalive_arp_resp arp_resp; 6436 } __packed; 6437 6438 struct wmi_sta_keepalive_arg { 6439 u32 vdev_id; 6440 u32 enabled; 6441 u32 method; 6442 u32 interval; 6443 __be32 src_ip4_addr; 6444 __be32 dest_ip4_addr; 6445 const u8 dest_mac_addr[ETH_ALEN]; 6446 }; 6447 6448 enum wmi_force_fw_hang_type { 6449 WMI_FORCE_FW_HANG_ASSERT = 1, 6450 WMI_FORCE_FW_HANG_NO_DETECT, 6451 WMI_FORCE_FW_HANG_CTRL_EP_FULL, 6452 WMI_FORCE_FW_HANG_EMPTY_POINT, 6453 WMI_FORCE_FW_HANG_STACK_OVERFLOW, 6454 WMI_FORCE_FW_HANG_INFINITE_LOOP, 6455 }; 6456 6457 #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF 6458 6459 struct wmi_force_fw_hang_cmd { 6460 __le32 type; 6461 __le32 delay_ms; 6462 } __packed; 6463 6464 enum ath10k_dbglog_level { 6465 ATH10K_DBGLOG_LEVEL_VERBOSE = 0, 6466 ATH10K_DBGLOG_LEVEL_INFO = 1, 6467 ATH10K_DBGLOG_LEVEL_WARN = 2, 6468 ATH10K_DBGLOG_LEVEL_ERR = 3, 6469 }; 6470 6471 /* VAP ids to enable dbglog */ 6472 #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0 6473 #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff 6474 6475 /* to enable dbglog in the firmware */ 6476 #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16 6477 #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000 6478 6479 /* timestamp resolution */ 6480 #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17 6481 #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000 6482 6483 /* number of queued messages before sending them to the host */ 6484 #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20 6485 #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000 6486 6487 /* 6488 * Log levels to enable. This defines the minimum level to enable, this is 6489 * not a bitmask. See enum ath10k_dbglog_level for the values. 6490 */ 6491 #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28 6492 #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000 6493 6494 /* 6495 * Note: this is a cleaned up version of a struct firmware uses. For 6496 * example, config_valid was hidden inside an array. 6497 */ 6498 struct wmi_dbglog_cfg_cmd { 6499 /* bitmask to hold mod id config*/ 6500 __le32 module_enable; 6501 6502 /* see ATH10K_DBGLOG_CFG_ */ 6503 __le32 config_enable; 6504 6505 /* mask of module id bits to be changed */ 6506 __le32 module_valid; 6507 6508 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */ 6509 __le32 config_valid; 6510 } __packed; 6511 6512 struct wmi_10_4_dbglog_cfg_cmd { 6513 /* bitmask to hold mod id config*/ 6514 __le64 module_enable; 6515 6516 /* see ATH10K_DBGLOG_CFG_ */ 6517 __le32 config_enable; 6518 6519 /* mask of module id bits to be changed */ 6520 __le64 module_valid; 6521 6522 /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */ 6523 __le32 config_valid; 6524 } __packed; 6525 6526 enum wmi_roam_reason { 6527 WMI_ROAM_REASON_BETTER_AP = 1, 6528 WMI_ROAM_REASON_BEACON_MISS = 2, 6529 WMI_ROAM_REASON_LOW_RSSI = 3, 6530 WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4, 6531 WMI_ROAM_REASON_HO_FAILED = 5, 6532 6533 /* keep last */ 6534 WMI_ROAM_REASON_MAX, 6535 }; 6536 6537 struct wmi_roam_ev { 6538 __le32 vdev_id; 6539 __le32 reason; 6540 } __packed; 6541 6542 #define ATH10K_FRAGMT_THRESHOLD_MIN 540 6543 #define ATH10K_FRAGMT_THRESHOLD_MAX 2346 6544 6545 #define WMI_MAX_EVENT 0x1000 6546 /* Maximum number of pending TXed WMI packets */ 6547 #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr) 6548 6549 /* By default disable power save for IBSS */ 6550 #define ATH10K_DEFAULT_ATIM 0 6551 6552 #define WMI_MAX_MEM_REQS 16 6553 6554 struct wmi_scan_ev_arg { 6555 __le32 event_type; /* %WMI_SCAN_EVENT_ */ 6556 __le32 reason; /* %WMI_SCAN_REASON_ */ 6557 __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */ 6558 __le32 scan_req_id; 6559 __le32 scan_id; 6560 __le32 vdev_id; 6561 }; 6562 6563 struct wmi_mgmt_rx_ev_arg { 6564 __le32 channel; 6565 __le32 snr; 6566 __le32 rate; 6567 __le32 phy_mode; 6568 __le32 buf_len; 6569 __le32 status; /* %WMI_RX_STATUS_ */ 6570 struct wmi_mgmt_rx_ext_info ext_info; 6571 }; 6572 6573 struct wmi_ch_info_ev_arg { 6574 __le32 err_code; 6575 __le32 freq; 6576 __le32 cmd_flags; 6577 __le32 noise_floor; 6578 __le32 rx_clear_count; 6579 __le32 cycle_count; 6580 __le32 chan_tx_pwr_range; 6581 __le32 chan_tx_pwr_tp; 6582 __le32 rx_frame_count; 6583 }; 6584 6585 struct wmi_vdev_start_ev_arg { 6586 __le32 vdev_id; 6587 __le32 req_id; 6588 __le32 resp_type; /* %WMI_VDEV_RESP_ */ 6589 __le32 status; 6590 }; 6591 6592 struct wmi_peer_kick_ev_arg { 6593 const u8 *mac_addr; 6594 }; 6595 6596 struct wmi_swba_ev_arg { 6597 __le32 vdev_map; 6598 struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV]; 6599 const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV]; 6600 }; 6601 6602 struct wmi_phyerr_ev_arg { 6603 u32 tsf_timestamp; 6604 u16 freq1; 6605 u16 freq2; 6606 u8 rssi_combined; 6607 u8 chan_width_mhz; 6608 u8 phy_err_code; 6609 u16 nf_chains[4]; 6610 u32 buf_len; 6611 const u8 *buf; 6612 u8 hdr_len; 6613 }; 6614 6615 struct wmi_phyerr_hdr_arg { 6616 u32 num_phyerrs; 6617 u32 tsf_l32; 6618 u32 tsf_u32; 6619 u32 buf_len; 6620 const void *phyerrs; 6621 }; 6622 6623 struct wmi_svc_rdy_ev_arg { 6624 __le32 min_tx_power; 6625 __le32 max_tx_power; 6626 __le32 ht_cap; 6627 __le32 vht_cap; 6628 __le32 sw_ver0; 6629 __le32 sw_ver1; 6630 __le32 fw_build; 6631 __le32 phy_capab; 6632 __le32 num_rf_chains; 6633 __le32 eeprom_rd; 6634 __le32 num_mem_reqs; 6635 __le32 low_5ghz_chan; 6636 __le32 high_5ghz_chan; 6637 const __le32 *service_map; 6638 size_t service_map_len; 6639 const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS]; 6640 }; 6641 6642 struct wmi_rdy_ev_arg { 6643 __le32 sw_version; 6644 __le32 abi_version; 6645 __le32 status; 6646 const u8 *mac_addr; 6647 }; 6648 6649 struct wmi_roam_ev_arg { 6650 __le32 vdev_id; 6651 __le32 reason; 6652 __le32 rssi; 6653 }; 6654 6655 struct wmi_echo_ev_arg { 6656 __le32 value; 6657 }; 6658 6659 struct wmi_pdev_temperature_event { 6660 /* temperature value in Celcius degree */ 6661 __le32 temperature; 6662 } __packed; 6663 6664 struct wmi_pdev_bss_chan_info_event { 6665 __le32 freq; 6666 __le32 noise_floor; 6667 __le64 cycle_busy; 6668 __le64 cycle_total; 6669 __le64 cycle_tx; 6670 __le64 cycle_rx; 6671 __le64 cycle_rx_bss; 6672 __le32 reserved; 6673 } __packed; 6674 6675 /* WOW structures */ 6676 enum wmi_wow_wakeup_event { 6677 WOW_BMISS_EVENT = 0, 6678 WOW_BETTER_AP_EVENT, 6679 WOW_DEAUTH_RECVD_EVENT, 6680 WOW_MAGIC_PKT_RECVD_EVENT, 6681 WOW_GTK_ERR_EVENT, 6682 WOW_FOURWAY_HSHAKE_EVENT, 6683 WOW_EAPOL_RECVD_EVENT, 6684 WOW_NLO_DETECTED_EVENT, 6685 WOW_DISASSOC_RECVD_EVENT, 6686 WOW_PATTERN_MATCH_EVENT, 6687 WOW_CSA_IE_EVENT, 6688 WOW_PROBE_REQ_WPS_IE_EVENT, 6689 WOW_AUTH_REQ_EVENT, 6690 WOW_ASSOC_REQ_EVENT, 6691 WOW_HTT_EVENT, 6692 WOW_RA_MATCH_EVENT, 6693 WOW_HOST_AUTO_SHUTDOWN_EVENT, 6694 WOW_IOAC_MAGIC_EVENT, 6695 WOW_IOAC_SHORT_EVENT, 6696 WOW_IOAC_EXTEND_EVENT, 6697 WOW_IOAC_TIMER_EVENT, 6698 WOW_DFS_PHYERR_RADAR_EVENT, 6699 WOW_BEACON_EVENT, 6700 WOW_CLIENT_KICKOUT_EVENT, 6701 WOW_EVENT_MAX, 6702 }; 6703 6704 #define C2S(x) case x: return #x 6705 6706 static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev) 6707 { 6708 switch (ev) { 6709 C2S(WOW_BMISS_EVENT); 6710 C2S(WOW_BETTER_AP_EVENT); 6711 C2S(WOW_DEAUTH_RECVD_EVENT); 6712 C2S(WOW_MAGIC_PKT_RECVD_EVENT); 6713 C2S(WOW_GTK_ERR_EVENT); 6714 C2S(WOW_FOURWAY_HSHAKE_EVENT); 6715 C2S(WOW_EAPOL_RECVD_EVENT); 6716 C2S(WOW_NLO_DETECTED_EVENT); 6717 C2S(WOW_DISASSOC_RECVD_EVENT); 6718 C2S(WOW_PATTERN_MATCH_EVENT); 6719 C2S(WOW_CSA_IE_EVENT); 6720 C2S(WOW_PROBE_REQ_WPS_IE_EVENT); 6721 C2S(WOW_AUTH_REQ_EVENT); 6722 C2S(WOW_ASSOC_REQ_EVENT); 6723 C2S(WOW_HTT_EVENT); 6724 C2S(WOW_RA_MATCH_EVENT); 6725 C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT); 6726 C2S(WOW_IOAC_MAGIC_EVENT); 6727 C2S(WOW_IOAC_SHORT_EVENT); 6728 C2S(WOW_IOAC_EXTEND_EVENT); 6729 C2S(WOW_IOAC_TIMER_EVENT); 6730 C2S(WOW_DFS_PHYERR_RADAR_EVENT); 6731 C2S(WOW_BEACON_EVENT); 6732 C2S(WOW_CLIENT_KICKOUT_EVENT); 6733 C2S(WOW_EVENT_MAX); 6734 default: 6735 return NULL; 6736 } 6737 } 6738 6739 enum wmi_wow_wake_reason { 6740 WOW_REASON_UNSPECIFIED = -1, 6741 WOW_REASON_NLOD = 0, 6742 WOW_REASON_AP_ASSOC_LOST, 6743 WOW_REASON_LOW_RSSI, 6744 WOW_REASON_DEAUTH_RECVD, 6745 WOW_REASON_DISASSOC_RECVD, 6746 WOW_REASON_GTK_HS_ERR, 6747 WOW_REASON_EAP_REQ, 6748 WOW_REASON_FOURWAY_HS_RECV, 6749 WOW_REASON_TIMER_INTR_RECV, 6750 WOW_REASON_PATTERN_MATCH_FOUND, 6751 WOW_REASON_RECV_MAGIC_PATTERN, 6752 WOW_REASON_P2P_DISC, 6753 WOW_REASON_WLAN_HB, 6754 WOW_REASON_CSA_EVENT, 6755 WOW_REASON_PROBE_REQ_WPS_IE_RECV, 6756 WOW_REASON_AUTH_REQ_RECV, 6757 WOW_REASON_ASSOC_REQ_RECV, 6758 WOW_REASON_HTT_EVENT, 6759 WOW_REASON_RA_MATCH, 6760 WOW_REASON_HOST_AUTO_SHUTDOWN, 6761 WOW_REASON_IOAC_MAGIC_EVENT, 6762 WOW_REASON_IOAC_SHORT_EVENT, 6763 WOW_REASON_IOAC_EXTEND_EVENT, 6764 WOW_REASON_IOAC_TIMER_EVENT, 6765 WOW_REASON_ROAM_HO, 6766 WOW_REASON_DFS_PHYERR_RADADR_EVENT, 6767 WOW_REASON_BEACON_RECV, 6768 WOW_REASON_CLIENT_KICKOUT_EVENT, 6769 WOW_REASON_DEBUG_TEST = 0xFF, 6770 }; 6771 6772 static inline const char *wow_reason(enum wmi_wow_wake_reason reason) 6773 { 6774 switch (reason) { 6775 C2S(WOW_REASON_UNSPECIFIED); 6776 C2S(WOW_REASON_NLOD); 6777 C2S(WOW_REASON_AP_ASSOC_LOST); 6778 C2S(WOW_REASON_LOW_RSSI); 6779 C2S(WOW_REASON_DEAUTH_RECVD); 6780 C2S(WOW_REASON_DISASSOC_RECVD); 6781 C2S(WOW_REASON_GTK_HS_ERR); 6782 C2S(WOW_REASON_EAP_REQ); 6783 C2S(WOW_REASON_FOURWAY_HS_RECV); 6784 C2S(WOW_REASON_TIMER_INTR_RECV); 6785 C2S(WOW_REASON_PATTERN_MATCH_FOUND); 6786 C2S(WOW_REASON_RECV_MAGIC_PATTERN); 6787 C2S(WOW_REASON_P2P_DISC); 6788 C2S(WOW_REASON_WLAN_HB); 6789 C2S(WOW_REASON_CSA_EVENT); 6790 C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV); 6791 C2S(WOW_REASON_AUTH_REQ_RECV); 6792 C2S(WOW_REASON_ASSOC_REQ_RECV); 6793 C2S(WOW_REASON_HTT_EVENT); 6794 C2S(WOW_REASON_RA_MATCH); 6795 C2S(WOW_REASON_HOST_AUTO_SHUTDOWN); 6796 C2S(WOW_REASON_IOAC_MAGIC_EVENT); 6797 C2S(WOW_REASON_IOAC_SHORT_EVENT); 6798 C2S(WOW_REASON_IOAC_EXTEND_EVENT); 6799 C2S(WOW_REASON_IOAC_TIMER_EVENT); 6800 C2S(WOW_REASON_ROAM_HO); 6801 C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT); 6802 C2S(WOW_REASON_BEACON_RECV); 6803 C2S(WOW_REASON_CLIENT_KICKOUT_EVENT); 6804 C2S(WOW_REASON_DEBUG_TEST); 6805 default: 6806 return NULL; 6807 } 6808 } 6809 6810 #undef C2S 6811 6812 struct wmi_wow_ev_arg { 6813 u32 vdev_id; 6814 u32 flag; 6815 enum wmi_wow_wake_reason wake_reason; 6816 u32 data_len; 6817 }; 6818 6819 #define WOW_MIN_PATTERN_SIZE 1 6820 #define WOW_MAX_PATTERN_SIZE 148 6821 #define WOW_MAX_PKT_OFFSET 128 6822 6823 enum wmi_tdls_state { 6824 WMI_TDLS_DISABLE, 6825 WMI_TDLS_ENABLE_PASSIVE, 6826 WMI_TDLS_ENABLE_ACTIVE, 6827 WMI_TDLS_ENABLE_ACTIVE_EXTERNAL_CONTROL, 6828 }; 6829 6830 enum wmi_tdls_peer_state { 6831 WMI_TDLS_PEER_STATE_PEERING, 6832 WMI_TDLS_PEER_STATE_CONNECTED, 6833 WMI_TDLS_PEER_STATE_TEARDOWN, 6834 }; 6835 6836 struct wmi_tdls_peer_update_cmd_arg { 6837 u32 vdev_id; 6838 enum wmi_tdls_peer_state peer_state; 6839 u8 addr[ETH_ALEN]; 6840 }; 6841 6842 #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32 6843 6844 #define WMI_TDLS_PEER_SP_MASK 0x60 6845 #define WMI_TDLS_PEER_SP_LSB 5 6846 6847 enum wmi_tdls_options { 6848 WMI_TDLS_OFFCHAN_EN = BIT(0), 6849 WMI_TDLS_BUFFER_STA_EN = BIT(1), 6850 WMI_TDLS_SLEEP_STA_EN = BIT(2), 6851 }; 6852 6853 enum { 6854 WMI_TDLS_PEER_QOS_AC_VO = BIT(0), 6855 WMI_TDLS_PEER_QOS_AC_VI = BIT(1), 6856 WMI_TDLS_PEER_QOS_AC_BK = BIT(2), 6857 WMI_TDLS_PEER_QOS_AC_BE = BIT(3), 6858 }; 6859 6860 struct wmi_tdls_peer_capab_arg { 6861 u8 peer_uapsd_queues; 6862 u8 peer_max_sp; 6863 u32 buff_sta_support; 6864 u32 off_chan_support; 6865 u32 peer_curr_operclass; 6866 u32 self_curr_operclass; 6867 u32 peer_chan_len; 6868 u32 peer_operclass_len; 6869 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES]; 6870 u32 is_peer_responder; 6871 u32 pref_offchan_num; 6872 u32 pref_offchan_bw; 6873 }; 6874 6875 struct wmi_10_4_tdls_set_state_cmd { 6876 __le32 vdev_id; 6877 __le32 state; 6878 __le32 notification_interval_ms; 6879 __le32 tx_discovery_threshold; 6880 __le32 tx_teardown_threshold; 6881 __le32 rssi_teardown_threshold; 6882 __le32 rssi_delta; 6883 __le32 tdls_options; 6884 __le32 tdls_peer_traffic_ind_window; 6885 __le32 tdls_peer_traffic_response_timeout_ms; 6886 __le32 tdls_puapsd_mask; 6887 __le32 tdls_puapsd_inactivity_time_ms; 6888 __le32 tdls_puapsd_rx_frame_threshold; 6889 __le32 teardown_notification_ms; 6890 __le32 tdls_peer_kickout_threshold; 6891 } __packed; 6892 6893 struct wmi_tdls_peer_capabilities { 6894 __le32 peer_qos; 6895 __le32 buff_sta_support; 6896 __le32 off_chan_support; 6897 __le32 peer_curr_operclass; 6898 __le32 self_curr_operclass; 6899 __le32 peer_chan_len; 6900 __le32 peer_operclass_len; 6901 u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES]; 6902 __le32 is_peer_responder; 6903 __le32 pref_offchan_num; 6904 __le32 pref_offchan_bw; 6905 struct wmi_channel peer_chan_list[1]; 6906 } __packed; 6907 6908 struct wmi_10_4_tdls_peer_update_cmd { 6909 __le32 vdev_id; 6910 struct wmi_mac_addr peer_macaddr; 6911 __le32 peer_state; 6912 __le32 reserved[4]; 6913 struct wmi_tdls_peer_capabilities peer_capab; 6914 } __packed; 6915 6916 enum wmi_tdls_peer_reason { 6917 WMI_TDLS_TEARDOWN_REASON_TX, 6918 WMI_TDLS_TEARDOWN_REASON_RSSI, 6919 WMI_TDLS_TEARDOWN_REASON_SCAN, 6920 WMI_TDLS_DISCONNECTED_REASON_PEER_DELETE, 6921 WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT, 6922 WMI_TDLS_TEARDOWN_REASON_BAD_PTR, 6923 WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE, 6924 WMI_TDLS_ENTER_BUF_STA, 6925 WMI_TDLS_EXIT_BUF_STA, 6926 WMI_TDLS_ENTER_BT_BUSY_MODE, 6927 WMI_TDLS_EXIT_BT_BUSY_MODE, 6928 WMI_TDLS_SCAN_STARTED_EVENT, 6929 WMI_TDLS_SCAN_COMPLETED_EVENT, 6930 }; 6931 6932 enum wmi_tdls_peer_notification { 6933 WMI_TDLS_SHOULD_DISCOVER, 6934 WMI_TDLS_SHOULD_TEARDOWN, 6935 WMI_TDLS_PEER_DISCONNECTED, 6936 WMI_TDLS_CONNECTION_TRACKER_NOTIFICATION, 6937 }; 6938 6939 struct wmi_tdls_peer_event { 6940 struct wmi_mac_addr peer_macaddr; 6941 /* see enum wmi_tdls_peer_notification*/ 6942 __le32 peer_status; 6943 /* see enum wmi_tdls_peer_reason */ 6944 __le32 peer_reason; 6945 __le32 vdev_id; 6946 } __packed; 6947 6948 enum wmi_txbf_conf { 6949 WMI_TXBF_CONF_UNSUPPORTED, 6950 WMI_TXBF_CONF_BEFORE_ASSOC, 6951 WMI_TXBF_CONF_AFTER_ASSOC, 6952 }; 6953 6954 #define WMI_CCA_DETECT_LEVEL_AUTO 0 6955 #define WMI_CCA_DETECT_MARGIN_AUTO 0 6956 6957 struct wmi_pdev_set_adaptive_cca_params { 6958 __le32 enable; 6959 __le32 cca_detect_level; 6960 __le32 cca_detect_margin; 6961 } __packed; 6962 6963 enum wmi_host_platform_type { 6964 WMI_HOST_PLATFORM_HIGH_PERF, 6965 WMI_HOST_PLATFORM_LOW_PERF, 6966 }; 6967 6968 enum wmi_bss_survey_req_type { 6969 WMI_BSS_SURVEY_REQ_TYPE_READ = 1, 6970 WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR, 6971 }; 6972 6973 struct wmi_pdev_chan_info_req_cmd { 6974 __le32 type; 6975 __le32 reserved; 6976 } __packed; 6977 6978 struct ath10k; 6979 struct ath10k_vif; 6980 struct ath10k_fw_stats_pdev; 6981 struct ath10k_fw_stats_peer; 6982 struct ath10k_fw_stats; 6983 6984 int ath10k_wmi_attach(struct ath10k *ar); 6985 void ath10k_wmi_detach(struct ath10k *ar); 6986 void ath10k_wmi_free_host_mem(struct ath10k *ar); 6987 int ath10k_wmi_wait_for_service_ready(struct ath10k *ar); 6988 int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar); 6989 6990 struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len); 6991 int ath10k_wmi_connect(struct ath10k *ar); 6992 6993 struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len); 6994 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); 6995 int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb, 6996 u32 cmd_id); 6997 void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *arg); 6998 6999 void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src, 7000 struct ath10k_fw_stats_pdev *dst); 7001 void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src, 7002 struct ath10k_fw_stats_pdev *dst); 7003 void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src, 7004 struct ath10k_fw_stats_pdev *dst); 7005 void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src, 7006 struct ath10k_fw_stats_pdev *dst); 7007 void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src, 7008 struct ath10k_fw_stats_peer *dst); 7009 void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar, 7010 struct wmi_host_mem_chunks *chunks); 7011 void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn, 7012 const struct wmi_start_scan_arg *arg); 7013 void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, 7014 const struct wmi_wmm_params_arg *arg); 7015 void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, 7016 const struct wmi_channel_arg *arg); 7017 int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg); 7018 7019 int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb); 7020 int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb); 7021 void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb); 7022 void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb); 7023 int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb); 7024 void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb); 7025 void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb); 7026 void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb); 7027 void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb); 7028 void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb); 7029 void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb); 7030 void ath10k_wmi_event_dfs(struct ath10k *ar, 7031 struct wmi_phyerr_ev_arg *phyerr, u64 tsf); 7032 void ath10k_wmi_event_spectral_scan(struct ath10k *ar, 7033 struct wmi_phyerr_ev_arg *phyerr, 7034 u64 tsf); 7035 void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb); 7036 void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb); 7037 void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb); 7038 void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb); 7039 void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb); 7040 void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb); 7041 void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar, 7042 struct sk_buff *skb); 7043 void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar, 7044 struct sk_buff *skb); 7045 void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb); 7046 void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb); 7047 void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb); 7048 void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb); 7049 void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb); 7050 void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar, 7051 struct sk_buff *skb); 7052 void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb); 7053 void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb); 7054 void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb); 7055 void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar, 7056 struct sk_buff *skb); 7057 void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb); 7058 void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb); 7059 void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb); 7060 void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb); 7061 int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb); 7062 int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf, 7063 int left_len, struct wmi_phyerr_ev_arg *arg); 7064 void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar, 7065 struct ath10k_fw_stats *fw_stats, 7066 char *buf); 7067 void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k *ar, 7068 struct ath10k_fw_stats *fw_stats, 7069 char *buf); 7070 size_t ath10k_wmi_fw_stats_num_peers(struct list_head *head); 7071 size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head); 7072 void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar, 7073 struct ath10k_fw_stats *fw_stats, 7074 char *buf); 7075 int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar, 7076 enum wmi_vdev_subtype subtype); 7077 int ath10k_wmi_barrier(struct ath10k *ar); 7078 void ath10k_wmi_tpc_config_get_rate_code(u8 *rate_code, u16 *pream_table, 7079 u32 num_tx_chain); 7080 void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb); 7081 7082 #endif /* _WMI_H_ */ 7083