📄 txc_envoy_pin.c
字号:
/*--------------------------------------------------------------------------
******* ****
* ***** ** * * * * * * ***** **** * *
* * * * * ** * * * * * * * * * *
* * * * * * * * **** * * * * * ******
* ***** ****** * * * * * ** * * * * * *
* * * * * * ** * * ** ** * * * * * *
* * * * * * * **** * * * * **** * *
Proprietary and Confidential
This program is made available only to customers and prospective customers
of TranSwitch Corporation under license and may be used only with TranSwitch
semi-conductor products.
Copyright(c) 2004 TranSwitch Inc.
--------------------------------------------------------------------------
******* ** ** ** ** ******** ** **
******* *** ** ** ** ********** ** **
** ** * ** ** ** ** ** ** **
***** ** * ** ** ** ** ** * *
***** ** * ** ** ** ** ** **
** ** * ** ** ** ** ** **
******* ** *** **** ********** **
******* ** ** ** ******** **
--------------------------------------------------------------------------
TranSwitch Envoy-CE2/CE4
Device Driver
--------------------------------------------------------------------------
Workfile: txc_envoy_pin_status.c
Description: Device Pin and Pin-Configuration Functions as defined in
API section 5.
--------------------------------------------------------------------------
Revision History
--------------------------------------------------------------------------
Rev # Date Author Description
----- ------- ----------- -----------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
/****************************************************************************
** Include Files **
****************************************************************************/
#include "txc_envoy_api.h"
#include "txc_envoy_pin.h"
#include "txc_envoy_database.h"
#include "txc_envoy_pin_real.h"
#ifndef TXC_ENVOY_VIRTUAL_DEVICE_MODE
#include "txc_hw_platform.h"
#endif
/****************************************************************************
** Static Functions **
****************************************************************************/
/****************************************************************************
** Static/Global Variables **
****************************************************************************/
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
static TXC_U32BIT virRegData= 0;
#endif
/****************************************************************************
** Code **
****************************************************************************/
/* ======================================================================== */
/* DEVICE-PIN STATUS AND PIN-CONFIGURATION FUNCTIONS */
/*--------------------------------------------------------------------------*
FUNCTION: TXC_ENVOY_DeviceExPinRtrv
DESCRIPTION: This function retrieves the pin status of the device
INPUTS: handle: Instance of the Envoy device to get the configuration of
deviceExtPinDataPtr: a pointer to type ENVOY_DEV_EXT_PIN_STRUCT
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Date Author Description
---- ------ -----------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_ENVOY_DeviceExPinRtrv (TXC_U16BIT handle,
ENVOY_DEV_EXT_PIN_STRUCT *deviceExtPinDataPtr)
{
TXC_U16BIT error = TXC_NO_ERR;
/* process the data if no error */
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_RtrvDeviceExPinVirtual (handle, deviceExtPinDataPtr); */
#else
error = ENVOY_RtrvDeviceExPinReal (handle, deviceExtPinDataPtr);
#endif
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: TXC_ENVOY_EthernetPortConfigSet
DESCRIPTION: This function sets the mode of an Ethernet port.
INPUTS: handle: Instance of the Envoy device to configure.
port: The ethernet MAC port to configure. For Envoy-CE2, the range is from
0 to 15, corresponding to ethernet physical port 1 to 8. For Envoy-CE4,
the range is 0 to 31, corresponding to ethernet physical ports 1 to 32.
The value 0xFFFF is used to configure all ethernet ports of specified
terminal the same way.
macIfaceDataPtr: a pointer to type ENVOY_DEV_ETHERNET_MODE_STRUCT.
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Date Author Description
---- ------ -----------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_ENVOY_EthernetPortConfigSet (TXC_U16BIT handle, TXC_U16BIT port,
ENVOY_DEV_ETHERNET_MODE_STRUCT * ethernetPortModeDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_SetEthernetPortConfigValid (handle, port, ethernetPortModeDataPtr);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/*error = ENVOY_EthernetPortConfigVirtual (handle, port, macIfaceDataPtr);*/
#else
error = ENVOY_SetEthernetPortConfigReal (handle, port, ethernetPortModeDataPtr);
#endif
}
/* return the error code */
return error;
}
/*--------------------------------------------------------------------------*
FUNCTION: TXC_ENVOY_EthernetPortConfigGet
DESCRIPTION: This function gets the mode of an Ethernet port.
INPUTS: handle: Instance of the Envoy device to get the configuration of.
port: The ethernet MAC port to get the configuration of. For Envoy-CE2,
the range is from 0 to 15, corresponding to ethernet physical port
1 to 16. For Envoy-CE4, the range is 0 to 31, corresponding to
ethernet physical ports 1 to 32. The value 0xFFFF cannot be used
to simultaneously get the configuration of multiple ethernet ports.
macIfaceDataPtr: a pointer to type TXC_IfMAC_CONFIG_STRUCT.
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Date Author Description
------ ------------ ---------------------------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_ENVOY_EthernetPortConfigGet (TXC_U16BIT handle, TXC_U16BIT port,
ENVOY_DEV_ETHERNET_MODE_STRUCT *ethernetPortModeDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_GetEthernetPortConfigValid (handle, port, ethernetPortModeDataPtr);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_GetEthernetPortConfigVirtual (handle, port, macIfaceDataPtr); */
#else
error = ENVOY_GetEthernetPortConfigReal (handle, port, ethernetPortModeDataPtr);
#endif
}
/* return the error code */
return error;
}
/****************************************************************************
** End of Module **
****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -