From c77726971ee29af46d2dabac2d4a821b84752a02 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Fri, 16 May 2014 10:04:16 +0200 Subject: [PATCH] staging: rtl8723au: Pull hal_init/deinit out of HAL wrapper layer Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/hal/hal_intf.c | 36 -------------- drivers/staging/rtl8723au/hal/usb_halinit.c | 49 +++++++++++++++++--- drivers/staging/rtl8723au/include/hal_intf.h | 6 +-- 3 files changed, 44 insertions(+), 47 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/hal_intf.c b/drivers/staging/rtl8723au/hal/hal_intf.c index 2a5c9cc4f048..50d8ca3dfcd3 100644 --- a/drivers/staging/rtl8723au/hal/hal_intf.c +++ b/drivers/staging/rtl8723au/hal/hal_intf.c @@ -41,42 +41,6 @@ u32 rtw_hal_power_on23a(struct rtw_adapter *padapter) 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) { if (padapter->HalFunc.SetHalDefVarHandler) diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index a25b018bd905..e3e7153205f8 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -614,10 +614,11 @@ enum rt_rf_power_state RfOnOffDetect23a(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; - u32 boundary, status = _SUCCESS; + u8 val8 = 0; + u32 boundary; + int status = _SUCCESS; struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv; struct registry_priv *pregistrypriv = &Adapter->registrypriv; @@ -1206,7 +1207,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter) 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__); @@ -1725,6 +1726,43 @@ static void UpdateHalRAMask8192CUsb(struct rtw_adapter *padapter, 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) { struct hal_ops *pHalFunc = &padapter->HalFunc; @@ -1735,9 +1773,6 @@ int rtl8723au_set_hal_ops(struct rtw_adapter *padapter) return -ENOMEM; } - pHalFunc->hal_init = &rtl8723au_hal_init; - pHalFunc->hal_deinit = &rtl8723au_hal_deinit; - pHalFunc->init_xmit_priv = &rtl8723au_init_xmit_priv; pHalFunc->init_recv_priv = &rtl8723au_init_recv_priv; diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index dc4fca93c366..fb5b8a72b1b7 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -62,8 +62,6 @@ enum hal_odm_variable { struct hal_ops { 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); @@ -142,8 +140,8 @@ void rtw_hal_sw_led_init23a(struct rtw_adapter *padapter); void rtw_hal_sw_led_deinit23a(struct rtw_adapter *padapter); u32 rtw_hal_power_on23a(struct rtw_adapter *padapter); -uint rtw_hal_init23a(struct rtw_adapter *padapter); -uint rtw_hal_deinit23a(struct rtw_adapter *padapter); +int rtw_hal_init23a(struct rtw_adapter *padapter); +int rtw_hal_deinit23a(struct rtw_adapter *padapter); void rtw_hal_stop(struct rtw_adapter *padapter); u8 rtw_hal_set_def_var23a(struct rtw_adapter *padapter, -- 2.30.2