rtw_sreset.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /* #include <drv_types.h> */
  18. enum {
  19. SRESET_TGP_NULL = 0,
  20. SRESET_TGP_XMIT_STATUS = 1,
  21. SRESET_TGP_LINK_STATUS = 2,
  22. SRESET_TGP_INFO = 99,
  23. };
  24. struct sreset_priv {
  25. _mutex silentreset_mutex;
  26. u8 silent_reset_inprogress;
  27. u8 Wifi_Error_Status;
  28. systime last_tx_time;
  29. systime last_tx_complete_time;
  30. s32 dbg_trigger_point;
  31. u64 self_dect_tx_cnt;
  32. u64 self_dect_rx_cnt;
  33. u64 self_dect_fw_cnt;
  34. u64 tx_dma_status_cnt;
  35. u64 rx_dma_status_cnt;
  36. u8 rx_cnt;
  37. u8 self_dect_fw;
  38. u8 self_dect_case;
  39. u16 last_mac_rxff_ptr;
  40. u8 dbg_sreset_ctrl;
  41. };
  42. #define WIFI_STATUS_SUCCESS 0
  43. #define USB_VEN_REQ_CMD_FAIL BIT0
  44. #define USB_READ_PORT_FAIL BIT1
  45. #define USB_WRITE_PORT_FAIL BIT2
  46. #define WIFI_MAC_TXDMA_ERROR BIT3
  47. #define WIFI_TX_HANG BIT4
  48. #define WIFI_RX_HANG BIT5
  49. #define WIFI_IF_NOT_EXIST BIT6
  50. void sreset_init_value(_adapter *padapter);
  51. void sreset_reset_value(_adapter *padapter);
  52. u8 sreset_get_wifi_status(_adapter *padapter);
  53. void sreset_set_wifi_error_status(_adapter *padapter, u32 status);
  54. void sreset_set_trigger_point(_adapter *padapter, s32 tgp);
  55. bool sreset_inprogress(_adapter *padapter);
  56. void sreset_reset(_adapter *padapter);
  57. #endif