mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Convert C90 comments to kernel form for hal/*.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
e5113c831c
commit
fe06a8b006
30 changed files with 4334 additions and 6166 deletions
|
@ -75,19 +75,19 @@ static void Hal_disable_dm(PADAPTER padapter)
|
|||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
|
||||
|
||||
//3 1. disable firmware dynamic mechanism
|
||||
// disable Power Training, Rate Adaptive
|
||||
/* 3 1. disable firmware dynamic mechanism */
|
||||
/* disable Power Training, Rate Adaptive */
|
||||
v8 = rtw_read8(padapter, REG_BCN_CTRL);
|
||||
v8 &= ~EN_BCN_FUNCTION;
|
||||
rtw_write8(padapter, REG_BCN_CTRL, v8);
|
||||
|
||||
//3 2. disable driver dynamic mechanism
|
||||
// disable Dynamic Initial Gain
|
||||
// disable High Power
|
||||
// disable Power Tracking
|
||||
/* 3 2. disable driver dynamic mechanism */
|
||||
/* disable Dynamic Initial Gain */
|
||||
/* disable High Power */
|
||||
/* disable Power Tracking */
|
||||
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
|
||||
|
||||
// enable APK, LCK and IQK but disable power tracking
|
||||
/* enable APK, LCK and IQK but disable power tracking */
|
||||
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = false;
|
||||
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, true);
|
||||
}
|
||||
|
@ -111,14 +111,14 @@ static void Hal_disable_dm(PADAPTER padapter)
|
|||
*---------------------------------------------------------------------------*/
|
||||
void Hal_mpt_SwitchRfSetting(PADAPTER pAdapter)
|
||||
{
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
/* HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); */
|
||||
struct mp_priv *pmp = &pAdapter->mppriv;
|
||||
u1Byte ChannelToSw = pmp->channel;
|
||||
ULONG ulRateIdx = pmp->rateidx;
|
||||
ULONG ulbandwidth = pmp->bandwidth;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
// <20120525, Kordan> Dynamic mechanism for APK, asked by Dennis.
|
||||
/* <20120525, Kordan> Dynamic mechanism for APK, asked by Dennis. */
|
||||
pmp->MptCtx.backup0x52_RF_A = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0);
|
||||
pmp->MptCtx.backup0x52_RF_B = (u1Byte)PHY_QueryRFReg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0);
|
||||
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0, 0xD);
|
||||
|
@ -137,38 +137,36 @@ void Hal_MPT_CCKTxPowerAdjust(PADAPTER Adapter, bool bInCH14)
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
|
||||
// get current cck swing value and check 0xa22 & 0xa23 later to match the table.
|
||||
/* get current cck swing value and check 0xa22 & 0xa23 later to match the table. */
|
||||
CurrCCKSwingVal = read_bbreg(Adapter, rCCK0_TxFilter1, bMaskHWord);
|
||||
|
||||
if (!bInCH14)
|
||||
{
|
||||
// Readback the current bb cck swing value and compare with the table to
|
||||
// get the current swing index
|
||||
/* Readback the current bb cck swing value and compare with the table to */
|
||||
/* get the current swing index */
|
||||
for (i = 0; i < CCK_TABLE_SIZE; i++)
|
||||
{
|
||||
if (((CurrCCKSwingVal&0xff) == (u32)CCKSwingTable_Ch1_Ch13[i][0]) &&
|
||||
(((CurrCCKSwingVal&0xff00)>>8) == (u32)CCKSwingTable_Ch1_Ch13[i][1]))
|
||||
{
|
||||
CCKSwingIndex = i;
|
||||
// RT_TRACE(COMP_INIT, DBG_LOUD,("Ch1~13, Current reg0x%x = 0x%lx, CCKSwingIndex=0x%x\n",
|
||||
// (rCCK0_TxFilter1+2), CurrCCKSwingVal, CCKSwingIndex));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Write 0xa22 0xa23
|
||||
/* Write 0xa22 0xa23 */
|
||||
TempVal = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][0] +
|
||||
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][1]<<8) ;
|
||||
|
||||
|
||||
//Write 0xa24 ~ 0xa27
|
||||
/* Write 0xa24 ~ 0xa27 */
|
||||
TempVal2 = 0;
|
||||
TempVal2 = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][2] +
|
||||
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][3]<<8) +
|
||||
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][4]<<16 )+
|
||||
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][5]<<24);
|
||||
|
||||
//Write 0xa28 0xa29
|
||||
/* Write 0xa28 0xa29 */
|
||||
TempVal3 = 0;
|
||||
TempVal3 = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][6] +
|
||||
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][7]<<8) ;
|
||||
|
@ -181,24 +179,22 @@ void Hal_MPT_CCKTxPowerAdjust(PADAPTER Adapter, bool bInCH14)
|
|||
(((CurrCCKSwingVal&0xff00)>>8) == (u32)CCKSwingTable_Ch14[i][1]))
|
||||
{
|
||||
CCKSwingIndex = i;
|
||||
// RT_TRACE(COMP_INIT, DBG_LOUD,("Ch14, Current reg0x%x = 0x%lx, CCKSwingIndex=0x%x\n",
|
||||
// (rCCK0_TxFilter1+2), CurrCCKSwingVal, CCKSwingIndex));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Write 0xa22 0xa23
|
||||
/* Write 0xa22 0xa23 */
|
||||
TempVal = CCKSwingTable_Ch14[CCKSwingIndex][0] +
|
||||
(CCKSwingTable_Ch14[CCKSwingIndex][1]<<8) ;
|
||||
|
||||
//Write 0xa24 ~ 0xa27
|
||||
/* Write 0xa24 ~ 0xa27 */
|
||||
TempVal2 = 0;
|
||||
TempVal2 = CCKSwingTable_Ch14[CCKSwingIndex][2] +
|
||||
(CCKSwingTable_Ch14[CCKSwingIndex][3]<<8) +
|
||||
(CCKSwingTable_Ch14[CCKSwingIndex][4]<<16 )+
|
||||
(CCKSwingTable_Ch14[CCKSwingIndex][5]<<24);
|
||||
|
||||
//Write 0xa28 0xa29
|
||||
/* Write 0xa28 0xa29 */
|
||||
TempVal3 = 0;
|
||||
TempVal3 = CCKSwingTable_Ch14[CCKSwingIndex][6] +
|
||||
(CCKSwingTable_Ch14[CCKSwingIndex][7]<<8) ;
|
||||
|
@ -213,7 +209,7 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
{
|
||||
s32 TempCCk;
|
||||
u8 CCK_index, CCK_index_old;
|
||||
u8 Action = 0; //0: no action, 1: even->odd, 2:odd->even
|
||||
u8 Action = 0; /* 0: no action, 1: even->odd, 2:odd->even */
|
||||
u8 TimeOut = 100;
|
||||
s32 i = 0;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
@ -225,12 +221,12 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
|
||||
if (!IS_92C_SERIAL(pHalData->VersionID))
|
||||
return;
|
||||
if (beven && !pMptCtx->bMptIndexEven) //odd->even
|
||||
if (beven && !pMptCtx->bMptIndexEven) /* odd->even */
|
||||
{
|
||||
Action = 2;
|
||||
pMptCtx->bMptIndexEven = true;
|
||||
}
|
||||
else if (!beven && pMptCtx->bMptIndexEven) //even->odd
|
||||
else if (!beven && pMptCtx->bMptIndexEven) /* even->odd */
|
||||
{
|
||||
Action = 1;
|
||||
pMptCtx->bMptIndexEven = false;
|
||||
|
@ -238,7 +234,7 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
|
||||
if (Action != 0)
|
||||
{
|
||||
//Query CCK default setting From 0xa24
|
||||
/* Query CCK default setting From 0xa24 */
|
||||
TempCCk = read_bbreg(pAdapter, rCCK0_TxFilter2, bMaskDWord) & bMaskCCK;
|
||||
for (i = 0; i < CCK_TABLE_SIZE; i++)
|
||||
{
|
||||
|
@ -247,8 +243,6 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
if (_rtw_memcmp((void*)&TempCCk, (void*)&CCKSwingTable_Ch14[i][2], 4) == true)
|
||||
{
|
||||
CCK_index_old = (u8) i;
|
||||
// RTPRINT(FINIT, INIT_TxPower,("MPT_CCKTxPowerAdjustbyIndex: Initial reg0x%x = 0x%lx, CCK_index=0x%x, ch 14 %d\n",
|
||||
// rCCK0_TxFilter2, TempCCk, CCK_index_old, pHalData->bCCKinCH14));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +251,6 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
if (_rtw_memcmp((void*)&TempCCk, (void*)&CCKSwingTable_Ch1_Ch13[i][2], 4) == true)
|
||||
{
|
||||
CCK_index_old = (u8) i;
|
||||
// RTPRINT(FINIT, INIT_TxPower,("MPT_CCKTxPowerAdjustbyIndex: Initial reg0x%x = 0x%lx, CCK_index=0x%x, ch14 %d\n",
|
||||
// rCCK0_TxFilter2, TempCCk, CCK_index_old, pHalData->bCCKinCH14));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -269,10 +261,7 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, bool beven)
|
|||
else
|
||||
CCK_index = CCK_index_old + 1;
|
||||
|
||||
// RTPRINT(FINIT, INIT_TxPower,("MPT_CCKTxPowerAdjustbyIndex: new CCK_index=0x%x\n",
|
||||
// CCK_index));
|
||||
|
||||
//Adjust CCK according to gain index
|
||||
/* Adjust CCK according to gain index */
|
||||
if (!pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
|
||||
rtw_write8(pAdapter, 0xa22, CCKSwingTable_Ch1_Ch13[CCK_index][0]);
|
||||
rtw_write8(pAdapter, 0xa23, CCKSwingTable_Ch1_Ch13[CCK_index][1]);
|
||||
|
@ -316,7 +305,7 @@ void Hal_SetChannel(PADAPTER pAdapter)
|
|||
u8 rate = pmp->rateidx;
|
||||
|
||||
|
||||
// set RF channel register
|
||||
/* set RF channel register */
|
||||
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++)
|
||||
{
|
||||
if (IS_HARDWARE_TYPE_8192D(pAdapter))
|
||||
|
@ -356,12 +345,12 @@ void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 *TxPower)
|
|||
u32 tmpval = 0;
|
||||
|
||||
|
||||
// rf-A cck tx power
|
||||
/* rf-A cck tx power */
|
||||
write_bbreg(pAdapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, TxPower[RF_PATH_A]);
|
||||
tmpval = (TxPower[RF_PATH_A]<<16) | (TxPower[RF_PATH_A]<<8) | TxPower[RF_PATH_A];
|
||||
write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
|
||||
// rf-B cck tx power
|
||||
/* rf-B cck tx power */
|
||||
write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, TxPower[RF_PATH_B]);
|
||||
tmpval = (TxPower[RF_PATH_B]<<16) | (TxPower[RF_PATH_B]<<8) | TxPower[RF_PATH_B];
|
||||
write_bbreg(pAdapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval);
|
||||
|
@ -379,7 +368,7 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 *TxPower)
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
|
||||
// HT Tx-rf(A)
|
||||
/* HT Tx-rf(A) */
|
||||
tmpval = TxPower[RF_PATH_A];
|
||||
TxAGC = (tmpval<<24) | (tmpval<<16) | (tmpval<<8) | tmpval;
|
||||
|
||||
|
@ -390,7 +379,7 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 *TxPower)
|
|||
write_bbreg(pAdapter, rTxAGC_A_Mcs11_Mcs08, bMaskDWord, TxAGC);
|
||||
write_bbreg(pAdapter, rTxAGC_A_Mcs15_Mcs12, bMaskDWord, TxAGC);
|
||||
|
||||
// HT Tx-rf(B)
|
||||
/* HT Tx-rf(B) */
|
||||
tmpval = TxPower[RF_PATH_B];
|
||||
TxAGC = (tmpval<<24) | (tmpval<<16) | (tmpval<<8) | tmpval;
|
||||
|
||||
|
@ -432,7 +421,7 @@ void Hal_SetAntennaPathPower(PADAPTER pAdapter)
|
|||
case RF_8256:
|
||||
case RF_6052:
|
||||
Hal_SetCCKTxPower(pAdapter, TxPowerLevel);
|
||||
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) // CCK rate
|
||||
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) /* CCK rate */
|
||||
Hal_MPT_CCKTxPowerAdjustbyIndex(pAdapter, TxPowerLevel[rfPath]%2 == 0);
|
||||
Hal_SetOFDMTxPower(pAdapter, TxPowerLevel);
|
||||
break;
|
||||
|
@ -469,13 +458,13 @@ void Hal_SetTxPower(PADAPTER pAdapter)
|
|||
|
||||
switch (pHalData->rf_chip)
|
||||
{
|
||||
// 2008/09/12 MH Test only !! We enable the TX power tracking for MP!!!!!
|
||||
// We should call normal driver API later!!
|
||||
/* 2008/09/12 MH Test only !! We enable the TX power tracking for MP!!!!! */
|
||||
/* We should call normal driver API later!! */
|
||||
case RF_8225:
|
||||
case RF_8256:
|
||||
case RF_6052:
|
||||
Hal_SetCCKTxPower(pAdapter, TxPowerLevel);
|
||||
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) // CCK rate
|
||||
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) /* CCK rate */
|
||||
Hal_MPT_CCKTxPowerAdjustbyIndex(pAdapter, TxPowerLevel[rfPath]%2 == 0);
|
||||
Hal_SetOFDMTxPower(pAdapter, TxPowerLevel);
|
||||
break;
|
||||
|
@ -483,9 +472,6 @@ void Hal_SetTxPower(PADAPTER pAdapter)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// SetCCKTxPower(pAdapter, TxPower);
|
||||
// SetOFDMTxPower(pAdapter, TxPower);
|
||||
}
|
||||
|
||||
void Hal_SetDataRate(PADAPTER pAdapter)
|
||||
|
@ -509,8 +495,8 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
p_cck_txrx = (R_ANTENNA_SELECT_CCK *)&r_ant_select_cck_val;
|
||||
|
||||
p_ofdm_tx->r_ant_ht1 = 0x1;
|
||||
p_ofdm_tx->r_ant_ht2 = 0x2; // Second TX RF path is A
|
||||
p_ofdm_tx->r_ant_non_ht = 0x3; // 0x1+0x2=0x3
|
||||
p_ofdm_tx->r_ant_ht2 = 0x2; /* Second TX RF path is A */
|
||||
p_ofdm_tx->r_ant_non_ht = 0x3; /* 0x1+0x2=0x3 */
|
||||
|
||||
switch (pAdapter->mppriv.antenna_tx)
|
||||
{
|
||||
|
@ -523,17 +509,15 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
p_cck_txrx->r_ccktx_enable = 0x8;
|
||||
chgTx = 1;
|
||||
|
||||
// From SD3 Willis suggestion !!! Set RF A=TX and B as standby
|
||||
// if (IS_HARDWARE_TYPE_8192S(pAdapter))
|
||||
{
|
||||
/* From SD3 Willis suggestion !!! Set RF A=TX and B as standby */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 2);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 1);
|
||||
r_ofdm_tx_en_val = 0x3;
|
||||
|
||||
// Power save
|
||||
//cosa r_ant_select_ofdm_val = 0x11111111;
|
||||
/* Power save */
|
||||
/* cosa r_ant_select_ofdm_val = 0x11111111; */
|
||||
|
||||
// We need to close RFB by SW control
|
||||
/* We need to close RFB by SW control */
|
||||
if (pHalData->rf_type == RF_2T2R)
|
||||
{
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 0);
|
||||
|
@ -542,7 +526,6 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 1);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ANTENNA_B:
|
||||
|
@ -554,31 +537,26 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
p_cck_txrx->r_ccktx_enable = 0x4;
|
||||
chgTx = 1;
|
||||
|
||||
// From SD3 Willis suggestion !!! Set RF A as standby
|
||||
//if (IS_HARDWARE_TYPE_8192S(pAdapter))
|
||||
{
|
||||
/* From SD3 Willis suggestion !!! Set RF A as standby */
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 1);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 2);
|
||||
// r_ofdm_tx_en_val = 0x3;
|
||||
|
||||
// Power save
|
||||
//cosa r_ant_select_ofdm_val = 0x22222222;
|
||||
/* Power save */
|
||||
/* cosa r_ant_select_ofdm_val = 0x22222222; */
|
||||
|
||||
// 2008/10/31 MH From SD3 Willi's suggestion. We must read RF 1T table.
|
||||
// 2009/01/08 MH From Sd3 Willis. We need to close RFA by SW control
|
||||
/* 2008/10/31 MH From SD3 Willi's suggestion. We must read RF 1T table. */
|
||||
/* 2009/01/08 MH From Sd3 Willis. We need to close RFA by SW control */
|
||||
if (pHalData->rf_type == RF_2T2R || pHalData->rf_type == RF_1T2R)
|
||||
{
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 1);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, BIT10, 0);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT26, 0);
|
||||
// PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT10, 0);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 0);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ANTENNA_AB: // For 8192S
|
||||
case ANTENNA_AB: /* For 8192S */
|
||||
p_ofdm_tx->r_tx_antenna = 0x3;
|
||||
r_ofdm_tx_en_val = 0x3;
|
||||
p_ofdm_tx->r_ant_l = 0x3;
|
||||
|
@ -587,15 +565,13 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
p_cck_txrx->r_ccktx_enable = 0xC;
|
||||
chgTx = 1;
|
||||
|
||||
// From SD3 Willis suggestion !!! Set RF B as standby
|
||||
//if (IS_HARDWARE_TYPE_8192S(pAdapter))
|
||||
{
|
||||
/* From SD3 Willis suggestion !!! Set RF B as standby */
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 2);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 2);
|
||||
|
||||
// Disable Power save
|
||||
//cosa r_ant_select_ofdm_val = 0x3321333;
|
||||
// 2009/01/08 MH From Sd3 Willis. We need to enable RFA/B by SW control
|
||||
/* Disable Power save */
|
||||
/* cosa r_ant_select_ofdm_val = 0x3321333; */
|
||||
/* 2009/01/08 MH From Sd3 Willis. We need to enable RFA/B by SW control */
|
||||
if (pHalData->rf_type == RF_2T2R)
|
||||
{
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 0);
|
||||
|
@ -603,38 +579,36 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 1);
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// r_rx_antenna_ofdm, bit0=A, bit1=B, bit2=C, bit3=D
|
||||
// r_cckrx_enable : CCK default, 0=A, 1=B, 2=C, 3=D
|
||||
// r_cckrx_enable_2 : CCK option, 0=A, 1=B, 2=C, 3=D
|
||||
//
|
||||
/* */
|
||||
/* r_rx_antenna_ofdm, bit0=A, bit1=B, bit2=C, bit3=D */
|
||||
/* r_cckrx_enable : CCK default, 0=A, 1=B, 2=C, 3=D */
|
||||
/* r_cckrx_enable_2 : CCK option, 0=A, 1=B, 2=C, 3=D */
|
||||
/* */
|
||||
switch (pAdapter->mppriv.antenna_rx)
|
||||
{
|
||||
case ANTENNA_A:
|
||||
r_rx_antenna_ofdm = 0x1; // A
|
||||
p_cck_txrx->r_cckrx_enable = 0x0; // default: A
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x0; // option: A
|
||||
r_rx_antenna_ofdm = 0x1; /* A */
|
||||
p_cck_txrx->r_cckrx_enable = 0x0; /* default: A */
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x0; /* option: A */
|
||||
chgRx = 1;
|
||||
break;
|
||||
|
||||
case ANTENNA_B:
|
||||
r_rx_antenna_ofdm = 0x2; // B
|
||||
p_cck_txrx->r_cckrx_enable = 0x1; // default: B
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x1; // option: B
|
||||
r_rx_antenna_ofdm = 0x2; /* B */
|
||||
p_cck_txrx->r_cckrx_enable = 0x1; /* default: B */
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x1; /* option: B */
|
||||
chgRx = 1;
|
||||
break;
|
||||
|
||||
case ANTENNA_AB:
|
||||
r_rx_antenna_ofdm = 0x3; // AB
|
||||
p_cck_txrx->r_cckrx_enable = 0x0; // default:A
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x1; // option:B
|
||||
r_rx_antenna_ofdm = 0x3; /* AB */
|
||||
p_cck_txrx->r_cckrx_enable = 0x0; /* default:A */
|
||||
p_cck_txrx->r_cckrx_enable_2 = 0x1; /* option:B */
|
||||
chgRx = 1;
|
||||
break;
|
||||
|
||||
|
@ -649,12 +623,12 @@ void Hal_SetAntenna(PADAPTER pAdapter)
|
|||
case RF_8225:
|
||||
case RF_8256:
|
||||
case RF_6052:
|
||||
//r_ant_sel_cck_val = r_ant_select_cck_val;
|
||||
PHY_SetBBReg(pAdapter, rFPGA1_TxInfo, 0x7fffffff, r_ant_select_ofdm_val); //OFDM Tx
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_TxInfo, 0x0000000f, r_ofdm_tx_en_val); //OFDM Tx
|
||||
PHY_SetBBReg(pAdapter, rOFDM0_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); //OFDM Rx
|
||||
PHY_SetBBReg(pAdapter, rOFDM1_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); //OFDM Rx
|
||||
PHY_SetBBReg(pAdapter, rCCK0_AFESetting, bMaskByte3, r_ant_select_cck_val);//r_ant_sel_cck_val); //CCK TxRx
|
||||
/* r_ant_sel_cck_val = r_ant_select_cck_val; */
|
||||
PHY_SetBBReg(pAdapter, rFPGA1_TxInfo, 0x7fffffff, r_ant_select_ofdm_val); /* OFDM Tx */
|
||||
PHY_SetBBReg(pAdapter, rFPGA0_TxInfo, 0x0000000f, r_ofdm_tx_en_val); /* OFDM Tx */
|
||||
PHY_SetBBReg(pAdapter, rOFDM0_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); /* OFDM Rx */
|
||||
PHY_SetBBReg(pAdapter, rOFDM1_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); /* OFDM Rx */
|
||||
PHY_SetBBReg(pAdapter, rCCK0_AFESetting, bMaskByte3, r_ant_select_cck_val); /* CCK TxRx */
|
||||
|
||||
break;
|
||||
|
||||
|
@ -696,19 +670,13 @@ void Hal_TriggerRFThermalMeter(PADAPTER pAdapter)
|
|||
{
|
||||
|
||||
_write_rfreg( pAdapter, RF_PATH_A , RF_T_METER_88E , BIT17 |BIT16 , 0x03 );
|
||||
|
||||
// RT_TRACE(_module_mp_,_drv_alert_, ("TriggerRFThermalMeter() finished.\n" ));
|
||||
}
|
||||
|
||||
u8 Hal_ReadRFThermalMeter(PADAPTER pAdapter)
|
||||
{
|
||||
u32 ThermalValue = 0;
|
||||
|
||||
//ThermalValue = _read_rfreg(pAdapter, RF_PATH_A, RF_T_METER, 0x1F); // 0x24: RF Reg[4:0]
|
||||
|
||||
ThermalValue = _read_rfreg(pAdapter, RF_PATH_A, RF_T_METER_88E, 0xfc00);
|
||||
|
||||
// RT_TRACE(_module_mp_, _drv_alert_, ("ThermalValue = 0x%x\n", ThermalValue));
|
||||
return (u8)ThermalValue;
|
||||
}
|
||||
|
||||
|
@ -723,52 +691,51 @@ void Hal_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart)
|
|||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
pAdapter->mppriv.MptCtx.bSingleCarrier = bStart;
|
||||
if (bStart)// Start Single Carrier.
|
||||
if (bStart)/* Start Single Carrier. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetSingleCarrierTx: test start\n"));
|
||||
// 1. if OFDM block on?
|
||||
/* 1. if OFDM block on? */
|
||||
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);//set OFDM block on
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);/* set OFDM block on */
|
||||
|
||||
{
|
||||
// 2. set CCK test mode off, set to CCK normal mode
|
||||
/* 2. set CCK test mode off, set to CCK normal mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, bDisable);
|
||||
// 3. turn on scramble setting
|
||||
/* 3. turn on scramble setting */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable);
|
||||
}
|
||||
// 4. Turn On Single Carrier Tx and turn off the other test modes.
|
||||
/* 4. Turn On Single Carrier Tx and turn off the other test modes. */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bEnable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
#ifdef CONFIG_RTL8192C
|
||||
// 5. Disable TX power saving at STF & LLTF
|
||||
/* 5. Disable TX power saving at STF & LLTF */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, BIT22, 1);
|
||||
#endif
|
||||
//for dynamic set Power index.
|
||||
/* for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
|
||||
}
|
||||
else// Stop Single Carrier.
|
||||
else/* Stop Single Carrier. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetSingleCarrierTx: test stop\n"));
|
||||
|
||||
// Turn off all test modes.
|
||||
/* Turn off all test modes. */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
#ifdef CONFIG_RTL8192C
|
||||
// Cancel disable TX power saving at STF&LLTF
|
||||
/* Cancel disable TX power saving at STF&LLTF */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, BIT22, 0);
|
||||
#endif
|
||||
//Delay 10 ms //delay_ms(10);
|
||||
rtw_msleep_os(10);
|
||||
|
||||
//BB Reset
|
||||
/* BB Reset */
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
||||
|
||||
//Stop for dynamic set Power index.
|
||||
/* Stop for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
|
||||
|
@ -798,10 +765,10 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart)
|
|||
}
|
||||
|
||||
pAdapter->mppriv.MptCtx.bSingleTone = bStart;
|
||||
if (bStart)// Start Single Tone.
|
||||
if (bStart)/* Start Single Tone. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetSingleToneTx: test start\n"));
|
||||
{ // <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu)
|
||||
{ /* <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu) */
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
{
|
||||
reg58 = PHY_QueryRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask);
|
||||
|
@ -818,31 +785,31 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart)
|
|||
_write_rfreg(pAdapter, RF_PATH_A, 0x21, BIT19, 0x01);
|
||||
rtw_usleep_os(100);
|
||||
if (rfPath == RF_PATH_A)
|
||||
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x10000); // PAD all on.
|
||||
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x10000); /* PAD all on. */
|
||||
else if (rfPath == RF_PATH_B)
|
||||
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x10000); // PAD all on.
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); // PAD all on.
|
||||
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x10000); /* PAD all on. */
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); /* PAD all on. */
|
||||
rtw_usleep_os(100);
|
||||
}
|
||||
else
|
||||
{
|
||||
write_rfreg(pAdapter, rfPath, 0x21, 0xd4000);
|
||||
rtw_usleep_os(100);
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); // PAD all on.
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); /* PAD all on. */
|
||||
rtw_usleep_os(100);
|
||||
}
|
||||
|
||||
//for dynamic set Power index.
|
||||
/* for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
|
||||
}
|
||||
else// Stop Single Tone.
|
||||
else/* Stop Single Tone. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetSingleToneTx: test stop\n"));
|
||||
|
||||
{ // <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu)
|
||||
// <20120326, Kordan> Only in single tone mode. (asked by Edlu)
|
||||
{ /* <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu) */
|
||||
/* <20120326, Kordan> Only in single tone mode. (asked by Edlu) */
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
{
|
||||
reg58 = PHY_QueryRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask);
|
||||
|
@ -856,17 +823,17 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart)
|
|||
if (is92C) {
|
||||
_write_rfreg(pAdapter, RF_PATH_A, 0x21, BIT19, 0x00);
|
||||
rtw_usleep_os(100);
|
||||
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x32d75); // PAD all on.
|
||||
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x32d75); // PAD all on.
|
||||
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x32d75); /* PAD all on. */
|
||||
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x32d75); /* PAD all on. */
|
||||
rtw_usleep_os(100);
|
||||
} else {
|
||||
write_rfreg(pAdapter, rfPath, 0x21, 0x54000);
|
||||
rtw_usleep_os(100);
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x30000); // PAD all on.
|
||||
write_rfreg(pAdapter, rfPath, 0x00, 0x30000); /* PAD all on. */
|
||||
rtw_usleep_os(100);
|
||||
}
|
||||
|
||||
//Stop for dynamic set Power index.
|
||||
/* Stop for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
|
||||
|
@ -879,53 +846,49 @@ void Hal_SetSingleToneTx(PADAPTER pAdapter, u8 bStart)
|
|||
void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart)
|
||||
{
|
||||
pAdapter->mppriv.MptCtx.bCarrierSuppression = bStart;
|
||||
if (bStart) // Start Carrier Suppression.
|
||||
if (bStart) /* Start Carrier Suppression. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetCarrierSuppressionTx: test start\n"));
|
||||
//if (pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
|
||||
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M)
|
||||
{
|
||||
// 1. if CCK block on?
|
||||
/* 1. if CCK block on? */
|
||||
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);//set CCK block on
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);/* set CCK block on */
|
||||
|
||||
//Turn Off All Test Mode
|
||||
/* Turn Off All Test Mode */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); //transmit mode
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x0); //turn off scramble setting
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); /* transmit mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x0); /* turn off scramble setting */
|
||||
|
||||
//Set CCK Tx Test Rate
|
||||
//PHY_SetBBReg(pAdapter, rCCK0_System, bCCKTxRate, pMgntInfo->ForcedDataRate);
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKTxRate, 0x0); //Set FTxRate to 1Mbps
|
||||
/* Set CCK Tx Test Rate */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKTxRate, 0x0); /* Set FTxRate to 1Mbps */
|
||||
}
|
||||
|
||||
//for dynamic set Power index.
|
||||
/* for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
|
||||
}
|
||||
else// Stop Carrier Suppression.
|
||||
else/* Stop Carrier Suppression. */
|
||||
{
|
||||
RT_TRACE(_module_mp_,_drv_alert_, ("SetCarrierSuppressionTx: test stop\n"));
|
||||
//if (pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
|
||||
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M ) {
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); //normal mode
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x1); //turn on scramble setting
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); /* normal mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x1); /* turn on scramble setting */
|
||||
|
||||
//BB Reset
|
||||
/* BB Reset */
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
||||
}
|
||||
|
||||
//Stop for dynamic set Power index.
|
||||
/* Stop for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
|
||||
}
|
||||
//DbgPrint("\n MPT_ProSetCarrierSupp() is finished.\n");
|
||||
}
|
||||
|
||||
void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
|
||||
|
@ -937,28 +900,28 @@ void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
RT_TRACE(_module_mp_, _drv_alert_,
|
||||
("SetCCKContinuousTx: test start\n"));
|
||||
|
||||
// 1. if CCK block on?
|
||||
/* 1. if CCK block on? */
|
||||
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);//set CCK block on
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);/* set CCK block on */
|
||||
|
||||
//Turn Off All Test Mode
|
||||
/* Turn Off All Test Mode */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
//Set CCK Tx Test Rate
|
||||
/* Set CCK Tx Test Rate */
|
||||
cckrate = pAdapter->mppriv.rateidx;
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKTxRate, cckrate);
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); //transmit mode
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); //turn on scramble setting
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); /* transmit mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); /* turn on scramble setting */
|
||||
|
||||
#ifdef CONFIG_RTL8192C
|
||||
// Patch for CCK 11M waveform
|
||||
/* Patch for CCK 11M waveform */
|
||||
if (cckrate == MPT_RATE_1M)
|
||||
write_bbreg(pAdapter, 0xA71, BIT(6), bDisable);
|
||||
else
|
||||
write_bbreg(pAdapter, 0xA71, BIT(6), bEnable);
|
||||
#endif
|
||||
//for dynamic set Power index.
|
||||
/* for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
|
||||
|
@ -967,14 +930,14 @@ void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
RT_TRACE(_module_mp_, _drv_info_,
|
||||
("SetCCKContinuousTx: test stop\n"));
|
||||
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); //normal mode
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); //turn on scramble setting
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); /* normal mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); /* turn on scramble setting */
|
||||
|
||||
//BB Reset
|
||||
/* BB Reset */
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
||||
|
||||
//Stop for dynamic set Power index.
|
||||
/* Stop for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
}
|
||||
|
@ -989,23 +952,23 @@ void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
|
||||
if (bStart) {
|
||||
RT_TRACE(_module_mp_, _drv_info_, ("SetOFDMContinuousTx: test start\n"));
|
||||
// 1. if OFDM block on?
|
||||
/* 1. if OFDM block on? */
|
||||
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);//set OFDM block on
|
||||
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);/* set OFDM block on */
|
||||
{
|
||||
|
||||
// 2. set CCK test mode off, set to CCK normal mode
|
||||
/* 2. set CCK test mode off, set to CCK normal mode */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, bDisable);
|
||||
|
||||
// 3. turn on scramble setting
|
||||
/* 3. turn on scramble setting */
|
||||
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable);
|
||||
}
|
||||
// 4. Turn On Continue Tx and turn off the other test modes.
|
||||
/* 4. Turn On Continue Tx and turn off the other test modes. */
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bEnable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
|
||||
//for dynamic set Power index.
|
||||
/* for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
||||
|
||||
|
@ -1014,13 +977,13 @@ void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
||||
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
||||
//Delay 10 ms
|
||||
/* Delay 10 ms */
|
||||
rtw_msleep_os(10);
|
||||
//BB Reset
|
||||
/* BB Reset */
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
||||
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
||||
|
||||
//Stop for dynamic set Power index.
|
||||
/* Stop for dynamic set Power index. */
|
||||
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
||||
}
|
||||
|
@ -1046,4 +1009,4 @@ void Hal_SetContinuousTx(PADAPTER pAdapter, u8 bStart)
|
|||
}
|
||||
}
|
||||
|
||||
#endif // CONFIG_MP_INCLUDE
|
||||
#endif /* CONFIG_MP_INCLUDE */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue