2019-11-09 10:12:08 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2012 - 2017 Realtek Corporation.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
#define _RTL8192E_SRESET_C_
|
|
|
|
|
|
|
|
/* #include <drv_types.h> */
|
|
|
|
#include <rtl8192e_hal.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DBG_CONFIG_ERROR_DETECT
|
|
|
|
void rtl8192e_sreset_xmit_status_check(_adapter *padapter)
|
|
|
|
{
|
|
|
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
|
|
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
|
|
|
|
|
|
|
systime current_time;
|
|
|
|
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
|
|
|
unsigned int diff_time;
|
|
|
|
u32 txdma_status;
|
|
|
|
|
|
|
|
txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
|
|
|
|
if (txdma_status != 0x00) {
|
|
|
|
RTW_INFO("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
|
|
|
|
rtw_hal_sreset_reset(padapter);
|
|
|
|
}
|
|
|
|
#ifdef CONFIG_USB_HCI
|
|
|
|
/* total xmit irp = 4 */
|
|
|
|
/* RTW_INFO("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt); */
|
|
|
|
/* if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1) */
|
2021-10-14 19:34:26 +00:00
|
|
|
current_time = jiffies;
|
2019-11-09 10:12:08 +00:00
|
|
|
|
|
|
|
if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
|
|
|
|
|
|
|
|
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time);
|
|
|
|
|
|
|
|
if (diff_time > 2000) {
|
|
|
|
if (psrtpriv->last_tx_complete_time == 0)
|
|
|
|
psrtpriv->last_tx_complete_time = current_time;
|
|
|
|
else {
|
|
|
|
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time);
|
|
|
|
if (diff_time > 4000) {
|
|
|
|
u32 ability = 0;
|
|
|
|
|
|
|
|
/* padapter->Wifi_Error_Status = WIFI_TX_HANG; */
|
|
|
|
ability = rtw_phydm_ability_get(padapter);
|
|
|
|
|
|
|
|
RTW_INFO("%s tx hang %s\n", __FUNCTION__,
|
|
|
|
(ability & ODM_BB_ADAPTIVITY) ? "ODM_BB_ADAPTIVITY" : "");
|
|
|
|
|
|
|
|
if (!(ability & ODM_BB_ADAPTIVITY))
|
|
|
|
rtw_hal_sreset_reset(padapter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_USB_HCI */
|
|
|
|
|
|
|
|
if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) {
|
|
|
|
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
|
|
|
rtw_hal_sreset_reset(padapter);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtl8192e_sreset_linked_status_check(_adapter *padapter)
|
|
|
|
{
|
|
|
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
|
|
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
|
|
|
|
|
|
|
u32 rx_dma_status = 0;
|
|
|
|
rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
|
|
|
|
if (rx_dma_status != 0x00)
|
|
|
|
RTW_INFO("%s REG_RXDMA_STATUS:0x%08x\n", __FUNCTION__, rx_dma_status);
|
|
|
|
|
|
|
|
if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) {
|
|
|
|
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
|
|
|
rtw_hal_sreset_reset(padapter);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|