staging: rtl8723au: odm.c: Use rtl8723au_{read, write}32() for 32 bit register access
authorJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 5 Mar 2015 19:24:42 +0000 (14:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 01:12:02 +0000 (17:12 -0800)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/odm.c

index 7a5cff5431c71dcb203491badae69f61259cab23..5220a0b535a31594321092f423d976154ad00157 100644 (file)
@@ -714,28 +714,25 @@ void odm_DIG23a(struct rtw_adapter *adapter)
 
 void odm_FalseAlarmCounterStatistics23a(struct dm_odm_t *pDM_Odm)
 {
-       u32 ret_value;
+       struct rtw_adapter *adapter = pDM_Odm->Adapter;
        struct false_alarm_stats *FalseAlmCnt = &pDM_Odm->FalseAlmCnt;
+       u32 ret_value;
 
        /* hold ofdm counter */
-        /* hold page C counter */
+       /* hold page C counter */
        ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT(31), 1);
        /* hold page D counter */
        ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT(31), 1);
-       ret_value =
-               ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
+       ret_value = rtl8723au_read32(adapter, ODM_REG_OFDM_FA_TYPE1_11N);
        FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
        FalseAlmCnt->Cnt_SB_Search_fail = (ret_value & 0xffff0000)>>16;
-       ret_value =
-               ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
+       ret_value = rtl8723au_read32(adapter, ODM_REG_OFDM_FA_TYPE2_11N);
        FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
        FalseAlmCnt->Cnt_Parity_Fail = (ret_value & 0xffff0000)>>16;
-       ret_value =
-               ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
+       ret_value = rtl8723au_read32(adapter, ODM_REG_OFDM_FA_TYPE3_11N);
        FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
        FalseAlmCnt->Cnt_Crc8_fail = (ret_value & 0xffff0000)>>16;
-       ret_value =
-               ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
+       ret_value = rtl8723au_read32(adapter, ODM_REG_OFDM_FA_TYPE4_11N);
        FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
 
        FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail +
@@ -753,7 +750,7 @@ void odm_FalseAlarmCounterStatistics23a(struct dm_odm_t *pDM_Odm)
        ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_MSB_11N, bMaskByte3);
        FalseAlmCnt->Cnt_Cck_fail +=  (ret_value & 0xff) << 8;
 
-       ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11N, bMaskDWord);
+       ret_value = rtl8723au_read32(adapter, ODM_REG_CCK_CCA_CNT_11N);
        FalseAlmCnt->Cnt_CCK_CCA =
                ((ret_value&0xFF)<<8) | ((ret_value&0xFF00)>>8);
 
@@ -881,19 +878,19 @@ void odm_DynamicBBPowerSaving23a(struct dm_odm_t *pDM_Odm)
 void ODM_RF_Saving23a(struct dm_odm_t *pDM_Odm, u8 bForceInNormal)
 {
        struct dynamic_pwr_sav *pDM_PSTable = &pDM_Odm->DM_PSTable;
+       struct rtw_adapter *adapter = pDM_Odm->Adapter;
        u8 Rssi_Up_bound = 30;
        u8 Rssi_Low_bound = 25;
        if (pDM_PSTable->initialize == 0) {
 
-               pDM_PSTable->Reg874 = (ODM_GetBBReg(pDM_Odm, 0x874,
-                                                   bMaskDWord)&0x1CC000) >> 14;
+               pDM_PSTable->Reg874 =
+                       (rtl8723au_read32(adapter, 0x874) & 0x1CC000) >> 14;
                pDM_PSTable->RegC70 =
-                       (ODM_GetBBReg(pDM_Odm, 0xc70, bMaskDWord) & BIT(3)) >>3;
-               pDM_PSTable->Reg85C = (ODM_GetBBReg(pDM_Odm, 0x85c,
-                                                   bMaskDWord)&0xFF000000)>>24;
-               pDM_PSTable->RegA74 = (ODM_GetBBReg(pDM_Odm, 0xa74,
-                                                   bMaskDWord)&0xF000)>>12;
-               /* Reg818 = PHY_QueryBBReg(pAdapter, 0x818, bMaskDWord); */
+                       (rtl8723au_read32(adapter, 0xc70) & BIT(3)) >>3;
+               pDM_PSTable->Reg85C =
+                       (rtl8723au_read32(adapter, 0x85c) & 0xFF000000) >> 24;
+               pDM_PSTable->RegA74 =
+                       (rtl8723au_read32(adapter, 0xa74) & 0xF000) >> 12;
                pDM_PSTable->initialize = 1;
        }