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

📄 txc_envoy_spi3_valid.c

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



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

   FUNCTION:  ENVOY_GetSpi3InputFlowCtrlCfgValid

   DESCRIPTION: This function validates the TXC_IfSPI3_InputFlowCtrlCfgGet

   INPUTS:   handle: Instance of the Envoy device to configure
 
             interfaceId: SPI-3 Bus Interface identifier

             port: the logical SPI-3 port ID to access
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_GetSpi3InputFlowCtrlCfgValid (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port)
{
    TXC_U16BIT error;

    /* check the handle, the interfaceId and the port  */
    error = ENVOY_VerifySpi3HandleIfaceIdAndSinglePort (handle, interfaceId, port);

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



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

   FUNCTION:  ENVOY_SetSpi3OutputFlowCtrlCfgValid

   DESCRIPTION: This function validates the TXC_IfSPI3_OutputFlowCtrlCfgSet

   INPUTS:   same as TXC_IfSPI3_OutputFlowCtrlCfgSet
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_SetSpi3OutputFlowCtrlCfgValid (TXC_U16BIT handle, TXC_U8BIT interfaceId,
      TXC_U16BIT port, TXC_IfSPI3_OUTPUT_FLOW_CTRL_STRUCT  *spi3OutputFlowCtrlDataPtr)
{
    TXC_U16BIT error;
    ENVOY_DEV_EXT_PIN_STRUCT pinData;

    /* fill the structure with 0 */
    memset ((void *) &pinData, 0, sizeof (pinData));

    /* first, check the handle and the interfaceId */
    error = ENVOY_VerifySpi3HandleAndIfaceId (handle, interfaceId);

    if (error == TXC_NO_ERR)
    {

        if (port != ENVOY_MAC_ALL_PORTS)  /* for Envoy-CE2/CE4 the flow control is across the SPI-3 Input Interface */
        {
            return error = TXC_INVALID_CHANNEL_ERR;
        }

        /* Verify if in PHY-Layer Mode, otherwise issue a WARNING */

        /* checking of the inputMode */
        error = TXC_ENVOY_DeviceExPinRtrv (handle, &pinData);
        if (error == TXC_NO_ERR)
        {
            if ((pinData.spi3InputMode != ENVOY_DEV_PIN_SPI3_LINK_MODE) && 
                (spi3OutputFlowCtrlDataPtr->outputLinkStpaWatermark >= OSPI_MIN_FLOW_CTRL_THRSLD))
            {
                error = TXC_PHY_LAYER_WARNING;
            }

            if ((pinData.spi3InputMode == ENVOY_DEV_PIN_SPI3_LINK_MODE) &&
                ((spi3OutputFlowCtrlDataPtr->outputLinkStpaWatermark > OSPI_MAX_FLOW_CTRL_THRSLD) ||
                (spi3OutputFlowCtrlDataPtr->outputLinkStpaWatermark < OSPI_MIN_FLOW_CTRL_THRSLD)))
            {
                spi3OutputFlowCtrlDataPtr->outputLinkStpaWatermark = TXC_U16_INVALID;
                error = TXC_INVALID_PARM_ERR;
            }

            if (spi3OutputFlowCtrlDataPtr->outputPtpaChunkSize > OSPI_MAX_CHUNK_SIZE)
            {
                spi3OutputFlowCtrlDataPtr->outputPtpaChunkSize = TXC_U16_INVALID;
                error = TXC_INVALID_PARM_ERR;
            }
        }
    }
    /* return the error code */
    return error;
}



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

   FUNCTION:  ENVOY_GetSpi3OutputFlowCtrlCfgValid

   DESCRIPTION: This function validates the TXC_IfSPI3_OutputFlowCtrlCfgGet

   INPUTS:   handle: Instance of the Envoy device to configure
 
             interfaceId: SPI-3 Bus Interface identifier

             port: the logical SPI-3 port ID to access
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_GetSpi3OutputFlowCtrlCfgValid (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port)
{
    TXC_U16BIT error;

    /* check the handle, the interfaceId and the port */
    error = ENVOY_VerifySpi3HandleIfaceIdAndSinglePort (handle, interfaceId, port);

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



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

   FUNCTION:  ENVOY_RtrvSpi3ExtGlobalCountersValid

   DESCRIPTION: This function validates the TXC_IfSPI3_Ext_InputGlobalCntRtrv

   INPUTS:   handle and interfaceId
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_RtrvSpi3ExtGlobalCountersValid (TXC_U16BIT handle, TXC_U8BIT interfaceId)
{
    TXC_U16BIT error;

    /* check the handle and the interfaceId */
    error = ENVOY_VerifySpi3HandleAndIfaceId (handle, interfaceId);

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



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

   FUNCTION:  ENVOY_RtrvSpi3InputGlobalStatusValid

   DESCRIPTION: This function validates the TXC_IfSPI3_Ext_InputGlobalStatusRtrv

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

           interfaceId: SPI-3 Bus Interface identifier.
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_RtrvSpi3InputGlobalStatusValid (TXC_U16BIT handle, TXC_U8BIT interfaceId)
{
    TXC_U16BIT error;

    /* check the handle and the interfaceId */
    error = ENVOY_VerifySpi3HandleAndIfaceId (handle, interfaceId);

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



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

   FUNCTION:  ENVOY_SetSpi3OutputPortCfgValid

   DESCRIPTION: This function validates the TXC_IfSPI3_Ext_OutputPortCfgSet

   INPUTS:   same as TXC_IfSPI3_Ext_OutputPortCfgSet
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_SetSpi3OutputPortCfgValid (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port)
{
    TXC_U16BIT error;
    TXC_IfSPI3_OUTPUT_STRUCT spi3OutputIfaceData;

    /* first, check the handle, the interfaceId and the port */
    error = ENVOY_VerifySpi3HandleIfaceIdAndMultiPort (handle, interfaceId, port);

    /* fill the structure with 0 */
    memset ((void *) &spi3OutputIfaceData, 0, sizeof (spi3OutputIfaceData));

    if (error == TXC_NO_ERR)
    {
        /* checking of the aggregation mode status */
        error = TXC_IfSPI3_OutputIfaceGet (handle, interfaceId, &spi3OutputIfaceData);
        if (error == TXC_NO_ERR)
        {
            if (spi3OutputIfaceData.outputDeviceExtension.envoyCe2Ce4OutputAttr.outputAggregationEnable == TXC_FALSE)
            {
                error = TXC_AGGR_DISABLED_WARNING;
            }
        }
    }
    /* return the error code */
    return error;
}


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

   FUNCTION:  ENVOY_GetSpi3OutputFlowCtrlCfgValid

   DESCRIPTION: This function validates the TXC_IfSPI3_OutputFlowCtrlCfgGet

   INPUTS:   handle, interfaceId and port
  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_GetSpi3OutputPortCfgValid (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port)
{
    TXC_U16BIT error;

    /* check the handle, the interfaceId and the port */
    error = ENVOY_VerifySpi3HandleIfaceIdAndSinglePort (handle, interfaceId, port);

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


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

   FUNCTION:  ENVOY_RtrvSpi3PortStatisticsValid

   DESCRIPTION: This function validates the TXC_IfSPI3_PortStatisticsRtrv

   INPUTS: handle: Instance of the Envoy device to configure

           interfaceId: SPI-3 Bus Interface identifier

           port: the logical SPI-3 port ID to access

  
   RETURNS:  TXC_NO_ERR or an appropriate specific error code listed in appendix.

   CAVEATS:  None.

   REVISION HISTORY:

    Rev #     Date          Author                Description
   -----    -------      ------------         ----------------------
   0.5.0    6/03/04      F. Giannella         Initial release (beta)
-----------------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_RtrvSpi3PortStatisticsValid (TXC_U16BIT handle, TXC_U8BIT interfaceId, TXC_U16BIT port)
{
    TXC_U16BIT error;

    /* check the handle, the interfaceId and the port */
    error = ENVOY_VerifySpi3HandleIfaceIdAndMultiPort (handle, interfaceId, port);

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



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

⌨️ 快捷键说明

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