dbglog.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //------------------------------------------------------------------------------
  2. // <copyright file="dbglog.h" company="Atheros">
  3. // Copyright (c) 2004-2007 Atheros Corporation. All rights reserved.
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License version 2 as
  7. // published by the Free Software Foundation;
  8. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // Author(s): ="Atheros"
  18. //==============================================================================
  19. #ifndef _DBGLOG_H_
  20. #define _DBGLOG_H_
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #define DBGLOG_TIMESTAMP_OFFSET 0
  25. #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit
  26. 8-23 of the LF0 timer */
  27. #define DBGLOG_DBGID_OFFSET 16
  28. #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */
  29. #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */
  30. #define DBGLOG_MODULEID_OFFSET 26
  31. #define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */
  32. #define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */
  33. /*
  34. * Please ensure that the definition of any new module intrduced is captured
  35. * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The
  36. * structure is required for the parser to correctly pick up the values for
  37. * different modules.
  38. */
  39. #define DBGLOG_MODULEID_START
  40. #define DBGLOG_MODULEID_INF 0
  41. #define DBGLOG_MODULEID_WMI 1
  42. #define DBGLOG_MODULEID_CSERV 2
  43. #define DBGLOG_MODULEID_PM 3
  44. #define DBGLOG_MODULEID_TXRX_MGMTBUF 4
  45. #define DBGLOG_MODULEID_TXRX_TXBUF 5
  46. #define DBGLOG_MODULEID_TXRX_RXBUF 6
  47. #define DBGLOG_MODULEID_WOW 7
  48. #define DBGLOG_MODULEID_WHAL 8
  49. #define DBGLOG_MODULEID_DC 9
  50. #define DBGLOG_MODULEID_CO 10
  51. #define DBGLOG_MODULEID_RO 11
  52. #define DBGLOG_MODULEID_CM 12
  53. #define DBGLOG_MODULEID_PY 13
  54. #define DBGLOG_MODULEID_TMR 14
  55. #define DBGLOG_MODULEID_BTCOEX 15
  56. #define DBGLOG_MODULEID_END
  57. #define DBGLOG_NUM_ARGS_OFFSET 30
  58. #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */
  59. #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */
  60. #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0
  61. #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF
  62. #define DBGLOG_REPORTING_ENABLED_OFFSET 16
  63. #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000
  64. #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17
  65. #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000
  66. #define DBGLOG_REPORT_SIZE_OFFSET 20
  67. #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000
  68. #define DBGLOG_LOG_BUFFER_SIZE 1500
  69. #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90
  70. struct dbglog_buf_s {
  71. struct dbglog_buf_s *next;
  72. A_INT8 *buffer;
  73. A_UINT32 bufsize;
  74. A_UINT32 length;
  75. A_UINT32 count;
  76. A_UINT32 free;
  77. };
  78. struct dbglog_hdr_s {
  79. struct dbglog_buf_s *dbuf;
  80. A_UINT32 dropped;
  81. };
  82. struct dbglog_config_s {
  83. A_UINT32 cfgvalid; /* Mask with valid config bits */
  84. union {
  85. /* TODO: Take care of endianness */
  86. struct {
  87. A_UINT32 mmask:16; /* Mask of modules with logging on */
  88. A_UINT32 rep:1; /* Reporting enabled or not */
  89. A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */
  90. A_UINT32 size:10; /* Report size in number of messages */
  91. A_UINT32 reserved:2;
  92. } dbglog_config;
  93. A_UINT32 value;
  94. } u;
  95. };
  96. #define cfgmmask u.dbglog_config.mmask
  97. #define cfgrep u.dbglog_config.rep
  98. #define cfgtsr u.dbglog_config.tsr
  99. #define cfgsize u.dbglog_config.size
  100. #define cfgvalue u.value
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* _DBGLOG_H_ */