From: Jes Sorensen Date: Wed, 9 Apr 2014 21:20:42 +0000 (+0200) Subject: staging: rtl8723au: Eliminate HW_VAR_DM_FUNC_OP calls X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a945bf30129d60659d4f983db93d7b7dc08c8571;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Eliminate HW_VAR_DM_FUNC_OP calls Demux the code and remove multiple call layers Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index b0c082039c1f..316200ea0c50 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -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 diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 91bb7a451fba..809d4167731f 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -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) diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index 5d4e51c493e6..66adec743a85 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -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) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 8d7f124df497..79e63bfb0b2e 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -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; diff --git a/drivers/staging/rtl8723au/include/hal_com.h b/drivers/staging/rtl8723au/include/hal_com.h index 9d036132ac4f..e8774fc602c0 100644 --- a/drivers/staging/rtl8723au/include/hal_com.h +++ b/drivers/staging/rtl8723au/include/hal_com.h @@ -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); diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 9c94b13b3329..2218032ef617 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -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, diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h index b61fc95b1037..53b2d0a34734 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h @@ -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);