• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
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.
8  *
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
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef _RTW_SRESET_H_
16 #define _RTW_SRESET_H_
17 
18 /* #include <drv_types.h> */
19 
20 enum {
21 	SRESET_TGP_NULL = 0,
22 	SRESET_TGP_XMIT_STATUS = 1,
23 	SRESET_TGP_LINK_STATUS = 2,
24 	SRESET_TGP_INFO = 99,
25 };
26 
27 struct sreset_priv {
28 	_mutex	silentreset_mutex;
29 	u8	silent_reset_inprogress;
30 	u8	Wifi_Error_Status;
31 	systime last_tx_time;
32 	systime last_tx_complete_time;
33 
34 	s32 dbg_trigger_point;
35 	u64 self_dect_tx_cnt;
36 	u64 self_dect_rx_cnt;
37 	u64 self_dect_fw_cnt;
38 	u64 tx_dma_status_cnt;
39 	u64 rx_dma_status_cnt;
40 	u8 rx_cnt;
41 	u8 self_dect_fw;
42 	u8 self_dect_case;
43 	u16 last_mac_rxff_ptr;
44 	u8 dbg_sreset_ctrl;
45 };
46 
47 
48 
49 #define	WIFI_STATUS_SUCCESS		0
50 #define	USB_VEN_REQ_CMD_FAIL	BIT0
51 #define	USB_READ_PORT_FAIL		BIT1
52 #define	USB_WRITE_PORT_FAIL		BIT2
53 #define	WIFI_MAC_TXDMA_ERROR	BIT3
54 #define   WIFI_TX_HANG				BIT4
55 #define	WIFI_RX_HANG				BIT5
56 #define	WIFI_IF_NOT_EXIST			BIT6
57 
58 void sreset_init_value(_adapter *padapter);
59 void sreset_reset_value(_adapter *padapter);
60 u8 sreset_get_wifi_status(_adapter *padapter);
61 void sreset_set_wifi_error_status(_adapter *padapter, u32 status);
62 void sreset_set_trigger_point(_adapter *padapter, s32 tgp);
63 bool sreset_inprogress(_adapter *padapter);
64 void sreset_reset(_adapter *padapter);
65 
66 #endif
67