mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Convert C90 comments
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
54abf571c4
commit
592c85f4e2
47 changed files with 4098 additions and 4374 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: u16 DataRate // 0x80-8f, 0x90-9f
|
||||
* Input: u16 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( IN struct adapter *Adapter,
|
||||
IN 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( IN struct adapter *Adapter,
|
|||
* Overview: This function is called by SetBWModeCallback8190Pci() only
|
||||
*
|
||||
* Input: struct adapter * 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( IN struct adapter *Adapter,
|
|||
void
|
||||
rtl8188e_PHY_RF6052SetBandwidth(
|
||||
IN struct adapter * Adapter,
|
||||
IN HT_CHANNEL_WIDTH Bandwidth) //20M or 40M
|
||||
IN HT_CHANNEL_WIDTH Bandwidth) /* 20M or 40M */
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
|
@ -133,7 +133,6 @@ rtl8188e_PHY_RF6052SetBandwidth(
|
|||
break;
|
||||
|
||||
default:
|
||||
//RT_TRACE(COMP_DBG, DBG_LOUD, ("PHY_SetRF8225Bandwidth(): unknown Bandwidth: %#X\n",Bandwidth ));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -166,13 +165,11 @@ 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;
|
||||
u32 TxAGC[2]={0, 0}, tmpval=0,pwrtrac_value;
|
||||
BOOLEAN TurboScanOff = false;
|
||||
u8 idx1, idx2;
|
||||
u8* ptr;
|
||||
u8 direction;
|
||||
//FOR CE ,must disable turbo scan
|
||||
TurboScanOff = true;
|
||||
|
||||
|
||||
|
@ -181,7 +178,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)
|
||||
{
|
||||
|
@ -190,7 +187,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
TxAGC[idx1] =
|
||||
pPowerlevel[idx1] | (pPowerlevel[idx1]<<8) |
|
||||
(pPowerlevel[idx1]<<16) | (pPowerlevel[idx1]<<24);
|
||||
// 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;
|
||||
}
|
||||
|
@ -198,9 +195,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;
|
||||
|
@ -235,16 +232,16 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
|
||||
|
||||
ODM_TxPwrTrackAdjust88E(&pHalData->odmpriv, 1, &direction, &pwrtrac_value);
|
||||
//printk("ODM_TxPwrTrackAdjust88E => direction:%02x, pwrtrac_value:%d \n", direction, pwrtrac_value);
|
||||
//printk(" ==> TxAGC:0x%08x \n",TxAGC[0] );
|
||||
/* printk("ODM_TxPwrTrackAdjust88E => direction:%02x, pwrtrac_value:%d \n", direction, pwrtrac_value); */
|
||||
/* printk(" ==> TxAGC:0x%08x \n",TxAGC[0] ); */
|
||||
|
||||
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;
|
||||
|
@ -260,31 +257,22 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
|||
ptr++;
|
||||
}
|
||||
}
|
||||
//printk(" ==> TxAGC:0x%08x \n",TxAGC[0] );
|
||||
/* printk(" ==> TxAGC:0x%08x \n",TxAGC[0] ); */
|
||||
|
||||
// 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);
|
||||
//printk("CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_A_CCK1_Mcs32);
|
||||
/* printk("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);
|
||||
//printk("CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_B_CCK11_A_CCK2_11);
|
||||
/* printk("CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval, rTxAGC_B_CCK11_A_CCK2_11); */
|
||||
|
||||
/*
|
||||
// rf-B cck tx power
|
||||
tmpval = TxAGC[RF_PATH_B]>>24;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval);
|
||||
//printk("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);
|
||||
//printk("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(
|
||||
IN struct adapter *Adapter,
|
||||
IN u8* pPowerLevelOFDM,
|
||||
|
@ -307,12 +295,12 @@ static void getPowerBase88E(
|
|||
|
||||
powerBase0 = (powerBase0<<24) | (powerBase0<<16) |(powerBase0<<8) |powerBase0;
|
||||
*(OfdmBase+i) = powerBase0;
|
||||
//DBG_871X(" [OFDM power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(OfdmBase+i));
|
||||
/* DBG_871X(" [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];
|
||||
|
@ -324,7 +312,7 @@ static void getPowerBase88E(
|
|||
powerBase1 = powerlevel[i];
|
||||
powerBase1 = (powerBase1<<24) | (powerBase1<<16) |(powerBase1<<8) |powerBase1;
|
||||
*(MCSBase+i) = powerBase1;
|
||||
//DBG_871X(" [MCS power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(MCSBase+i));
|
||||
/* DBG_871X(" [MCS power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(MCSBase+i)); */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,38 +333,38 @@ static void getTxPowerWriteValByRegulatory88E(
|
|||
u32 writeVal, customer_limit, rf;
|
||||
u8 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)]));
|
||||
/* 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));
|
||||
/* 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(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 = 4;
|
||||
|
||||
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
|
||||
|
@ -399,23 +387,23 @@ static void getTxPowerWriteValByRegulatory88E(
|
|||
chnlGroup+=4;
|
||||
*/
|
||||
}
|
||||
//RTPRINT(FPHY, PHY_TXPWR, ("MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%x\n",
|
||||
//chnlGroup, index, pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8: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, ("Realtek regulatory, 20MHz, writeVal(%c) = 0x%x\n", ((rf==0)?'A':'B'), writeVal));
|
||||
/* 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));
|
||||
/* 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)]));
|
||||
/* 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)
|
||||
|
@ -434,14 +422,14 @@ static void getTxPowerWriteValByRegulatory88E(
|
|||
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));
|
||||
/* 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));
|
||||
/* 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;
|
||||
|
@ -457,46 +445,39 @@ 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));
|
||||
/* 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));
|
||||
/* 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));
|
||||
/* 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"));
|
||||
/* 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"));
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
@ -535,9 +516,9 @@ static void writeOFDMPowerReg88E(
|
|||
RegOffset = RegOffset_B[index];
|
||||
|
||||
PHY_SetBBReg(Adapter, RegOffset, bMaskDWord, writeVal);
|
||||
//printk("Set OFDM tx pwr- 0x%x = %08x\n", RegOffset, writeVal);
|
||||
/* printk("Set OFDM tx pwr- 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) &&
|
||||
|
@ -598,14 +579,14 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
|||
u8 index = 0;
|
||||
|
||||
|
||||
//DBG_871X("PHY_RF6052SetOFDMTxPower, channel(%d) \n", Channel);
|
||||
/* DBG_871X("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++)
|
||||
|
@ -635,10 +616,10 @@ phy_RF6052_Config_HardCode(
|
|||
)
|
||||
{
|
||||
|
||||
// Set Default Bandwidth to 20M
|
||||
//Adapter->HalFunc .SetBWModeHandler(Adapter, HT_CHANNEL_WIDTH_20);
|
||||
/* Set Default Bandwidth to 20M */
|
||||
/* Adapter->HalFunc .SetBWModeHandler(Adapter, HT_CHANNEL_WIDTH_20); */
|
||||
|
||||
// TODO: Set Default Channel to channel one for RTL8225
|
||||
/* TODO: Set Default Channel to channel one for RTL8225 */
|
||||
|
||||
}
|
||||
|
||||
|
@ -664,10 +645,10 @@ phy_RF6052_Config_ParaFile(
|
|||
pszRadioBFile = sz88eRadioBFile;
|
||||
|
||||
|
||||
//3//-----------------------------------------------------------------
|
||||
//3// <2> Initialize RF
|
||||
//3//-----------------------------------------------------------------
|
||||
//for(eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
/* 3----------------------------------------------------------------- */
|
||||
/* 3 <2> Initialize RF */
|
||||
/* 3----------------------------------------------------------------- */
|
||||
/* for(eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++) */
|
||||
for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
|
||||
{
|
||||
|
||||
|
@ -688,18 +669,18 @@ 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)
|
||||
|
@ -711,10 +692,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
|
||||
|
@ -723,7 +704,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
|
||||
|
@ -748,13 +729,13 @@ phy_RF6052_Config_ParaFile(
|
|||
}
|
||||
|
||||
if(rtStatus != _SUCCESS){
|
||||
//RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath));
|
||||
/* RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath)); */
|
||||
goto phy_RF6052_Config_ParaFile_Fail;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n"));
|
||||
/* RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n")); */
|
||||
return rtStatus;
|
||||
|
||||
phy_RF6052_Config_ParaFile_Fail:
|
||||
|
@ -769,26 +750,26 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ==> RF shadow Operation API Code Section!!!
|
||||
//
|
||||
/* */
|
||||
/* ==> RF shadow Operation API Code Section!!! */
|
||||
/* */
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: PHY_RFShadowRead
|
||||
* PHY_RFShadowWrite
|
||||
|
@ -845,18 +826,18 @@ PHY_RFShadowCompare(
|
|||
IN u32 Offset)
|
||||
{
|
||||
u32 reg;
|
||||
// Check if we need to check the register
|
||||
/* Check if we need to check the register */
|
||||
if (RF_Shadow[eRFPath][Offset].Compare == true)
|
||||
{
|
||||
reg = PHY_QueryRFReg(Adapter, eRFPath, Offset, bRFRegOffsetMask);
|
||||
// Compare shadow and real rf register for 20bits!!
|
||||
/* Compare shadow and real rf register for 20bits!! */
|
||||
if (RF_Shadow[eRFPath][Offset].Value != reg)
|
||||
{
|
||||
// Locate error position.
|
||||
/* Locate error position. */
|
||||
RF_Shadow[eRFPath][Offset].ErrorOrNot = true;
|
||||
//RT_TRACE(COMP_INIT, DBG_LOUD,
|
||||
//("PHY_RFShadowCompare RF-%d Addr%02lx Err = %05lx\n",
|
||||
//eRFPath, Offset, reg));
|
||||
/* RT_TRACE(COMP_INIT, DBG_LOUD, */
|
||||
/* PHY_RFShadowCompare RF-%d Addr%02lx Err = %05lx\n", */
|
||||
/* eRFPath, Offset, reg)); */
|
||||
}
|
||||
return RF_Shadow[eRFPath][Offset].ErrorOrNot ;
|
||||
}
|
||||
|
@ -870,17 +851,17 @@ PHY_RFShadowRecorver(
|
|||
IN RF_RADIO_PATH_E eRFPath,
|
||||
IN u32 Offset)
|
||||
{
|
||||
// Check if the address is error
|
||||
/* Check if the address is error */
|
||||
if (RF_Shadow[eRFPath][Offset].ErrorOrNot == true)
|
||||
{
|
||||
// Check if we need to recorver the register.
|
||||
/* Check if we need to recorver the register. */
|
||||
if (RF_Shadow[eRFPath][Offset].Recorver == true)
|
||||
{
|
||||
PHY_SetRFReg(Adapter, eRFPath, Offset, bRFRegOffsetMask,
|
||||
RF_Shadow[eRFPath][Offset].Value);
|
||||
//RT_TRACE(COMP_INIT, DBG_LOUD,
|
||||
//("PHY_RFShadowRecorver RF-%d Addr%02lx=%05lx",
|
||||
//eRFPath, Offset, RF_Shadow[eRFPath][Offset].Value));
|
||||
/* RT_TRACE(COMP_INIT, DBG_LOUD, */
|
||||
/* PHY_RFShadowRecorver RF-%d Addr%02lx=%05lx", */
|
||||
/* eRFPath, Offset, RF_Shadow[eRFPath][Offset].Value)); */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -930,7 +911,7 @@ PHY_RFShadowCompareFlagSet(
|
|||
IN u32 Offset,
|
||||
IN u8 Type)
|
||||
{
|
||||
// Set True or False!!!
|
||||
/* Set True or False!!! */
|
||||
RF_Shadow[eRFPath][Offset].Compare = Type;
|
||||
|
||||
} /* PHY_RFShadowCompareFlagSet */
|
||||
|
@ -943,7 +924,7 @@ PHY_RFShadowRecorverFlagSet(
|
|||
IN u32 Offset,
|
||||
IN u8 Type)
|
||||
{
|
||||
// Set True or False!!!
|
||||
/* Set True or False!!! */
|
||||
RF_Shadow[eRFPath][Offset].Recorver= Type;
|
||||
|
||||
} /* PHY_RFShadowRecorverFlagSet */
|
||||
|
@ -960,7 +941,7 @@ PHY_RFShadowCompareFlagSetAll(
|
|||
{
|
||||
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
|
||||
{
|
||||
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
|
||||
/* 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!! */
|
||||
if (Offset != 0x26 && Offset != 0x27)
|
||||
PHY_RFShadowCompareFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, false);
|
||||
else
|
||||
|
@ -982,7 +963,7 @@ PHY_RFShadowRecorverFlagSetAll(
|
|||
{
|
||||
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
|
||||
{
|
||||
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
|
||||
/* 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!! */
|
||||
if (Offset != 0x26 && Offset != 0x27)
|
||||
PHY_RFShadowRecorverFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, false);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue