rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2016 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | /************************************************************* |
| 36 | * |
| 37 | * This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc. |
| 38 | * |
| 39 | * Any unauthorized use inconsistent with the terms of such license is strictly prohibited. |
| 40 | * |
| 41 | * Copyright (c) 2002-2010 VIA Telecom, Inc. All rights reserved. |
| 42 | * |
| 43 | *************************************************************/ |
| 44 | /************************************************************************* |
| 45 | * |
| 46 | * File Name: itrace.h |
| 47 | * Project: Protocol Engine tracing header file |
| 48 | * |
| 49 | * Original Author: Stuart Harker |
| 50 | * Creation Date: August 10, 1998 |
| 51 | * |
| 52 | * Description: |
| 53 | * |
| 54 | * Restrictions: |
| 55 | * Dependencies: |
| 56 | * |
| 57 | ************************************************************************** |
| 58 | ************************************************************************** |
| 59 | * |
| 60 | * RCS Log Information |
| 61 | * |
| 62 | * $Revision: 1.2 $ |
| 63 | * |
| 64 | * $Log: itrace.h $ |
| 65 | * |
| 66 | * 10 27 2017 sue.zhong |
| 67 | * [MOLY00284146] [MT6763][SMO][C2K]Remove relative include path in source and header file |
| 68 | * . |
| 69 | * |
| 70 | * |
| 71 | ************************************************************************/ |
| 72 | |
| 73 | #ifndef _ITRACE_H_ |
| 74 | #define _ITRACE_H_ 1 |
| 75 | |
| 76 | #include "kal_public_defs.h" |
| 77 | #include "kal_public_api.h" |
| 78 | |
| 79 | /* Each Protocol Engine module has a unique ID */ |
| 80 | /* ********* DO NOT MODIFY ********** */ |
| 81 | enum |
| 82 | { |
| 83 | ISOLIB_ENGINE_ID, /* ISOLIB modules */ |
| 84 | CP_ENGINE_ID, /* Call Processing engine */ |
| 85 | RLP_ENGINE_ID, /* RLP protocol engine */ |
| 86 | PPP_ENGINE_ID, /* PPP protocol engine */ |
| 87 | TCPIP_ENGINE_ID, /* TCP/IP/UDP protocol engine */ |
| 88 | NSPE_ENGINE_ID, /* NSPE protocol engine */ |
| 89 | APPINT_ENGINE_ID, /* AppInt protocol engine */ |
| 90 | LAYER1_ENGINE_ID, /* Layer 1 driver engine */ |
| 91 | SMS_ENGINE_ID, /* SMS PE */ |
| 92 | OTA_ENGINE_ID, /* OTA PE */ |
| 93 | MEM_ENGINE_ID, /* MEM utility */ |
| 94 | SCC_ENGINE_ID, /* SCC */ |
| 95 | BIC_ENGINE_ID, /* Beta Interface Controller */ |
| 96 | MB_ENGINE_ID, |
| 97 | MCM_ENGINE_ID, |
| 98 | CSS_ENGINE_ID, /*Custom System Selection*/ |
| 99 | EXT_APPINT_ENGINE_ID, /*Extended AppInt protocol engine */ |
| 100 | NUM_ENGINE_IDS /* this must be last */ |
| 101 | }; |
| 102 | typedef kal_uint8 ProtocolEngineID; |
| 103 | |
| 104 | /***************************************************************************** |
| 105 | * Trace definitions |
| 106 | ****************************************************************************/ |
| 107 | #define TOKEN_TRACING 0 |
| 108 | #define STRING_TRACING 1 |
| 109 | |
| 110 | #ifdef TRACEON |
| 111 | |
| 112 | #define TRACE_TABLE(name,id,len) const char* name[len] |
| 113 | |
| 114 | #ifndef ITRACE_TYPE |
| 115 | #define ITRACE_TYPE TOKEN_TRACING |
| 116 | #endif |
| 117 | |
| 118 | /* enable Tracing in the engine code */ |
| 119 | #define TraceIt |
| 120 | |
| 121 | /* Trace levels; LEVEL0 = little detail; LEVEL5 = lots of detail */ |
| 122 | typedef enum |
| 123 | { |
| 124 | LEVEL0=0, |
| 125 | LEVEL1, |
| 126 | LEVEL2, |
| 127 | LEVEL3, |
| 128 | LEVEL4, |
| 129 | LEVEL5 |
| 130 | } TraceLevel; |
| 131 | |
| 132 | |
| 133 | /* this is the maximum number of categories per engine */ |
| 134 | #define MAX_NUM_TRACE_CATEGORIES 100 |
| 135 | |
| 136 | |
| 137 | /***************************************************************************** |
| 138 | * Trace Function Prototypes |
| 139 | ****************************************************************************/ |
| 140 | |
| 141 | #ifdef __cplusplus |
| 142 | extern "C" { |
| 143 | #endif |
| 144 | |
| 145 | |
| 146 | #if (ITRACE_TYPE == TOKEN_TRACING) |
| 147 | |
| 148 | #define TRACE_INSTALL(s, i) static const kal_uint8 MyNameID = i; |
| 149 | |
| 150 | void engTraceEvent (const ProtocolEngineID engine_id, |
| 151 | const kal_uint8 cat, const kal_uint8 level, |
| 152 | const kal_uint8 moduleId, const kal_uint8 token, |
| 153 | kal_uint8 size1, kal_uint8 *var1, |
| 154 | kal_uint8 size2, kal_uint8 *var2); |
| 155 | |
| 156 | void engTraceIndexEvent (const ProtocolEngineID engineId, |
| 157 | const kal_uint8 cat, const kal_uint8 level, |
| 158 | const kal_uint8 modId, const kal_uint8 token, |
| 159 | kal_uint16 tableID, kal_uint16 index); |
| 160 | |
| 161 | void engTraceStringEvent (const ProtocolEngineID engine_id, |
| 162 | const kal_uint8 cat, const kal_uint8 level, |
| 163 | const kal_uint8 mod_id, const kal_uint8 token, |
| 164 | char *var1); |
| 165 | |
| 166 | void engTraceDataEvent (const ProtocolEngineID engineId, |
| 167 | const kal_uint8 cat, const kal_uint8 level, |
| 168 | const kal_uint8 moduleId, const kal_uint8 token, |
| 169 | int size, kal_uint8 *var1); |
| 170 | |
| 171 | #ifdef SYS_DEBUG_FAULT_FILE_INFO |
| 172 | |
| 173 | void engAssert (const ProtocolEngineID engineId, const kal_uint8 moduleId, |
| 174 | const char *filename, unsigned line); |
| 175 | |
| 176 | #else |
| 177 | |
| 178 | void engAssert (const ProtocolEngineID engineId, const kal_uint8 moduleId, |
| 179 | unsigned line); |
| 180 | |
| 181 | #endif /* SYS_DEBUG_FAULT_FILE_INFO */ |
| 182 | |
| 183 | |
| 184 | #else /* !TOKEN_TRACING */ |
| 185 | |
| 186 | #define TRACE_INSTALL(s, i) static const char MyName[] = s; |
| 187 | |
| 188 | void engTraceEvent (const ProtocolEngineID engine_id, |
| 189 | const kal_uint8 cat, const kal_uint8 level, |
| 190 | const char *modName, |
| 191 | char *string, kal_uint8 size1, void *var1, |
| 192 | kal_uint8 size2, void *var2); |
| 193 | |
| 194 | void engTraceIndexEvent (const ProtocolEngineID engineId, |
| 195 | const kal_uint8 cat, const kal_uint8 level, |
| 196 | const char* modName, |
| 197 | char* string, const char* table[], |
| 198 | kal_uint16 index); |
| 199 | |
| 200 | void engTraceStringEvent (const ProtocolEngineID engine_id, |
| 201 | const kal_uint8 cat, const kal_uint8 level, |
| 202 | const char *modName, |
| 203 | char *string, char *var1); |
| 204 | |
| 205 | void engTraceDataEvent (const ProtocolEngineID engineId, |
| 206 | const kal_uint8 cat, const kal_uint8 level, |
| 207 | const char *modName, |
| 208 | char *str, int size, kal_uint8 *var1); |
| 209 | |
| 210 | void engAssert (const char *modName, unsigned line); |
| 211 | |
| 212 | #endif /* ITRACE_TYPE */ |
| 213 | |
| 214 | |
| 215 | #ifdef __cplusplus |
| 216 | } |
| 217 | #endif |
| 218 | |
| 219 | #else /* !TRACEON */ |
| 220 | #define TRACE_INSTALL(s, i) |
| 221 | |
| 222 | #endif /* TRACEON */ |
| 223 | #endif /* _ITRACE_H_ */ |
| 224 | |