1*c06983aeShastings /* $OpenBSD: mtwreg.h,v 1.2 2022/07/27 06:41:04 hastings Exp $ */ 257a8187dShastings /* 357a8187dShastings * Copyright (c) 2007 Damien Bergamini <damien.bergamini@free.fr> 457a8187dShastings * Copyright (c) 2021 James Hastings 557a8187dShastings * 657a8187dShastings * Permission to use, copy, modify, and distribute this software for any 757a8187dShastings * purpose with or without fee is hereby granted, provided that the above 857a8187dShastings * copyright notice and this permission notice appear in all copies. 957a8187dShastings * 1057a8187dShastings * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1157a8187dShastings * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1257a8187dShastings * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1357a8187dShastings * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1457a8187dShastings * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1557a8187dShastings * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1657a8187dShastings * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1757a8187dShastings */ 1857a8187dShastings 1957a8187dShastings #define MTW_ASIC_VER 0x0000 2057a8187dShastings #define MTW_CMB_CTRL 0x0020 2157a8187dShastings #define MTW_EFUSE_CTRL 0x0024 2257a8187dShastings #define MTW_EFUSE_DATA0 0x0028 2357a8187dShastings #define MTW_EFUSE_DATA1 0x002c 2457a8187dShastings #define MTW_EFUSE_DATA2 0x0030 2557a8187dShastings #define MTW_EFUSE_DATA3 0x0034 2657a8187dShastings #define MTW_OSC_CTRL 0x0038 2757a8187dShastings #define MTW_COEX_CFG0 0x0040 2857a8187dShastings #define MTW_PLL_CTRL 0x0050 2957a8187dShastings #define MTW_LDO_CFG0 0x006c 3057a8187dShastings #define MTW_LDO_CFG1 0x0070 3157a8187dShastings #define MTW_WLAN_CTRL 0x0080 3257a8187dShastings 3357a8187dShastings /* SCH/DMA registers */ 3457a8187dShastings #define MTW_INT_STATUS 0x0200 3557a8187dShastings #define RT2860_INT_MASK 0x0204 3657a8187dShastings #define MTW_WPDMA_GLO_CFG 0x0208 3757a8187dShastings #define RT2860_WPDMA_RST_IDX 0x020c 3857a8187dShastings #define RT2860_DELAY_INT_CFG 0x0210 3957a8187dShastings #define MTW_WMM_AIFSN_CFG 0x0214 4057a8187dShastings #define MTW_WMM_CWMIN_CFG 0x0218 4157a8187dShastings #define MTW_WMM_CWMAX_CFG 0x021c 4257a8187dShastings #define MTW_WMM_TXOP0_CFG 0x0220 4357a8187dShastings #define MTW_WMM_TXOP1_CFG 0x0224 4457a8187dShastings #define RT2860_GPIO_CTRL 0x0228 4557a8187dShastings #define RT2860_MCU_CMD_REG 0x022c 4657a8187dShastings #define MTW_MCU_DMA_ADDR 0x0230 4757a8187dShastings #define MTW_MCU_DMA_LEN 0x0234 4857a8187dShastings #define MTW_USB_DMA_CFG 0x0238 4957a8187dShastings #define RT2860_TX_BASE_PTR(qid) (0x0230 + (qid) * 16) 5057a8187dShastings #define RT2860_TX_MAX_CNT(qid) (0x0234 + (qid) * 16) 5157a8187dShastings #define RT2860_TX_CTX_IDX(qid) (0x0238 + (qid) * 16) 5257a8187dShastings #define RT2860_TX_DTX_IDX(qid) (0x023c + (qid) * 16) 5357a8187dShastings #define MTW_TSO_CTRL 0x0250 5457a8187dShastings #define MTW_HDR_TRANS_CTRL 0x0260 5557a8187dShastings #define RT2860_RX_BASE_PTR 0x0290 5657a8187dShastings #define RT2860_RX_MAX_CNT 0x0294 5757a8187dShastings #define RT2860_RX_CALC_IDX 0x0298 5857a8187dShastings #define RT2860_FS_DRX_IDX 0x029c 5957a8187dShastings #define MTW_US_CYC_CNT 0x02a4 6057a8187dShastings 6157a8187dShastings #define MTW_TX_RING_BASE 0x0300 6257a8187dShastings #define MTW_RX_RING_BASE 0x03c0 6357a8187dShastings 6457a8187dShastings /* Packet Buffer registers */ 6557a8187dShastings #define MTW_SYS_CTRL 0x0400 6657a8187dShastings #define MTW_PBF_CFG 0x0404 6757a8187dShastings #define MTW_TX_MAX_PCNT 0x0408 6857a8187dShastings #define MTW_RX_MAX_PCNT 0x040c 6957a8187dShastings #define MTW_PBF_CTRL 0x0410 7057a8187dShastings #define RT2860_BUF_CTRL 0x0410 7157a8187dShastings #define RT2860_MCU_INT_STA 0x0414 7257a8187dShastings #define RT2860_MCU_INT_ENA 0x0418 7357a8187dShastings #define RT2860_TXQ_IO(qid) (0x041c + (qid) * 4) 7457a8187dShastings #define MTW_BCN_OFFSET0 0x041c 7557a8187dShastings #define MTW_BCN_OFFSET1 0x0420 7657a8187dShastings #define MTW_BCN_OFFSET2 0x0424 7757a8187dShastings #define MTW_BCN_OFFSET3 0x0428 7857a8187dShastings #define RT2860_RX0Q_IO 0x0424 7957a8187dShastings #define MTW_RXQ_STA 0x0430 8057a8187dShastings #define MTW_TXQ_STA 0x0434 8157a8187dShastings #define MTW_TXRXQ_PCNT 0x0438 8257a8187dShastings 8357a8187dShastings /* RF registers */ 8457a8187dShastings #define MTW_RF_CSR 0x0500 8557a8187dShastings #define MTW_RF_BYPASS0 0x0504 8657a8187dShastings #define MTW_RF_BYPASS1 0x0508 8757a8187dShastings #define MTW_RF_SETTING0 0x050C 8857a8187dShastings #define MTW_RF_MISC 0x0518 8957a8187dShastings #define MTW_RF_DATA_WR 0x0524 9057a8187dShastings #define MTW_RF_CTRL 0x0528 9157a8187dShastings #define MTW_RF_DATA_RD 0x052c 9257a8187dShastings 9357a8187dShastings /* MCU registers */ 9457a8187dShastings #define MTW_MCU_RESET_CTL 0x070c 9557a8187dShastings #define MTW_MCU_INT_LEVEL 0x0718 9657a8187dShastings #define MTW_MCU_COM_REG0 0x0730 9757a8187dShastings #define MTW_MCU_COM_REG1 0x0734 9857a8187dShastings #define MTW_MCU_COM_REG2 0x0738 9957a8187dShastings #define MTW_MCU_COM_REG3 0x073c 10057a8187dShastings #define MTW_FCE_PSE_CTRL 0x0800 10157a8187dShastings #define MTW_FCE_PARAMETERS 0x0804 10257a8187dShastings #define MTW_FCE_CSO 0x0808 10357a8187dShastings #define MTW_FCE_L2_STUFF 0x080c 10457a8187dShastings #define MTW_FCE_WLAN_FLOW_CTRL 0x0824 10557a8187dShastings #define MTW_TX_CPU_FCE_BASE 0x09a0 10657a8187dShastings #define MTW_TX_CPU_FCE_MAX_COUNT 0x09a4 10757a8187dShastings #define MTW_MCU_FW_IDX 0x09a8 10857a8187dShastings #define MTW_FCE_PDMA 0x09c4 10957a8187dShastings #define MTW_FCE_SKIP_FS 0x0a6c 11057a8187dShastings 11157a8187dShastings /* MAC registers */ 11257a8187dShastings #define MTW_MAC_VER_ID 0x1000 11357a8187dShastings #define MTW_MAC_SYS_CTRL 0x1004 11457a8187dShastings #define MTW_MAC_ADDR_DW0 0x1008 11557a8187dShastings #define MTW_MAC_ADDR_DW1 0x100c 11657a8187dShastings #define MTW_MAC_BSSID_DW0 0x1010 11757a8187dShastings #define MTW_MAC_BSSID_DW1 0x1014 11857a8187dShastings #define MTW_MAX_LEN_CFG 0x1018 11957a8187dShastings #define MTW_BBP_CSR 0x101c 12057a8187dShastings #define MTW_LED_CFG 0x102c 12157a8187dShastings #define MTW_AMPDU_MAX_LEN_20M1S 0x1030 12257a8187dShastings #define MTW_AMPDU_MAX_LEN_20M2S 0x1034 12357a8187dShastings #define MTW_AMPDU_MAX_LEN_40M1S 0x1038 12457a8187dShastings #define MTW_AMPDU_MAX_LEN_40M2S 0x103c 12557a8187dShastings #define MTW_AMPDU_MAX_LEN 0x1040 12657a8187dShastings 12757a8187dShastings /* MAC Timing control registers */ 12857a8187dShastings #define MTW_XIFS_TIME_CFG 0x1100 12957a8187dShastings #define MTW_BKOFF_SLOT_CFG 0x1104 13057a8187dShastings #define RT2860_NAV_TIME_CFG 0x1108 13157a8187dShastings #define RT2860_CH_TIME_CFG 0x110c 13257a8187dShastings #define RT2860_PBF_LIFE_TIMER 0x1110 13357a8187dShastings #define MTW_BCN_TIME_CFG 0x1114 13457a8187dShastings #define MTW_TBTT_SYNC_CFG 0x1118 13557a8187dShastings #define MTW_TSF_TIMER_DW0 0x111c 13657a8187dShastings #define MTW_TSF_TIMER_DW1 0x1120 13757a8187dShastings #define RT2860_TBTT_TIMER 0x1124 13857a8187dShastings #define MTW_INT_TIMER_CFG 0x1128 13957a8187dShastings #define RT2860_INT_TIMER_EN 0x112c 14057a8187dShastings #define RT2860_CH_IDLE_TIME 0x1130 14157a8187dShastings 14257a8187dShastings /* MAC Power Save configuration registers */ 14357a8187dShastings #define MTW_MAC_STATUS_REG 0x1200 14457a8187dShastings #define MTW_PWR_PIN_CFG 0x1204 14557a8187dShastings #define MTW_AUTO_WAKEUP_CFG 0x1208 14657a8187dShastings #define MTW_AUX_CLK_CFG 0x120c 14757a8187dShastings #define MTW_BBP_PA_MODE_CFG0 0x1214 14857a8187dShastings #define MTW_BBP_PA_MODE_CFG1 0x1218 14957a8187dShastings #define MTW_RF_PA_MODE_CFG0 0x121c 15057a8187dShastings #define MTW_RF_PA_MODE_CFG1 0x1220 15157a8187dShastings #define MTW_RF_PA_MODE_ADJ0 0x1228 15257a8187dShastings #define MTW_RF_PA_MODE_ADJ1 0x122c 15357a8187dShastings #define MTW_DACCLK_EN_DLY_CFG 0x1264 /* MT7612 */ 15457a8187dShastings 15557a8187dShastings /* MAC TX configuration registers */ 15657a8187dShastings #define MTW_EDCA_AC_CFG(aci) (0x1300 + (aci) * 4) 15757a8187dShastings #define MTW_EDCA_TID_AC_MAP 0x1310 15857a8187dShastings #define MTW_TX_PWR_CFG(ridx) (0x1314 + (ridx) * 4) 15957a8187dShastings #define MTW_TX_PIN_CFG 0x1328 16057a8187dShastings #define MTW_TX_BAND_CFG 0x132c 16157a8187dShastings #define MTW_TX_SW_CFG0 0x1330 16257a8187dShastings #define MTW_TX_SW_CFG1 0x1334 16357a8187dShastings #define MTW_TX_SW_CFG2 0x1338 16457a8187dShastings #define RT2860_TXOP_THRES_CFG 0x133c 16557a8187dShastings #define MTW_TXOP_CTRL_CFG 0x1340 16657a8187dShastings #define MTW_TX_RTS_CFG 0x1344 16757a8187dShastings #define MTW_TX_TIMEOUT_CFG 0x1348 16857a8187dShastings #define MTW_TX_RETRY_CFG 0x134c 16957a8187dShastings #define MTW_TX_LINK_CFG 0x1350 17057a8187dShastings #define MTW_HT_FBK_CFG0 0x1354 17157a8187dShastings #define MTW_HT_FBK_CFG1 0x1358 17257a8187dShastings #define MTW_LG_FBK_CFG0 0x135c 17357a8187dShastings #define MTW_LG_FBK_CFG1 0x1360 17457a8187dShastings #define MTW_CCK_PROT_CFG 0x1364 17557a8187dShastings #define MTW_OFDM_PROT_CFG 0x1368 17657a8187dShastings #define MTW_MM20_PROT_CFG 0x136c 17757a8187dShastings #define MTW_MM40_PROT_CFG 0x1370 17857a8187dShastings #define MTW_GF20_PROT_CFG 0x1374 17957a8187dShastings #define MTW_GF40_PROT_CFG 0x1378 18057a8187dShastings #define RT2860_EXP_CTS_TIME 0x137c 18157a8187dShastings #define MTW_EXP_ACK_TIME 0x1380 18257a8187dShastings #define MTW_TX_PWR_CFG5 0x1384 18357a8187dShastings #define MTW_TX_PWR_CFG6 0x1388 18457a8187dShastings #define MTW_TX_PWR_EXT_CFG(ridx) (0x1390 + (ridx) * 4) 18557a8187dShastings #define MTW_TX0_RF_GAIN_CORR 0x13a0 18657a8187dShastings #define MTW_TX1_RF_GAIN_CORR 0x13a4 18757a8187dShastings #define MTW_TX0_RF_GAIN_ATTEN 0x13a8 18857a8187dShastings #define MTW_TX_ALC_CFG3 0x13ac 18957a8187dShastings #define MTW_TX_ALC_CFG0 0x13b0 19057a8187dShastings #define MTW_TX_ALC_CFG1 0x13b4 19157a8187dShastings #define MTW_TX_ALC_CFG4 0x13c0 19257a8187dShastings #define MTW_TX_ALC_VGA3 0x13c8 19357a8187dShastings #define MTW_TX_PWR_CFG7 0x13d4 19457a8187dShastings #define MTW_TX_PWR_CFG8 0x13d8 19557a8187dShastings #define MTW_TX_PWR_CFG9 0x13dc 19657a8187dShastings #define MTW_VHT20_PROT_CFG 0x13e0 19757a8187dShastings #define MTW_VHT40_PROT_CFG 0x13e4 19857a8187dShastings #define MTW_VHT80_PROT_CFG 0x13e8 19957a8187dShastings #define MTW_TX_PIFS_CFG 0x13ec /* MT761X */ 20057a8187dShastings 20157a8187dShastings /* MAC RX configuration registers */ 20257a8187dShastings #define MTW_RX_FILTR_CFG 0x1400 20357a8187dShastings #define MTW_AUTO_RSP_CFG 0x1404 20457a8187dShastings #define MTW_LEGACY_BASIC_RATE 0x1408 20557a8187dShastings #define MTW_HT_BASIC_RATE 0x140c 20657a8187dShastings #define MTW_HT_CTRL_CFG 0x1410 20757a8187dShastings #define RT2860_SIFS_COST_CFG 0x1414 20857a8187dShastings #define RT2860_RX_PARSER_CFG 0x1418 20957a8187dShastings 21057a8187dShastings /* MAC Security configuration registers */ 21157a8187dShastings #define RT2860_TX_SEC_CNT0 0x1500 21257a8187dShastings #define RT2860_RX_SEC_CNT0 0x1504 21357a8187dShastings #define RT2860_CCMP_FC_MUTE 0x1508 21457a8187dShastings #define MTW_PN_PAD_MODE 0x150c /* MT761X */ 21557a8187dShastings 21657a8187dShastings /* MAC HCCA/PSMP configuration registers */ 21757a8187dShastings #define MTW_TXOP_HLDR_ADDR0 0x1600 21857a8187dShastings #define MTW_TXOP_HLDR_ADDR1 0x1604 21957a8187dShastings #define MTW_TXOP_HLDR_ET 0x1608 22057a8187dShastings #define RT2860_QOS_CFPOLL_RA_DW0 0x160c 22157a8187dShastings #define RT2860_QOS_CFPOLL_A1_DW1 0x1610 22257a8187dShastings #define RT2860_QOS_CFPOLL_QC 0x1614 22357a8187dShastings #define MTW_PROT_AUTO_TX_CFG 0x1648 22457a8187dShastings 22557a8187dShastings /* MAC Statistics Counters */ 22657a8187dShastings #define MTW_RX_STA_CNT0 0x1700 22757a8187dShastings #define MTW_RX_STA_CNT1 0x1704 22857a8187dShastings #define MTW_RX_STA_CNT2 0x1708 22957a8187dShastings #define MTW_TX_STA_CNT0 0x170c 23057a8187dShastings #define MTW_TX_STA_CNT1 0x1710 23157a8187dShastings #define MTW_TX_STA_CNT2 0x1714 23257a8187dShastings #define MTW_TX_STAT_FIFO 0x1718 23357a8187dShastings 23457a8187dShastings /* RX WCID search table */ 23557a8187dShastings #define MTW_WCID_ENTRY(wcid) (0x1800 + (wcid) * 8) 23657a8187dShastings 23757a8187dShastings /* MT761x Baseband */ 23857a8187dShastings #define MTW_BBP_CORE(x) (0x2000 + (x) * 4) 23957a8187dShastings #define MTW_BBP_IBI(x) (0x2100 + (x) * 4) 24057a8187dShastings #define MTW_BBP_AGC(x) (0x2300 + (x) * 4) 24157a8187dShastings #define MTW_BBP_TXC(x) (0x2400 + (x) * 4) 24257a8187dShastings #define MTW_BBP_RXC(x) (0x2500 + (x) * 4) 24357a8187dShastings #define MTW_BBP_TXQ(x) (0x2600 + (x) * 4) 24457a8187dShastings #define MTW_BBP_TXBE(x) (0x2700 + (x) * 4) 24557a8187dShastings #define MTW_BBP_RXFE(x) (0x2800 + (x) * 4) 24657a8187dShastings #define MTW_BBP_RXO(x) (0x2900 + (x) * 4) 24757a8187dShastings #define MTW_BBP_DFS(x) (0x2a00 + (x) * 4) 24857a8187dShastings #define MTW_BBP_TR(x) (0x2b00 + (x) * 4) 24957a8187dShastings #define MTW_BBP_CAL(x) (0x2c00 + (x) * 4) 25057a8187dShastings #define MTW_BBP_DSC(x) (0x2e00 + (x) * 4) 25157a8187dShastings #define MTW_BBP_PFMU(x) (0x2f00 + (x) * 4) 25257a8187dShastings 25357a8187dShastings #define MTW_SKEY_MODE_16_23 0x7008 25457a8187dShastings #define MTW_SKEY_MODE_24_31 0x700c 25557a8187dShastings #define MTW_H2M_MAILBOX 0x7010 25657a8187dShastings 25757a8187dShastings /* Pair-wise key table */ 25857a8187dShastings #define MTW_PKEY(wcid) (0x8000 + (wcid) * 32) 25957a8187dShastings 26057a8187dShastings /* USB 3.0 DMA */ 26157a8187dShastings #define MTW_USB_U3DMA_CFG 0x9018 26257a8187dShastings 26357a8187dShastings /* IV/EIV table */ 26457a8187dShastings #define MTW_IVEIV(wcid) (0xa000 + (wcid) * 8) 26557a8187dShastings 26657a8187dShastings /* WCID attribute table */ 26757a8187dShastings #define MTW_WCID_ATTR(wcid) (0xa800 + (wcid) * 4) 26857a8187dShastings 26957a8187dShastings /* Shared Key Table */ 27057a8187dShastings #define MTW_SKEY(vap, kidx) ((vap & 8) ? MTW_SKEY_1(vap, kidx) : \ 27157a8187dShastings MTW_SKEY_0(vap, kidx)) 27257a8187dShastings #define MTW_SKEY_0(vap, kidx) (0xac00 + (4 * (vap) + (kidx)) * 32) 27357a8187dShastings #define MTW_SKEY_1(vap, kidx) (0xb400 + (4 * ((vap) & 7) + (kidx)) * 32) 27457a8187dShastings 27557a8187dShastings /* Shared Key Mode */ 27657a8187dShastings #define MTW_SKEY_MODE_0_7 0xb000 27757a8187dShastings #define MTW_SKEY_MODE_8_15 0xb004 27857a8187dShastings 27957a8187dShastings /* Shared Key Mode */ 28057a8187dShastings #define MTW_SKEY_MODE_BASE 0xb000 28157a8187dShastings 28257a8187dShastings /* Beacon */ 28357a8187dShastings #define MTW_BCN_BASE 0xc000 28457a8187dShastings 28557a8187dShastings /* possible flags for register CMB_CTRL 0x0020 */ 28657a8187dShastings #define MTW_PLL_LD (1U << 23) 28757a8187dShastings #define MTW_XTAL_RDY (1U << 22) 28857a8187dShastings 28957a8187dShastings /* possible flags for register EFUSE_CTRL 0x0024 */ 29057a8187dShastings #define MTW_SEL_EFUSE (1U << 31) 29157a8187dShastings #define MTW_EFSROM_KICK (1U << 30) 29257a8187dShastings #define MTW_EFSROM_AIN_MASK 0x03ff0000 29357a8187dShastings #define MTW_EFSROM_AIN_SHIFT 16 29457a8187dShastings #define MTW_EFSROM_MODE_MASK 0x000000c0 29557a8187dShastings #define MTW_EFUSE_AOUT_MASK 0x0000003f 29657a8187dShastings 29757a8187dShastings /* possible flags for register OSC_CTRL 0x0038 */ 29857a8187dShastings #define MTW_OSC_EN (1U << 31) 29957a8187dShastings #define MTW_OSC_CAL_REQ (1U << 30) 30057a8187dShastings #define MTW_OSC_CLK_32K_VLD (1U << 29) 30157a8187dShastings #define MTW_OSC_CAL_ACK (1U << 28) 30257a8187dShastings #define MTW_OSC_CAL_CNT (0xfff << 16) 30357a8187dShastings #define MTW_OSC_REF_CYCLE 0x1fff 30457a8187dShastings 30557a8187dShastings /* possible flags for register WLAN_CTRL 0x0080 */ 30657a8187dShastings #define MTW_GPIO_OUT_OE_ALL (0xff << 24) 30757a8187dShastings #define MTW_GPIO_OUT_ALL (0xff << 16) 30857a8187dShastings #define MTW_GPIO_IN_ALL (0xff << 8) 30957a8187dShastings #define MTW_THERM_CKEN (1U << 9) 31057a8187dShastings #define MTW_THERM_RST (1U << 8) 31157a8187dShastings #define MTW_INV_TR_SW0 (1U << 6) 31257a8187dShastings #define MTW_FRC_WL_ANT_SET (1U << 5) 31357a8187dShastings #define MTW_PCIE_APP0_CLK_REQ (1U << 4) 31457a8187dShastings #define MTW_WLAN_RESET (1U << 3) 31557a8187dShastings #define MTW_WLAN_RESET_RF (1U << 2) 31657a8187dShastings #define MTW_WLAN_CLK_EN (1U << 1) 31757a8187dShastings #define MTW_WLAN_EN (1U << 0) 31857a8187dShastings 31957a8187dShastings /* possible flags for registers INT_STATUS/INT_MASK 0x0200 */ 32057a8187dShastings #define RT2860_TX_COHERENT (1 << 17) 32157a8187dShastings #define RT2860_RX_COHERENT (1 << 16) 32257a8187dShastings #define RT2860_MAC_INT_4 (1 << 15) 32357a8187dShastings #define RT2860_MAC_INT_3 (1 << 14) 32457a8187dShastings #define RT2860_MAC_INT_2 (1 << 13) 32557a8187dShastings #define RT2860_MAC_INT_1 (1 << 12) 32657a8187dShastings #define RT2860_MAC_INT_0 (1 << 11) 32757a8187dShastings #define RT2860_TX_RX_COHERENT (1 << 10) 32857a8187dShastings #define RT2860_MCU_CMD_INT (1 << 9) 32957a8187dShastings #define RT2860_TX_DONE_INT5 (1 << 8) 33057a8187dShastings #define RT2860_TX_DONE_INT4 (1 << 7) 33157a8187dShastings #define RT2860_TX_DONE_INT3 (1 << 6) 33257a8187dShastings #define RT2860_TX_DONE_INT2 (1 << 5) 33357a8187dShastings #define RT2860_TX_DONE_INT1 (1 << 4) 33457a8187dShastings #define RT2860_TX_DONE_INT0 (1 << 3) 33557a8187dShastings #define RT2860_RX_DONE_INT (1 << 2) 33657a8187dShastings #define RT2860_TX_DLY_INT (1 << 1) 33757a8187dShastings #define RT2860_RX_DLY_INT (1 << 0) 33857a8187dShastings 33957a8187dShastings /* possible flags for register WPDMA_GLO_CFG 0x0208 */ 34057a8187dShastings #define MTW_HDR_SEG_LEN_SHIFT 8 34157a8187dShastings #define MTW_BIG_ENDIAN (1 << 7) 34257a8187dShastings #define MTW_TX_WB_DDONE (1 << 6) 34357a8187dShastings #define MTW_WPDMA_BT_SIZE_SHIFT 4 34457a8187dShastings #define MTW_WPDMA_BT_SIZE16 0 34557a8187dShastings #define MTW_WPDMA_BT_SIZE32 1 34657a8187dShastings #define MTW_WPDMA_BT_SIZE64 2 34757a8187dShastings #define MTW_WPDMA_BT_SIZE128 3 34857a8187dShastings #define MTW_RX_DMA_BUSY (1 << 3) 34957a8187dShastings #define MTW_RX_DMA_EN (1 << 2) 35057a8187dShastings #define MTW_TX_DMA_BUSY (1 << 1) 35157a8187dShastings #define MTW_TX_DMA_EN (1 << 0) 35257a8187dShastings 35357a8187dShastings /* possible flags for register DELAY_INT_CFG */ 35457a8187dShastings #define RT2860_TXDLY_INT_EN (1U << 31) 35557a8187dShastings #define RT2860_TXMAX_PINT_SHIFT 24 35657a8187dShastings #define RT2860_TXMAX_PTIME_SHIFT 16 35757a8187dShastings #define RT2860_RXDLY_INT_EN (1U << 15) 35857a8187dShastings #define RT2860_RXMAX_PINT_SHIFT 8 35957a8187dShastings #define RT2860_RXMAX_PTIME_SHIFT 0 36057a8187dShastings 36157a8187dShastings /* possible flags for register GPIO_CTRL */ 36257a8187dShastings #define RT2860_GPIO_D_SHIFT 8 36357a8187dShastings #define RT2860_GPIO_O_SHIFT 0 36457a8187dShastings 36557a8187dShastings /* possible flags for register MCU_DMA_ADDR 0x0230 */ 36657a8187dShastings #define MTW_MCU_READY (1U << 0) 36757a8187dShastings 36857a8187dShastings /* possible flags for register USB_DMA_CFG 0x0238 */ 36957a8187dShastings #define MTW_USB_TX_BUSY (1U << 31) 37057a8187dShastings #define MTW_USB_RX_BUSY (1U << 30) 37157a8187dShastings #define MTW_USB_EPOUT_VLD_SHIFT 24 37257a8187dShastings #define MTW_USB_RX_WL_DROP (1U << 25) 37357a8187dShastings #define MTW_USB_TX_EN (1U << 23) 37457a8187dShastings #define MTW_USB_RX_EN (1U << 22) 37557a8187dShastings #define MTW_USB_RX_AGG_EN (1U << 21) 37657a8187dShastings #define MTW_USB_TXOP_HALT (1U << 20) 37757a8187dShastings #define MTW_USB_TX_CLEAR (1U << 19) 37857a8187dShastings #define MTW_USB_PHY_WD_EN (1U << 16) 37957a8187dShastings #define MTW_USB_PHY_MAN_RST (1U << 15) 38057a8187dShastings #define MTW_USB_RX_AGG_LMT(x) ((x) << 8) /* in unit of 1KB */ 38157a8187dShastings #define MTW_USB_RX_AGG_TO(x) ((x) & 0xff) /* in unit of 33ns */ 38257a8187dShastings 38357a8187dShastings /* possible flags for register US_CYC_CNT 0x02a4 */ 38457a8187dShastings #define RT2860_TEST_EN (1 << 24) 38557a8187dShastings #define RT2860_TEST_SEL_SHIFT 16 38657a8187dShastings #define RT2860_BT_MODE_EN (1 << 8) 38757a8187dShastings #define RT2860_US_CYC_CNT_SHIFT 0 38857a8187dShastings 38957a8187dShastings /* possible flags for register PBF_CFG 0x0404 */ 39057a8187dShastings #define MTW_PBF_CFG_RX_DROP (1 << 8) 39157a8187dShastings #define MTW_PBF_CFG_RX0Q_EN (1 << 4) 39257a8187dShastings #define MTW_PBF_CFG_TX3Q_EN (1 << 3) 39357a8187dShastings #define MTW_PBF_CFG_TX2Q_EN (1 << 2) 39457a8187dShastings #define MTW_PBF_CFG_TX1Q_EN (1 << 1) 39557a8187dShastings #define MTW_PBF_CFG_TX0Q_EN (1 << 0) 39657a8187dShastings 39757a8187dShastings /* possible flags for register BUF_CTRL 0x0410 */ 39857a8187dShastings #define RT2860_WRITE_TXQ(qid) (1 << (11 - (qid))) 39957a8187dShastings #define RT2860_NULL0_KICK (1 << 7) 40057a8187dShastings #define RT2860_NULL1_KICK (1 << 6) 40157a8187dShastings #define RT2860_BUF_RESET (1 << 5) 40257a8187dShastings #define RT2860_READ_TXQ(qid) (1 << (3 - (qid)) 40357a8187dShastings #define RT2860_READ_RX0Q (1 << 0) 40457a8187dShastings 40557a8187dShastings /* possible flags for registers MCU_INT_STA/MCU_INT_ENA */ 40657a8187dShastings #define RT2860_MCU_MAC_INT_8 (1 << 24) 40757a8187dShastings #define RT2860_MCU_MAC_INT_7 (1 << 23) 40857a8187dShastings #define RT2860_MCU_MAC_INT_6 (1 << 22) 40957a8187dShastings #define RT2860_MCU_MAC_INT_4 (1 << 20) 41057a8187dShastings #define RT2860_MCU_MAC_INT_3 (1 << 19) 41157a8187dShastings #define RT2860_MCU_MAC_INT_2 (1 << 18) 41257a8187dShastings #define RT2860_MCU_MAC_INT_1 (1 << 17) 41357a8187dShastings #define RT2860_MCU_MAC_INT_0 (1 << 16) 41457a8187dShastings #define RT2860_DTX0_INT (1 << 11) 41557a8187dShastings #define RT2860_DTX1_INT (1 << 10) 41657a8187dShastings #define RT2860_DTX2_INT (1 << 9) 41757a8187dShastings #define RT2860_DRX0_INT (1 << 8) 41857a8187dShastings #define RT2860_HCMD_INT (1 << 7) 41957a8187dShastings #define RT2860_N0TX_INT (1 << 6) 42057a8187dShastings #define RT2860_N1TX_INT (1 << 5) 42157a8187dShastings #define RT2860_BCNTX_INT (1 << 4) 42257a8187dShastings #define RT2860_MTX0_INT (1 << 3) 42357a8187dShastings #define RT2860_MTX1_INT (1 << 2) 42457a8187dShastings #define RT2860_MTX2_INT (1 << 1) 42557a8187dShastings #define RT2860_MRX0_INT (1 << 0) 42657a8187dShastings 42757a8187dShastings /* possible flags for register TXRXQ_PCNT 0x0438 */ 42857a8187dShastings #define MTW_RX0Q_PCNT_MASK 0xff000000 42957a8187dShastings #define MTW_TX2Q_PCNT_MASK 0x00ff0000 43057a8187dShastings #define MTW_TX1Q_PCNT_MASK 0x0000ff00 43157a8187dShastings #define MTW_TX0Q_PCNT_MASK 0x000000ff 43257a8187dShastings 43357a8187dShastings /* possible flags for register RF_CSR_CFG 0x0500 */ 43457a8187dShastings #define MTW_RF_CSR_KICK (1U << 31) 43557a8187dShastings #define MTW_RF_CSR_WRITE (1U << 30) 43657a8187dShastings #define MT7610_BANK_SHIFT 15 43757a8187dShastings #define MT7601_BANK_SHIFT 14 43857a8187dShastings 43957a8187dShastings /* possible flags for register FCE_L2_STUFF 0x080c */ 44057a8187dShastings #define MTW_L2S_WR_MPDU_LEN_EN (1 << 4) 44157a8187dShastings 44257a8187dShastings /* possible flag for register DEBUG_INDEX */ 44357a8187dShastings #define RT5592_SEL_XTAL (1U << 31) 44457a8187dShastings 44557a8187dShastings /* possible flags for register MAC_SYS_CTRL 0x1004 */ 44657a8187dShastings #define MTW_RX_TS_EN (1 << 7) 44757a8187dShastings #define MTW_WLAN_HALT_EN (1 << 6) 44857a8187dShastings #define MTW_PBF_LOOP_EN (1 << 5) 44957a8187dShastings #define MTW_CONT_TX_TEST (1 << 4) 45057a8187dShastings #define MTW_MAC_RX_EN (1 << 3) 45157a8187dShastings #define MTW_MAC_TX_EN (1 << 2) 45257a8187dShastings #define MTW_BBP_HRST (1 << 1) 45357a8187dShastings #define MTW_MAC_SRST (1 << 0) 45457a8187dShastings 45557a8187dShastings /* possible flags for register MAC_BSSID_DW1 0x100c */ 45657a8187dShastings #define RT2860_MULTI_BCN_NUM_SHIFT 18 45757a8187dShastings #define RT2860_MULTI_BSSID_MODE_SHIFT 16 45857a8187dShastings 45957a8187dShastings /* possible flags for register MAX_LEN_CFG 0x1018 */ 46057a8187dShastings #define RT2860_MIN_MPDU_LEN_SHIFT 16 46157a8187dShastings #define RT2860_MAX_PSDU_LEN_SHIFT 12 46257a8187dShastings #define RT2860_MAX_PSDU_LEN8K 0 46357a8187dShastings #define RT2860_MAX_PSDU_LEN16K 1 46457a8187dShastings #define RT2860_MAX_PSDU_LEN32K 2 46557a8187dShastings #define RT2860_MAX_PSDU_LEN64K 3 46657a8187dShastings #define RT2860_MAX_MPDU_LEN_SHIFT 0 46757a8187dShastings 46857a8187dShastings /* possible flags for registers BBP_CSR_CFG 0x101c */ 46957a8187dShastings #define MTW_BBP_CSR_KICK (1 << 17) 47057a8187dShastings #define MTW_BBP_CSR_READ (1 << 16) 47157a8187dShastings #define MTW_BBP_ADDR_SHIFT 8 47257a8187dShastings #define MTW_BBP_DATA_SHIFT 0 47357a8187dShastings 47457a8187dShastings /* possible flags for register LED_CFG */ 47557a8187dShastings #define MTW_LED_MODE_ON 0 47657a8187dShastings #define MTW_LED_MODE_DIM 1 47757a8187dShastings #define MTW_LED_MODE_BLINK_TX 2 47857a8187dShastings #define MTW_LED_MODE_SLOW_BLINK 3 47957a8187dShastings 48057a8187dShastings /* possible flags for register XIFS_TIME_CFG 0x1100 */ 48157a8187dShastings #define MTW_BB_RXEND_EN (1 << 29) 48257a8187dShastings #define MTW_EIFS_TIME_SHIFT 20 48357a8187dShastings #define MTW_OFDM_XIFS_TIME_SHIFT 16 48457a8187dShastings #define MTW_OFDM_SIFS_TIME_SHIFT 8 48557a8187dShastings #define MTW_CCK_SIFS_TIME_SHIFT 0 48657a8187dShastings 48757a8187dShastings /* possible flags for register BKOFF_SLOT_CFG 0x1104 */ 48857a8187dShastings #define MTW_CC_DELAY_TIME_SHIFT 8 48957a8187dShastings #define MTW_SLOT_TIME 0 49057a8187dShastings 49157a8187dShastings /* possible flags for register NAV_TIME_CFG */ 49257a8187dShastings #define RT2860_NAV_UPD (1U << 31) 49357a8187dShastings #define RT2860_NAV_UPD_VAL_SHIFT 16 49457a8187dShastings #define RT2860_NAV_CLR_EN (1U << 15) 49557a8187dShastings #define RT2860_NAV_TIMER_SHIFT 0 49657a8187dShastings 49757a8187dShastings /* possible flags for register CH_TIME_CFG */ 49857a8187dShastings #define RT2860_EIFS_AS_CH_BUSY (1 << 4) 49957a8187dShastings #define RT2860_NAV_AS_CH_BUSY (1 << 3) 50057a8187dShastings #define RT2860_RX_AS_CH_BUSY (1 << 2) 50157a8187dShastings #define RT2860_TX_AS_CH_BUSY (1 << 1) 50257a8187dShastings #define RT2860_CH_STA_TIMER_EN (1 << 0) 50357a8187dShastings 50457a8187dShastings /* possible values for register BCN_TIME_CFG 0x1114 */ 50557a8187dShastings #define MTW_TSF_INS_COMP_SHIFT 24 50657a8187dShastings #define MTW_BCN_TX_EN (1 << 20) 50757a8187dShastings #define MTW_TBTT_TIMER_EN (1 << 19) 50857a8187dShastings #define MTW_TSF_SYNC_MODE_SHIFT 17 50957a8187dShastings #define MTW_TSF_SYNC_MODE_DIS 0 51057a8187dShastings #define MTW_TSF_SYNC_MODE_STA 1 51157a8187dShastings #define MTW_TSF_SYNC_MODE_IBSS 2 51257a8187dShastings #define MTW_TSF_SYNC_MODE_HOSTAP 3 51357a8187dShastings #define MTW_TSF_TIMER_EN (1 << 16) 51457a8187dShastings #define MTW_BCN_INTVAL_SHIFT 0 51557a8187dShastings 51657a8187dShastings /* possible flags for register TBTT_SYNC_CFG 0x1118 */ 51757a8187dShastings #define RT2860_BCN_CWMIN_SHIFT 20 51857a8187dShastings #define RT2860_BCN_AIFSN_SHIFT 16 51957a8187dShastings #define RT2860_BCN_EXP_WIN_SHIFT 8 52057a8187dShastings #define RT2860_TBTT_ADJUST_SHIFT 0 52157a8187dShastings 52257a8187dShastings /* possible flags for register INT_TIMER_CFG 0x1128 */ 52357a8187dShastings #define RT2860_GP_TIMER_SHIFT 16 52457a8187dShastings #define RT2860_PRE_TBTT_TIMER_SHIFT 0 52557a8187dShastings 52657a8187dShastings /* possible flags for register INT_TIMER_EN */ 52757a8187dShastings #define RT2860_GP_TIMER_EN (1 << 1) 52857a8187dShastings #define RT2860_PRE_TBTT_INT_EN (1 << 0) 52957a8187dShastings 53057a8187dShastings /* possible flags for register MAC_STATUS_REG 0x1200 */ 53157a8187dShastings #define MTW_RX_STATUS_BUSY (1 << 1) 53257a8187dShastings #define MTW_TX_STATUS_BUSY (1 << 0) 53357a8187dShastings 53457a8187dShastings /* possible flags for register PWR_PIN_CFG 0x1204 */ 53557a8187dShastings #define RT2860_IO_ADDA_PD (1 << 3) 53657a8187dShastings #define RT2860_IO_PLL_PD (1 << 2) 53757a8187dShastings #define RT2860_IO_RA_PE (1 << 1) 53857a8187dShastings #define RT2860_IO_RF_PE (1 << 0) 53957a8187dShastings 54057a8187dShastings /* possible flags for register AUTO_WAKEUP_CFG 0x1208 */ 54157a8187dShastings #define MTW_AUTO_WAKEUP_EN (1 << 15) 54257a8187dShastings #define MTW_SLEEP_TBTT_NUM_SHIFT 8 54357a8187dShastings #define MTW_WAKEUP_LEAD_TIME_SHIFT 0 54457a8187dShastings 54557a8187dShastings /* possible flags for register TX_PIN_CFG 0x1328 */ 54657a8187dShastings #define RT2860_TRSW_POL (1U << 19) 54757a8187dShastings #define RT2860_TRSW_EN (1U << 18) 54857a8187dShastings #define RT2860_RFTR_POL (1U << 17) 54957a8187dShastings #define RT2860_RFTR_EN (1U << 16) 55057a8187dShastings #define RT2860_LNA_PE_G1_POL (1U << 15) 55157a8187dShastings #define RT2860_LNA_PE_A1_POL (1U << 14) 55257a8187dShastings #define RT2860_LNA_PE_G0_POL (1U << 13) 55357a8187dShastings #define RT2860_LNA_PE_A0_POL (1U << 12) 55457a8187dShastings #define RT2860_LNA_PE_G1_EN (1U << 11) 55557a8187dShastings #define RT2860_LNA_PE_A1_EN (1U << 10) 55657a8187dShastings #define RT2860_LNA_PE1_EN (RT2860_LNA_PE_A1_EN | RT2860_LNA_PE_G1_EN) 55757a8187dShastings #define RT2860_LNA_PE_G0_EN (1U << 9) 55857a8187dShastings #define RT2860_LNA_PE_A0_EN (1U << 8) 55957a8187dShastings #define RT2860_LNA_PE0_EN (RT2860_LNA_PE_A0_EN | RT2860_LNA_PE_G0_EN) 56057a8187dShastings #define RT2860_PA_PE_G1_POL (1U << 7) 56157a8187dShastings #define RT2860_PA_PE_A1_POL (1U << 6) 56257a8187dShastings #define RT2860_PA_PE_G0_POL (1U << 5) 56357a8187dShastings #define RT2860_PA_PE_A0_POL (1U << 4) 56457a8187dShastings #define RT2860_PA_PE_G1_EN (1U << 3) 56557a8187dShastings #define RT2860_PA_PE_A1_EN (1U << 2) 56657a8187dShastings #define RT2860_PA_PE_G0_EN (1U << 1) 56757a8187dShastings #define RT2860_PA_PE_A0_EN (1U << 0) 56857a8187dShastings 56957a8187dShastings /* possible flags for register TX_BAND_CFG 0x132c */ 57057a8187dShastings #define MTW_TX_BAND_SEL_2G (1 << 2) 57157a8187dShastings #define MTW_TX_BAND_SEL_5G (1 << 1) 57257a8187dShastings #define MTW_TX_BAND_UPPER_40M (1 << 0) 57357a8187dShastings 57457a8187dShastings /* possible flags for register TX_SW_CFG0 0x1330 */ 57557a8187dShastings #define RT2860_DLY_RFTR_EN_SHIFT 24 57657a8187dShastings #define RT2860_DLY_TRSW_EN_SHIFT 16 57757a8187dShastings #define RT2860_DLY_PAPE_EN_SHIFT 8 57857a8187dShastings #define RT2860_DLY_TXPE_EN_SHIFT 0 57957a8187dShastings 58057a8187dShastings /* possible flags for register TX_SW_CFG1 0x1334 */ 58157a8187dShastings #define RT2860_DLY_RFTR_DIS_SHIFT 16 58257a8187dShastings #define RT2860_DLY_TRSW_DIS_SHIFT 8 58357a8187dShastings #define RT2860_DLY_PAPE_DIS SHIFT 0 58457a8187dShastings 58557a8187dShastings /* possible flags for register TX_SW_CFG2 0x1338 */ 58657a8187dShastings #define RT2860_DLY_LNA_EN_SHIFT 24 58757a8187dShastings #define RT2860_DLY_LNA_DIS_SHIFT 16 58857a8187dShastings #define RT2860_DLY_DAC_EN_SHIFT 8 58957a8187dShastings #define RT2860_DLY_DAC_DIS_SHIFT 0 59057a8187dShastings 59157a8187dShastings /* possible flags for register TXOP_THRES_CFG 0x133c */ 59257a8187dShastings #define RT2860_TXOP_REM_THRES_SHIFT 24 59357a8187dShastings #define RT2860_CF_END_THRES_SHIFT 16 59457a8187dShastings #define RT2860_RDG_IN_THRES 8 59557a8187dShastings #define RT2860_RDG_OUT_THRES 0 59657a8187dShastings 59757a8187dShastings /* possible flags for register TXOP_CTRL_CFG 0x1340 */ 59857a8187dShastings #define MTW_TXOP_ED_CCA_EN (1 << 20) 59957a8187dShastings #define MTW_EXT_CW_MIN_SHIFT 16 60057a8187dShastings #define MTW_EXT_CCA_DLY_SHIFT 8 60157a8187dShastings #define MTW_EXT_CCA_EN (1 << 7) 60257a8187dShastings #define MTW_LSIG_TXOP_EN (1 << 6) 60357a8187dShastings #define MTW_TXOP_TRUN_EN_MIMOPS (1 << 4) 60457a8187dShastings #define MTW_TXOP_TRUN_EN_TXOP (1 << 3) 60557a8187dShastings #define MTW_TXOP_TRUN_EN_RATE (1 << 2) 60657a8187dShastings #define MTW_TXOP_TRUN_EN_AC (1 << 1) 60757a8187dShastings #define MTW_TXOP_TRUN_EN_TIMEOUT (1 << 0) 60857a8187dShastings 60957a8187dShastings /* possible flags for register TX_RTS_CFG 0x1344 */ 61057a8187dShastings #define MTW_RTS_FBK_EN (1 << 24) 61157a8187dShastings #define MTW_RTS_THRES_SHIFT 8 61257a8187dShastings #define MTW_RTS_RTY_LIMIT_SHIFT 0 61357a8187dShastings 61457a8187dShastings /* possible flags for register TX_TIMEOUT_CFG 0x1348 */ 61557a8187dShastings #define MTW_TXOP_TIMEOUT_SHIFT 16 61657a8187dShastings #define MTW_RX_ACK_TIMEOUT_SHIFT 8 61757a8187dShastings #define MTW_MPDU_LIFE_TIME_SHIFT 4 61857a8187dShastings 61957a8187dShastings /* possible flags for register TX_RETRY_CFG 0x134c */ 62057a8187dShastings #define MTW_TX_AUTOFB_EN (1 << 30) 62157a8187dShastings #define MTW_AGG_RTY_MODE_TIMER (1 << 29) 62257a8187dShastings #define MTW_NAG_RTY_MODE_TIMER (1 << 28) 62357a8187dShastings #define MTW_LONG_RTY_THRES_SHIFT 16 62457a8187dShastings #define MTW_LONG_RTY_LIMIT_SHIFT 8 62557a8187dShastings #define MTW_SHORT_RTY_LIMIT_SHIFT 0 62657a8187dShastings 62757a8187dShastings /* possible flags for register TX_LINK_CFG 0x1350 */ 62857a8187dShastings #define MTW_REMOTE_MFS_SHIFT 24 62957a8187dShastings #define MTW_REMOTE_MFB_SHIFT 16 63057a8187dShastings #define MTW_TX_CFACK_EN (1 << 12) 63157a8187dShastings #define MTW_TX_RDG_EN (1 << 11) 63257a8187dShastings #define MTW_TX_MRQ_EN (1 << 10) 63357a8187dShastings #define MTW_REMOTE_UMFS_EN (1 << 9) 63457a8187dShastings #define MTW_TX_MFB_EN (1 << 8) 63557a8187dShastings #define MTW_REMOTE_MFB_LT_SHIFT 0 63657a8187dShastings 63757a8187dShastings /* possible flags for registers *_PROT_CFG */ 63857a8187dShastings #define RT2860_RTSTH_EN (1 << 26) 63957a8187dShastings #define RT2860_TXOP_ALLOW_GF40 (1 << 25) 64057a8187dShastings #define RT2860_TXOP_ALLOW_GF20 (1 << 24) 64157a8187dShastings #define RT2860_TXOP_ALLOW_MM40 (1 << 23) 64257a8187dShastings #define RT2860_TXOP_ALLOW_MM20 (1 << 22) 64357a8187dShastings #define RT2860_TXOP_ALLOW_OFDM (1 << 21) 64457a8187dShastings #define RT2860_TXOP_ALLOW_CCK (1 << 20) 64557a8187dShastings #define RT2860_TXOP_ALLOW_ALL (0x3f << 20) 64657a8187dShastings #define RT2860_PROT_NAV_SHORT (1 << 18) 64757a8187dShastings #define RT2860_PROT_NAV_LONG (2 << 18) 64857a8187dShastings #define RT2860_PROT_CTRL_RTS_CTS (1 << 16) 64957a8187dShastings #define RT2860_PROT_CTRL_CTS (2 << 16) 65057a8187dShastings 65157a8187dShastings /* possible flags for registers EXP_{CTS,ACK}_TIME */ 65257a8187dShastings #define RT2860_EXP_OFDM_TIME_SHIFT 16 65357a8187dShastings #define RT2860_EXP_CCK_TIME_SHIFT 0 65457a8187dShastings 65557a8187dShastings /* possible flags for register RX_FILTR_CFG 0x1400 */ 65657a8187dShastings #define MTW_DROP_CTRL_RSV (1 << 16) 65757a8187dShastings #define MTW_DROP_BAR (1 << 15) 65857a8187dShastings #define MTW_DROP_BA (1 << 14) 65957a8187dShastings #define MTW_DROP_PSPOLL (1 << 13) 66057a8187dShastings #define MTW_DROP_RTS (1 << 12) 66157a8187dShastings #define MTW_DROP_CTS (1 << 11) 66257a8187dShastings #define MTW_DROP_ACK (1 << 10) 66357a8187dShastings #define MTW_DROP_CFEND (1 << 9) 66457a8187dShastings #define MTW_DROP_CFACK (1 << 8) 66557a8187dShastings #define MTW_DROP_DUPL (1 << 7) 66657a8187dShastings #define MTW_DROP_BC (1 << 6) 66757a8187dShastings #define MTW_DROP_MC (1 << 5) 66857a8187dShastings #define MTW_DROP_VER_ERR (1 << 4) 66957a8187dShastings #define MTW_DROP_NOT_MYBSS (1 << 3) 67057a8187dShastings #define MTW_DROP_UC_NOME (1 << 2) 67157a8187dShastings #define MTW_DROP_PHY_ERR (1 << 1) 67257a8187dShastings #define MTW_DROP_CRC_ERR (1 << 0) 67357a8187dShastings 67457a8187dShastings /* possible flags for register AUTO_RSP_CFG 0x1404 */ 67557a8187dShastings #define MTW_CTRL_PWR_BIT (1 << 7) 67657a8187dShastings #define MTW_BAC_ACK_POLICY (1 << 6) 67757a8187dShastings #define MTW_CCK_SHORT_EN (1 << 4) 67857a8187dShastings #define MTW_CTS_40M_REF_EN (1 << 3) 67957a8187dShastings #define MTW_CTS_40M_MODE_EN (1 << 2) 68057a8187dShastings #define MTW_BAC_ACKPOLICY_EN (1 << 1) 68157a8187dShastings #define MTW_AUTO_RSP_EN (1 << 0) 68257a8187dShastings 68357a8187dShastings /* possible flags for register SIFS_COST_CFG */ 68457a8187dShastings #define RT2860_OFDM_SIFS_COST_SHIFT 8 68557a8187dShastings #define RT2860_CCK_SIFS_COST_SHIFT 0 68657a8187dShastings 68757a8187dShastings /* possible flags for register TXOP_HLDR_ET 0x1608 */ 68857a8187dShastings #define MTW_TXOP_ETM1_EN (1 << 25) 68957a8187dShastings #define MTW_TXOP_ETM0_EN (1 << 24) 69057a8187dShastings #define MTW_TXOP_ETM_THRES_SHIFT 16 69157a8187dShastings #define MTW_TXOP_ETO_EN (1 << 8) 69257a8187dShastings #define MTW_TXOP_ETO_THRES_SHIFT 1 69357a8187dShastings #define MTW_PER_RX_RST_EN (1 << 0) 69457a8187dShastings 69557a8187dShastings /* possible flags for register TX_STAT_FIFO 0x1718 */ 69657a8187dShastings #define MTW_TXQ_MCS_SHIFT 16 69757a8187dShastings #define MTW_TXQ_WCID_SHIFT 8 69857a8187dShastings #define MTW_TXQ_ACKREQ (1 << 7) 69957a8187dShastings #define MTW_TXQ_AGG (1 << 6) 70057a8187dShastings #define MTW_TXQ_OK (1 << 5) 70157a8187dShastings #define MTW_TXQ_PID_SHIFT 1 70257a8187dShastings #define MTW_TXQ_VLD (1 << 0) 70357a8187dShastings 70457a8187dShastings /* possible flags for register TX_STAT_FIFO_EXT 0x1798 */ 70557a8187dShastings #define MTW_TXQ_PKTID_SHIFT 8 70657a8187dShastings #define MTW_TXQ_RETRY_SHIFT 0 70757a8187dShastings 70857a8187dShastings /* possible flags for register WCID_ATTR 0xa800 */ 70957a8187dShastings #define MTW_MODE_NOSEC 0 71057a8187dShastings #define MTW_MODE_WEP40 1 71157a8187dShastings #define MTW_MODE_WEP104 2 71257a8187dShastings #define MTW_MODE_TKIP 3 71357a8187dShastings #define MTW_MODE_AES_CCMP 4 71457a8187dShastings #define MTW_MODE_CKIP40 5 71557a8187dShastings #define MTW_MODE_CKIP104 6 71657a8187dShastings #define MTW_MODE_CKIP128 7 71757a8187dShastings #define MTW_RX_PKEY_EN (1 << 0) 71857a8187dShastings 71957a8187dShastings /* possible flags for MT7601 BBP register 47 */ 72057a8187dShastings #define MT7601_R47_MASK 0x07 72157a8187dShastings #define MT7601_R47_TSSI (0 << 0) 72257a8187dShastings #define MT7601_R47_PKT (1 << 0) 72357a8187dShastings #define MT7601_R47_TXRATE (1 << 1) 72457a8187dShastings #define MT7601_R47_TEMP (1 << 2) 72557a8187dShastings 72657a8187dShastings #define MTW_RXQ_WLAN 0 72757a8187dShastings #define MTW_RXQ_MCU 1 72857a8187dShastings #define MTW_TXQ_MCU 5 72957a8187dShastings 730*c06983aeShastings enum mtw_phy_mode { 731*c06983aeShastings MTW_PHY_CCK, 732*c06983aeShastings MTW_PHY_OFDM, 733*c06983aeShastings MTW_PHY_HT, 734*c06983aeShastings MTW_PHY_HT_GF, 735*c06983aeShastings MTW_PHY_VHT, 736*c06983aeShastings }; 737*c06983aeShastings 73857a8187dShastings /* RT2860 TX descriptor */ 73957a8187dShastings struct rt2860_txd { 74057a8187dShastings uint32_t sdp0; /* Segment Data Pointer 0 */ 74157a8187dShastings uint16_t sdl1; /* Segment Data Length 1 */ 74257a8187dShastings #define RT2860_TX_BURST (1 << 15) 74357a8187dShastings #define RT2860_TX_LS1 (1 << 14) /* SDP1 is the last segment */ 74457a8187dShastings 74557a8187dShastings uint16_t sdl0; /* Segment Data Length 0 */ 74657a8187dShastings #define RT2860_TX_DDONE (1 << 15) 74757a8187dShastings #define RT2860_TX_LS0 (1 << 14) /* SDP0 is the last segment */ 74857a8187dShastings 74957a8187dShastings uint32_t sdp1; /* Segment Data Pointer 1 */ 75057a8187dShastings uint8_t reserved[3]; 75157a8187dShastings uint8_t flags; 75257a8187dShastings #define RT2860_TX_QSEL_SHIFT 1 75357a8187dShastings #define RT2860_TX_QSEL_MGMT (0 << 1) 75457a8187dShastings #define RT2860_TX_QSEL_HCCA (1 << 1) 75557a8187dShastings #define RT2860_TX_QSEL_EDCA (2 << 1) 75657a8187dShastings #define RT2860_TX_WIV (1 << 0) 75757a8187dShastings } __packed; 75857a8187dShastings 75957a8187dShastings /* TX descriptor */ 76057a8187dShastings struct mtw_txd { 76157a8187dShastings uint16_t len; 76257a8187dShastings uint16_t flags; 76357a8187dShastings #define MTW_TXD_CMD (1 << 14) 76457a8187dShastings #define MTW_TXD_DATA (0 << 14) 76557a8187dShastings #define MTW_TXD_MCU (2 << 11) 76657a8187dShastings #define MTW_TXD_WLAN (0 << 11) 76757a8187dShastings #define MTW_TXD_QSEL_EDCA (2 << 9) 76857a8187dShastings #define MTW_TXD_QSEL_HCCA (1 << 9) 76957a8187dShastings #define MTW_TXD_QSEL_MGMT (0 << 9) 77057a8187dShastings #define MTW_TXD_WIV (1 << 8) 77157a8187dShastings #define MTW_TXD_CMD_SHIFT 4 77257a8187dShastings #define MTW_TXD_80211 (1 << 3) 77357a8187dShastings } __packed; 77457a8187dShastings 77557a8187dShastings /* TX Wireless Information */ 77657a8187dShastings struct mtw_txwi { 77757a8187dShastings uint8_t flags; 77857a8187dShastings #define MTW_TX_MPDU_DSITY_SHIFT 5 77957a8187dShastings #define MTW_TX_AMPDU (1 << 4) 78057a8187dShastings #define MTW_TX_TS (1 << 3) 78157a8187dShastings #define MTW_TX_CFACK (1 << 2) 78257a8187dShastings #define MTW_TX_MMPS (1 << 1) 78357a8187dShastings #define MTW_TX_FRAG (1 << 0) 78457a8187dShastings 78557a8187dShastings uint8_t txop; 78657a8187dShastings #define MTW_TX_TXOP_HT 0 78757a8187dShastings #define MTW_TX_TXOP_PIFS 1 78857a8187dShastings #define MTW_TX_TXOP_SIFS 2 78957a8187dShastings #define MTW_TX_TXOP_BACKOFF 3 79057a8187dShastings 79157a8187dShastings uint16_t phy; 792*c06983aeShastings #define MT7650_PHY_MODE 0xe000 793*c06983aeShastings #define MT7601_PHY_MODE 0xc000 794*c06983aeShastings #define MT7601_PHY_SHIFT 14 795*c06983aeShastings #define MT7650_PHY_SHIFT 13 796*c06983aeShastings #define MT7650_PHY_SGI (1 << 9) 797*c06983aeShastings #define MT7601_PHY_SGI (1 << 8) 79857a8187dShastings #define MTW_PHY_BW20 (0 << 7) 79957a8187dShastings #define MTW_PHY_BW40 (1 << 7) 80057a8187dShastings #define MTW_PHY_BW80 (2 << 7) 80157a8187dShastings #define MTW_PHY_BW160 (3 << 7) 80257a8187dShastings #define MTW_PHY_LDPC (1 << 6) 80357a8187dShastings #define MTW_PHY_MCS 0x3f 80457a8187dShastings #define MTW_PHY_SHPRE (1 << 3) 80557a8187dShastings 80657a8187dShastings uint8_t xflags; 80757a8187dShastings #define MTW_TX_BAWINSIZE_SHIFT 2 80857a8187dShastings #define MTW_TX_NSEQ (1 << 1) 80957a8187dShastings #define MTW_TX_ACK (1 << 0) 81057a8187dShastings 81157a8187dShastings uint8_t wcid; /* Wireless Client ID */ 81257a8187dShastings uint16_t len; 81357a8187dShastings #define MTW_TX_PID_SHIFT 12 81457a8187dShastings 81557a8187dShastings uint32_t iv; 81657a8187dShastings uint32_t eiv; 81757a8187dShastings uint32_t reserved1; 81857a8187dShastings } __packed; 81957a8187dShastings 82057a8187dShastings /* RT2860 RX descriptor */ 82157a8187dShastings struct rt2860_rxd { 82257a8187dShastings uint32_t sdp0; 82357a8187dShastings uint16_t sdl1; /* unused */ 82457a8187dShastings uint16_t sdl0; 82557a8187dShastings #define MTW_RX_DDONE (1 << 15) 82657a8187dShastings #define MTW_RX_LS0 (1 << 14) 82757a8187dShastings 82857a8187dShastings uint32_t sdp1; /* unused */ 82957a8187dShastings uint32_t flags; 83057a8187dShastings #define MTW_RX_DEC (1 << 16) 83157a8187dShastings #define MTW_RX_AMPDU (1 << 15) 83257a8187dShastings #define MTW_RX_L2PAD (1 << 14) 83357a8187dShastings #define MTW_RX_RSSI (1 << 13) 83457a8187dShastings #define MTW_RX_HTC (1 << 12) 83557a8187dShastings #define MTW_RX_AMSDU (1 << 11) 83657a8187dShastings #define MTW_RX_MICERR (1 << 10) 83757a8187dShastings #define MTW_RX_ICVERR (1 << 9) 83857a8187dShastings #define MTW_RX_CRCERR (1 << 8) 83957a8187dShastings #define MTW_RX_MYBSS (1 << 7) 84057a8187dShastings #define MTW_RX_BC (1 << 6) 84157a8187dShastings #define MTW_RX_MC (1 << 5) 84257a8187dShastings #define MTW_RX_UC2ME (1 << 4) 84357a8187dShastings #define MTW_RX_FRAG (1 << 3) 84457a8187dShastings #define MTW_RX_NULL (1 << 2) 84557a8187dShastings #define MTW_RX_DATA (1 << 1) 84657a8187dShastings #define MTW_RX_BA (1 << 0) 84757a8187dShastings } __packed; 84857a8187dShastings 84957a8187dShastings /* RX descriptor */ 85057a8187dShastings struct mtw_rxd { 85157a8187dShastings uint16_t len; 85257a8187dShastings #define MTW_RXD_SELF_GEN (1 << 15) 85357a8187dShastings #define MTW_RXD_LEN 0x3fff 85457a8187dShastings 85557a8187dShastings uint16_t flags; 85657a8187dShastings } __packed; 85757a8187dShastings 85857a8187dShastings /* RX Wireless Information */ 85957a8187dShastings struct mtw_rxwi { 86057a8187dShastings uint32_t flags; 86157a8187dShastings uint8_t wcid; 86257a8187dShastings uint8_t keyidx; 86357a8187dShastings #define MTW_RX_UDF_SHIFT 5 86457a8187dShastings #define MTW_RX_BSS_IDX_SHIFT 2 86557a8187dShastings 86657a8187dShastings uint16_t len; 86757a8187dShastings #define MTW_RX_TID_SHIFT 12 86857a8187dShastings 86957a8187dShastings uint16_t seq; 87057a8187dShastings uint16_t phy; 87157a8187dShastings uint8_t rssi[4]; 87257a8187dShastings uint32_t reserved1; 87357a8187dShastings uint32_t reserved2; 87457a8187dShastings uint32_t reserved3; 87557a8187dShastings } __packed __aligned(4); 87657a8187dShastings 87757a8187dShastings /* MCU Command */ 87857a8187dShastings struct mtw_mcu_cmd_8 { 87957a8187dShastings uint32_t func; 88057a8187dShastings uint32_t val; 88157a8187dShastings } __packed __aligned(4); 88257a8187dShastings 88357a8187dShastings struct mtw_mcu_cmd_16 { 88457a8187dShastings uint32_t r1; 88557a8187dShastings uint32_t r2; 88657a8187dShastings uint32_t r3; 88757a8187dShastings uint32_t r4; 88857a8187dShastings } __packed __aligned(4); 88957a8187dShastings 89057a8187dShastings #define MTW_DMA_PAD 4 89157a8187dShastings 89257a8187dShastings /* first DMA segment contains TXWI + 802.11 header + 32-bit padding */ 89357a8187dShastings #define MTW_TXWI_DMASZ \ 89457a8187dShastings (sizeof (struct mtw_txwi) + \ 89557a8187dShastings sizeof (struct ieee80211_htframe) + \ 89657a8187dShastings sizeof (uint16_t)) 89757a8187dShastings 89857a8187dShastings #define MT7601_RF_7601 0x7601 /* 1T1R */ 89957a8187dShastings #define MT7610_RF_7610 0x7610 /* 1T1R */ 90057a8187dShastings #define MT7612_RF_7612 0x7612 /* 2T2R */ 90157a8187dShastings 90257a8187dShastings #define MTW_CONFIG_NO 1 90357a8187dShastings 90457a8187dShastings /* USB vendor request */ 90557a8187dShastings #define MTW_RESET 0x1 90657a8187dShastings #define MTW_WRITE_2 0x2 90757a8187dShastings #define MTW_WRITE_REGION_1 0x6 90857a8187dShastings #define MTW_READ_REGION_1 0x7 90957a8187dShastings #define MTW_EEPROM_READ 0x9 91057a8187dShastings #define MTW_WRITE_CFG 0x46 91157a8187dShastings #define MTW_READ_CFG 0x47 91257a8187dShastings 91357a8187dShastings /* eFUSE ROM */ 91457a8187dShastings #define MTW_EEPROM_CHIPID 0x00 91557a8187dShastings #define MTW_EEPROM_VERSION 0x01 91657a8187dShastings #define MTW_EEPROM_MAC01 0x02 91757a8187dShastings #define MTW_EEPROM_MAC23 0x03 91857a8187dShastings #define MTW_EEPROM_MAC45 0x04 91957a8187dShastings #define MTW_EEPROM_ANTENNA 0x1a 92057a8187dShastings #define MTW_EEPROM_CONFIG 0x1b 92157a8187dShastings #define MTW_EEPROM_COUNTRY 0x1c 92257a8187dShastings #define MTW_EEPROM_FREQ_OFFSET 0x1d 92357a8187dShastings #define MTW_EEPROM_LED1 0x1e 92457a8187dShastings #define MTW_EEPROM_LED2 0x1f 92557a8187dShastings #define MTW_EEPROM_LED3 0x20 92657a8187dShastings #define MTW_EEPROM_LNA 0x22 92757a8187dShastings #define MTW_EEPROM_RSSI1_2GHZ 0x23 92857a8187dShastings #define MTW_EEPROM_RSSI2_2GHZ 0x24 92957a8187dShastings #define MTW_EEPROM_RSSI1_5GHZ 0x25 93057a8187dShastings #define MTW_EEPROM_RSSI2_5GHZ 0x26 93157a8187dShastings #define MTW_EEPROM_DELTAPWR 0x28 93257a8187dShastings #define MTW_EEPROM_PWR2GHZ_BASE1 0x29 93357a8187dShastings #define MTW_EEPROM_PWR2GHZ_BASE2 0x30 93457a8187dShastings #define MTW_EEPROM_TSSI1_2GHZ 0x37 93557a8187dShastings #define MTW_EEPROM_TSSI2_2GHZ 0x38 93657a8187dShastings #define MTW_EEPROM_TSSI3_2GHZ 0x39 93757a8187dShastings #define MTW_EEPROM_TSSI4_2GHZ 0x3a 93857a8187dShastings #define MTW_EEPROM_TSSI5_2GHZ 0x3b 93957a8187dShastings #define MTW_EEPROM_PWR5GHZ_BASE1 0x3c 94057a8187dShastings #define MTW_NIC_CONF2 0x42 94157a8187dShastings #define MTW_EEPROM_PWR5GHZ_BASE2 0x53 94257a8187dShastings #define MTW_TXPWR_EXT_PA_5G 0x54 94357a8187dShastings #define MTW_TXPWR_START_2G_0 0x56 94457a8187dShastings #define MTW_TXPWR_START_2G_1 0x5c 94557a8187dShastings #define MTW_TXPWR_START_5G_0 0x62 94657a8187dShastings #define RT2860_EEPROM_TSSI1_5GHZ 0x6a 94757a8187dShastings #define RT2860_EEPROM_TSSI2_5GHZ 0x6b 94857a8187dShastings #define RT2860_EEPROM_TSSI3_5GHZ 0x6c 94957a8187dShastings #define RT2860_EEPROM_TSSI4_5GHZ 0x6d 95057a8187dShastings #define RT2860_EEPROM_TSSI5_5GHZ 0x6e 95157a8187dShastings #define MTW_TX_TSSI_SLOPE 0x6e 95257a8187dShastings #define MTW_EEPROM_RPWR 0x6f 95357a8187dShastings 95457a8187dShastings #define MTW_RIDX_CCK1 0 95557a8187dShastings #define MTW_RIDX_CCK11 3 95657a8187dShastings #define MTW_RIDX_OFDM6 4 95757a8187dShastings #define MTW_RIDX_MAX 11 95857a8187dShastings static const struct rt2860_rate { 95957a8187dShastings uint8_t rate; 96057a8187dShastings uint8_t mcs; 96157a8187dShastings enum ieee80211_phytype phy; 96257a8187dShastings uint8_t ctl_ridx; 96357a8187dShastings uint16_t sp_ack_dur; 96457a8187dShastings uint16_t lp_ack_dur; 96557a8187dShastings } rt2860_rates[] = { 96657a8187dShastings { 2, 0, IEEE80211_T_DS, 0, 314, 314 }, 96757a8187dShastings { 4, 1, IEEE80211_T_DS, 1, 258, 162 }, 96857a8187dShastings { 11, 2, IEEE80211_T_DS, 2, 223, 127 }, 96957a8187dShastings { 22, 3, IEEE80211_T_DS, 3, 213, 117 }, 97057a8187dShastings { 12, 0, IEEE80211_T_OFDM, 4, 60, 60 }, 97157a8187dShastings { 18, 1, IEEE80211_T_OFDM, 4, 52, 52 }, 97257a8187dShastings { 24, 2, IEEE80211_T_OFDM, 6, 48, 48 }, 97357a8187dShastings { 36, 3, IEEE80211_T_OFDM, 6, 44, 44 }, 97457a8187dShastings { 48, 4, IEEE80211_T_OFDM, 8, 44, 44 }, 97557a8187dShastings { 72, 5, IEEE80211_T_OFDM, 8, 40, 40 }, 97657a8187dShastings { 96, 6, IEEE80211_T_OFDM, 8, 40, 40 }, 97757a8187dShastings { 108, 7, IEEE80211_T_OFDM, 8, 40, 40 } 97857a8187dShastings }; 97957a8187dShastings 98057a8187dShastings #define MT7601_RF_CHAN \ 98157a8187dShastings { 1, 0x99, 0x99, 0x09, 0x50 }, \ 98257a8187dShastings { 2, 0x46, 0x44, 0x0a, 0x50 }, \ 98357a8187dShastings { 3, 0xec, 0xee, 0x0a, 0x50 }, \ 98457a8187dShastings { 4, 0x99, 0x99, 0x0b, 0x50 }, \ 98557a8187dShastings { 5, 0x46, 0x44, 0x08, 0x51 }, \ 98657a8187dShastings { 6, 0xec, 0xee, 0x08, 0x51 }, \ 98757a8187dShastings { 7, 0x99, 0x99, 0x09, 0x51 }, \ 98857a8187dShastings { 8, 0x46, 0x44, 0x0a, 0x51 }, \ 98957a8187dShastings { 9, 0xec, 0xee, 0x0a, 0x51 }, \ 99057a8187dShastings { 10, 0x99, 0x99, 0x0b, 0x51 }, \ 99157a8187dShastings { 11, 0x46, 0x44, 0x08, 0x52 }, \ 99257a8187dShastings { 12, 0xec, 0xee, 0x08, 0x52 }, \ 99357a8187dShastings { 13, 0x99, 0x99, 0x09, 0x52 }, \ 99457a8187dShastings { 14, 0x33, 0x33, 0x0b, 0x52 } 99557a8187dShastings 99657a8187dShastings /* 99757a8187dShastings * Default values for MAC registers. 99857a8187dShastings */ 99957a8187dShastings #define MT7601_DEF_MAC \ 100057a8187dShastings { MTW_BCN_OFFSET0, 0x18100800 }, \ 100157a8187dShastings { MTW_BCN_OFFSET1, 0x38302820 }, \ 100257a8187dShastings { MTW_BCN_OFFSET2, 0x58504840 }, \ 100357a8187dShastings { MTW_BCN_OFFSET3, 0x78706860 }, \ 100457a8187dShastings { MTW_MAC_SYS_CTRL, 0x0000000c }, \ 100557a8187dShastings { MTW_MAX_LEN_CFG, 0x000a3fff }, \ 100657a8187dShastings { MTW_AMPDU_MAX_LEN_20M1S, 0x77777777 }, \ 100757a8187dShastings { MTW_AMPDU_MAX_LEN_20M2S, 0x77777777 }, \ 100857a8187dShastings { MTW_AMPDU_MAX_LEN_40M1S, 0x77777777 }, \ 100957a8187dShastings { MTW_AMPDU_MAX_LEN_40M2S, 0x77777777 }, \ 101057a8187dShastings { MTW_XIFS_TIME_CFG, 0x33a41010 }, \ 101157a8187dShastings { MTW_BKOFF_SLOT_CFG, 0x00000209 }, \ 101257a8187dShastings { MTW_TBTT_SYNC_CFG, 0x00422010 }, \ 101357a8187dShastings { MTW_INT_TIMER_CFG, 0x00000000 }, \ 101457a8187dShastings { MTW_PWR_PIN_CFG, 0x00000000 }, \ 101557a8187dShastings { MTW_AUTO_WAKEUP_CFG, 0x00000014 }, \ 101657a8187dShastings { MTW_EDCA_AC_CFG(0), 0x000a4360 }, \ 101757a8187dShastings { MTW_EDCA_AC_CFG(1), 0x000a4700 }, \ 101857a8187dShastings { MTW_EDCA_AC_CFG(2), 0x00043338 }, \ 101957a8187dShastings { MTW_EDCA_AC_CFG(3), 0x0003222f }, \ 102057a8187dShastings { MTW_TX_PIN_CFG, 0x33150f0f }, \ 102157a8187dShastings { MTW_TX_BAND_CFG, 0x00000005 }, \ 102257a8187dShastings { MTW_TX_SW_CFG0, 0x00000402 }, \ 102357a8187dShastings { MTW_TX_SW_CFG1, 0x00000000 }, \ 102457a8187dShastings { MTW_TX_SW_CFG2, 0x00000000 }, \ 102557a8187dShastings { MTW_TXOP_CTRL_CFG, 0x0000583f }, \ 102657a8187dShastings { MTW_TX_RTS_CFG, 0x01100020 }, \ 102757a8187dShastings { MTW_TX_TIMEOUT_CFG, 0x000a2090 }, \ 102857a8187dShastings { MTW_TX_RETRY_CFG, 0x47d01f0f }, \ 102957a8187dShastings { MTW_TX_LINK_CFG, 0x007f1820 }, \ 103057a8187dShastings { MTW_HT_FBK_CFG1, 0xedcba980 }, \ 103157a8187dShastings { MTW_CCK_PROT_CFG, 0x07f40000 }, \ 103257a8187dShastings { MTW_OFDM_PROT_CFG, 0x07f60000 }, \ 103357a8187dShastings { MTW_MM20_PROT_CFG, 0x01750003 }, \ 103457a8187dShastings { MTW_MM40_PROT_CFG, 0x03f50003 }, \ 103557a8187dShastings { MTW_GF20_PROT_CFG, 0x01750003 }, \ 103657a8187dShastings { MTW_GF40_PROT_CFG, 0x03f50003 }, \ 103757a8187dShastings { MTW_EXP_ACK_TIME, 0x002400ca }, \ 103857a8187dShastings { MTW_TX_PWR_CFG5, 0x00000000 }, \ 103957a8187dShastings { MTW_TX_PWR_CFG6, 0x01010101 }, \ 104057a8187dShastings { MTW_TX0_RF_GAIN_CORR, 0x003b0005 }, \ 104157a8187dShastings { MTW_TX1_RF_GAIN_CORR, 0x00000000 }, \ 104257a8187dShastings { MTW_TX0_RF_GAIN_ATTEN, 0x00006969 }, \ 104357a8187dShastings { MTW_TX_ALC_CFG3, 0x6c6c6c6c }, \ 104457a8187dShastings { MTW_TX_ALC_CFG0, 0x2f2f0005 }, \ 104557a8187dShastings { MTW_TX_ALC_CFG4, 0x00000400 }, \ 104657a8187dShastings { MTW_TX_ALC_VGA3, 0x00060006 }, \ 104757a8187dShastings { MTW_RX_FILTR_CFG, 0x00015f97 }, \ 104857a8187dShastings { MTW_AUTO_RSP_CFG, 0x00000003 }, \ 104957a8187dShastings { MTW_LEGACY_BASIC_RATE, 0x0000015f }, \ 105057a8187dShastings { MTW_HT_BASIC_RATE, 0x00008003 }, \ 105157a8187dShastings { MTW_RX_MAX_PCNT, 0x0000009f }, \ 105257a8187dShastings { MTW_WPDMA_GLO_CFG, 0x00000030 }, \ 105357a8187dShastings { MTW_WMM_AIFSN_CFG, 0x00002273 }, \ 105457a8187dShastings { MTW_WMM_CWMIN_CFG, 0x00002344 }, \ 105557a8187dShastings { MTW_WMM_CWMAX_CFG, 0x000034aa }, \ 105657a8187dShastings { MTW_TSO_CTRL, 0x00000000 }, \ 105757a8187dShastings { MTW_SYS_CTRL, 0x00080c00 }, \ 105857a8187dShastings { MTW_FCE_PSE_CTRL, 0x00000001 }, \ 105957a8187dShastings { MTW_AUX_CLK_CFG, 0x00000000 }, \ 106057a8187dShastings { MTW_BBP_PA_MODE_CFG0, 0x010055ff }, \ 106157a8187dShastings { MTW_BBP_PA_MODE_CFG1, 0x00550055 }, \ 106257a8187dShastings { MTW_RF_PA_MODE_CFG0, 0x010055ff }, \ 106357a8187dShastings { MTW_RF_PA_MODE_CFG1, 0x00550055 }, \ 106457a8187dShastings { 0x0a38, 0x00000000 }, \ 106557a8187dShastings { MTW_BBP_CSR, 0x00000000 }, \ 106657a8187dShastings { MTW_PBF_CFG, 0x7f723c1f } 106757a8187dShastings 106857a8187dShastings /* 106957a8187dShastings * Default values for Baseband registers 107057a8187dShastings */ 107157a8187dShastings #define MT7601_DEF_BBP \ 107257a8187dShastings { 1, 0x04 }, \ 107357a8187dShastings { 4, 0x40 }, \ 107457a8187dShastings { 20, 0x06 }, \ 107557a8187dShastings { 31, 0x08 }, \ 107657a8187dShastings { 178, 0xff }, \ 107757a8187dShastings { 66, 0x14 }, \ 107857a8187dShastings { 68, 0x8b }, \ 107957a8187dShastings { 69, 0x12 }, \ 108057a8187dShastings { 70, 0x09 }, \ 108157a8187dShastings { 73, 0x11 }, \ 108257a8187dShastings { 75, 0x60 }, \ 108357a8187dShastings { 76, 0x44 }, \ 108457a8187dShastings { 84, 0x9a }, \ 108557a8187dShastings { 86, 0x38 }, \ 108657a8187dShastings { 91, 0x07 }, \ 108757a8187dShastings { 92, 0x02 }, \ 108857a8187dShastings { 99, 0x50 }, \ 108957a8187dShastings { 101, 0x00 }, \ 109057a8187dShastings { 103, 0xc0 }, \ 109157a8187dShastings { 104, 0x92 }, \ 109257a8187dShastings { 105, 0x3c }, \ 109357a8187dShastings { 106, 0x03 }, \ 109457a8187dShastings { 128, 0x12 }, \ 109557a8187dShastings { 142, 0x04 }, \ 109657a8187dShastings { 143, 0x37 }, \ 109757a8187dShastings { 142, 0x03 }, \ 109857a8187dShastings { 143, 0x99 }, \ 109957a8187dShastings { 160, 0xeb }, \ 110057a8187dShastings { 161, 0xc4 }, \ 110157a8187dShastings { 162, 0x77 }, \ 110257a8187dShastings { 163, 0xf9 }, \ 110357a8187dShastings { 164, 0x88 }, \ 110457a8187dShastings { 165, 0x80 }, \ 110557a8187dShastings { 166, 0xff }, \ 110657a8187dShastings { 167, 0xe4 }, \ 110757a8187dShastings { 195, 0x00 }, \ 110857a8187dShastings { 196, 0x00 }, \ 110957a8187dShastings { 195, 0x01 }, \ 111057a8187dShastings { 196, 0x04 }, \ 111157a8187dShastings { 195, 0x02 }, \ 111257a8187dShastings { 196, 0x20 }, \ 111357a8187dShastings { 195, 0x03 }, \ 111457a8187dShastings { 196, 0x0a }, \ 111557a8187dShastings { 195, 0x06 }, \ 111657a8187dShastings { 196, 0x16 }, \ 111757a8187dShastings { 195, 0x07 }, \ 111857a8187dShastings { 196, 0x05 }, \ 111957a8187dShastings { 195, 0x08 }, \ 112057a8187dShastings { 196, 0x37 }, \ 112157a8187dShastings { 195, 0x0a }, \ 112257a8187dShastings { 196, 0x15 }, \ 112357a8187dShastings { 195, 0x0b }, \ 112457a8187dShastings { 196, 0x17 }, \ 112557a8187dShastings { 195, 0x0c }, \ 112657a8187dShastings { 196, 0x06 }, \ 112757a8187dShastings { 195, 0x0d }, \ 112857a8187dShastings { 196, 0x09 }, \ 112957a8187dShastings { 195, 0x0e }, \ 113057a8187dShastings { 196, 0x05 }, \ 113157a8187dShastings { 195, 0x0f }, \ 113257a8187dShastings { 196, 0x09 }, \ 113357a8187dShastings { 195, 0x10 }, \ 113457a8187dShastings { 196, 0x20 }, \ 113557a8187dShastings { 195, 0x20 }, \ 113657a8187dShastings { 196, 0x17 }, \ 113757a8187dShastings { 195, 0x21 }, \ 113857a8187dShastings { 196, 0x06 }, \ 113957a8187dShastings { 195, 0x22 }, \ 114057a8187dShastings { 196, 0x09 }, \ 114157a8187dShastings { 195, 0x23 }, \ 114257a8187dShastings { 196, 0x17 }, \ 114357a8187dShastings { 195, 0x24 }, \ 114457a8187dShastings { 196, 0x06 }, \ 114557a8187dShastings { 195, 0x25 }, \ 114657a8187dShastings { 196, 0x09 }, \ 114757a8187dShastings { 195, 0x26 }, \ 114857a8187dShastings { 196, 0x17 }, \ 114957a8187dShastings { 195, 0x27 }, \ 115057a8187dShastings { 196, 0x06 }, \ 115157a8187dShastings { 195, 0x28 }, \ 115257a8187dShastings { 196, 0x09 }, \ 115357a8187dShastings { 195, 0x29 }, \ 115457a8187dShastings { 196, 0x05 }, \ 115557a8187dShastings { 195, 0x2a }, \ 115657a8187dShastings { 196, 0x09 }, \ 115757a8187dShastings { 195, 0x80 }, \ 115857a8187dShastings { 196, 0x8b }, \ 115957a8187dShastings { 195, 0x81 }, \ 116057a8187dShastings { 196, 0x12 }, \ 116157a8187dShastings { 195, 0x82 }, \ 116257a8187dShastings { 196, 0x09 }, \ 116357a8187dShastings { 195, 0x83 }, \ 116457a8187dShastings { 196, 0x17 }, \ 116557a8187dShastings { 195, 0x84 }, \ 116657a8187dShastings { 196, 0x11 }, \ 116757a8187dShastings { 195, 0x85 }, \ 116857a8187dShastings { 196, 0x00 }, \ 116957a8187dShastings { 195, 0x86 }, \ 117057a8187dShastings { 196, 0x00 }, \ 117157a8187dShastings { 195, 0x87 }, \ 117257a8187dShastings { 196, 0x18 }, \ 117357a8187dShastings { 195, 0x88 }, \ 117457a8187dShastings { 196, 0x60 }, \ 117557a8187dShastings { 195, 0x89 }, \ 117657a8187dShastings { 196, 0x44 }, \ 117757a8187dShastings { 195, 0x8a }, \ 117857a8187dShastings { 196, 0x8b }, \ 117957a8187dShastings { 195, 0x8b }, \ 118057a8187dShastings { 196, 0x8b }, \ 118157a8187dShastings { 195, 0x8c }, \ 118257a8187dShastings { 196, 0x8b }, \ 118357a8187dShastings { 195, 0x8d }, \ 118457a8187dShastings { 196, 0x8b }, \ 118557a8187dShastings { 195, 0x8e }, \ 118657a8187dShastings { 196, 0x09 }, \ 118757a8187dShastings { 195, 0x8f }, \ 118857a8187dShastings { 196, 0x09 }, \ 118957a8187dShastings { 195, 0x90 }, \ 119057a8187dShastings { 196, 0x09 }, \ 119157a8187dShastings { 195, 0x91 }, \ 119257a8187dShastings { 196, 0x09 }, \ 119357a8187dShastings { 195, 0x92 }, \ 119457a8187dShastings { 196, 0x11 }, \ 119557a8187dShastings { 195, 0x93 }, \ 119657a8187dShastings { 196, 0x11 }, \ 119757a8187dShastings { 195, 0x94 }, \ 119857a8187dShastings { 196, 0x11 }, \ 119957a8187dShastings { 195, 0x95 }, \ 120057a8187dShastings { 196, 0x11 }, \ 120157a8187dShastings { 47, 0x80 }, \ 120257a8187dShastings { 60, 0x80 }, \ 120357a8187dShastings { 150, 0xd2 }, \ 120457a8187dShastings { 151, 0x32 }, \ 120557a8187dShastings { 152, 0x23 }, \ 120657a8187dShastings { 153, 0x41 }, \ 120757a8187dShastings { 154, 0x00 }, \ 120857a8187dShastings { 155, 0x4f }, \ 120957a8187dShastings { 253, 0x7e }, \ 121057a8187dShastings { 195, 0x30 }, \ 121157a8187dShastings { 196, 0x32 }, \ 121257a8187dShastings { 195, 0x31 }, \ 121357a8187dShastings { 196, 0x23 }, \ 121457a8187dShastings { 195, 0x32 }, \ 121557a8187dShastings { 196, 0x45 }, \ 121657a8187dShastings { 195, 0x35 }, \ 121757a8187dShastings { 196, 0x4a }, \ 121857a8187dShastings { 195, 0x36 }, \ 121957a8187dShastings { 196, 0x5a }, \ 122057a8187dShastings { 195, 0x37 }, \ 122157a8187dShastings { 196, 0x5a } 122257a8187dShastings 122357a8187dShastings /* 122457a8187dShastings * Default values for RF registers 122557a8187dShastings */ 122657a8187dShastings #define MT7601_BANK0_RF \ 122757a8187dShastings { 0, 0x02 }, \ 122857a8187dShastings { 1, 0x01 }, \ 122957a8187dShastings { 2, 0x11 }, \ 123057a8187dShastings { 3, 0xff }, \ 123157a8187dShastings { 4, 0x0a }, \ 123257a8187dShastings { 5, 0x20 }, \ 123357a8187dShastings { 6, 0x00 }, \ 123457a8187dShastings { 7, 0x00 }, \ 123557a8187dShastings { 8, 0x00 }, \ 123657a8187dShastings { 9, 0x00 }, \ 123757a8187dShastings { 10, 0x00 }, \ 123857a8187dShastings { 11, 0x21 }, \ 123957a8187dShastings { 13, 0x00 }, \ 124057a8187dShastings { 14, 0x7c }, \ 124157a8187dShastings { 15, 0x22 }, \ 124257a8187dShastings { 16, 0x80 }, \ 124357a8187dShastings { 17, 0x99 }, \ 124457a8187dShastings { 18, 0x99 }, \ 124557a8187dShastings { 19, 0x09 }, \ 124657a8187dShastings { 20, 0x50 }, \ 124757a8187dShastings { 21, 0xb0 }, \ 124857a8187dShastings { 22, 0x00 }, \ 124957a8187dShastings { 23, 0xc5 }, \ 125057a8187dShastings { 24, 0xfc }, \ 125157a8187dShastings { 25, 0x40 }, \ 125257a8187dShastings { 26, 0x4d }, \ 125357a8187dShastings { 27, 0x02 }, \ 125457a8187dShastings { 28, 0x72 }, \ 125557a8187dShastings { 29, 0x01 }, \ 125657a8187dShastings { 30, 0x00 }, \ 125757a8187dShastings { 31, 0x00 }, \ 125857a8187dShastings { 32, 0x00 }, \ 125957a8187dShastings { 33, 0x00 }, \ 126057a8187dShastings { 34, 0x23 }, \ 126157a8187dShastings { 35, 0x01 }, \ 126257a8187dShastings { 36, 0x00 }, \ 126357a8187dShastings { 37, 0x00 }, \ 126457a8187dShastings { 38, 0x00 }, \ 126557a8187dShastings { 39, 0x20 }, \ 126657a8187dShastings { 40, 0x00 }, \ 126757a8187dShastings { 41, 0xd0 }, \ 126857a8187dShastings { 42, 0x1b }, \ 126957a8187dShastings { 43, 0x02 }, \ 127057a8187dShastings { 44, 0x00 } 127157a8187dShastings 127257a8187dShastings #define MT7601_BANK4_RF \ 127357a8187dShastings { 0, 0x01 }, \ 127457a8187dShastings { 1, 0x00 }, \ 127557a8187dShastings { 2, 0x00 }, \ 127657a8187dShastings { 3, 0x00 }, \ 127757a8187dShastings { 4, 0x00 }, \ 127857a8187dShastings { 5, 0x08 }, \ 127957a8187dShastings { 6, 0x00 }, \ 128057a8187dShastings { 7, 0x5b }, \ 128157a8187dShastings { 8, 0x52 }, \ 128257a8187dShastings { 9, 0xb6 }, \ 128357a8187dShastings { 10, 0x57 }, \ 128457a8187dShastings { 11, 0x33 }, \ 128557a8187dShastings { 12, 0x22 }, \ 128657a8187dShastings { 13, 0x3d }, \ 128757a8187dShastings { 14, 0x3e }, \ 128857a8187dShastings { 15, 0x13 }, \ 128957a8187dShastings { 16, 0x22 }, \ 129057a8187dShastings { 17, 0x23 }, \ 129157a8187dShastings { 18, 0x02 }, \ 129257a8187dShastings { 19, 0xa4 }, \ 129357a8187dShastings { 20, 0x01 }, \ 129457a8187dShastings { 21, 0x12 }, \ 129557a8187dShastings { 22, 0x80 }, \ 129657a8187dShastings { 23, 0xb3 }, \ 129757a8187dShastings { 24, 0x00 }, \ 129857a8187dShastings { 25, 0x00 }, \ 129957a8187dShastings { 26, 0x00 }, \ 130057a8187dShastings { 27, 0x00 }, \ 130157a8187dShastings { 28, 0x18 }, \ 130257a8187dShastings { 29, 0xee }, \ 130357a8187dShastings { 30, 0x6b }, \ 130457a8187dShastings { 31, 0x31 }, \ 130557a8187dShastings { 32, 0x5d }, \ 130657a8187dShastings { 33, 0x00 }, \ 130757a8187dShastings { 34, 0x96 }, \ 130857a8187dShastings { 35, 0x55 }, \ 130957a8187dShastings { 36, 0x08 }, \ 131057a8187dShastings { 37, 0xbb }, \ 131157a8187dShastings { 38, 0xb3 }, \ 131257a8187dShastings { 39, 0xb3 }, \ 131357a8187dShastings { 40, 0x03 }, \ 131457a8187dShastings { 41, 0x00 }, \ 131557a8187dShastings { 42, 0x00 }, \ 131657a8187dShastings { 43, 0xc5 }, \ 131757a8187dShastings { 44, 0xc5 }, \ 131857a8187dShastings { 45, 0xc5 }, \ 131957a8187dShastings { 46, 0x07 }, \ 132057a8187dShastings { 47, 0xa8 }, \ 132157a8187dShastings { 48, 0xef }, \ 132257a8187dShastings { 49, 0x1a }, \ 132357a8187dShastings { 54, 0x07 }, \ 132457a8187dShastings { 55, 0xa7 }, \ 132557a8187dShastings { 56, 0xcc }, \ 132657a8187dShastings { 57, 0x14 }, \ 132757a8187dShastings { 58, 0x07 }, \ 132857a8187dShastings { 59, 0xa8 }, \ 132957a8187dShastings { 60, 0xd7 }, \ 133057a8187dShastings { 61, 0x10 }, \ 133157a8187dShastings { 62, 0x1c }, \ 133257a8187dShastings { 63, 0x00 } 133357a8187dShastings 133457a8187dShastings #define MT7601_BANK5_RF \ 133557a8187dShastings { 0, 0x47 }, \ 133657a8187dShastings { 1, 0x00 }, \ 133757a8187dShastings { 2, 0x00 }, \ 133857a8187dShastings { 3, 0x08 }, \ 133957a8187dShastings { 4, 0x04 }, \ 134057a8187dShastings { 5, 0x20 }, \ 134157a8187dShastings { 6, 0x3a }, \ 134257a8187dShastings { 7, 0x3a }, \ 134357a8187dShastings { 8, 0x00 }, \ 134457a8187dShastings { 9, 0x00 }, \ 134557a8187dShastings { 10, 0x10 }, \ 134657a8187dShastings { 11, 0x10 }, \ 134757a8187dShastings { 12, 0x10 }, \ 134857a8187dShastings { 13, 0x10 }, \ 134957a8187dShastings { 14, 0x10 }, \ 135057a8187dShastings { 15, 0x20 }, \ 135157a8187dShastings { 16, 0x22 }, \ 135257a8187dShastings { 17, 0x7c }, \ 135357a8187dShastings { 18, 0x00 }, \ 135457a8187dShastings { 19, 0x00 }, \ 135557a8187dShastings { 20, 0x00 }, \ 135657a8187dShastings { 21, 0xf1 }, \ 135757a8187dShastings { 22, 0x11 }, \ 135857a8187dShastings { 23, 0x02 }, \ 135957a8187dShastings { 24, 0x41 }, \ 136057a8187dShastings { 25, 0x20 }, \ 136157a8187dShastings { 26, 0x00 }, \ 136257a8187dShastings { 27, 0xd7 }, \ 136357a8187dShastings { 28, 0xa2 }, \ 136457a8187dShastings { 29, 0x20 }, \ 136557a8187dShastings { 30, 0x49 }, \ 136657a8187dShastings { 31, 0x20 }, \ 136757a8187dShastings { 32, 0x04 }, \ 136857a8187dShastings { 33, 0xf1 }, \ 136957a8187dShastings { 34, 0xa1 }, \ 137057a8187dShastings { 35, 0x01 }, \ 137157a8187dShastings { 41, 0x00 }, \ 137257a8187dShastings { 42, 0x00 }, \ 137357a8187dShastings { 43, 0x00 }, \ 137457a8187dShastings { 44, 0x00 }, \ 137557a8187dShastings { 45, 0x00 }, \ 137657a8187dShastings { 46, 0x00 }, \ 137757a8187dShastings { 47, 0x00 }, \ 137857a8187dShastings { 48, 0x00 }, \ 137957a8187dShastings { 49, 0x00 }, \ 138057a8187dShastings { 50, 0x00 }, \ 138157a8187dShastings { 51, 0x00 }, \ 138257a8187dShastings { 52, 0x00 }, \ 138357a8187dShastings { 53, 0x00 }, \ 138457a8187dShastings { 54, 0x00 }, \ 138557a8187dShastings { 55, 0x00 }, \ 138657a8187dShastings { 56, 0x00 }, \ 138757a8187dShastings { 57, 0x00 }, \ 138857a8187dShastings { 58, 0x31 }, \ 138957a8187dShastings { 59, 0x31 }, \ 139057a8187dShastings { 60, 0x0a }, \ 139157a8187dShastings { 61, 0x02 }, \ 139257a8187dShastings { 62, 0x00 }, \ 139357a8187dShastings { 63, 0x00 } 1394