Staging: merge 2.6.39-rc3 into staging-next
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / ath6kl / include / common / dbglog.h
blob5566e568b83d94d2b3d58e16e9b94ee3291c1f24
1 //------------------------------------------------------------------------------
2 // <copyright file="dbglog.h" company="Atheros">
3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved.
4 //
5 //
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.
9 //
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 //==============================================================================
24 #ifndef _DBGLOG_H_
25 #define _DBGLOG_H_
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 #define DBGLOG_TIMESTAMP_OFFSET 0
32 #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit
33 8-23 of the LF0 timer */
34 #define DBGLOG_DBGID_OFFSET 16
35 #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */
36 #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */
38 #define DBGLOG_MODULEID_OFFSET 26
39 #define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */
40 #define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */
43 * Please ensure that the definition of any new module introduced is captured
44 * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The
45 * structure is required for the parser to correctly pick up the values for
46 * different modules.
48 #define DBGLOG_MODULEID_START
49 #define DBGLOG_MODULEID_INF 0
50 #define DBGLOG_MODULEID_WMI 1
51 #define DBGLOG_MODULEID_MISC 2
52 #define DBGLOG_MODULEID_PM 3
53 #define DBGLOG_MODULEID_TXRX_MGMTBUF 4
54 #define DBGLOG_MODULEID_TXRX_TXBUF 5
55 #define DBGLOG_MODULEID_TXRX_RXBUF 6
56 #define DBGLOG_MODULEID_WOW 7
57 #define DBGLOG_MODULEID_WHAL 8
58 #define DBGLOG_MODULEID_DC 9
59 #define DBGLOG_MODULEID_CO 10
60 #define DBGLOG_MODULEID_RO 11
61 #define DBGLOG_MODULEID_CM 12
62 #define DBGLOG_MODULEID_MGMT 13
63 #define DBGLOG_MODULEID_TMR 14
64 #define DBGLOG_MODULEID_BTCOEX 15
65 #define DBGLOG_MODULEID_END
67 #define DBGLOG_NUM_ARGS_OFFSET 30
68 #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */
69 #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */
71 #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0
72 #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF
74 #define DBGLOG_REPORTING_ENABLED_OFFSET 16
75 #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000
77 #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17
78 #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000
80 #define DBGLOG_REPORT_SIZE_OFFSET 20
81 #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000
83 #define DBGLOG_LOG_BUFFER_SIZE 1500
84 #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90
86 PREPACK struct dbglog_buf_s {
87 struct dbglog_buf_s *next;
88 u8 *buffer;
89 u32 bufsize;
90 u32 length;
91 u32 count;
92 u32 free;
93 } POSTPACK;
95 PREPACK struct dbglog_hdr_s {
96 struct dbglog_buf_s *dbuf;
97 u32 dropped;
98 } POSTPACK;
100 PREPACK struct dbglog_config_s {
101 u32 cfgvalid; /* Mask with valid config bits */
102 union {
103 /* TODO: Take care of endianness */
104 struct {
105 u32 mmask:16; /* Mask of modules with logging on */
106 u32 rep:1; /* Reporting enabled or not */
107 u32 tsr:3; /* Time stamp resolution. Def: 1 ms */
108 u32 size:10; /* Report size in number of messages */
109 u32 reserved:2;
110 } dbglog_config;
112 u32 value;
113 } u;
114 } POSTPACK;
116 #define cfgmmask u.dbglog_config.mmask
117 #define cfgrep u.dbglog_config.rep
118 #define cfgtsr u.dbglog_config.tsr
119 #define cfgsize u.dbglog_config.size
120 #define cfgvalue u.value
122 #ifdef __cplusplus
124 #endif
126 #endif /* _DBGLOG_H_ */