📄 common_def.h
字号:
/*
*---------------------------------------------------------------------------
*
* I N T E L P R O P R I E T A R Y
*
* COPYRIGHT (c) 2001 BY INTEL CORPORATION. ALL RIGHTS
* RESERVED. NO PART OF THIS PROGRAM OR PUBLICATION MAY
* BE REPRODUCED, TRANSMITTED, TRANSCRIBED, STORED IN A
* RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER
* LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,
* MAGNETIC, OPTICAL, CHEMICAL, MANUAL, OR OTHERWISE, WITHOUT
* THE PRIOR WRITTEN PERMISSION OF :
*
* INTEL CORPORATION
*
* 2200 MISSION COLLEGE BLVD
*
* SANTA CLARA, CALIFORNIA 95052-8119
*
*---------------------------------------------------------------------------
*
*
* AUTHOR: $Author: lagarwal $
* DATE: $Date: 2002/11/15 17:51:11 $
* LAST MODIFIED: $Modtime: 4/29/02 8:45a $
* REV#: $Revision: 1.1.1.1 $
* LOGFILE: $Logfile: /SFT Platform/Include/common_def.h $
* WORKFILE: $Workfile: common_def.h $
*
* --------------------------------------------------------------------------
* Project: All
*
* Purpose: This file defines types that are common to all IXF API and driver
* modules
*
* Notes:
*
* --------------------------------------------------------------------------
* CompilerFlags:
* --------------------------------------------------------------------------
* --------------------------------------------------------------------------
* $Log: common_def.h,v $
* Revision 1.1.1.1 2002/11/15 17:51:11 lagarwal
* rename dir
*
* Revision 1.5 2002/09/09 21:49:21 cmah1
* no message
*
* Revision 1.3 2002/07/09 17:09:51 machambe
* no message
*
* Revision 1.2 2002/07/08 14:13:28 machambe
* no message
*
*
* 14 4/29/02 4:48p Ngifford
* Integrated IXF3502 and IXF3503 based on Hailey
*
* 13 4/17/02 2:07p Srodrig1
*
* 12 4/05/02 12:34p Machambe
* Moving the InitRegTable_t here
*
* 11 3/19/02 3:15p Skadrix
* Added 5 new chip types ...
* FPGAs for Hailey STB (4)
* Hailey DV Board
*
* 10 3/02/02 12:04p Jaalliso
* Adding return code section for VTB portion of the driver
*
* 9 2/21/02 3:07p Jaalliso
* Adding bb_FPGA_OIFMISC_1810X
*
* 8 2/14/02 11:23a Jaalliso
* Adding error code for unsupported IXF function
*
* 7 1/30/02 10:38a Machambe
*
* 6 1/08/02 11:10a Kssaepha
* Modified Trace Macros
*
* 5 1/02/02 12:05p Rsood
* Added bb_MAX_NUM_CHIPS to bb_ChipType_e
*
* 4 12/17/01 2:49p Pkjain2
* Added Trace Macros
*
* 3 12/06/01 4:32p Jaalliso
* Putting in bb_WordSize_t
*
* 2 12/05/01 9:33a Machambe
* Moving Error Codes in this file.
*
* 1 12/04/01 1:39p Jaalliso
* Common definitions file
*
* --------------------------------------------------------------------------
*/
#ifndef __COMMON_DEF_H__
#define __COMMON_DEF_H__
/******************************************************************************/
/* Common enum definintions */
/******************************************************************************/
typedef enum /* Identifies type of chip */
{
bb_FPGA_6048_CHIP = 0,
bb_6051_CHIP,
bb_6251_CHIP,
bb_6048_CHIP,
bb_6151_CHIP,
bb_6192_CHIP,
bb_FPGA_INS_6192,
bb_FPGA_EXT_6192,
bb_18100_CHIP,
bb_CENTAUR_CHIP, /* Update with device number */
bb_GIGA_SLT100_CHIP, /* Update with device number */
bb_GIGA_FEC100_CHIP, /* Update with device number */
bb_GIGA_WRAP100_CHIP, /* Update with device number */
bb_16121_CHIP,
bb_FPGA_INS_18100, /* STB insertion FPGA for 1810x */
bb_FPGA_EXT_18100, /* STB extraction FPGA for 1810x */
bb_FPGA_SIF_18100, /* SIF FPGA for ixf1810x */
bb_FPGA_OIFMISC_18100, /* OIF/Misc. board control logical FPGA for 1810x */
bb_FPGA_INS_SOH_16121, /* STB SOH Insertion FPGA for IXF 16121 */
bb_FPGA_EXT_SOH_16121, /* STB SOH Extraction FPGA for IXF 16121 */
bb_FPGA_INS_SALPAL_16121, /* STB SAL/PAL Insertion FPGA for IXF 16121 */
bb_FPGA_EXT_SALPAL_16121, /* STB SAL/PAL Extraction FPGA for IXF 16121 */
bb_DVBOARD_16121, /* DV Board for IXF 16121 */
bb_GENERIC_CHIP, /* Generic Chip */
bb_IXF3502_CHIP, /* IXF3502 -- NRG_042902 */
bb_IXF3503_CHIP, /* IXF3503 -- NRG_042902 */
bb_MAX_NUM_CHIPS
} bb_ChipType_e;
/* Define a Register pointer type that can be casted
based upon the Chip type (16 bit or 8 bit) */
typedef ushort *bb_RegPointer_type;
/******************************************************************************/
/* Common #defines */
/******************************************************************************/
#define TRUE 1
#define FALSE 0
#ifndef NULL
#define NULL ((void*)0) /* For use as NULL pointer value */
#endif
/***********************************************************************
* Error Codes for Driver
**********************************************************************/
typedef enum
{
bb_COMMON_ERROR_OFFSET = 100,
bb_OHT_ERROR_OFFSET = 200,
bb_MAPPER_ERROR_OFFSET = 300,
bb_6048_ERROR_OFFSET = 400,
bb_6192_ERROR_OFFSET = 500,
bb_VTB_ERROR_OFFSET = 600
} bb_ErrorOffsets_e;
typedef enum
{
bb_NO_ERROR = 0, /* Returned by Driver for no error */
/* ---------- Fatal Errors ---------- */
bb_FATAL_ERROR, /* Fatal error codes should be defined here */
bb_GENERAL_ERROR, /* Catch all type of error */
bb_NULL_ADDRESS_ASSIGNED, /* A NULL Base Address has been Assigned */
/* ------------ Common part of Driver ---------- */
bb_NO_CHIP_DATA = bb_COMMON_ERROR_OFFSET, /* pChipData = 0 */
bb_NULL_BASE_ADDR, /* BaseAddress = 0, for chip */
bb_INV_BASE_ADDR, /* BaseAddress not for initialized chip */
bb_INV_CHIP_TYPE, /* Chip type not supported */
bb_NO_CHIP_CFG, /* pChipCfg = 0, for chip */
bb_NO_ALARM_CFG, /* pAlarmCfg = 0, for chip, but Alarm cfg needed */
bb_UNDEF_ALARM_BITS, /* An XxxAlarmCfg uses undefined alarm bits */
bb_STM_MODE_MISMATCH, /* Mismatch between h/w and s/w cfg of STM-0/1 */
bb_INV_SEL_OH_BYTE, /* Invalid SelOhByte */
bb_INV_SEL_OH_BYTES, /* Invalid SelOhBytes */
bb_INV_SEL_COUNTERS, /* Invalid SelCounters */
bb_INV_CHAN_TEST, /* Invalid Test Chan */
bb_INV_PARAMETER, /* Invaild parameter, generic error */
bb_INV_CHIP_SEGMENT, /* Chip segment is invalid */
bb_NULL_ARG, /* null pointer passed as argument to function */
bb_INV_BLOCK_OPERATION, /* operation not supported on this block*/
bb_FN_NOT_SUPPORTED, /* function not supported */
/*------------ OHT part of Driver ---------------*/
bb_JN_TRACE_WRITE_FAIL= bb_OHT_ERROR_OFFSET, /* Write of Expected/Rx/Tx J0,J1,J2 Trace failed */
bb_INV_EXP_JN_FMT, /* The Expected Jn Format is invalid */
bb_TX_J1_FOR_RPTR, /* Cannot set Tx J1 trace for repeater */
bb_POH_PASSTHRU, /* Illegal call; all POH bytes passed through */
bb_OHT_NOT_IN_TEST, /* OHT must be in test mode, to introduce errors */
bb_TX_J0_NOT_CPU, /* For Terminal or ADM, Tx J0 source must = CPU */
bb_INV_EXP_J1_FMT, /* An Invalid Expected J1 Format found */
bb_INV_TX_J1_FMT, /* An Invalid Tx J1 Format found */
bb_NO_OHT_NU_CFG, /* pNuBytes = 0 */
bb_NOT_PROTECTING_MAIN, /* not Main Terminal or ADM, or no Protection h/w */
bb_NOT_TERM_ADM, /* This function valid only for Terminal or ADM */
bb_INV_BKUP_OHT, /* Invalid Protection Allocation */
bb_INV_SEL_OHT_CFG, /* Invalid SelOhtCfg Value Used */
bb_TRACE_ACCESS_FAIL, /* Trace read or write has failed */
bb_INV_TRACE_FORMAT, /* Invalid trace format selected */
bb_INV_TRACE_TYPE, /* Invalid trace type selected */
/*------------ Mapper part of Driver ---------*/
bb_INV_PORT_NUM = bb_MAPPER_ERROR_OFFSET, /* Invalid PortNum */
bb_NO_MPR_CFG, /* pMprCfg = 0 */
bb_INV_ALM_SPEC, /* Invalid AlmSpec */
bb_NO_ADM_CFG, /* pAdmCfg = 0 */
bb_NOT_ADM, /* This chip not configured as an ADM */
bb_INV_TIMESLOT, /* ADM timeslots = 0, or 1-28 */
bb_GET_J2_TYP_ERR,
bb_SET_J2_TYP_ERR,
bb_SET_J2_LEN_ERR,
bb_PORT_NOT_N2_ENBLD,
bb_INV_SIG_LBL,
bb_INV_SEL_AUTO_FDBK, /* Invalid Auto Feedback spec */
bb_INV_TEST_CNFG,
/*------------ ixf6048 part of Driver ----------*/
bb_NO_CHIP_LEVEL_CFG = bb_6048_ERROR_OFFSET, /* Chip Level Config Uninitialised */
bb_INV_RESET_TYPE, /* Invalid Reset Type */
bb_INV_SEL_STATUS_TYPE, /* Invalid Select Status Type */
bb_INV_SEL_CFG_TYPE, /* Invalid Select Cfg Stype */
bb_INVALID_NUM_CHAN_CFG, /* Num Chan Cfg uninitialised */
bb_INVALID_CHAN_CFG, /* Chanel Config invalid*/
bb_INV_UTOPIA_INTERFACE_USED, /* Invalid Utopia Interface */
bb_INV_UTOPIA_MULTI_PHY_USED, /* Invalid Utopia Multi Phy */
bb_INV_ORDERWIRE_PULSE_BYTE_LOCN_USED, /* Invalid OW Pulse Byte Location*/
bb_INV_UNUSED_UTOPIA_PINS_IMP_USED, /* Invalid Unused Utopia Pins Imp*/
bb_INV_POS_UTOPIA_INTERFACE_USED, /* Invalid POS Utopia Interface */
bb_INV_POS_FA_STATUS_USED, /* Invalid POS FA status Used */
bb_INV_POS_RX_VAL_DEASSERT_AT_EOP_USED, /* Invalid POS RX Val deassert ta EOP*/
bb_INV_POS_RX_FA_DEASSERT_ON_LOW_USED, /* Invalid POS FA Deassert on Low*/
bb_INV_CHANEL_MODE_USED, /* Invalid Channel Mode*/
bb_INV_CHAN_IF_CFG_USED, /* Invalid Chan If Config*/
bb_INV_SONET_SDH_CHAN_CFG_USED, /* Invalid SONET SDH Chan Config*/
bb_INV_ATM_CHAN_CFG_USED, /* Invalid ATM Chan Config*/
bb_INV_POS_CHAN_CFG_USED, /* Invalid POS Chan Config*/
bb_INV_LINE_SPEED_USED, /* Invalid Line Speed*/
bb_LOOPBACK_MODE_RX_TX_MISMATCH, /* The RcvIFMode and XmtIFMode Mismatch (Line Loopback Cfg) */
/*------------ ixf6192 part of Driver ----------*/
bb_INV_MAPSLOT_SELECTION = bb_6192_ERROR_OFFSET,/* Invalid selection for mapping slots */
bb_INV_INITIAL_DATA,
bb_ALARMS_NOT_USED,
bb_INV_CHIP_SECTION,
bb_WORD_SIZE_UNSUPPORTED,
bb_INV_POINTER,
/*------------ VTB part of Driver ----------*/
bb_SIF_FPGA_TPMISMATCH = bb_VTB_ERROR_OFFSET /* SIF FPGA Test Pattern mismatch */
} bb_Error_e;
/* Define a word size */
typedef enum
{
ONE_BYTE = 1,
TWO_BYTES = 2,
FOUR_BYTES = 4,
EIGHT_BYTES = 8,
MAX_BYTES
} bb_Word_Size_t;
/* Defines the structure to be used by the InitChip routine */
typedef struct initRegTable
{
bb_RegPointer_type offset;
ushort value;
} InitRegTable_t;
/* Function pointer for Alarm Callbacks */
typedef void (*AlarmCallBack)(
void *pChipData,
ulong AlarmType, /* Type of Alarm */
void *pAlarmStatusCounters); /* -> Alarm status counter ptr*/
#ifdef INCLUDE_TRACE
#ifdef SIMULATOR
extern void PrintToView(char *sString);
#define IXF_FUNC_ENTRY_TRC(fmtStr) \
do {\
char Buffer[129] = "Entering: ";\
strcat(Buffer, fmtStr);\
strcat(Buffer, "\r\n");\
PrintToView(Buffer);\
} while(0);
#define IXF_FUNC_EXIT_TRC(fmtStr, retVal) \
do {\
char Buffer[129] = "Exiting: ";\
strcat(Buffer, fmtStr);\
strcat(Buffer, " with Return Code: %d\r\n");\
sprintf(Buffer, Buffer, retVal);\
PrintToView(Buffer);\
} while(0);
#else /* SIMULATOR */
#define IXF_FUNC_ENTRY_TRC(fmtStr) eprintf(fmtStr)
#define IXF_FUNC_EXIT_TRC(fmtStr, retVal) eprintf(fmtStr, retVal)
#endif /* SIMULATOR */
#else /* INCLUDE_TRACE */
#define IXF_FUNC_ENTRY_TRC(fmtStr)
#define IXF_FUNC_EXIT_TRC(fmtStr, retVal)
#endif /* INCLUDE_TRACE */
#endif /* __COMMON_DEF_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -