2013-08-22 03:33:48 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#include <rtw_sreset.h>
|
2014-06-11 17:21:40 +00:00
|
|
|
#include <usb_ops_linux.h>
|
2013-08-22 03:33:48 +00:00
|
|
|
|
2016-09-03 15:33:00 +00:00
|
|
|
void rtw_hal_sreset_init(struct adapter *padapter)
|
2013-08-22 03:33:48 +00:00
|
|
|
{
|
2016-09-18 17:28:06 +00:00
|
|
|
struct sreset_priv *psrtpriv = &padapter->HalData->srestpriv;
|
2013-08-22 03:33:48 +00:00
|
|
|
|
|
|
|
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 sreset_get_wifi_status(struct adapter *padapter)
|
|
|
|
{
|
2016-09-18 17:28:06 +00:00
|
|
|
struct sreset_priv *psrtpriv = &padapter->HalData->srestpriv;
|
2013-08-22 03:33:48 +00:00
|
|
|
|
|
|
|
u8 status = WIFI_STATUS_SUCCESS;
|
|
|
|
u32 val32 = 0;
|
|
|
|
|
2014-06-11 17:21:34 +00:00
|
|
|
val32 = usb_read32(padapter, REG_TXDMA_STATUS);
|
2013-08-22 03:33:48 +00:00
|
|
|
if (val32 == 0xeaeaeaea) {
|
|
|
|
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
|
|
|
} else if (val32 != 0) {
|
|
|
|
DBG_88E("txdmastatu(%x)\n", val32);
|
|
|
|
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (WIFI_STATUS_SUCCESS != psrtpriv->Wifi_Error_Status) {
|
|
|
|
DBG_88E("==>%s error_status(0x%x)\n", __func__, psrtpriv->Wifi_Error_Status);
|
2015-03-13 16:55:55 +00:00
|
|
|
status = psrtpriv->Wifi_Error_Status & (~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL));
|
2013-08-22 03:33:48 +00:00
|
|
|
}
|
|
|
|
DBG_88E("==> %s wifi_status(0x%x)\n", __func__, status);
|
|
|
|
|
|
|
|
/* status restore */
|
|
|
|
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
|
|
|
|
{
|
2016-09-18 17:28:06 +00:00
|
|
|
padapter->HalData->srestpriv.Wifi_Error_Status = status;
|
2013-08-22 03:33:48 +00:00
|
|
|
}
|