[s3c24xx] Add 2.6.31 patches
[openwrt.git] / target / linux / s3c24xx / files-2.6.31 / drivers / ar6000 / include / dbglog.h
1 /*
2 * Copyright (c) 2004-2007 Atheros Communications Inc.
3 * All rights reserved.
4 *
5 * $ATH_LICENSE_HOSTSDK0_C$
6 *
7 * This file contains the definitions and data structures associated with
8 * the log based debug mechanism.
9 *
10 */
11
12 #ifndef _DBGLOG_H_
13 #define _DBGLOG_H_
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define DBGLOG_TIMESTAMP_OFFSET 0
20 #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit
21 8-23 of the LF0 timer */
22 #define DBGLOG_DBGID_OFFSET 16
23 #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */
24 #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */
25
26 #define DBGLOG_MODULEID_OFFSET 26
27 #define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */
28 #define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */
29
30 /*
31 * Please ensure that the definition of any new module intrduced is captured
32 * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The
33 * structure is required for the parser to correctly pick up the values for
34 * different modules.
35 */
36 #define DBGLOG_MODULEID_START
37 #define DBGLOG_MODULEID_INF 0
38 #define DBGLOG_MODULEID_WMI 1
39 #define DBGLOG_MODULEID_CSERV 2
40 #define DBGLOG_MODULEID_PM 3
41 #define DBGLOG_MODULEID_TXRX_MGMTBUF 4
42 #define DBGLOG_MODULEID_TXRX_TXBUF 5
43 #define DBGLOG_MODULEID_TXRX_RXBUF 6
44 #define DBGLOG_MODULEID_WOW 7
45 #define DBGLOG_MODULEID_WHAL 8
46 #define DBGLOG_MODULEID_END
47
48 #define DBGLOG_NUM_ARGS_OFFSET 30
49 #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */
50 #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */
51
52 #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0
53 #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF
54
55 #define DBGLOG_REPORTING_ENABLED_OFFSET 16
56 #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000
57
58 #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17
59 #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000
60
61 #define DBGLOG_REPORT_SIZE_OFFSET 20
62 #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000
63
64 #define DBGLOG_LOG_BUFFER_SIZE 1500
65 #define DBGLOG_DBGID_DEFINITION_LEN_MAX 64
66
67 struct dbglog_buf_s {
68 struct dbglog_buf_s *next;
69 A_INT8 *buffer;
70 A_UINT32 bufsize;
71 A_UINT32 length;
72 A_UINT32 count;
73 A_UINT32 free;
74 };
75
76 struct dbglog_hdr_s {
77 struct dbglog_buf_s *dbuf;
78 A_UINT32 dropped;
79 };
80
81 struct dbglog_config_s {
82 A_UINT32 cfgvalid; /* Mask with valid config bits */
83 union {
84 /* TODO: Take care of endianness */
85 struct {
86 A_UINT32 mmask:16; /* Mask of modules with logging on */
87 A_UINT32 rep:1; /* Reporting enabled or not */
88 A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */
89 A_UINT32 size:10; /* Report size in number of messages */
90 A_UINT32 reserved:2;
91 } dbglog_config;
92
93 A_UINT32 value;
94 } u;
95 };
96
97 #define cfgmmask u.dbglog_config.mmask
98 #define cfgrep u.dbglog_config.rep
99 #define cfgtsr u.dbglog_config.tsr
100 #define cfgsize u.dbglog_config.size
101 #define cfgvalue u.value
102
103 #ifdef __cplusplus
104 }
105 #endif
106
107 #endif /* _DBGLOG_H_ */
This page took 0.046154 seconds and 5 git commands to generate.