1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2017 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 #ifndef _RTW_SRESET_H_ 17 #define _RTW_SRESET_H_ 18 19 /* #include <drv_types.h> */ 20 21 enum { 22 SRESET_TGP_NULL = 0, 23 SRESET_TGP_XMIT_STATUS = 1, 24 SRESET_TGP_LINK_STATUS = 2, 25 SRESET_TGP_INFO = 99, 26 }; 27 28 struct sreset_priv { 29 _mutex silentreset_mutex; 30 u8 silent_reset_inprogress; 31 u8 Wifi_Error_Status; 32 systime last_tx_time; 33 systime last_tx_complete_time; 34 35 s32 dbg_trigger_point; 36 u64 self_dect_tx_cnt; 37 u64 self_dect_rx_cnt; 38 u64 self_dect_fw_cnt; 39 u64 tx_dma_status_cnt; 40 u64 rx_dma_status_cnt; 41 u8 rx_cnt; 42 u8 self_dect_fw; 43 u8 self_dect_case; 44 u16 last_mac_rxff_ptr; 45 u8 dbg_sreset_ctrl; 46 }; 47 48 49 50 #define WIFI_STATUS_SUCCESS 0 51 #define USB_VEN_REQ_CMD_FAIL BIT0 52 #define USB_READ_PORT_FAIL BIT1 53 #define USB_WRITE_PORT_FAIL BIT2 54 #define WIFI_MAC_TXDMA_ERROR BIT3 55 #define WIFI_TX_HANG BIT4 56 #define WIFI_RX_HANG BIT5 57 #define WIFI_IF_NOT_EXIST BIT6 58 59 void sreset_init_value(_adapter *padapter); 60 void sreset_reset_value(_adapter *padapter); 61 u8 sreset_get_wifi_status(_adapter *padapter); 62 void sreset_set_wifi_error_status(_adapter *padapter, u32 status); 63 void sreset_set_trigger_point(_adapter *padapter, s32 tgp); 64 bool sreset_inprogress(_adapter *padapter); 65 void sreset_reset(_adapter *padapter); 66 67 #endif 68