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

staging: rtl8723au: Pull hal_init/deinit out of HAL wrapper layer

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4f6eb1e
...@@ -41,42 +41,6 @@ u32 rtw_hal_power_on23a(struct rtw_adapter *padapter) ...@@ -41,42 +41,6 @@ u32 rtw_hal_power_on23a(struct rtw_adapter *padapter)
return _FAIL; return _FAIL;
} }
uint rtw_hal_init23a(struct rtw_adapter *padapter)
{
uint status = _SUCCESS;
padapter->hw_init_completed = false;
status = padapter->HalFunc.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;
}
uint rtw_hal_deinit23a(struct rtw_adapter *padapter)
{
uint status = _SUCCESS;
status = padapter->HalFunc.hal_deinit(padapter);
if (status == _SUCCESS)
padapter->hw_init_completed = false;
else
DBG_8723A("\n rtw_hal_deinit23a: hal_init fail\n");
return status;
}
u8 rtw_hal_set_def_var23a(struct rtw_adapter *padapter, enum hal_def_variable eVariable, void *pValue) u8 rtw_hal_set_def_var23a(struct rtw_adapter *padapter, enum hal_def_variable eVariable, void *pValue)
{ {
if (padapter->HalFunc.SetHalDefVarHandler) if (padapter->HalFunc.SetHalDefVarHandler)
......
...@@ -614,10 +614,11 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter *pAdapter) ...@@ -614,10 +614,11 @@ 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 u32 rtl8723au_hal_init(struct rtw_adapter *Adapter) static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
{ {
u8 val8 = 0; u8 val8 = 0;
u32 boundary, status = _SUCCESS; u32 boundary;
int status = _SUCCESS;
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv; struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
struct registry_priv *pregistrypriv = &Adapter->registrypriv; struct registry_priv *pregistrypriv = &Adapter->registrypriv;
...@@ -1206,7 +1207,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter) ...@@ -1206,7 +1207,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter)
rtw_write8(Adapter, REG_RSV_CTRL, 0x0e); rtw_write8(Adapter, REG_RSV_CTRL, 0x0e);
} }
static u32 rtl8723au_hal_deinit(struct rtw_adapter *padapter) static int rtl8723au_hal_deinit(struct rtw_adapter *padapter)
{ {
DBG_8723A("==> %s\n", __func__); DBG_8723A("==> %s\n", __func__);
...@@ -1725,6 +1726,43 @@ static void UpdateHalRAMask8192CUsb(struct rtw_adapter *padapter, ...@@ -1725,6 +1726,43 @@ static void UpdateHalRAMask8192CUsb(struct rtw_adapter *padapter,
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;
}
int rtl8723au_set_hal_ops(struct rtw_adapter *padapter) int rtl8723au_set_hal_ops(struct rtw_adapter *padapter)
{ {
struct hal_ops *pHalFunc = &padapter->HalFunc; struct hal_ops *pHalFunc = &padapter->HalFunc;
...@@ -1735,9 +1773,6 @@ int rtl8723au_set_hal_ops(struct rtw_adapter *padapter) ...@@ -1735,9 +1773,6 @@ int rtl8723au_set_hal_ops(struct rtw_adapter *padapter)
return -ENOMEM; return -ENOMEM;
} }
pHalFunc->hal_init = &rtl8723au_hal_init;
pHalFunc->hal_deinit = &rtl8723au_hal_deinit;
pHalFunc->init_xmit_priv = &rtl8723au_init_xmit_priv; pHalFunc->init_xmit_priv = &rtl8723au_init_xmit_priv;
pHalFunc->init_recv_priv = &rtl8723au_init_recv_priv; pHalFunc->init_recv_priv = &rtl8723au_init_recv_priv;
......
...@@ -62,8 +62,6 @@ enum hal_odm_variable { ...@@ -62,8 +62,6 @@ enum hal_odm_variable {
struct hal_ops { struct hal_ops {
u32 (*hal_power_on)(struct rtw_adapter *padapter); u32 (*hal_power_on)(struct rtw_adapter *padapter);
u32 (*hal_init)(struct rtw_adapter *padapter);
u32 (*hal_deinit)(struct rtw_adapter *padapter);
s32 (*init_xmit_priv)(struct rtw_adapter *padapter); s32 (*init_xmit_priv)(struct rtw_adapter *padapter);
...@@ -142,8 +140,8 @@ void rtw_hal_sw_led_init23a(struct rtw_adapter *padapter); ...@@ -142,8 +140,8 @@ void rtw_hal_sw_led_init23a(struct rtw_adapter *padapter);
void rtw_hal_sw_led_deinit23a(struct rtw_adapter *padapter); void rtw_hal_sw_led_deinit23a(struct rtw_adapter *padapter);
u32 rtw_hal_power_on23a(struct rtw_adapter *padapter); u32 rtw_hal_power_on23a(struct rtw_adapter *padapter);
uint rtw_hal_init23a(struct rtw_adapter *padapter); int rtw_hal_init23a(struct rtw_adapter *padapter);
uint rtw_hal_deinit23a(struct rtw_adapter *padapter); int rtw_hal_deinit23a(struct rtw_adapter *padapter);
void rtw_hal_stop(struct rtw_adapter *padapter); void rtw_hal_stop(struct rtw_adapter *padapter);
u8 rtw_hal_set_def_var23a(struct rtw_adapter *padapter, u8 rtw_hal_set_def_var23a(struct rtw_adapter *padapter,
......
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