1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2017-2026 Morse Micro 4 */ 5 #ifndef _MM81X_COMMAND_DEFS_H_ 6 #define _MM81X_COMMAND_DEFS_H_ 7 8 #include <linux/types.h> 9 10 #define __sle16 __le16 11 #define __sle32 __le32 12 #define __sle64 __le64 13 14 #define HOST_CMD_SEMVER_MAJOR 56 15 #define HOST_CMD_SEMVER_MINOR 17 16 #define HOST_CMD_SEMVER_PATCH 0 17 18 #define HOST_CMD_TYPE_REQ BIT(0) 19 #define HOST_CMD_TYPE_RESP BIT(1) 20 #define HOST_CMD_TYPE_EVT BIT(2) 21 22 #define HOST_CMD_SSID_MAX_LEN 32 23 #define HOST_CMD_MAC_ADDR_LEN 6 24 25 enum host_cmd_id { 26 HOST_CMD_ID_SET_CHANNEL = 0x0001, 27 HOST_CMD_ID_GET_CHANNEL = 0x001D, 28 HOST_CMD_ID_GET_CHANNEL_FULL = 0x0013, 29 HOST_CMD_ID_GET_CHANNEL_DTIM = 0x001C, 30 HOST_CMD_ID_GET_VERSION = 0x0002, 31 HOST_CMD_ID_SET_TXPOWER = 0x0003, 32 HOST_CMD_ID_GET_MAX_TXPOWER = 0x0024, 33 HOST_CMD_ID_ADD_INTERFACE = 0x0004, 34 HOST_CMD_ID_REMOVE_INTERFACE = 0x0005, 35 HOST_CMD_ID_BSS_CONFIG = 0x0006, 36 HOST_CMD_ID_SCAN_CONFIG = 0x0010, 37 HOST_CMD_ID_SET_QOS_PARAMS = 0x0011, 38 HOST_CMD_ID_GET_QOS_PARAMS = 0x0012, 39 HOST_CMD_ID_SET_STA_STATE = 0x0014, 40 HOST_CMD_ID_SET_BSS_COLOR = 0x0015, 41 HOST_CMD_ID_CONFIG_PS = 0x0016, 42 HOST_CMD_ID_HEALTH_CHECK = 0x0019, 43 HOST_CMD_ID_CTS_SELF_PS = 0x001A, 44 HOST_CMD_ID_DTIM_CHANNEL_ENABLE = 0x001B, 45 HOST_CMD_ID_ARP_OFFLOAD = 0x0020, 46 HOST_CMD_ID_SET_LONG_SLEEP_CONFIG = 0x0021, 47 HOST_CMD_ID_SET_DUTY_CYCLE = 0x0022, 48 HOST_CMD_ID_GET_DUTY_CYCLE = 0x0023, 49 HOST_CMD_ID_GET_CAPABILITIES = 0x0025, 50 HOST_CMD_ID_TWT_AGREEMENT_INSTALL = 0x0026, 51 HOST_CMD_ID_TWT_AGREEMENT_VALIDATE = 0x0036, 52 HOST_CMD_ID_TWT_AGREEMENT_REMOVE = 0x0027, 53 HOST_CMD_ID_GET_TSF = 0x0028, 54 HOST_CMD_ID_MAC_ADDR = 0x0029, 55 HOST_CMD_ID_MPSW_CONFIG = 0x0030, 56 HOST_CMD_ID_INSTALL_KEY = 0x000A, 57 HOST_CMD_ID_DISABLE_KEY = 0x000B, 58 HOST_CMD_ID_DHCP_OFFLOAD = 0x0032, 59 HOST_CMD_ID_SET_KEEP_ALIVE_OFFLOAD = 0x0033, 60 HOST_CMD_ID_UPDATE_OUI_FILTER = 0x0034, 61 HOST_CMD_ID_IBSS_CONFIG = 0x0035, 62 HOST_CMD_ID_OCS = 0x0038, 63 HOST_CMD_ID_MESH_CONFIG = 0x0039, 64 HOST_CMD_ID_SET_OFFSET_TSF = 0x003A, 65 HOST_CMD_ID_GET_CHANNEL_USAGE = 0x003B, 66 HOST_CMD_ID_MCAST_FILTER = 0x003C, 67 HOST_CMD_ID_BSS_BEACON_CONFIG = 0x003D, 68 HOST_CMD_ID_UAPSD_CONFIG = 0x0040, 69 HOST_CMD_ID_PAGE_SLICING_CONFIG = 0x0043, 70 HOST_CMD_ID_HW_SCAN = 0x0044, 71 HOST_CMD_ID_SET_WHITELIST = 0x0045, 72 HOST_CMD_ID_ARP_PERIODIC_REFRESH = 0x0046, 73 HOST_CMD_ID_SET_TCP_KEEPALIVE = 0x0047, 74 HOST_CMD_ID_FORCE_POWER_MODE = 0x0048, 75 HOST_CMD_ID_LI_SLEEP = 0x0049, 76 HOST_CMD_ID_GET_DISABLED_CHANNELS = 0x004A, 77 HOST_CMD_ID_SET_CQM_RSSI = 0x004F, 78 HOST_CMD_ID_GET_APF_CAPABILITIES = 0x0050, 79 HOST_CMD_ID_READ_WRITE_APF = 0x0051, 80 HOST_CMD_ID_BSSID_SET = 0x0052, 81 HOST_CMD_ID_BEACON_OFFLOAD = 0x0053, 82 HOST_CMD_ID_PROBE_RESPONSE_OFFLOAD = 0x0054, 83 HOST_CMD_ID_HOST_STATS_LOG = 0x2007, 84 HOST_CMD_ID_HOST_STATS_RESET = 0x2008, 85 HOST_CMD_ID_MAC_STATS_LOG = 0x200C, 86 HOST_CMD_ID_MAC_STATS_RESET = 0x200D, 87 HOST_CMD_ID_UPHY_STATS_LOG = 0x200E, 88 HOST_CMD_ID_UPHY_STATS_RESET = 0x200F, 89 HOST_CMD_ID_SET_STA_TYPE = 0xA000, 90 HOST_CMD_ID_SET_ENC_MODE = 0xA001, 91 HOST_CMD_ID_TEST_BA = 0xA002, 92 HOST_CMD_ID_SET_LISTEN_INTERVAL = 0xA003, 93 HOST_CMD_ID_SET_AMPDU = 0xA004, 94 HOST_CMD_ID_COREDUMP = 0xA006, 95 HOST_CMD_ID_SET_S1G_OP_CLASS = 0xA007, 96 HOST_CMD_ID_SEND_WAKE_ACTION_FRAME = 0xA008, 97 HOST_CMD_ID_VENDOR_IE_CONFIG = 0xA009, 98 HOST_CMD_ID_SET_TWT_CONF = 0xA010, 99 HOST_CMD_ID_GET_AVAILABLE_CHANNELS = 0xA011, 100 HOST_CMD_ID_SET_ECSA_S1G_INFO = 0xA012, 101 HOST_CMD_ID_GET_HW_VERSION = 0xA013, 102 HOST_CMD_ID_CAC = 0xA014, 103 HOST_CMD_ID_DRIVER_SET_DUTY_CYCLE = 0xA015, 104 HOST_CMD_ID_OCS_DRIVER = 0xA017, 105 HOST_CMD_ID_MBSSID = 0xA016, 106 HOST_CMD_ID_SET_MESH_CONFIG = 0xA018, 107 HOST_CMD_ID_SET_MCBA_CONF = 0xA019, 108 HOST_CMD_ID_DYNAMIC_PEERING_CONFIG = 0xA020, 109 HOST_CMD_ID_CONFIG_RAW = 0xA021, 110 HOST_CMD_ID_CONFIG_BSS_STATS = 0xA022, 111 HOST_CMD_ID_GET_RSSI = 0x1002, 112 HOST_CMD_ID_SET_IFS = 0x1003, 113 HOST_CMD_ID_SET_FEM_SETTINGS = 0x1005, 114 HOST_CMD_ID_SET_TXOP = 0x1008, 115 HOST_CMD_ID_SET_CONTROL_RESPONSE = 0x1009, 116 HOST_CMD_ID_SET_PERIODIC_CAL = 0x100A, 117 HOST_CMD_ID_SET_BCN_RSSI_THRESHOLD = 0x100B, 118 HOST_CMD_ID_SET_TX_PKT_LIFETIME_USECS = 0x100C, 119 HOST_CMD_ID_SET_PHYSM_WATCHDOG = 0x100D, 120 HOST_CMD_ID_TX_POLAR = 0x100E, 121 HOST_CMD_ID_EVT_STA_STATE = 0x4001, 122 HOST_CMD_ID_EVT_BEACON_LOSS = 0x4002, 123 HOST_CMD_ID_EVT_SIG_FIELD_ERROR = 0x4003, 124 HOST_CMD_ID_EVT_UMAC_TRAFFIC_CONTROL = 0x4004, 125 HOST_CMD_ID_EVT_DHCP_LEASE_UPDATE = 0x4005, 126 HOST_CMD_ID_EVT_OCS_DONE = 0x4006, 127 HOST_CMD_ID_EVT_HW_SCAN_DONE = 0x4011, 128 HOST_CMD_ID_EVT_CHANNEL_USAGE = 0x4012, 129 HOST_CMD_ID_EVT_CONNECTION_LOSS = 0x4013, 130 HOST_CMD_ID_EVT_SCHED_SCAN_RESULTS = 0x4014, 131 HOST_CMD_ID_EVT_CQM_RSSI_NOTIFY = 0x4015, 132 HOST_CMD_ID_EVT_SCAN_DONE = 0x4007, 133 HOST_CMD_ID_EVT_SCAN_RESULT = 0x4008, 134 HOST_CMD_ID_EVT_CONNECTED = 0x4009, 135 HOST_CMD_ID_EVT_DISCONNECTED = 0x4010, 136 HOST_CMD_ID_EVT_BEACON_FILTER_MATCH = 0x4016, 137 HOST_CMD_ID_SET_CAPABILITIES = 0x8118, 138 HOST_CMD_ID_SET_TRANSMISSION_RATE = 0x8009, 139 HOST_CMD_ID_FORCE_ASSERT = 0x800E, 140 HOST_CMD_ID_GET_SET_GENERIC_PARAM = 0x003E, 141 }; 142 143 struct host_cmd_mac_addr { 144 u8 octet[HOST_CMD_MAC_ADDR_LEN]; 145 }; 146 147 enum host_cmd_ocs_subcmd { 148 HOST_CMD_OCS_SUBCMD_CONFIG = 1, 149 HOST_CMD_OCS_SUBCMD_STATUS = 2, 150 }; 151 152 enum host_cmd_headless_cfg_option { 153 HOST_CMD_HEADLESS_CFG_OPTION_KEEP_IFACES = BIT(0), 154 HOST_CMD_HEADLESS_CFG_OPTION_BUFFER_RX = BIT(1), 155 HOST_CMD_HEADLESS_CFG_OPTION_NOTIFY_ON_ANY_RX = BIT(2), 156 }; 157 158 struct host_cmd_header { 159 __le16 flags; 160 __le16 message_id; 161 __le16 len; 162 __le16 host_id; 163 __le16 vif_id; 164 __le16 pad; 165 }; 166 167 #define HOST_CMD_CHANNEL_BW_NOT_SET 0xFF 168 #define HOST_CMD_CHANNEL_IDX_NOT_SET 0xFF 169 #define HOST_CMD_CHANNEL_FREQ_NOT_SET 0xFFFFFFFF 170 171 enum host_cmd_dot11_proto_mode { 172 HOST_CMD_DOT11_PROTO_MODE_AH = 0, 173 }; 174 175 struct host_cmd_req_set_channel { 176 struct host_cmd_header hdr; 177 __le32 op_chan_freq_hz; 178 u8 op_bw_mhz; 179 u8 pri_bw_mhz; 180 u8 pri_1mhz_chan_idx; 181 u8 dot11_mode; 182 u8 __deprecated_reg_tx_power_set; 183 u8 is_off_channel; 184 } __packed; 185 186 struct host_cmd_resp_set_channel { 187 struct host_cmd_header hdr; 188 __le32 status; 189 __sle32 power_qdbm; 190 } __packed; 191 192 struct host_cmd_req_get_channel { 193 struct host_cmd_header hdr; 194 } __packed; 195 196 struct host_cmd_resp_get_channel { 197 struct host_cmd_header hdr; 198 __le32 status; 199 __le32 op_chan_freq_hz; 200 u8 op_chan_bw_mhz; 201 u8 pri_chan_bw_mhz; 202 u8 pri_1mhz_chan_idx; 203 } __packed; 204 205 #define HOST_CMD_MAX_VERSION_LEN 128 206 207 struct host_cmd_req_get_version { 208 struct host_cmd_header hdr; 209 } __packed; 210 211 struct host_cmd_resp_get_version { 212 struct host_cmd_header hdr; 213 __le32 status; 214 __sle32 length; 215 u8 version[]; 216 } __packed; 217 218 struct host_cmd_req_set_txpower { 219 struct host_cmd_header hdr; 220 __sle32 power_qdbm; 221 } __packed; 222 223 struct host_cmd_resp_set_txpower { 224 struct host_cmd_header hdr; 225 __le32 status; 226 __sle32 power_qdbm; 227 } __packed; 228 229 struct host_cmd_req_get_max_txpower { 230 struct host_cmd_header hdr; 231 } __packed; 232 233 struct host_cmd_resp_get_max_txpower { 234 struct host_cmd_header hdr; 235 __le32 status; 236 __sle32 power_qdbm; 237 } __packed; 238 239 enum host_cmd_interface_type { 240 HOST_CMD_INTERFACE_TYPE_INVALID = 0, 241 HOST_CMD_INTERFACE_TYPE_STA = 1, 242 HOST_CMD_INTERFACE_TYPE_AP = 2, 243 HOST_CMD_INTERFACE_TYPE_MON = 3, 244 HOST_CMD_INTERFACE_TYPE_ADHOC = 4, 245 HOST_CMD_INTERFACE_TYPE_MESH = 5, 246 HOST_CMD_INTERFACE_TYPE_LAST = HOST_CMD_INTERFACE_TYPE_MESH, 247 }; 248 249 struct host_cmd_req_add_interface { 250 struct host_cmd_header hdr; 251 struct host_cmd_mac_addr addr; 252 __le32 interface_type; 253 } __packed; 254 255 struct host_cmd_resp_add_interface { 256 struct host_cmd_header hdr; 257 __le32 status; 258 } __packed; 259 260 struct host_cmd_req_remove_interface { 261 struct host_cmd_header hdr; 262 } __packed; 263 264 struct host_cmd_resp_remove_interface { 265 struct host_cmd_header hdr; 266 __le32 status; 267 } __packed; 268 269 struct host_cmd_req_bss_config { 270 struct host_cmd_header hdr; 271 __le16 beacon_interval_tu; 272 __le16 dtim_period; 273 u8 __padding[2]; 274 __le32 cssid; 275 } __packed; 276 277 struct host_cmd_resp_bss_config { 278 struct host_cmd_header hdr; 279 __le32 status; 280 } __packed; 281 282 struct host_cmd_req_scan_config { 283 struct host_cmd_header hdr; 284 u8 enabled; 285 u8 is_survey; 286 } __packed; 287 288 struct host_cmd_resp_scan_config { 289 struct host_cmd_header hdr; 290 __le32 status; 291 } __packed; 292 293 struct host_cmd_req_set_qos_params { 294 struct host_cmd_header hdr; 295 u8 uapsd; 296 u8 queue_idx; 297 u8 aifs_slot_count; 298 __le16 contention_window_min; 299 __le16 contention_window_max; 300 __le32 max_txop_usec; 301 } __packed; 302 303 struct host_cmd_resp_set_qos_params { 304 struct host_cmd_header hdr; 305 __le32 status; 306 } __packed; 307 308 struct host_cmd_req_get_qos_params { 309 struct host_cmd_header hdr; 310 u8 queue_idx; 311 } __packed; 312 313 struct host_cmd_resp_get_qos_params { 314 struct host_cmd_header hdr; 315 __le32 status; 316 u8 aifs_slot_count; 317 __le16 contention_window_min; 318 __le16 contention_window_max; 319 __le32 max_txop_usec; 320 } __packed; 321 322 struct host_cmd_req_set_sta_state { 323 struct host_cmd_header hdr; 324 u8 sta_addr[HOST_CMD_MAC_ADDR_LEN]; 325 __le16 aid; 326 __le16 state; 327 u8 uapsd_queues; 328 __le32 flags; 329 } __packed; 330 331 struct host_cmd_resp_set_sta_state { 332 struct host_cmd_header hdr; 333 __le32 status; 334 } __packed; 335 336 struct host_cmd_req_set_bss_color { 337 struct host_cmd_header hdr; 338 u8 bss_color; 339 } __packed; 340 341 struct host_cmd_resp_set_bss_color { 342 struct host_cmd_header hdr; 343 __le32 status; 344 } __packed; 345 346 struct host_cmd_req_config_ps { 347 struct host_cmd_header hdr; 348 u8 enabled; 349 u8 dynamic_ps_offload; 350 } __packed; 351 352 struct host_cmd_resp_config_ps { 353 struct host_cmd_header hdr; 354 __le32 status; 355 } __packed; 356 357 struct host_cmd_req_health_check { 358 struct host_cmd_header hdr; 359 } __packed; 360 361 struct host_cmd_resp_health_check { 362 struct host_cmd_header hdr; 363 __le32 status; 364 } __packed; 365 366 struct host_cmd_req_cts_self_ps { 367 struct host_cmd_header hdr; 368 u8 enable; 369 } __packed; 370 371 struct host_cmd_resp_cts_self_ps { 372 struct host_cmd_header hdr; 373 __le32 status; 374 } __packed; 375 376 struct host_cmd_req_dtim_channel_enable { 377 struct host_cmd_header hdr; 378 u8 enable; 379 } __packed; 380 381 struct host_cmd_resp_dtim_channel_enable { 382 struct host_cmd_header hdr; 383 __le32 status; 384 } __packed; 385 386 #define HOST_CMD_ARP_OFFLOAD_MAX_IP_ADDRESSES 4 387 388 struct host_cmd_req_arp_offload { 389 struct host_cmd_header hdr; 390 __be32 ip_table[HOST_CMD_ARP_OFFLOAD_MAX_IP_ADDRESSES]; 391 } __packed; 392 393 struct host_cmd_resp_arp_offload { 394 struct host_cmd_header hdr; 395 __le32 status; 396 } __packed; 397 398 struct host_cmd_req_set_long_sleep_config { 399 struct host_cmd_header hdr; 400 u8 enabled; 401 } __packed; 402 403 struct host_cmd_resp_set_long_sleep_config { 404 struct host_cmd_header hdr; 405 __le32 status; 406 } __packed; 407 408 #define HOST_CMD_DUTY_CYCLE_SET_CFG_DUTY_CYCLE BIT(0) 409 #define HOST_CMD_DUTY_CYCLE_SET_CFG_OMIT_CONTROL_RESP BIT(1) 410 #define HOST_CMD_DUTY_CYCLE_SET_CFG_EXT BIT(2) 411 #define HOST_CMD_DUTY_CYCLE_SET_CFG_BURST_RECORD_UNIT BIT(3) 412 413 enum host_cmd_duty_cycle_mode { 414 HOST_CMD_DUTY_CYCLE_MODE_SPREAD = 0, 415 HOST_CMD_DUTY_CYCLE_MODE_BURST = 1, 416 HOST_CMD_DUTY_CYCLE_MODE_LAST = HOST_CMD_DUTY_CYCLE_MODE_BURST, 417 }; 418 419 struct host_cmd_duty_cycle_configuration { 420 u8 omit_control_responses; 421 __le32 duty_cycle; 422 } __packed; 423 424 struct host_cmd_duty_cycle_set_configuration_ext { 425 __le32 burst_record_unit_us; 426 u8 mode; 427 } __packed; 428 429 struct host_cmd_duty_cycle_configuration_ext { 430 __le32 airtime_remaining_us; 431 __le32 burst_window_duration_us; 432 struct host_cmd_duty_cycle_set_configuration_ext set; 433 } __packed; 434 435 struct host_cmd_req_set_duty_cycle { 436 struct host_cmd_header hdr; 437 struct host_cmd_duty_cycle_configuration config; 438 u8 set_cfgs; 439 struct host_cmd_duty_cycle_set_configuration_ext config_ext; 440 } __packed; 441 442 struct host_cmd_resp_get_duty_cycle { 443 struct host_cmd_header hdr; 444 __le32 status; 445 struct host_cmd_duty_cycle_configuration config; 446 struct host_cmd_duty_cycle_configuration_ext config_ext; 447 } __packed; 448 449 #define HOST_CMD_SET_S1G_CAP_FLAGS BIT(0) 450 #define HOST_CMD_SET_S1G_CAP_AMPDU_MSS BIT(1) 451 #define HOST_CMD_SET_S1G_CAP_BEAM_STS BIT(2) 452 #define HOST_CMD_SET_S1G_CAP_NUM_SOUND_DIMS BIT(3) 453 #define HOST_CMD_SET_S1G_CAP_MAX_AMPDU_LEXP BIT(4) 454 #define HOST_CMD_SET_MORSE_CAP_MMSS_OFFSET BIT(5) 455 #define HOST_CMD_S1G_CAPABILITY_FLAGS_WIDTH 4 456 457 struct host_cmd_mm_capabilities { 458 __le32 flags[HOST_CMD_S1G_CAPABILITY_FLAGS_WIDTH]; 459 u8 ampdu_mss; 460 u8 beamformee_sts_capability; 461 u8 number_sounding_dimensions; 462 u8 maximum_ampdu_length_exponent; 463 } __packed; 464 465 struct host_cmd_req_get_capabilities { 466 struct host_cmd_header hdr; 467 } __packed; 468 469 struct host_cmd_resp_get_capabilities { 470 struct host_cmd_header hdr; 471 __le32 status; 472 struct host_cmd_mm_capabilities capabilities; 473 u8 morse_mmss_offset; 474 } __packed; 475 476 #define HOST_CMD_DOT11_TWT_AGREEMENT_MAX_LEN 20 477 478 struct host_cmd_req_twt_agreement_install { 479 struct host_cmd_header hdr; 480 u8 flow_id; 481 u8 agreement_len; 482 u8 agreement[HOST_CMD_DOT11_TWT_AGREEMENT_MAX_LEN]; 483 } __packed; 484 485 struct host_cmd_resp_twt_agreement_install { 486 struct host_cmd_header hdr; 487 __le32 status; 488 } __packed; 489 490 struct host_cmd_req_twt_agreement_validate { 491 struct host_cmd_header hdr; 492 u8 flow_id; 493 u8 agreement_len; 494 u8 agreement[HOST_CMD_DOT11_TWT_AGREEMENT_MAX_LEN]; 495 } __packed; 496 497 struct host_cmd_resp_twt_agreement_validate { 498 struct host_cmd_header hdr; 499 __le32 status; 500 } __packed; 501 502 struct host_cmd_req_twt_agreement_remove { 503 struct host_cmd_header hdr; 504 u8 flow_id; 505 } __packed; 506 507 struct host_cmd_req_get_tsf { 508 struct host_cmd_header hdr; 509 } __packed; 510 511 struct host_cmd_resp_get_tsf { 512 struct host_cmd_header hdr; 513 __le32 status; 514 __le64 now_tsf; 515 __le64 now_chip_ts; 516 } __packed; 517 518 struct host_cmd_req_mac_addr { 519 struct host_cmd_header hdr; 520 u8 write; 521 u8 octet[HOST_CMD_MAC_ADDR_LEN]; 522 } __packed; 523 524 struct host_cmd_resp_mac_addr { 525 struct host_cmd_header hdr; 526 __le32 status; 527 u8 octet[HOST_CMD_MAC_ADDR_LEN]; 528 } __packed; 529 530 #define HOST_CMD_SET_MPSW_CFG_AIRTIME_BOUNDS BIT(0) 531 #define HOST_CMD_SET_MPSW_CFG_PKT_SPC_WIN_LEN BIT(1) 532 #define HOST_CMD_SET_MPSW_CFG_ENABLED BIT(2) 533 534 struct host_cmd_mpsw_configuration { 535 __le32 airtime_max_us; 536 __le32 airtime_min_us; 537 __le32 packet_space_window_length_us; 538 u8 enable; 539 } __packed; 540 541 struct host_cmd_req_mpsw_config { 542 struct host_cmd_header hdr; 543 struct host_cmd_mpsw_configuration config; 544 u8 set_cfgs; 545 } __packed; 546 547 struct host_cmd_resp_mpsw_config { 548 struct host_cmd_header hdr; 549 __le32 status; 550 struct host_cmd_mpsw_configuration config; 551 } __packed; 552 553 #define HOST_CMD_MAX_KEY_LEN 32 554 555 enum host_cmd_key_cipher { 556 HOST_CMD_KEY_CIPHER_INVALID = 0, 557 HOST_CMD_KEY_CIPHER_AES_CCM = 1, 558 HOST_CMD_KEY_CIPHER_AES_GCM = 2, 559 HOST_CMD_KEY_CIPHER_AES_CMAC = 3, 560 HOST_CMD_KEY_CIPHER_AES_GMAC = 4, 561 HOST_CMD_KEY_CIPHER_LAST = HOST_CMD_KEY_CIPHER_AES_GMAC, 562 }; 563 564 enum host_cmd_aes_key_len { 565 HOST_CMD_AES_KEY_LEN_INVALID = 0, 566 HOST_CMD_AES_KEY_LEN_LENGTH_128 = 1, 567 HOST_CMD_AES_KEY_LEN_LENGTH_256 = 2, 568 HOST_CMD_AES_KEY_LEN_LENGTH_LAST = HOST_CMD_AES_KEY_LEN_LENGTH_256, 569 }; 570 571 enum host_cmd_temporal_key_type { 572 HOST_CMD_TEMPORAL_KEY_TYPE_INVALID = 0, 573 HOST_CMD_TEMPORAL_KEY_TYPE_GTK = 1, 574 HOST_CMD_TEMPORAL_KEY_TYPE_PTK = 2, 575 HOST_CMD_TEMPORAL_KEY_TYPE_IGTK = 3, 576 HOST_CMD_TEMPORAL_KEY_TYPE_LAST = HOST_CMD_TEMPORAL_KEY_TYPE_IGTK, 577 }; 578 579 struct host_cmd_req_install_key { 580 struct host_cmd_header hdr; 581 __le64 pn; 582 __le32 aid; 583 u8 key_idx; 584 u8 cipher; 585 u8 key_length; 586 u8 key_type; 587 u8 __padding[2]; 588 u8 key[HOST_CMD_MAX_KEY_LEN]; 589 } __packed; 590 591 struct host_cmd_resp_install_key { 592 struct host_cmd_header hdr; 593 __le32 status; 594 u8 key_idx; 595 } __packed; 596 597 struct host_cmd_req_disable_key { 598 struct host_cmd_header hdr; 599 __le32 key_type; 600 __le32 aid; 601 u8 key_idx; 602 } __packed; 603 604 struct host_cmd_resp_disable_key { 605 struct host_cmd_header hdr; 606 __le32 status; 607 } __packed; 608 609 enum host_cmd_dhcp_opcode { 610 HOST_CMD_DHCP_OPCODE_ENABLE = 0, 611 HOST_CMD_DHCP_OPCODE_DO_DISCOVERY = 1, 612 HOST_CMD_DHCP_OPCODE_GET_LEASE = 2, 613 HOST_CMD_DHCP_OPCODE_CLEAR_LEASE = 3, 614 HOST_CMD_DHCP_OPCODE_RENEW_LEASE = 4, 615 HOST_CMD_DHCP_OPCODE_REBIND_LEASE = 5, 616 HOST_CMD_DHCP_OPCODE_SEND_LEASE_UPDATE = 6, 617 }; 618 619 enum host_cmd_dhcp_retcode { 620 HOST_CMD_DHCP_RETCODE_SUCCESS = 0, 621 HOST_CMD_DHCP_RETCODE_NOT_ENABLED = 1, 622 HOST_CMD_DHCP_RETCODE_ALREADY_ENABLED = 2, 623 HOST_CMD_DHCP_RETCODE_NO_LEASE = 3, 624 HOST_CMD_DHCP_RETCODE_HAVE_LEASE = 4, 625 HOST_CMD_DHCP_RETCODE_BUSY = 5, 626 HOST_CMD_DHCP_RETCODE_BAD_VIF = 6, 627 }; 628 629 struct host_cmd_req_dhcp_offload { 630 struct host_cmd_header hdr; 631 __le32 opcode; 632 } __packed; 633 634 struct host_cmd_resp_dhcp_offload { 635 struct host_cmd_header hdr; 636 __le32 status; 637 __le32 retcode; 638 __le32 my_ip; 639 __le32 netmask; 640 __le32 router; 641 __le32 dns; 642 } __packed; 643 644 struct host_cmd_req_set_keep_alive_offload { 645 struct host_cmd_header hdr; 646 __le16 bss_max_idle_period; 647 u8 interpret_as_11ah; 648 } __packed; 649 650 #define HOST_CMD_MAX_OUI_FILTERS 5 651 #define HOST_CMD_OUI_SIZE 3 652 #define HOST_CMD_MAX_OUI_FILTER_ARRAY_SIZE 15 653 654 struct host_cmd_req_update_oui_filter { 655 struct host_cmd_header hdr; 656 u8 n_ouis; 657 u8 ouis[HOST_CMD_MAX_OUI_FILTERS][HOST_CMD_OUI_SIZE]; 658 } __packed; 659 660 enum host_cmd_ibss_config_opcode { 661 HOST_CMD_IBSS_CONFIG_OPCODE_CREATE = 0, 662 HOST_CMD_IBSS_CONFIG_OPCODE_JOIN = 1, 663 HOST_CMD_IBSS_CONFIG_OPCODE_STOP = 2, 664 }; 665 666 struct host_cmd_req_ibss_config { 667 struct host_cmd_header hdr; 668 u8 ibss_bssid[HOST_CMD_MAC_ADDR_LEN]; 669 u8 ibss_cfg_opcode; 670 u8 ibss_probe_filtering; 671 } __packed; 672 673 enum host_cmd_ocs_type { 674 HOST_CMD_OCS_TYPE_QNULL = 0, 675 HOST_CMD_OCS_TYPE_RAW = 1, 676 }; 677 678 struct host_cmd_ocs_config_req { 679 __le32 op_channel_freq_hz; 680 u8 op_channel_bw_mhz; 681 u8 pri_channel_bw_mhz; 682 u8 pri_1mhz_channel_index; 683 __le16 aid; 684 u8 type; 685 } __packed; 686 687 struct host_cmd_ocs_status_resp { 688 u8 running; 689 } __packed; 690 691 struct host_cmd_req_ocs { 692 struct host_cmd_header hdr; 693 __le32 subcmd; 694 union { 695 u8 opaque[0]; 696 struct host_cmd_ocs_config_req config; 697 }; 698 } __packed; 699 700 struct host_cmd_resp_ocs { 701 struct host_cmd_header hdr; 702 __le32 status; 703 __le32 subcmd; 704 union { 705 u8 opaque[0]; 706 struct host_cmd_ocs_status_resp ocs_status; 707 }; 708 } __packed; 709 710 enum host_cmd_mesh_config_opcode { 711 HOST_CMD_MESH_CONFIG_OPCODE_START = 0, 712 HOST_CMD_MESH_CONFIG_OPCODE_STOP = 1, 713 }; 714 715 struct host_cmd_req_mesh_config { 716 struct host_cmd_header hdr; 717 u8 mesh_cfg_opcode; 718 u8 enable_beaconing; 719 u8 mbca_config; 720 u8 min_beacon_gap_ms; 721 __le16 mbss_start_scan_duration_ms; 722 __le16 tbtt_adj_timer_interval_ms; 723 } __packed; 724 725 struct host_cmd_req_set_offset_tsf { 726 struct host_cmd_header hdr; 727 __sle64 offset_tsf; 728 } __packed; 729 730 struct host_cmd_req_get_channel_usage { 731 struct host_cmd_header hdr; 732 } __packed; 733 734 struct host_cmd_resp_get_channel_usage { 735 struct host_cmd_header hdr; 736 __le32 status; 737 __le64 time_listen; 738 __le64 busy_time; 739 __le32 freq_hz; 740 s8 noise; 741 u8 bw_mhz; 742 } __packed; 743 744 #define HOST_CMD_MAX_MCAST_FILTERS 12 745 746 struct host_cmd_req_mcast_filter { 747 struct host_cmd_header hdr; 748 u8 count; 749 __le32 hw_addr[]; 750 } __packed; 751 752 struct host_cmd_req_bss_beacon_config { 753 struct host_cmd_header hdr; 754 u8 enable; 755 } __packed; 756 757 struct host_cmd_resp_bss_beacon_config { 758 struct host_cmd_header hdr; 759 __le32 status; 760 __le16 interface_id; 761 } __packed; 762 763 struct host_cmd_req_uapsd_config { 764 struct host_cmd_header hdr; 765 u8 auto_trigger_enabled; 766 __le32 auto_trigger_timeout; 767 } __packed; 768 769 struct host_cmd_resp_uapsd_config { 770 struct host_cmd_header hdr; 771 __le32 status; 772 u8 auto_trigger_enabled; 773 } __packed; 774 775 struct host_cmd_req_page_slicing_config { 776 struct host_cmd_header hdr; 777 u8 enable; 778 } __packed; 779 780 #define HOST_CMD_HW_SCAN_FLAGS_START BIT(0) 781 #define HOST_CMD_HW_SCAN_FLAGS_ABORT BIT(1) 782 #define HOST_CMD_HW_SCAN_FLAGS_SURVEY BIT(2) 783 #define HOST_CMD_HW_SCAN_FLAGS_STORE BIT(3) 784 #define HOST_CMD_HW_SCAN_FLAGS_1MHZ_PROBES BIT(4) 785 #define HOST_CMD_HW_SCAN_FLAGS_SCHED_START BIT(5) 786 #define HOST_CMD_HW_SCAN_FLAGS_SCHED_STOP BIT(6) 787 #define HOST_CMD_HW_SCAN_FLAGS_PROBE_ON_DOZE_BEACON BIT(7) 788 789 enum host_cmd_hw_scan_tlv_tag { 790 HOST_CMD_HW_SCAN_TLV_TAG_PAD = 0, 791 HOST_CMD_HW_SCAN_TLV_TAG_PROBE_REQ = 1, 792 HOST_CMD_HW_SCAN_TLV_TAG_CHAN_LIST = 2, 793 HOST_CMD_HW_SCAN_TLV_TAG_POWER_LIST = 3, 794 HOST_CMD_HW_SCAN_TLV_TAG_DWELL_ON_HOME = 4, 795 HOST_CMD_HW_SCAN_TLV_TAG_SCHED = 5, 796 HOST_CMD_HW_SCAN_TLV_TAG_FILTER = 6, 797 HOST_CMD_HW_SCAN_TLV_TAG_SCHED_PARAMS = 7, 798 }; 799 800 struct host_cmd_hw_scan_tlv { 801 __le16 tag; 802 __le16 len; 803 u8 value[]; 804 } __packed; 805 806 struct host_cmd_req_hw_scan { 807 struct host_cmd_header hdr; 808 __le32 flags; 809 __le32 dwell_time_ms; 810 u8 variable[]; 811 } __packed; 812 813 #define HOST_CMD_WHITELIST_FLAGS_CLEAR BIT(0) 814 815 struct host_cmd_req_set_whitelist { 816 struct host_cmd_header hdr; 817 u8 flags; 818 u8 ip_protocol; 819 __be16 llc_protocol; 820 __be32 src_ip; 821 __be32 dest_ip; 822 __be32 netmask; 823 __be16 src_port; 824 __be16 dest_port; 825 } __packed; 826 827 struct host_cmd_arp_periodic_params { 828 __le32 refresh_period_s; 829 __le32 destination_ip; 830 u8 send_as_garp; 831 } __packed; 832 833 struct host_cmd_req_arp_periodic_refresh { 834 struct host_cmd_header hdr; 835 struct host_cmd_arp_periodic_params config; 836 } __packed; 837 838 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_PERIOD BIT(0) 839 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_RETRY_COUNT BIT(1) 840 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_RETRY_INTERVAL BIT(2) 841 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_SRC_IP_ADDR BIT(3) 842 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_DEST_IP_ADDR BIT(4) 843 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_SRC_PORT BIT(5) 844 #define HOST_CMD_TCP_KEEPALIVE_SET_CFG_DEST_PORT BIT(6) 845 846 struct host_cmd_req_set_tcp_keepalive { 847 struct host_cmd_header hdr; 848 u8 enabled; 849 u8 retry_count; 850 u8 retry_interval_s; 851 u8 set_cfgs; 852 __be32 src_ip; 853 __be32 dest_ip; 854 __be16 src_port; 855 __be16 dest_port; 856 __le16 period_s; 857 } __packed; 858 859 enum host_cmd_power_mode { 860 HOST_CMD_POWER_MODE_SNOOZE = 0, 861 HOST_CMD_POWER_MODE_DEEP_SLEEP = 1, 862 HOST_CMD_POWER_MODE_HIBERNATE = 2, 863 }; 864 865 struct host_cmd_req_force_power_mode { 866 struct host_cmd_header hdr; 867 __le32 mode; 868 } __packed; 869 870 struct host_cmd_req_li_sleep { 871 struct host_cmd_header hdr; 872 __le32 listen_interval; 873 } __packed; 874 875 struct host_cmd_disabled_channel_entry { 876 __le16 freq_100khz; 877 u8 bw_mhz; 878 } __packed; 879 880 struct host_cmd_resp_get_disabled_channels { 881 struct host_cmd_header hdr; 882 __le32 status; 883 __le32 n_channels; 884 struct host_cmd_disabled_channel_entry channels[]; 885 } __packed; 886 887 struct host_cmd_req_set_cqm_rssi { 888 struct host_cmd_header hdr; 889 __sle32 threshold; 890 __le32 hysteresis; 891 } __packed; 892 893 struct host_cmd_req_get_apf_capabilities { 894 struct host_cmd_header hdr; 895 } __packed; 896 897 struct host_cmd_resp_get_apf_capabilities { 898 struct host_cmd_header hdr; 899 __le32 status; 900 __le32 max_length; 901 u8 version; 902 } __packed; 903 904 struct host_cmd_req_read_write_apf { 905 struct host_cmd_header hdr; 906 __le32 offset; 907 __le16 program_length; 908 u8 write; 909 u8 program[]; 910 } __packed; 911 912 struct host_cmd_resp_read_write_apf { 913 struct host_cmd_header hdr; 914 __le32 status; 915 __le16 program_length; 916 u8 program[]; 917 } __packed; 918 919 struct host_cmd_req_bssid_set { 920 struct host_cmd_header hdr; 921 struct host_cmd_mac_addr bssid; 922 } __packed; 923 924 #define HOST_CMD_BEACON_OFFLOAD_FLAGS_START BIT(0) 925 #define HOST_CMD_BEACON_OFFLOAD_FLAGS_STOP BIT(1) 926 #define HOST_CMD_BEACON_OFFLOAD_CSSID_LEN 4 927 928 enum host_cmd_beacon_offload_tlv_tag { 929 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_DTIM_CNT = 0, 930 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_FRAME_CTRL = 1, 931 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_CHANGE_SEQ = 2, 932 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_CSSID = 3, 933 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_IES = 4, 934 HOST_CMD_BEACON_OFFLOAD_TLV_TAG_TX_INFO = 5, 935 }; 936 937 struct host_cmd_beacon_offload_tlv_hdr { 938 __le16 tag; 939 __le16 len; 940 } __packed; 941 942 struct host_cmd_beacon_offload_tlv_generic { 943 struct host_cmd_beacon_offload_tlv_hdr hdr; 944 u8 value[]; 945 } __packed; 946 947 struct host_cmd_beacon_offload_tlv_dtim_cnt { 948 struct host_cmd_beacon_offload_tlv_hdr hdr; 949 __le16 dtim_cnt; 950 } __packed; 951 952 struct host_cmd_beacon_offload_tlv_frame_ctrl { 953 struct host_cmd_beacon_offload_tlv_hdr hdr; 954 u8 frame_ctrl[2]; 955 } __packed; 956 957 struct host_cmd_beacon_offload_tlv_change_seq { 958 struct host_cmd_beacon_offload_tlv_hdr hdr; 959 __le16 change_seq; 960 } __packed; 961 962 struct host_cmd_beacon_offload_tlv_tx_info { 963 struct host_cmd_beacon_offload_tlv_hdr hdr; 964 u8 bw_mhz; 965 } __packed; 966 967 struct host_cmd_beacon_offload_tlv_cssid { 968 struct host_cmd_beacon_offload_tlv_hdr hdr; 969 u8 cssid[HOST_CMD_BEACON_OFFLOAD_CSSID_LEN]; 970 } __packed; 971 972 struct host_cmd_beacon_offload_tlv_ies { 973 struct host_cmd_beacon_offload_tlv_hdr hdr; 974 u8 buf[]; 975 } __packed; 976 977 struct host_cmd_req_beacon_offload { 978 struct host_cmd_header hdr; 979 __le32 flags; 980 u8 variable[]; 981 } __packed; 982 983 struct host_cmd_resp_beacon_offload { 984 struct host_cmd_header hdr; 985 __le32 status; 986 __le16 dtim_count; 987 } __packed; 988 989 struct host_cmd_req_probe_response_offload { 990 struct host_cmd_header hdr; 991 u8 enable; 992 __le16 probe_resp_len; 993 u8 probe_resp_buf[]; 994 } __packed; 995 996 struct host_cmd_resp_probe_response_offload { 997 struct host_cmd_header hdr; 998 __le32 status; 999 } __packed; 1000 1001 struct host_cmd_req_set_sta_type { 1002 struct host_cmd_header hdr; 1003 u8 sta_type; 1004 } __packed; 1005 1006 struct host_cmd_req_set_enc_mode { 1007 struct host_cmd_header hdr; 1008 u8 enc_mode; 1009 } __packed; 1010 1011 struct host_cmd_req_test_ba { 1012 struct host_cmd_header hdr; 1013 u8 addr[HOST_CMD_MAC_ADDR_LEN]; 1014 u8 start; 1015 u8 tx; 1016 __le32 tid; 1017 } __packed; 1018 1019 struct host_cmd_req_set_listen_interval { 1020 struct host_cmd_header hdr; 1021 __le16 listen_interval; 1022 } __packed; 1023 1024 struct host_cmd_req_set_ampdu { 1025 struct host_cmd_header hdr; 1026 u8 ampdu_enabled; 1027 } __packed; 1028 1029 struct host_cmd_req_set_s1g_op_class { 1030 struct host_cmd_header hdr; 1031 u8 opclass; 1032 u8 prim_opclass; 1033 } __packed; 1034 1035 struct host_cmd_req_send_wake_action_frame { 1036 struct host_cmd_header hdr; 1037 u8 dest_addr[HOST_CMD_MAC_ADDR_LEN]; 1038 __le32 payload_size; 1039 u8 payload[]; 1040 } __packed; 1041 1042 #define HOST_CMD_MAX_VENDOR_IE_LENGTH 255 1043 #define HOST_CMD_VENDOR_IE_TYPE_FLAG_BEACON BIT(0) 1044 #define HOST_CMD_VENDOR_IE_TYPE_FLAG_PROBE_REQ BIT(1) 1045 #define HOST_CMD_VENDOR_IE_TYPE_FLAG_PROBE_RESP BIT(2) 1046 #define HOST_CMD_VENDOR_IE_TYPE_FLAG_ASSOC_REQ BIT(3) 1047 #define HOST_CMD_VENDOR_IE_TYPE_FLAG_ASSOC_RESP BIT(4) 1048 1049 enum host_cmd_vendor_ie_op { 1050 HOST_CMD_VENDOR_IE_OP_ADD_ELEMENT = 0, 1051 HOST_CMD_VENDOR_IE_OP_CLEAR_ELEMENTS = 1, 1052 HOST_CMD_VENDOR_IE_OP_ADD_FILTER = 2, 1053 HOST_CMD_VENDOR_IE_OP_CLEAR_FILTERS = 3, 1054 HOST_CMD_VENDOR_IE_OP_INVALID = U16_MAX, 1055 }; 1056 1057 struct host_cmd_req_vendor_ie_config { 1058 struct host_cmd_header hdr; 1059 __le16 opcode; 1060 __le16 mgmt_type_mask; 1061 u8 data[HOST_CMD_MAX_VENDOR_IE_LENGTH]; 1062 } __packed; 1063 1064 struct host_cmd_resp_vendor_ie_config { 1065 struct host_cmd_header hdr; 1066 __le32 status; 1067 } __packed; 1068 1069 enum host_cmd_twt_conf_op { 1070 HOST_CMD_TWT_CONF_OP_CONFIGURE = 0, 1071 HOST_CMD_TWT_CONF_OP_FORCE_INSTALL_AGREEMENT = 1, 1072 HOST_CMD_TWT_CONF_OP_REMOVE_AGREEMENT = 2, 1073 HOST_CMD_TWT_CONF_OP_CONFIGURE_EXPLICIT = 3, 1074 }; 1075 1076 struct host_cmd_explicit_twt_wake_interval { 1077 __le16 wake_interval_mantissa; 1078 u8 wake_interval_exponent; 1079 u8 __padding[5]; 1080 } __packed; 1081 1082 union host_cmd_wake_interval { 1083 __le64 wake_interval_us; 1084 struct host_cmd_explicit_twt_wake_interval explicit_twt; 1085 } __packed; 1086 1087 struct host_cmd_req_set_twt_conf { 1088 struct host_cmd_header hdr; 1089 u8 opcode; 1090 u8 flow_id; 1091 __le64 target_wake_time; 1092 union host_cmd_wake_interval wake_interval; 1093 __le32 wake_duration_us; 1094 u8 twt_setup_command; 1095 u8 __padding[3]; 1096 } __packed; 1097 1098 #define HOST_CMD_MAX_AVAILABLE_CHANNELS 255 1099 1100 struct host_cmd_channel_info { 1101 __le32 frequency_khz; 1102 u8 channel_5g; 1103 u8 channel_s1g; 1104 u8 bandwidth_mhz; 1105 } __packed; 1106 1107 struct host_cmd_resp_get_available_channels { 1108 struct host_cmd_header hdr; 1109 __le32 status; 1110 __le32 num_channels; 1111 struct host_cmd_channel_info channels[HOST_CMD_MAX_AVAILABLE_CHANNELS]; 1112 } __packed; 1113 1114 #define HOST_CMD_S1G_CAP0_S1G_LONG BIT(0) 1115 #define HOST_CMD_S1G_CAP0_SGI_1MHZ BIT(1) 1116 #define HOST_CMD_S1G_CAP0_SGI_2MHZ BIT(2) 1117 #define HOST_CMD_S1G_CAP0_SGI_4MHZ BIT(3) 1118 #define HOST_CMD_S1G_CAP0_SGI_8MHZ BIT(4) 1119 #define HOST_CMD_S1G_CAP0_SGI_16MHZ BIT(5) 1120 1121 struct host_cmd_req_set_ecsa_s1g_info { 1122 struct host_cmd_header hdr; 1123 __le32 operating_channel_freq_hz; 1124 u8 opclass; 1125 u8 primary_channel_bw_mhz; 1126 u8 prim_1mhz_ch_idx; 1127 u8 operating_channel_bw_mhz; 1128 u8 prim_opclass; 1129 u8 s1g_cap0; 1130 u8 s1g_cap1; 1131 u8 s1g_cap2; 1132 u8 s1g_cap3; 1133 } __packed; 1134 1135 struct host_cmd_resp_get_hw_version { 1136 struct host_cmd_header hdr; 1137 __le32 status; 1138 u8 hw_version[64]; 1139 } __packed; 1140 1141 #define HOST_CMD_CAC_CFG_CHANGE_RULE_MAX 8 1142 #define HOST_CMD_CAC_CFG_ARFS_MAX 99 1143 #define HOST_CMD_CAC_CFG_CHANGE_MAX 99 1144 #define HOST_CMD_CAC_CFG_CHANGE_STEP 5 1145 1146 enum host_cmd_cac_op { 1147 HOST_CMD_CAC_OP_DISABLE = 0, 1148 HOST_CMD_CAC_OP_ENABLE = 1, 1149 HOST_CMD_CAC_OP_CFG_GET = 2, 1150 HOST_CMD_CAC_OP_CFG_SET = 3, 1151 }; 1152 1153 struct host_cmd_cac_change_rule { 1154 __le16 arfs; 1155 __sle16 threshold_change; 1156 } __packed; 1157 1158 struct host_cmd_req_cac { 1159 struct host_cmd_header hdr; 1160 u8 opcode; 1161 u8 rule_tot; 1162 struct host_cmd_cac_change_rule rule[HOST_CMD_CAC_CFG_CHANGE_RULE_MAX]; 1163 } __packed; 1164 1165 struct host_cmd_resp_cac { 1166 struct host_cmd_header hdr; 1167 __le32 status; 1168 u8 rule_tot; 1169 struct host_cmd_cac_change_rule rule[HOST_CMD_CAC_CFG_CHANGE_RULE_MAX]; 1170 } __packed; 1171 1172 struct host_cmd_ocs_driver_req { 1173 __le32 op_channel_freq_hz; 1174 u8 op_channel_bw_mhz; 1175 u8 pri_channel_bw_mhz; 1176 u8 pri_1mhz_channel_index; 1177 } __packed; 1178 1179 struct host_cmd_ocs_driver_resp { 1180 u8 running; 1181 } __packed; 1182 1183 struct host_cmd_req_ocs_driver { 1184 struct host_cmd_header hdr; 1185 __le32 subcmd; 1186 union { 1187 u8 opaque[0]; 1188 struct host_cmd_ocs_driver_req config; 1189 }; 1190 } __packed; 1191 1192 struct host_cmd_resp_ocs_driver { 1193 struct host_cmd_header hdr; 1194 __le32 status; 1195 __le32 subcmd; 1196 union { 1197 u8 opaque[0]; 1198 struct host_cmd_ocs_driver_resp ocs_status; 1199 }; 1200 } __packed; 1201 1202 #define HOST_CMD_IFNAMSIZ 16 1203 1204 struct host_cmd_req_mbssid { 1205 struct host_cmd_header hdr; 1206 u8 max_bssid_indicator; 1207 s8 transmitter_iface[HOST_CMD_IFNAMSIZ]; 1208 } __packed; 1209 1210 #define HOST_CMD_MESH_ID_LEN_MAX 32 1211 #define HOST_CMD_MESH_BEACONLESS_MODE_DISABLE 0 1212 #define HOST_CMD_MESH_BEACONLESS_MODE_ENABLE 1 1213 #define HOST_CMD_MESH_PEER_LINKS_MIN 0 1214 #define HOST_CMD_MESH_PEER_LINKS_MAX 10 1215 1216 struct host_cmd_req_set_mesh_config { 1217 struct host_cmd_header hdr; 1218 u8 mesh_id_len; 1219 u8 mesh_id[HOST_CMD_MESH_ID_LEN_MAX]; 1220 u8 mesh_beaconless_mode; 1221 u8 max_plinks; 1222 } __packed; 1223 1224 struct host_cmd_req_set_mcba_conf { 1225 struct host_cmd_header hdr; 1226 u8 mbca_config; 1227 u8 beacon_timing_report_interval; 1228 u8 min_beacon_gap_ms; 1229 __le16 mbss_start_scan_duration_ms; 1230 __le16 tbtt_adj_interval_ms; 1231 } __packed; 1232 1233 struct host_cmd_req_dynamic_peering_config { 1234 struct host_cmd_header hdr; 1235 u8 enabled; 1236 u8 rssi_margin; 1237 __le32 blacklist_timeout; 1238 } __packed; 1239 1240 #define HOST_CMD_CFG_RAW_FLAG_ENABLE BIT(0) 1241 #define HOST_CMD_CFG_RAW_FLAG_DELETE BIT(1) 1242 #define HOST_CMD_CFG_RAW_FLAG_UPDATE BIT(2) 1243 #define HOST_CMD_CFG_RAW_FLAG_DYNAMIC BIT(3) 1244 #define HOST_CMD_RAW_RESERVED_AID_DCS 2008 1245 #define HOST_CMD_RAW_RESERVED_AID_DOWNLINK 2009 1246 1247 enum host_cmd_raw_tlv_tag { 1248 HOST_CMD_RAW_TLV_TAG_SLOT_DEF = 0, 1249 HOST_CMD_RAW_TLV_TAG_GROUP = 1, 1250 HOST_CMD_RAW_TLV_TAG_START_TIME = 2, 1251 HOST_CMD_RAW_TLV_TAG_PRAW = 3, 1252 HOST_CMD_RAW_TLV_TAG_BCN_SPREAD = 4, 1253 HOST_CMD_RAW_TLV_TAG_DYN_GLOBAL = 5, 1254 HOST_CMD_RAW_TLV_TAG_DYN_CONFIG = 6, 1255 HOST_CMD_RAW_TLV_TAG_LAST = 7, 1256 }; 1257 1258 struct host_cmd_raw_tlv_slot_def { 1259 u8 tag; 1260 __le32 raw_duration_us; 1261 u8 num_slots; 1262 u8 cross_slot_bleed; 1263 } __packed; 1264 1265 struct host_cmd_raw_tlv_group { 1266 u8 tag; 1267 __le16 aid_start; 1268 __le16 aid_end; 1269 } __packed; 1270 1271 struct host_cmd_raw_tlv_start_time { 1272 u8 tag; 1273 __le32 start_time_us; 1274 } __packed; 1275 1276 struct host_cmd_raw_tlv_praw { 1277 u8 tag; 1278 u8 periodicity; 1279 u8 validity; 1280 u8 start_offset; 1281 u8 refresh_on_expiry; 1282 } __packed; 1283 1284 struct host_cmd_raw_tlv_bcn_spread { 1285 u8 tag; 1286 __le16 max_spread; 1287 __le16 nominal_sta_per_bcn; 1288 } __packed; 1289 1290 struct host_cmd_raw_tlv_dyn_global { 1291 u8 tag; 1292 __le16 num_configs; 1293 __le16 num_bcn_indexes; 1294 } __packed; 1295 1296 struct host_cmd_raw_tlv_dyn_config { 1297 u8 tag; 1298 __le16 id; 1299 __le16 index; 1300 __le16 len; 1301 u8 variable[]; 1302 } __packed; 1303 1304 union host_cmd_raw_tlvs { 1305 u8 tag; 1306 struct host_cmd_raw_tlv_slot_def slot_def; 1307 struct host_cmd_raw_tlv_group group; 1308 struct host_cmd_raw_tlv_start_time start_time; 1309 struct host_cmd_raw_tlv_praw praw; 1310 struct host_cmd_raw_tlv_bcn_spread bcn_spread; 1311 struct host_cmd_raw_tlv_dyn_global dyn_global; 1312 struct host_cmd_raw_tlv_dyn_config dyn_config; 1313 } __packed; 1314 1315 struct host_cmd_req_config_raw { 1316 struct host_cmd_header hdr; 1317 __le32 flags; 1318 __le16 id; 1319 u8 variable[]; 1320 } __packed; 1321 1322 struct host_cmd_req_config_bss_stats { 1323 struct host_cmd_header hdr; 1324 u8 enable; 1325 __le32 monitor_window_ms; 1326 } __packed; 1327 1328 struct host_cmd_req_get_rssi { 1329 struct host_cmd_header hdr; 1330 } __packed; 1331 1332 struct host_cmd_resp_get_rssi { 1333 struct host_cmd_header hdr; 1334 __le32 status; 1335 __sle32 rssi0; 1336 __sle32 rssi1; 1337 __sle32 rssi2; 1338 __sle32 rssi3; 1339 __sle32 rssi4; 1340 __sle32 rssi5; 1341 __sle32 rssi6; 1342 __sle32 rssi7; 1343 } __packed; 1344 1345 #define HOST_CMD_SET_IFS_MIN_USECS 160 1346 1347 struct host_cmd_req_set_ifs { 1348 struct host_cmd_header hdr; 1349 __le32 period_usecs; 1350 } __packed; 1351 1352 struct host_cmd_resp_set_ifs { 1353 struct host_cmd_header hdr; 1354 __le32 status; 1355 } __packed; 1356 1357 struct host_cmd_req_set_fem_settings { 1358 struct host_cmd_header hdr; 1359 __le32 tx_antenna; 1360 __le32 rx_antenna; 1361 __le32 lna_enabled; 1362 __le32 pa_enabled; 1363 } __packed; 1364 1365 struct host_cmd_resp_set_fem_settings { 1366 struct host_cmd_header hdr; 1367 __le32 status; 1368 } __packed; 1369 1370 struct host_cmd_req_set_txop { 1371 struct host_cmd_header hdr; 1372 u8 min_packet_count; 1373 } __packed; 1374 1375 struct host_cmd_resp_set_txop { 1376 struct host_cmd_header hdr; 1377 __le32 status; 1378 } __packed; 1379 1380 struct host_cmd_req_set_control_response { 1381 struct host_cmd_header hdr; 1382 u8 direction; 1383 u8 control_response_1mhz_en; 1384 } __packed; 1385 1386 struct host_cmd_resp_set_control_response { 1387 struct host_cmd_header hdr; 1388 __le32 status; 1389 } __packed; 1390 1391 struct host_cmd_req_set_periodic_cal { 1392 struct host_cmd_header hdr; 1393 __le32 periodic_cal_en_mask; 1394 } __packed; 1395 1396 struct host_cmd_resp_set_periodic_cal { 1397 struct host_cmd_header hdr; 1398 __le32 status; 1399 } __packed; 1400 1401 struct host_cmd_req_set_bcn_rssi_threshold { 1402 struct host_cmd_header hdr; 1403 u8 threshold_db; 1404 } __packed; 1405 1406 struct host_cmd_resp_set_bcn_rssi_threshold { 1407 struct host_cmd_header hdr; 1408 __le32 status; 1409 } __packed; 1410 1411 struct host_cmd_req_set_tx_pkt_lifetime_usecs { 1412 struct host_cmd_header hdr; 1413 __le32 lifetime_usecs; 1414 } __packed; 1415 1416 struct host_cmd_resp_set_tx_pkt_lifetime_usecs { 1417 struct host_cmd_header hdr; 1418 __le32 status; 1419 } __packed; 1420 1421 struct host_cmd_req_set_physm_watchdog { 1422 struct host_cmd_header hdr; 1423 u8 physm_watchdog_en; 1424 } __packed; 1425 1426 struct host_cmd_req_tx_polar { 1427 struct host_cmd_header hdr; 1428 u8 enable; 1429 } __packed; 1430 1431 struct host_cmd_evt_sta_state { 1432 struct host_cmd_header hdr; 1433 u8 sta_addr[HOST_CMD_MAC_ADDR_LEN]; 1434 __le16 aid; 1435 __le16 state; 1436 } __packed; 1437 1438 struct host_cmd_evt_beacon_loss { 1439 struct host_cmd_header hdr; 1440 __le32 num_bcns; 1441 } __packed; 1442 1443 struct host_cmd_evt_sig_field_error { 1444 struct host_cmd_header hdr; 1445 __le64 start_timestamp; 1446 __le64 end_timestamp; 1447 } __packed; 1448 1449 #define HOST_CMD_UMAC_TRAFFIC_CONTROL_SOURCE_TWT BIT(0) 1450 #define HOST_CMD_UMAC_TRAFFIC_CONTROL_SOURCE_DUTY_CYCLE BIT(1) 1451 1452 struct host_cmd_evt_umac_traffic_control { 1453 struct host_cmd_header hdr; 1454 u8 pause_data_traffic; 1455 __le32 sources; 1456 } __packed; 1457 1458 struct host_cmd_evt_dhcp_lease_update { 1459 struct host_cmd_header hdr; 1460 __le32 my_ip; 1461 __le32 netmask; 1462 __le32 router; 1463 __le32 dns; 1464 } __packed; 1465 1466 struct host_cmd_evt_ocs_done { 1467 struct host_cmd_header hdr; 1468 __le64 time_listen; 1469 __le64 time_rx; 1470 s8 noise; 1471 u8 metric; 1472 } __packed; 1473 1474 struct host_cmd_evt_hw_scan_done { 1475 struct host_cmd_header hdr; 1476 u8 aborted; 1477 } __packed; 1478 1479 struct host_cmd_evt_channel_usage { 1480 struct host_cmd_header hdr; 1481 __le64 time_listen; 1482 __le64 busy_time; 1483 __le32 freq_hz; 1484 u8 noise; 1485 u8 bw_mhz; 1486 } __packed; 1487 1488 enum host_cmd_connection_loss_reason { 1489 HOST_CMD_CONNECTION_LOSS_REASON_TSF_RESET = 0, 1490 }; 1491 1492 struct host_cmd_evt_connection_loss { 1493 struct host_cmd_header hdr; 1494 __le32 reason; 1495 } __packed; 1496 1497 struct host_cmd_evt_sched_scan_results { 1498 struct host_cmd_header hdr; 1499 } __packed; 1500 1501 enum host_cmd_cqm_rssi_threshold_event { 1502 HOST_CMD_CQM_RSSI_THRESHOLD_EVENT_LOW = 0, 1503 HOST_CMD_CQM_RSSI_THRESHOLD_EVENT_HIGH = 1, 1504 }; 1505 1506 struct host_cmd_evt_cqm_rssi_notify { 1507 struct host_cmd_header hdr; 1508 __sle16 rssi; 1509 __le16 event; 1510 } __packed; 1511 1512 struct host_cmd_evt_scan_done { 1513 struct host_cmd_header hdr; 1514 u8 aborted; 1515 } __packed; 1516 1517 enum host_cmd_scan_result_frame { 1518 HOST_CMD_SCAN_RESULT_FRAME_UNKNOWN = 0, 1519 HOST_CMD_SCAN_RESULT_FRAME_BEACON = 1, 1520 HOST_CMD_SCAN_RESULT_FRAME_PROBE_RESPONSE = 2, 1521 }; 1522 1523 struct host_cmd_evt_scan_result { 1524 struct host_cmd_header hdr; 1525 __le32 channel_freq_hz; 1526 u8 bw_mhz; 1527 u8 frame_type; 1528 __sle16 rssi; 1529 u8 bssid[HOST_CMD_MAC_ADDR_LEN]; 1530 __le16 beacon_interval; 1531 __le16 capability_info; 1532 __le64 tsf; 1533 __le16 ies_len; 1534 u8 ies[]; 1535 } __packed; 1536 1537 struct host_cmd_evt_connected { 1538 struct host_cmd_header hdr; 1539 u8 bssid[HOST_CMD_MAC_ADDR_LEN]; 1540 __sle16 rssi; 1541 u8 padding_0[8]; 1542 __le16 assoc_resp_ies_len; 1543 u8 assoc_resp_ies[]; 1544 } __packed; 1545 1546 struct host_cmd_evt_beacon_filter_match { 1547 struct host_cmd_header hdr; 1548 u8 padding_0[4]; 1549 __le32 ies_len; 1550 u8 ies[]; 1551 } __packed; 1552 1553 struct host_cmd_req_set_capabilities { 1554 struct host_cmd_header hdr; 1555 struct host_cmd_mm_capabilities capabilities; 1556 u8 set_caps; 1557 u8 morse_mmss_offset; 1558 } __packed; 1559 1560 struct host_cmd_resp_set_capabilities { 1561 struct host_cmd_header hdr; 1562 __le32 status; 1563 } __packed; 1564 1565 struct host_cmd_req_set_transmission_rate { 1566 struct host_cmd_header hdr; 1567 __sle32 mcs_index; 1568 __sle32 bandwidth_mhz; 1569 __sle32 tx_80211ah_format; 1570 s8 use_traveling_pilots; 1571 s8 use_sgi; 1572 u8 enabled; 1573 s8 nss_idx; 1574 s8 use_ldpc; 1575 s8 use_stbc; 1576 } __packed; 1577 1578 struct host_cmd_resp_set_transmission_rate { 1579 struct host_cmd_header hdr; 1580 __le32 status; 1581 } __packed; 1582 1583 enum host_cmd_hart_id { 1584 HOST_CMD_HART_ID_HOST = 0, 1585 HOST_CMD_HART_ID_MAC = 1, 1586 HOST_CMD_HART_ID_UPHY = 2, 1587 HOST_CMD_HART_ID_LPHY = 3, 1588 }; 1589 1590 struct host_cmd_req_force_assert { 1591 struct host_cmd_header hdr; 1592 __le32 hart_id; 1593 } __packed; 1594 1595 #define HOST_CMD_HOST_BLOCK_TX_FRAMES BIT(0) 1596 #define HOST_CMD_HOST_BLOCK_TX_CMD BIT(1) 1597 1598 enum host_cmd_param_action { 1599 HOST_CMD_PARAM_ACTION_SET = 0, 1600 HOST_CMD_PARAM_ACTION_GET = 1, 1601 HOST_CMD_PARAM_ACTION_LAST = 2, 1602 }; 1603 1604 enum host_cmd_slow_clock_mode { 1605 HOST_CMD_SLOW_CLOCK_MODE_AUTO = 0, 1606 HOST_CMD_SLOW_CLOCK_MODE_INTERNAL = 1, 1607 }; 1608 1609 enum host_cmd_param_id { 1610 HOST_CMD_PARAM_ID_MAX_TRAFFIC_DELIVERY_WAIT_US = 0, 1611 HOST_CMD_PARAM_ID_EXTRA_ACK_TIMEOUT_ADJUST_US = 1, 1612 HOST_CMD_PARAM_ID_TX_STATUS_FLUSH_WATERMARK = 2, 1613 HOST_CMD_PARAM_ID_TX_STATUS_FLUSH_MIN_AMPDU_SIZE = 3, 1614 HOST_CMD_PARAM_ID_POWERSAVE_TYPE = 4, 1615 HOST_CMD_PARAM_ID_SNOOZE_DURATION_ADJUST_US = 5, 1616 HOST_CMD_PARAM_ID_TX_BLOCK = 6, 1617 HOST_CMD_PARAM_ID_FORCED_SNOOZE_PERIOD_US = 7, 1618 HOST_CMD_PARAM_ID_WAKE_ACTION_GPIO = 8, 1619 HOST_CMD_PARAM_ID_WAKE_ACTION_GPIO_PULSE_MS = 9, 1620 HOST_CMD_PARAM_ID_CONNECTION_MONITOR_GPIO = 10, 1621 HOST_CMD_PARAM_ID_INPUT_TRIGGER_GPIO = 11, 1622 HOST_CMD_PARAM_ID_INPUT_TRIGGER_MODE = 12, 1623 HOST_CMD_PARAM_ID_COUNTRY = 13, 1624 HOST_CMD_PARAM_ID_RTS_THRESHOLD = 14, 1625 HOST_CMD_PARAM_ID_HOST_TX_BLOCK = 15, 1626 HOST_CMD_PARAM_ID_MEM_RETENTION_CODE = 16, 1627 HOST_CMD_PARAM_ID_NON_TIM_MODE = 17, 1628 HOST_CMD_PARAM_ID_DYNAMIC_PS_TIMEOUT_MS = 18, 1629 HOST_CMD_PARAM_ID_HOME_CHANNEL_DWELL_MS = 19, 1630 HOST_CMD_PARAM_ID_SLOW_CLOCK_MODE = 20, 1631 HOST_CMD_PARAM_ID_FRAGMENT_THRESHOLD = 21, 1632 HOST_CMD_PARAM_ID_BEACON_LOSS_COUNT = 22, 1633 HOST_CMD_PARAM_ID_AP_POWER_SAVE = 23, 1634 HOST_CMD_PARAM_ID_BEACON_OFFLOAD = 24, 1635 HOST_CMD_PARAM_ID_PROBE_RESP_OFFLOAD = 25, 1636 HOST_CMD_PARAM_ID_BSS_MAX_AWAY_DURATION = 26, 1637 HOST_CMD_PARAM_ID_DEFAULT_ACTIVE_SCAN_DWELL_MS = 27, 1638 HOST_CMD_PARAM_ID_CTS_TO_SELF = 28, 1639 HOST_CMD_PARAM_ID_CHANNELIZATION = 29, 1640 HOST_CMD_PARAM_ID_LAST = 30, 1641 }; 1642 1643 struct host_cmd_req_get_set_generic_param { 1644 struct host_cmd_header hdr; 1645 __le32 param_id; 1646 __le32 action; 1647 __le32 flags; 1648 __le32 value; 1649 } __packed; 1650 1651 struct host_cmd_resp_get_set_generic_param { 1652 struct host_cmd_header hdr; 1653 __le32 status; 1654 __le32 flags; 1655 __le32 value; 1656 } __packed; 1657 1658 #endif 1659