From: Jes Sorensen Date: Wed, 9 Apr 2014 21:20:54 +0000 (+0200) Subject: staging: rtl8723au: Eliminate HW_VAR_FWLPS_RF_ON usage X-Git-Tag: next-20140428~14^2~471 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0cee8101d83bbc5cc3d8e44ab601e2fdb15cf887;p=karo-tx-linux.git staging: rtl8723au: Eliminate HW_VAR_FWLPS_RF_ON usage Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c index da6645e9b9fc..07c63246ca31 100644 --- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c @@ -386,12 +386,11 @@ s32 LPS_RF_ON_check23a(struct rtw_adapter *padapter, u32 delay_ms) while (1) { - rtw23a_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake); - if (true == bAwake) + bAwake = rtl8723a_get_fwlps_rf_on(padapter); + if (bAwake == true) break; - if (true == padapter->bSurpriseRemoved) - { + if (padapter->bSurpriseRemoved == true) { err = -2; DBG_8723A("%s: device surprise removed!!\n", __func__); break; diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index c41781e6a5e5..7b00dbadf105 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -896,3 +896,26 @@ u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter) 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; +} diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index f204ab1714e7..b3907ca2e96b 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -217,7 +217,7 @@ rtl8723a_HalDmWatchDog( goto skip_dm; 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 /* Fw is under p2p powersaving mode, driver should stop dynamic mechanism. */ diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index b3d398a75512..f9cf4c88f7ff 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -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) { 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: *val = ((rtw_read32(padapter, REG_HGQ_INFORMATION) & 0x0000ff00) == diff --git a/drivers/staging/rtl8723au/include/hal_com.h b/drivers/staging/rtl8723au/include/hal_com.h index d2e372c302f7..84e472e671d1 100644 --- a/drivers/staging/rtl8723au/include/hal_com.h +++ b/drivers/staging/rtl8723au/include/hal_com.h @@ -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); u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter); +bool rtl8723a_get_fwlps_rf_on(struct rtw_adapter *padapter); #endif /* __HAL_COMMON_H__ */ diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 5bdf34b0e3d6..35bedf984ba9 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -38,7 +38,6 @@ enum _CHIP_TYPE { enum HW_VARIABLES { HW_VAR_INIT_RTS_RATE, HW_VAR_CAM_READ, - HW_VAR_FWLPS_RF_ON, HW_VAR_TDLS_WRCR, HW_VAR_TDLS_INIT_CH_SEN, HW_VAR_TDLS_RS_RCR,