1 /******************************************************************************
3 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
16 #include <rtw_sreset.h>
17 #include <usb_ops_linux.h>
19 void rtw_hal_sreset_init(struct adapter *padapter)
21 struct sreset_priv *psrtpriv = &padapter->HalData->srestpriv;
23 psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
26 u8 sreset_get_wifi_status(struct adapter *padapter)
28 struct sreset_priv *psrtpriv = &padapter->HalData->srestpriv;
30 u8 status = WIFI_STATUS_SUCCESS;
33 val32 = usb_read32(padapter, REG_TXDMA_STATUS);
34 if (val32 == 0xeaeaeaea) {
35 psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
36 } else if (val32 != 0) {
37 DBG_88E("txdmastatu(%x)\n", val32);
38 psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
41 if (WIFI_STATUS_SUCCESS != psrtpriv->Wifi_Error_Status) {
42 DBG_88E("==>%s error_status(0x%x)\n", __func__, psrtpriv->Wifi_Error_Status);
43 status = psrtpriv->Wifi_Error_Status & (~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL));
45 DBG_88E("==> %s wifi_status(0x%x)\n", __func__, status);
48 psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
53 void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
55 padapter->HalData->srestpriv.Wifi_Error_Status = status;