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

📄 ixparityenaccmain.c

📁 有关ARM开发板上的IXP400网络驱动程序的源码以。
💻 C
📖 第 1 页 / 共 5 页
字号:
                break;            } /* end of case NPE - C DMEM */            case IX_PARITYENACC_NPE_C_EXT:            {                ixParityENAccPEParityErrorStats.npeStats.parityErrorsExternal++;                break;            } /* end of case NPE - C EXT */            default:            {                IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDERR,                     "ixParityENAccParityErrorContextGet(): "                    "Invalid Parity Source: %0x\n", pecMessage->pecParitySource, 0,0,0,0,0);                return IX_PARITYENACC_OPERATION_FAILED;          } /* end of case default */        } /* end of switch */        return IX_PARITYENACC_SUCCESS;    } /* end of if (TRUE == ixIcParityInterruptStatus.npeCParityInterrupt) */    if (TRUE == ixIcParityInterruptStatus.swcpParityInterrupt)    {        if (IX_SUCCESS != ixParityENAccSwcpPEParityErrorContextFetch (                              &ixSwcpPECMsg))        {            return IX_PARITYENACC_OPERATION_FAILED;        } /* end of if */        pecMessage->pecParitySource = ixSwcpPECMsg.swcpParitySource;        pecMessage->pecAccessType = ixSwcpPECMsg.swcpAccessType;        /* Increment statistics */        ixParityENAccPEParityErrorStats.swcpStats++;        return IX_PARITYENACC_SUCCESS;    } /* end of if (TRUE == ixIcParityInterruptStatus.swcpParityInterrupt) */    if (TRUE == ixIcParityInterruptStatus.aqmParityInterrupt)    {        if (IX_SUCCESS != ixParityENAccAqmPEParityErrorContextFetch(                              &ixAqmPECMsg))        {            return IX_PARITYENACC_OPERATION_FAILED;        } /* end of if */        pecMessage->pecParitySource = ixAqmPECMsg.aqmParitySource;        pecMessage->pecAccessType   = ixAqmPECMsg.aqmAccessType;        pecMessage->pecAddress      = ixAqmPECMsg.aqmParityAddress;        pecMessage->pecData         = ixAqmPECMsg.aqmParityData;        /* Increment statistics */        ixParityENAccPEParityErrorStats.aqmStats++;        return IX_PARITYENACC_SUCCESS;    } /* end of if (TRUE == ixIcParityInterruptStatus.aqmParityInterrupt) */    if (TRUE == ixIcParityInterruptStatus.pbcParityInterrupt)    {        if (IX_SUCCESS != ixParityENAccPbcPEParityErrorContextFetch(                              &ixPbcPECMsg))        {            return IX_PARITYENACC_OPERATION_FAILED;        } /* end of if */        pecMessage->pecParitySource = ixPbcPECMsg.pbcParitySource;        pecMessage->pecAccessType   = ixPbcPECMsg.pbcAccessType;        /* Increment statistics */        switch (pecMessage->pecParitySource)        {            case IX_PARITYENACC_PBC_INITIATOR:            {                ixParityENAccPEParityErrorStats.pbcStats.parityErrorsPciInitiator++;                break;            } /* end of case PCI Initiator interface */            case IX_PARITYENACC_PBC_TARGET:            {                ixParityENAccPEParityErrorStats.pbcStats.parityErrorsPciTarget++;                break;            } /* end of case PCI Target interface */            default:            {                IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDERR,                     "ixParityENAccParityErrorContextGet(): "                    "Invalid Parity Source: %0x\n", pecMessage->pecParitySource, 0,0,0,0,0);                return IX_PARITYENACC_OPERATION_FAILED;          } /* end of case default */        } /* end of switch */        return IX_PARITYENACC_SUCCESS;    } /* end of if (TRUE == ixIcParityInterruptStatus.pbcParityInterrupt) */    if (TRUE == ixIcParityInterruptStatus.ebcParityInterrupt)    {        if (IX_SUCCESS != ixParityENAccEbcPEParityErrorContextFetch(                              &ixEbcPECMsg))        {            return IX_PARITYENACC_OPERATION_FAILED;        } /* end of if */        pecMessage->pecParitySource = ixEbcPECMsg.ebcParitySource;        pecMessage->pecAccessType   = ixEbcPECMsg.ebcAccessType;        pecMessage->pecAddress      = ixEbcPECMsg.ebcParityAddress;        /* Increment statistics */        switch (pecMessage->pecParitySource)        {            case IX_PARITYENACC_EBC_CS:            {                ixParityENAccPEParityErrorStats.ebcStats.parityErrorsOutbound++;                break;            } /* end of case EBC CS */            case IX_PARITYENACC_EBC_EXTMST:            {                ixParityENAccPEParityErrorStats.ebcStats.parityErrorsInbound++;                break;            } /* end of case EBC EXT Master */                 default:            {                IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDERR,                    "ixParityENAccParityErrorContextGet(): "                    "Invalid Parity Source: %0x\n", pecMessage->pecParitySource, 0,0,0,0,0);                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of case default */        } /* end of switch */        return IX_PARITYENACC_SUCCESS;    } /* end of if (TRUE == ixIcParityInterruptStatus.ebcParityInterrupt) */#ifndef NDEBUG    IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_USER, IX_OSAL_LOG_DEV_STDOUT,        "ixParityENAccParityErrorContextGet():"        "No Parity Interrupt Observed\n",0,0,0,0,0,0);#endif /* end of #ifndef NDEBUG */    return IX_PARITYENACC_NO_PARITY;} /* end of ixParityENAccParityErrorContextGet() function */ PUBLIC IxParityENAccStatusixParityENAccParityErrorInterruptClear (    const IxParityENAccParityErrorContextMessage *pecMessage){    /* Local variables */    IxParityENAccPbcPEParityErrorContext ixPbcPECMsg;    /* Not initialised before? */    if (FALSE == ixParityENAccInitStatus)    {        return IX_PARITYENACC_NOT_INITIALISED;    } /* end of if */    if ((IxParityENAccParityErrorContextMessage *) NULL == pecMessage)    {        return IX_PARITYENACC_INVALID_PARAMETERS;    } /* end of if */    /* Delegate to the respective sub-module */    switch (pecMessage->pecParitySource)    {        case IX_PARITYENACC_NPE_A_IMEM:        case IX_PARITYENACC_NPE_A_DMEM:        case IX_PARITYENACC_NPE_A_EXT:        {            if (IX_SUCCESS != ixParityENAccNpePEParityInterruptClear(                                  IXP400_PARITYENACC_PE_NPE_A))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case NPE-A */               case IX_PARITYENACC_NPE_B_IMEM:        case IX_PARITYENACC_NPE_B_DMEM:        case IX_PARITYENACC_NPE_B_EXT:        {            if (IX_SUCCESS != ixParityENAccNpePEParityInterruptClear(                                  IXP400_PARITYENACC_PE_NPE_B))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case NPE-B */               case IX_PARITYENACC_NPE_C_IMEM:        case IX_PARITYENACC_NPE_C_DMEM:        case IX_PARITYENACC_NPE_C_EXT:        {            if (IX_SUCCESS != ixParityENAccNpePEParityInterruptClear(                                  IXP400_PARITYENACC_PE_NPE_C))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case NPE-C */               case IX_PARITYENACC_SWCP:        {            if (IX_SUCCESS != ixParityENAccSwcpPEParityInterruptClear())            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case SWCP */                case IX_PARITYENACC_AQM:        {            if (IX_SUCCESS != ixParityENAccAqmPEParityInterruptClear())            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case AQM */             case IX_PARITYENACC_MCU_SBIT:        {            if (IX_SUCCESS != ixParityENAccMcuPEParityInterruptClear(                                  IXP400_PARITYENACC_PE_MCU_SBIT, pecMessage->pecAddress))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case MCU SBIT */        case IX_PARITYENACC_MCU_MBIT:        {            if (IX_SUCCESS != ixParityENAccMcuPEParityInterruptClear(                                  IXP400_PARITYENACC_PE_MCU_MBIT, pecMessage->pecAddress))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case MCU MBIT */        case IX_PARITYENACC_MCU_OVERFLOW:        {            if (IX_SUCCESS != ixParityENAccMcuPEParityInterruptClear(                                  IXP400_PARITYENACC_PE_MCU_OVERFLOW, pecMessage->pecAddress))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case MCU OVERFLOW */                case IX_PARITYENACC_PBC_INITIATOR:        case IX_PARITYENACC_PBC_TARGET:        {            ixPbcPECMsg.pbcParitySource = pecMessage->pecParitySource;            ixPbcPECMsg.pbcAccessType = pecMessage->pecAccessType;            if (IX_SUCCESS != ixParityENAccPbcPEParityInterruptClear(                                  ixPbcPECMsg))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case PBC Target */              case IX_PARITYENACC_EBC_CS:        {            if (IX_SUCCESS != ixParityENAccEbcPEParityInterruptClear(                                  IXP400_PARITYENACC_PE_EBC_CS))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case EBC */        case IX_PARITYENACC_EBC_EXTMST:        {            if (IX_SUCCESS != ixParityENAccEbcPEParityInterruptClear(                                  IXP400_PARITYENACC_PE_EBC_EXTMST))            {                return IX_PARITYENACC_OPERATION_FAILED;            } /* end of if */            break;        } /* end of case EBC */             default:        {            IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDERR,                "ixParityENAccParityErrorInterruptClear(): "                "Invalid Parity Source: %0x\n", pecMessage->pecParitySource, 0,0,0,0,0);            return IX_PARITYENACC_INVALID_PARAMETERS;        } /* end of case default */    } /* end of switch */    return IX_PARITYENACC_SUCCESS;} /* end of ixParityENAccParityErrorInterruptClear() */PUBLIC IxParityENAccStatusixParityENAccStatsGet (    IxParityENAccParityErrorStats * const ixParityErrorStats){    /* Not initialised before? */    if (FALSE == ixParityENAccInitStatus)    {        return IX_PARITYENACC_NOT_INITIALISED;    } /* end of if */    if ((IxParityENAccParityErrorStats *) NULL == ixParityErrorStats)    {        return IX_PARITYENACC_INVALID_PARAMETERS;    } /* end of if */    /* Return Parity Error Stats for all hardware blocks */    memcpy((void *)ixParityErrorStats, (void *)&ixParityENAccPEParityErrorStats,        sizeof(IxParityENAccParityErrorStats));    return IX_PARITYENACC_SUCCESS;} /* end of ixParityENAccStatsGet() function */PUBLIC IxParityENAccStatusixParityENAccStatsShow (void){    /* Not initialised before? */    if (FALSE == ixParityENAccInitStatus)    {        return IX_PARITYENACC_NOT_INITIALISED;    } /* end of if */    /* Display Parity Error Stats for all hardware blocks */    IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_USER, IX_OSAL_LOG_DEV_STDOUT,        "NPE Parity Errors (IMem=%u, DMem=%u, Ext Err=%u)\n",        ixParityENAccPEParityErrorStats.npeStats.parityErrorsIMem,        ixParityENAccPEParityErrorStats.npeStats.parityErrorsDMem,        ixParityENAccPEParityErrorStats.npeStats.parityErrorsExternal,0,0,0);    IXP400_PARITYENACC_MSGLOG(IX_OSAL_LOG_LVL_USER, IX_OSAL_LOG_DEV_STDOUT,        "MCU Parity Errors (SBit=%u, MBit=%u, OvrFlow=%u)\n",        ixParityENAccPEParityErrorStats.mcuStats.parityErrorsSingleBit,        ixParityENAccPEParityErrorStats.mcuStats.parityErrorsMultiBit,        ixParityENAccPEParityErrorStats.mcuStats.parityErrorsOverflow,0,

⌨️ 快捷键说明

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