staging: rtl8723au: Eliminate HW_VAR_DM_FUNC_OP calls
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Apr 2014 21:20:42 +0000 (23:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 15:29:08 +0000 (08:29 -0700)
Demux the code and remove multiple call layers

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_wlan_util.c
drivers/staging/rtl8723au/hal/hal_com.c
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/include/hal_com.h
drivers/staging/rtl8723au/include/hal_intf.h
drivers/staging/rtl8723au/include/rtw_mlme_ext.h

index b0c082039c1f9a87b73a9b37fab43ee20dffec71..316200ea0c50fdc0de76cc912a600c5cd66fc86f 100644 (file)
@@ -7718,7 +7718,7 @@ void site_survey23a(struct rtw_adapter *padapter)
                        /* restore RX GAIN */
                        rtl8723a_set_initial_gain(padapter, 0xff);
                        /* turn on dynamic functions */
-                       Restore_DM_Func_Flag23a(padapter);
+                       rtl8723a_odm_support_ability_restore(padapter);
                        /* Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, true); */
 
                        mod_timer(&pwdinfo->find_phase_timer, jiffies +
@@ -7747,7 +7747,7 @@ void site_survey23a(struct rtw_adapter *padapter)
                        /* restore RX GAIN */
                        rtl8723a_set_initial_gain(padapter, 0xff);
                        /* turn on dynamic functions */
-                       Restore_DM_Func_Flag23a(padapter);
+                       rtl8723a_odm_support_ability_restore(padapter);
                        /* Switch_DM_Func23a(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */
 
                        if (is_client_associated_to_ap23a(padapter) == true)
@@ -9223,7 +9223,8 @@ u8 createbss_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
                pmlmeinfo->candidate_tid_bitmap = 0;
 
                /* disable dynamic functions, such as high power, DIG */
-               Save_DM_Func_Flag23a(padapter);
+               rtl8723a_odm_support_ability_backup(padapter);
+
                Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false);
 
                /* cancel link timer */
@@ -9535,7 +9536,7 @@ u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
        if ((pmlmeext->sitesurvey_res.state == SCAN_START) ||
            (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) {
                /* disable dynamic functions, such as high power, DIG */
-               Save_DM_Func_Flag23a(padapter);
+               rtl8723a_odm_support_ability_backup(padapter);
                Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false);
 
                /* config the initial gain under scaning, need to
index 91bb7a451fbac389af81c37cade8b5be5057d599..809d4167731f27911ab2223928015f07e0863e48 100644 (file)
@@ -283,19 +283,6 @@ void Update23aTblForSoftAP(u8 *bssrateset, u32 bssratelen)
        }
 }
 
-void Save_DM_Func_Flag23a(struct rtw_adapter *padapter)
-{
-       u8      bSaveFlag = true;
-
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
-}
-
-void Restore_DM_Func_Flag23a(struct rtw_adapter *padapter)
-{
-       u8      bSaveFlag = false;
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
-}
-
 void Switch_DM_Func23a(struct rtw_adapter *padapter, unsigned long mode, u8 enable)
 {
        if (enable == true)
index 5d4e51c493e687ba8dcd2680a609b52bcfe7abc5..66adec743a8554f552d066420e04adf747bc0d23 100644 (file)
@@ -872,16 +872,18 @@ void rtl8723a_odm_support_ability_write(struct rtw_adapter *padapter, u32 val)
        pHalData->odmpriv.SupportAbility = val;
 }
 
-void rtl8723a_odm_support_ability_backup(struct rtw_adapter *padapter, u8 val)
+void rtl8723a_odm_support_ability_restore(struct rtw_adapter *padapter)
 {
        struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
 
-       if (val)        /*  save dm flag */
-               pHalData->odmpriv.BK_SupportAbility =
-                       pHalData->odmpriv.SupportAbility;
-       else            /*  restore dm flag */
-               pHalData->odmpriv.SupportAbility =
-                       pHalData->odmpriv.BK_SupportAbility;
+       pHalData->odmpriv.SupportAbility = pHalData->odmpriv.BK_SupportAbility;
+}
+
+void rtl8723a_odm_support_ability_backup(struct rtw_adapter *padapter)
+{
+       struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
+
+       pHalData->odmpriv.BK_SupportAbility = pHalData->odmpriv.SupportAbility;
 }
 
 void rtl8723a_odm_support_ability_set(struct rtw_adapter *padapter, u32 val)
index 8d7f124df49730f8e6279c9c998daff7155184dc..79e63bfb0b2eec2c1d3b9fb7c4b98935eca03fa7 100644 (file)
@@ -3142,9 +3142,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
        case HW_VAR_DM_FLAG:
                rtl8723a_odm_support_ability_write(padapter, *val32);
                break;
-       case HW_VAR_DM_FUNC_OP:
-               rtl8723a_odm_support_ability_backup(padapter, *val);
-               break;
        case HW_VAR_DM_FUNC_SET:
                rtl8723a_odm_support_ability_set(padapter, *val32);
                break;
index 9d036132ac4f446577ed9f9bb6f577289132980f..e8774fc602c0a7b1eb19839a67a8567b952b5882 100644 (file)
@@ -202,7 +202,8 @@ void rtl8723a_set_nav_upper(struct rtw_adapter *padapter, u32 usNavUpper);
 void rtl8723a_set_initial_gain(struct rtw_adapter *padapter, u32 rx_gain);
 
 void rtl8723a_odm_support_ability_write(struct rtw_adapter *padapter, u32 val);
-void rtl8723a_odm_support_ability_backup(struct rtw_adapter *padapter, u8 val);
+void rtl8723a_odm_support_ability_backup(struct rtw_adapter *padapter);
+void rtl8723a_odm_support_ability_restore(struct rtw_adapter *padapter);
 void rtl8723a_odm_support_ability_set(struct rtw_adapter *padapter, u32 val);
 void rtl8723a_odm_support_ability_clr(struct rtw_adapter *padapter, u32 val);
 
index 9c94b13b332947c6011ce499ade73de558ce7a9b..2218032ef6174609db1beb99a8f61d7cb2b4f541 100644 (file)
@@ -40,7 +40,6 @@ enum HW_VARIABLES {
        HW_VAR_TXPAUSE,
        HW_VAR_RF_TYPE,
        HW_VAR_DM_FLAG,
-       HW_VAR_DM_FUNC_OP,
        HW_VAR_DM_FUNC_SET,
        HW_VAR_DM_FUNC_CLR,
        HW_VAR_CAM_READ,
index b61fc95b1037946f284dbf4f2e5a993c2dbc04eb..53b2d0a34734cfab076d53dcd3f5368ab9c39524 100644 (file)
@@ -474,8 +474,6 @@ void get_rate_set23a(struct rtw_adapter *padapter, unsigned char *pbssrate,
 void UpdateBrateTbl23a(struct rtw_adapter *padapter,u8 *mBratesOS);
 void Update23aTblForSoftAP(u8 *bssrateset, u32 bssratelen);
 
-void Save_DM_Func_Flag23a(struct rtw_adapter *padapter);
-void Restore_DM_Func_Flag23a(struct rtw_adapter *padapter);
 void Switch_DM_Func23a(struct rtw_adapter *padapter, unsigned long mode, u8 enable);
 
 void Set_MSR23a(struct rtw_adapter *padapter, u8 type);