DEENESPTFRRUARHIKOZHNL

Ethernet Driver (Eth)

ModulEth (Ethernet Driver)
BSW-Modul-ID88
Standard-Header#include "Eth.h"
SWS-SpezifikationAUTOSAR_SWS_EthernetDriver.pdf
ClusterEthernet Services

Module guideAI-GENERATED

Interfaces Ethernet controllers to the AUTOSAR stack: initialization, modes, transmission, reception, and diagnostics.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 7ed698a8fca3 Provenance Open questions (3)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Interfaces Ethernet controllers to the AUTOSAR stack: initialization, modes, transmission, reception, and diagnostics.

The Ethernet driver interfaces Ethernet controllers to the Ethernet Interface. It initializes the controllers, switches their Rx/Tx communication asynchronously between ETH_MODE_DOWN and ETH_MODE_ACTIVE, and reports the change via indication ([SWS_Eth_00276]). Transmission is two-staged: request buffer, then hand over. The driver acknowledges each transmission with E_OK or E_NOT_OK ([SWS_Eth_00243]). In addition, it provides reception with address filtering, MII accesses, timestamps, and diagnostic counters. During shutdown, locked transmit buffers must be released.

The Ethernet driver Eth abstracts one or more Ethernet controllers for the Ethernet Interface (EthIf). EthIf can bundle multiple drivers from different vendors (SWS Eth p. 17). Eth reports results via EthIf_RxIndication, EthIf_TxConfirmation, and EthIf_CtrlModeIndication ([SWS_Eth_00244], [SWS_Eth_00243], [SWS_Eth_00119]). Further neighbors are EthTrcv, EthSwt, DET, and DEM ([SWS_Eth_00241], [SWS_Eth_00120]).

kontext EcuM EcuM Eth Eth (Ethernet-Treiber) EcuM->Eth Eth_Init EthIf EthIf (Ethernet Interface) EthIf->Eth Eth_SetControllerMode, Eth_ProvideTxBuffer, Eth_Transmit, Eth_Receive, Eth_TxConfirmation, Eth_WriteMii / Eth_ReadMii Eth->EthIf EthIf_RxIndication, EthIf_TxConfirmation, EthIf_CtrlModeIndication EthTrcv EthTrcv (Transceiver-Treiber) Eth->EthTrcv EthTrcv_WriteMiiIndication, EthTrcv_ReadMiiIndication EthSwt EthSwt (Switch-Treiber) Eth->EthSwt EthSwt_EthRxProcessFrame, EthSwt_EthTxPrepareFrame u. a. Det Det Eth->Det Det_ReportError Dem Dem Eth->Dem Dem_SetEventStatus HW Ethernet-Controller (Hardware) Eth->HW register and buffer access

Context diagram: Callers and callback receivers of the Ethernet driver. Sources: [SWS_Eth_00119], [SWS_Eth_00120], SWS Eth p. 17

Eth_Init disables the Rx/Tx communication of all configured controllers, configures them, and discards pending requests ([SWS_Eth_00027], [SWS_Eth_00275]). The asynchronous Eth_SetControllerMode switches between ETH_MODE_DOWN and ETH_MODE_ACTIVE ([SWS_Eth_91009], [SWS_Eth_00276]). During shutdown, the driver releases locked transmit buffers ([SWS_Eth_00280]). The result follows via EthIf_CtrlModeIndication, in polling mode from Eth_MainFunction ([SWS_Eth_00240]).

For transmission, the upper layer requests a buffer with Eth_ProvideTxBuffer and hands it over with Eth_Transmit ([SWS_Eth_00077], [SWS_Eth_00087]). The confirmation is E_OK or E_NOT_OK ([SWS_Eth_00243], [SWS_Eth_00256]). Eth_Receive reads frames from a FIFO and reports whether further frames are available ([SWS_Eth_00095], [SWS_Eth_00162]). Eth discards frames with a non-matching destination address ([SWS_Eth_00245], [SWS_Eth_00246]).

transmission of a frame in polling modeObere Schicht (UL)EthIfEthEthIf_ProvideTxBuffer(...)Eth_ProvideTxBuffer(CtrlIdx, Priority,BufIdxPtr, BufPtr, LenBytePtr)BUFREQ_OK, BufIdx, BufPtr, granted lengthBUFREQ_OK, Puffercopy payload into bufferEthIf_Transmit(...)Eth_Transmit(CtrlIdx, BufIdx, FrameType,TxConfirmation = TRUE, LenByte, PhysAddrPtr)Ethernet-Header bilden,trigger transmissionE_OKE_OKUse Case: zyklisch in EthIf_MainFunctionTx()Eth_TxConfirmation(CtrlIdx)altSenden erfolgreichEthIf_TxConfirmation(..., E_OK)Senden fehlgeschlagenEthIf_TxConfirmation(..., E_NOT_OK)UL_TxConfirmation(CtrlIdx, BufIdx)

Sequence diagram: Buffer request, transmission, and confirmation in polling mode. Sources: [SWS_Eth_00077], [SWS_Eth_00087], [SWS_Eth_00243], SWS EthIf p. 87

Additional functions include MII accesses, which are asynchronous in R20-11 ([SWS_Eth_00058]), hardware timestamps ([SWS_Eth_00190]), statistics services ([SWS_Eth_00233]), and an optional Credit Based Shaper (DRAFT, [SWS_Eth_00263]). Eth reports errors as development errors to DET ([SWS_Eth_00016]). Production errors such as ETH_E_ACCESS or ETH_E_RX_FRAMES_LOST go to DEM ([SWS_Eth_00173], [SWS_Eth_00174]).

Role in the Ethernet stack and system boundary

The Ethernet driver Eth resides as a hardware-oriented module below the Ethernet Interface (EthIf). According to the diagram of the basic structure of the stack, EthIf bundles one or more Eth drivers from different vendors, each with its own controller types (SWS Eth p. 17). To the upper layers, Eth offers services such as Eth_Init, Eth_SetControllerMode, Eth_ProvideTxBuffer, Eth_Transmit, and Eth_Receive ([SWS_Eth_00027], [SWS_Eth_91009], [SWS_Eth_00077], [SWS_Eth_00087], [SWS_Eth_00095]). It reports results back via the callbacks EthIf_RxIndication, EthIf_TxConfirmation, and EthIf_CtrlModeIndication ([SWS_Eth_00244], [SWS_Eth_00243], [SWS_Eth_00119]).

Further neighbors are the following modules:

If multiple controllers share peripheral resources, Eth emulates independent controllers towards the upper layers. The upper layers then handle coordination ([SWS_Eth_00258]).

kontext EcuM EcuM Eth Eth (Ethernet-Treiber) EcuM->Eth Eth_Init EthIf EthIf (Ethernet Interface) EthIf->Eth Eth_SetControllerMode, Eth_ProvideTxBuffer, Eth_Transmit, Eth_Receive, Eth_TxConfirmation, Eth_WriteMii / Eth_ReadMii Eth->EthIf EthIf_RxIndication, EthIf_TxConfirmation, EthIf_CtrlModeIndication EthTrcv EthTrcv (Transceiver-Treiber) Eth->EthTrcv EthTrcv_WriteMiiIndication, EthTrcv_ReadMiiIndication EthSwt EthSwt (Switch-Treiber) Eth->EthSwt EthSwt_EthRxProcessFrame, EthSwt_EthTxPrepareFrame u. a. Det Det Eth->Det Det_ReportError Dem Dem Eth->Dem Dem_SetEventStatus HW Ethernet-Controller (Hardware) Eth->HW register and buffer access

Context diagram: Eth is called by EthIf and EcuM and reports to EthIf, EthTrcv, EthSwt, DET, and DEM. Sources: [SWS_Eth_00119], [SWS_Eth_00120], [SWS_Eth_00241], SWS Eth p. 17

From Eth_Init to ETH_MODE_ACTIVE: startup and controller modes

Eth_Init receives a pointer to the post-build structure Eth_ConfigType ([SWS_Eth_00027], [SWS_Eth_00156]). For each controller of the current EthConfigSet, the function executes the following steps ([SWS_Eth_00275], DRAFT; older version [SWS_Eth_00034] obsolete):

  • disable Rx/Tx communication,
  • clear pending interrupts,
  • configure controller parameters and transmit/receive resources,
  • discard pending requests.

Eth_StateType distinguishes between ETH_STATE_UNINIT and ETH_STATE_INIT and serves development error detection ([SWS_Eth_00159]). Newer versions summarize the calling rule: Except for Eth_GetVersionInfo and planned functions such as Eth_MainFunction, services are permitted only after initialization (SWS Eth p. 27). R20-11 regulates this per service via checking for ETH_E_UNINIT, e.g. in [SWS_Eth_00066].

startup of the Ethernet driver with first MII accessEcuMEthIfEthEthTrcvInterpretation: order of EcuM calls;Eth_Init must occur prior to MII accessesEth_Init(CfgPtr)Rx/Tx aller Controller deaktivieren,clear interrupts, configure parametersand buffers, discard jobsEthTrcv_Init(...)EthIf_WriteMii(...)Eth_WriteMii(CtrlIdx, TrcvIdx, RegIdx, RegVal)E_OK (Dienst angenommen)E_OKMII access runs asynchronously in R20-11EthTrcv_WriteMiiIndication(...)EthIf_Init(...)

Sequence diagram: Startup with Eth_Init and an initial, asynchronously acknowledged MII access of the transceiver driver. Sources: [SWS_Eth_00275], [SWS_Eth_00058], [SWS_Eth_00241], SWS EthIf p. 84

In R20-11, Eth_SetControllerMode applies in the asynchronous, non-reentrant version [SWS_Eth_91009]; it replaces [SWS_Eth_00041]. The two modes take effect as follows ([SWS_Eth_00276]):

  • ETH_MODE_DOWN: The driver disables Rx/Tx and resets all buffers. Locked and pending transmit buffers are released ([SWS_Eth_00280], [SWS_Eth_00281]).
  • ETH_MODE_ACTIVE: The driver activates all buffers and Rx/Tx communication.

Eth reports the result of a mode switch asynchronously via EthIf_CtrlModeIndication ([SWS_Eth_00119]). In polling mode, Eth_MainFunction detects the switch and calls this callback ([SWS_Eth_00171], [SWS_Eth_00240]). Eth_GetControllerMode returns the current state ([SWS_Eth_91010], [SWS_Eth_00277]).

Eth_ModeType additionally knows ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST. With ETH_MODE_DOWN, the hardware can trigger a sleep sequence, for example with OA-TC10 hardware ([SWS_Eth_91008]). However, the parameter description of Eth_SetControllerMode only lists ETH_MODE_DOWN and ETH_MODE_ACTIVE ([SWS_Eth_91009]).

zustand cluster_init ETH_STATE_INIT (je Controller) start Start UNINIT ETH_STATE_UNINIT start->UNINIT DOWN Rx/Tx deaktiviert (Interpretation: entspricht ETH_MODE_DOWN) UNINIT->DOWN Eth_Init: disable Rx/Tx, configure, discard jobs ACTIVE ETH_MODE_ACTIVE Rx/Tx aktiv DOWN->ACTIVE Eth_SetControllerMode(ETH_MODE_ACTIVE): Puffer aktivieren, Rx/Tx aktivieren; danach EthIf_CtrlModeIndication ACTIVE->DOWN Eth_SetControllerMode(ETH_MODE_DOWN): disable Rx/Tx, reset buffers, release locked and pending transmit buffers

State diagram: Driver state UNINIT/INIT and, per controller, the modes DOWN and ACTIVE with the obligations during transition. Sources: [SWS_Eth_00159], [SWS_Eth_00275], [SWS_Eth_00276], [SWS_Eth_00280]

activation of an Ethernet controllerEthSMEthIfEthEthIf_SetControllerMode(CtrlIdx, ETH_MODE_ACTIVE)Eth_SetControllerMode(CtrlIdx, ETH_MODE_ACTIVE)E_OKactivate transmit and receive buffers,Rx/Tx-Kommunikation aktivierenoptPolling-BetriebEth_MainFunction(): Moduswechsel erkanntEthIf_CtrlModeIndication(CtrlIdx, ETH_MODE_ACTIVE)EthSM_CtrlModeIndication(CtrlIdx, ETH_MODE_ACTIVE)

Sequence diagram: Activation by EthSM with synchronous acceptance and asynchronous mode indication. Sources: [SWS_Eth_91009], [SWS_Eth_00119], [SWS_Eth_00240], SWS EthIf p. 85

Transmit path: request buffer, transmit, confirm

Transmission proceeds in two stages. First, Eth_ProvideTxBuffer selects a transmit FIFO based on Priority. The service returns an index of type Eth_BufIdxType, a buffer pointer, and via LenBytePtr the granted length ([SWS_Eth_00077], [SWS_Eth_00175]). Possible return values are BUFREQ_OK, BUFREQ_E_NOT_OK, BUFREQ_E_BUSY, and BUFREQ_E_OVFL. The buffer remains locked until Eth_Transmit follows with this index (SWS Eth p. 91).

Then, Eth_Transmit initiates transmission with FrameType, destination MAC address, and the flag TxConfirmation ([SWS_Eth_00087], [SWS_Eth_00160]). In doing so, the driver constructs the Ethernet header (SWS Eth p. 93). Eth_Transmit is reentrant for different buffer and controller indices ([SWS_Eth_00087]).

If confirmation is requested, Eth calls EthIf_TxConfirmation with E_OK. In interrupt mode, this occurs from the interrupt routine; in polling mode, from Eth_TxConfirmation ([SWS_Eth_00243], [SWS_Eth_00100]). If transmission fails, the result is E_NOT_OK ([SWS_Eth_00256]). Upper layers can rely on each Eth_Transmit being followed by a confirmation (SWS Eth p. 32).

In the polling diagram, EthIf_MainFunctionTx calls the function Eth_TxConfirmation (SWS EthIf p. 87). In interrupt mode, Eth_TxIrqHdlr_<CtrlIdx> handles this (SWS EthIf p. 88). When the driver releases the buffer is left to the implementation (SWS Eth p. 93).

transmission of a frame in polling modeObere Schicht (UL)EthIfEthEthIf_ProvideTxBuffer(...)Eth_ProvideTxBuffer(CtrlIdx, Priority,BufIdxPtr, BufPtr, LenBytePtr)BUFREQ_OK, BufIdx, BufPtr, granted lengthBUFREQ_OK, Puffercopy payload into bufferEthIf_Transmit(...)Eth_Transmit(CtrlIdx, BufIdx, FrameType,TxConfirmation = TRUE, LenByte, PhysAddrPtr)Ethernet-Header bilden,trigger transmissionE_OKE_OKUse Case: zyklisch in EthIf_MainFunctionTx()Eth_TxConfirmation(CtrlIdx)altSenden erfolgreichEthIf_TxConfirmation(..., E_OK)Senden fehlgeschlagenEthIf_TxConfirmation(..., E_NOT_OK)UL_TxConfirmation(CtrlIdx, BufIdx)

Sequence diagram: Request buffer, fill, transmit, and confirm in polling mode, with success and failure branches. Sources: [SWS_Eth_00077], [SWS_Eth_00087], [SWS_Eth_00243], [SWS_Eth_00256], SWS EthIf p. 87

Reception path and address filter

Eth_Receive reads a frame from the FIFO addressed via FifoIdx. The service is reentrant for different FIFOs, but not for the same one ([SWS_Eth_00095]). RxStatusPtr returns ETH_RECEIVED, ETH_NOT_RECEIVED, or ETH_RECEIVED_MORE_DATA_AVAILABLE ([SWS_Eth_00162]). Interpretation: A polling caller is likely to repeat Eth_Receive as long as additional frames are reported. Question Q-8f1484413f850bda (open) Who calls in polling mode is not specified; presumably it is EthIf.

Eth reports reception via EthIf_RxIndication, either from the interrupt or from Eth_Receive ([SWS_Eth_00244]). Broadcast frames are indicated as such ([SWS_Eth_00153]). Newer versions name the parameter QueueIdx (SWS Eth p. 110).

The own source address is set by Eth_SetPhysAddr; Eth_GetPhysAddr reads it ([SWS_Eth_00151], [SWS_Eth_00052]). Eth_UpdatePhysAddrFilter adds multicast destination addresses to the receive filter with ETH_ADD_TO_FILTER and removes them with ETH_REMOVE_FROM_FILTER ([SWS_Eth_00152], [SWS_Eth_00163], [SWS_Eth_00150]).

If the destination address matches, Eth notifies the upper layer; otherwise, it discards the frame ([SWS_Eth_00245], [SWS_Eth_00246]). If the hardware cannot filter, initialization enables promiscuous mode ([SWS_Eth_00146]). The address 00:00:00:00:00:00 reduces the filter to the own unicast address and ends promiscuous mode ([SWS_Eth_00147]; cf. SWS Eth p. 74).

reception in polling and interrupt modeEthIfEthUse Case: Polling-BetriebInterpretation: EthIf calls Eth_Receive cyclicallyloopInterpretation: solange RxStatus == ETH_RECEIVED_MORE_DATA_AVAILABLEEth_Receive(CtrlIdx, FifoIdx, RxStatusPtr)read frame from FIFO,check destination address against filteraltRahmen empfangen, Adresse passtEthIf_RxIndication(...)address does not matchRahmen verwerfenRxStatusUse Case: Interrupt-BetriebEmpfangs-InterruptEthIf_RxIndication(...)

Sequence diagram: Reception in polling and interrupt mode with address check prior to indication. Sources: [SWS_Eth_00095], [SWS_Eth_00162], [SWS_Eth_00244], [SWS_Eth_00246]

filter a Eth_UpdatePhysAddrFilter(CtrlIdx, PhysAddrPtr, Action) z PhysAddrPtr = 00:00:00:00:00:00? a->z reset reduce filter to own unicast address, terminate promiscuous mode z->reset yes act Action? z->act no rx frame arrives reset->rx add ETH_ADD_TO_FILTER: allow reception for address act->add add rem ETH_REMOVE_FROM_FILTER: Empfang blockieren act->rem entfernen hw controller can filter? add->hw rem->hw hwf Hardware-Filter nutzen hw->hwf yes swf Filterung in Software (Promiscuous Mode seit Initialisierung) hw->swf no hwf->rx swf->rx m destination address matches filter? rx->m ind EthIf_RxIndication m->ind yes drop Rahmen verwerfen m->drop no

Activity diagram: Filter update with zero-address special case, hardware or software filtering, and acceptance or discarding upon reception. Sources: [SWS_Eth_00146], [SWS_Eth_00147], [SWS_Eth_00163], [SWS_Eth_00245], [SWS_Eth_00246]

Transceiver access, hardware timestamps, and diagnostic counters

Eth_WriteMii and Eth_ReadMii are asynchronous and non-reentrant in R20-11 ([SWS_Eth_00058], [SWS_Eth_00064]). Eth reports completion via EthTrcv_WriteMiiIndication or EthTrcv_ReadMiiIndication, respectively ([SWS_Eth_00241], [SWS_Eth_00242]). Clause 45 registers are accessed via registers 13 and 14 according to Annex 22D ([SWS_Eth_00273], [SWS_Eth_00274]). Access is enabled via EthCtrlEnableMii ([SWS_Eth_00069]). In contrast, R24-11 describes Eth_WriteMii as synchronous (SWS Eth p. 95); for R20-11, the asynchronous definition applies.

The timestamp functions are enabled via EthGlobalTimeSupport ([SWS_Eth_00210], [SWS_Eth_00211]). In detail, the following applies:

The upper layer discards timestamps of quality ETH_UNCERTAIN or ETH_INVALID ([SWS_Eth_00177]). Starting with R23-11, Eth_GetCurrentTime is obsolete (SWS Eth p. 82); in R20-11, the service is normative.

egress timestamp via Ethernet driverEthTSynEthIfEth[EthTSynHardwareTimestampSupport == TRUE]EthIf_EnableEgressTimeStamp(CtrlIdx, BufIdx)Eth_EnableEgressTimeStamp(CtrlIdx, BufIdx)EthIf_Transmit(...)Eth_Transmit(...)EthIf_TxConfirmation(CtrlIdx, BufIdx, Result)EthTSyn_TxConfirmation(CtrlIdx, BufIdx, Result)retrieval in the context of TxConfirmationEthIf_GetEgressTimeStamp(CtrlIdx, BufIdx, ...)Eth_GetEgressTimeStamp(CtrlIdx, BufIdx,timeQualPtr, timeStampPtr)E_OK, quality, timestampE_OK, quality, timestampaltquality == ETH_VALIDZeitstempel verwendenETH_UNCERTAIN or ETH_INVALIDZeitstempel verwerfen

Sequence diagram: Activate transmit timestamp, transmit, and read out in the confirmation context with quality check. Sources: [SWS_Eth_00186], [SWS_Eth_00190], [SWS_Eth_00177], SWS EthTSyn p. 70, SWS EthTSyn p. 55

Four diagnostic services can each be enabled individually:

For the statistical services, the maximum value indicates an unavailable counter (SWS Eth p. 98).

Configuration, Partitioning, and SW Buffer Management (CBS)

With EthCtrlEnableOffloadChecksumIPv4, EthCtrlEnableOffloadChecksumICMP, EthCtrlEnableOffloadChecksumTCP, and EthCtrlEnableOffloadChecksumUDP, the controller calculates checksums in hardware. Upon reception, it drops frames with an incorrect checksum ([SWS_Eth_00216], [SWS_Eth_00217]). The base addresses of the buffers must satisfy the alignment of all AUTOSAR data types ([SWS_Eth_00218]). Unsupported partition assignments must be rejected. The partitions in EthCtrlEcucPartitionRef must be a subset of EthEcucPartitionRef ([SWS_Eth_00257], [SWS_Eth_00260], [SWS_Eth_CONSTR_00001]).

If fair scheduling in hardware is missing, a Credit Based Shaper in software is available (SWS Eth p. 38). In R20-11, all associated requirements are DRAFT. The method operates as follows:

cbs mf Eth_MainFunction() (EthCtrlConfigSwBufferHandling = TRUE) c1 SW FIFOs descending by priority: increase credits by EthCtrlConfigShaperIdleSlope (only non-empty FIFOs) mf->c1 c2 next SW FIFO (highest priority first) c1->c2 q message present and credits >= EthCtrlConfigShaperMinCredit? c2->q mv move first message to HW FIFO, subtract message size from credits q->mv yes more Weitere SW-FIFO? q->more no b EthTrcvPhysLayerPLCAMaxBurstCount = 0? mv->b stop Iteration beenden b->stop yes burst move further messages up to the burst limit, subtract credits per message b->burst no ende Ende stop->ende burst->more Interpretation: continue with next FIFO more->c2 yes more->ende no

Activity diagram: CBS run in Eth_MainFunction with credit update, minimum credit check, and PLCA burst branch. Sources: [SWS_Eth_00266], [SWS_Eth_00270], [SWS_Eth_00271], [SWS_Eth_00272], SWS Eth p. 56

Behavior in the event of an error

Eth reports development errors to DET ([SWS_Eth_00120]). The codes are ETH_E_INV_CTRL_IDX, ETH_E_UNINIT, ETH_E_PARAM_POINTER, ETH_E_INV_PARAM, and ETH_E_INV_MODE ([SWS_Eth_00016]). Typical checks concern initialization, CtrlIdx, and pointers ([SWS_Eth_00066], [SWS_Eth_00067], [SWS_Eth_00068]). If DET is disabled, the statistical services return E_NOT_OK in these cases ([SWS_Eth_00228], [SWS_Eth_00236], [SWS_Eth_00248], [SWS_Eth_00254]).

Production errors are sent to DEM via Dem_SetEventStatus ([SWS_Eth_00119]). A failed controller access results in ETH_E_ACCESS with DEM_EVENT_STATUS_PREFAILED; Eth_SetControllerMode then returns E_NOT_OK ([SWS_Eth_00039], [SWS_Eth_00173], [SWS_Eth_00168]). Eth_MainFunction reports the following extended production errors ([SWS_Eth_00169], [SWS_Eth_00172]):

During operation, errors also manifest via return values. These include BUFREQ_E_BUSY and BUFREQ_E_OVFL (SWS Eth p. 91) as well as a negative transmit confirmation ([SWS_Eth_00256]). The behavior of Eth_Receive when the controller is inactive depends on the release. R23-11 and R24-11 require ETH_E_INV_MODE (SWS Eth p. 94, SWS Eth p. 116), R25-11 an immediate return (SWS Eth p. 110). For R20-11, the DET variant likely applies because of [SWS_Eth_00016]. Question (open)

Further detailed evidence

AI-generated guide based on specification excerpts in the payload. The linked requirements of R20-11 are authoritative; citations from other releases are marked as such.

Ethernet Driver (Eth)

Provides uniform hardware access to Ethernet controller interfaces.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function Eth_Init [SWS_Eth_00027] 📄 PDF

void Eth_Init (const Eth_ConfigType* CfgPtr);

Initializes the Ethernet Driver

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6639db5c607b Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 58bddef3c196 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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:

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 45ebc5b270a4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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, either ETH_MODE_ACTIVE to enable Rx/Tx communication or ETH_MODE_DOWN to 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:

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_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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3be26284fad7 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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 type Eth_FilterActionType whether 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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 59aa765351e8 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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]:

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6906f4ae5194 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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_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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 28883e2189c8 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 44e533ef4911 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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]:

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 964b3772cde6 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: aeb0a2bc1424 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 72b1ce9d790c Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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_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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 395137d99dcb Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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_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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 12ea280a995a Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: bd78c0f35c62 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c3ab864e1cec Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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 (value 0x00): Indicates that the Ethernet driver is not yet configured ([SWS_Eth_00159]).
  • ETH_STATE_INIT (value 0x01): 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_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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 91a81f4cdad3 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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_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_TxErrorCounterValuesType [SWS_Eth_91004] 📄 PDF

Type Eth_TxErrorCounterValuesType.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: cf651d8e65c0 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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 (RFC1213 ifOutDiscards).
  • Tx Dropped Error Pkts: Number of packets that could not be transmitted due to errors encountered (RFC1213 ifOutErrors).
  • Tx Deferred Trans: Number of frames whose first transmission attempt was delayed because the transmission medium was busy (RFC1643 dot3StatsDeferredTransmissions).
  • Tx Single Collision and Tx 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 (RFC1643 dot3StatsLateCollisions).
  • Tx Excessive Collison: Number of transmissions that failed definitively as a result of excessive collisions (RFC1643 dot3StatsExcessiveCollisions).

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

Initialization and status

Returns the version information of this module

void Eth_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);
Eth_Init function

Initializes the Ethernet Driver

void Eth_Init (const Eth_ConfigType* CfgPtr);

Services · Get…

Obtains the state of the indexed controller Tags: atp.Status=obsolete

Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);

Obtains the communication state of the indexed controller Tags: atp.Status=draft

Std_ReturnType Eth_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);

Reads a list with drop counter values of the corresponding controller. The meaning of these values is described at Eth_ Counter Type.

Std_ReturnType Eth_GetCounterValues (uint8 CtrlIdx, Eth_CounterType* CounterPtr);

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.

Std_ReturnType Eth_GetCurrentTime (uint8 CtrlIdx, 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.

Std_ReturnType Eth_GetEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx, 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.

Std_ReturnType Eth_GetIngressTimeStamp (uint8 CtrlIdx, const Eth_DataType* DataPtr, Eth_TimeStampQualType* timeQualPtr, Eth_TimeStampType* timeStampPtr);

Obtains the physical source address used by the indexed controller

void Eth_GetPhysAddr (uint8 CtrlIdx, uint8* PhysAddrPtr);

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

Std_ReturnType Eth_GetRxStats (uint8 CtrlIdx, Eth_RxStatsType* RxStats);

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.

Std_ReturnType Eth_GetTxErrorCounterValues (uint8 CtrlIdx, Eth_TxErrorCounterValuesType* TxErrorCounterValues);

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.

Std_ReturnType Eth_GetTxStats (uint8 CtrlIdx, Eth_TxStatsType* TxStats);

Services · Set…

Enables / disables the indexed controller Tags: atp.Status=obsolete

Std_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);

Enables / Disables Rx/ Tx communication of the indexed controller Tags: atp.Status=draft

Std_ReturnType Eth_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);

Sets the physical source address used by the indexed controller

void Eth_SetPhysAddr (uint8 CtrlIdx, const uint8* PhysAddrPtr);

Services · More

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.

void Eth_EnableEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx);

Provides access to a transmit buffer of the FIFO related to the specified priority

BufReq_ReturnType Eth_ProvideTxBuffer (uint8 CtrlIdx, uint8 Priority, Eth_BufIdxType* BufIdxPtr, uint8* * BufPtr, uint16* LenBytePtr);
Eth_ReadMii function

Reads a transceiver register

Std_ReturnType Eth_ReadMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16* RegValPtr);
Eth_Receive function

Receive a frame from the related fifo.

void Eth_Receive (uint8 CtrlIdx, uint8 FifoIdx, Eth_RxStatusType* RxStatusPtr);
Eth_Transmit function

Triggers transmission of a previously filled transmit buffer

Std_ReturnType Eth_Transmit (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_FrameType FrameType, boolean TxConfirmation, uint16 LenByte, const uint8* PhysAddrPtr);

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.

Std_ReturnType Eth_UpdatePhysAddrFilter (uint8 CtrlIdx, const uint8* PhysAddrPtr, Eth_FilterActionType Action);
Eth_WriteMii function

Configures a transceiver register or triggers a function offered by the receiver

Std_ReturnType Eth_WriteMii (uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16 RegVal);

Callbacks

Triggers frame transmission confirmation

void Eth_TxConfirmation (uint8 CtrlIdx);

Cyclic

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.

void Eth_MainFunction (void);

Types

Ethernet buffer identifier type.

Implementation specific structure of the post build configuration

Type Eth_CounterType.

This type defines the Ethernet data type used for data transmission. Its definition depends on the used CPU.

The Enumeration Type Eth_ Filter Action Type describes the action to be taklen for the MAC address given in *Phys Addr Ptr.

This type defines the Ethernet frame type used in the Ethernet frame header

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.

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

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

Variables of this type are used to express frequency ratios.

Type Eth_RxStatsType.

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.

Status supervision used for Development Error Detection. The state shall be available for debugging.

Variables of this type are used to express time differences.

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.

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_TxErrorCounterValuesType.

Statistic counter for diag nostics.