162306a36Sopenharmony_ci/* SPDX-License-Identifier: ISC */ 262306a36Sopenharmony_ci/* Copyright (C) 2019 MediaTek Inc. */ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef __MT7615_MAC_H 562306a36Sopenharmony_ci#define __MT7615_MAC_H 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#define MT_CT_PARSE_LEN 72 862306a36Sopenharmony_ci#define MT_CT_DMA_BUF_NUM 2 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#define MT_RXD0_LENGTH GENMASK(15, 0) 1162306a36Sopenharmony_ci#define MT_RXD0_PKT_FLAG GENMASK(19, 16) 1262306a36Sopenharmony_ci#define MT_RXD0_PKT_TYPE GENMASK(31, 29) 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16) 1562306a36Sopenharmony_ci#define MT_RXD0_NORMAL_IP_SUM BIT(23) 1662306a36Sopenharmony_ci#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24) 1762306a36Sopenharmony_ci#define MT_RXD0_NORMAL_GROUP_1 BIT(25) 1862306a36Sopenharmony_ci#define MT_RXD0_NORMAL_GROUP_2 BIT(26) 1962306a36Sopenharmony_ci#define MT_RXD0_NORMAL_GROUP_3 BIT(27) 2062306a36Sopenharmony_ci#define MT_RXD0_NORMAL_GROUP_4 BIT(28) 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#define MT_RXD1_NORMAL_BSSID GENMASK(31, 26) 2362306a36Sopenharmony_ci#define MT_RXD1_NORMAL_PAYLOAD_FORMAT GENMASK(25, 24) 2462306a36Sopenharmony_ci#define MT_RXD1_FIRST_AMSDU_FRAME GENMASK(1, 0) 2562306a36Sopenharmony_ci#define MT_RXD1_MID_AMSDU_FRAME BIT(1) 2662306a36Sopenharmony_ci#define MT_RXD1_LAST_AMSDU_FRAME BIT(0) 2762306a36Sopenharmony_ci#define MT_RXD1_NORMAL_HDR_TRANS BIT(23) 2862306a36Sopenharmony_ci#define MT_RXD1_NORMAL_HDR_OFFSET BIT(22) 2962306a36Sopenharmony_ci#define MT_RXD1_NORMAL_MAC_HDR_LEN GENMASK(21, 16) 3062306a36Sopenharmony_ci#define MT_RXD1_NORMAL_CH_FREQ GENMASK(15, 8) 3162306a36Sopenharmony_ci#define MT_RXD1_NORMAL_KEY_ID GENMASK(7, 6) 3262306a36Sopenharmony_ci#define MT_RXD1_NORMAL_BEACON_UC BIT(5) 3362306a36Sopenharmony_ci#define MT_RXD1_NORMAL_BEACON_MC BIT(4) 3462306a36Sopenharmony_ci#define MT_RXD1_NORMAL_BF_REPORT BIT(3) 3562306a36Sopenharmony_ci#define MT_RXD1_NORMAL_ADDR_TYPE GENMASK(2, 1) 3662306a36Sopenharmony_ci#define MT_RXD1_NORMAL_BCAST GENMASK(2, 1) 3762306a36Sopenharmony_ci#define MT_RXD1_NORMAL_MCAST BIT(2) 3862306a36Sopenharmony_ci#define MT_RXD1_NORMAL_U2M BIT(1) 3962306a36Sopenharmony_ci#define MT_RXD1_NORMAL_HTC_VLD BIT(0) 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#define MT_RXD2_NORMAL_NON_AMPDU BIT(31) 4262306a36Sopenharmony_ci#define MT_RXD2_NORMAL_NON_AMPDU_SUB BIT(30) 4362306a36Sopenharmony_ci#define MT_RXD2_NORMAL_NDATA BIT(29) 4462306a36Sopenharmony_ci#define MT_RXD2_NORMAL_NULL_FRAME BIT(28) 4562306a36Sopenharmony_ci#define MT_RXD2_NORMAL_FRAG BIT(27) 4662306a36Sopenharmony_ci#define MT_RXD2_NORMAL_INT_FRAME BIT(26) 4762306a36Sopenharmony_ci#define MT_RXD2_NORMAL_HDR_TRANS_ERROR BIT(25) 4862306a36Sopenharmony_ci#define MT_RXD2_NORMAL_MAX_LEN_ERROR BIT(24) 4962306a36Sopenharmony_ci#define MT_RXD2_NORMAL_AMSDU_ERR BIT(23) 5062306a36Sopenharmony_ci#define MT_RXD2_NORMAL_LEN_MISMATCH BIT(22) 5162306a36Sopenharmony_ci#define MT_RXD2_NORMAL_TKIP_MIC_ERR BIT(21) 5262306a36Sopenharmony_ci#define MT_RXD2_NORMAL_ICV_ERR BIT(20) 5362306a36Sopenharmony_ci#define MT_RXD2_NORMAL_CLM BIT(19) 5462306a36Sopenharmony_ci#define MT_RXD2_NORMAL_CM BIT(18) 5562306a36Sopenharmony_ci#define MT_RXD2_NORMAL_FCS_ERR BIT(17) 5662306a36Sopenharmony_ci#define MT_RXD2_NORMAL_SW_BIT BIT(16) 5762306a36Sopenharmony_ci#define MT_RXD2_NORMAL_SEC_MODE GENMASK(15, 12) 5862306a36Sopenharmony_ci#define MT_RXD2_NORMAL_TID GENMASK(11, 8) 5962306a36Sopenharmony_ci#define MT_RXD2_NORMAL_WLAN_IDX GENMASK(7, 0) 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci#define MT_RXD3_NORMAL_PF_STS GENMASK(31, 30) 6262306a36Sopenharmony_ci#define MT_RXD3_NORMAL_PF_MODE BIT(29) 6362306a36Sopenharmony_ci#define MT_RXD3_NORMAL_CLS_BITMAP GENMASK(28, 19) 6462306a36Sopenharmony_ci#define MT_RXD3_NORMAL_WOL GENMASK(18, 14) 6562306a36Sopenharmony_ci#define MT_RXD3_NORMAL_MAGIC_PKT BIT(13) 6662306a36Sopenharmony_ci#define MT_RXD3_NORMAL_OFLD GENMASK(12, 11) 6762306a36Sopenharmony_ci#define MT_RXD3_NORMAL_CLS BIT(10) 6862306a36Sopenharmony_ci#define MT_RXD3_NORMAL_PATTERN_DROP BIT(9) 6962306a36Sopenharmony_ci#define MT_RXD3_NORMAL_TSF_COMPARE_LOSS BIT(8) 7062306a36Sopenharmony_ci#define MT_RXD3_NORMAL_RXV_SEQ GENMASK(7, 0) 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci#define MT_RXD4_FRAME_CONTROL GENMASK(15, 0) 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci#define MT_RXD6_SEQ_CTRL GENMASK(15, 0) 7562306a36Sopenharmony_ci#define MT_RXD6_QOS_CTL GENMASK(31, 16) 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci#define MT_RXD7_HT_CONTROL GENMASK(31, 0) 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define MT_RXV1_ACID_DET_H BIT(31) 8062306a36Sopenharmony_ci#define MT_RXV1_ACID_DET_L BIT(30) 8162306a36Sopenharmony_ci#define MT_RXV1_VHTA2_B8_B3 GENMASK(29, 24) 8262306a36Sopenharmony_ci#define MT_RXV1_NUM_RX GENMASK(23, 22) 8362306a36Sopenharmony_ci#define MT_RXV1_HT_NO_SOUND BIT(21) 8462306a36Sopenharmony_ci#define MT_RXV1_HT_SMOOTH BIT(20) 8562306a36Sopenharmony_ci#define MT_RXV1_HT_SHORT_GI BIT(19) 8662306a36Sopenharmony_ci#define MT_RXV1_HT_AGGR BIT(18) 8762306a36Sopenharmony_ci#define MT_RXV1_VHTA1_B22 BIT(17) 8862306a36Sopenharmony_ci#define MT_RXV1_FRAME_MODE GENMASK(16, 15) 8962306a36Sopenharmony_ci#define MT_RXV1_TX_MODE GENMASK(14, 12) 9062306a36Sopenharmony_ci#define MT_RXV1_HT_EXT_LTF GENMASK(11, 10) 9162306a36Sopenharmony_ci#define MT_RXV1_HT_AD_CODE BIT(9) 9262306a36Sopenharmony_ci#define MT_RXV1_HT_STBC GENMASK(8, 7) 9362306a36Sopenharmony_ci#define MT_RXV1_TX_RATE GENMASK(6, 0) 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define MT_RXV2_SEL_ANT BIT(31) 9662306a36Sopenharmony_ci#define MT_RXV2_VALID_BIT BIT(30) 9762306a36Sopenharmony_ci#define MT_RXV2_NSTS GENMASK(29, 27) 9862306a36Sopenharmony_ci#define MT_RXV2_GROUP_ID GENMASK(26, 21) 9962306a36Sopenharmony_ci#define MT_RXV2_LENGTH GENMASK(20, 0) 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci#define MT_RXV3_WB_RSSI GENMASK(31, 24) 10262306a36Sopenharmony_ci#define MT_RXV3_IB_RSSI GENMASK(23, 16) 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define MT_RXV4_RCPI3 GENMASK(31, 24) 10562306a36Sopenharmony_ci#define MT_RXV4_RCPI2 GENMASK(23, 16) 10662306a36Sopenharmony_ci#define MT_RXV4_RCPI1 GENMASK(15, 8) 10762306a36Sopenharmony_ci#define MT_RXV4_RCPI0 GENMASK(7, 0) 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci#define MT_RXV5_FOE GENMASK(11, 0) 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci#define MT_RXV6_NF3 GENMASK(31, 24) 11262306a36Sopenharmony_ci#define MT_RXV6_NF2 GENMASK(23, 16) 11362306a36Sopenharmony_ci#define MT_RXV6_NF1 GENMASK(15, 8) 11462306a36Sopenharmony_ci#define MT_RXV6_NF0 GENMASK(7, 0) 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_cienum tx_header_format { 11762306a36Sopenharmony_ci MT_HDR_FORMAT_802_3, 11862306a36Sopenharmony_ci MT_HDR_FORMAT_CMD, 11962306a36Sopenharmony_ci MT_HDR_FORMAT_802_11, 12062306a36Sopenharmony_ci MT_HDR_FORMAT_802_11_EXT, 12162306a36Sopenharmony_ci}; 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_cienum tx_pkt_type { 12462306a36Sopenharmony_ci MT_TX_TYPE_CT, 12562306a36Sopenharmony_ci MT_TX_TYPE_SF, 12662306a36Sopenharmony_ci MT_TX_TYPE_CMD, 12762306a36Sopenharmony_ci MT_TX_TYPE_FW, 12862306a36Sopenharmony_ci}; 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_cienum tx_port_idx { 13162306a36Sopenharmony_ci MT_TX_PORT_IDX_LMAC, 13262306a36Sopenharmony_ci MT_TX_PORT_IDX_MCU 13362306a36Sopenharmony_ci}; 13462306a36Sopenharmony_ci 13562306a36Sopenharmony_cienum tx_mcu_port_q_idx { 13662306a36Sopenharmony_ci MT_TX_MCU_PORT_RX_Q0 = 0, 13762306a36Sopenharmony_ci MT_TX_MCU_PORT_RX_Q1, 13862306a36Sopenharmony_ci MT_TX_MCU_PORT_RX_Q2, 13962306a36Sopenharmony_ci MT_TX_MCU_PORT_RX_Q3, 14062306a36Sopenharmony_ci MT_TX_MCU_PORT_RX_FWDL = 0x1e 14162306a36Sopenharmony_ci}; 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_cienum tx_phy_bandwidth { 14462306a36Sopenharmony_ci MT_PHY_BW_20, 14562306a36Sopenharmony_ci MT_PHY_BW_40, 14662306a36Sopenharmony_ci MT_PHY_BW_80, 14762306a36Sopenharmony_ci MT_PHY_BW_160, 14862306a36Sopenharmony_ci}; 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci#define MT_CT_INFO_APPLY_TXD BIT(0) 15162306a36Sopenharmony_ci#define MT_CT_INFO_COPY_HOST_TXD_ALL BIT(1) 15262306a36Sopenharmony_ci#define MT_CT_INFO_MGMT_FRAME BIT(2) 15362306a36Sopenharmony_ci#define MT_CT_INFO_NONE_CIPHER_FRAME BIT(3) 15462306a36Sopenharmony_ci#define MT_CT_INFO_HSR2_TX BIT(4) 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define MT_TXD0_P_IDX BIT(31) 15762306a36Sopenharmony_ci#define MT_TXD0_Q_IDX GENMASK(30, 26) 15862306a36Sopenharmony_ci#define MT_TXD0_UDP_TCP_SUM BIT(24) 15962306a36Sopenharmony_ci#define MT_TXD0_IP_SUM BIT(23) 16062306a36Sopenharmony_ci#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16) 16162306a36Sopenharmony_ci#define MT_TXD0_TX_BYTES GENMASK(15, 0) 16262306a36Sopenharmony_ci 16362306a36Sopenharmony_ci#define MT_TXD1_OWN_MAC GENMASK(31, 26) 16462306a36Sopenharmony_ci#define MT_TXD1_PKT_FMT GENMASK(25, 24) 16562306a36Sopenharmony_ci#define MT_TXD1_TID GENMASK(23, 21) 16662306a36Sopenharmony_ci#define MT_TXD1_AMSDU BIT(20) 16762306a36Sopenharmony_ci#define MT_TXD1_UNXV BIT(19) 16862306a36Sopenharmony_ci#define MT_TXD1_HDR_PAD GENMASK(18, 17) 16962306a36Sopenharmony_ci#define MT_TXD1_TXD_LEN BIT(16) 17062306a36Sopenharmony_ci#define MT_TXD1_LONG_FORMAT BIT(15) 17162306a36Sopenharmony_ci#define MT_TXD1_HDR_FORMAT GENMASK(14, 13) 17262306a36Sopenharmony_ci#define MT_TXD1_HDR_INFO GENMASK(12, 8) 17362306a36Sopenharmony_ci#define MT_TXD1_WLAN_IDX GENMASK(7, 0) 17462306a36Sopenharmony_ci 17562306a36Sopenharmony_ci#define MT_TXD2_FIX_RATE BIT(31) 17662306a36Sopenharmony_ci#define MT_TXD2_TIMING_MEASURE BIT(30) 17762306a36Sopenharmony_ci#define MT_TXD2_BA_DISABLE BIT(29) 17862306a36Sopenharmony_ci#define MT_TXD2_POWER_OFFSET GENMASK(28, 24) 17962306a36Sopenharmony_ci#define MT_TXD2_MAX_TX_TIME GENMASK(23, 16) 18062306a36Sopenharmony_ci#define MT_TXD2_FRAG GENMASK(15, 14) 18162306a36Sopenharmony_ci#define MT_TXD2_HTC_VLD BIT(13) 18262306a36Sopenharmony_ci#define MT_TXD2_DURATION BIT(12) 18362306a36Sopenharmony_ci#define MT_TXD2_BIP BIT(11) 18462306a36Sopenharmony_ci#define MT_TXD2_MULTICAST BIT(10) 18562306a36Sopenharmony_ci#define MT_TXD2_RTS BIT(9) 18662306a36Sopenharmony_ci#define MT_TXD2_SOUNDING BIT(8) 18762306a36Sopenharmony_ci#define MT_TXD2_NDPA BIT(7) 18862306a36Sopenharmony_ci#define MT_TXD2_NDP BIT(6) 18962306a36Sopenharmony_ci#define MT_TXD2_FRAME_TYPE GENMASK(5, 4) 19062306a36Sopenharmony_ci#define MT_TXD2_SUB_TYPE GENMASK(3, 0) 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci#define MT_TXD3_SN_VALID BIT(31) 19362306a36Sopenharmony_ci#define MT_TXD3_PN_VALID BIT(30) 19462306a36Sopenharmony_ci#define MT_TXD3_SEQ GENMASK(27, 16) 19562306a36Sopenharmony_ci#define MT_TXD3_REM_TX_COUNT GENMASK(15, 11) 19662306a36Sopenharmony_ci#define MT_TXD3_TX_COUNT GENMASK(10, 6) 19762306a36Sopenharmony_ci#define MT_TXD3_PROTECT_FRAME BIT(1) 19862306a36Sopenharmony_ci#define MT_TXD3_NO_ACK BIT(0) 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_ci#define MT_TXD4_PN_LOW GENMASK(31, 0) 20162306a36Sopenharmony_ci 20262306a36Sopenharmony_ci#define MT_TXD5_PN_HIGH GENMASK(31, 16) 20362306a36Sopenharmony_ci#define MT_TXD5_SW_POWER_MGMT BIT(13) 20462306a36Sopenharmony_ci#define MT_TXD5_DA_SELECT BIT(11) 20562306a36Sopenharmony_ci#define MT_TXD5_TX_STATUS_HOST BIT(10) 20662306a36Sopenharmony_ci#define MT_TXD5_TX_STATUS_MCU BIT(9) 20762306a36Sopenharmony_ci#define MT_TXD5_TX_STATUS_FMT BIT(8) 20862306a36Sopenharmony_ci#define MT_TXD5_PID GENMASK(7, 0) 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ci#define MT_TXD6_FIXED_RATE BIT(31) 21162306a36Sopenharmony_ci#define MT_TXD6_SGI BIT(30) 21262306a36Sopenharmony_ci#define MT_TXD6_LDPC BIT(29) 21362306a36Sopenharmony_ci#define MT_TXD6_TX_BF BIT(28) 21462306a36Sopenharmony_ci#define MT_TXD6_TX_RATE GENMASK(27, 16) 21562306a36Sopenharmony_ci#define MT_TXD6_ANT_ID GENMASK(15, 4) 21662306a36Sopenharmony_ci#define MT_TXD6_DYN_BW BIT(3) 21762306a36Sopenharmony_ci#define MT_TXD6_FIXED_BW BIT(2) 21862306a36Sopenharmony_ci#define MT_TXD6_BW GENMASK(1, 0) 21962306a36Sopenharmony_ci 22062306a36Sopenharmony_ci/* MT7663 DW7 HW-AMSDU */ 22162306a36Sopenharmony_ci#define MT_TXD7_HW_AMSDU_CAP BIT(30) 22262306a36Sopenharmony_ci#define MT_TXD7_TYPE GENMASK(21, 20) 22362306a36Sopenharmony_ci#define MT_TXD7_SUB_TYPE GENMASK(19, 16) 22462306a36Sopenharmony_ci#define MT_TXD7_SPE_IDX GENMASK(15, 11) 22562306a36Sopenharmony_ci#define MT_TXD7_SPE_IDX_SLE BIT(10) 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci#define MT_TXD8_L_TYPE GENMASK(5, 4) 22862306a36Sopenharmony_ci#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0) 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci#define MT_TX_RATE_STBC BIT(11) 23162306a36Sopenharmony_ci#define MT_TX_RATE_NSS GENMASK(10, 9) 23262306a36Sopenharmony_ci#define MT_TX_RATE_MODE GENMASK(8, 6) 23362306a36Sopenharmony_ci#define MT_TX_RATE_IDX GENMASK(5, 0) 23462306a36Sopenharmony_ci 23562306a36Sopenharmony_ci#define MT_TX_FREE_MSDU_ID_CNT GENMASK(6, 0) 23662306a36Sopenharmony_ci 23762306a36Sopenharmony_ci#define MT_TXS0_PID GENMASK(31, 24) 23862306a36Sopenharmony_ci#define MT_TXS0_BA_ERROR BIT(22) 23962306a36Sopenharmony_ci#define MT_TXS0_PS_FLAG BIT(21) 24062306a36Sopenharmony_ci#define MT_TXS0_TXOP_TIMEOUT BIT(20) 24162306a36Sopenharmony_ci#define MT_TXS0_BIP_ERROR BIT(19) 24262306a36Sopenharmony_ci 24362306a36Sopenharmony_ci#define MT_TXS0_QUEUE_TIMEOUT BIT(18) 24462306a36Sopenharmony_ci#define MT_TXS0_RTS_TIMEOUT BIT(17) 24562306a36Sopenharmony_ci#define MT_TXS0_ACK_TIMEOUT BIT(16) 24662306a36Sopenharmony_ci#define MT_TXS0_ACK_ERROR_MASK GENMASK(18, 16) 24762306a36Sopenharmony_ci 24862306a36Sopenharmony_ci#define MT_TXS0_TX_STATUS_HOST BIT(15) 24962306a36Sopenharmony_ci#define MT_TXS0_TX_STATUS_MCU BIT(14) 25062306a36Sopenharmony_ci#define MT_TXS0_TXS_FORMAT BIT(13) 25162306a36Sopenharmony_ci#define MT_TXS0_FIXED_RATE BIT(12) 25262306a36Sopenharmony_ci#define MT_TXS0_TX_RATE GENMASK(11, 0) 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_ci#define MT_TXS1_ANT_ID GENMASK(31, 20) 25562306a36Sopenharmony_ci#define MT_TXS1_RESP_RATE GENMASK(19, 16) 25662306a36Sopenharmony_ci#define MT_TXS1_BW GENMASK(15, 14) 25762306a36Sopenharmony_ci#define MT_TXS1_I_TXBF BIT(13) 25862306a36Sopenharmony_ci#define MT_TXS1_E_TXBF BIT(12) 25962306a36Sopenharmony_ci#define MT_TXS1_TID GENMASK(11, 9) 26062306a36Sopenharmony_ci#define MT_TXS1_AMPDU BIT(8) 26162306a36Sopenharmony_ci#define MT_TXS1_ACKED_MPDU BIT(7) 26262306a36Sopenharmony_ci#define MT_TXS1_TX_POWER_DBM GENMASK(6, 0) 26362306a36Sopenharmony_ci 26462306a36Sopenharmony_ci#define MT_TXS2_WCID GENMASK(31, 24) 26562306a36Sopenharmony_ci#define MT_TXS2_RXV_SEQNO GENMASK(23, 16) 26662306a36Sopenharmony_ci#define MT_TXS2_TX_DELAY GENMASK(15, 0) 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci#define MT_TXS3_LAST_TX_RATE GENMASK(31, 29) 26962306a36Sopenharmony_ci#define MT_TXS3_TX_COUNT GENMASK(28, 24) 27062306a36Sopenharmony_ci#define MT_TXS3_F1_TSSI1 GENMASK(23, 12) 27162306a36Sopenharmony_ci#define MT_TXS3_F1_TSSI0 GENMASK(11, 0) 27262306a36Sopenharmony_ci#define MT_TXS3_F0_SEQNO GENMASK(11, 0) 27362306a36Sopenharmony_ci 27462306a36Sopenharmony_ci#define MT_TXS4_F0_TIMESTAMP GENMASK(31, 0) 27562306a36Sopenharmony_ci#define MT_TXS4_F1_TSSI3 GENMASK(23, 12) 27662306a36Sopenharmony_ci#define MT_TXS4_F1_TSSI2 GENMASK(11, 0) 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci#define MT_TXS5_F0_FRONT_TIME GENMASK(24, 0) 27962306a36Sopenharmony_ci#define MT_TXS5_F1_NOISE_2 GENMASK(23, 16) 28062306a36Sopenharmony_ci#define MT_TXS5_F1_NOISE_1 GENMASK(15, 8) 28162306a36Sopenharmony_ci#define MT_TXS5_F1_NOISE_0 GENMASK(7, 0) 28262306a36Sopenharmony_ci 28362306a36Sopenharmony_ci#define MT_TXS6_F1_RCPI_3 GENMASK(31, 24) 28462306a36Sopenharmony_ci#define MT_TXS6_F1_RCPI_2 GENMASK(23, 16) 28562306a36Sopenharmony_ci#define MT_TXS6_F1_RCPI_1 GENMASK(15, 8) 28662306a36Sopenharmony_ci#define MT_TXS6_F1_RCPI_0 GENMASK(7, 0) 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_cistruct mt7615_dfs_pulse { 28962306a36Sopenharmony_ci u32 max_width; /* us */ 29062306a36Sopenharmony_ci int max_pwr; /* dbm */ 29162306a36Sopenharmony_ci int min_pwr; /* dbm */ 29262306a36Sopenharmony_ci u32 min_stgr_pri; /* us */ 29362306a36Sopenharmony_ci u32 max_stgr_pri; /* us */ 29462306a36Sopenharmony_ci u32 min_cr_pri; /* us */ 29562306a36Sopenharmony_ci u32 max_cr_pri; /* us */ 29662306a36Sopenharmony_ci}; 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_cistruct mt7615_dfs_pattern { 29962306a36Sopenharmony_ci u8 enb; 30062306a36Sopenharmony_ci u8 stgr; 30162306a36Sopenharmony_ci u8 min_crpn; 30262306a36Sopenharmony_ci u8 max_crpn; 30362306a36Sopenharmony_ci u8 min_crpr; 30462306a36Sopenharmony_ci u8 min_pw; 30562306a36Sopenharmony_ci u8 max_pw; 30662306a36Sopenharmony_ci u32 min_pri; 30762306a36Sopenharmony_ci u32 max_pri; 30862306a36Sopenharmony_ci u8 min_crbn; 30962306a36Sopenharmony_ci u8 max_crbn; 31062306a36Sopenharmony_ci u8 min_stgpn; 31162306a36Sopenharmony_ci u8 max_stgpn; 31262306a36Sopenharmony_ci u8 min_stgpr; 31362306a36Sopenharmony_ci}; 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_cistruct mt7615_dfs_radar_spec { 31662306a36Sopenharmony_ci struct mt7615_dfs_pulse pulse_th; 31762306a36Sopenharmony_ci struct mt7615_dfs_pattern radar_pattern[16]; 31862306a36Sopenharmony_ci}; 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_cistatic inline u32 mt7615_mac_wtbl_addr(struct mt7615_dev *dev, int wcid) 32162306a36Sopenharmony_ci{ 32262306a36Sopenharmony_ci return MT_WTBL_BASE(dev) + wcid * MT_WTBL_ENTRY_SIZE; 32362306a36Sopenharmony_ci} 32462306a36Sopenharmony_ci 32562306a36Sopenharmony_ci#endif 326