⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpldebug.h

📁 NATIONAL公司DP83816芯片Linux下驱动
💻 H
字号:

//**********************************************************************
//
//  MPLDEBUG.H
//
//  Copyright (c) 2004 National Semiconductor Corporation.
//  All Rights Reserved
//
//  MPL Debug related definitions
//
//**********************************************************************

#ifndef _MPLDEBUG_H_
#define _MPLDEBUG_H_

//**********************************************************************
// Debug Definitions.
//**********************************************************************

// Debug Zones - Add more if needed
// Enable all zones
#define DZONE_ALL                 0xFFFFFFFF

// Mpl Zones
#define DZONE_MPL_INIT_DOWN       0x00000001
#define DZONE_MPL_TRANS           0x00000002
#define DZONE_MPL_RECV            0x00000004
#define DZONE_MPL_INTR            0x00000008
#define DZONE_MPL_LINK            0x00000010
#define DZONE_MPL_PWR             0x00000020
#define DZONE_MPL_DIAG            0x00000040
#define DZONE_MPL_MISC            0x00000080
#define DZONE_MPL_TASK_RX_FILTER  0x00000100
#define DZONE_MPL_TASK_VLAN       0x00000200

// Add more zones here if needed

// The default debug zones to be enabled for function path 
// tracing.
#define DZONE_ENABLED_PATH       (DZONE_MPL_INIT_DOWN |          \
                                  DZONE_MPL_TRANS     |          \
                                  DZONE_MPL_RECV      |          \
                                  DZONE_MPL_INTR      |          \
                                  DZONE_MPL_LINK      |          \
                                  DZONE_MPL_PWR       |          \
                                  DZONE_MPL_DIAG      |          \
                                  DZONE_MPL_MISC      |          \
                                  DZONE_MPL_TASK_RX_FILTER)

// The default debug zones to be enabled for verbose message
// display and asserts.
#define DZONE_ENABLED_MSG_CHECKS (DZONE_MPL_INIT_DOWN |          \
                                  DZONE_MPL_TRANS     |          \
                                  DZONE_MPL_RECV      |          \
                                  DZONE_MPL_INTR      |          \
                                  DZONE_MPL_LINK      |          \
                                  DZONE_MPL_PWR       |          \
                                  DZONE_MPL_DIAG      |          \
                                  DZONE_MPL_MISC      |          \
                                  DZONE_MPL_TASK_RX_FILTER)

//********** MPL_CHECKED_BUILD ***********
#ifdef MPL_CHECKED_BUILD

extern NS_UINT MplDebugZonePathTracing;
extern NS_UINT MplDebugZoneMsgAndChecks;

// Debug Macros

#define MPL_TRACE(message) { OAI_DEBUG_MSG message; }

#define MPL_BREAK() { OAI_DEBUG_BREAK(); }

#define MPL_TRACEBREAK( message)    \
        {                           \
            MPL_TRACE (message);    \
            MPL_BREAK();            \
        }

#define MPL_ASSERT( logicalExpression)                                      \
        {                                                                   \
            if (!(logicalExpression))                                       \
            {                                                               \
                MPL_TRACE(("MPL Assert: " #logicalExpression "\nline %d, %s\n",\
                (NS_UINT)__LINE__, (NS_PUINT8)__FILE__));                   \
                MPL_BREAK();                                                \
            }                                                               \
        }

// Conditional trace outs
#define MPL_CTRACE( zone, message)                              \
        {                                                       \
            if ((zone) & MplDebugZoneMsgAndChecks)              \
               MPL_TRACE(message);                              \
        }

// Conditional Function Enter
#define MPL_CENTER( zone, functionName)                         \
         {                                                      \
             if ((zone) & MplDebugZonePathTracing)              \
                MPL_TRACE((">>> Enter " #functionName "()\n")); \
         }

// Conditional Function Exit
#define MPL_CEXIT( zone, functionName)                                 \
        {                                                              \
             if ((zone) & MplDebugZonePathTracing)                     \
                MPL_TRACE(("<<< Exit " #functionName"() Line : %d \n", \
                (NS_UINT)__LINE__));                                   \
        }

// Conditional break
#define MPL_CBREAK( zone)                                      \
        {                                                      \
             if ((zone) & MplDebugZoneMsgAndChecks)            \
                MPL_BREAK();                                   \
        }

// Conditional trace-break
#define MPL_CTRACEBREAK( zone, message)                        \
        {                                                      \
             if ((zone) & MplDebugZoneMsgAndChecks)            \
                MPL_TRACEBREAK(message);                       \
        }

// Conditional assert
#define MPL_CASSERT( zone, logicalExpression)                  \
        {                                                      \
             if ((zone) & MplDebugZoneMsgAndChecks)            \
                MPL_ASSERT(logicalExpression);                 \
        }

//********** RETAIL BUILD ***********
#else // !MPL_CHECKED_BUILD

// These do nothing in retail builds.
#define MPL_TRACE(message)
#define MPL_BREAK()
#define MPL_TRACEBREAK(message)
#define MPL_ASSERT(logicalExpression)
#define MPL_CTRACE( zone, message)
#define MPL_CENTER( zone, functionName)
#define MPL_CEXIT( zone, functionName)
#define MPL_CBREAK( zone)
#define MPL_CTRACEBREAK( zone, message)
#define MPL_CASSERT( zone, logicalExpression)

#endif // MPL_CHECKED_BUILD

// Exposed public debug functions. These are defined for retail and checked
// builds, however in retail builds they don't do anything.
#if defined(__cplusplus)
extern "C"
{
#endif

NS_VOID  
    MplDebDumpBuffer(
        IN NS_UINT8 *buffer,
        IN NS_UINT   length);
NS_VOID  
    MplDebDumpWords(
        IN NS_UINT32 *buffer,
        IN NS_UINT length);
NS_VOID  
    MplDebEnablePathTracing(
        IN NS_UINT zones);
NS_VOID  
    MplDebEnableMsgsAndChecks(
        IN NS_UINT zones);
NS_VOID 
    MplDebDumpAdapterRegisters(
        IN NS_VOID  *pMplContext);

#if defined(__cplusplus)
}
#endif 


#endif // _MPLDEBUG_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -