staging: rtl8723au: Pull hal_init/deinit out of HAL wrapper layer
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 16 May 2014 08:04:16 +0000 (10:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 May 2014 18:34:26 +0000 (11:34 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/hal_intf.c
drivers/staging/rtl8723au/hal/usb_halinit.c
drivers/staging/rtl8723au/include/hal_intf.h

index 2a5c9cc4f048810487ca4faa243a8ad4bdb34213..50d8ca3dfcd3de824da038287305f8c1f65e04d2 100644 (file)
@@ -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)
index a25b018bd9051e971afee4bba11538e375833035..e3e7153205f804fe28c4dc86ed2773852b755c74 100644 (file)
@@ -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;
index dc4fca93c3661c0e239e5fb3e08c6d2456918c78..fb5b8a72b1b76c4c2b6c5efa28e19407f94740ee 100644 (file)
@@ -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,