phydm_auto_dbg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __PHYDM_AUTO_DBG_H__
  26. #define __PHYDM_AUTO_DBG_H__
  27. #define AUTO_DBG_VERSION "1.0" /* @2017.05.015 Dino, Add phydm_auto_dbg.h*/
  28. /* @1 ============================================================
  29. * 1 Definition
  30. * 1 ============================================================
  31. */
  32. #define AUTO_CHK_HANG_STEP_MAX 3
  33. #define DBGPORT_CHK_NUM 6
  34. #ifdef PHYDM_AUTO_DEGBUG
  35. /* @1 ============================================================
  36. * 1 enumeration
  37. * 1 ============================================================
  38. */
  39. enum auto_dbg_type_e {
  40. AUTO_DBG_STOP = 0,
  41. AUTO_DBG_CHECK_HANG = 1,
  42. AUTO_DBG_CHECK_RA = 2,
  43. AUTO_DBG_CHECK_DIG = 3
  44. };
  45. /* @1 ============================================================
  46. * 1 structure
  47. * 1 ============================================================
  48. */
  49. struct n_dbgport_803 {
  50. /*@BYTE 3*/
  51. u8 bb_rst_b : 1;
  52. u8 glb_rst_b : 1;
  53. u8 zero_1bit_1 : 1;
  54. u8 ofdm_rst_b : 1;
  55. u8 cck_txpe : 1;
  56. u8 ofdm_txpe : 1;
  57. u8 phy_tx_on : 1;
  58. u8 tdrdy : 1;
  59. /*@BYTE 2*/
  60. u8 txd : 8;
  61. /*@BYTE 1*/
  62. u8 cck_cca_pp : 1;
  63. u8 ofdm_cca_pp : 1;
  64. u8 rx_rst : 1;
  65. u8 rdrdy : 1;
  66. u8 rxd_7_4 : 4;
  67. /*@BYTE 0*/
  68. u8 rxd_3_0 : 4;
  69. u8 ofdm_tx_en : 1;
  70. u8 cck_tx_en : 1;
  71. u8 zero_1bit_2 : 1;
  72. u8 clk_80m : 1;
  73. };
  74. struct phydm_auto_dbg_struct {
  75. enum auto_dbg_type_e auto_dbg_type;
  76. u8 dbg_step;
  77. u16 dbg_port_table[DBGPORT_CHK_NUM];
  78. u32 dbg_port_val[DBGPORT_CHK_NUM];
  79. u16 ofdm_t_cnt;
  80. u16 ofdm_r_cnt;
  81. u16 cck_t_cnt;
  82. u16 cck_r_cnt;
  83. u16 ofdm_crc_error_cnt;
  84. u16 cck_crc_error_cnt;
  85. };
  86. /* @1 ============================================================
  87. * 1 function prototype
  88. * 1 ============================================================
  89. */
  90. void phydm_auto_dbg_console(
  91. void *dm_void,
  92. char input[][16],
  93. u32 *_used,
  94. char *output,
  95. u32 *_out_len);
  96. void phydm_auto_dbg_engine(void *dm_void);
  97. void phydm_auto_dbg_engine_init(void *dm_void);
  98. #endif
  99. #endif