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
|
@ -48,17 +48,17 @@
|
|||
#include <rtl8188e_hal.h>
|
||||
|
||||
/*---------------------------Define Local Constant---------------------------*/
|
||||
// Define local structure for debug!!!!!
|
||||
/* Define local structure for debug!!!!! */
|
||||
typedef struct RF_Shadow_Compare_Map {
|
||||
// Shadow register value
|
||||
/* Shadow register value */
|
||||
u32 Value;
|
||||
// Compare or not flag
|
||||
/* Compare or not flag */
|
||||
u8 Compare;
|
||||
// Record If it had ever modified unpredicted
|
||||
/* Record If it had ever modified unpredicted */
|
||||
u8 ErrorOrNot;
|
||||
// Recorver Flag
|
||||
/* Recorver Flag */
|
||||
u8 Recorver;
|
||||
//
|
||||
/* */
|
||||
u8 Driver_Write;
|
||||
}RF_SHADOW_T;
|
||||
/*---------------------------Define Local Constant---------------------------*/
|
||||
|
@ -69,8 +69,8 @@ typedef struct RF_Shadow_Compare_Map {
|
|||
|
||||
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
// 2008/11/20 MH For Debug only, RF
|
||||
//static RF_SHADOW_T RF_Shadow[RF6052_MAX_PATH][RF6052_MAX_REG] = {0};
|
||||
/* 2008/11/20 MH For Debug only, RF */
|
||||
/* static RF_SHADOW_T RF_Shadow[RF6052_MAX_PATH][RF6052_MAX_REG] = {0}; */
|
||||
static RF_SHADOW_T RF_Shadow[RF6052_MAX_PATH][RF6052_MAX_REG];
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
|
||||
|
@ -80,7 +80,7 @@ static RF_SHADOW_T RF_Shadow[RF6052_MAX_PATH][RF6052_MAX_REG];
|
|||
*
|
||||
* Overview: For RL6052, we must change some RF settign for 1T or 2T.
|
||||
*
|
||||
* Input: u2Byte DataRate // 0x80-8f, 0x90-9f
|
||||
* Input: u2Byte DataRate 0x80-8f, 0x90-9f
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
|
@ -95,7 +95,7 @@ static RF_SHADOW_T RF_Shadow[RF6052_MAX_PATH][RF6052_MAX_REG];
|
|||
void rtl8188e_RF_ChangeTxPath( PADAPTER Adapter,
|
||||
u16 DataRate)
|
||||
{
|
||||
// We do not support gain table change inACUT now !!!! Delete later !!!
|
||||
/* We do not support gain table change inACUT now !!!! Delete later !!! */
|
||||
} /* RF_ChangeTxPath */
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ void rtl8188e_RF_ChangeTxPath( PADAPTER Adapter,
|
|||
* Overview: This function is called by SetBWModeCallback8190Pci() only
|
||||
*
|
||||
* Input: PADAPTER Adapter
|
||||
* WIRELESS_BANDWIDTH_E Bandwidth //20M or 40M
|
||||
* WIRELESS_BANDWIDTH_E Bandwidth 20M or 40M
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
|
@ -116,7 +116,7 @@ void rtl8188e_RF_ChangeTxPath( PADAPTER Adapter,
|
|||
void
|
||||
rtl8188e_PHY_RF6052SetBandwidth(
|
||||
PADAPTER Adapter,
|
||||
HT_CHANNEL_WIDTH Bandwidth) //20M or 40M
|
||||
HT_CHANNEL_WIDTH Bandwidth) /* 20M or 40M */
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
|
@ -133,7 +133,7 @@ rtl8188e_PHY_RF6052SetBandwidth(
|
|||
break;
|
||||
|
||||
default:
|
||||
//RT_TRACE(COMP_DBG, DBG_LOUD, ("PHY_SetRF8225Bandwidth(): unknown Bandwidth: %#X\n",Bandwidth ));
|
||||
/* RT_TRACE(COMP_DBG, DBG_LOUD, ("PHY_SetRF8225Bandwidth(): unknown Bandwidth: %#X\n",Bandwidth )); */
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -166,13 +166,13 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
//PMGNT_INFO pMgntInfo=&Adapter->MgntInfo;
|
||||
/* PMGNT_INFO pMgntInfo=&Adapter->MgntInfo; */
|
||||
u32 TxAGC[2]={0, 0}, tmpval=0,pwrtrac_value;
|
||||
bool TurboScanOff = false;
|
||||
u8 idx1, idx2;
|
||||
u8* ptr;
|
||||
u8 direction;
|
||||
//FOR CE ,must disable turbo scan
|
||||
/* FOR CE ,must disable turbo scan */
|
||||
TurboScanOff = true;
|
||||
|
||||
|
||||
|
@ -181,7 +181,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
TxAGC[RF_PATH_A] = 0x3f3f3f3f;
|
||||
TxAGC[RF_PATH_B] = 0x3f3f3f3f;
|
||||
|
||||
TurboScanOff = true;//disable turbo scan
|
||||
TurboScanOff = true;/* disable turbo scan */
|
||||
|
||||
if (TurboScanOff)
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
pPowerlevel[idx1] | (pPowerlevel[idx1]<<8) |
|
||||
(pPowerlevel[idx1]<<16) | (pPowerlevel[idx1]<<24);
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20.
|
||||
/* 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20. */
|
||||
if (TxAGC[idx1] > 0x20 && pHalData->ExternalPA)
|
||||
TxAGC[idx1] = 0x20;
|
||||
#endif
|
||||
|
@ -200,9 +200,9 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
}
|
||||
else
|
||||
{
|
||||
// 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism.
|
||||
// Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism.
|
||||
// In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder.
|
||||
/* 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism. */
|
||||
/* Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism. */
|
||||
/* In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder. */
|
||||
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
|
||||
{
|
||||
TxAGC[RF_PATH_A] = 0x10101010;
|
||||
|
@ -247,41 +247,35 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
}
|
||||
ODM_TxPwrTrackAdjust88E(&pHalData->odmpriv, 1, &direction, &pwrtrac_value);
|
||||
|
||||
if (direction == 1) // Increase TX pwoer
|
||||
if (direction == 1) /* Increase TX pwoer */
|
||||
{
|
||||
TxAGC[0] += pwrtrac_value;
|
||||
TxAGC[1] += pwrtrac_value;
|
||||
}
|
||||
else if (direction == 2) // Decrease TX pwoer
|
||||
else if (direction == 2) /* Decrease TX pwoer */
|
||||
{
|
||||
TxAGC[0] -= pwrtrac_value;
|
||||
TxAGC[1] -= pwrtrac_value;
|
||||
}
|
||||
|
||||
|
||||
// rf-A cck tx power
|
||||
/* rf-A cck tx power */
|
||||
tmpval = TxAGC[RF_PATH_A]&0xff;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_A_CCK1_Mcs32));
|
||||
tmpval = TxAGC[RF_PATH_A]>>8;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_B_CCK11_A_CCK2_11));
|
||||
|
||||
// rf-B cck tx power
|
||||
/* rf-B cck tx power */
|
||||
tmpval = TxAGC[RF_PATH_B]>>24;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_B_CCK11_A_CCK2_11));
|
||||
tmpval = TxAGC[RF_PATH_B]&0x00ffffff;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n",
|
||||
// tmpval, rTxAGC_B_CCK1_55_Mcs32));
|
||||
|
||||
} /* PHY_RF6052SetCckTxPower */
|
||||
|
||||
//
|
||||
// powerbase0 for OFDM rates
|
||||
// powerbase1 for HT MCS rates
|
||||
//
|
||||
/* */
|
||||
/* powerbase0 for OFDM rates */
|
||||
/* powerbase1 for HT MCS rates */
|
||||
/* */
|
||||
static void getPowerBase88E(
|
||||
PADAPTER Adapter,
|
||||
u8* pPowerLevelOFDM,
|
||||
|
@ -304,12 +298,11 @@ static void getPowerBase88E(
|
|||
|
||||
powerBase0 = (powerBase0<<24) | (powerBase0<<16) |(powerBase0<<8) |powerBase0;
|
||||
*(OfdmBase+i) = powerBase0;
|
||||
//DBG_88E(" [OFDM power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(OfdmBase+i));
|
||||
}
|
||||
|
||||
for (i=0; i<pHalData->NumTotalRFPath; i++)
|
||||
{
|
||||
//Check HT20 to HT40 diff
|
||||
/* Check HT20 to HT40 diff */
|
||||
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
|
||||
{
|
||||
powerlevel[i] = pPowerLevelBW20[i];
|
||||
|
@ -321,7 +314,6 @@ static void getPowerBase88E(
|
|||
powerBase1 = powerlevel[i];
|
||||
powerBase1 = (powerBase1<<24) | (powerBase1<<16) |(powerBase1<<8) |powerBase1;
|
||||
*(MCSBase+i) = powerBase1;
|
||||
//DBG_88E(" [MCS power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(MCSBase+i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,101 +334,61 @@ static void getTxPowerWriteValByRegulatory88E(
|
|||
u4Byte writeVal, customer_limit, rf;
|
||||
u1Byte Regulatory = pHalData->EEPROMRegulatory;
|
||||
|
||||
//
|
||||
// Index 0 & 1= legacy OFDM, 2-5=HT_MCS rate
|
||||
//
|
||||
/* */
|
||||
/* Index 0 & 1= legacy OFDM, 2-5=HT_MCS rate */
|
||||
/* */
|
||||
|
||||
for (rf=0; rf<2; rf++) {
|
||||
switch (Regulatory)
|
||||
{
|
||||
case 0: // Realtek better performance
|
||||
// increase power diff defined by Realtek for large power
|
||||
case 0: /* Realtek better performance */
|
||||
/* increase power diff defined by Realtek for large power */
|
||||
chnlGroup = 0;
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%x\n",
|
||||
// chnlGroup, index, pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)]));
|
||||
writeVal = pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)] +
|
||||
((index<2)?powerBase0[rf]:powerBase1[rf]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("RTK better performance, writeVal(%c) = 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
break;
|
||||
case 1: // Realtek regulatory
|
||||
// increase power diff defined by Realtek for regulatory
|
||||
case 1: /* Realtek regulatory */
|
||||
/* increase power diff defined by Realtek for regulatory */
|
||||
{
|
||||
if (pHalData->pwrGroupCnt == 1)
|
||||
chnlGroup = 0;
|
||||
if (pHalData->pwrGroupCnt >= pHalData->PGMaxGroup)
|
||||
{
|
||||
if (Channel < 3) // Chanel 1-2
|
||||
if (Channel < 3) /* Chanel 1-2 */
|
||||
chnlGroup = 0;
|
||||
else if (Channel < 6) // Channel 3-5
|
||||
else if (Channel < 6) /* Channel 3-5 */
|
||||
chnlGroup = 1;
|
||||
else if (Channel <9) // Channel 6-8
|
||||
else if (Channel <9) /* Channel 6-8 */
|
||||
chnlGroup = 2;
|
||||
else if (Channel <12) // Channel 9-11
|
||||
else if (Channel <12) /* Channel 9-11 */
|
||||
chnlGroup = 3;
|
||||
else if (Channel <14) // Channel 12-13
|
||||
else if (Channel <14) /* Channel 12-13 */
|
||||
chnlGroup = 4;
|
||||
else if (Channel ==14) // Channel 14
|
||||
else if (Channel ==14) /* Channel 14 */
|
||||
chnlGroup = 5;
|
||||
|
||||
/*
|
||||
if (Channel <= 3)
|
||||
chnlGroup = 0;
|
||||
else if (Channel >= 4 && Channel <= 9)
|
||||
chnlGroup = 1;
|
||||
else if (Channel > 9)
|
||||
chnlGroup = 2;
|
||||
|
||||
|
||||
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
|
||||
chnlGroup++;
|
||||
else
|
||||
chnlGroup+=4;
|
||||
*/
|
||||
}
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%x\n",
|
||||
//chnlGroup, index, pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)]));
|
||||
writeVal = pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)] +
|
||||
((index<2)?powerBase0[rf]:powerBase1[rf]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("Realtek regulatory, 20MHz, writeVal(%c) = 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
}
|
||||
break;
|
||||
case 2: // Better regulatory
|
||||
// don't increase any power diff
|
||||
case 2: /* Better regulatory */
|
||||
/* don't increase any power diff */
|
||||
writeVal = ((index<2)?powerBase0[rf]:powerBase1[rf]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("Better regulatory, writeVal(%c) = 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
break;
|
||||
case 3: // Customer defined power diff.
|
||||
// increase power diff defined by customer.
|
||||
case 3: /* Customer defined power diff. */
|
||||
/* increase power diff defined by customer. */
|
||||
chnlGroup = 0;
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%x\n",
|
||||
// chnlGroup, index, pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)]));
|
||||
|
||||
/*
|
||||
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20_40)
|
||||
{
|
||||
RTPRINT(FPHY, PHY_TXPWR, ("customer's limit, 40MHz rf(%c) = 0x%x\n",
|
||||
((rf==0)?'A':'B'), pHalData->PwrGroupHT40[rf][Channel-1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
RTPRINT(FPHY, PHY_TXPWR, ("customer's limit, 20MHz rf(%c) = 0x%x\n",
|
||||
((rf==0)?'A':'B'), pHalData->PwrGroupHT20[rf][Channel-1]));
|
||||
}*/
|
||||
|
||||
if (index < 2)
|
||||
pwr_diff = pHalData->TxPwrLegacyHtDiff[rf][Channel-1];
|
||||
else if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
|
||||
pwr_diff = pHalData->TxPwrHt20Diff[rf][Channel-1];
|
||||
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("power diff rf(%c) = 0x%x\n", ((rf==0)?'A':'B'), pwr_diff));
|
||||
|
||||
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_40)
|
||||
customer_pwr_limit = pHalData->PwrGroupHT40[rf][Channel-1];
|
||||
else
|
||||
customer_pwr_limit = pHalData->PwrGroupHT20[rf][Channel-1];
|
||||
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("customer pwr limit rf(%c) = 0x%x\n", ((rf==0)?'A':'B'), customer_pwr_limit));
|
||||
|
||||
if (pwr_diff >= customer_pwr_limit)
|
||||
pwr_diff = 0;
|
||||
else
|
||||
|
@ -451,46 +403,34 @@ static void getTxPowerWriteValByRegulatory88E(
|
|||
}
|
||||
customer_limit = (pwr_diff_limit[3]<<24) | (pwr_diff_limit[2]<<16) |
|
||||
(pwr_diff_limit[1]<<8) | (pwr_diff_limit[0]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("Customer's limit rf(%c) = 0x%x\n", ((rf==0)?'A':'B'), customer_limit));
|
||||
writeVal = customer_limit + ((index<2)?powerBase0[rf]:powerBase1[rf]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("Customer, writeVal rf(%c)= 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
break;
|
||||
default:
|
||||
chnlGroup = 0;
|
||||
writeVal = pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)] +
|
||||
((index<2)?powerBase0[rf]:powerBase1[rf]);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("RTK better performance, writeVal rf(%c) = 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
break;
|
||||
}
|
||||
|
||||
// 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism.
|
||||
// Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism.
|
||||
// In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder.
|
||||
//92d do not need this
|
||||
/* 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism. */
|
||||
/* Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism. */
|
||||
/* In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder. */
|
||||
/* 92d do not need this */
|
||||
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
|
||||
writeVal = 0x14141414;
|
||||
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
|
||||
writeVal = 0x00000000;
|
||||
|
||||
// 20100628 Joseph: High power mode for BT-Coexist mechanism.
|
||||
// This mechanism is only applied when Driver-Highpower-Mechanism is OFF.
|
||||
/* 20100628 Joseph: High power mode for BT-Coexist mechanism. */
|
||||
/* This mechanism is only applied when Driver-Highpower-Mechanism is OFF. */
|
||||
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1)
|
||||
{
|
||||
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-6)\n"));
|
||||
writeVal = writeVal - 0x06060606;
|
||||
}
|
||||
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2)
|
||||
{
|
||||
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-0)\n"));
|
||||
writeVal = writeVal ;
|
||||
}
|
||||
/*
|
||||
if (pMgntInfo->bDisableTXPowerByRate)
|
||||
{
|
||||
// add for OID_RT_11N_TX_POWER_BY_RATE ,disable tx powre change by rate
|
||||
writeVal = 0x2c2c2c2c;
|
||||
}
|
||||
*/
|
||||
*(pOutWriteVal+rf) = writeVal;
|
||||
}
|
||||
}
|
||||
|
@ -529,9 +469,8 @@ static void writeOFDMPowerReg88E(
|
|||
RegOffset = RegOffset_B[index];
|
||||
|
||||
PHY_SetBBReg(Adapter, RegOffset, bMaskDWord, writeVal);
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("Set 0x%x = %08x\n", RegOffset, writeVal));
|
||||
|
||||
// 201005115 Joseph: Set Tx Power diff for Tx power training mechanism.
|
||||
/* 201005115 Joseph: Set Tx Power diff for Tx power training mechanism. */
|
||||
if (((pHalData->rf_type == RF_2T2R) &&
|
||||
(RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs15_Mcs12))||
|
||||
((pHalData->rf_type != RF_2T2R) &&
|
||||
|
@ -591,15 +530,12 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
|||
u8 direction;
|
||||
u8 index = 0;
|
||||
|
||||
|
||||
//DBG_88E("PHY_RF6052SetOFDMTxPower, channel(%d)\n", Channel);
|
||||
|
||||
getPowerBase88E(Adapter, pPowerLevelOFDM,pPowerLevelBW20,pPowerLevelBW40, Channel, &powerBase0[0], &powerBase1[0]);
|
||||
|
||||
//
|
||||
// 2012/04/23 MH According to power tracking value, we need to revise OFDM tx power.
|
||||
// This is ued to fix unstable power tracking mode.
|
||||
//
|
||||
/* */
|
||||
/* 2012/04/23 MH According to power tracking value, we need to revise OFDM tx power. */
|
||||
/* This is ued to fix unstable power tracking mode. */
|
||||
/* */
|
||||
ODM_TxPwrTrackAdjust88E(&pHalData->odmpriv, 0, &direction, &pwrtrac_value);
|
||||
|
||||
for (index=0; index<6; index++)
|
||||
|
@ -622,18 +558,11 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
phy_RF6052_Config_HardCode(
|
||||
PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
|
||||
// Set Default Bandwidth to 20M
|
||||
//Adapter->HalFunc .SetBWModeHandler(Adapter, HT_CHANNEL_WIDTH_20);
|
||||
|
||||
// TODO: Set Default Channel to channel one for RTL8225
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -657,18 +586,16 @@ phy_RF6052_Config_ParaFile(
|
|||
pszRadioBFile = sz88eRadioBFile;
|
||||
#endif
|
||||
|
||||
//3//-----------------------------------------------------------------
|
||||
//3// <2> Initialize RF
|
||||
//3//-----------------------------------------------------------------
|
||||
//for (eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
/* 3----------------------------------------------------------------- */
|
||||
/* 3 <2> Initialize RF */
|
||||
/* 3----------------------------------------------------------------- */
|
||||
for (eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
{
|
||||
|
||||
pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
|
||||
/*----Store original RFENV control type----*/
|
||||
switch (eRFPath)
|
||||
{
|
||||
switch (eRFPath) {
|
||||
case RF_PATH_A:
|
||||
case RF_PATH_C:
|
||||
u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
|
||||
|
@ -681,22 +608,21 @@ phy_RF6052_Config_ParaFile(
|
|||
|
||||
/*----Set RF_ENV enable----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV<<16, 0x1);
|
||||
rtw_udelay_os(1);//PlatformStallExecution(1);
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Set RF_ENV output high----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfo, bRFSI_RFENV, 0x1);
|
||||
rtw_udelay_os(1);//PlatformStallExecution(1);
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/* Set bit number of Address and Data for RF register */
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0); // Set 1 to 4 bits for 8255
|
||||
rtw_udelay_os(1);//PlatformStallExecution(1);
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0); /* Set 1 to 4 bits for 8255 */
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); // Set 0 to 12 bits for 8255
|
||||
rtw_udelay_os(1);//PlatformStallExecution(1);
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); /* Set 0 to 12 bits for 8255 */
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
switch (eRFPath)
|
||||
{
|
||||
switch (eRFPath) {
|
||||
case RF_PATH_A:
|
||||
#ifdef CONFIG_EMBEDDED_FWIMG
|
||||
#ifdef CONFIG_PHY_SETTING_WITH_ODM
|
||||
|
@ -704,10 +630,10 @@ phy_RF6052_Config_ParaFile(
|
|||
rtStatus= _FAIL;
|
||||
#else
|
||||
rtStatus= rtl8188e_PHY_ConfigRFWithHeaderFile(Adapter,(RF_RADIO_PATH_E)eRFPath);
|
||||
#endif//#ifdef CONFIG_PHY_SETTING_WITH_ODM
|
||||
#endif/* ifdef CONFIG_PHY_SETTING_WITH_ODM */
|
||||
#else
|
||||
rtStatus = rtl8188e_PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile, (RF_RADIO_PATH_E)eRFPath);
|
||||
#endif//#ifdef CONFIG_EMBEDDED_FWIMG
|
||||
#endif/* ifdef CONFIG_EMBEDDED_FWIMG */
|
||||
break;
|
||||
case RF_PATH_B:
|
||||
#ifdef CONFIG_EMBEDDED_FWIMG
|
||||
|
@ -716,7 +642,7 @@ phy_RF6052_Config_ParaFile(
|
|||
rtStatus= _FAIL;
|
||||
#else
|
||||
rtStatus = rtl8188e_PHY_ConfigRFWithHeaderFile(Adapter,(RF_RADIO_PATH_E)eRFPath);
|
||||
#endif //#ifdef CONFIG_PHY_SETTING_WITH_ODM
|
||||
#endif /* ifdef CONFIG_PHY_SETTING_WITH_ODM */
|
||||
#else
|
||||
rtStatus =rtl8188e_PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile, (RF_RADIO_PATH_E)eRFPath);
|
||||
#endif
|
||||
|
@ -740,14 +666,11 @@ phy_RF6052_Config_ParaFile(
|
|||
break;
|
||||
}
|
||||
|
||||
if (rtStatus != _SUCCESS){
|
||||
//RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath));
|
||||
if (rtStatus != _SUCCESS)
|
||||
goto phy_RF6052_Config_ParaFile_Fail;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n"));
|
||||
return rtStatus;
|
||||
|
||||
phy_RF6052_Config_ParaFile_Fail:
|
||||
|
@ -762,18 +685,18 @@ PHY_RF6052_Config8188E(
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
int rtStatus = _SUCCESS;
|
||||
|
||||
//
|
||||
// Initialize general global value
|
||||
//
|
||||
// TODO: Extend RF_PATH_C and RF_PATH_D in the future
|
||||
/* */
|
||||
/* Initialize general global value */
|
||||
/* */
|
||||
/* TODO: Extend RF_PATH_C and RF_PATH_D in the future */
|
||||
if (pHalData->rf_type == RF_1T1R)
|
||||
pHalData->NumTotalRFPath = 1;
|
||||
else
|
||||
pHalData->NumTotalRFPath = 2;
|
||||
|
||||
//
|
||||
// Config BB and RF
|
||||
//
|
||||
/* */
|
||||
/* Config BB and RF */
|
||||
/* */
|
||||
rtStatus = phy_RF6052_Config_ParaFile(Adapter);
|
||||
return rtStatus;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue