Commit 0cee8101 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Eliminate HW_VAR_FWLPS_RF_ON usage

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2370e83
...@@ -386,12 +386,11 @@ s32 LPS_RF_ON_check23a(struct rtw_adapter *padapter, u32 delay_ms) ...@@ -386,12 +386,11 @@ s32 LPS_RF_ON_check23a(struct rtw_adapter *padapter, u32 delay_ms)
while (1) while (1)
{ {
rtw23a_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake); bAwake = rtl8723a_get_fwlps_rf_on(padapter);
if (true == bAwake) if (bAwake == true)
break; break;
if (true == padapter->bSurpriseRemoved) if (padapter->bSurpriseRemoved == true) {
{
err = -2; err = -2;
DBG_8723A("%s: device surprise removed!!\n", __func__); DBG_8723A("%s: device surprise removed!!\n", __func__);
break; break;
......
...@@ -896,3 +896,26 @@ u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter) ...@@ -896,3 +896,26 @@ u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter)
return pHalData->rf_type; return pHalData->rf_type;
} }
bool rtl8723a_get_fwlps_rf_on(struct rtw_adapter *padapter)
{
bool retval;
u32 valRCR;
/* When we halt NIC, we should check if FW LPS is leave. */
if ((padapter->bSurpriseRemoved == true) ||
(padapter->pwrctrlpriv.rf_pwrstate == rf_off)) {
/* If it is in HW/SW Radio OFF or IPS state, we do
not check Fw LPS Leave, because Fw is unload. */
retval = true;
} else {
valRCR = rtw_read32(padapter, REG_RCR);
if (valRCR & 0x00070000)
retval = false;
else
retval = true;
}
return retval;
}
...@@ -217,7 +217,7 @@ rtl8723a_HalDmWatchDog( ...@@ -217,7 +217,7 @@ rtl8723a_HalDmWatchDog(
goto skip_dm; goto skip_dm;
bFwCurrentInPSMode = Adapter->pwrctrlpriv.bFwCurrentInPSMode; bFwCurrentInPSMode = Adapter->pwrctrlpriv.bFwCurrentInPSMode;
rtw23a_hal_get_hwreg(Adapter, HW_VAR_FWLPS_RF_ON, (u8 *)(&bFwPSAwake)); bFwPSAwake = rtl8723a_get_fwlps_rf_on(Adapter);
#ifdef CONFIG_8723AU_P2P #ifdef CONFIG_8723AU_P2P
/* Fw is under p2p powersaving mode, driver should stop dynamic mechanism. */ /* Fw is under p2p powersaving mode, driver should stop dynamic mechanism. */
......
...@@ -3135,27 +3135,6 @@ void hw_var_set_mlme_join(struct rtw_adapter *padapter, u8 type) ...@@ -3135,27 +3135,6 @@ void hw_var_set_mlme_join(struct rtw_adapter *padapter, u8 type)
void GetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val) void GetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
{ {
switch (variable) { switch (variable) {
case HW_VAR_FWLPS_RF_ON:
{
/* When we halt NIC, we should check if FW LPS is leave. */
u32 valRCR;
if ((padapter->bSurpriseRemoved == true) ||
(padapter->pwrctrlpriv.rf_pwrstate == rf_off)) {
/* If it is in HW/SW Radio OFF or IPS state, we do
not check Fw LPS Leave, because Fw is unload. */
*val = true;
} else {
valRCR = rtw_read32(padapter, REG_RCR);
valRCR &= 0x00070000;
if (valRCR)
*val = false;
else
*val = true;
}
}
break;
case HW_VAR_CHK_HI_QUEUE_EMPTY: case HW_VAR_CHK_HI_QUEUE_EMPTY:
*val = *val =
((rtw_read32(padapter, REG_HGQ_INFORMATION) & 0x0000ff00) == ((rtw_read32(padapter, REG_HGQ_INFORMATION) & 0x0000ff00) ==
......
...@@ -208,5 +208,6 @@ void rtl8723a_odm_support_ability_clr(struct rtw_adapter *padapter, u32 val); ...@@ -208,5 +208,6 @@ void rtl8723a_odm_support_ability_clr(struct rtw_adapter *padapter, u32 val);
void rtl8723a_set_rpwm(struct rtw_adapter *padapter, u8 val); void rtl8723a_set_rpwm(struct rtw_adapter *padapter, u8 val);
u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter); u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter);
bool rtl8723a_get_fwlps_rf_on(struct rtw_adapter *padapter);
#endif /* __HAL_COMMON_H__ */ #endif /* __HAL_COMMON_H__ */
...@@ -38,7 +38,6 @@ enum _CHIP_TYPE { ...@@ -38,7 +38,6 @@ enum _CHIP_TYPE {
enum HW_VARIABLES { enum HW_VARIABLES {
HW_VAR_INIT_RTS_RATE, HW_VAR_INIT_RTS_RATE,
HW_VAR_CAM_READ, HW_VAR_CAM_READ,
HW_VAR_FWLPS_RF_ON,
HW_VAR_TDLS_WRCR, HW_VAR_TDLS_WRCR,
HW_VAR_TDLS_INIT_CH_SEN, HW_VAR_TDLS_INIT_CH_SEN,
HW_VAR_TDLS_RS_RCR, HW_VAR_TDLS_RS_RCR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment