📄 devlib.c
字号:
&ixf18100SonetFuncPtrs, /* SONET routines*/
&ixf18100XgmacFuncPtrs /* XGMAC routines */
};
#endif /* INCLUDE_18100_LIB */
/*****************************************************************************
**** IXF16121 ****
*****************************************************************************/
#ifdef INCLUDE_16121_LIB
/* Function Pointers for the Ixf16121 Chip */
const CommonFunctionPointers_t ixf16121CommonFuncPtrs =
{
Ixf16121InitChip, /* InitChip */
Ixf16121InitAllocMemory, /* InitAllocMemory */
Ixf16121DeAllocMemory, /* DeAllocMemory */
NULL, /* GetStatus */
NULL, /* GetOpMode */
NULL, /* SetOpMode */
Ixf16121Reset, /* Reset */
Ixf16121InitAlarmCallback, /* InitAlarmCallback */
Ixf16121ChipIsr, /* ChipIsr */
Ixf16121CfgTest, /* CfgTest */
Ixf16121GetCounters, /* GetCounters */
Ixf16121GetChipInfo, /* GetChipInfo */
Ixf16121SetChipOnline, /* SetChipOnline */
Ixf16121SetChipOffline, /* SetChipOffline */
Ixf16121SetAlarmCfg, /* SetAlarmCfg */
Ixf16121GetBuildVersion, /* GetBuildVersion */
Ixf16121Read, /* Read */
Ixf16121Write, /* Write */
Ixf16121GetCfg, /* GetCfg */
Ixf16121SetCfg /* SetCfg */
};
const SonetFunctionPointers_t ixf16121SonetFuncPtrs =
{
Ixf16121GetWindowSize, /* GetWindow */
Ixf16121SetWindowSize, /* SetWindow */
Ixf16121SetBERThreshold, /* Set BER Threshold */
Ixf16121GetTrace, /* GetTrace */
Ixf16121SetTrace, /* SetTrace */
Ixf16121GetOhBytes, /* GetOhBytes */
Ixf16121SetOhByte, /* SetOhBytes */
Ixf16121SetRmstSourceBytes, /* SetRmstSourceBytes */
Ixf16121GetRmstSourceBytes, /* GetRmstSourceBytes */
Ixf16121MapFrames, /* MapFrame */
Ixf16121GetMappedFrames, /* GetMappedFrame */
Ixf16121GetFramesAuPointer /* GetAuPointer */
};
const ChipFunctionPointers_t ixf16121FuncPtrs =
{
&ixf16121CommonFuncPtrs, /* COMMON routines */
&ixf16121SonetFuncPtrs, /* SONET routines*/
NULL /* XGMAC routines */
};
#endif /* INCLUDE_16121_LIB */
#ifdef INCLUDE_GENERIC_LIB
/* Function Pointers for the Generic Chip */
const CommonFunctionPointers_t genericCommonFuncPtrs =
{
NULL, /* InitChip */
NULL, /* InitAllocMemory */
NULL, /* DeAllocMemory */
NULL, /* GetStatus */
NULL, /* GetOpMode */
NULL, /* SetOpMode */
NULL, /* Reset */
NULL, /* InitAlarmCallback */
NULL, /* ChipIsr */
NULL, /* CfgTest */
NULL, /* GetCounters */
NULL, /* GetChipInfo */
NULL, /* SetChipOnline */
NULL, /* SetChipOffline */
NULL, /* SetAlarmCfg */
GenericDriverGetBuildVersion, /* GetBuildVersion */
GenericDriverRead, /* Read */
GenericDriverWrite, /* Write */
NULL, /* GetCfg */
NULL /* SetCfg */
};
const ChipFunctionPointers_t genericFuncPtrs =
{
&genericCommonFuncPtrs, /* COMMON routines */
NULL, /* SONET routines*/
NULL /* XGMAC routines */
};
#endif /* INCLUDE_GENERIC_LIB */
/*****************************************************************************
*********** CHIP ARRAY FUNCTION POINTER DEFINITION *********
*****************************************************************************/
typedef struct{
bb_ChipType_e chipType;
ChipFunctionPointers_t* funcPtr;
} ChipFuncTableItem_t;
static const ChipFuncTableItem_t chipFuncTable[] =
{
#ifdef INCLUDE_6048_LIB
{bb_6048_CHIP, (ChipFunctionPointers_t *)&ixf6048FuncPtrs},
#endif
#ifdef INCLUDE_6192_LIB
{bb_6192_CHIP, &ixf6192FuncPtrs},
#endif
#ifdef INCLUDE_18100_LIB
{bb_18100_CHIP, &ixf18100FuncPtrs},
#endif
#ifdef INCLUDE_16121_LIB
{bb_16121_CHIP, &ixf16121FuncPtrs},
#endif
#ifdef INCLUDE_GENERIC_LIB
{bb_DVBOARD_16121, &genericFuncPtrs},
{bb_GENERIC_CHIP, &genericFuncPtrs} /* THIS MUST BE ALWAYS AT THE END*/
#else
{bb_GENERIC_CHIP, NULL}
#endif
};
ChipFunctionPointers_t* getChipFuncPtr(bb_ChipType_e chipType)
{
int i = 0;
while( chipFuncTable[i].chipType != bb_GENERIC_CHIP)
{
if (chipFuncTable[i].chipType == chipType)
break;
else
i++;
}
return (chipFuncTable[i].funcPtr);
}
bb_ChipType_e checkChipType(bb_ChipType_e chipType)
{
int i = 0;
while( chipFuncTable[i].chipType != bb_GENERIC_CHIP)
{
if (chipFuncTable[i].chipType == chipType)
break;
else
i++;
}
return (chipFuncTable[i].chipType);
}
/* Table of all valid chips with API Function Pointers initialized */
const ChipFunctionPointers_t *chipArrayFuncPtrs[] =
{
NULL,
NULL,
NULL,
#ifdef INCLUDE_6048_LIB
&ixf6048FuncPtrs,
#else
NULL,
#endif
NULL,
#ifdef INCLUDE_6192_LIB
&ixf6192FuncPtrs,
#else
NULL,
#endif
NULL,
NULL,
#ifdef INCLUDE_18100_LIB
&ixf18100FuncPtrs,
#else
NULL,
#endif
NULL,
NULL,
NULL,
NULL,
#ifdef INCLUDE_16121_LIB
&ixf16121FuncPtrs,
#else
NULL,
#endif
NULL,
NULL,
NULL,
NULL, /* OIF/Misc. board control logical FPGA for 1810x */
NULL, /* STB SOH Insertion FPGA for IXF 16121 */
NULL, /* STB SOH Extraction FPGA for IXF 16121 */
NULL, /* STB SAL/PAL Insertion FPGA for IXF 16121 */
NULL, /* STB SAL/PAL Extraction FPGA for IXF 16121 */
NULL, /* DV Board for IXF 16121 */
#ifdef INCLUDE_GENERIC_LIB
&genericFuncPtrs,
#else
NULL,
#endif
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -