From: Jes Sorensen Date: Wed, 9 Apr 2014 21:20:43 +0000 (+0200) Subject: staging: rtl8723au: Eliminate HW_VAR_DM_FUNC_{SET,CLR} X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=585eefb45398abdc9d330785e2ef7e084655f1ff;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Eliminate HW_VAR_DM_FUNC_{SET,CLR} Unroll two layers of mux/demux in the call chain for each. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index f55e86d8be65..c18eee9222ce 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -723,7 +723,8 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) /* disable dynamic functions, such as high power, DIG */ /* turn on all dynamic functions */ - Switch_DM_Func23a(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); + rtl8723a_odm_support_ability_set(padapter, + DYNAMIC_ALL_FUNC_ENABLE); } /* set channel, bwmode */ p = rtw_get_ie23a((pnetwork->IEs + sizeof(struct ndis_802_11_fixed_ies)), diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 316200ea0c50..94ba6ef8f24b 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -7719,7 +7719,6 @@ void site_survey23a(struct rtw_adapter *padapter) rtl8723a_set_initial_gain(padapter, 0xff); /* turn on dynamic functions */ 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 + msecs_to_jiffies(pwdinfo->listen_dwell * 100)); @@ -7748,7 +7747,6 @@ void site_survey23a(struct rtw_adapter *padapter) rtl8723a_set_initial_gain(padapter, 0xff); /* turn on dynamic functions */ rtl8723a_odm_support_ability_restore(padapter); - /* Switch_DM_Func23a(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ if (is_client_associated_to_ap23a(padapter) == true) { @@ -8705,7 +8703,7 @@ void mlmeext_joinbss_event_callback23a(struct rtw_adapter *padapter, int join_re } /* turn on dynamic functions */ - Switch_DM_Func23a(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); + rtl8723a_odm_support_ability_set(padapter, DYNAMIC_ALL_FUNC_ENABLE); /* update IOT-releated issue */ update_IOT_info23a(padapter); @@ -9225,7 +9223,8 @@ u8 createbss_hdl23a(struct rtw_adapter *padapter, u8 *pbuf) /* disable dynamic functions, such as high power, DIG */ rtl8723a_odm_support_ability_backup(padapter); - Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false); + rtl8723a_odm_support_ability_clr(padapter, + DYNAMIC_FUNC_DISABLE); /* cancel link timer */ del_timer_sync(&pmlmeext->link_timer); @@ -9355,8 +9354,6 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, u8 *pbuf) i += (pIE->Length + 2); } - /* disable dynamic functions, such as high power, DIG */ - /* Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false); */ hw_var_set_bssid(padapter, pmlmeinfo->network.MacAddress); hw_var_set_mlme_join(padapter, 0); @@ -9537,7 +9534,8 @@ u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, u8 *pbuf) (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) { /* disable dynamic functions, such as high power, DIG */ rtl8723a_odm_support_ability_backup(padapter); - Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false); + rtl8723a_odm_support_ability_clr(padapter, + DYNAMIC_FUNC_DISABLE); /* config the initial gain under scaning, need to write the BB registers */ diff --git a/drivers/staging/rtl8723au/core/rtw_sreset.c b/drivers/staging/rtl8723au/core/rtw_sreset.c index dd2a6f18f7d7..5bf7beb6d19c 100644 --- a/drivers/staging/rtl8723au/core/rtw_sreset.c +++ b/drivers/staging/rtl8723au/core/rtw_sreset.c @@ -140,9 +140,6 @@ static void sreset_restore_network_station(struct rtw_adapter *padapter) set_channel_bwmode23a(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - /* disable dynamic functions, such as high power, DIG */ - /* Switch_DM_Func23a(padapter, DYNAMIC_FUNC_DISABLE, false); */ - hw_var_set_bssid(padapter, pmlmeinfo->network.MacAddress); hw_var_set_mlme_join(padapter, 0); diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 809d4167731f..227280230dee 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -283,14 +283,6 @@ void Update23aTblForSoftAP(u8 *bssrateset, u32 bssratelen) } } -void Switch_DM_Func23a(struct rtw_adapter *padapter, unsigned long mode, u8 enable) -{ - if (enable == true) - rtw_hal_set_hwreg23a(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode)); - else - rtw_hal_set_hwreg23a(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode)); -} - void Set_MSR23a(struct rtw_adapter *padapter, u8 type) { rtl8723a_set_media_status(padapter, type); @@ -1485,15 +1477,15 @@ void update_IOT_info23a(struct rtw_adapter *padapter) pmlmeinfo->turboMode_cts2self = 0; pmlmeinfo->turboMode_rtsen = 1; /* disable high power */ - Switch_DM_Func23a(padapter, ~DYNAMIC_BB_DYNAMIC_TXPWR, - false); + rtl8723a_odm_support_ability_clr(padapter, (u32) + ~DYNAMIC_BB_DYNAMIC_TXPWR); break; case HT_IOT_PEER_REALTEK: /* rtw_write16(padapter, 0x4cc, 0xffff); */ /* rtw_write16(padapter, 0x546, 0x01c0); */ /* disable high power */ - Switch_DM_Func23a(padapter, ~DYNAMIC_BB_DYNAMIC_TXPWR, - false); + rtl8723a_odm_support_ability_clr(padapter, (u32) + ~DYNAMIC_BB_DYNAMIC_TXPWR); break; default: pmlmeinfo->turboMode_cts2self = 0; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 79e63bfb0b2e..62089f846838 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -3142,13 +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_SET: - rtl8723a_odm_support_ability_set(padapter, *val32); - break; - - case HW_VAR_DM_FUNC_CLR: - rtl8723a_odm_support_ability_clr(padapter, *val32); - break; case HW_VAR_EFUSE_BYTES: pHalData->EfuseUsedBytes = *((u16 *) val); diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 2218032ef617..2675fc09fecf 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -40,8 +40,6 @@ enum HW_VARIABLES { HW_VAR_TXPAUSE, HW_VAR_RF_TYPE, HW_VAR_DM_FLAG, - HW_VAR_DM_FUNC_SET, - HW_VAR_DM_FUNC_CLR, HW_VAR_CAM_READ, HW_VAR_FWLPS_RF_ON, HW_VAR_TDLS_WRCR, diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h index 53b2d0a34734..7729b2be25ae 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 Switch_DM_Func23a(struct rtw_adapter *padapter, unsigned long mode, u8 enable); - void Set_MSR23a(struct rtw_adapter *padapter, u8 type); u8 rtw_get_oper_ch23a(struct rtw_adapter *adapter);