mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
staging: r8188eu: remove SetHwReg8188EU()
Remove the case HW_VAR_CORRECT_TSF from SetHwReg8188EU() and move the functionality to the function that calls SetHwReg8188EU() with HW_VAR_CORRECT_TSF. SetHwReg8188EU() is empty now and we can finally remove it. Tested-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7136ef70a0
commit
b9ad667059
3 changed files with 33 additions and 52 deletions
|
@ -445,7 +445,39 @@ static void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe)
|
|||
|
||||
static void correct_TSF(struct adapter *padapter)
|
||||
{
|
||||
SetHwReg8188EU(padapter, HW_VAR_CORRECT_TSF, NULL);
|
||||
u8 reg;
|
||||
int res;
|
||||
u64 tsf;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue,
|
||||
pmlmeinfo->bcn_interval * 1024) - 1024; /* us */
|
||||
|
||||
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) ||
|
||||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE))
|
||||
rtw_stop_tx_beacon(padapter);
|
||||
|
||||
/* disable related TSF function */
|
||||
res = rtw_read8(padapter, REG_BCN_CTRL, ®);
|
||||
if (res)
|
||||
return;
|
||||
|
||||
rtw_write8(padapter, REG_BCN_CTRL, reg & (~BIT(3)));
|
||||
|
||||
rtw_write32(padapter, REG_TSFTR, tsf);
|
||||
rtw_write32(padapter, REG_TSFTR + 4, tsf >> 32);
|
||||
|
||||
/* enable related TSF function */
|
||||
res = rtw_read8(padapter, REG_BCN_CTRL, ®);
|
||||
if (res)
|
||||
return;
|
||||
|
||||
rtw_write8(padapter, REG_BCN_CTRL, reg | BIT(3));
|
||||
|
||||
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) ||
|
||||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE))
|
||||
rtw_resume_tx_beacon(padapter);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -963,51 +963,6 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
|||
kfree(efuse_buf);
|
||||
}
|
||||
|
||||
void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
{
|
||||
u8 reg;
|
||||
int res;
|
||||
|
||||
switch (variable) {
|
||||
case HW_VAR_CORRECT_TSF:
|
||||
{
|
||||
u64 tsf;
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
tsf = pmlmeext->TSFValue - do_div(pmlmeext->TSFValue,
|
||||
pmlmeinfo->bcn_interval * 1024) - 1024; /* us */
|
||||
|
||||
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE))
|
||||
rtw_stop_tx_beacon(Adapter);
|
||||
|
||||
/* disable related TSF function */
|
||||
res = rtw_read8(Adapter, REG_BCN_CTRL, ®);
|
||||
if (res)
|
||||
return;
|
||||
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, reg & (~BIT(3)));
|
||||
|
||||
rtw_write32(Adapter, REG_TSFTR, tsf);
|
||||
rtw_write32(Adapter, REG_TSFTR + 4, tsf >> 32);
|
||||
|
||||
/* enable related TSF function */
|
||||
res = rtw_read8(Adapter, REG_BCN_CTRL, ®);
|
||||
if (res)
|
||||
return;
|
||||
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, reg | BIT(3));
|
||||
|
||||
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE))
|
||||
rtw_resume_tx_beacon(Adapter);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
|
||||
{
|
||||
u8 init_rate = 0;
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
#include "drv_types.h"
|
||||
#include "Hal8188EPhyCfg.h"
|
||||
|
||||
enum hw_variables {
|
||||
HW_VAR_CORRECT_TSF,
|
||||
};
|
||||
|
||||
typedef s32 (*c2h_id_filter)(u8 id);
|
||||
|
||||
void rtl8188eu_interface_configure(struct adapter *adapt);
|
||||
|
@ -32,8 +28,6 @@ int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter,
|
|||
|
||||
unsigned int rtl8188eu_inirp_init(struct adapter *Adapter);
|
||||
|
||||
void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val);
|
||||
|
||||
uint rtw_hal_init(struct adapter *padapter);
|
||||
uint rtw_hal_deinit(struct adapter *padapter);
|
||||
void rtw_hal_stop(struct adapter *padapter);
|
||||
|
|
Loading…
Reference in a new issue