Commit dc20d1da authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

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

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0b39f87
...@@ -534,7 +534,7 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter *pAdapter) ...@@ -534,7 +534,7 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter *pAdapter)
void _ps_open_RF23a(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; u8 val8 = 0;
u32 boundary; u32 boundary;
...@@ -545,6 +545,8 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) ...@@ -545,6 +545,8 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
unsigned long init_start_time = jiffies; unsigned long init_start_time = jiffies;
Adapter->hw_init_completed = false;
if (Adapter->pwrctrlpriv.bkeepfwalive) { if (Adapter->pwrctrlpriv.bkeepfwalive) {
_ps_open_RF23a(Adapter); _ps_open_RF23a(Adapter);
...@@ -796,6 +798,13 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) ...@@ -796,6 +798,13 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
rtl8723au_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12)); rtl8723au_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12));
exit: 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__, DBG_8723A("%s in %dms\n", __func__,
jiffies_to_msecs(jiffies - init_start_time)); jiffies_to_msecs(jiffies - init_start_time));
return status; return status;
...@@ -1105,7 +1114,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter) ...@@ -1105,7 +1114,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter)
rtl8723au_write8(Adapter, REG_RSV_CTRL, 0x0e); 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__); DBG_8723A("==> %s\n", __func__);
...@@ -1118,6 +1127,8 @@ static int rtl8723au_hal_deinit(struct rtw_adapter *padapter) ...@@ -1118,6 +1127,8 @@ static int rtl8723au_hal_deinit(struct rtw_adapter *padapter)
/* IC. Accord to johnny's opinion, only RU need the support. */ /* IC. Accord to johnny's opinion, only RU need the support. */
CardDisableRTL8723U(padapter); CardDisableRTL8723U(padapter);
padapter->hw_init_completed = false;
return _SUCCESS; return _SUCCESS;
} }
...@@ -1543,40 +1554,3 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter, ...@@ -1543,40 +1554,3 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
/* set correct initial date rate for each mac_id */ /* set correct initial date rate for each mac_id */
pdmpriv->INIDATA_RATE[mac_id] = init_rate; 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;
}
...@@ -103,8 +103,8 @@ void rtw_hal_def_value_init23a(struct rtw_adapter *padapter); ...@@ -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 pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal);
int rtw_resume_process23a(struct rtw_adapter *padapter); int rtw_resume_process23a(struct rtw_adapter *padapter);
int rtw_hal_init23a(struct rtw_adapter *padapter); int rtl8723au_hal_init(struct rtw_adapter *padapter);
int rtw_hal_deinit23a(struct rtw_adapter *padapter); int rtl8723au_hal_deinit(struct rtw_adapter *padapter);
void rtw_hal_stop(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); void rtw_hal_update_ra_mask23a(struct sta_info *psta, u8 rssi_level);
......
...@@ -666,7 +666,7 @@ int netdev_open23a(struct net_device *pnetdev) ...@@ -666,7 +666,7 @@ int netdev_open23a(struct net_device *pnetdev)
padapter->bSurpriseRemoved = false; padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false; padapter->bCardDisableWOHSM = false;
status = rtw_hal_init23a(padapter); status = rtl8723au_hal_init(padapter);
if (status == _FAIL) { if (status == _FAIL) {
RT_TRACE(_module_os_intfs_c_, _drv_err_, RT_TRACE(_module_os_intfs_c_, _drv_err_,
("rtl871x_hal_init(): Can't init h/w!\n")); ("rtl871x_hal_init(): Can't init h/w!\n"));
...@@ -735,7 +735,7 @@ static int ips_netdrv_open(struct rtw_adapter *padapter) ...@@ -735,7 +735,7 @@ static int ips_netdrv_open(struct rtw_adapter *padapter)
padapter->bSurpriseRemoved = false; padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false; padapter->bCardDisableWOHSM = false;
status = rtw_hal_init23a(padapter); status = rtl8723au_hal_init(padapter);
if (status == _FAIL) { if (status == _FAIL) {
RT_TRACE(_module_os_intfs_c_, _drv_err_, RT_TRACE(_module_os_intfs_c_, _drv_err_,
("ips_netdrv_open(): Can't init h/w!\n")); ("ips_netdrv_open(): Can't init h/w!\n"));
...@@ -800,7 +800,7 @@ void rtw_ips_dev_unload23a(struct rtw_adapter *padapter) ...@@ -800,7 +800,7 @@ void rtw_ips_dev_unload23a(struct rtw_adapter *padapter)
/* s5. */ /* s5. */
if (!padapter->bSurpriseRemoved) if (!padapter->bSurpriseRemoved)
rtw_hal_deinit23a(padapter); rtl8723au_hal_deinit(padapter);
} }
int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal) int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal)
......
...@@ -303,7 +303,7 @@ static void rtw_dev_unload(struct rtw_adapter *padapter) ...@@ -303,7 +303,7 @@ static void rtw_dev_unload(struct rtw_adapter *padapter)
/* s5. */ /* s5. */
if (!padapter->bSurpriseRemoved) { if (!padapter->bSurpriseRemoved) {
rtw_hal_deinit23a(padapter); rtl8723au_hal_deinit(padapter);
padapter->bSurpriseRemoved = true; padapter->bSurpriseRemoved = true;
} }
padapter->bup = false; padapter->bup = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment