📄 txc_envoy_mac_valid.c
字号:
*--------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_GetMacOperationalStateValid (TXC_U16BIT handle, TXC_U16BIT port)
{
TXC_U16BIT error;
error = ENVOY_VerifyGetMacHandleAndPort (handle, port);
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_SetMacHalfDuplexValid
DESCRIPTION: This function validates the ENVOYSetMacHalfDuplex
INPUTS: Same as ENVOY_SetMacHalfDuplex
RETURNS: TXC_NO_ERR or an appropriate specific error code listed in appendix.
CAVEATS: None.
REVISION HISTORY:
REVISION HISTORY:
Rev Date Author Description
----- ------- ------------ -----------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT ENVOY_SetMacHalfDuplexValid(TXC_U16BIT handle, TXC_U16BIT port,
TXC_IfMAC_HALF_DUPLEX_STRUCT * macHalfDuplexDataPtr)
{
TXC_U16BIT error;
/* first, check the handle & port */
error = ENVOY_VerifySetMacHandleAndPort (handle, port);
/* now range check the data */
if (error == TXC_NO_ERR)
{
if ((macHalfDuplexDataPtr->excessiveDeferEnable != TXC_FALSE) &&
(macHalfDuplexDataPtr->excessiveDeferEnable != TXC_TRUE))
{
macHalfDuplexDataPtr->excessiveDeferEnable = TXC_BOOL_INVALID;
error = TXC_INVALID_PARM_ERR;
}
if ((macHalfDuplexDataPtr->noBackoffEnable != TXC_FALSE) &&
(macHalfDuplexDataPtr->noBackoffEnable != TXC_TRUE))
{
macHalfDuplexDataPtr->noBackoffEnable = TXC_BOOL_INVALID;
error = TXC_INVALID_PARM_ERR;
}
if ((macHalfDuplexDataPtr->backPressureNoBackoffEnable != TXC_FALSE) &&
(macHalfDuplexDataPtr->backPressureNoBackoffEnable != TXC_TRUE))
{
macHalfDuplexDataPtr->backPressureNoBackoffEnable = TXC_BOOL_INVALID;
error = TXC_INVALID_PARM_ERR;
}
if ((macHalfDuplexDataPtr->altBinExpBackoffEnable != TXC_FALSE) &&
(macHalfDuplexDataPtr->altBinExpBackoffEnable != TXC_TRUE))
{
macHalfDuplexDataPtr->altBinExpBackoffEnable = TXC_BOOL_INVALID;
error = TXC_INVALID_PARM_ERR;
}
/* check the alternate backoff truncate parameter */
if (macHalfDuplexDataPtr->altBinExpBackoffTrunc > ENVOY_MAC_MAX_ALT_BACKOFF_TRUNC)
{
macHalfDuplexDataPtr->altBinExpBackoffTrunc = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
/* check the collision window */
if (macHalfDuplexDataPtr->collisionWindow > ENVOY_MAC_MAX_COLLISION_WINDOW)
{
macHalfDuplexDataPtr->collisionWindow = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
/* check the max retransmissions before aborting */
if (macHalfDuplexDataPtr->retranMax > ENVOY_MAC_MAX_RETRANS)
{
macHalfDuplexDataPtr->retranMax = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
/* first check the non back-to-back Inter-Packet Gap value, part 2 */
if (macHalfDuplexDataPtr->nonB2bIPGpart2 > ENVOY_MAC_MAX_IPG_SIZE)
{
macHalfDuplexDataPtr->nonB2bIPGpart2 = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
/* check the non back-to-back Inter-Packet Gap value, part 1. This must
be less than or equal to the part 2 value */
if ((macHalfDuplexDataPtr->nonB2bIPGpart1 > ENVOY_MAC_MAX_IPG_SIZE) ||
(macHalfDuplexDataPtr->nonB2bIPGpart1 > macHalfDuplexDataPtr->nonB2bIPGpart2))
{
macHalfDuplexDataPtr->nonB2bIPGpart1 = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
}
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_GetMacHalfDuplexValid
DESCRIPTION: This function validates the ENVOYGetMacHalfDuplex
INPUTS: Same as ENVOY_GetMacHalfDuplex
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_GetMacHalfDuplexValid(
TXC_U16BIT handle, TXC_U16BIT port)
{
TXC_U16BIT error;
error = ENVOY_VerifyGetMacHandleAndPort (handle, port);
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_SetMacLoopbackValid
DESCRIPTION: This function validates the TXC_IfMAC_MacLoopbackSet
INPUTS: Same as TXC_IfMAC_MacLoopbackSet
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_SetMacLoopbackValid (TXC_U16BIT handle, TXC_U16BIT port,
TXC_IfMAC_LOOPBACK_STRUCT *macLoopbackDataPtr)
{
TXC_U16BIT error;
/* first, check the handle & port */
error = ENVOY_VerifySetMacHandleAndPort (handle, port);
if (error != TXC_NO_ERR)
return error;
/* now range check the data */
if (macLoopbackDataPtr->macLpbkMode >= TXC_IfMAC_END_OF_LPBK_ENUM)
{
error = TXC_INVALID_PARM_ERR;
macLoopbackDataPtr->macLpbkMode = TXC_IfMAC_LPBK_ENUM_ERR;
return(error);
}
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_GetMacLoopbackValid
DESCRIPTION: This function validates the ENVOYGetMacHalfDuplex
INPUTS: Same as TXC_IfMAC_MacLoopbackGet
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_GetMacLoopbackValid (TXC_U16BIT handle, TXC_U16BIT port,
TXC_IfMAC_LOOPBACK_STRUCT *macLoopbackDataPtr)
{
TXC_U16BIT error;
error = ENVOY_VerifyGetMacHandleAndPort (handle, port);
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_SetMacIngressFlowCtrlValid
DESCRIPTION: This function validates the TXC_ENVOY_MacIngressFlowCtrlSet input parameters
INPUTS: Same as TXC_ENVOY_MacIngressFlowCtrlSet
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_SetMacIngressFlowCtrlValid(TXC_U16BIT handle, TXC_U16BIT port,
TXC_IfMAC_INGRESS_FLOW_CTRL_MODE_STRUCT *macIngressFlowCtrlDataPtr)
{ TXC_U16BIT error;
/* first, check the handle & port */
error = ENVOY_VerifySetMacHandleAndPort (handle, port);
/* now range check the data */
if (error == TXC_NO_ERR)
{
if (macIngressFlowCtrlDataPtr->ingressFlowCtrlMode >= TXC_IfMAC_END_OF_MAC_INGRESS_FLOW_CTRL_ENUM)
{
macIngressFlowCtrlDataPtr->ingressFlowCtrlMode = TXC_IfMAC_INGRESS_FLOW_CTRL_ENUM_ERR;
error = TXC_INVALID_PARM_ERR;
}
if (macIngressFlowCtrlDataPtr->ingressFlowCtrlFramePauseTime > ENVOY_MAC_MAX_FC_FRAME_PAUSE_TIME)
{
macIngressFlowCtrlDataPtr->ingressFlowCtrlFramePauseTime = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
if (macIngressFlowCtrlDataPtr->ingressFlowCtrlFrameExtendedParameter > ENVOY_MAC_MAX_FC_FRAME_EXT)
{
macIngressFlowCtrlDataPtr->ingressFlowCtrlFrameExtendedParameter = TXC_U16_INVALID;
error = TXC_INVALID_PARM_ERR;
}
}
return(error);
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_GetMacIngressFlowCtrlValid
DESCRIPTION: This function validates the TXC_ENVOY_MacIngressFlowCtrlGet input parameters
INPUTS: Same as TXC_ENVOY_MacIngressFlowCtrlGet
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_GetMacIngressFlowCtrlValid (TXC_U16BIT handle, TXC_U16BIT port,
TXC_IfMAC_INGRESS_FLOW_CTRL_MODE_STRUCT *macIngressFlowCtrlModeDataPtr)
{ TXC_U16BIT error;
error = ENVOY_VerifyGetMacHandleAndPort (handle, port);
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: ENVOY_SetMacEgressFlowCtrlValid
DESCRIPTION: This function validates the TXC_ENVOY_MacEgressFlowCtrlSet input parameters
INPUTS: Same as TXC_ENVOY_MacEgressFlowCtrlSet
RETURNS: TXC_NO_ERR or an appropriate specific error code listed in appendix.
CAVEATS: None.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -