Implement Silicom card features #1
1 changed files with 60 additions and 1 deletions
|
@ -3083,6 +3083,60 @@ static void DumpConfig(void)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static fm_status VerifyConfig(void)
|
||||||
|
{
|
||||||
|
fm_uint32 idx;
|
||||||
|
fm_uint32 subLed;
|
||||||
|
fm_status status;
|
||||||
|
|
||||||
|
status = FM_OK;
|
||||||
|
|
||||||
|
if (hwCfg.numResId > 0)
|
||||||
|
{
|
||||||
|
for(idx = 0; idx < hwCfg.numResId; ++idx)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
hwCfg.hwResId[idx].xcvrI2cBusSel.busSelType == BUS_SEL_TYPE_PCA_IO &&
|
||||||
|
hwCfg.hwResId[idx].xcvrStateIo.ioIdx >= hwCfg.numPcaIo
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||||
|
"hwResourceId %d xcvrI2C.pcaIo.index is out of range.\n",
|
||||||
|
idx);
|
||||||
|
status = FM_ERR_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
(hwCfg.hwResId[idx].xcvrStateIo.intfType == INTF_TYPE_SFPP || hwCfg.hwResId[idx].xcvrStateIo.intfType == INTF_TYPE_QSFP) &&
|
||||||
|
hwCfg.hwResId[idx].xcvrStateIo.ioIdx >= hwCfg.numPcaIo
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||||
|
"hwResourceId %d xcvrState.pcaIo.index is out of range.\n",
|
||||||
|
idx);
|
||||||
|
status = FM_ERR_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
for(subLed = 0; subLed < NUM_SUB_LED; ++subLed){
|
||||||
|
if (
|
||||||
|
hwCfg.hwResId[idx].portLed[0].subLed[subLed].usage == LED_USAGE_LINK &&
|
||||||
|
hwCfg.hwResId[idx].portLed[0].subLed[subLed].pin >= hwCfg.numPcaIo
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||||
|
"hwResourceId %d LED pcaIo.index is out of range.\n",
|
||||||
|
idx);
|
||||||
|
status = FM_ERR_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* SetupMuxPathRcrsv
|
/* SetupMuxPathRcrsv
|
||||||
|
@ -3845,7 +3899,6 @@ ABORT:
|
||||||
* Public Functions
|
* Public Functions
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* fmPlatformLibInit
|
/* fmPlatformLibInit
|
||||||
* \ingroup platformLib
|
* \ingroup platformLib
|
||||||
|
@ -3924,6 +3977,12 @@ fm_status fmPlatformLibInit(void)
|
||||||
DumpConfig();
|
DumpConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status = VerifyConfig();
|
||||||
|
if(status != FM_OK)
|
||||||
|
{
|
||||||
|
goto ABORT;
|
||||||
|
}
|
||||||
|
|
||||||
if (strlen(hwCfg.fileLockName) > 0)
|
if (strlen(hwCfg.fileLockName) > 0)
|
||||||
{
|
{
|
||||||
hwCfg.fileLock =
|
hwCfg.fileLock =
|
||||||
|
|
Loading…
Reference in a new issue