staging: rtl8723au: Eliminate HW_VAR_FWLPS_RF_ON usage
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Apr 2014 21:20:54 +0000 (23:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 15:29:13 +0000 (08:29 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_pwrctrl.c
drivers/staging/rtl8723au/hal/hal_com.c
drivers/staging/rtl8723au/hal/rtl8723a_dm.c
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/include/hal_com.h
drivers/staging/rtl8723au/include/hal_intf.h

index da6645e9b9fc1e37b9e4235cc4079f1e51ae0a73..07c63246ca319893c127fe031406fdbe073999cb 100644 (file)
@@ -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;
index c41781e6a5e52b446985e50dfc345b7e07ddb1ab..7b00dbadf1054001d0cbb541b389c6f2b7d0bb1a 100644 (file)
@@ -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;
+}
index f204ab1714e7f921184cb0400248a8635cd7771f..b3907ca2e96bc8087281ea4f05094e5b6cccbcba 100644 (file)
@@ -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. */
index b3d398a75512198cd63024b521395f87423c01a6..f9cf4c88f7ffc6f631dbc05dcc5a3a8a85b49ca3 100644 (file)
@@ -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) ==
index d2e372c302f7eb19ea4f9f0084187b8166446be4..84e472e671d1d4e2a87a2e1c944dd645be93657b 100644 (file)
@@ -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__ */
index 5bdf34b0e3d6a9e685b9a1974281954c84471ccb..35bedf984ba91fe0ca0deb7a41694fb6c091b821 100644 (file)
@@ -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,