From: Jes Sorensen Date: Fri, 16 May 2014 08:04:00 +0000 (+0200) Subject: staging: rtl8723au: Get rid of sreset related HAL clutter X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b7c19c276a230aee012ba7adef036689633c4cd8;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Get rid of sreset related HAL clutter Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index 32c5f72c9a44..356bfcc9744a 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -1033,7 +1033,7 @@ static void dynamic_chk_wk_hdl(struct rtw_adapter *padapter, u8 *pbuf, int sz) expire_timeout_chk23a(padapter); #endif - rtw_hal_sreset_xmit_status_check23a(padapter); + rtl8723a_sreset_xmit_status_check(padapter); linked_status_chk23a(padapter); traffic_status_watchdog(padapter); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index a5fca8141e32..b1f1fd6e6c9f 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -25,6 +25,7 @@ #include #include #include +#include static void rtw_init_mlme_timer(struct rtw_adapter *padapter) { @@ -808,7 +809,7 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) rtw_os_xmit_schedule23a(adapter); if (pmlmeext->sitesurvey_res.bss_cnt == 0) - rtw_hal_sreset_reset23a(adapter); + rtw_sreset_reset(adapter); rtw_cfg80211_surveydone_event_callback(adapter); } diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 1789822e785a..9d40b08dd19f 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -5555,10 +5555,9 @@ void linked_status_chk23a(struct rtw_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct sta_priv *pstapriv = &padapter->stapriv; - rtw_hal_sreset_linked_status_check23a(padapter); + rtl8723a_sreset_linked_status_check(padapter); - if (is_client_associated_to_ap23a(padapter)) - { + if (is_client_associated_to_ap23a(padapter)) { /* linked infrastructure client mode */ int tx_chk = _SUCCESS, rx_chk = _SUCCESS; diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c index 993504dd7eda..b36c12b842c0 100644 --- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c @@ -546,12 +546,12 @@ int _rtw_pwr_wakeup23a(struct rtw_adapter *padapter, u32 ips_deffer_ms, const ch DBG_8723A("%s wait ps_processing done\n", __func__); } - if (rtw_hal_sreset_inprogress(padapter)) { + if (rtw_sreset_inprogress(padapter)) { DBG_8723A("%s wait sreset_inprogress...\n", __func__); - while (rtw_hal_sreset_inprogress(padapter) && + while (rtw_sreset_inprogress(padapter) && jiffies_to_msecs(jiffies - start) <= 4000) msleep(10); - if (rtw_hal_sreset_inprogress(padapter)) + if (rtw_sreset_inprogress(padapter)) DBG_8723A("%s wait sreset_inprogress timeout\n", __func__); else diff --git a/drivers/staging/rtl8723au/core/rtw_sreset.c b/drivers/staging/rtl8723au/core/rtw_sreset.c index 0e1ea3142006..4938af70cc02 100644 --- a/drivers/staging/rtl8723au/core/rtw_sreset.c +++ b/drivers/staging/rtl8723au/core/rtw_sreset.c @@ -13,11 +13,11 @@ * ******************************************************************************/ -#include +#include -void sreset_init_value23a(struct rtw_adapter *padapter) +void rtw_sreset_init(struct rtw_adapter *padapter) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); struct sreset_priv *psrtpriv = &pHalData->srestpriv; mutex_init(&psrtpriv->silentreset_mutex); @@ -26,9 +26,10 @@ void sreset_init_value23a(struct rtw_adapter *padapter) psrtpriv->last_tx_time = 0; psrtpriv->last_tx_complete_time = 0; } -void sreset_reset_value23a(struct rtw_adapter *padapter) + +void rtw_sreset_reset_value(struct rtw_adapter *padapter) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); struct sreset_priv *psrtpriv = &pHalData->srestpriv; psrtpriv->silent_reset_inprogress = false; @@ -37,9 +38,9 @@ void sreset_reset_value23a(struct rtw_adapter *padapter) psrtpriv->last_tx_complete_time = 0; } -u8 sreset_get_wifi_status23a(struct rtw_adapter *padapter) +u8 rtw_sreset_get_wifi_status(struct rtw_adapter *padapter) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); struct sreset_priv *psrtpriv = &pHalData->srestpriv; u8 status = WIFI_STATUS_SUCCESS; u32 val32 = 0; @@ -80,9 +81,10 @@ void sreset_set_trigger_point(struct rtw_adapter *padapter, s32 tgp) pHalData->srestpriv.dbg_trigger_point = tgp; } -bool sreset_inprogress(struct rtw_adapter *padapter) +bool rtw_sreset_inprogress(struct rtw_adapter *padapter) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); + struct rtw_adapter *primary_adapter = GET_PRIMARY_ADAPTER(padapter); + struct hal_data_8723a *pHalData = GET_HAL_DATA(primary_adapter); return pHalData->srestpriv.silent_reset_inprogress; } @@ -227,9 +229,10 @@ static void sreset_start_adapter(struct rtw_adapter *padapter) netif_tx_wake_all_queues(padapter->pnetdev); } -void sreset_reset(struct rtw_adapter *padapter) +void rtw_sreset_reset(struct rtw_adapter *active_adapter) { - struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); + struct rtw_adapter *padapter = GET_PRIMARY_ADAPTER(active_adapter); + struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); struct sreset_priv *psrtpriv = &pHalData->srestpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; unsigned long start = jiffies; diff --git a/drivers/staging/rtl8723au/hal/hal_intf.c b/drivers/staging/rtl8723au/hal/hal_intf.c index 1e42a33e6967..d08e805bb023 100644 --- a/drivers/staging/rtl8723au/hal/hal_intf.c +++ b/drivers/staging/rtl8723au/hal/hal_intf.c @@ -268,54 +268,6 @@ void rtw_hal_bcn_related_reg_setting23a(struct rtw_adapter *padapter) padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter); } -void rtw_hal_sreset_init23a(struct rtw_adapter *padapter) -{ - if (padapter->HalFunc.sreset_init_value23a) - padapter->HalFunc.sreset_init_value23a(padapter); -} -void rtw_hal_sreset_reset23a(struct rtw_adapter *padapter) -{ - padapter = GET_PRIMARY_ADAPTER(padapter); - - if (padapter->HalFunc.silentreset) - padapter->HalFunc.silentreset(padapter); -} - -void rtw_hal_sreset_reset23a_value23a(struct rtw_adapter *padapter) -{ - if (padapter->HalFunc.sreset_reset_value23a) - padapter->HalFunc.sreset_reset_value23a(padapter); -} - -void rtw_hal_sreset_xmit_status_check23a(struct rtw_adapter *padapter) -{ - if (padapter->HalFunc.sreset_xmit_status_check) - padapter->HalFunc.sreset_xmit_status_check(padapter); -} -void rtw_hal_sreset_linked_status_check23a(struct rtw_adapter *padapter) -{ - if (padapter->HalFunc.sreset_linked_status_check) - padapter->HalFunc.sreset_linked_status_check(padapter); -} -u8 rtw_hal_sreset_get_wifi_status23a(struct rtw_adapter *padapter) -{ - u8 status = 0; - if (padapter->HalFunc.sreset_get_wifi_status23a) - status = padapter->HalFunc.sreset_get_wifi_status23a(padapter); - return status; -} - -bool rtw_hal_sreset_inprogress(struct rtw_adapter *padapter) -{ - bool inprogress = false; - - padapter = GET_PRIMARY_ADAPTER(padapter); - - if (padapter->HalFunc.sreset_inprogress) - inprogress = padapter->HalFunc.sreset_inprogress(padapter); - return inprogress; -} - void rtw_hal_notch_filter23a(struct rtw_adapter *adapter, bool enable) { if (adapter->HalFunc.hal_notch_filter) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 5e2726244576..71cf14320956 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -1746,14 +1746,6 @@ void rtl8723a_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->Efuse_WordEnableDataWrite23a = &Hal_EfuseWordEnableDataWrite; pHalFunc->Efuse_PgPacketWrite23a_BT = &Hal_EfusePgPacketWrite_BT; - pHalFunc->sreset_init_value23a = &sreset_init_value23a; - pHalFunc->sreset_reset_value23a = &sreset_reset_value23a; - pHalFunc->silentreset = &sreset_reset; - pHalFunc->sreset_xmit_status_check = &rtl8723a_sreset_xmit_status_check; - pHalFunc->sreset_linked_status_check = - &rtl8723a_sreset_linked_status_check; - pHalFunc->sreset_get_wifi_status23a = &sreset_get_wifi_status23a; - pHalFunc->sreset_inprogress = &sreset_inprogress; pHalFunc->GetHalODMVarHandler = &rtl8723a_GetHalODMVar; pHalFunc->SetHalODMVarHandler = &rtl8723a_SetHalODMVar; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_sreset.c b/drivers/staging/rtl8723au/hal/rtl8723a_sreset.c index c0218e734b9e..54b0dfb6eebf 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_sreset.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_sreset.c @@ -30,7 +30,7 @@ void rtl8723a_sreset_xmit_status_check(struct rtw_adapter *padapter) txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS); if (txdma_status != 0) { DBG_8723A("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status); - rtw_hal_sreset_reset23a(padapter); + rtw_sreset_reset(padapter); } current_time = jiffies; @@ -47,7 +47,7 @@ void rtl8723a_sreset_xmit_status_check(struct rtw_adapter *padapter) if (diff_time > 4000) { /* padapter->Wifi_Error_Status = WIFI_TX_HANG; */ DBG_8723A("%s tx hang\n", __func__); - rtw_hal_sreset_reset23a(padapter); + rtw_sreset_reset(padapter); } } } @@ -55,7 +55,7 @@ void rtl8723a_sreset_xmit_status_check(struct rtw_adapter *padapter) if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) { psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; - rtw_hal_sreset_reset23a(padapter); + rtw_sreset_reset(padapter); return; } } @@ -67,7 +67,7 @@ void rtl8723a_sreset_linked_status_check(struct rtw_adapter *padapter) if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) { psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; - rtw_hal_sreset_reset23a(padapter); + rtw_sreset_reset(padapter); return; } } diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 959105e34a66..2fdc02afb53d 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -139,14 +139,6 @@ struct hal_ops { bool (*Efuse_PgPacketWrite23a_BT)(struct rtw_adapter *padapter, u8 offset, u8 word_en, u8 *data); - void (*sreset_init_value23a)(struct rtw_adapter *padapter); - void (*sreset_reset_value23a)(struct rtw_adapter *padapter); - void (*silentreset)(struct rtw_adapter *padapter); - void (*sreset_xmit_status_check)(struct rtw_adapter *padapter); - void (*sreset_linked_status_check) (struct rtw_adapter *padapter); - u8 (*sreset_get_wifi_status23a)(struct rtw_adapter *padapter); - bool (*sreset_inprogress)(struct rtw_adapter *padapter); - void (*hal_notch_filter)(struct rtw_adapter *adapter, bool enable); void (*hal_reset_security_engine)(struct rtw_adapter *adapter); }; @@ -255,14 +247,6 @@ void rtw_hal_set_bwmode23a(struct rtw_adapter *padapter, enum ht_channel_width Bandwidth, u8 Offset); void rtw_hal_set_chan23a(struct rtw_adapter *padapter, u8 channel); -void rtw_hal_sreset_init23a(struct rtw_adapter *padapter); -void rtw_hal_sreset_reset23a(struct rtw_adapter *padapter); -void rtw_hal_sreset_reset23a_value23a(struct rtw_adapter *padapter); -void rtw_hal_sreset_xmit_status_check23a(struct rtw_adapter *padapter); -void rtw_hal_sreset_linked_status_check23a (struct rtw_adapter *padapter); -u8 rtw_hal_sreset_get_wifi_status23a(struct rtw_adapter *padapter); -bool rtw_hal_sreset_inprogress(struct rtw_adapter *padapter); - void rtw_hal_notch_filter23a(struct rtw_adapter *adapter, bool enable); void rtw_hal_reset_security_engine23a(struct rtw_adapter *adapter); diff --git a/drivers/staging/rtl8723au/include/rtw_sreset.h b/drivers/staging/rtl8723au/include/rtw_sreset.h index 91d57e2791d9..77cc7941b546 100644 --- a/drivers/staging/rtl8723au/include/rtw_sreset.h +++ b/drivers/staging/rtl8723au/include/rtw_sreset.h @@ -45,12 +45,12 @@ struct sreset_priv { #define WIFI_RX_HANG BIT(5) #define WIFI_IF_NOT_EXIST BIT(6) -void sreset_init_value23a(struct rtw_adapter *padapter); -void sreset_reset_value23a(struct rtw_adapter *padapter); -u8 sreset_get_wifi_status23a(struct rtw_adapter *padapter); +void rtw_sreset_init(struct rtw_adapter *padapter); +void rtw_sreset_reset_value(struct rtw_adapter *padapter); +u8 rtw_sreset_get_wifi_status(struct rtw_adapter *padapter); +bool rtw_sreset_inprogress(struct rtw_adapter *padapter); void sreset_set_wifi_error_status23a(struct rtw_adapter *padapter, u32 status); void sreset_set_trigger_point(struct rtw_adapter *padapter, s32 tgp); -bool sreset_inprogress(struct rtw_adapter *padapter); -void sreset_reset(struct rtw_adapter *padapter); +void rtw_sreset_reset(struct rtw_adapter *active_adapter); #endif diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c index 6273497aa61e..38ad4ab45206 100644 --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c @@ -449,7 +449,7 @@ u8 rtw_reset_drv_sw23a(struct rtw_adapter *padapter) _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING); - rtw_hal_sreset_reset23a_value23a(padapter); + rtw_sreset_reset_value(padapter); pwrctrlpriv->pwr_state_check_cnts = 0; /* mlmeextpriv */ @@ -525,7 +525,7 @@ u8 rtw_init_drv_sw23a(struct rtw_adapter *padapter) rtl8723a_init_dm_priv(padapter); rtw_hal_sw_led_init23a(padapter); - rtw_hal_sreset_init23a(padapter); + rtw_sreset_init(padapter); exit: