| OLD | NEW |
| 1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="dbglog.h" company="Atheros"> | 2 // <copyright file="dbglog.h" company="Atheros"> |
| 3 // Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. | 3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. |
| 4 // | 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 // | 5 // |
| 9 // Software distributed under the License is distributed on an "AS | 6 // Permission to use, copy, modify, and/or distribute this software for any |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 7 // purpose with or without fee is hereby granted, provided that the above |
| 11 // implied. See the License for the specific language governing | 8 // copyright notice and this permission notice appear in all copies. |
| 12 // rights and limitations under the License. | 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. |
| 13 // | 17 // |
| 14 // | 18 // |
| 15 //------------------------------------------------------------------------------ | 19 //------------------------------------------------------------------------------ |
| 16 //============================================================================== | 20 //============================================================================== |
| 17 // Author(s): ="Atheros" | 21 // Author(s): ="Atheros" |
| 18 //============================================================================== | 22 //============================================================================== |
| 19 | 23 |
| 20 #ifndef _DBGLOG_H_ | 24 #ifndef _DBGLOG_H_ |
| 21 #define _DBGLOG_H_ | 25 #define _DBGLOG_H_ |
| 22 | 26 |
| 27 #ifndef ATH_TARGET |
| 28 #include "athstartpack.h" |
| 29 #endif |
| 30 |
| 23 #ifdef __cplusplus | 31 #ifdef __cplusplus |
| 24 extern "C" { | 32 extern "C" { |
| 25 #endif | 33 #endif |
| 26 | 34 |
| 27 #define DBGLOG_TIMESTAMP_OFFSET 0 | 35 #define DBGLOG_TIMESTAMP_OFFSET 0 |
| 28 #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit | 36 #define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit |
| 29 8-23 of the LF0 timer */ | 37 8-23 of the LF0 timer */ |
| 30 #define DBGLOG_DBGID_OFFSET 16 | 38 #define DBGLOG_DBGID_OFFSET 16 |
| 31 #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */ | 39 #define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */ |
| 32 #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */ | 40 #define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 51 #define DBGLOG_MODULEID_TXRX_RXBUF 6 | 59 #define DBGLOG_MODULEID_TXRX_RXBUF 6 |
| 52 #define DBGLOG_MODULEID_WOW 7 | 60 #define DBGLOG_MODULEID_WOW 7 |
| 53 #define DBGLOG_MODULEID_WHAL 8 | 61 #define DBGLOG_MODULEID_WHAL 8 |
| 54 #define DBGLOG_MODULEID_DC 9 | 62 #define DBGLOG_MODULEID_DC 9 |
| 55 #define DBGLOG_MODULEID_CO 10 | 63 #define DBGLOG_MODULEID_CO 10 |
| 56 #define DBGLOG_MODULEID_RO 11 | 64 #define DBGLOG_MODULEID_RO 11 |
| 57 #define DBGLOG_MODULEID_CM 12 | 65 #define DBGLOG_MODULEID_CM 12 |
| 58 #define DBGLOG_MODULEID_MGMT 13 | 66 #define DBGLOG_MODULEID_MGMT 13 |
| 59 #define DBGLOG_MODULEID_TMR 14 | 67 #define DBGLOG_MODULEID_TMR 14 |
| 60 #define DBGLOG_MODULEID_BTCOEX 15 | 68 #define DBGLOG_MODULEID_BTCOEX 15 |
| 61 #define DBGLOG_MODULEID_TLPM 2 | |
| 62 #define DBGLOG_MODULEID_END | 69 #define DBGLOG_MODULEID_END |
| 63 | 70 |
| 64 #define DBGLOG_NUM_ARGS_OFFSET 30 | 71 #define DBGLOG_NUM_ARGS_OFFSET 30 |
| 65 #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */ | 72 #define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */ |
| 66 #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */ | 73 #define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */ |
| 67 | 74 |
| 68 #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0 | 75 #define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0 |
| 69 #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF | 76 #define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF |
| 70 | 77 |
| 71 #define DBGLOG_REPORTING_ENABLED_OFFSET 16 | 78 #define DBGLOG_REPORTING_ENABLED_OFFSET 16 |
| 72 #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000 | 79 #define DBGLOG_REPORTING_ENABLED_MASK 0x00010000 |
| 73 | 80 |
| 74 #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17 | 81 #define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17 |
| 75 #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000 | 82 #define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000 |
| 76 | 83 |
| 77 #define DBGLOG_REPORT_SIZE_OFFSET 20 | 84 #define DBGLOG_REPORT_SIZE_OFFSET 20 |
| 78 #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000 | 85 #define DBGLOG_REPORT_SIZE_MASK 0x3FF00000 |
| 79 | 86 |
| 80 #define DBGLOG_LOG_BUFFER_SIZE 1500 | 87 #define DBGLOG_LOG_BUFFER_SIZE 1500 |
| 81 #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90 | 88 #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90 |
| 82 | 89 |
| 83 struct dbglog_buf_s { | 90 PREPACK struct dbglog_buf_s { |
| 84 struct dbglog_buf_s *next; | 91 struct dbglog_buf_s *next; |
| 85 A_UINT8 *buffer; | 92 A_UINT8 *buffer; |
| 86 A_UINT32 bufsize; | 93 A_UINT32 bufsize; |
| 87 A_UINT32 length; | 94 A_UINT32 length; |
| 88 A_UINT32 count; | 95 A_UINT32 count; |
| 89 A_UINT32 free; | 96 A_UINT32 free; |
| 90 }; | 97 } POSTPACK; |
| 91 | 98 |
| 92 struct dbglog_hdr_s { | 99 PREPACK struct dbglog_hdr_s { |
| 93 struct dbglog_buf_s *dbuf; | 100 struct dbglog_buf_s *dbuf; |
| 94 A_UINT32 dropped; | 101 A_UINT32 dropped; |
| 95 }; | 102 } POSTPACK; |
| 96 | 103 |
| 97 struct dbglog_config_s { | 104 PREPACK struct dbglog_config_s { |
| 98 A_UINT32 cfgvalid; /* Mask with valid config bits */ | 105 A_UINT32 cfgvalid; /* Mask with valid config bits */ |
| 99 union { | 106 union { |
| 100 /* TODO: Take care of endianness */ | 107 /* TODO: Take care of endianness */ |
| 101 struct { | 108 struct { |
| 102 A_UINT32 mmask:16; /* Mask of modules with logging on */ | 109 A_UINT32 mmask:16; /* Mask of modules with logging on */ |
| 103 A_UINT32 rep:1; /* Reporting enabled or not */ | 110 A_UINT32 rep:1; /* Reporting enabled or not */ |
| 104 A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */ | 111 A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */ |
| 105 A_UINT32 size:10; /* Report size in number of messages */ | 112 A_UINT32 size:10; /* Report size in number of messages */ |
| 106 A_UINT32 reserved:2; | 113 A_UINT32 reserved:2; |
| 107 } dbglog_config; | 114 } dbglog_config; |
| 108 | 115 |
| 109 A_UINT32 value; | 116 A_UINT32 value; |
| 110 } u; | 117 } u; |
| 111 }; | 118 } POSTPACK; |
| 112 | 119 |
| 113 #define cfgmmask u.dbglog_config.mmask | 120 #define cfgmmask u.dbglog_config.mmask |
| 114 #define cfgrep u.dbglog_config.rep | 121 #define cfgrep u.dbglog_config.rep |
| 115 #define cfgtsr u.dbglog_config.tsr | 122 #define cfgtsr u.dbglog_config.tsr |
| 116 #define cfgsize u.dbglog_config.size | 123 #define cfgsize u.dbglog_config.size |
| 117 #define cfgvalue u.value | 124 #define cfgvalue u.value |
| 118 | 125 |
| 119 #ifdef __cplusplus | 126 #ifdef __cplusplus |
| 120 } | 127 } |
| 121 #endif | 128 #endif |
| 122 | 129 |
| 130 #ifndef ATH_TARGET |
| 131 #include "athendpack.h" |
| 132 #endif |
| 133 |
| 123 #endif /* _DBGLOG_H_ */ | 134 #endif /* _DBGLOG_H_ */ |
| OLD | NEW |