Merge pull request #103 from kimocoder/v5.1.5

Minor fixes / tests
This commit is contained in:
Christian B 2018-03-08 09:12:03 +01:00 committed by GitHub
commit f93a48a654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 746 additions and 799 deletions

0
hal/btc/HalBtc8703b2Ant.c Executable file → Normal file
View File

0
hal/btc/HalBtc8703b2Ant.h Executable file → Normal file
View File

View File

@ -76,15 +76,13 @@ ODM_PWdB_Conversion(
s4Byte Y, integer = 0, decimal = 0;
u4Byte i;
if(X == 0)
if (X == 0)
X = 1; // log2(x), x can't be 0
for(i = (TotalBit-1); i > 0; i--)
{
if(X & BIT(i))
{
for (i = (TotalBit-1); i > 0; i--) {
if (X & BIT(i)) {
integer = i;
if(i > 0)
if (i > 0)
decimal = (X & BIT(i-1))?2:0; //decimal is 0.5dB*3=1.5dB~=2dB
break;
}
@ -101,7 +99,7 @@ ODM_SignConversion(
IN u4Byte TotalBit
)
{
if(value&BIT(TotalBit-1))
if (value&BIT(TotalBit-1))
value -= BIT(TotalBit);
return value;
}
@ -460,8 +458,7 @@ phydm_Init_cck_setting(
pDM_Odm->bCckHighPower = (BOOLEAN) ODM_GetBBReg(pDM_Odm, ODM_REG(CCK_RPT_FORMAT,pDM_Odm), ODM_BIT(CCK_RPT_FORMAT,pDM_Odm));
#if (RTL8192E_SUPPORT == 1)
if(pDM_Odm->SupportICType & (ODM_RTL8192E))
{
if (pDM_Odm->SupportICType & (ODM_RTL8192E)) {
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
phydm_config_cck_rx_antenna_init(pDM_Odm);
phydm_config_cck_rx_path(pDM_Odm, PHYDM_A, CCA_PATHDIV_DISABLE);
@ -471,8 +468,7 @@ phydm_Init_cck_setting(
value_824 = ODM_GetBBReg(pDM_Odm, 0x824, BIT9);
value_82c = ODM_GetBBReg(pDM_Odm, 0x82c, BIT9);
if(value_824 != value_82c)
{
if (value_824 != value_82c) {
ODM_SetBBReg(pDM_Odm, 0x82c , BIT9, value_824);
}
ODM_SetBBReg(pDM_Odm, 0xa80 , BIT7, value_824);
@ -602,8 +598,7 @@ odm_CommonInfoSelfUpdate(
/* THis variable cannot be used because it is wrong*/
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
if (*(pDM_Odm->pBandWidth) == ODM_BW40M)
{
if (*(pDM_Odm->pBandWidth) == ODM_BW40M) {
if (*(pDM_Odm->pSecChOffset) == 1)
pDM_Odm->ControlChannel = *(pDM_Odm->pChannel) + 2;
else if (*(pDM_Odm->pSecChOffset) == 2)
@ -625,14 +620,11 @@ odm_CommonInfoSelfUpdate(
pDM_Odm->ControlChannel = *(pDM_Odm->pChannel);
#endif
for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
{
for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++) {
pEntry = pDM_Odm->pODM_StaInfo[i];
if(IS_STA_VALID(pEntry))
{
if (IS_STA_VALID(pEntry)) {
EntryCnt++;
if(EntryCnt==1)
{
if (EntryCnt==1) {
OneEntry_MACID=i;
}
@ -647,8 +639,7 @@ odm_CommonInfoSelfUpdate(
}
}
if(EntryCnt == 1)
{
if (EntryCnt == 1) {
pDM_Odm->bOneEntryOnly = TRUE;
pDM_Odm->OneEntry_MACID=OneEntry_MACID;
}
@ -732,7 +723,7 @@ odm_HWSetting(
)
{
#if (RTL8821A_SUPPORT == 1)
if(pDM_Odm->SupportICType & ODM_RTL8821)
if (pDM_Odm->SupportICType & ODM_RTL8821)
odm_HWSetting_8821A(pDM_Odm);
#endif
@ -784,13 +775,11 @@ ODM_DMInit(
}
#endif
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
{
if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) {
odm_DynamicBBPowerSavingInit(pDM_Odm);
#if (RTL8188E_SUPPORT == 1)
if(pDM_Odm->SupportICType==ODM_RTL8188E)
{
if (pDM_Odm->SupportICType==ODM_RTL8188E) {
ODM_PrimaryCCA_Init(pDM_Odm);
ODM_RAInfo_Init_all(pDM_Odm);
}
@ -799,12 +788,12 @@ ODM_DMInit(
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
#if (RTL8723B_SUPPORT == 1)
if(pDM_Odm->SupportICType == ODM_RTL8723B)
if (pDM_Odm->SupportICType == ODM_RTL8723B)
odm_SwAntDetectInit(pDM_Odm);
#endif
#if (RTL8192E_SUPPORT == 1)
if(pDM_Odm->SupportICType==ODM_RTL8192E)
if (pDM_Odm->SupportICType==ODM_RTL8192E)
odm_PrimaryCCA_Check_Init(pDM_Odm);
#endif
@ -842,8 +831,7 @@ phydm_support_ability_debug(
pre_support_ability = pDM_Odm->SupportAbility ;
PHYDM_SNPRINTF((output+used, out_len-used,"\n%s\n", "================================"));
if(dm_value[0] == 100)
{
if (dm_value[0] == 100) {
PHYDM_SNPRINTF((output+used, out_len-used, "[Supportability] PhyDM Selection\n"));
PHYDM_SNPRINTF((output+used, out_len-used,"%s\n", "================================"));
PHYDM_SNPRINTF((output+used, out_len-used, "00. (( %s ))DIG\n", ((pDM_Odm->SupportAbility & ODM_BB_DIG)?("V"):("."))));
@ -877,23 +865,17 @@ phydm_support_ability_debug(
PHYDM_SNPRINTF((output+used, out_len-used,"%s\n", "Disable all SupportAbility components"));
}
*/
else
{
else {
if(dm_value[1] == 1) //enable
{
if (dm_value[1] == 1) { //enable
pDM_Odm->SupportAbility |= BIT(dm_value[0]) ;
if(BIT(dm_value[0]) & ODM_BB_PATH_DIV)
{
if (BIT(dm_value[0]) & ODM_BB_PATH_DIV) {
odm_PathDiversityInit(pDM_Odm);
}
}
else if(dm_value[1] == 2) //disable
{
else if (dm_value[1] == 2) { //disable
pDM_Odm->SupportAbility &= ~(BIT(dm_value[0])) ;
}
else
{
} else {
//DbgPrint("\n[Warning!!!] 1:enable, 2:disable \n\n");
PHYDM_SNPRINTF((output+used, out_len-used,"%s\n", "[Warning!!!] 1:enable, 2:disable"));
}
@ -919,7 +901,7 @@ ODM_DMWatchdog_LPS(
odm_CCKPacketDetectionThresh(pDM_Odm);
odm_CommonInfoSelfReset(pDM_Odm);
if(*(pDM_Odm->pbPowerSaving)==TRUE)
if (*(pDM_Odm->pbPowerSaving)==TRUE)
return;
}
#endif
@ -940,7 +922,7 @@ ODM_DMWatchdog(
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
{
prtl8192cd_priv priv = pDM_Odm->priv;
if( (priv->auto_channel != 0) && (priv->auto_channel != 2) )//if ACS running, do not do FA/CCA counter read
if ( (priv->auto_channel != 0) && (priv->auto_channel != 2) )//if ACS running, do not do FA/CCA counter read
return;
}
#endif
@ -949,8 +931,7 @@ ODM_DMWatchdog(
odm_RSSIMonitorCheck(pDM_Odm);
if(*(pDM_Odm->pbPowerSaving) == TRUE)
{
if (*(pDM_Odm->pbPowerSaving) == TRUE) {
odm_DIGbyRSSI_LPS(pDM_Odm);
{
pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable;
@ -984,8 +965,7 @@ ODM_DMWatchdog(
phydm_rf_watchdog(pDM_Odm);
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
{
if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES) {
#if (RTL8188E_SUPPORT == 1)
if (pDM_Odm->SupportICType == ODM_RTL8188E)
@ -995,7 +975,7 @@ ODM_DMWatchdog(
#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
#if (RTL8192E_SUPPORT == 1)
if(pDM_Odm->SupportICType==ODM_RTL8192E)
if (pDM_Odm->SupportICType==ODM_RTL8192E)
odm_DynamicPrimaryCCA_Check(pDM_Odm);
#endif
#endif
@ -1941,8 +1921,7 @@ ODM_CheckPowerStatus(
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
// 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence.
if (pMgntInfo->init_adpt_in_progress == TRUE)
{
if (pMgntInfo->init_adpt_in_progress == TRUE) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return TRUE, due to initadapter\n"));
return TRUE;
}
@ -1951,8 +1930,7 @@ ODM_CheckPowerStatus(
// 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK.
//
Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
if(Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff)
{
if (Adapter->bDriverStopped || Adapter->bDriverIsGoingToPnpSetPowerSleep || rtState == eRfOff) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM_CheckPowerStatus Return FALSE, due to %d/%d/%d\n",
Adapter->bDriverStopped, Adapter->bDriverIsGoingToPnpSetPowerSleep, rtState));
return FALSE;
@ -2048,23 +2026,18 @@ odm_ConvertTo_dB(
Value = Value & 0xFFFF;
for (i = 0; i < 12; i++)
{
if (Value <= dB_Invert_Table[i][7])
{
for (i = 0; i < 12; i++) {
if (Value <= dB_Invert_Table[i][7]) {
break;
}
}
if (i >= 12)
{
if (i >= 12) {
return (96); // maximum 96 dB
}
for (j = 0; j < 8; j++)
{
if (Value <= dB_Invert_Table[i][j])
{
for (j = 0; j < 8; j++) {
if (Value <= dB_Invert_Table[i][j]) {
break;
}
}
@ -2118,16 +2091,14 @@ ODM_AsocEntry_Init(
pLoopAdapter = GetNextExtAdapter(pLoopAdapter);
TotalAssocEntryNum +=1;
while(pLoopAdapter)
{
for (index = 0; index <ASSOCIATE_ENTRY_NUM; index++)
{
while (pLoopAdapter) {
for (index = 0; index <ASSOCIATE_ENTRY_NUM; index++) {
ODM_CmnInfoPtrArrayHook(pDM_OutSrc, ODM_CMNINFO_STA_STATUS, TotalAssocEntryNum+index, &pLoopAdapter->MgntInfo.AsocEntry[index]);
pLoopAdapter->MgntInfo.AsocEntry[index].MultiPortStationIdx = TotalAssocEntryNum+index;
}
TotalAssocEntryNum+= index;
if(IS_HARDWARE_TYPE_8188E((pDM_Odm->Adapter)))
if (IS_HARDWARE_TYPE_8188E((pDM_Odm->Adapter)))
pLoopAdapter->RASupport = TRUE;
adaptercount += 1;
RT_TRACE(COMP_INIT, DBG_LOUD, ("adaptercount=%d\n", adaptercount));
@ -2191,8 +2162,7 @@ void odm_dtc(PDM_ODM_T pDM_Odm)
if (DTC_BASE < pDM_Odm->RSSI_Min) {
/* need to decade the CTS TX power */
sign = 1;
for (i=0;i<ARRAY_SIZE(dtc_table_down);i++)
{
for (i=0;i<ARRAY_SIZE(dtc_table_down);i++) {
if ((dtc_table_down[i] >= pDM_Odm->RSSI_Min) || (dtc_steps >= 6))
break;
else
@ -2200,13 +2170,11 @@ void odm_dtc(PDM_ODM_T pDM_Odm)
}
}
#if 0
else if (DTC_DWN_BASE > pDM_Odm->RSSI_Min)
{
else if (DTC_DWN_BASE > pDM_Odm->RSSI_Min) {
/* needs to increase the CTS TX power */
sign = 0;
dtc_steps = 1;
for (i=0;i<ARRAY_SIZE(dtc_table_up);i++)
{
for (i=0;i<ARRAY_SIZE(dtc_table_up);i++) {
if ((dtc_table_up[i] <= pDM_Odm->RSSI_Min) || (dtc_steps>=10))
break;
else
@ -2241,21 +2209,19 @@ odm_UpdatePowerTrainingState(
pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable;
u4Byte score = 0;
if(!(pDM_Odm->SupportAbility & ODM_BB_PWR_TRAIN))
if (!(pDM_Odm->SupportAbility & ODM_BB_PWR_TRAIN))
return;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState()============>\n"));
pDM_Odm->bChangeState = FALSE;
// Debug command
if(pDM_Odm->ForcePowerTrainingState)
{
if(pDM_Odm->ForcePowerTrainingState == 1 && !pDM_Odm->bDisablePowerTraining)
{
if (pDM_Odm->ForcePowerTrainingState) {
if (pDM_Odm->ForcePowerTrainingState == 1 && !pDM_Odm->bDisablePowerTraining) {
pDM_Odm->bChangeState = TRUE;
pDM_Odm->bDisablePowerTraining = TRUE;
}
else if(pDM_Odm->ForcePowerTrainingState == 2 && pDM_Odm->bDisablePowerTraining)
else if (pDM_Odm->ForcePowerTrainingState == 2 && pDM_Odm->bDisablePowerTraining)
{
pDM_Odm->bChangeState = TRUE;
pDM_Odm->bDisablePowerTraining = FALSE;
@ -2269,12 +2235,11 @@ odm_UpdatePowerTrainingState(
return;
}
if(!pDM_Odm->bLinked)
if (!pDM_Odm->bLinked)
return;
// First connect
if((pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE))
{
if ((pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0 == FALSE)) {
pDM_Odm->PT_score = 0;
pDM_Odm->bChangeState = TRUE;
pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM = 0;
@ -2284,21 +2249,19 @@ odm_UpdatePowerTrainingState(
}
// Compute score
if(pDM_Odm->NHM_cnt_0 >= 215)
if (pDM_Odm->NHM_cnt_0 >= 215)
score = 2;
else if(pDM_Odm->NHM_cnt_0 >= 190)
else if (pDM_Odm->NHM_cnt_0 >= 190)
score = 1; // unknow state
else
{
else {
u4Byte RX_Pkt_Cnt;
RX_Pkt_Cnt = (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM) + (u4Byte)(pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK);
if((FalseAlmCnt->Cnt_CCA_all > 31 && RX_Pkt_Cnt > 31) && (FalseAlmCnt->Cnt_CCA_all >= RX_Pkt_Cnt))
{
if((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 1)) <= FalseAlmCnt->Cnt_CCA_all)
if ((FalseAlmCnt->Cnt_CCA_all > 31 && RX_Pkt_Cnt > 31) && (FalseAlmCnt->Cnt_CCA_all >= RX_Pkt_Cnt)) {
if ((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 1)) <= FalseAlmCnt->Cnt_CCA_all)
score = 0;
else if((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 2)) <= FalseAlmCnt->Cnt_CCA_all)
else if ((RX_Pkt_Cnt + (RX_Pkt_Cnt >> 2)) <= FalseAlmCnt->Cnt_CCA_all)
score = 1;
else
score = 2;
@ -2318,20 +2281,16 @@ odm_UpdatePowerTrainingState(
pDM_Odm->PT_score, score));
// Mode decision
if(score == 2)
{
if(pDM_Odm->bDisablePowerTraining)
{
if (score == 2) {
if (pDM_Odm->bDisablePowerTraining) {
pDM_Odm->bChangeState = TRUE;
pDM_Odm->bDisablePowerTraining = FALSE;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Change state\n"));
}
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Enable Power Training\n"));
}
else if(score == 0)
{
if(!pDM_Odm->bDisablePowerTraining)
{
else if (score == 0) {
if (!pDM_Odm->bDisablePowerTraining) {
pDM_Odm->bChangeState = TRUE;
pDM_Odm->bDisablePowerTraining = TRUE;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RA_MASK, ODM_DBG_LOUD,("odm_UpdatePowerTrainingState(): Change state\n"));
@ -2406,10 +2365,8 @@ phydm_NoisyDetection(
else if( Total_FA_Cnt*16>=Total_CCA_Cnt*1 ) // 6.25%
*/
for(i=0;i<=16;i++)
{
if( Total_FA_Cnt*16>=Total_CCA_Cnt*(16-i) )
{
for (i=0;i<=16;i++) {
if ( Total_FA_Cnt*16>=Total_CCA_Cnt*(16-i) ) {
Score = 16-i;
break;
}

0
hal/phydm/phydm_rxhp.c Executable file → Normal file
View File

0
hal/phydm/phydm_rxhp.h Executable file → Normal file
View File

View File

@ -475,7 +475,3 @@ static RT_CHANNEL_PLAN_NEW RtChnlPlan[] =
};
#endif

View File

@ -693,7 +693,3 @@ typedef struct _RT_CHANNEL_PLAN_NEW
#endif // __RT_CHANNELPLAN_H__

View File

@ -309,7 +309,6 @@
#endif /* !CONFIG_BT_COEXIST */
#ifdef CONFIG_USB_TX_AGGREGATION
/* #define CONFIG_TX_EARLY_MODE */
#endif
@ -347,12 +346,11 @@
/* #define DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED "jeff-ap" */
/* #define DBG_SHOW_MCUFWDL_BEFORE_51_ENABLE */
/* #define DBG_ROAMING_TEST */
/* #define DBG_HAL_INIT_PROFILING */
/*#define DBG_MEMORY_LEAK*/
/* #define DBG_MEMORY_LEAK*/
#define DBG_RX_DFRAME_RAW_DATA
#define CONFIG_USE_EXTERNAL_POWER /* NOT USB2.0 power, so no 500mA power constraint, no limitation in Power by Rate */
/* #define CONFIG_USE_EXTERNAL_POWER */ /* NOT USB2.0 power, so no 500mA power constraint, no limitation in Power by Rate */