1 //------------------------------------------------------------------------------
2 // <copyright file="dbglog.h" company="Atheros">
3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved.
6 // Permission to use, copy, modify, and/or distribute this software for any
7 // purpose with or without fee is hereby granted, provided that the above
8 // copyright notice and this permission notice appear in all copies.
10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 //------------------------------------------------------------------------------
20 //==============================================================================
21 // Author(s): ="Atheros"
22 //==============================================================================
28 #include "athstartpack.h"
35 #define DBGLOG_TIMESTAMP_OFFSET 0
36 #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit
37 8-23 of the LF0 timer */
38 #define DBGLOG_DBGID_OFFSET 16
39 #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */
40 #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */
42 #define DBGLOG_MODULEID_OFFSET 26
43 #define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */
44 #define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */
47 * Please ensure that the definition of any new module introduced is captured
48 * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The
49 * structure is required for the parser to correctly pick up the values for
52 #define DBGLOG_MODULEID_START
53 #define DBGLOG_MODULEID_INF 0
54 #define DBGLOG_MODULEID_WMI 1
55 #define DBGLOG_MODULEID_MISC 2
56 #define DBGLOG_MODULEID_PM 3
57 #define DBGLOG_MODULEID_TXRX_MGMTBUF 4
58 #define DBGLOG_MODULEID_TXRX_TXBUF 5
59 #define DBGLOG_MODULEID_TXRX_RXBUF 6
60 #define DBGLOG_MODULEID_WOW 7
61 #define DBGLOG_MODULEID_WHAL 8
62 #define DBGLOG_MODULEID_DC 9
63 #define DBGLOG_MODULEID_CO 10
64 #define DBGLOG_MODULEID_RO 11
65 #define DBGLOG_MODULEID_CM 12
66 #define DBGLOG_MODULEID_MGMT 13
67 #define DBGLOG_MODULEID_TMR 14
68 #define DBGLOG_MODULEID_BTCOEX 15
69 #define DBGLOG_MODULEID_END
71 #define DBGLOG_NUM_ARGS_OFFSET 30
72 #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */
73 #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */
75 #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0
76 #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF
78 #define DBGLOG_REPORTING_ENABLED_OFFSET 16
79 #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000
81 #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17
82 #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000
84 #define DBGLOG_REPORT_SIZE_OFFSET 20
85 #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000
87 #define DBGLOG_LOG_BUFFER_SIZE 1500
88 #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90
90 PREPACK struct dbglog_buf_s {
91 struct dbglog_buf_s *next;
99 PREPACK struct dbglog_hdr_s {
100 struct dbglog_buf_s *dbuf;
104 PREPACK struct dbglog_config_s {
105 u32 cfgvalid; /* Mask with valid config bits */
107 /* TODO: Take care of endianness */
109 u32 mmask:16; /* Mask of modules with logging on */
110 u32 rep:1; /* Reporting enabled or not */
111 u32 tsr:3; /* Time stamp resolution. Def: 1 ms */
112 u32 size:10; /* Report size in number of messages */
120 #define cfgmmask u.dbglog_config.mmask
121 #define cfgrep u.dbglog_config.rep
122 #define cfgtsr u.dbglog_config.tsr
123 #define cfgsize u.dbglog_config.size
124 #define cfgvalue u.value
131 #include "athendpack.h"
134 #endif /* _DBGLOG_H_ */