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

📄 txc_envoy_spi3_api.c

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

   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_PortCtrlSet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
                     TXC_U16BIT port, TXC_IfSPI3_PORT_CTRL_STRUCT  *spi3PortCtrlPtr)
{
    TXC_U16BIT error;

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

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

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_SetSpi3PortCtrlVirtual (handle, port, spi3PortCtrlPtr); */
#else
    
        error = ENVOY_SetSpi3PortCtrlReal (handle, port, spi3PortCtrlPtr);
#endif

    }

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



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

   FUNCTION:  TXC_IfSPI3_PortCtrlGet

   DESCRIPTION: This function gets the configuration of the SPI-3 port enable status per 
                device and per port granularity.

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3PortCtrlPtr: a pointer to type TXC_IfSPI3_PORT_CTRL_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_PortCtrlGet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
                        TXC_U16BIT port, TXC_IfSPI3_PORT_CTRL_STRUCT  *spi3PortCtrlPtr)
{
    TXC_U16BIT error;

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

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

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_GetSpi3PortCtrlVirtual (handle, port, spi3PortCtrlPtr); */
#else
    
        error = ENVOY_GetSpi3PortCtrlReal (handle, port, spi3PortCtrlPtr);
#endif

    }

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





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

   FUNCTION:  TXC_IfSPI3_InputFlowCtrlCfgSet

   DESCRIPTION: This function configures the flow control parameters associated 
                with the SPI-3 Input Interface on per device and per-port granularity.

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3InputFlowCtrlDataPtr: a pointer to type TXC_IfSPI3_INPUT_FLOW_CTRL_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_InputFlowCtrlCfgSet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
           TXC_U16BIT port, TXC_IfSPI3_INPUT_FLOW_CTRL_STRUCT  *spi3InputFlowCtrlDataPtr)
{
    TXC_U16BIT error;
    TXC_U16BIT error1 = TXC_NO_ERR;
    TXC_U16BIT error2 = TXC_NO_ERR;

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

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

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error2 = ENVOY_SetSpi3InputFlowCtrlCfgVirtual (handle, port, spi3InputFlowCtrlDataPtr); */
#else
    
        error2 = ENVOY_SetSpi3InputFlowCtrlCfgReal (handle, port, spi3InputFlowCtrlDataPtr);
#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_InputFlowCtrlCfgGet

   DESCRIPTION: This function gets the flow control parameters associated with
                the SPI-3 Input Interface on per device and per-port granularity.

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3InputFlowCtrlDataPtr: a pointer to type TXC_IfSPI3_INPUT_FLOW_CTRL_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_InputFlowCtrlCfgGet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
           TXC_U16BIT port, TXC_IfSPI3_INPUT_FLOW_CTRL_STRUCT  *spi3InputFlowCtrlDataPtr)
{
    TXC_U16BIT error;

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

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

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error = ENVOY_SetSpi3InputFlowCtrlCfgVirtual (handle, port, spi3InputFlowCtrlDataPtr); */
#else
    
        error = ENVOY_GetSpi3InputFlowCtrlCfgReal (handle, port, spi3InputFlowCtrlDataPtr);
#endif

    }

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



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

   FUNCTION:  TXC_IfSPI3_OutputFlowCtrlCfgSet

   DESCRIPTION: This function configures the flow control parameters associated 
                with the SPI-3 Output Interface on per device and per-port granularity.

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3OutputFlowCtrlDataPtr: a pointer to type TXC_IfSPI3_OUTPUT_FLOW_CTRL_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_OutputFlowCtrlCfgSet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
      TXC_U16BIT port, TXC_IfSPI3_OUTPUT_FLOW_CTRL_STRUCT  *spi3OutputFlowCtrlDataPtr)
{
    TXC_U16BIT error = TXC_NO_ERR;
    TXC_U16BIT error1 = TXC_NO_ERR;
    TXC_U16BIT error2 = TXC_NO_ERR;

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

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

#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE

     /* error2 = ENVOY_SetSpi3OutputFlowCtrlCfgVirtual (handle, port, spi3OutputFlowCtrlDataPtr); */
#else
    
        error2 = ENVOY_SetSpi3OutputFlowCtrlCfgReal (handle, port, spi3OutputFlowCtrlDataPtr);
#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_OutputFlowCtrlCfgGet

   DESCRIPTION: This function gets the configuration associated with the SPI-3 Output
                Interface Flow Control on per device and per-port granularity.

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

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

           spi3OutputFlowCtrlDataPtr: a pointer to type TXC_IfSPI3_OUTPUT_FLOW_CTRL_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_OutputFlowCtrlCfgGet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
      TXC_U16BIT port, TXC_IfSPI3_OUTPUT_FLOW_CTRL_STRUCT  *spi3OutputFlowCtrlDataPtr)

⌨️ 快捷键说明

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