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. 17// 18// 19//------------------------------------------------------------------------------ 20//============================================================================== 21// Author(s): ="Atheros" 22//============================================================================== 23 24#ifndef _DBGLOG_H_ 25#define _DBGLOG_H_ 26 27#ifndef ATH_TARGET 28#include "athstartpack.h" 29#endif 30 31#ifdef __cplusplus 32extern "C" { 33#endif 34 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 */ 41 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 */ 45 46/* 47 * Please ensure that the definition of any new module intrduced 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 50 * different modules. 51 */ 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 70 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 */ 74 75#define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0 76#define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF 77 78#define DBGLOG_REPORTING_ENABLED_OFFSET 16 79#define DBGLOG_REPORTING_ENABLED_MASK 0x00010000 80 81#define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17 82#define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000 83 84#define DBGLOG_REPORT_SIZE_OFFSET 20 85#define DBGLOG_REPORT_SIZE_MASK 0x3FF00000 86 87#define DBGLOG_LOG_BUFFER_SIZE 1500 88#define DBGLOG_DBGID_DEFINITION_LEN_MAX 90 89 90PREPACK struct dbglog_buf_s { 91 struct dbglog_buf_s *next; 92 A_UINT8 *buffer; 93 A_UINT32 bufsize; 94 A_UINT32 length; 95 A_UINT32 count; 96 A_UINT32 free; 97} POSTPACK; 98 99PREPACK struct dbglog_hdr_s { 100 struct dbglog_buf_s *dbuf; 101 A_UINT32 dropped; 102} POSTPACK; 103 104PREPACK struct dbglog_config_s { 105 A_UINT32 cfgvalid; /* Mask with valid config bits */ 106 union { 107 /* TODO: Take care of endianness */ 108 struct { 109 A_UINT32 mmask:16; /* Mask of modules with logging on */ 110 A_UINT32 rep:1; /* Reporting enabled or not */ 111 A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */ 112 A_UINT32 size:10; /* Report size in number of messages */ 113 A_UINT32 reserved:2; 114 } dbglog_config; 115 116 A_UINT32 value; 117 } u; 118} POSTPACK; 119 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 125 126#ifdef __cplusplus 127} 128#endif 129 130#ifndef ATH_TARGET 131#include "athendpack.h" 132#endif 133 134#endif /* _DBGLOG_H_ */ 135