staging: rtl8723au: Reduce wrapper layers around hal_{de, }init() calls

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-07-21 11:25:07 +02:00 committed by Greg Kroah-Hartman
parent d0b39f8742
commit dc20d1da78
4 changed files with 19 additions and 45 deletions

View File

@ -534,7 +534,7 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter *pAdapter)
void _ps_open_RF23a(struct rtw_adapter *padapter);
static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
int rtl8723au_hal_init(struct rtw_adapter *Adapter)
{
u8 val8 = 0;
u32 boundary;
@ -545,6 +545,8 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
unsigned long init_start_time = jiffies;
Adapter->hw_init_completed = false;
if (Adapter->pwrctrlpriv.bkeepfwalive) {
_ps_open_RF23a(Adapter);
@ -796,6 +798,13 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
rtl8723au_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12));
exit:
if (status == _SUCCESS) {
Adapter->hw_init_completed = true;
if (Adapter->registrypriv.notch_filter == 1)
rtl8723a_notch_filter(Adapter, 1);
}
DBG_8723A("%s in %dms\n", __func__,
jiffies_to_msecs(jiffies - init_start_time));
return status;
@ -1105,7 +1114,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter)
rtl8723au_write8(Adapter, REG_RSV_CTRL, 0x0e);
}
static int rtl8723au_hal_deinit(struct rtw_adapter *padapter)
int rtl8723au_hal_deinit(struct rtw_adapter *padapter)
{
DBG_8723A("==> %s\n", __func__);
@ -1118,6 +1127,8 @@ static int rtl8723au_hal_deinit(struct rtw_adapter *padapter)
/* IC. Accord to johnny's opinion, only RU need the support. */
CardDisableRTL8723U(padapter);
padapter->hw_init_completed = false;
return _SUCCESS;
}
@ -1543,40 +1554,3 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
/* set correct initial date rate for each mac_id */
pdmpriv->INIDATA_RATE[mac_id] = init_rate;
}
int rtw_hal_init23a(struct rtw_adapter *padapter)
{
int status;
padapter->hw_init_completed = false;
status = rtl8723au_hal_init(padapter);
if (status == _SUCCESS) {
padapter->hw_init_completed = true;
if (padapter->registrypriv.notch_filter == 1)
rtl8723a_notch_filter(padapter, 1);
} else {
padapter->hw_init_completed = false;
DBG_8723A("rtw_hal_init23a: hal__init fail\n");
}
RT_TRACE(_module_hal_init_c_, _drv_err_,
("-rtl871x_hal_init:status = 0x%x\n", status));
return status;
}
int rtw_hal_deinit23a(struct rtw_adapter *padapter)
{
int status;
status = rtl8723au_hal_deinit(padapter);
if (status == _SUCCESS)
padapter->hw_init_completed = false;
else
DBG_8723A("\n rtw_hal_deinit23a: hal_init fail\n");
return status;
}

View File

@ -103,8 +103,8 @@ void rtw_hal_def_value_init23a(struct rtw_adapter *padapter);
int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal);
int rtw_resume_process23a(struct rtw_adapter *padapter);
int rtw_hal_init23a(struct rtw_adapter *padapter);
int rtw_hal_deinit23a(struct rtw_adapter *padapter);
int rtl8723au_hal_init(struct rtw_adapter *padapter);
int rtl8723au_hal_deinit(struct rtw_adapter *padapter);
void rtw_hal_stop(struct rtw_adapter *padapter);
void rtw_hal_update_ra_mask23a(struct sta_info *psta, u8 rssi_level);

View File

@ -666,7 +666,7 @@ int netdev_open23a(struct net_device *pnetdev)
padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false;
status = rtw_hal_init23a(padapter);
status = rtl8723au_hal_init(padapter);
if (status == _FAIL) {
RT_TRACE(_module_os_intfs_c_, _drv_err_,
("rtl871x_hal_init(): Can't init h/w!\n"));
@ -735,7 +735,7 @@ static int ips_netdrv_open(struct rtw_adapter *padapter)
padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false;
status = rtw_hal_init23a(padapter);
status = rtl8723au_hal_init(padapter);
if (status == _FAIL) {
RT_TRACE(_module_os_intfs_c_, _drv_err_,
("ips_netdrv_open(): Can't init h/w!\n"));
@ -800,7 +800,7 @@ void rtw_ips_dev_unload23a(struct rtw_adapter *padapter)
/* s5. */
if (!padapter->bSurpriseRemoved)
rtw_hal_deinit23a(padapter);
rtl8723au_hal_deinit(padapter);
}
int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal)

View File

@ -303,7 +303,7 @@ static void rtw_dev_unload(struct rtw_adapter *padapter)
/* s5. */
if (!padapter->bSurpriseRemoved) {
rtw_hal_deinit23a(padapter);
rtl8723au_hal_deinit(padapter);
padapter->bSurpriseRemoved = true;
}
padapter->bup = false;