Ethernet Driver (Eth)
Provides uniform hardware access to Ethernet controller interfaces.
Funktionen — Übersicht
void Eth_Init (const Eth_ConfigType* CfgPtr);Initializes the Ethernet DriverStd_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);Enables / disables the indexed controller Tags: atp.Std_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);Enables / Disables Rx/ Tx communication of the indexed controller Tags: atp.Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);Obtains the state of the indexed controller Tags: atp.Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);Obtains the communication state of the indexed controller Tags: atp.void Eth_GetPhysAddr (uint8 CtrlIdx, uint8* PhysAddrPtr);Obtains the physical source address used by the indexed controllervoid Eth_SetPhysAddr (uint8 CtrlIdx, const uint8* PhysAddrPtr);Sets the physical source address used by the indexed controllerStd_ReturnType Eth_UpdatePhysAddrFilter (uint8 CtrlIdx, const uint8* PhysAddrPtr, Eth_FilterActionType Action);Update the physica l source address to/ from the indexed controller filter.Std_ReturnType Eth_WriteMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16 RegVal);Configures a transceiver register or triggers a function offered by the receiverStd_ReturnType Eth_ReadMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16* RegValPtr);Reads a transceiver registerStd_ReturnType Eth_GetCounterValues (uint8 CtrlIdx, Eth_CounterType* CounterPtr);Reads a list with drop counter values of the corresponding controller.Std_ReturnType Eth_GetRxStats (uint8 CtrlIdx, Eth_RxStatsType* RxStats);Returns the following list according to IETF RFC281 9, where the maximal possible value shall denote an invalid value, e.Std_ReturnType Eth_GetTxStats (uint8 CtrlIdx, Eth_TxStatsType* TxStats);Returns the list of Transmission Statistics out of IETF RFC1213 defined with Eth_ Tx Stats Type, where the maximal possible...Std_ReturnType Eth_GetTxErrorCounterValues (uint8 CtrlIdx, Eth_TxErrorCounterValuesType* TxErrorCounterValues);Returns the list of Transmission Error Counters out of IETF RFC1213 and RFC1643 defined with Eth_ Tx Error Counter Values...Std_ReturnType Eth_GetCurrentTime (uint8 CtrlIdx, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);Returns a time value out of the HW registers according to the capability of the HW.void Eth_EnableEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx);Activat es egress time stamping on a dedicated message object.Std_ReturnType Eth_GetEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);Reads back the egress time stamp on a dedicated message object.Std_ReturnType Eth_GetIngressTimeStamp (uint8 CtrlIdx, const Eth_DataType* DataPtr, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);Reads back the ingress time stamp on a dedicated message object.BufReq_ReturnType Eth_ProvideTxBuffer (uint8 CtrlIdx, uint8 Priority, Eth_BufIdxType* BufIdxPtr, uint8* * BufPtr, uint16* LenBytePtr);Provides access to a transmit buffer of the FIFO related to the specified priorityStd_ReturnType Eth_Transmit (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_FrameType FrameType, boolean TxConfirmation, uint16 LenByte, const uint8* PhysAddrPtr);Triggers transmission of a previously filled transmit buffervoid Eth_Receive (uint8 CtrlIdx, uint8 FifoIdx, Eth_RxStatusType* RxStatusPtr);Receive a frame from the related fifo.void Eth_TxConfirmation (uint8 CtrlIdx);Triggers frame transmission confirmationvoid Eth_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);Returns the version information of this modulevoid Eth_MainFunction (void);The function checks for controller errors and lost frames.
Typen — Übersicht
struct Eth_ConfigTypeImplementation specific structure of the post build configurationenum Eth_ModeTypeThis is an generic type and used in the layers of the Ethernet communication stack (e.enum Eth_ModeTypeThis is an generic type and used in the layers of the Ethernet commun ication stack (e.enum Eth_StateTypeStatus supervision used for Development Error Detection.Eth_FrameTypeThis type defines the Ethernet frame type used in the Ethernet frame headerEth_DataTypeThis type defines the Ethernet data type used for data transmission.Eth_BufIdxTypeEthernet buffer identifier type.enum Eth_RxStatusTypeUsed as out parameter in Eth_ Receive() indicates whether a frame has been received and if so, whether more frames are...enum Eth_FilterActionTypeThe Enumeration Type Eth_ Filter Action Type describes the action to be taklen for the MAC address given in *Phys Addr Ptr.Eth_TimeStampQualTypeDepending on the HW, quality information regarding the evaluated time stamp might be supported.Eth_TimeStampTypeVariables of this type are used for expressing time stamps including relative time and absolute calendar time.Eth_TimeIntDiffTypeVariables of this type are used to express time differences.Eth_RateRatioTypeVariables of this type are used to express frequency ratios.struct Eth_MacVlanTypeThis type is used to read out addresses from the address resolution logic (A RL) table of the switch.Eth_CounterTypeType Eth_CounterType.Eth_RxStatsTypeType Eth_RxStatsType.Eth_TxStatsTypeStatistic counter for diag nostics.Eth_TxErrorCounterValuesTypeType Eth_TxErrorCounterValuesType.
Funktionen & Typen — Detailansicht
function Eth_Init [SWS_Eth_00027] 📄 PDF
void Eth_Init (const Eth_ConfigType* CfgPtr);
Initializes the Ethernet Driver
The function Eth_Init serves to initialize the Ethernet driver [SWS_Eth_00027]. It is declared via the header file Eth.h, has the service ID 0x01, and has no return value (void) [SWS_Eth_00027]. As an input parameter, it expects CfgPtr, which points to an implementation-specific configuration structure of type Eth_ConfigType [SWS_Eth_00027]. The call is synchronous and defined as non-reentrant (Non Reentrant) [SWS_Eth_00027].
In the operational sequence, Eth_Init constitutes the fundamental precondition for working with the module. All other functions strictly require a prior controller initialization by Eth_Init [SWS_Eth_00070], [SWS_Eth_00167], [SWS_Eth_00185]. This dependency is mandatorily prescribed for various controller services of the driver [SWS_Eth_00189], [SWS_Eth_00194], [SWS_Eth_00199], [SWS_Eth_00232].
Dedicated error handling is provided in case of uninitialized access: When development error detection (DET) is activated, the driver functions check whether service Eth_Init was properly called beforehand [SWS_Eth_00066]. If this check is not successful, they raise the development error ETH_E_UNINIT [SWS_Eth_00164], [SWS_Eth_00182], [SWS_Eth_00187], [SWS_Eth_00196]. If DET is disabled, however, affected functions refuse execution and signal the impermissible state by returning status E_NOT_OK [SWS_Eth_00228], [SWS_Eth_00235], [SWS_Eth_00248], [SWS_Eth_00252].
This text was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I2)
function Eth_SetControllerMode [SWS_Eth_00041] 📄 PDF
Std_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);
Enables / disables the indexed controller Tags: atp.Status=obsolete
The function Eth_SetControllerMode serves to enable (ETH_MODE_ACTIVE) or disable (ETH_MODE_DOWN) the Ethernet controller addressed via parameter CtrlIdx [SWS_Eth_00041]. In AUTOSAR Classic R20-11, this service is classified as obsolete (obsolete) [SWS_Eth_00041].
Execution of the service is asynchronous and non-reentrant (Non Reentrant) [SWS_Eth_00041]. As return value, the function returns E_OK upon successful initiation or E_NOT_OK if the operating mode could not be changed [SWS_Eth_00041]. Interpretation: Since the call is specified as asynchronous, but no callback is defined in the payload, the actual state change is likely completed near the hardware in the driver background after return from the function. Question Q-d7ec04578e921eb9 (open)
If the controller or its transmit and receive communication is disabled via Eth_SetControllerMode, mandatory buffer cleanup actions apply:
- All locked transmit buffers must be released [SWS_Eth_00137] [SWS_Eth_00280].
- All pending transmit buffers must also be released [SWS_Eth_00138] [SWS_Eth_00281].
Due to the property Non Reentrant, the function must not be executed concurrently for the same or additional controller instances [SWS_Eth_00041]. Specific DET or DEM error notifications are not listed; error conditions are communicated to the caller via the return value E_NOT_OK [SWS_Eth_00041].
This usage note was generated automatically based on the specification data of AUTOSAR Classic R20-11.
Implementer's Guide to follow (complexity I2)
function Eth_SetControllerMode [SWS_Eth_91009] 📄 PDF
Std_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);
Enables / Disables Rx/ Tx communication of the indexed controller Tags: atp.Status=draft
The function Eth_SetControllerMode (Service ID 0x03, provided via Eth.h) serves to enable and disable receive and transmit communication (Rx/Tx) of a specific Ethernet controller [SWS_Eth_91009].
Usage and Call Conditions
Execution of the function is asynchronous and specified as non-reentrant (Non Reentrant) [SWS_Eth_91009]. Upon invocation, two parameters are passed:
CtrlIdx: Index of the respective controller in the context of the Ethernet driver [SWS_Eth_91009].CtrlMode: Target mode for the controller, eitherETH_MODE_ACTIVEto enable Rx/Tx communication orETH_MODE_DOWNto disable it [SWS_Eth_91009].
As return value, the function returns status Std_ReturnType: E_OK signals successful execution, whereas E_NOT_OK indicates that the mode of the controller could not be changed [SWS_Eth_91009].
Interaction and Buffer Management
If the Rx/Tx communication of the indexed controller is disabled via Eth_SetControllerMode (mode ETH_MODE_DOWN), cleanup actions for the transmit buffers must mandatorily be performed:
- All locked transmit buffers must be released [SWS_Eth_00280].
- All pending transmit buffers must also be released [SWS_Eth_00281].
The current provisions for releasing locked and pending buffers as well as the function definition itself have the status "draft" [SWS_Eth_91009], [SWS_Eth_00280], [SWS_Eth_00281]. They replace the historically preceding requirements [SWS_Eth_00137] and [SWS_Eth_00138], which are classified as obsolete.
This text was generated by an AI based on the AUTOSAR specifications.
Implementer's Guide to follow (complexity I2)
function Eth_GetControllerMode [SWS_Eth_00046] 📄 PDF
Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);
Obtains the state of the indexed controller Tags: atp.Status=obsolete
function Eth_GetControllerMode [SWS_Eth_91010] 📄 PDF
Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);
Obtains the communication state of the indexed controller Tags: atp.Status=draft
function Eth_GetPhysAddr [SWS_Eth_00052] 📄 PDF
void Eth_GetPhysAddr (uint8 CtrlIdx, uint8* PhysAddrPtr);
Obtains the physical source address used by the indexed controller
function Eth_SetPhysAddr [SWS_Eth_00151] 📄 PDF
void Eth_SetPhysAddr (uint8 CtrlIdx, const uint8* PhysAddrPtr);
Sets the physical source address used by the indexed controller
function Eth_UpdatePhysAddrFilter [SWS_Eth_00152] 📄 PDF
Std_ReturnType Eth_UpdatePhysAddrFilter (uint8 CtrlIdx, const uint8* PhysAddrPtr, Eth_FilterActionType Action);
Update the physica l source address to/ from the indexed controller filter. If the Ethernet Controller is not capable to do the filtering, the software has to do this.
The synchronous interface Eth_UpdatePhysAddrFilter is provided via the header file Eth.h and has the service ID 0x12 [SWS_Eth_00152]. The function serves to add a physical address to or remove it from the filter of an indexed Ethernet controller [SWS_Eth_00152].
The parameters of the function comprise three input values [SWS_Eth_00152]:
CtrlIdx: Determines the index of the respective Ethernet controller within the driver context [SWS_Eth_00152].PhysAddrPtr: Pointer to the memory area containing the physical destination address (MAC address) in network byte order; this is the multicast destination address of the layer 2 Ethernet packet [SWS_Eth_00152].Action: Specifies via the enumeration typeEth_FilterActionTypewhether the specified address is added to or deleted from the controller filter [SWS_Eth_00152].
The function returns a status of type Std_ReturnType: E_OK confirms the successful modification of the filter, while E_NOT_OK reports that the filter could not be modified [SWS_Eth_00152]. If the Ethernet controller is incapable on the hardware side of performing the filtering autonomously, the filtering task must be implemented by software [SWS_Eth_00152].
A strict reentrancy restriction applies to the execution: The function is non-reentrant for the same controller index (CtrlIdx), but may be called concurrently and reentrantly for differing controller indices [SWS_Eth_00152].
This usage note was generated by an AI system based on the AUTOSAR Classic specification R20-11.
Implementer's Guide to follow (complexity I1)
function Eth_WriteMii [SWS_Eth_00058] 📄 PDF
Std_ReturnType Eth_WriteMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16 RegVal);
Configures a transceiver register or triggers a function offered by the receiver
The function Eth_WriteMii serves to configure a register of an Ethernet transceiver via the MII interface or to trigger a function provided by the transceiver [SWS_Eth_00058]. The declaration is available via the header Eth.h [SWS_Eth_00058].
Usage and Parameters
The call is made with the service ID 0x05 and processes four input parameters [SWS_Eth_00058]:
CtrlIdx: Index of the Ethernet controller in the context of the Ethernet driver [SWS_Eth_00058].TrcvIdx: Index of the transceiver on the MII interface [SWS_Eth_00058].RegIdx: Index of the transceiver register to be written on the MII [SWS_Eth_00058].RegVal: The 16-bit value to be written into the addressed register [SWS_Eth_00058].
The execution of the service is specified as asynchronous [SWS_Eth_00058]. This means that the actual write operation via the hardware interface is typically handled in the background, while the function returns immediately after accepting the request. Question Q-0f9a9e682985d796 (open)
Return Values and Restrictions
As return value, the function provides type Std_ReturnType [SWS_Eth_00058]:
E_OK: The write request was accepted successfully [SWS_Eth_00058].E_NOT_OK: The service was rejected [SWS_Eth_00058].
Regarding concurrency, Eth_WriteMii is specified as non-reentrant (Non Reentrant) [SWS_Eth_00058]. Calls must therefore not be executed concurrently without appropriate synchronization by the caller.
This usage note was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function Eth_ReadMii [SWS_Eth_00064] 📄 PDF
Std_ReturnType Eth_ReadMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16* RegValPtr);
Reads a transceiver register
Usage and Parameters
The function Eth_ReadMii (Service ID 0x06) serves to read a transceiver register via the MII interface and is provided via header file Eth.h [SWS_Eth_00064]. Upon invocation, CtrlIdx identifies the respective Ethernet controller in the driver context, TrcvIdx identifies the addressed transceiver on the MII, and RegIdx identifies the concrete transceiver register [SWS_Eth_00064]. The determined register value is written to the memory location pointed to by pointer RegValPtr [SWS_Eth_00064].
Execution and Concurrency
Execution is asynchronous (Asynchronous) [SWS_Eth_00064]. A return value of E_OK merely confirms that the service or the read request was successfully accepted (Service accepted), whereas E_NOT_OK signals a rejection of the request (Service denied) [SWS_Eth_00064]. Because of the asynchronous nature, the memory area passed for RegValPtr likely must remain valid until final completion of the read operation. Question Q-04a94624b96bf51f (open) Since the function is also classified as non-reentrant (Non Reentrant) [SWS_Eth_00064], callers must not perform concurrent accesses across different tasks or interrupt contexts without external synchronization.
Error handling
If the driver cannot accept the read request, the call is acknowledged directly with E_NOT_OK [SWS_Eth_00064]. Specific error codes, DET runtime checks, or DEM diagnostic events are not listed for this function in the element-related specification data.
This usage note was created by an AI based on the specification.
Implementer's Guide to follow (complexity I1)
function Eth_GetCounterValues [SWS_Eth_00226] 📄 PDF
Std_ReturnType Eth_GetCounterValues (uint8 CtrlIdx, Eth_CounterType* CounterPtr);
Reads a list with drop counter values of the corresponding controller. The meaning of these values is described at Eth_ Counter Type.
function Eth_GetRxStats [SWS_Eth_00233] 📄 PDF
Std_ReturnType Eth_GetRxStats (uint8 CtrlIdx, Eth_RxStatsType* RxStats);
Returns the following list according to IETF RFC281 9, where the maximal possible value shall denote an invalid value, e.g. if this counter is not available: 1. ether Stats Drop Events 2. ether Stats Octets 3. ether Stats Pkts 4. ether Stats Broadcast Pkts 5. ether Stats Multicast Pkts 6. ether Stats Crc Al ign Errors 7. ether Stats Undersize Pkts 8. ether Stats Oversize Pkts 9. ether Stats Fragments 10. ether Stats Jabbers 11. ether Stats Collisions 12. ether Stats Pkts64Octets 13. ether Stats Pkts65to127Octets 14. ether Stats Pkts128to255Octets 15. ether St ats Pkts256to511Octets 16. ether Stats Pkts512to1023Octets 17. ether
function Eth_GetTxStats [SWS_Eth_91005] 📄 PDF
Std_ReturnType Eth_GetTxStats (uint8 CtrlIdx, Eth_TxStatsType* TxStats);
Returns the list of Transmission Statistics out of IETF RFC1213 defined with Eth_ Tx Stats Type, where the maximal possible value shall denote an invalid value, e.g. this counter is not available.
function Eth_GetTxErrorCounterValues [SWS_Eth_91006] 📄 PDF
Std_ReturnType Eth_GetTxErrorCounterValues (uint8 CtrlIdx, Eth_TxErrorCounterValuesType* TxErrorCounterValues);
Returns the list of Transmission Error Counters out of IETF RFC1213 and RFC1643 defined with Eth_ Tx Error Counter Values Type, where the maximal possible value shall denote an invalid value, e.g. this counter is not available.
function Eth_GetCurrentTime [SWS_Eth_00181] 📄 PDF
Std_ReturnType Eth_GetCurrentTime (uint8 CtrlIdx, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);
Returns a time value out of the HW registers according to the capability of the HW. Is the HW resolution is lower than the Eth_ Time Stamp Type resolution resp. range, than an the remainin g bits will be filled with 0. Important Note: Eth_ Get Current Time may be called within an exclusive area.
function Eth_EnableEgressTimeStamp [SWS_Eth_00186] 📄 PDF
void Eth_EnableEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx);
Activat es egress time stamping on a dedicated message object. Some HW does store once the egress time stamp marker and some HW needs it always before transmission. There will be no "disable" functionality, due to the fact, that the message type is always "time st amped" by network design.
The synchronous function Eth_EnableEgressTimeStamp activates the recording of egress timestamps (egress time stamping) for a dedicated message object of the Ethernet driver [SWS_Eth_00186]. The call is made via the header Eth.h with the service ID 0x17 and returns no value [SWS_Eth_00186].
When calling, the following input parameters must be passed [SWS_Eth_00186]:
CtrlIdx: Index of the addressed Ethernet controller [SWS_Eth_00186].BufIdx: Index of the message buffer for which the upper-layer application expects the generation of an egress timestamp [SWS_Eth_00186].
Regarding concurrency, the function is specified as non-reentrant (Non Reentrant) [SWS_Eth_00186]. A parallel call for the same or additional buffers must therefore be synchronized or avoided on the caller side.
The behavior of the hardware varies depending on the controller implementation: Some hardware stores the mark for the egress timestamp persistently, whereas other controllers mandatorily require activation prior to each transmission [SWS_Eth_00186]. Interpretation: For hardware-independent control, it would therefore likely be advisable to call the function prior to each transmission of the desired buffer. Question Q-c2b8d2db03e9d13b (open) A deactivation interface does not exist because the message type is always transmitted timestamped according to the network design [SWS_Eth_00186].
This text was generated by an AI based on the AUTOSAR specification R20-11.
function Eth_GetEgressTimeStamp [SWS_Eth_00190] 📄 PDF
Std_ReturnType Eth_GetEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);
Reads back the egress time stamp on a dedicated message object. It must be called within the Tx Confirmation() function.
function Eth_GetIngressTimeStamp [SWS_Eth_00195] 📄 PDF
Std_ReturnType Eth_GetIngressTimeStamp (uint8 CtrlIdx, const Eth_DataType* DataPtr, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);
Reads back the ingress time stamp on a dedicated message object. It must be called within the Rx Indication() function.
function Eth_ProvideTxBuffer [SWS_Eth_00077] 📄 PDF
BufReq_ReturnType Eth_ProvideTxBuffer (uint8 CtrlIdx, uint8 Priority, Eth_BufIdxType* BufIdxPtr, uint8* * BufPtr, uint16* LenBytePtr);
Provides access to a transmit buffer of the FIFO related to the specified priority
use
The synchronous function Eth_ProvideTxBuffer grants access to an Ethernet transmit buffer of the FIFO that is assigned to the passed priority [SWS_Eth_00077]. It is provided via the header Eth.h and specified as reentrant [SWS_Eth_00077]. Via the input parameters, the controller index CtrlIdx as well as the frame priority Priority for FIFO selection are passed [SWS_Eth_00077]. The in/out parameter LenBytePtr passes the desired buffer size and returns the actually granted byte size after the call [SWS_Eth_00077]. The output parameters BufIdxPtr (resource index for subsequent queries) and BufPtr (pointer to the buffer) provide the references to the memory area [SWS_Eth_00077].
Error Handling and Return Values
The function signals the result via return values of type BufReq_ReturnType [SWS_Eth_00077]:
BUFREQ_OK: The transmit buffer was successfully provided [SWS_Eth_00077].BUFREQ_E_BUSY: All buffer resources are currently occupied [SWS_Eth_00077].BUFREQ_E_OVFL: The requested buffer is too large [SWS_Eth_00077].BUFREQ_E_NOT_OK: A development error was detected [SWS_Eth_00077].
Interaction
If EthCtrlConfigSwBufferHandling is configured to TRUE, a tuple consisting of the buffer index of the software buffer pool passed to BufIdxPtr and the specified priority Priority is stored internally [SWS_Eth_00267].
If Eth_Transmit() is subsequently called, the given buffer index is assigned to the software FIFO whose configuration EthCtrlConfigEgressFifoPriorityAssignment matches the priority previously passed in Eth_ProvideTxBuffer() [SWS_Eth_00268].
This text was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function Eth_Transmit [SWS_Eth_00087] 📄 PDF
Std_ReturnType Eth_Transmit (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_FrameType FrameType, boolean TxConfirmation, uint16 LenByte, const uint8* PhysAddrPtr);
Triggers transmission of a previously filled transmit buffer
Usage and Call Context
The synchronous interface Eth_Transmit initiates the transmission process for a previously provided and filled Ethernet transmit buffer [SWS_Eth_00087]. It accepts the following parameters:
CtrlIdx: Index of the Ethernet controller within the context of the driver [SWS_Eth_00087].BufIdx: Index of the buffer resource to be transmitted [SWS_Eth_00087].FrameType: Specific Ethernet frame type [SWS_Eth_00087].TxConfirmation: Switch for activating transmit confirmation [SWS_Eth_00087].LenByte: Data length of the payload in bytes [SWS_Eth_00087].PhysAddrPtr: Pointer to the physical destination address (MAC address) in network byte order [SWS_Eth_00087].
The return value of type Std_ReturnType signals the successful initiation of the transmission with E_OK and a failure with E_NOT_OK [SWS_Eth_00087].
Interaction and buffer processing
As part of the transmission sequence, Eth_Transmit assigns the buffer pointer BufIdx to the software FIFO whose configuration element EthCtrlConfigEgressFifoPriorityAssignment matches the priority previously defined in Eth_ProvideTxBuffer() [SWS_Eth_00268]. With the call, the corresponding messages are transferred from the software FIFOs into the hardware FIFO [SWS_Eth_00269].
Concurrency
The function is reentrant for calls with different buffer indices (BufIdx) as well as different controller indices (CtrlIdx) [SWS_Eth_00087].
This usage note was generated automatically based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I2)
function Eth_Receive [SWS_Eth_00095] 📄 PDF
void Eth_Receive (uint8 CtrlIdx, uint8 FifoIdx, Eth_RxStatusType* RxStatusPtr);
Receive a frame from the related fifo.
The synchronous function Eth_Receive serves to receive an Ethernet frame from a specific FIFO buffer of an Ethernet controller [SWS_Eth_00095]. It has no return value, but returns the result of the query to the caller via the pointer RxStatusPtr of type Eth_RxStatusType [SWS_Eth_00095]. This output parameter indicates whether a frame was successfully received and whether further frames are available for retrieval in the respective FIFO buffer [SWS_Eth_00095].
Parameters and call context
As input parameters, the function requires the controller index CtrlIdx within the Ethernet driver as well as the index FifoIdx of the FIFO to be read [SWS_Eth_00095]. The function is declared in the header file Eth.h [SWS_Eth_00095]. The call is typically expected to occur periodically within a polling mechanism by higher driver or interface layers. Question Q-f5ec0693a5887bcf (open)
Concurrency and Limitations
Regarding concurrency, Eth_Receive is implemented as reentrant for different FIFOs, but non-reentrant for the same FIFO [SWS_Eth_00095]. Concurrent calls querying the same FIFO of the same controller are impermissible and must be prevented by the calling software.
Interaction with the Ethernet interface
In polling mode, the Ethernet driver is obliged, upon a successful reception, to call the function EthIf_RxIndication directly from the routine Eth_Receive in order to report the received frame to the upper layer for further processing [SWS_Eth_00244].
This text was generated by an AI based on the specification.
Implementer's Guide to follow (complexity I1)
function Eth_TxConfirmation [SWS_Eth_00100] 📄 PDF
void Eth_TxConfirmation (uint8 CtrlIdx);
Triggers frame transmission confirmation
Usage and Call Context
The function Eth_TxConfirmation available via header Eth.h serves to specifically trigger transmission confirmation for transmitted Ethernet frames [SWS_Eth_00100]. It has the Service ID 0x0C and is executed synchronously [SWS_Eth_00100]. As its only input parameter, the function expects CtrlIdx, which determines the logical index of the controller to be addressed within the instance of the Ethernet driver [SWS_Eth_00100]. A return value does not exist (void), and no output parameters are passed [SWS_Eth_00100].
Interaction in the Transmission Sequence
In the interaction of the layers, Eth_TxConfirmation handles the forwarding of the transmission status to the upper Ethernet Interface. If the corresponding notification was enabled, the Ethernet driver is obliged to call EthIf_TxConfirmation with the result value E_OK in order to signal a successful transmission [SWS_Eth_00243]. In polling mode, this call occurs explicitly from the context of routine Eth_TxConfirmation, whereas in interrupt-driven mode, it is alternatively issued directly from the interrupt routine [SWS_Eth_00243].
Concurrency and Execution Conditions
For execution, the restriction applies that Eth_TxConfirmation is defined as non-reentrant (Non Reentrant) [SWS_Eth_00100]. Concurrent calls for the same controller must therefore be prevented by the caller. In polling mode, the call is likely to occur typically cyclically through a higher-level schedule control. Question Q-c19295838459b689 (open) Specific error codes as well as requirements for DET or DEM notifications are not specified in the functional specification, which is why a separate error handling is omitted.
This text was created by an AI; the referenced specification is authoritative.
Implementer's Guide to follow (complexity I1)
function Eth_GetVersionInfo [SWS_Eth_00106] 📄 PDF
void Eth_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);
Returns the version information of this module
function Eth_MainFunction [SWS_Eth_00171] 📄 PDF
void Eth_MainFunction (void);
The function checks for controller errors and lost frames. Used for polling state changes. Calls Eth If_ Ctrl Mode Indication when the controller mode changed.
Usage and Call Context
The function Eth_MainFunction has the signature void Eth_MainFunction(void) and is provided via header file SchM_Eth.h [SWS_Eth_00171]. From this, it can be interpreted: The call is likely to occur cyclically through the Schedule Manager (SchM) in a task-based context, since no input parameters or return values are defined. Question Q-690a2dc372d49c6a (open)
Functional Scope and Polling
The main task of the function consists in polling state changes as well as checking for controller errors and lost Ethernet frames [SWS_Eth_00171]. If the function detects that the mode of the Ethernet controller has changed, it calls function EthIf_CtrlModeIndication to inform the upper layer about the state transition [SWS_Eth_00171].
Processing Order in the Transmit Path
In the context of Eth_MainFunction(), a fixed sequence is prescribed for processing software FIFOs [SWS_Eth_00270]:
- First, all SW FIFOs are iterated and their credit accounts (Credits Account) are updated [SWS_Eth_00270].
- Subsequently, all SW FIFOs are iterated again and checked for messages ready to send [SWS_Eth_00270].
- Transmission is then attempted for each iterated SW FIFO [SWS_Eth_00270].
This usage note was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I2)
type Eth_ConfigType [SWS_Eth_00156] 📄 PDF
Implementation specific structure of the post build configuration
type Eth_ModeType [SWS_Eth_00158] 📄 PDF
This is an generic type and used in the layers of the Ethernet communication stack (e.g. EthIf, Eth, EthSwt, EthTrcv) to enable and disable, resp ectively, the Ethernet communcation channel and set the corresponding hardware (e.g. Ethernet controller, Ethernet Switch port, Ethernet transceiver) to an lowpower sleep and power on mode, respectively. Tags: atp.Status=obsolete
In the layers of the Ethernet communication stack (such as EthIf, Eth, EthSwt, and EthTrcv), the generic enumeration type Eth_ModeType serves to enable or disable the Ethernet communication channel and to switch the associated hardware (such as Ethernet controller, Ethernet switch port, or Ethernet transceiver) into a low-power sleep state or active mode [SWS_Eth_00158].
The type is available via the header file Eth_GeneralTypes.h and defines the following value ranges [SWS_Eth_00158]:
ETH_MODE_DOWN(0x00): Disables the Ethernet communication channel and switches the associated hardware into a low-power sleep mode [SWS_Eth_00158].ETH_MODE_ACTIVE(0x01): Enables the Ethernet communication channel and switches the hardware into operational mode (Power-On Mode) [SWS_Eth_00158].
Regarding the lifecycle and usage, it should be noted that Eth_ModeType is marked with the status obsolete in Release R20-11 [SWS_Eth_00158]. In new developments, using this type should therefore be avoided, as obsolete interface types in future standards are typically replaced by more modern control structures.
This usage note was created automatically. Specification citations refer exclusively to the provided requirements context.
Implementer's Guide to follow (complexity I1)
type Eth_ModeType [SWS_Eth_91008] 📄 PDF
This is an generic type and used in the layers of the Ethernet commun ication stack (e.g. Eth If, Eth, Eth Swt, Eth Trcv) to enable and disable, respectively, the Ethernet communcation channel and set the corresponding hardware (e.g. Ethernet controller, Ethernet Switch port, Ethernet transceiver) to an lowpower sleep and po wer on mode, respectively. The type also support to transfer a wake - up request from the services layer (Com M) to the communication drivers (Eth Trcv). This could be used e.g. for Ethernet hardware that has the capability to wake - up and sleep on data line (see OA TC10) Tags: atp.Status=draft
The enumeration type Eth_ModeType is declared via Eth_GeneralTypes.h and serves as a cross-layer mode type in the AUTOSAR Ethernet communication stack ([SWS_Eth_91008]). It is used in modules such as EthIf, Eth, EthSwt, and EthTrcv to specifically activate or deactivate communication channels and to switch the associated hardware component (Ethernet controller, switch ports, or transceiver) between a power-saving sleep mode and the active operating mode ([SWS_Eth_91008]).
The type comprises three states for mode control ([SWS_Eth_91008]):
ETH_MODE_DOWN(0x00): Deactivates Rx and Tx communication and switches the associated hardware into a low-power sleep mode. If supported by the hardware, a sleep sequence is initiated at the same time (for example, requesting sleep on the data line according to OPEN Alliance TC10).ETH_MODE_ACTIVE(0x01): Activates Rx and Tx communication and switches the associated hardware into the regular operating mode (power-on).ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST(0x02): Activates Rx and Tx communication, sets the hardware to the operating mode, and additionally triggers a wake-up request on the network if the hardware has wake-up capabilities (such as wake-up on the data line according to OPEN Alliance TC10).
In the stack interaction, Eth_ModeType specifically supports forwarding wake-up requests from the service layer (ComM) via the intermediate layers down to the communication drivers (EthTrcv), whereby hardware with wake-up and sleep functionality on the data line is controlled as needed ([SWS_Eth_91008]).
This usage note was generated automatically based on the specification SWS_Eth_91008.
Implementer's Guide to follow (complexity I1)
type Eth_StateType [SWS_Eth_00159] 📄 PDF
Status supervision used for Development Error Detection. The state shall be available for debugging.
The enumeration type Eth_StateType is provided via header Eth_GeneralTypes.h and serves according to [SWS_Eth_00159] for state monitoring of the Ethernet driver. Its purpose is to support development error detection, whereby the current state according to the specification must be available for debugging purposes ([SWS_Eth_00159]).
For state management, Eth_StateType defines two discrete enumeration values ([SWS_Eth_00159]):
ETH_STATE_UNINIT(value0x00): Indicates that the Ethernet driver is not yet configured ([SWS_Eth_00159]).ETH_STATE_INIT(value0x01): Indicates that the Ethernet driver is successfully configured ([SWS_Eth_00159]).
Regarding error handling and interaction, this state type forms the basis for internal error detection. It is likely to be assumed that driver APIs query this state and reject calls as long as the driver is in the uninitialized state ETH_STATE_UNINIT ([SWS_Eth_00159]). Question Q-35a17e3267274d70 (open) Only when the driver has transitioned to state ETH_STATE_INIT is it considered configured and ready for operation ([SWS_Eth_00159]). Since the type definition resides in Eth_GeneralTypes.h, it is available across drivers ([SWS_Eth_00159]).
This text was generated by an AI based on the AUTOSAR CP R20-11 specification.
Implementer's Guide to follow (complexity I1)
type Eth_FrameType [SWS_Eth_00160] 📄 PDF
This type defines the Ethernet frame type used in the Ethernet frame header
type Eth_DataType [SWS_Eth_00161] 📄 PDF
This type defines the Ethernet data type used for data transmission. Its definition depends on the used CPU.
type Eth_BufIdxType [SWS_Eth_00175] 📄 PDF
Ethernet buffer identifier type.
type Eth_RxStatusType [SWS_Eth_00162] 📄 PDF
Used as out parameter in Eth_ Receive() indicates whether a frame has been received and if so, whether more frames are available or frames go t lost.
Usage and Value Range
The enumeration type Eth_RxStatusType is defined according to [SWS_Eth_00162] in the header file Eth_GeneralTypes.h. It serves as an output parameter (out parameter) in the function Eth_Receive(), via which the Ethernet driver indicates whether an Ethernet frame was received and whether further frames are subsequently present in the buffer or data has been lost [SWS_Eth_00162].
The specification defines three discrete enumeration values for this type [SWS_Eth_00162]:
ETH_RECEIVED(0x00): An Ethernet frame was received; no further frames are available in the controller.ETH_NOT_RECEIVED(0x01): No Ethernet frame was received; no further frames are present.ETH_RECEIVED_MORE_DATA_AVAILABLE(0x02): An Ethernet frame was received, and additional frames are available for retrieval.
Interaction during frame processing
When calling Eth_Receive(), the calling layer passes a pointer to a variable of type Eth_RxStatusType. The evaluation of this output parameter controls the further sequence of the reception cycle: The return value ETH_RECEIVED_MORE_DATA_AVAILABLE likely serves as a criterion for the caller to immediately call Eth_Receive() again in order to quickly process remaining frames from the receive buffer [SWS_Eth_00162]. Question Q-4ed309522aa004f8 (open) In contrast, the states ETH_RECEIVED and ETH_NOT_RECEIVED signal that the buffer is exhausted and no further data is pending for processing. Provision via Eth_GeneralTypes.h ensures uniform type usage across modules [SWS_Eth_00162].
This text was generated by an AI and is based exclusively on the specification data from AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
type Eth_FilterActionType [SWS_Eth_00163] 📄 PDF
The Enumeration Type Eth_ Filter Action Type describes the action to be taklen for the MAC address given in *Phys Addr Ptr.
type Eth_TimeStampQualType [SWS_Eth_00177] 📄 PDF
Depending on the HW, quality information regarding the evaluated time stamp might be supported. If not supported, the value shall be always Valid. For Uncertain and Invalid values, the upper layer shall discard the time stamp.
type Eth_TimeStampType [SWS_Eth_00178] 📄 PDF
Variables of this type are used for expressing time stamps including relative time and absolute calendar time. The absolute time starts at 1970 - - 01. 0 to 281474976710655s == 3257812230d [0x FFFF FFFF FFFF] 0 to 999999999ns [0x3B9A C9FF] invalid value in nanoseconds: [0x3B9A CA00] to [0x3FFF FFFF] Bit 30 and 31 reserved, default: 0
type Eth_TimeIntDiffType [SWS_Eth_00179] 📄 PDF
Variables of this type are used to express time differences.
type Eth_RateRatioType [SWS_Eth_00180] 📄 PDF
Variables of this type are used to express frequency ratios.
type Eth_MacVlanType [SWS_Eth_91001] 📄 PDF
This type is used to read out addresses from the address resolution logic (A RL) table of the switch. typedef struct { uint8 Mac Addr[6U]; uint16 Vlan Id; uint32 Switch Port; } Eth_ Mac Vlan Type; In case of Macaddr contains a Multicast Address Mac Vlan Type.Switch Port shall be handled as Bitmask, each bit represents a Switch Port , Bit 0 represents Eth Swicht Port Idx = 0 , Bit 1 represents Eth Swicht Port Idx = 1 and so on. In case of Macaddr contains not a Multicast Address Mac Vlan Type.Switch Port shall be handled as a value representing the Eth Switch Port Idx.
type Eth_CounterType [SWS_Eth_91007] 📄 PDF
Type Eth_CounterType.
type Eth_RxStatsType [SWS_Eth_91002] 📄 PDF
Type Eth_RxStatsType.
type Eth_TxStatsType [SWS_Eth_91003] 📄 PDF
Statistic counter for diag nostics.
type Eth_TxErrorCounterValuesType [SWS_Eth_91004] 📄 PDF
Type Eth_TxErrorCounterValuesType.
Usage and purpose
According to [SWS_Eth_91004], the data type Eth_TxErrorCounterValuesType is specified as a structure for statistical counters for diagnostic purposes in the Ethernet driver. The definition is available via the header file Eth_GeneralTypes.h. The structure bundles several 32-bit counters (uint32) that represent specific transmission states and transmission impediments at the interface level.
Structure Components and Semantics
According to [SWS_Eth_91004], the individual counters are based on standardized network MIB definitions:
Tx Dropped No Error Pkts: Number of outbound packets that were discarded despite an error-free state, for example to free buffer space (RFC1213ifOutDiscards).Tx Dropped Error Pkts: Number of packets that could not be transmitted due to errors encountered (RFC1213ifOutErrors).Tx Deferred Trans: Number of frames whose first transmission attempt was delayed because the transmission medium was busy (RFC1643dot3StatsDeferredTransmissions).Tx Single CollisionandTx Multiple Collision: Successfully transmitted frames whose transmission was delayed by exactly one or by multiple collisions, respectively (RFC1643).Tx Late Collision: Collisions detected later than 512 bit times after the start of packet transmission (RFC1643dot3StatsLateCollisions).Tx Excessive Collison: Number of transmissions that failed definitively as a result of excessive collisions (RFC1643dot3StatsExcessiveCollisions).
Call Context and Restrictions
Interpretation: Since the specification extract does not list an associated API function, this diagnostic type is presumably passed as an output parameter via pointer to corresponding driver functions for counter retrieval. Question Q-2bfbe59d1fb81938 (open) Specific requirements for error handling, DET reports, or concurrency are not defined in the sources for this pure data structure.
This text was generated by an AI based on the specification AUTOSAR CP R20-11.
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Eth- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Eth@rel:R20-11#50ead6f0- Content hash
50ead6f0- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_EthernetDriver.pdf#nameddest=SWS_Eth_00027
gemini-3.8-flash-low· 2026-10-13 · German original