1 /* SPDX-License-Identifier: ISC */ 2 /* 3 * Copyright (C) 2022 MediaTek Inc. 4 */ 5 6 #ifndef __MT7996_MCU_H 7 #define __MT7996_MCU_H 8 9 #include "../mt76_connac_mcu.h" 10 11 struct mt7996_mcu_rxd { 12 __le32 rxd[8]; 13 14 __le16 len; 15 __le16 pkt_type_id; 16 17 u8 eid; 18 u8 seq; 19 u8 option; 20 u8 __rsv; 21 22 u8 ext_eid; 23 u8 __rsv1[2]; 24 u8 s2d_index; 25 }; 26 27 struct mt7996_mcu_uni_event { 28 u8 cid; 29 u8 __rsv[3]; 30 __le32 status; /* 0: success, others: fail */ 31 } __packed; 32 33 struct mt7996_mcu_thermal_ctrl { 34 u8 ctrl_id; 35 u8 band_idx; 36 union { 37 struct { 38 u8 protect_type; /* 1: duty admit, 2: radio off */ 39 u8 trigger_type; /* 0: low, 1: high */ 40 } __packed type; 41 struct { 42 u8 duty_level; /* level 0~3 */ 43 u8 duty_cycle; 44 } __packed duty; 45 }; 46 } __packed; 47 48 struct mt7996_mcu_thermal_enable { 49 __le32 trigger_temp; 50 __le32 restore_temp; 51 __le16 sustain_time; 52 u8 rsv[2]; 53 } __packed; 54 55 struct mt7996_mcu_csa_notify { 56 struct mt7996_mcu_rxd rxd; 57 58 u8 omac_idx; 59 u8 csa_count; 60 u8 band_idx; 61 u8 rsv; 62 } __packed; 63 64 struct mt7996_mcu_rdd_report { 65 struct mt7996_mcu_rxd rxd; 66 67 u8 __rsv1[4]; 68 69 __le16 tag; 70 __le16 len; 71 72 u8 band_idx; 73 u8 long_detected; 74 u8 constant_prf_detected; 75 u8 staggered_prf_detected; 76 u8 radar_type_idx; 77 u8 periodic_pulse_num; 78 u8 long_pulse_num; 79 u8 hw_pulse_num; 80 81 u8 out_lpn; 82 u8 out_spn; 83 u8 out_crpn; 84 u8 out_crpw; 85 u8 out_crbn; 86 u8 out_stgpn; 87 u8 out_stgpw; 88 89 u8 __rsv2; 90 91 __le32 out_pri_const; 92 __le32 out_pri_stg[3]; 93 __le32 out_pri_stg_dmin; 94 95 struct { 96 __le32 start; 97 __le16 pulse_width; 98 __le16 pulse_power; 99 u8 mdrdy_flag; 100 u8 rsv[3]; 101 } long_pulse[32]; 102 103 struct { 104 __le32 start; 105 __le16 pulse_width; 106 __le16 pulse_power; 107 u8 mdrdy_flag; 108 u8 rsv[3]; 109 } periodic_pulse[32]; 110 111 struct { 112 __le32 start; 113 __le16 pulse_width; 114 __le16 pulse_power; 115 u8 sc_pass; 116 u8 sw_reset; 117 u8 mdrdy_flag; 118 u8 tx_active; 119 } hw_pulse[32]; 120 } __packed; 121 122 struct mt7996_mcu_background_chain_ctrl { 123 u8 _rsv[4]; 124 125 __le16 tag; 126 __le16 len; 127 128 u8 chan; /* primary channel */ 129 u8 central_chan; /* central channel */ 130 u8 bw; 131 u8 tx_stream; 132 u8 rx_stream; 133 134 u8 monitor_chan; /* monitor channel */ 135 u8 monitor_central_chan;/* monitor central channel */ 136 u8 monitor_bw; 137 u8 monitor_tx_stream; 138 u8 monitor_rx_stream; 139 140 u8 scan_mode; /* 0: ScanStop 141 * 1: ScanStart 142 * 2: ScanRunning 143 */ 144 u8 band_idx; /* DBDC */ 145 u8 monitor_scan_type; 146 u8 band; /* 0: 2.4GHz, 1: 5GHz */ 147 u8 rsv[2]; 148 } __packed; 149 150 struct mt7996_mcu_eeprom { 151 u8 _rsv[4]; 152 153 __le16 tag; 154 __le16 len; 155 u8 buffer_mode; 156 u8 format; 157 __le16 buf_len; 158 } __packed; 159 160 struct mt7996_mcu_phy_rx_info { 161 u8 category; 162 u8 rate; 163 u8 mode; 164 u8 nsts; 165 u8 gi; 166 u8 coding; 167 u8 stbc; 168 u8 bw; 169 }; 170 171 struct mt7996_mcu_mib { 172 __le16 tag; 173 __le16 len; 174 __le32 offs; 175 __le64 data; 176 } __packed; 177 178 struct all_sta_trx_rate { 179 __le16 wlan_idx; 180 u8 __rsv1[2]; 181 u8 tx_mode; 182 u8 flags; 183 u8 tx_stbc; 184 u8 tx_gi; 185 u8 tx_bw; 186 u8 tx_ldpc; 187 u8 tx_mcs; 188 u8 tx_nss; 189 u8 rx_rate; 190 u8 rx_mode; 191 u8 rx_nsts; 192 u8 rx_gi; 193 u8 rx_coding; 194 u8 rx_stbc; 195 u8 rx_bw; 196 u8 __rsv2; 197 } __packed; 198 199 struct mt7996_mcu_all_sta_info_event { 200 u8 rsv[4]; 201 __le16 tag; 202 __le16 len; 203 u8 more; 204 u8 rsv2; 205 __le16 sta_num; 206 u8 rsv3[4]; 207 208 union { 209 struct all_sta_trx_rate rate[0]; 210 struct { 211 __le16 wlan_idx; 212 u8 rsv[2]; 213 __le32 tx_bytes[IEEE80211_NUM_ACS]; 214 __le32 rx_bytes[IEEE80211_NUM_ACS]; 215 } adm_stat[0]; 216 217 struct { 218 __le16 wlan_idx; 219 u8 rsv[2]; 220 __le32 tx_msdu_cnt; 221 __le32 rx_msdu_cnt; 222 } msdu_cnt[0]; 223 }; 224 } __packed; 225 226 struct mt7996_mcu_wed_rro_event { 227 struct mt7996_mcu_rxd rxd; 228 229 u8 __rsv1[4]; 230 231 __le16 tag; 232 __le16 len; 233 } __packed; 234 235 struct mt7996_mcu_wed_rro_ba_event { 236 __le16 tag; 237 __le16 len; 238 239 __le16 wlan_id; 240 u8 tid; 241 u8 __rsv1; 242 __le32 status; 243 __le16 id; 244 u8 __rsv2[2]; 245 } __packed; 246 247 struct mt7996_mcu_wed_rro_ba_delete_event { 248 __le16 tag; 249 __le16 len; 250 251 __le16 session_id; 252 u8 __rsv2[2]; 253 } __packed; 254 255 enum { 256 UNI_WED_RRO_BA_SESSION_STATUS, 257 UNI_WED_RRO_BA_SESSION_TBL, 258 UNI_WED_RRO_BA_SESSION_DELETE, 259 }; 260 261 struct mt7996_mcu_thermal_notify { 262 struct mt7996_mcu_rxd rxd; 263 264 u8 __rsv1[4]; 265 266 __le16 tag; 267 __le16 len; 268 269 u8 event_id; 270 u8 band_idx; 271 u8 level_idx; 272 u8 duty_percent; 273 __le32 restore_temp; 274 u8 __rsv2[4]; 275 } __packed; 276 277 enum mt7996_chan_mib_offs { 278 UNI_MIB_OBSS_AIRTIME = 26, 279 UNI_MIB_NON_WIFI_TIME = 27, 280 UNI_MIB_TX_TIME = 28, 281 UNI_MIB_RX_TIME = 29 282 }; 283 284 struct edca { 285 __le16 tag; 286 __le16 len; 287 288 u8 queue; 289 u8 set; 290 u8 cw_min; 291 u8 cw_max; 292 __le16 txop; 293 u8 aifs; 294 u8 __rsv; 295 }; 296 297 #define MCU_PQ_ID(p, q) (((p) << 15) | ((q) << 10)) 298 #define MCU_PKT_ID 0xa0 299 300 enum { 301 MCU_FW_LOG_WM, 302 MCU_FW_LOG_WA, 303 MCU_FW_LOG_TO_HOST, 304 MCU_FW_LOG_RELAY = 16 305 }; 306 307 enum { 308 MCU_TWT_AGRT_ADD, 309 MCU_TWT_AGRT_MODIFY, 310 MCU_TWT_AGRT_DELETE, 311 MCU_TWT_AGRT_TEARDOWN, 312 MCU_TWT_AGRT_GET_TSF, 313 }; 314 315 enum { 316 MCU_WA_PARAM_CMD_QUERY, 317 MCU_WA_PARAM_CMD_SET, 318 MCU_WA_PARAM_CMD_CAPABILITY, 319 MCU_WA_PARAM_CMD_DEBUG, 320 }; 321 322 enum { 323 MCU_WA_PARAM_PDMA_RX = 0x04, 324 MCU_WA_PARAM_CPU_UTIL = 0x0b, 325 MCU_WA_PARAM_RED = 0x0e, 326 MCU_WA_PARAM_HW_PATH_HIF_VER = 0x2f, 327 }; 328 329 enum mcu_mmps_mode { 330 MCU_MMPS_STATIC, 331 MCU_MMPS_DYNAMIC, 332 MCU_MMPS_RSV, 333 MCU_MMPS_DISABLE, 334 }; 335 336 struct bss_rate_tlv { 337 __le16 tag; 338 __le16 len; 339 u8 __rsv1[4]; 340 __le16 bc_trans; 341 __le16 mc_trans; 342 u8 short_preamble; 343 u8 bc_fixed_rate; 344 u8 mc_fixed_rate; 345 u8 __rsv2[9]; 346 } __packed; 347 348 struct bss_ra_tlv { 349 __le16 tag; 350 __le16 len; 351 u8 short_preamble; 352 u8 force_sgi; 353 u8 force_gf; 354 u8 ht_mode; 355 u8 se_off; 356 u8 antenna_idx; 357 __le16 max_phyrate; 358 u8 force_tx_streams; 359 u8 __rsv[3]; 360 } __packed; 361 362 struct bss_rlm_tlv { 363 __le16 tag; 364 __le16 len; 365 u8 control_channel; 366 u8 center_chan; 367 u8 center_chan2; 368 u8 bw; 369 u8 tx_streams; 370 u8 rx_streams; 371 u8 ht_op_info; 372 u8 sco; 373 u8 band; 374 u8 __rsv[3]; 375 } __packed; 376 377 struct bss_color_tlv { 378 __le16 tag; 379 __le16 len; 380 u8 enable; 381 u8 color; 382 u8 rsv[2]; 383 } __packed; 384 385 struct bss_inband_discovery_tlv { 386 __le16 tag; 387 __le16 len; 388 u8 tx_type; 389 u8 tx_mode; 390 u8 tx_interval; 391 u8 enable; 392 __le16 wcid; 393 __le16 prob_rsp_len; 394 } __packed; 395 396 struct bss_bcn_content_tlv { 397 __le16 tag; 398 __le16 len; 399 __le16 tim_ie_pos; 400 __le16 csa_ie_pos; 401 __le16 bcc_ie_pos; 402 u8 enable; 403 u8 type; 404 __le16 pkt_len; 405 } __packed; 406 407 struct bss_bcn_cntdwn_tlv { 408 __le16 tag; 409 __le16 len; 410 u8 cnt; 411 u8 rsv[3]; 412 } __packed; 413 414 struct bss_bcn_mbss_tlv { 415 __le16 tag; 416 __le16 len; 417 __le32 bitmap; 418 #define MAX_BEACON_NUM 32 419 __le16 offset[MAX_BEACON_NUM]; 420 } __packed __aligned(4); 421 422 struct bss_txcmd_tlv { 423 __le16 tag; 424 __le16 len; 425 u8 txcmd_mode; 426 u8 __rsv[3]; 427 } __packed; 428 429 struct bss_sec_tlv { 430 __le16 tag; 431 __le16 len; 432 u8 __rsv1[2]; 433 u8 cipher; 434 u8 __rsv2[1]; 435 } __packed; 436 437 struct bss_ifs_time_tlv { 438 __le16 tag; 439 __le16 len; 440 u8 slot_valid; 441 u8 sifs_valid; 442 u8 rifs_valid; 443 u8 eifs_valid; 444 __le16 slot_time; 445 __le16 sifs_time; 446 __le16 rifs_time; 447 __le16 eifs_time; 448 u8 eifs_cck_valid; 449 u8 rsv; 450 __le16 eifs_cck_time; 451 } __packed; 452 453 struct bss_power_save { 454 __le16 tag; 455 __le16 len; 456 u8 profile; 457 u8 _rsv[3]; 458 } __packed; 459 460 struct bss_mld_tlv { 461 __le16 tag; 462 __le16 len; 463 u8 group_mld_id; 464 u8 own_mld_id; 465 u8 mac_addr[ETH_ALEN]; 466 u8 remap_idx; 467 u8 __rsv[3]; 468 } __packed; 469 470 struct sta_rec_ht_uni { 471 __le16 tag; 472 __le16 len; 473 __le16 ht_cap; 474 __le16 ht_cap_ext; 475 u8 ampdu_param; 476 u8 _rsv[3]; 477 } __packed; 478 479 struct sta_rec_ba_uni { 480 __le16 tag; 481 __le16 len; 482 u8 tid; 483 u8 ba_type; 484 u8 amsdu; 485 u8 ba_en; 486 __le16 ssn; 487 __le16 winsize; 488 u8 ba_rdd_rro; 489 u8 __rsv[3]; 490 } __packed; 491 492 struct sta_rec_eht { 493 __le16 tag; 494 __le16 len; 495 u8 tid_bitmap; 496 u8 _rsv; 497 __le16 mac_cap; 498 __le64 phy_cap; 499 __le64 phy_cap_ext; 500 u8 mcs_map_bw20[4]; 501 u8 mcs_map_bw80[3]; 502 u8 mcs_map_bw160[3]; 503 u8 mcs_map_bw320[3]; 504 u8 _rsv2[3]; 505 } __packed; 506 507 struct sec_key_uni { 508 __le16 wlan_idx; 509 u8 mgmt_prot; 510 u8 cipher_id; 511 u8 cipher_len; 512 u8 key_id; 513 u8 key_len; 514 u8 need_resp; 515 u8 key[32]; 516 } __packed; 517 518 struct sta_rec_sec_uni { 519 __le16 tag; 520 __le16 len; 521 u8 add; 522 u8 n_cipher; 523 u8 rsv[2]; 524 525 struct sec_key_uni key[2]; 526 } __packed; 527 528 struct sta_phy_uni { 529 u8 type; 530 u8 flag; 531 u8 stbc; 532 u8 sgi; 533 u8 bw; 534 u8 ldpc; 535 u8 mcs; 536 u8 nss; 537 u8 he_ltf; 538 u8 rsv[3]; 539 }; 540 541 struct sta_rec_ra_uni { 542 __le16 tag; 543 __le16 len; 544 545 u8 valid; 546 u8 auto_rate; 547 u8 phy_mode; 548 u8 channel; 549 u8 bw; 550 u8 disable_cck; 551 u8 ht_mcs32; 552 u8 ht_gf; 553 u8 ht_mcs[4]; 554 u8 mmps_mode; 555 u8 gband_256; 556 u8 af; 557 u8 auth_wapi_mode; 558 u8 rate_len; 559 560 u8 supp_mode; 561 u8 supp_cck_rate; 562 u8 supp_ofdm_rate; 563 __le32 supp_ht_mcs; 564 __le16 supp_vht_mcs[4]; 565 566 u8 op_mode; 567 u8 op_vht_chan_width; 568 u8 op_vht_rx_nss; 569 u8 op_vht_rx_nss_type; 570 571 __le32 sta_cap; 572 573 struct sta_phy_uni phy; 574 u8 rx_rcpi[4]; 575 } __packed; 576 577 struct sta_rec_ra_fixed_uni { 578 __le16 tag; 579 __le16 len; 580 581 __le32 field; 582 u8 op_mode; 583 u8 op_vht_chan_width; 584 u8 op_vht_rx_nss; 585 u8 op_vht_rx_nss_type; 586 587 struct sta_phy_uni phy; 588 589 u8 spe_idx; 590 u8 short_preamble; 591 u8 is_5g; 592 u8 mmps_mode; 593 } __packed; 594 595 struct sta_rec_hdrt { 596 __le16 tag; 597 __le16 len; 598 u8 hdrt_mode; 599 u8 rsv[3]; 600 } __packed; 601 602 struct sta_rec_hdr_trans { 603 __le16 tag; 604 __le16 len; 605 u8 from_ds; 606 u8 to_ds; 607 u8 dis_rx_hdr_tran; 608 u8 mesh; 609 } __packed; 610 611 struct hdr_trans_en { 612 __le16 tag; 613 __le16 len; 614 u8 enable; 615 u8 check_bssid; 616 u8 mode; 617 u8 __rsv; 618 } __packed; 619 620 struct hdr_trans_vlan { 621 __le16 tag; 622 __le16 len; 623 u8 insert_vlan; 624 u8 remove_vlan; 625 u8 tid; 626 u8 __rsv; 627 } __packed; 628 629 struct hdr_trans_blacklist { 630 __le16 tag; 631 __le16 len; 632 u8 idx; 633 u8 enable; 634 __le16 type; 635 } __packed; 636 637 struct uni_header { 638 u8 __rsv[4]; 639 } __packed; 640 641 struct vow_rx_airtime { 642 __le16 tag; 643 __le16 len; 644 645 u8 enable; 646 u8 band; 647 u8 __rsv[2]; 648 } __packed; 649 650 struct bf_sounding_on { 651 __le16 tag; 652 __le16 len; 653 654 u8 snd_mode; 655 u8 sta_num; 656 u8 __rsv[2]; 657 __le16 wlan_id[4]; 658 __le32 snd_period; 659 } __packed; 660 661 struct bf_hw_en_status_update { 662 __le16 tag; 663 __le16 len; 664 665 bool ebf; 666 bool ibf; 667 u8 __rsv[2]; 668 } __packed; 669 670 struct bf_mod_en_ctrl { 671 __le16 tag; 672 __le16 len; 673 674 u8 bf_num; 675 u8 bf_bitmap; 676 u8 bf_sel[8]; 677 u8 __rsv[2]; 678 } __packed; 679 680 union bf_tag_tlv { 681 struct bf_sounding_on bf_snd; 682 struct bf_hw_en_status_update bf_hw_en; 683 struct bf_mod_en_ctrl bf_mod_en; 684 }; 685 686 struct ra_rate { 687 __le16 wlan_idx; 688 u8 mode; 689 u8 stbc; 690 __le16 gi; 691 u8 bw; 692 u8 ldpc; 693 u8 mcs; 694 u8 nss; 695 __le16 ltf; 696 u8 spe; 697 u8 preamble; 698 u8 __rsv[2]; 699 } __packed; 700 701 struct ra_fixed_rate { 702 __le16 tag; 703 __le16 len; 704 705 __le16 version; 706 struct ra_rate rate; 707 } __packed; 708 709 enum { 710 UNI_RA_FIXED_RATE = 0xf, 711 }; 712 713 #define MT7996_HDR_TRANS_MAX_SIZE (sizeof(struct hdr_trans_en) + \ 714 sizeof(struct hdr_trans_vlan) + \ 715 sizeof(struct hdr_trans_blacklist)) 716 717 enum { 718 UNI_HDR_TRANS_EN, 719 UNI_HDR_TRANS_VLAN, 720 UNI_HDR_TRANS_BLACKLIST, 721 }; 722 723 enum { 724 RATE_PARAM_FIXED = 3, 725 RATE_PARAM_MMPS_UPDATE = 5, 726 RATE_PARAM_FIXED_HE_LTF = 7, 727 RATE_PARAM_FIXED_MCS, 728 RATE_PARAM_FIXED_GI = 11, 729 RATE_PARAM_AUTO = 20, 730 }; 731 732 enum { 733 BF_SOUNDING_ON = 1, 734 BF_HW_EN_UPDATE = 17, 735 BF_MOD_EN_CTRL = 20, 736 }; 737 738 enum { 739 CMD_BAND_NONE, 740 CMD_BAND_24G, 741 CMD_BAND_5G, 742 CMD_BAND_6G, 743 }; 744 745 struct bss_req_hdr { 746 u8 bss_idx; 747 u8 __rsv[3]; 748 } __packed; 749 750 enum { 751 UNI_CHANNEL_SWITCH, 752 UNI_CHANNEL_RX_PATH, 753 }; 754 755 #define MT7996_BSS_UPDATE_MAX_SIZE (sizeof(struct bss_req_hdr) + \ 756 sizeof(struct mt76_connac_bss_basic_tlv) + \ 757 sizeof(struct bss_rlm_tlv) + \ 758 sizeof(struct bss_ra_tlv) + \ 759 sizeof(struct bss_info_uni_he) + \ 760 sizeof(struct bss_rate_tlv) + \ 761 sizeof(struct bss_txcmd_tlv) + \ 762 sizeof(struct bss_power_save) + \ 763 sizeof(struct bss_sec_tlv) + \ 764 sizeof(struct bss_ifs_time_tlv) + \ 765 sizeof(struct bss_mld_tlv)) 766 767 #define MT7996_STA_UPDATE_MAX_SIZE (sizeof(struct sta_req_hdr) + \ 768 sizeof(struct sta_rec_basic) + \ 769 sizeof(struct sta_rec_bf) + \ 770 sizeof(struct sta_rec_ht_uni) + \ 771 sizeof(struct sta_rec_he_v2) + \ 772 sizeof(struct sta_rec_ba_uni) + \ 773 sizeof(struct sta_rec_vht) + \ 774 sizeof(struct sta_rec_uapsd) + \ 775 sizeof(struct sta_rec_amsdu) + \ 776 sizeof(struct sta_rec_bfee) + \ 777 sizeof(struct sta_rec_ra_uni) + \ 778 sizeof(struct sta_rec_sec) + \ 779 sizeof(struct sta_rec_ra_fixed_uni) + \ 780 sizeof(struct sta_rec_he_6g_capa) + \ 781 sizeof(struct sta_rec_eht) + \ 782 sizeof(struct sta_rec_hdrt) + \ 783 sizeof(struct sta_rec_hdr_trans) + \ 784 sizeof(struct tlv)) 785 786 #define MT7996_MAX_BEACON_SIZE 1342 787 #define MT7996_BEACON_UPDATE_SIZE (sizeof(struct bss_req_hdr) + \ 788 sizeof(struct bss_bcn_content_tlv) + \ 789 MT_TXD_SIZE + \ 790 sizeof(struct bss_bcn_cntdwn_tlv) + \ 791 sizeof(struct bss_bcn_mbss_tlv)) 792 #define MT7996_MAX_BSS_OFFLOAD_SIZE (MT7996_MAX_BEACON_SIZE + \ 793 MT7996_BEACON_UPDATE_SIZE) 794 795 static inline s8 796 mt7996_get_power_bound(struct mt7996_phy *phy, s8 txpower) 797 { 798 struct mt76_phy *mphy = phy->mt76; 799 int n_chains = hweight16(mphy->chainmask); 800 801 txpower = mt76_get_sar_power(mphy, mphy->chandef.chan, txpower * 2); 802 txpower -= mt76_tx_power_nss_delta(n_chains); 803 804 return txpower; 805 } 806 807 enum { 808 UNI_BAND_CONFIG_RADIO_ENABLE, 809 UNI_BAND_CONFIG_RTS_THRESHOLD = 0x08, 810 }; 811 812 enum { 813 UNI_WSYS_CONFIG_FW_LOG_CTRL, 814 UNI_WSYS_CONFIG_FW_DBG_CTRL, 815 }; 816 817 enum { 818 UNI_RDD_CTRL_PARM, 819 UNI_RDD_CTRL_SET_TH = 0x3, 820 }; 821 822 enum { 823 UNI_EFUSE_ACCESS = 1, 824 UNI_EFUSE_BUFFER_MODE, 825 UNI_EFUSE_FREE_BLOCK, 826 UNI_EFUSE_BUFFER_RD, 827 }; 828 829 enum { 830 UNI_VOW_DRR_CTRL, 831 UNI_VOW_RX_AT_AIRTIME_EN = 0x0b, 832 UNI_VOW_RX_AT_AIRTIME_CLR_EN = 0x0e, 833 }; 834 835 enum { 836 UNI_CMD_MIB_DATA, 837 }; 838 839 enum { 840 UNI_POWER_OFF, 841 }; 842 843 enum { 844 UNI_CMD_TWT_ARGT_UPDATE = 0x0, 845 UNI_CMD_TWT_MGMT_OFFLOAD, 846 }; 847 848 enum { 849 UNI_RRO_DEL_ENTRY = 0x1, 850 UNI_RRO_SET_PLATFORM_TYPE, 851 UNI_RRO_GET_BA_SESSION_TABLE, 852 UNI_RRO_SET_BYPASS_MODE, 853 UNI_RRO_SET_TXFREE_PATH, 854 UNI_RRO_DEL_BA_SESSION, 855 UNI_RRO_SET_FLUSH_TIMEOUT 856 }; 857 858 enum{ 859 UNI_CMD_SR_ENABLE = 0x1, 860 UNI_CMD_SR_ENABLE_SD, 861 UNI_CMD_SR_ENABLE_MODE, 862 UNI_CMD_SR_ENABLE_DPD = 0x12, 863 UNI_CMD_SR_ENABLE_TX, 864 UNI_CMD_SR_SET_SRG_BITMAP = 0x80, 865 UNI_CMD_SR_SET_PARAM = 0xc1, 866 UNI_CMD_SR_SET_SIGA = 0xd0, 867 }; 868 869 enum { 870 UNI_CMD_THERMAL_PROTECT_ENABLE = 0x6, 871 UNI_CMD_THERMAL_PROTECT_DISABLE, 872 UNI_CMD_THERMAL_PROTECT_DUTY_CONFIG, 873 }; 874 875 enum { 876 UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL = 4, 877 }; 878 879 enum { 880 UNI_CMD_ACCESS_REG_BASIC = 0x0, 881 UNI_CMD_ACCESS_RF_REG_BASIC, 882 }; 883 884 enum { 885 UNI_CMD_SER_QUERY, 886 /* recovery */ 887 UNI_CMD_SER_SET_RECOVER_L1, 888 UNI_CMD_SER_SET_RECOVER_L2, 889 UNI_CMD_SER_SET_RECOVER_L3_RX_ABORT, 890 UNI_CMD_SER_SET_RECOVER_L3_TX_ABORT, 891 UNI_CMD_SER_SET_RECOVER_L3_TX_DISABLE, 892 UNI_CMD_SER_SET_RECOVER_L3_BF, 893 UNI_CMD_SER_SET_RECOVER_L4_MDP, 894 UNI_CMD_SER_SET_RECOVER_FULL, 895 UNI_CMD_SER_SET_SYSTEM_ASSERT, 896 /* action */ 897 UNI_CMD_SER_ENABLE = 1, 898 UNI_CMD_SER_SET, 899 UNI_CMD_SER_TRIGGER 900 }; 901 902 enum { 903 MT7996_SEC_MODE_PLAIN, 904 MT7996_SEC_MODE_AES, 905 MT7996_SEC_MODE_SCRAMBLE, 906 MT7996_SEC_MODE_MAX, 907 }; 908 909 #define MT7996_PATCH_SEC GENMASK(31, 24) 910 #define MT7996_PATCH_SCRAMBLE_KEY GENMASK(15, 8) 911 #define MT7996_PATCH_AES_KEY GENMASK(7, 0) 912 913 #define MT7996_SEC_ENCRYPT BIT(0) 914 #define MT7996_SEC_KEY_IDX GENMASK(2, 1) 915 #define MT7996_SEC_IV BIT(3) 916 917 struct fixed_rate_table_ctrl { 918 u8 _rsv[4]; 919 920 __le16 tag; 921 __le16 len; 922 923 u8 table_idx; 924 u8 antenna_idx; 925 __le16 rate_idx; 926 u8 spe_idx_sel; 927 u8 spe_idx; 928 u8 gi; 929 u8 he_ltf; 930 bool ldpc; 931 bool txbf; 932 bool dynamic_bw; 933 934 u8 _rsv2; 935 } __packed; 936 937 #endif 938