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

📄 txc_envoy_spi3_api.c

📁 TranSwitch Envoy CE2 & Envoy CE4 设备驱动及编程指南
💻 C
📖 第 1 页 / 共 3 页
字号:
{
    TXC_U16BIT error;

    /* check for input parameters */
    error = ENVOY_GetSpi3OutputFlowCtrlCfgValid (handle, interfaceId, port);

    /* process the data if no error */
    if (error == TXC_NO_ERR)
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_GetSpi3OutputFlowCtrlCfgVirtual (handle, port, spi3OutputFlowCtrlDataPtr); */
#else
    
        error = ENVOY_GetSpi3OutputFlowCtrlCfgReal (handle, port, spi3OutputFlowCtrlDataPtr);
#endif

    }

    /* return the error code */
    return error;
}






/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************

   FUNCTION:  TXC_IfSPI3_Ext_InputGlobalCntRtrv

   DESCRIPTION: This function retrieves error counters across the SPI-3 Input I/F.

   INPUTS: handle: Instance of the Envoy device to configure.

           interfaceId: SPI-3 Bus Interface identifier.

           spi3ExtGlobalCountersDataPtr: a pointer to type TXC_IfSPI3_EXT_GLBL_CTR_STRUCT. 

   RETURNS:  TXC_NO_ERR or an appropriate specific error code.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT TXC_IfSPI3_Ext_InputGlobalCntRtrv (TXC_U16BIT handle, TXC_U8BIT interfaceId,
           TXC_IfSPI3_EXT_GLBL_CTR_STRUCT *spi3ExtGlobalCountersDataPtr)
{
    TXC_U16BIT error;

    /* check for input parameters */
    error = ENVOY_RtrvSpi3ExtGlobalCountersValid (handle, interfaceId);

    /* process the data if no error */
    if (error == TXC_NO_ERR)
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_RtrvSpi3ExtGlobalCountersVirtual (handle, spi3ExtGlobalCountersDataPtr); */
#else
    
        error = ENVOY_RtrvSpi3ExtGlobalCountersReal (handle, spi3ExtGlobalCountersDataPtr);
#endif

    }

    /* return the error code */
    return error;
}



/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************

   FUNCTION:  TXC_IfSPI3_Ext_InputGlobalStatusRtrv

   DESCRIPTION: This function retrieves the SPI-3 Input I/F Error Event Status.

   INPUTS: handle: Instance of the Envoy device to configure.

           interfaceId: SPI-3 Bus Interface identifier.

           spi3InputGlobalStatusDataPtr: a pointer to type TXC_IfSPI3_EXT_INPUT_GLBL_STATUS_STRUCT. 

   RETURNS:  TXC_NO_ERR or an appropriate specific error code.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT TXC_IfSPI3_Ext_InputGlobalStatusRtrv (TXC_U16BIT handle, TXC_U8BIT interfaceId,
        TXC_IfSPI3_EXT_INPUT_GLBL_STATUS_STRUCT *spi3InputGlobalStatusDataPtr)
{
    TXC_U16BIT error;

    /* check for input parameters */
    error = ENVOY_RtrvSpi3InputGlobalStatusValid (handle, interfaceId);

    /* process the data if no error */
    if (error == TXC_NO_ERR)
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_RtrvSpi3InputGlobalStatusVirtual (handle, spi3InputGlobalStatusDataPtr); */
#else
    
        error = ENVOY_RtrvSpi3InputGlobalStatusReal (handle, spi3InputGlobalStatusDataPtr);
#endif

    }

    /* return the error code */
    return error;
}




/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************

   FUNCTION:  TXC_IfSPI3_Ext_OutputPortCfgSet

   DESCRIPTION: This function configures the SPI-3 Output I/F port parameters

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3OutputPortCfgDataPtr: a pointer to type TXC_IfSPI3_EXT_OUTPUT_PORT_CFG_STRUCT. 

   RETURNS:  TXC_NO_ERR or an appropriate specific error code.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT TXC_IfSPI3_Ext_OutputPortCfgSet (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port,
                          TXC_IfSPI3_EXT_OUTPUT_PORT_CFG_STRUCT  *spi3OutputPortCfgDataPtr)
{
    TXC_U16BIT error = TXC_NO_ERR;
    TXC_U16BIT error1 = TXC_NO_ERR;
    TXC_U16BIT error2 = TXC_NO_ERR;

    /* check for input parameters */
    error1 = ENVOY_SetSpi3OutputPortCfgValid (handle, interfaceId, port);

    /* process the data if no error */
    if ((error1 == TXC_NO_ERR) || (error1 == TXC_AGGR_DISABLED_WARNING))
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error2 = ENVOY_SetSpi3OutputPortCfgVirtual (handle, port, spi3OutputPortCfgDataPtr); */
#else
    
        error2 = ENVOY_SetSpi3OutputPortCfgReal (handle, port, spi3OutputPortCfgDataPtr);
#endif

    }

    if (error2 == TXC_NO_ERR)
    {
        error = error1;  /* to allow return of a warning */
    }
    else
    {
        error = error2;
    }

    /* return the error code */
    return error;
}



/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************

   FUNCTION:  TXC_IfSPI3_Ext_OutputPortCfgGet

   DESCRIPTION: This function gets the configuration of the SPI-3 Output I/F port parameters

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3OutputPortCfgDataPtr: a pointer to type TXC_IfSPI3_EXT_OUTPUT_PORT_CFG_STRUCT

   RETURNS:  TXC_NO_ERR or an appropriate specific error code.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT TXC_IfSPI3_Ext_OutputPortCfgGet (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port,
                          TXC_IfSPI3_EXT_OUTPUT_PORT_CFG_STRUCT  *spi3OutputPortCfgDataPtr)
{
    TXC_U16BIT error = TXC_NO_ERR;

    /* check for input parameters */
    error = ENVOY_GetSpi3OutputPortCfgValid (handle, interfaceId, port);

    /* process the data if no error */
    if (error == TXC_NO_ERR)
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_GetSpi3OutputPortCfgVirtual (handle, port, spi3OutputPortCfgDataPtr); */
#else
    
        error = ENVOY_GetSpi3OutputPortCfgReal (handle, port, spi3OutputPortCfgDataPtr);
#endif

    }

    /* return the error code */
    return error;
}



/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************

   FUNCTION:  TXC_IfSPI3_PortStatisticsRtrv

   DESCRIPTION: This function retrieves the SPI-3 Packet Statistics from 
                the Input and Output Interfaces.

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3PortStatisticsDataPtr: a pointer to type TXC_IfSPI3_PORT_STATISTICS_STRUCT

   RETURNS:  TXC_NO_ERR or an appropriate specific error code.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
 *--------------------------------------------------------------------------*/

TXC_U16BIT TXC_IfSPI3_PortStatisticsRtrv (TXC_U16BIT handle, TXC_U8BIT interfaceId,
           TXC_U16BIT port, TXC_IfSPI3_PORT_STATISTICS_STRUCT *spi3PortStatisticsDataPtr)
{
    TXC_U16BIT error;

    /* check for input parameters */
    error = ENVOY_RtrvSpi3PortStatisticsValid (handle, interfaceId, port);

    /* process the data if no error */
    if (error == TXC_NO_ERR)
    {

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_RtrvSpi3PortStatisticsVirtual (handle, port, spi3PortStatisticsDataPtr); */
#else
    
        error = ENVOY_RtrvSpi3PortStatisticsReal (handle, port, spi3PortStatisticsDataPtr);
#endif

    }
    /* return the error code */
    return error;
}



/****************************************************************************
 **                              End of Module                             **
 ****************************************************************************/

⌨️ 快捷键说明

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