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 <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2014-04-09 23:20:43 +02:00 committed by Greg Kroah-Hartman
parent a945bf3012
commit 585eefb453
7 changed files with 11 additions and 34 deletions

View file

@ -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)),

View file

@ -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 */

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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,

View 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 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);