EthIf¶
文档信息 Document Information¶
版本历史 Version History¶
日期(Date) |
作者(Author) |
版本(Version) |
状态(Status) |
说明(Description) |
|---|---|---|---|---|
2025/04/03 |
jianyu.yang |
V0.1 |
发布(Release) |
首次发布(First release) |
2025/04/04 |
jianyu.yang |
V1.0 |
发布(Release) |
正式发布(Official release) |
参考文档 References¶
编号(Number) |
分类(Classification) |
标题(Title) |
版本(Version) |
|---|---|---|---|
1 |
Autosar |
AUTOSAR_CP_SWS_EthernetInterface.pdf |
R23-11 |
2 |
Autosar |
AUTOSAR_CP_SWS_EthernetDriver.pdf |
R23-11 |
3 |
Autosar |
AUTOSAR_CP_SWS_EthernetTransceiverDriver.pdf |
R23-11 |
4 |
Autosar |
AUTOSAR_CP_SWS_EthernetSwitchDriver.pdf |
R23-11 |
术语与简写 Terms and Abbreviations¶
术语 Terms¶
术语(Terms) |
解释(Explanation) |
|---|---|
Eth |
以太网控制器驱动程序(AUTOSAR BSW 模块)(Ethernet Controller Driver (AUTOSAR BSW Module)) |
EthIf |
以太网接口(AUTOSAR BSW 模块)(Ethernet Interface (AUTOSAR BSW Module)) |
EthSM |
以太网状态管理器(AUTOSAR BSW 模块)(Ethernet State Manager (AUTOSAR BSW Module)) |
EthTrcv |
以太网收发器驱动程序(AUTOSAR BSW 模块)(Ethernet Transceiver Driver (AUTOSAR BSW Module)) |
CBR |
信道繁忙率(Channel Busy Ratio) |
CIT |
信道空闲时间(Channel Idle Time) |
CV2x |
蜂窝车联网直连通信驱动程序(AUTOSAR BSW 模块)(Cellular Vehicle-to-Everything Driver (AUTOSAR BSW Module)) |
CIT |
信道空闲时间(Channel Idle Time) |
OA TC10 |
OPEN Alliance TC10 规范(OPEN Alliance TC10 Specification) |
简写 Abbreviations¶
简写(Abbreviation) |
全称(Full name) |
解释(Explanation) |
|---|---|---|
IP |
Internet Protocol |
网际互连协议 |
MCG |
Module Configuration Generator |
模块配置与生成器 |
MII |
Media Independent Interface (standardized Interface provided by Ethernet controllers to access Ethernet transceivers) |
媒介独立接口 |
RSSI |
Received Signal Strength Indicator |
接收信号强度指示 |
TCP |
Transmission Control Protocol |
传输控制协议 |
TCP/IP Stack |
Ethernet communication stack |
传输控制与网际互联协议栈 |
VLAN |
Virtual Local Area Network |
虚拟局域网 |
WEth |
Wireless Ethernet Driver |
无线以太网驱动 |
WEthTrcv |
Wireless Ethernet Transceiver Driver |
无线以太网收发器驱动 |
简介 Introduction¶
EthIf通过与遵守AUTOSAR规范的以太网Transceiver,以太网Controller以及以太网switch的驱动所提供的接口密切配合,可为EthIf的上层提供独立于这些以太网硬件的独立接口,从而可以支持多种不同以太网控制器和收发器。
By closely cooperating with the interfaces provided by the Ethernet Transceiver, Ethernet Controller, and Ethernet Switch drivers that comply with the AUTOSAR specification, EthIf can provide interfaces independent of these Ethernet hardware for the upper layer of EthIf, thus supporting a variety of different Ethernet controllers and transceivers.
EthIf提供的这些接口,按功能可以大体分为模式控制相关的接口、时间同步相关的接口、数据接收发送相关的接口。另外,EthIf还存在的初始化或周期任务接口。
These interfaces provided by EthIf can be roughly divided into mode control-related interfaces, time synchronization-related interfaces, and data transmission/reception-related interfaces by function. In addition, EthIf also has initialization or periodic task interfaces.
EthIf模块层次图 (EthIf Module Layer Diagram)¶
如图 EthIf模块层次图 (EthIf Module Layer Diagram) 所示,EthIf向下通过统一的交互接口与以太网控制器,以太网收发器以及以太网交互机等这些以太网硬件间进行交互,向上它将这些交互得到的信息再传递以太网通讯栈或者其他相关模块,以及将这些上层模块的请求传递到对应的以太网硬件上,使得这些上层模块可以独立于以太网硬件而访问以太网通讯资源。
As shown in Figure EthIf模块层次图 (EthIf Module Layer Diagram), EthIf interacts downward with Ethernet hardware such as Ethernet Controllers, Ethernet Transceivers, and Ethernet Switches through a unified interaction interface. Upward, it transmits the information obtained from these interactions to the Ethernet communication stack or other related modules, and also transmits the requests from these upper-layer modules to the corresponding Ethernet hardware, enabling these upper-layer modules to access Ethernet communication resources independently of the Ethernet hardware.
功能描述 Functional Description¶
特性 Features¶
接口传递功能 Interface Transmission Function¶
EthIf将下层以太网硬件(例如Ethernet Controller,Ethernet transceiver以及Ethernet switch等)提供的接口抽象到EthIf中,由EthIf在上层模块与以太网硬件间扮演接口传递的角色。
EthIf abstracts the interfaces provided by the underlying Ethernet hardware (such as Ethernet Controller, Ethernet Transceiver, and Ethernet Switch) into itself, and EthIf acts as an interface transmission role between the upper-layer modules and the Ethernet hardware.
Vlan的支持 VLAN Support¶
EthIf负责对VLAN报文的解/加Tag操作,当接收时,通过EthIf传递给上层的以太网报文将在EthIf中提取出VLAN头,并把剩余的数据传递给上层模块。当上层模块需要向下传输报文时,在EthIf中添加VLAN头,并通过合适的Eth通道发送出去。
EthIf is responsible for the VLAN tag removal/insertion operations for VLAN frames. When receiving a frame, the Ethernet frame passed by EthIf to the upper layer will have its VLAN header extracted in EthIf, and the remaining data will be transmitted to the upper-layer module. When the upper-layer module needs to transmit a frame downward, a VLAN header will be added to the frame in EthIf, and the frame will be sent out through the appropriate Eth channel.
通讯与控制 Communication and Control¶
EthIf提供了许多对以太网硬件进行通讯模式与状态控制的接口,例如涉及Ethernet Controller,Ethernet transceiver以及Ethernet switch等硬件的API。同时也提供通过以太网硬件发送与接收以太网数据的接口,以及它们数据的获取方式(这里指中断方式与轮询方式)等。
EthIf provides a number of interfaces for controlling the communication mode and state of Ethernet hardware, such as APIs related to Ethernet Controllers, Ethernet Transceivers, and Ethernet Switches. It also provides interfaces for sending and receiving Ethernet data through Ethernet hardware, as well as methods for obtaining such data (referring to interrupt mode and polling mode here).
偏差 Deviation¶
配置
Configuration
1.EthIfClkUnit: 位于EthIfPhysController下的EthIfClkUnit配置项因为没有相应版本的Eth驱动进行验证,所以本配置项目前不支持。
1.EthIfClkUnit: The EthIfClkUnit configuration item under EthIfPhysController is not currently supported because there is no corresponding version of the Eth driver for verification.
2.EthIfPhysCtrlRxMainFunctionIngressQueueProcessing: 位于EthIfPhysController下的EthIfPhysCtrlRxMainFunctionIngressQueueProcessing配置项因为没有相应版本的Eth驱动进行验证,所以本配置项目前不支持。
2.EthIfPhysCtrlRxMainFunctionIngressQueueProcessing: The EthIfPhysCtrlRxMainFunctionIngressQueueProcessing configuration item under EthIfPhysController is not currently supported because there is no corresponding version of the Eth driver for verification.
3.EthIfFrameOwnerPdu: 位于EthIfFrameOwnerConfig下的EthIfFrameOwnerPdu配置项因为它相关功能的实现需要依赖L-SDU(该模块本阶段未实现),所以该配置及其子配置项目前不支持。
3.EthIfFrameOwnerPdu: The EthIfFrameOwnerPdu configuration item under EthIfFrameOwnerConfig is not currently supported, along with its sub-configuration items, because the implementation of its related functions depends on L-SDU (this module is not implemented in this phase).
接口
Interfaces
1.EthIf_MainFunctionRx_<IngressQueueProcessing ShortName>:本接口不支持因为需求为Draft状态,且未有对应版本的Eth驱动进行验证。
1.EthIf_MainFunctionRx_<IngressQueueProcessing ShortName>: This interface is not supported because the requirement is in Draft status and there is no corresponding version of the Eth driver for verification.
2.EthIf_ReleaseRxBuffer:本接口不支持因为配置中不支持EthIfFrameOwnerPdu,即以PDU形式的通讯方式不支持。
2.EthIf_ReleaseRxBuffer: This interface is not supported because EthIfFrameOwnerPdu is not supported in the configuration, i.e., the communication mode in the form of PDU is not supported.
3.无线以太网相关的接口现阶段尚未开发。
3.Interfaces related to Wireless Ethernet have not been developed at this stage.
4.蜂窝网络的V2X相关接口现阶段尚未开发,且需求为Draft状态。
4.Interfaces related to Cellular V2X have not been developed at this stage, and the requirement is in Draft status.
5.MACsec相关的接口现阶段尚未开发,且需求为Draft状态。
5.Interfaces related to MACsec have not been developed at this stage, and the requirement is in Draft status.
6.Firewall相关的接口现阶段尚未开发,且需求为Draft状态。
6.Interfaces related to Firewall have not been developed at this stage, and the requirement is in Draft status.
扩展 Extension¶
None
集成 Integration¶
文件列表 File List¶
静态文件 Static Files¶
文件(File) |
描述(Description) |
|---|---|
EthIf.h |
实现EthIf模块对外的函数接口的声明,以及配置文件中全局变量类型的声明(Implements the declaration of the EthIf module’s external function interfaces and the declaration of global variable types in the configuration file) |
EthIf_Cbk.h |
实现EthIf模块回调函数接口的声明(Implements the declaration of the EthIf module’s callback function interfaces) |
EthIf_Type.h |
EthIf模块宏定义及数据类型定义(Defines macros and data types for the EthIf module) |
EthIf.c |
EthIf模块源文件,包含了API函数的实现(Source file of the EthIf module, containing the implementation of API functions) |
动态文件 Dynamic Files¶
文件(File) |
描述(Description) |
|---|---|
EthIf_Cfg.h |
定义EthIf模块内部结构体以及相应宏常量(Defines the internal structures and corresponding macro constants of the EthIf module) |
EthIf_Cfg.c |
定义EthIf模块内部描述各个以太网硬件资源(例如controller,transceiver以及siwtch与相关的switch port等)状态的变量(Defines variables in the EthIf module that describe the status of various Ethernet hardware resources (such as controllers, transceivers, switches, and related switch ports)) |
EthIf_PBcfg.c |
定义EthIf模块PB配置的结构体参数(Defines the structure parameters for the PB configuration of the EthIf module) |
EthIf_MemMap.h |
实现EthIf模块内存布局(Implements the memory mapping of the EthIf module) |
错误处理 Error Handling¶
开发错误 Development Errors¶
Error code |
Value[hex] |
Description |
|---|---|---|
ETHIF_E_INV_CTRL_IDX |
0x01 |
API service called with invalid controller index |
ETHIF_E_INV_TRCV_IDX |
0x02 |
API service called with invalid transceiver index |
ETHIF_E_INV_SWT_IDX |
0x03 |
API service called with invalid switch index |
ETHIF_E_INV_PORT_GROUP_IDX |
0x04 |
API service called with invalid port group index |
ETHIF_E_UNINIT |
0x05 |
API service called when EthIf module was not initialized |
ETHIF_E_PARAM_POINTER |
0x06 |
API service called with invalid pointer in parameter list |
ETHIF_E_INV_PARAM |
0x07 |
API service called with invalid parameter |
ETHIF_E_INIT_FAILED |
0x08 |
EthIf_Init called with an invalid configuration pointer |
ETHIF_E_INV_PORT_IDX |
0x09 |
Invalid port index |
产品错误 Product Errors¶
None
运行时错误 Runtime Errors¶
Error code |
Value[hex] |
Description |
|---|---|---|
ETHIF_E_PDU_STATE_TRANSITION_FAILED |
0x01 |
A PDU is requested to be used while it is already in use or requested to be available while it is already availalbe |
接口描述 Interface Description¶
提供的服务 Services¶
EthIf_Init¶
void EthIf_Init(const EthIf_ConfigType *CfgPtr)
Initializes the Ethernet Interface.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CfgPtr |
Points to the implementation specific structure. |
- Return type
void
EthIf_SetControllerMode¶
Std_ReturnType EthIf_SetControllerMode(uint8 CtrlIdx, Eth_ModeType CtrlMode)
Enables / disables the indexed controller.
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
CtrlMode |
Mode for Controller. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
controller mode could not be changed. |
EthIf_GetControllerMode¶
Std_ReturnType EthIf_GetControllerMode(uint8 CtrlIdx, Eth_ModeType *CtrlModePtr)
Enables / disables the indexed controller.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[out] |
CtrlModePtr |
Mode of Controller. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
controller could not be initialized. |
EthIf_GetTransceiverMode¶
Std_ReturnType EthIf_GetTransceiverMode(uint8 TrcvIdx, Eth_ModeType *TrcvModePtr)
Obtain state of the indexed transceiver.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Transceiver Driver. |
[out] |
TrcvModePtr |
ETH_MODE_DOWN: the transceiver is disabled ETH_MODE_ACTIVE: the transceiver is enable. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
transceiver could not be initialized. |
EthIf_CheckWakeup¶
Std_ReturnType EthIf_CheckWakeup(EcuM_WakeupSourceType WakeupSource)
This API request the affected Ethernet hardware to check for a signaled wake-up.
- Sync/Async
FALSE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
WakeupSource |
Source device which initiated the wake up event. |
- Return type
Std_ReturnType
EthIf_GetPhyWakeupReason¶
Std_ReturnType EthIf_GetPhyWakeupReason(uint8 TrcvIdx, EthTrcv_WakeupReasonType *WakeupReasonPtr)
obtains the wake up reasons of the indexed Ethernet Transceiver (PHY).
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver. |
[out] |
WakeupReasonPtr |
Pointer to structure of least recent wakeup event,which was detected by the Ethernet PHY. |
- Return type
Std_ReturnType
EthIf_GetSwitchPortWakeupReason¶
Std_ReturnType EthIf_GetSwitchPortWakeupReason(uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_WakeupReasonType *WakeupReasonPtr)
This function obtains the wake up reasons of the indexed Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the Ethernet switch. |
[in] |
SwitchPortIdx |
Index of the Ethernet switch port. |
[out] |
WakeupReasonPtr |
Pointer to structure of least recent wakeup event,which was detected by the Ethernet switch port. |
- Return type
Std_ReturnType
EthIf_GetPhysAddr¶
void EthIf_GetPhysAddr(uint8 CtrlIdx, uint8 *PhysAddrPtr)
Obtains the physical source address used by the indexed controller.
- Sync/Async
FALSE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the Ethernet controller. |
[out] |
PhysAddrPtr |
Physical source address (MAC address) in network byte order. |
- Return type
void
EthIf_SetPhysAddr¶
void EthIf_SetPhysAddr(uint8 CtrlIdx, const uint8 *PhysAddrPtr)
Sets the physical source address used by the indexed controller.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant for the same CtrlIdx, reentrant for different
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the Ethernet controller. |
[out] |
PhysAddrPtr |
Pointer to memory containing the physical source address (MAC address) in network byte order. |
- Return type
void
EthIf_UpdatePhysAddrFilter¶
Std_ReturnType EthIf_UpdatePhysAddrFilter(uint8 CtrlIdx, const uint8 *PhysAddrPtr, Eth_FilterActionType Action)
Update the physical source address to/from the indexed controller filter.
- Sync/Async
FALSE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the Ethernet controller. |
PhysAddrPtr |
||
[in] |
Action |
Add or remove the address from the Ethernet controllers filter. |
- Return type
Std_ReturnType
EthIf_GetCurrentTime¶
Std_ReturnType EthIf_GetCurrentTime(uint8 CtrlIdx, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
Sync/Async
Reentrancy
- Return type
Std_ReturnType
EthIf_GetCurrentTimeTuple¶
Std_ReturnType EthIf_GetCurrentTimeTuple(uint8 CtrlIdx, uint8 ClkUnitIdx, TimeTupleType *currentTimeTuplePtr)
Reads the current time of the timestamp clock and the current time of the PHC in an atomic operation.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
ClkUnitIdx |
Index of the Clock Unit. |
[out] |
currentTimeTuplePtr |
Current time tuple with the: value of the free-running clock used for timestamping and value of the adjustable PHC |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Current time successfully retrieved. |
E_NOT_OK |
Current time could not be retrieved. |
EthIf_SetPhcTime¶
Std_ReturnType EthIf_SetPhcTime(uint8 CtrlIdx, uint8 ClkUnitIdx, const TimeStampType *timeStampPtr)
Sets the absolute time of the PHC.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
ClkUnitIdx |
Index of the Clock Unit. |
[out] |
timeStampPtr |
Time value to which the PHC shall be set. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Current time successfully retrieved. |
E_NOT_OK |
Current time could not be retrieved. |
EthIf_SetPhcCorrection¶
Std_ReturnType EthIf_SetPhcCorrection(uint8 CtrlIdx, uint8 ClkUnitIdx, sint32 rateDeviation, sint32 offset)
Sets the absolute time of the PHC.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
ClkUnitIdx |
Index of the Clock Unit. |
[in] |
rateDeviation |
Rate deviation (resolution: 2-41), by which the PHC is requested to be corrected. |
[in] |
offset |
Time offset, by which the PHC is requested to be updated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Current time successfully retrieved. |
E_NOT_OK |
Current time could not be retrieved. |
EthIf_GetPhcTime¶
Std_ReturnType EthIf_GetPhcTime(uint8 CtrlIdx, uint8 ClkUnitIdx, TimeStampQualType *timeQualPtr, TimeStampType *timeStampPtr)
Returns the current time value out of the HW registers of the PHC.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
ClkUnitIdx |
Index of the Clock Unit. |
[out] |
timeQualPtr |
quality of HW time stamp, e.g. based on current drift. |
[out] |
timeStampPtr |
current time stamp. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
PHC value successfully retrieved. |
E_NOT_OK |
PHC value could not be retrieved. |
EthIf_SetPpsSignalMode¶
Std_ReturnType EthIf_SetPpsSignalMode(uint8 CtrlIdx, uint8 ClkUnitIdx, boolean signalMode)
Enables/disables the generation of a PPS signal.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
ClkUnitIdx |
Index of the Clock Unit. |
[out] |
signalMode |
quality of HW time stamp, e.g. based on current drift. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
PPS signal generation successfully enabled/disabled. |
E_NOT_OK |
Failed to enable/disable PPS signal generation. |
EthIf_EnableEgressTimeStamp¶
void EthIf_EnableEgressTimeStamp(uint8 CtrlIdx, Eth_BufIdxType BufIdx)
Activates egress time stamping on a dedicated message object.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
BufIdx |
Index of the message buffer, where Application expects egress time stamping. |
- Return type
void
EthIf_GetEgressTimeStamp¶
Std_ReturnType EthIf_GetEgressTimeStamp(uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
Reads back the egress time stamp on a dedicated message object.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
BufIdx |
Index of the message buffer, where the Upper Layer expects egress time stamping. |
[out] |
timeQualPtr |
quality of HW time stamp, e.g. based on current drift. |
[out] |
timeStampPtr |
current time stamp. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
PPS signal generation successfully enabled/disabled. |
E_NOT_OK |
Failed to enable/disable PPS signal generation. |
EthIf_GetIngressTimeStamp¶
Std_ReturnType EthIf_GetIngressTimeStamp(uint8 CtrlIdx, const Eth_DataType *DataPtr, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
Reads back the ingress time stamp on a dedicated message object.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of Ethernet Controller. |
[in] |
DataPtr |
Pointer to the message buffer, where Application expects ingress time stamping. |
[out] |
timeQualPtr |
quality of HW time stamp, e.g. based on current drift. |
[out] |
timeStampPtr |
current time stamp. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
PPS signal generation successfully enabled/disabled. |
E_NOT_OK |
Failed to enable/disable PPS signal generation. |
EthIf_ProvideTxBuffer¶
BufReq_ReturnType EthIf_ProvideTxBuffer(uint8 CtrlIdx, Eth_FrameType FrameType, uint8 Priority, Eth_BufIdxType *BufIdxPtr, uint8 **BufPtr, uint16 *LenBytePtr)
Provides access to a transmit buffer of the specified Ethernet controller.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[out] |
FrameType |
Ethernet Frame Type (EtherType) |
[out] |
Priority |
Priority value which shall be used for the 3-bit PCP field of the VLAN tag |
[out] |
BufIdxPtr |
Index to the granted buffer resource. To be used for subsequent requests. |
[out] |
BufPtr |
Pointer to the granted buffer |
[inout] |
LenBytePtr |
in: desired length in bytes, out: granted length in bytes |
- Return type
BufReq_ReturnType
Return values
Name |
Description |
|---|---|
BUFREQ_OK |
success |
BUFREQ_E_NOT_OK |
development error detected |
BUFREQ_E_BUSY |
all buffers in use |
BUFREQ_E_OVFL |
requested buffer too large |
EthIf_Transmit¶
Std_ReturnType EthIf_Transmit(uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_FrameType FrameType, boolean TxConfirmation, uint16 LenByte, const uint8 *PhysAddrPtr)
Triggers transmission of a previously filled transmit buffer.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different buffer indexes and Ctrl indexes
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[in] |
BufIdx |
Index of the buffer resource |
[in] |
FrameType |
Ethernet Frame Type (EtherType) |
[in] |
TxConfirmation |
Activates transmission confirmation. |
[in] |
LenByte |
Data length in byte. |
[in] |
PhysAddrPtr |
Physical target address (MAC address) in network byte order |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success |
E_NOT_OK |
transmission failed |
EthIf_GetVersionInfo¶
void EthIf_GetVersionInfo(Std_VersionInfoType *VersionInfoPtr)
Returns the version information of this module.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[out] |
VersionInfoPtr |
Version information of this module. |
- Return type
void
EthIf_GetCtrlIdxList¶
Std_ReturnType EthIf_GetCtrlIdxList(uint8 *NumberOfCtrlIdx, uint8 *CtrlIdxListPtr)
Returns the number and index of all active Ethernet controllers..
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
NumberOfCtrlIdx |
||
[out] |
CtrlIdxListPtr |
List of active controller indexes. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
failure. |
EthIf_MainFunctionRx¶
void EthIf_MainFunctionRx(uint8 ethIfPartition)
The function checks for new received frames and issues reception indications in polling mode..
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
ethIfPartition |
Index of the Ethernet partition. |
- Return type
void
EthIf_MainFunctionTx¶
void EthIf_MainFunctionTx(uint8 ethIfPartition)
The function issues transmission confirmations in polling mode.It checks also for transceiver state changes.
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
ethIfPartition |
Index of the Ethernet partition. |
- Return type
void
EthIf_MainFunctionState¶
void EthIf_MainFunctionState(uint8 ethIfPartition)
The function is polling different communication hardware (Ethernet transceiver, Ethernet switch ports) related information, e.g. link state,signal quality.
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
ethIfPartition |
Index of the Ethernet partition. |
- Return type
void
EthIf_GetVlanId¶
Std_ReturnType EthIf_GetVlanId(uint8 CtrlIdx, uint16 *VlanIdPtr)
Returns the VLAN identifier of the requested Ethernet controller..
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the Ethernet controller. |
[out] |
VlanIdPtr |
Pointer to store the VLAN identifier (VID) of the Ethernet controller. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
failure. |
EthIf_GetAndResetMeasurementData¶
Std_ReturnType EthIf_GetAndResetMeasurementData(EthIf_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32 *MeasurementDataPtr)
Returns the VLAN identifier of the requested Ethernet controller..
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
MeasurementIdx |
Data index of measurement data. |
[in] |
MeasurementResetNeeded |
Flag to trigger a reset of the measurement data. |
[out] |
MeasurementDataPtr |
Reference to data buffer, where to copy measurement data. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
failure. |
EthIf_GetPortMacAddr¶
BufReq_ReturnType EthIf_GetPortMacAddr(const uint8 *MacAddrPtr, uint8 *SwtichIdxPtr, uint8 *PortIdxPtr)
Obtains the port over which this MAC-address can be reached.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
MacAddrPtr |
ID of the SDU that is requested to be transmitted. |
[out] |
SwtichIdxPtr |
Pointer to the switch index. |
[out] |
PortIdxPtr |
Pointer to the port index. |
- Return type
BufReq_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
an error occurred, e.g. multiple ports were found. |
EthIf_GetArlTable¶
Std_ReturnType EthIf_GetArlTable(uint8 switchIdx, uint16 *numberOfElements, Eth_MacVlanType *arlTableListPointer)
Obtains the address resolution table of a switch and copies the list into a user provided buffer.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
switchIdx |
Index of the switch. |
numberOfElements |
||
[out] |
arlTableListPointer |
Returns a pointer to the memory where the ARL table of the switch. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
requested switchIdx is not valid or inactive. |
EthIf_StoreConfiguration¶
Std_ReturnType EthIf_StoreConfiguration(uint8 SwitchIdx)
Trigger the storage/reset of the configuration of the learned MAC/Port tables of a switch in a persistent manner and will be used by e.g. CDD.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Storage/Reset request accepted. |
E_NOT_OK |
Storage/Reset request not accepted. |
EthIf_ResetConfiguration¶
Std_ReturnType EthIf_ResetConfiguration(uint8 SwitchIdx)
The function shall request to reset the configuration of the learned MAC/Port tables of a Ethernet switch in a persistent manner.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Request to persistently reset the MAC/Port table was accepted. |
E_NOT_OK |
Request to persistently reset the MAC/Port table was not accepted. |
EthIf_SwitchPortGroupRequestMode¶
Std_ReturnType EthIf_SwitchPortGroupRequestMode(EthIf_SwitchPortGroupIdxType PortGroupIdx, Eth_ModeType PortMode)
Request a mode for the EthIfSwtPortGroup.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
PortGroupIdx |
Index of the switch. |
[in] |
PortMode |
port group mode for EthIfSwtPortGroup. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
group mode could not be changed. |
EthIf_StartAllPorts¶
Std_ReturnType EthIf_StartAllPorts(void)
Request to set all configured and affected EthSwtPorts to ETH_MODE_ACTIVE.
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Request was accepted. |
E_NOT_OK |
Request was rejected. |
EthIf_SetSwitchMgmtInfo¶
Std_ReturnType EthIf_SetSwitchMgmtInfo(uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType *MgmtInfoPtr)
Provides additional management information along to an Ethernet frame that requires special treatment within the Switch.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of an Ethernet Interface controller. |
[in] |
BufIdx |
Ethernet Tx Buffer index. |
[in] |
MgmtInfoPtr |
Pointer to the management information. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Management infos successfully set |
E_NOT_OK |
Setting of management infos failed. |
EthIf_GetRxMgmtObject¶
Std_ReturnType EthIf_GetRxMgmtObject(uint8 CtrlIdx, Eth_DataType *DataPtr, EthSwt_MgmtObjectType **MgmtObjectPtr)
Request the MgmtObject of the (in this context) unique DataPtr.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of an Ethernet Interface controller. |
[in] |
DataPtr |
Ethernet data pointer. |
[out] |
MgmtObjectPtr |
Pointer to the management object. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
management object could not be obtained. |
EthIf_GetTxMgmtObject¶
Std_ReturnType EthIf_GetTxMgmtObject(uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtObjectType **MgmtObjectPtr)
Request the MgmtObject of the (in this context) unique BufIdx.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of an Ethernet Interface controller. |
[in] |
BufIdx |
Ethernet Rx Buffer index. |
[out] |
MgmtObjectPtr |
Pointer to the management object. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
management object could not be obtained. |
EthIf_SwitchEnableTimeStamping¶
Std_ReturnType EthIf_SwitchEnableTimeStamping(uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType *MgmtInfo)
Activates egress time stamping on a dedicated message object, addressed by CtrlIdx and BufIdx.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of an Ethernet Interface controller. |
[in] |
BufIdx |
Index of the message buffer, where Application expects egress time stamping. |
[out] |
MgmtInfo |
Management information. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Time stamping on egress successfully enabled. |
E_NOT_OK |
Enabling of time stamping on egress has been failed. |
EthIf_VerifyConfig¶
Std_ReturnType EthIf_VerifyConfig(uint8 SwitchIdx, boolean *Result)
Forwarded to EthSwt_VerifyConfig. EthSwt_VerifyConfig verifies the Switch Configuration depending on the HW-Architecture, HW-capability and the intended accuracy of this verification.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Interface. |
[out] |
Result |
Result of verification, TRUE: configureation verified ok, FALSE:configuraton values found corrupted |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Configuration verificaton succeeded. |
E_NOT_OK |
Configuration verification not succeeded. |
EthIf_SetForwardingMode¶
Std_ReturnType EthIf_SetForwardingMode(uint8 SwitchIdx, boolean mode)
Control of switch frame forwarding.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Interface. |
[in] |
mode |
True Forwarding enabled, False Forwarding disabled. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
request was accepted. |
E_NOT_OK |
request was rejected. |
EthIf_GetTrcvSignalQuality¶
Std_ReturnType EthIf_GetTrcvSignalQuality(uint8 TrcvIdx, EthIf_SignalQualityResultType *ResultPtr)
Retrieves the signal quality of the link of the given Ethernet transceiver.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[out] |
ResultPtr |
Pointer to the memory where the signal quality in percent shall be stored.. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The signal quality retrieved successfully. |
E_NOT_OK |
The signal quality not retrieved successfully. |
EthIf_GetSwitchPortSignalQuality¶
Std_ReturnType EthIf_GetSwitchPortSignalQuality(uint8 SwitchIdx, uint8 SwitchPortIdx, EthIf_SignalQualityResultType *ResultPtr)
Retrieves the signal quality of the link of the given Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the Ethernet switch within the context of the Ethernet Interface. |
[in] |
SwitchPortIdx |
Index of the Ethernet switch port within the context of the Ethernet Interface. |
[out] |
ResultPtr |
Pointer to the memory where the signal quality in percent shall be stored.. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The signal quality retrieved successfully. |
E_NOT_OK |
The signal quality not retrieved successfully. |
EthIf_ClearTrcvSignalQuality¶
Std_ReturnType EthIf_ClearTrcvSignalQuality(uint8 TrcvIdx)
Clear the stored signal quality of the link of the given Ethernet transceiver.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The signal quality cleared successfully. |
E_NOT_OK |
The signal quality cleared not successfully. |
EthIf_ClearSwitchPortSignalQuality¶
Std_ReturnType EthIf_ClearSwitchPortSignalQuality(uint8 SwitchIdx, uint8 SwitchPortIdx)
Clear the stored signal quality of the link of the given Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different Ethernet switch indexes and Ethernet Switch port indexes. Non reentrant for the same SwitchPortIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the Ethernet switch within the context of the Ethernet Interface. |
[in] |
SwitchPortIdx |
Index of the Ethernet switch port within the context of the Ethernet Interface. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The signal quality cleared successfully. |
E_NOT_OK |
The signal quality cleared not successfully. |
EthIf_SetPhyTestMode¶
Std_ReturnType EthIf_SetPhyTestMode(uint8 TrcvIdx, EthTrcv_PhyTestModeType Mode)
Activates a given test mode.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[in] |
Mode |
Test mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The request has been accepted. |
E_NOT_OK |
The request has not been accepted. |
EthIf_SetPhyLoopbackMode¶
Std_ReturnType EthIf_SetPhyLoopbackMode(uint8 TrcvIdx, EthTrcv_PhyLoopbackModeType Mode)
Activates a given loopback mode.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[in] |
Mode |
Loopback mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The request has been accepted. |
E_NOT_OK |
The request has not been accepted. |
EthIf_SetPhyTxMode¶
Std_ReturnType EthIf_SetPhyTxMode(uint8 TrcvIdx, EthTrcv_PhyTxModeType Mode)
Activates a given transmission mode.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[in] |
Mode |
Transmission mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The request has been accepted. |
E_NOT_OK |
The request has not been accepted. |
EthIf_GetCableDiagnosticsResult¶
Std_ReturnType EthIf_GetCableDiagnosticsResult(uint8 TrcvIdx, EthTrcv_CableDiagResultType *ResultPtr)
Retrieves the cable diagnostics result of a given transceiver.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[out] |
ResultPtr |
Pointer to the location where the cable diagnostics result shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The request has been accepted. |
E_NOT_OK |
The request has not been accepted. |
EthIf_GetPhyIdentifier¶
Std_ReturnType EthIf_GetPhyIdentifier(uint8 TrcvIdx, uint32 *OrgUniqueIdPtr, uint8 *ModelNrPtr, uint8 *RevisionNrPtr)
Obtains the PHY identifier of the Ethernet Interface according to IEEE 802.3-2015.
- Sync/Async
TRUE
- Reentrancy
Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Interface. |
[out] |
OrgUniqueIdPtr |
Pointer to the memory where the Organizationally Unique Identifier shall be stored. |
[out] |
ModelNrPtr |
Pointer to the memory where the Manufacturer’s Model Number shall be stored. |
[out] |
RevisionNrPtr |
Pointer to the memory where the Revision Number shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The request has been accepted. |
E_NOT_OK |
The request has not been accepted. |
EthIf_GetSwitchPortMode¶
Std_ReturnType EthIf_GetSwitchPortMode(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_ModeType *PortModePtr)
Obtains the mode of the indexed switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
PortModePtr |
ETH_MODE_DOWN: The Ethernet switch port of the given Ethernet switch is disabled ETH_MODE_ACTIVE: The Ethernet switch port of the given Ethernet switch is enabled |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
The mode of the indexed switch port could not be obtained, or the function is called in state ETHSWT_STATE_UNINIT or ETHSWT_STATE_INIT.. |
EthIf_SwitchPortGetLinkState¶
Std_ReturnType EthIf_SwitchPortGetLinkState(uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_LinkStateType *LinkStatePtr)
Obtains the link state of the indexed switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[in] |
LinkStatePtr |
ETHTRCV_LINK_STATE_DOWN: Switch port is disconnected ETHTRCV_LINK_STATE_ACTIVE: Switch port is connected |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
Link state of the indexed switch port could not be obtained, or the function is called in state ETHSWT_STATE_UNINIT or ETHSWT_STATE_INIT. |
EthIf_TransceiverGetLinkState¶
Std_ReturnType EthIf_TransceiverGetLinkState(uint8 TrcvIdx, EthTrcv_LinkStateType *LinkStatePtr)
Obtains the link state of the indexed transceiver.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Transceiver Driver. |
[out] |
LinkStatePtr |
ETHTRCV_LINK_STATE_DOWN: transceiver is disconnected ETHTRCV_LINK_STATE_ACTIVE: transceiver is connected |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
transceiver could not be initialized. |
EthIf_SwitchPortGetBaudRate¶
Std_ReturnType EthIf_SwitchPortGetBaudRate(uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_BaudRateType *BaudRatePtr)
Obtains the baud rate of the indexed switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
BaudRatePtr |
ETHTRCV_BAUD_RATE_10MBIT: 10MBit connection ETHTRCV_BAUD_RATE_100MBIT: 100MBit connection ETHTRCV_BAUD_RATE_1000MBIT: 1000MBit connection ETHTRCV_BAUD_RATE_2500MBIT: 2500MBit connection |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
Baud rate of the indexed switch port could not be obtained, or the function is called in state ETHSWT_STATE_UNINIT or ETHSWT_STATE_INIT |
EthIf_TransceiverGetBaudRate¶
Std_ReturnType EthIf_TransceiverGetBaudRate(uint8 TrcvIdx, EthTrcv_BaudRateType *BaudRatePtr)
Obtains the baud rate of the indexed transceiver.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Transceiver Driver. |
[out] |
BaudRatePtr |
ETHTRCV_BAUD_RATE_10MBIT: 10MBit connection ETHTRCV_BAUD_RATE_100MBIT: 100MBit connection ETHTRCV_BAUD_RATE_1000MBIT: 1000MBit connection ETHTRCV_BAUD_RATE_2500MBIT: 2500MBit connection |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
transceiver could not be initialized. |
EthIf_SwitchPortGetDuplexMode¶
Std_ReturnType EthIf_SwitchPortGetDuplexMode(uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_DuplexModeType *DuplexModePtr)
Obtains the duplex mode of the indexed switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
DuplexModePtr |
ETHTRCV_DUPLEX_MODE_HALF: half duplex connections ETHTRCV_DUPLEXMODE_FULL: full duplex connection |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
duplex mode of the indexed switch port could not be obtained, or the function is called in state ETHSWT_STATE_UNINIT or ETHSWT_STATE_INIT. |
EthIf_TransceiverGetDuplexMode¶
Std_ReturnType EthIf_TransceiverGetDuplexMode(uint8 TrcvIdx, EthTrcv_DuplexModeType *DuplexModePtr)
Obtains the duplex mode of the indexed transceiver.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Transceiver Driver. |
[out] |
DuplexModePtr |
ETHTRCV_DUPLEX_MODE_HALF: half duplex connections ETHTRCV_DUPLEXMODE_FULL: full duplex connection |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
transceiver could not be initialized |
EthIf_SwitchPortGetCounterValues¶
Std_ReturnType EthIf_SwitchPortGetCounterValues(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_CounterType *CounterPtr)
Reads a list with drop counter values of the corresponding port of the switch.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
CounterPtr |
counter values according to IETF RFC 1757, RFC 1643 and RFC 2233 |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
counter values read failure |
EthIf_SwitchPortGetCounterValue¶
Std_ReturnType EthIf_SwitchPortGetCounterValue(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_CounterType *CounterPtr)
Sync/Async
Reentrancy
- Return type
Std_ReturnType
EthIf_SwitchPortGetRxStats¶
Std_ReturnType EthIf_SwitchPortGetRxStats(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_RxStatsType *RxStatsPtr)
Returns a list of statistic counters defined with Eth_RxTatsType.The majority of these Counters are derived from the IETF RFC2819.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
RxStatsPtr |
List of values according to IETF RFC 2819 (Remote Network Monitoring Management Information Base) |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
drop counter could not be obtained |
EthIf_SwitchPortGetTxStats¶
Std_ReturnType EthIf_SwitchPortGetTxStats(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxStatsType *TxStatsPtr)
List of values to read statistic values for transmission.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
TxStatsPtr |
List of values to read statistic values for transmission. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
Tx-statistics could not be obtained |
EthIf_SwitchPortGetTxErrorCounterValues¶
Std_ReturnType EthIf_SwitchPortGetTxErrorCounterValues(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxErrorCounterValuesType *TxStatsPtr)
List of values to read statistic error counter values for transmission from.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
TxStatsPtr |
List of values to read statistic error counter values for transmission. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
Tx-statistics could not be obtained |
EthIf_SwitchPortGetMacLearningMode¶
Std_ReturnType EthIf_SwitchPortGetMacLearningMode(uint8 SwitchIdx, uint8 SwitchPortIdx, EthSwt_MacLearningType *MacLearningModePtr)
Returns the MAC learning mode.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
MacLearningModePtr |
Defines whether MAC addresses shall be learned and if they shall be learned in software or hardware. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
configuration could be persistently reset |
EthIf_GetSwitchPortIdentifier¶
Std_ReturnType EthIf_GetSwitchPortIdentifier(uint8 SwitchIdx, uint8 SwitchPortIdx, uint32 *OrgUniqueIdPtr, uint8 *ModelNrPtr, uint8 *RevisionNrPtr)
Returns the MAC learning mode.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[out] |
OrgUniqueIdPtr |
Pointer to the memory where the Organizationally Unique Identifier (OUI) shall be stored. |
[out] |
ModelNrPtr |
Pointer to the memory where the Manufacturer’s Model Number shall be stored. |
[out] |
RevisionNrPtr |
Pointer to the memory where the Revision Number shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
organizationally unique identifier of the Ethernet transceiver could be read. |
E_NOT_OK |
organizationally unique identifier of the Ethernet transceiver could not be obtained (i.e. OUI is not available). |
EthIf_GetSwitchIdentifier¶
Std_ReturnType EthIf_GetSwitchIdentifier(uint8 SwitchIdx, uint32 *OrgUniqueIdPtr)
Obtain the Organizationally Unique Identifier that is given by the IEEE of the indexed Ethernet switch.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[out] |
OrgUniqueIdPtr |
Pointer to the memory where the Organizationally Unique Identifier (OUI) shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
organizationally unique identifier of the Ethernet switch could be read.. |
E_NOT_OK |
organizationally unique identifier of the Ethernet switch could not be read (i.e. no OUI is available for this Ethernet switch). |
EthIf_WritePortMirrorConfiguration¶
Std_ReturnType EthIf_WritePortMirrorConfiguration(uint8 MirroredSwitchIdx, const EthSwt_PortMirrorCfgType *PortMirrorConfigurationPtr)
Store the given port mirror configuration in a shadow buffer in the Ethernet switch driver for the given MirroredSwitchIdx.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
MirroredSwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver, where the Ethernet switch port is located, that has to be mirrored. |
[out] |
PortMirrorConfigurationPtr |
Pointer to the memory where the port configuration shall be used. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port mirror configuration for the indexed Ethernet switch port was written. |
E_NOT_OK |
the port mirror configuration for the indexed Ethernet switch port was not written. (i.e. indexed ethernet switch is not available). |
EthIf_ReadPortMirrorConfiguration¶
Std_ReturnType EthIf_ReadPortMirrorConfiguration(uint8 MirroredSwitchIdx, EthSwt_PortMirrorCfgType *PortMirrorConfigurationPtr)
Obtain the port mirror configuration of the given Ethernet switch.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
MirroredSwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver, where the Ethernet switch port is located, that has to be mirrored. |
[out] |
PortMirrorConfigurationPtr |
Pointer to the memory where the port configuration shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port mirror configuration for the indexed Ethernet switch port was red successfully. |
E_NOT_OK |
the port mirror configuration for the indexed Ethernet switch was not red successfully. (i.e. indexed Ethernet switch is not available. |
EthIf_DeletePortMirrorConfiguration¶
Std_ReturnType EthIf_DeletePortMirrorConfiguration(uint8 MirroredSwitchIdx)
Delete the stored port mirror configuration of the given MirroredSwitchIdx.
- Sync/Async
TRUE
- Reentrancy
Reentrant Reentrant for different MirroredSwitchIdx. Non reentrant for the same SwitchIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
MirroredSwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Port mirror configuration was deleted successfully. |
E_NOT_OK |
Port mirror configuration was not deleted successfully. (e.g. the port mirroring is enabled) |
EthIf_GetPortMirrorState¶
Std_ReturnType EthIf_GetPortMirrorState(uint8 SwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType *PortMirrorStatePtr)
Obtain the current status of the port mirroring for the indexed Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
PortMirrorStatePtr |
Pointer to the memory where the port mirroring state of the given Ethernet switch port shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port mirroring state for the indexed Ethernet switch port returned successfully.. |
E_NOT_OK |
the port mirror configuration for the indexed Ethernet switch returned not successfully. (i.e. indexed ethernet switch port is not available) |
EthIf_SetPortMirrorState¶
Std_ReturnType EthIf_SetPortMirrorState(uint8 MirroredSwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType PortMirrorState)
Request to set the given port mirroring state of the port mirror configuration for the given Ethernet switch.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
MirroredSwitchIdx |
||
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
PortMirrorState |
Contain the requested port mirroring state either PORT_MIRRORING_ENABLED or PORT_MIRRORING_DISABLED. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the requested port mirroring state for the indexed Ethernet switch port was set successfully. |
E_NOT_OK |
the requested port mirroring state for the indexed Ethernet switch was not set successfully. |
EthIf_SetPortTestMode¶
Std_ReturnType EthIf_SetPortTestMode(uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTestModeType Mode)
Activates a given test mode of the indexed Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
Mode |
Test mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port test mode for the indexed Ethernet switch port was set successfully. |
E_NOT_OK |
the port test mode for the indexed Ethernet switch was not set successfully. |
EthIf_SetPortLoopbackMode¶
Std_ReturnType EthIf_SetPortLoopbackMode(uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyLoopbackModeType Mode)
Activates a given test loop-back mode of the indexed Ethernet switch port..
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
Mode |
Loop-back mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port mirroring loop-back back mode for the indexed Ethernet switch port was activated successfully. |
E_NOT_OK |
the port mirroring loop-back back mode for the indexed Ethernet switch port was not activated successfully. |
EthIf_SetPortTxMode¶
Std_ReturnType EthIf_SetPortTxMode(uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTxModeType Mode)
Activates a given transmission mode of the indexed Ethernet switch port.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
Mode |
Transmission mode to be activated. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port Tx mode for the indexed Ethernet switch port was activated successfully. |
E_NOT_OK |
the port Tx mode for the indexed Ethernet switch port was not activated successfully. |
EthIf_GetPortCableDiagnosticsResult¶
Std_ReturnType EthIf_GetPortCableDiagnosticsResult(uint8 SwitchIdx, uint8 PortIdx, EthTrcv_CableDiagResultType *ResultPtr)
Retrieves the cable diagnostics result of the indexed Ethernet switch port respectively the referenced Ethernet Transceiver Driver.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
ResultPtr |
Pointer to the location where the cable diagnostics result shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the port cable diagnostic result for the indexed Ethernet switch port was obtained successfully. |
E_NOT_OK |
the port cable diagnostic result for the indexed Ethernet switch port was not obtained successfully. |
EthIf_RunPortCableDiagnostic¶
Std_ReturnType EthIf_RunPortCableDiagnostic(uint8 SwitchIdx, uint8 PortIdx)
Trigger the cable diagnostics of the given Ethernet Switch port (PortIdx) by calling EthTrcv_Run CableDiagnostic of the referenced Ethernet transceiver.
- Sync/Async
TRUE
- Reentrancy
Reentrant Reentrant for different SwitchIdx and PortIdx. Non reentrant for the same SwitchIdx and PortIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
[in] |
PortIdx |
Index of the port at the addressed switch. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The trigger to run the cable diagnostic has been accepted. |
E_NOT_OK |
The trigger to run the cable diagnostic has not been accepted. |
EthIf_RunCableDiagnostic¶
Std_ReturnType EthIf_RunCableDiagnostic(uint8 TrcvIdx)
Trigger the cable diagnostics for the given Ethernet transceiver..
- Sync/Async
TRUE
- Reentrancy
Reentrant Reentrant for different TrcvIdx. Non reentrant for the same TrcvIdx..
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the switch within the context of the Ethernet Switch Driver. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The trigger has been accepted.. |
E_NOT_OK |
The trigger has not been accepted. |
EthIf_SwitchGetCfgDataRaw¶
Std_ReturnType EthIf_SwitchGetCfgDataRaw(uint8 SwitchIdx, uint32 Offset, uint16 Length, uint8 *BufferPtr)
Retrieves the data in memory of the indexed Ethernet switch in variable length.
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the Ethernet switch within the context of the Ethernet Switch Driver. |
[in] |
Offset |
Offset of the Ethernet switch memory from where the reading starts. |
[in] |
Length |
Length of data in bytes that shall be copied. |
[out] |
BufferPtr |
Pointer to the location where the data shall be copied. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The trigger has been accepted.. |
E_NOT_OK |
The trigger has not been accepted. |
EthIf_SwitchGetCfgDataInfo¶
Std_ReturnType EthIf_SwitchGetCfgDataInfo(uint8 SwitchIdx, uint32 *DataSizePtr, uint32 *DataAdressPtr)
Retrieves the data in memory of the indexed Ethernet switch in variable length.
- Sync/Async
FALSE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the Ethernet switch within the context of the Ethernet Switch Driver. |
[out] |
DataSizePtr |
Pointer to the location where the total size of the configuration data shall be copied. |
[out] |
DataAdressPtr |
Pointer to the location where the start address of the configuration registers shall be copied. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
the data was obtained successfully. |
E_NOT_OK |
the data was not obtained successfully. (i.e. indexedEthernet switch is not available). |
EthIf_SwitchPortGetMaxFIFOBufferFillLevel¶
Std_ReturnType EthIf_SwitchPortGetMaxFIFOBufferFillLevel(uint8 SwitchPortIdx, uint8 PortIdx, uint8 SwitchPortEgressFifoIdx, uint32 *SwitchPortEgressFifoBufferLevelPtr)
The function retrieves the maximum amount of allocated FIFO buffer of the indexed Ethernet switch egress port.If the Ethernet switch hardware does not support Ethernet switch port based maximal FIFO buffer level, the content of SwitchPortEgressFifoBufferLevelPtr shall be set to 0xFFFFFFFF.This API may be called by e.g. a CDD.
- Sync/Async
FALSE
- Reentrancy
Reentrant Reentrant for different SwitchIdx and PortIdx. Non reentrant for the same SwitchIdx and PortIdx.
Parameters
Dir |
Name |
Description |
|---|---|---|
SwitchPortIdx |
||
[in] |
PortIdx |
Index of the port at the addressed switch. |
[out] |
SwitchPortEgressFifoIdx |
Index of the egress FIFO of the addressed Ethernet switch port. |
[out] |
SwitchPortEgressFifoBufferLevelPtr |
Pointer to a memory location, where the maximum amount of allocated FIFO buffer (in bytes) since the last read out shall be stored. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
The maximal FIFO buffer level could not be obtained. |
EthIf_TransceiverGetMacMethod¶
Std_ReturnType EthIf_TransceiverGetMacMethod(uint8 TrcvIdx, EthTrcv_MacMethodType *MacModePtr)
Obtains the media access mode of the transceiver..
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the transceiver within the context of the Ethernet Transceiver Driver. |
[out] |
MacModePtr |
ETHTRCV_MAC_TYPE_CSMA_CD: Carrier-sense multiple access with collicion detection. ETHTRCV_MAC_TYPE_PLCA: Physical layer collision avoidance. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success.. |
E_NOT_OK |
transceiver request has not been accepted. |
EthIf_EthGetSpiStatus¶
Std_ReturnType EthIf_EthGetSpiStatus(uint8 CtrlIdx, Eth_SpiStatusType *SpiStatusPtr)
When MACPHY controller are used, obtains the SPI interface status..
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the controller within the context of the Ethernet controller Driver. |
[out] |
SpiStatusPtr |
Status of the SPI interface. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
success. |
E_NOT_OK |
Controller request has not been accepted.. |
EthIf_RxIndication¶
void EthIf_RxIndication(uint8 CtrlIdx, Eth_FrameType FrameType, boolean IsBroadcast, const uint8 *PhysAddrPtr, const Eth_DataType *DataPtr, uint16 DataLen, TimeTupleType *IngressTimeTuplePtr, Eth_BufIdxType RxHandleId)
Receive indication of an Ethernet frame which was received by the indexed controller.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the physical Ethernet controller within the context of the Ethernet Interface. |
[in] |
FrameType |
Frame type of received Ethernet frame. |
[in] |
IsBroadcast |
parameter to indicate a broadcast frame. |
[in] |
PhysAddrPtr |
Pointer to Physical source address (MAC address in network byte order) of received Ethernet frame. |
[in] |
DataPtr |
Pointer to payload of received Ethernet frame. |
[in] |
DataLen |
Length (bytes) of the payload in received frame. |
[in] |
IngressTimeTuplePtr |
Pointer to ingress timestamp provided as time tuple. |
[in] |
RxHandleId |
Unique receive handle id provided by the Ethernet Driver, to identify the ingress queue element per hysical Ethernet controller. |
- Return type
void
EthIf_TxConfirmation¶
void EthIf_TxConfirmation(uint8 CtrlIdx, Eth_BufIdxType BufIdx, Std_ReturnType Result)
Confirms frame transmission by the indexed controller.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the physical Ethernet controller within the context of the Ethernet Interface. |
[in] |
BufIdx |
Index of the transmitted buffer. |
[in] |
Result |
E_OK: The transmission was successful, E_NOT_OK: The transmission failed. |
- Return type
void
EthIf_CtrlModeIndication¶
void EthIf_CtrlModeIndication(uint8 CtrlIdx, Eth_ModeType CtrlMode)
Called asynchronously when mode has been read out.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant for the same CtrlIdx, reentrant for different
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
CtrlIdx |
Index of the physical Ethernet controller within the context of the Ethernet Interface. |
[in] |
CtrlMode |
Notified Ethernet controller mode. |
- Return type
void
EthIf_TrcvModeIndication¶
void EthIf_TrcvModeIndication(uint8 TrcvIdx, Eth_ModeType TrcvMode)
Called asynchronously when a mode change has been read out.
- Sync/Async
TRUE
- Reentrancy
Non Reentrant for the same CtrlIdx, reentrant for different
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the Ethernet transceiver within the context of the Ethernet Interface. |
[in] |
TrcvMode |
Notified Ethernet transceiver mode. |
- Return type
void
EthIf_SwitchPortModeIndication¶
void EthIf_SwitchPortModeIndication(uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_ModeType PortMode)
The EthIf shall determine the expected notifications based on the EthSwtPort configuration.In case the EthSwtPort references an EthTrcv the EthIf expects a notification from the EthTrcv via API
- Sync/Async
FALSE
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
SwitchIdx |
Index of the switch. |
[in] |
SwitchPortIdx |
Index of the port at the addressed switch. |
[in] |
PortMode |
Notified Ethernet Switch port mode. |
- Return type
void
EthIf_SleepIndication¶
void EthIf_SleepIndication(uint8 TrcvIdx)
This API is called by the corresponding EthTrcv, if a sleep indication was detected on the network.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
TrcvIdx |
Index of the Ethernet transceiver within the context of the Ethernet Interface. |
- Return type
void
类型定义 Type Definitions¶
Type Name |
Type |
Description |
|---|---|---|
EthIf_StateType |
enum EthIf_StateTag |
state of EthIf |
EthIf_CtrlRefTrcvType |
enum EthIf_CtrlRefTrcvTag |
Type of ethernet hardware refercecd by controller. |
EthIf_MeasurementIdxType |
uint8 |
|
EthIf_SwitchPortGroupIdxType |
uint8 |
Definition of configurable interface <User>_TrcvLinkStateChg. |
EthIfULRxIndicationFuncType |
void* |
Definition of configurable interface <User>_RxIndication. |
EthIfULTxConfirmationFuncType |
void* |
Definition of configurable interface. |
EthIfTrcvLinkStateChgFuncType |
void* |
Definition of configurable interface <User>_TrcvLinkStateChg. |
EthIf_EthDriverApiType |
struct EthIf_EthDriverApiTag |
Api Type of Ethernet Driver. |
EthIf_ControllerCfgType |
struct EthIf_ControllerCfgTag |
EthIfController Configuration type. |
EthIf_FrameOwnerCfgType |
struct EthIf_FrameOwnerCfgTag |
EthIfFrameOwner Configuration type. |
EthIf_SwitchCfgType |
struct EthIf_SwitchCfgTag |
EthIfSwitch Configuration type. |
EthIf_TrcvCfgType |
struct EthIf_TrcvCfgTag |
EthIfTransceiver Configuration type. |
EthIf_PhysControllerType |
struct EthIf_PhysControllerTag |
EthIfPhysicalController Configuration type. |
EthIf_PortGroupSemanticType |
enum EthIf_PortGroupSemanticTag |
Sementic type of EthIfSwitchPortGroup. |
EthIf_EthSwtPortCfgType |
struct EthIf_EthSwtPortCfgTag |
EthSwitchPort Configuration type. |
EthIf_PortGroupType |
struct EthIf_PortGroupTag |
EthIfPortGroup Configuration type. |
EthIf_ConfigType |
struct EthIf_ConfigTag |
EthIf Configuration type. |
EthIf_StateTag |
enum |
state of EthIf |
EthIf_CtrlRefTrcvTag |
enum |
Type of ethernet hardware refercecd by controller. |
EthIf_PortGroupSemanticTag |
enum |
Sementic type of EthIfSwitchPortGroup. |
配置 Configuration¶
OverView¶
如下图所示EthIfConfigSet与EthIfGeneral页面上的内容是按照AUTOSAR的规范进行开发设置的,另外的EthTrcv_DriverApiConfigSet,Eth_DriverApiConfigSet与EthSwt_DriverApiConfigSet分别用于配置Ethernet Transceiver,Ethernet Driver与Ethnernet Switch相关的驱动的API(后续称这三个页面为驱动具体名称配置页面)。
As shown in the figure below, the contents on the EthIfConfigSet and EthIfGeneral pages are developed and set in accordance with AUTOSAR specifications. In addition, EthTrcv_DriverApiConfigSet, Eth_DriverApiConfigSet, and EthSwt_DriverApiConfigSet are used to configure the APIs of drivers related to Ethernet Transceiver, Ethernet Driver, and Ethernet Switch respectively (these three pages are referred to as “Driver-Specific Name Configuration Pages” hereinafter).
EthIf模块配置界面概览 (EthIf Module Configuration Interface Overview)¶
驱动具体名称的配置页面与EthIfGeneral页面的内容基本可以按照字面意思进行配置,下面将着重说一下EthIfConfigSet中的容器的配置。
The contents of the Driver-Specific Name Configuration Pages and the EthIfGeneral page can basically be configured according to their literal meanings. The following will focus on the configuration of the containers in EthIfConfigSet.
EthIfConfigSet中的容器 Containers in EthIfConfigSet¶
容器EthIfPhysController Container EthIfPhysController¶
这个容器主要是用于EthIf层抽象的EthIfPhysController关联Ethernet Driver(后续也可以是WEthernet与CanXL)的物理以太网控制器。在多分区的工程中这里还需要配置EthIfCtrlPartitionRef。
This container is mainly used for the EthIfPhysController abstracted by the EthIf layer to associate the physical Ethernet Controller of the Ethernet Driver (which can also be WEthernet and CanXL hereinafter). In a multi-partition project, EthIfCtrlPartitionRef also needs to be configured here.
EthIfPhysController配置界面 (EthIfPhysController Configuration Interface)¶
此外在配置上,EthIfPhysController几乎只被EthIf模块内部使用,而EthIf外的模块访问以太网硬件几乎都是通过关联EthIfController来实现的。
In addition, in terms of configuration, EthIfPhysController is almost only used internally by the EthIf module, while modules outside EthIf access Ethernet hardware almost all through associating EthIfController.
容器EthIfController Container EthIfController¶
这里主要用于配置EthIf模块向上层抽象出来的EthIfController,EthIf外的模块访问以太网硬件几乎都是通过EthIfController来实现的。配置界面上提供了不少的属性,其中EthIfVlanId比较重要。
This is mainly used to configure the EthIfController abstracted by the EthIf module for the upper layer. Modules outside EthIf access Ethernet hardware almost all through EthIfController. The configuration interface provides many attributes, among which EthIfVlanId is relatively important.
EthIfController配置界面 (EthIfController Configuration Interface)¶
容器EthIfTransceiver,EthIfSwitch与EthIfSwitchPortGroup Containers EthIfTransceiver, EthIfSwitch, and EthIfSwitchPortGroup¶
这三类容器主要都是引用外部模块的配置,可依据需要与配置属性的介绍进行配置。
These three types of containers are mainly used to reference the configurations of external modules, and can be configured according to needs and the description of configuration attributes.
容器EthIfTrcvLinkStateChgConfig Container EthIfTrcvLinkStateChgConfig¶
这个容器用于配置EthIf模块检测到Transceiver的link状态发生变化时将新的link状态报告给对应的模块,EthIf模块会调用容器配置的目标模块的回调函数。
This container is used to configure that when the EthIf module detects a change in the link state of the Transceiver, it will report the new link state to the corresponding module, and the EthIf module will call the callback function of the target module configured in the container.
具体实现时EthIf会根据发送link状态变化的Transceiver所关联的EthIfController作为参数,遍历所有的EthIfTrcvLinkStateChgConfig配置并调用其配置的目标模块的回调函数。
In specific implementation, EthIf will use the EthIfController associated with the Transceiver that sends the link state change as a parameter, traverse all EthIfTrcvLinkStateChgConfig configurations, and call the callback function of the target module configured therein.
EthIfTrcvLinkStateChgConfig配置界面 (EthIfTrcvLinkStateChgConfig Configuration Interface)
容器EthIfRxIndicationConfig,EthIfTxConfirmationConfig与EthIfFrameOwnerConfig Containers EthIfRxIndicationConfig, EthIfTxConfirmationConfig, and EthIfFrameOwnerConfig¶
容器EthIfRxIndicationConfig用于配置EthIf接收到以太网报文时将会调用的目标模块用于接收EthIf传递的以太网数据的回调函数,这个容器中可以配置多个EthIfRxIndicationConfig,但是EthIf会依据EthIfFrameOwnerConfig的配置选择调用哪一个配置的回调函数。
The container EthIfRxIndicationConfig is used to configure the callback function of the target module that the EthIf module will call to receive the Ethernet data transmitted by EthIf when it receives an Ethernet frame. Multiple EthIfRxIndicationConfig configurations can be set in this container, but EthIf will select which configured callback function to call based on the configuration of EthIfFrameOwnerConfig.
容器EthIfTxConfirmationConfig用于配置EthIf接收到以太网报文发送完成确认时向上层模块报告以太网报文的发送完成确认,即调用配置在这个容器中的上层模块的发送完成确认的回调函数,EthIf会依据EthIfFrameOwnerConfig的配置选择调用哪一个配置的回调函数。
The container EthIfTxConfirmationConfig is used to configure that when the EthIf module receives the confirmation of the completion of Ethernet frame transmission, it will report the transmission completion confirmation of the Ethernet frame to the upper-layer module, i.e., call the transmission completion confirmation callback function of the upper-layer module configured in this container. EthIf will select which configured callback function to call based on the configuration of EthIfFrameOwnerConfig.
EthIf_TxConfirmation回调函数可以配置成NULL_PTR (The EthIf_TxConfirmation callback function can be configured as NULL_PTR)¶
Important
在EthIf模块内部会维护EthIfFrameOwnerConfig中配置的报文类型相关的数据,在收到以太网报文时将遍历EthIfFrameOwnerConfig中的配置,当EthIfFramType与收到的报文匹配时将根据当前EthIfFrameOwnerConfig中配置的EthIfOwner(它是从0开始计数的)调用EthIfRxIndicationConfig中对应条目中的回调函数。
The EthIf module will maintain data related to the frame type configured in EthIfFrameOwnerConfig internally. When an Ethernet frame is received, it will traverse the configurations in EthIfFrameOwnerConfig. When the EthIfFramType matches the received frame, it will call the callback function in the corresponding entry of EthIfRxIndicationConfig according to the EthIfOwner (counted from 0) configured in the current EthIfFrameOwnerConfig.
在EthIf模块发送数据时,EthIf模块会依据发送的报文的类型与EthIfFrameOwnerConfig中配置的报文类型进行匹配,当完成匹配时EthIf模块会在EthIfFrameOwnerConfig对应的条目中记录下对应的EthIfPhyController与BufIndex;当EthIf_TxConfirmation函数被调用时,通过EthIfPhyController与BufIndex的匹配找到对应的EthIfFrameOwnerConfig中配置,进而确定出EthIfOwner然后再调用EthIfTxConfirmationConfig对应的回调函数。
When the EthIf module sends data, it will match the type of the frame to be sent with the frame type configured in EthIfFrameOwnerConfig. When the matching is completed, the EthIf module will record the corresponding EthIfPhyController and BufIndex in the corresponding entry of EthIfFrameOwnerConfig; when the EthIf_TxConfirmation function is called, it will find the corresponding configuration in EthIfFrameOwnerConfig through the matching of EthIfPhyController and BufIndex, then determine the EthIfOwner, and further call the corresponding callback function in EthIfTxConfirmationConfig.
所以简单来说配置时需要确保同一个上层模块的TxConfirmation与RxIndication函数,在EthIfTxConfirmationConfig与EthIfRxIndicationConfig中处在相同的序号位置上,若这个上层模块没有对应的回调函数,可以配置“NULL_PTR”来替代从而保证在这两个容器中的顺序的一致。
Therefore, simply put, during configuration, it is necessary to ensure that the TxConfirmation and RxIndication functions of the same upper-layer module are in the same sequence position in EthIfTxConfirmationConfig and EthIfRxIndicationConfig. If the upper-layer module does not have a corresponding callback function, it can be replaced by configuring “NULL_PTR” to ensure the consistency of the sequence in these two containers.