mirror of
https://github.com/chinawrj/rtl8812au
synced 2024-11-09 23:57:10 +00:00
Remove unused mpt_SetRFPath_8812A()
This commit is contained in:
parent
bb31213a73
commit
d20d0744b5
126
hal/hal_mp.c
126
hal/hal_mp.c
@ -936,126 +936,6 @@ mpt_SetSingleTone_8814A(
|
||||
phy_set_bb_reg(pAdapter, rD_TxScale_Jaguar2, bMaskDWord, regIG3); /* 0x1A1C[31:21]*/
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
|
||||
void mpt_SetRFPath_8812A(PADAPTER pAdapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
PMPT_CONTEXT pMptCtx = &pAdapter->mppriv.mpt_ctx;
|
||||
struct mp_priv *pmp = &pAdapter->mppriv;
|
||||
u8 channel = pmp->channel;
|
||||
u8 bandwidth = pmp->bandwidth;
|
||||
u8 eLNA_2g = pHalData->ExternalLNA_2G;
|
||||
u32 ulAntennaTx, ulAntennaRx;
|
||||
|
||||
ulAntennaTx = pHalData->antenna_tx_path;
|
||||
ulAntennaRx = pHalData->AntennaRxPath;
|
||||
|
||||
switch (ulAntennaTx) {
|
||||
case ANTENNA_A:
|
||||
pMptCtx->mpt_rf_path = RF_PATH_A;
|
||||
phy_set_bb_reg(pAdapter, rTxPath_Jaguar, bMaskLWord, 0x1111);
|
||||
if (pHalData->rfe_type == 3 && IS_HARDWARE_TYPE_8812(pAdapter))
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, bMask_AntselPathFollow_Jaguar, 0x0);
|
||||
break;
|
||||
case ANTENNA_B:
|
||||
pMptCtx->mpt_rf_path = RF_PATH_B;
|
||||
phy_set_bb_reg(pAdapter, rTxPath_Jaguar, bMaskLWord, 0x2222);
|
||||
if (pHalData->rfe_type == 3 && IS_HARDWARE_TYPE_8812(pAdapter))
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, bMask_AntselPathFollow_Jaguar, 0x1);
|
||||
break;
|
||||
case ANTENNA_AB:
|
||||
pMptCtx->mpt_rf_path = RF_PATH_AB;
|
||||
phy_set_bb_reg(pAdapter, rTxPath_Jaguar, bMaskLWord, 0x3333);
|
||||
if (pHalData->rfe_type == 3 && IS_HARDWARE_TYPE_8812(pAdapter))
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, bMask_AntselPathFollow_Jaguar, 0x0);
|
||||
break;
|
||||
default:
|
||||
pMptCtx->mpt_rf_path = RF_PATH_AB;
|
||||
RTW_INFO("Unknown Tx antenna.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (ulAntennaRx) {
|
||||
u32 reg0xC50;
|
||||
case ANTENNA_A:
|
||||
phy_set_bb_reg(pAdapter, rRxPath_Jaguar, bMaskByte0, 0x11);
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_B, RF_AC_Jaguar, 0xF0000, 0x1); /*/ RF_B_0x0[19:16] = 1, Standby mode*/
|
||||
phy_set_bb_reg(pAdapter, rCCK_RX_Jaguar, bCCK_RX_Jaguar, 0x0);
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_A, RF_AC_Jaguar, BIT19 | BIT18 | BIT17 | BIT16, 0x3);
|
||||
|
||||
/*/ <20121101, Kordan> To prevent gain table from not switched, asked by Ynlin.*/
|
||||
reg0xC50 = phy_query_bb_reg(pAdapter, rA_IGI_Jaguar, bMaskByte0);
|
||||
phy_set_bb_reg(pAdapter, rA_IGI_Jaguar, bMaskByte0, reg0xC50 + 2);
|
||||
phy_set_bb_reg(pAdapter, rA_IGI_Jaguar, bMaskByte0, reg0xC50);
|
||||
|
||||
/* set PWED_TH for BB Yn user guide R29 */
|
||||
if (IS_HARDWARE_TYPE_8812(pAdapter)) {
|
||||
if (channel <= 14) { /* 2.4G */
|
||||
if (bandwidth == CHANNEL_WIDTH_20
|
||||
&& eLNA_2g == 0) {
|
||||
/* 0x830[3:1]=3'b010 */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x02);
|
||||
} else
|
||||
/* 0x830[3:1]=3'b100 */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x04);
|
||||
} else
|
||||
/* 0x830[3:1]=3'b100 for 5G */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x04);
|
||||
}
|
||||
break;
|
||||
case ANTENNA_B:
|
||||
phy_set_bb_reg(pAdapter, rRxPath_Jaguar, bMaskByte0, 0x22);
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_A, RF_AC_Jaguar, 0xF0000, 0x1);/*/ RF_A_0x0[19:16] = 1, Standby mode */
|
||||
phy_set_bb_reg(pAdapter, rCCK_RX_Jaguar, bCCK_RX_Jaguar, 0x1);
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_B, RF_AC_Jaguar, BIT19 | BIT18 | BIT17 | BIT16, 0x3);
|
||||
|
||||
/*/ <20121101, Kordan> To prevent gain table from not switched, asked by Ynlin.*/
|
||||
reg0xC50 = phy_query_bb_reg(pAdapter, rB_IGI_Jaguar, bMaskByte0);
|
||||
phy_set_bb_reg(pAdapter, rB_IGI_Jaguar, bMaskByte0, reg0xC50 + 2);
|
||||
phy_set_bb_reg(pAdapter, rB_IGI_Jaguar, bMaskByte0, reg0xC50);
|
||||
|
||||
/* set PWED_TH for BB Yn user guide R29 */
|
||||
if (IS_HARDWARE_TYPE_8812(pAdapter)) {
|
||||
if (channel <= 14) {
|
||||
if (bandwidth == CHANNEL_WIDTH_20
|
||||
&& eLNA_2g == 0) {
|
||||
/* 0x830[3:1]=3'b010 */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x02);
|
||||
} else
|
||||
/* 0x830[3:1]=3'b100 */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x04);
|
||||
} else
|
||||
/* 0x830[3:1]=3'b100 for 5G */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x04);
|
||||
}
|
||||
break;
|
||||
case ANTENNA_AB:
|
||||
phy_set_bb_reg(pAdapter, rRxPath_Jaguar, bMaskByte0, 0x33);
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_B, RF_AC_Jaguar, 0xF0000, 0x3); /*/ RF_B_0x0[19:16] = 3, Rx mode*/
|
||||
phy_set_bb_reg(pAdapter, rCCK_RX_Jaguar, bCCK_RX_Jaguar, 0x0);
|
||||
/* set PWED_TH for BB Yn user guide R29 */
|
||||
phy_set_bb_reg(pAdapter, rPwed_TH_Jaguar, BIT1 | BIT2 | BIT3, 0x04);
|
||||
break;
|
||||
default:
|
||||
RTW_INFO("Unknown Rx antenna.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (pHalData->rfe_type == 5 || pHalData->rfe_type == 1) {
|
||||
if (ulAntennaTx == ANTENNA_A || ulAntennaTx == ANTENNA_AB) {
|
||||
/* WiFi */
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, BIT(1) | BIT(0), 0x2);
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, BIT(9) | BIT(8), 0x3);
|
||||
} else {
|
||||
/* BT */
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, BIT(1) | BIT(0), 0x1);
|
||||
phy_set_bb_reg(pAdapter, r_ANTSEL_SW_Jaguar, BIT(9) | BIT(8), 0x3);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8723B
|
||||
@ -1496,12 +1376,6 @@ void hal_mpt_SetAntenna(PADAPTER pAdapter)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
|
||||
if (IS_HARDWARE_TYPE_JAGUAR(pAdapter)) {
|
||||
mpt_SetRFPath_8812A(pAdapter);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723B
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter)) {
|
||||
mpt_SetRFPath_8723B(pAdapter);
|
||||
|
Loading…
Reference in New Issue
Block a user