DEENESPTFRRUARHIKOZHNL

Ethernet Interface (EthIf)

ModulEthIf (Ethernet Interface)
BSW-Modul-ID65
Standard-Header#include "EthIf.h"
SWS-SpezifikationAUTOSAR_SWS_EthernetInterface.pdf
ClusterEthernet Services

模块指南人工智能生成

在 Ethernet 驱动程序、交换机与通信栈之间转发帧、模式切换以及链路状态。
AI 生成 未审核 模型: claude-opus-5-5 · 推理强度: high · 温度: 不可控 · 提示词: c246974844fe 来源 未决问题(2)
因果锚点:R20-11 自 R20-11 起有效 为此规范版本重新合成。
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

在 Ethernet 驱动程序、交换机与通信栈之间转发帧、模式切换以及链路状态。

Ethernet Interface 在一侧的 EthSM 与 Upper Layer,与另一侧的控制器、收发器和交换机驱动程序之间进行转发。它通过异步的 EthIf_SetControllerMode 切换控制器连同引用的硬件 [SWS_EthIf_00034]。它分两步发送帧,分发接收指示,并将链路状态报告给 EthSM 或 BswM。它延迟关闭端口组,并将唤醒检查转发至收发器和交换机。最重要的边界条件:在错误检测激活时,几乎每个服务都以预先执行 EthIf_Init 为前提,否则将报告 ETHIF_E_UNINIT [SWS_EthIf_00155]。

Ethernet Interface 将 Ethernet 栈的用户与控制器、收发器和交换机的驱动程序连接起来。它通过一个或多个 Ethernet Switch Driver 访问交换机 [SWS_EthIf_00228]。向上,EthSM 控制控制器模式并接收模式与链路报告 [SWS_EthIf_00252]。BswM 接收独立端口组的链路状态 [SWS_EthIf_00261]。

kontext ul Upper Layer (z. B. EthTSyn, V2xGn) ethif EthIf ul->ethif EthIf_ProvideTxBuffer, EthIf_Transmit ethsm EthSM ethsm->ethif EthIf_SetControllerMode bswm BswM integ Integration Code (EcuM-Kontext) integ->ethif EthIf_CheckWakeup ethif->ul <User>_RxIndication, <UL>_TxConfirmation, <User>_TrcvLinkStateChg ethif->ethsm EthSM_CtrlModeIndication, EthSM_TrcvLinkStateChg ethif->bswm BswM_EthIf_PortGroupLinkStateChg eth Eth (Controller-Treiber) ethif->eth Modus, Puffer, Senden trcv EthTrcv ethif->trcv Modus, Link, Wake-up swt EthSwt ethif->swt EthIfSwitchIdx -> EthSwtIdx weth WEth / WEthTrcv ethif->weth 仅适用于 EthIfEnableWEthApi det Det ethif->det Entwicklungsfehler idsm IdsM ethif->idsm Security-Events eth->ethif EthIf_RxIndication, EthIf_TxConfirmation, EthIf_CtrlModeIndication trcv->ethif EthIf_TrcvModeIndication

上下文图:EthIf 一方面充当 Upper Layer、EthSM、BswM 和 Integration Code 之间的中介,另一方面充当 Ethernet 驱动程序之间的中介。来源:[SWS_EthIf_00228]、[SWS_EthIf_00224]、[SWS_EthIf_00252]、[SWS_EthIf_00261]、EthSwt-SWS 第5页

通信启动由异步的 EthIf_SetControllerMode 触发 [SWS_EthIf_00034]。EthIf 在此过程中一并切换引用的收发器和端口组 [SWS_EthIf_00266]、[SWS_EthIf_00264]。它通过 EthSM_CtrlModeIndication 报告达到的控制器模式 [SWS_EthIf_00252]。

发送分两步使用 EthIf_ProvideTxBuffer 和 EthIf_Transmit 进行 [SWS_EthIf_00067]、[SWS_EthIf_00075]。确认通过 <UL>_TxConfirmation 到达 Upper Layer;在轮询模式下由 EthIf_MainFunctionTx 触发确认 [SWS_EthIf_00255]、[SWS_EthIf_00113]。EthIf 通过 <User>_RxIndication 分发接收到的帧 [SWS_EthIf_00104]。它会丢弃并计数具有无效 VLAN 的帧 [SWS_EthIf_00317]、[SWS_EthIf_00309]。

带确认发送帧Upper LayerEthIfEthEthIf_ProvideTxBuffer(CtrlIdx, FrameType, Priority, ...)Eth_ProvideTxBuffer(...)BUFREQ_OK, BufIdx, BufPtrBUFREQ_OK, BufIdx, BufPtr用有效负载数据填充缓冲区EthIf_Transmit(CtrlIdx, BufIdx, FrameType,TxConfirmation, LenByte, PhysAddrPtr)包含 EthIfVlanID:FrameType 0x8100Eth_Transmit(...)E_OKE_OKaltPolling-ModusEthIf_MainFunctionTx()Eth_TxConfirmation(CtrlIdx)EthIf_TxConfirmation(CtrlIdx, BufIdx, Result)Interrupt-ModusEth_TxIrqHdlr_<CtrlIdx>EthIf_TxConfirmation(CtrlIdx, BufIdx, Result)<UL>_TxConfirmation(CtrlIdx, BufIdx, Result)

时序图:轮询或中断模式下的缓冲区请求、发送与确认。来源:[SWS_EthIf_00067]、[SWS_EthIf_00075]、[SWS_EthIf_00091]、[SWS_EthIf_00113]、EthIf-SWS 第87页

EthIf 在 EthIf_MainFunctionState 中周期性确定链路状态 [SWS_EthIf_00407]。对于端口组,它对链路状态进行累加 [SWS_EthIf_00259],对于活动链路,它轮询信号质量 [SWS_EthIf_00409]。EthIf 通过定时器 EthIfSwitchOffPortTimedelay 延迟关闭端口组的交换机端口 [SWS_EthIf_00270]。EthIf_CheckWakeup 将唤醒检查转发至收发器和交换机 [SWS_EthIf_00245]、[SWS_EthIf_00500]。

在 DET 激活时,各服务会报告无效索引以及未初始化(ETHIF_E_UNINIT)等错误 [SWS_EthIf_00017]、[SWS_EthIf_00155]。如果 DET 被关闭,许多服务将改为返回 E_NOT_OK [SWS_EthIf_00325]。诸如时间戳或 Wireless Ethernet 等可选服务可以通过配置参数关闭 [SWS_EthIf_00164]、[SWS_EthIf_00342]。

EthIf在以太网驱动程序与通信栈之间的角色

以太网接口(Ethernet Interface)是以太网栈用户与控制器(Eth)、收发器(EthTrcv)及交换机(EthSwt)驱动程序之间的独立于硬件的中介层。对于交换机,EthIf使用一个或多个以太网交换机驱动程序,这些驱动程序封装了相应硬件的特性[SWS_EthIf_00228]。通过EthIfSwitchIdx进行的访问由EthIf使用其EthSwtIdx分发至主管的EthSwt模块[SWS_EthIf_00224]。随EthIfEnableWEthApi增加了无线控制器与收发器驱动程序[SWS_EthIf_00340]。分层结构见图示EthSwt-SWS 第5页和Eth-SWS 第18页。

向上,EthIf与多个伙伴协同工作:

导入的类型(包括Eth_BufIdxType和EcuM_WakeupSourceType)由[SWS_EthIf_00023]确定。文件结构见EthIf-SWS 第15页。

kontext ul Upper Layer (z. B. EthTSyn, V2xGn) ethif EthIf ul->ethif EthIf_ProvideTxBuffer, EthIf_Transmit ethsm EthSM ethsm->ethif EthIf_SetControllerMode bswm BswM integ Integration Code (EcuM-Kontext) integ->ethif EthIf_CheckWakeup ethif->ul <User>_RxIndication, <UL>_TxConfirmation, <User>_TrcvLinkStateChg ethif->ethsm EthSM_CtrlModeIndication, EthSM_TrcvLinkStateChg ethif->bswm BswM_EthIf_PortGroupLinkStateChg eth Eth (Controller-Treiber) ethif->eth Modus, Puffer, Senden trcv EthTrcv ethif->trcv Modus, Link, Wake-up swt EthSwt ethif->swt EthIfSwitchIdx -> EthSwtIdx weth WEth / WEthTrcv ethif->weth 仅适用于 EthIfEnableWEthApi det Det ethif->det Entwicklungsfehler idsm IdsM ethif->idsm Security-Events eth->ethif EthIf_RxIndication, EthIf_TxConfirmation, EthIf_CtrlModeIndication trcv->ethif EthIf_TrcvModeIndication

上下文图:EthIf 将 Upper Layer、EthSM、BswM 以及 Integration Code 与 Controller、Transceiver、Switch 和 Wireless Ethernet 的驱动程序连接起来。来源:[SWS_EthIf_00228]、[SWS_EthIf_00224]、[SWS_EthIf_00252]、[SWS_EthIf_00261]、[SWS_EthIf_00244]、[SWS_EthIf_00340]、[SWS_EthIf_00502]、EthSwt-SWS 第5页

从EthIf_Init到活动的EthIfController

EthIf_Init [SWS_EthIf_00024]接收类型为EthIf_ConfigType的特定于实现的构建后(Post-Build)结构[SWS_EthIf_00149]。在启用错误检测的情况下,几乎所有服务都会检查是否已执行初始化。否则它们会报告ETHIF_E_UNINIT,例如依据[SWS_EthIf_00155]或[SWS_EthIf_00273]。

通信启动由EthIf_SetControllerMode触发;该服务以异步方式工作[SWS_EthIf_00034]。在此过程中,EthIf会一同切换所引用的硬件:

  • 若引用的EthIfTransceiver处于ETH_MODE_DOWN,则按固定顺序执行EthTrcv_SetTransceiverMode及后续调用[SWS_EthIf_00266]。
  • 对于类型为“control”的端口组,将切换其端口[SWS_EthIf_00264]。
  • 在直接关联交换机的情况下,将切换交换机的所有端口(DRAFT)[SWS_EthIf_00478]。

控制器与其他硬件相互独立地受控EthIf-SWS 第30页。反馈以异步方式到来:驱动程序调用EthIf_CtrlModeIndication [SWS_EthIf_00231],且EthIf继续上报给EthSM_CtrlModeIndication [SWS_EthIf_00252]。收发器通过EthIf_TrcvModeIndication [SWS_EthIf_00232]进行报告。

使用ETH_MODE_DOWN关断时,EthIf仅关闭活动的收发器或交换机端口[SWS_EthIf_00484]、[SWS_EthIf_00485]、[SWS_EthIf_00265]。相反,EthIf在每次调用时都会转发ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST,而与当前模式无关[SWS_EthIf_00479]、[SWS_EthIf_00480]、[SWS_EthIf_00481]。关于交换机关断的较旧规则在R20-11中已作废(OBSOLETE)[SWS_EthIf_00256]、[SWS_EthIf_00257]。

EthIfController 模式切换为 ETH_MODE_ACTIVEEthSMEthIfEthEthTrcvEthIf_SetControllerMode(CtrlIdx, ETH_MODE_ACTIVE)Eth_SetControllerMode(CtrlIdx, ETH_MODE_ACTIVE)optEthIfTransceiver 被引用且当前为 ETH_MODE_DOWNEthTrcv_SetTransceiverMode(TrcvIdx, ETH_MODE_ACTIVE)EthTrcv_TransceiverLinkStateRequest(TrcvIdx, ETHTRCV_LINK_STATE_ACTIVE)E_OK反馈异步进行EthIf_CtrlModeIndication(CtrlIdx, ETH_MODE_ACTIVE)EthSM_CtrlModeIndication(CtrlIdx, ETH_MODE_ACTIVE)EthIf_TrcvModeIndication(TrcvIdx, ETH_MODE_ACTIVE)

时序图:依据ETH_MODE_ACTIVE进行模式切换,并带有来自控制器和收发器的异步反馈。来源:[SWS_EthIf_00034]、[SWS_EthIf_00266]、[SWS_EthIf_00231]、[SWS_EthIf_00252]、[SWS_EthIf_00232]、EthIf-SWS 第85页

发送和接收帧:缓冲区、VLAN与确认

发送分两步进行:

  1. EthIf_ProvideTxBuffer [SWS_EthIf_00067]提供缓冲区索引和缓冲区指针。若未配置EthIfVlanID,则FrameType和Priority保持未使用状态[SWS_EthIf_00146]。
  2. EthIf_Transmit [SWS_EthIf_00075]触发已填充缓冲区的发送。对于VLAN控制器,EthIf向Eth_Transmit传递值0x8100而非FrameType [SWS_EthIf_00250]。

来自R23-11的文档出处补充了一个条件:仅当最近接受的模式为ETH_MODE_ACTIVE或ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST时才进行转发EthIf-SWS 第101页。通过ETH_MODE_TX_OFFLINE的静默通信(Silent Communication)直到该版本才被描述EthIf-SWS 第34页。它不属于有效载荷中的R20-11需求。

EthIf_TxConfirmation [SWS_EthIf_00091]通过<UL>_TxConfirmation将结果透传至Upper Layer [SWS_EthIf_00255]、[SWS_EthIf_00106]。在轮询模式下,EthIf_MainFunctionTx生成确认并额外检查收发器的状态切换[SWS_EthIf_00113]。在中断模式下,驱动程序的ISR直接回调EthIf-SWS 第88页。自R24-11起EthIf_Transmit基于PDU的签名EthIf-SWS 第97页不适用于R20-11。

带确认发送帧Upper LayerEthIfEthEthIf_ProvideTxBuffer(CtrlIdx, FrameType, Priority, ...)Eth_ProvideTxBuffer(...)BUFREQ_OK, BufIdx, BufPtrBUFREQ_OK, BufIdx, BufPtr用有效负载数据填充缓冲区EthIf_Transmit(CtrlIdx, BufIdx, FrameType,TxConfirmation, LenByte, PhysAddrPtr)包含 EthIfVlanID:FrameType 0x8100Eth_Transmit(...)E_OKE_OKaltPolling-ModusEthIf_MainFunctionTx()Eth_TxConfirmation(CtrlIdx)EthIf_TxConfirmation(CtrlIdx, BufIdx, Result)Interrupt-ModusEth_TxIrqHdlr_<CtrlIdx>EthIf_TxConfirmation(CtrlIdx, BufIdx, Result)<UL>_TxConfirmation(CtrlIdx, BufIdx, Result)

时序图:两步发送以及轮询模式或中断模式下的确认。来源:[SWS_EthIf_00067]、[SWS_EthIf_00075]、[SWS_EthIf_00250]、[SWS_EthIf_00113]、[SWS_EthIf_00091]、[SWS_EthIf_00255]、EthIf-SWS 第87页、EthIf-SWS 第88页

接收到的帧由驱动程序通过EthIf_RxIndication [SWS_EthIf_00085]报告。在轮询模式下,EthIf_MainFunctionRx周期性检查新帧[SWS_EthIf_00097]。在优先级处理时,针对每个接收队列通过带有相应FifoIdx [SWS_EthIf_91051]的Eth_Receive执行此操作。通过<User>_RxIndication [SWS_EthIf_00104]向下透传,推测传递给通过FrameType分配的用户。 问题 Q-f3145bbfee9a08d0 (未决)

若VLAN未激活,EthIf丢弃该帧并增加相应的测量值[SWS_EthIf_00317],即ETHIF_MEAS_DROP_CRTLIDX [SWS_EthIf_00309]。通过EthIfEnableSecurityEventReporting,EthIf还向IdsM报告安全事件(Security Events)[SWS_EthIf_00502]、[SWS_EthIf_00503]、EthIf-SWS 第225页。

rx irq Interrupt-Modus: Eth meldet empfangenen Frame ind EthIf_RxIndication(CtrlIdx, FrameType, IsBroadcast, PhysAddrPtr, DataPtr, LenByte) irq->ind poll Polling-Modus: EthIf_MainFunctionRx ruft Eth_Receive poll->ind vlan VLAN / CtrlIdx 是否有效? ind->vlan dropv 丢弃帧, 增加 ETHIF_MEAS_DROP_CRTLIDX vlan->dropv 不 etype Ethertype bekannt? vlan->etype 是 sevv 安全事件 ETHIF_SEV_DROP_INV_VLAN (当 EthIfEnableSecurityEventReporting 时) dropv->sevv dropt Frame verwerfen etype->dropt 不 user <User>_RxIndication(CtrlIdx, FrameType, ...) an zugeordneten Nutzer (Zuordnung per FrameType: Interpretation) etype->user 是 sevt 安全事件 ETHIF_SEV_DROP_UNKNOWN_ETHERTYPE (当 EthIfEnableSecurityEventReporting 时) dropt->sevt

活动图:带有无效VLAN帧过滤及未知以太网类型过滤的接收路径;通过FrameType分配至用户为推测理解。来源:[SWS_EthIf_00085]、[SWS_EthIf_00097]、[SWS_EthIf_00317]、[SWS_EthIf_00309]、[SWS_EthIf_00503]、[SWS_EthIf_00104]

链路状态、端口组与信号质量

无收发器引用的控制器的行为表现为链路为ETHTRCV_LINK_STATE_ACTIVE [SWS_EthIf_00229]。若链路发生变化,EthIf为每个受影响的EthIfController调用<User>_TrcvLinkStateChg [SWS_EthIf_00230]、[SWS_EthIf_00108]。在无端口组的情况下,EthIf将主机端口的状态报告给EthSM [SWS_EthIf_00260]。

对于端口组,EthIf累加跨端口的状态。例如,当主机或上行链路端口处于down状态时,ETHTRCV_LINK_STATE_DOWN适用[SWS_EthIf_00259]。当该组分配给某一控制器时,结果发送给EthSM [SWS_EthIf_00262],否则发送给BswM [SWS_EthIf_00261]。

查询以周期EthIfMainFunctionStatePeriod在EthIf_MainFunctionState [SWS_EthIf_91104]中周期性执行[SWS_EthIf_00407]。若缺少此参数,根据图示由EthIf_MainFunctionRx接管查询EthIf-SWS 第89页。

对于活动链路,EthIf还通过EthSwt_GetPortSignalQuality [SWS_EthIf_00408]或EthTrcv_GetPhySignalQuality [SWS_EthIf_00409]轮询信号质量。当前值、最大值和最小值位于EthIf_SignalQualityResultType [SWS_EthIf_91057]中。它们通过[SWS_EthIf_91056]读取,通过[SWS_EthIf_00400]和[SWS_EthIf_00404]复位。关于更新的规则在EthIf-SWS 第176页中描述。

带端口组的周期性链路查询EthSMBswMEthIfEthSwtEthTrcvaltEthIfMainFunctionStatePeriod definiertEthIf_MainFunctionState()未定义 EthIfMainFunctionStatePeriodEthIf_MainFunctionRx()loop端口组的所有端口EthSwt_GetLinkState(SwitchIdx, SwitchPortIdx, ...)端口链路状态EthTrcv_GetLinkState(TrcvIdx, ...)收发器链路状态累加群组的链路状态alt更改,带 EthIfController 的端口组EthSM_TrcvLinkStateChg(CtrlIdx, TransceiverLinkState)更改,不带 EthIfController 的端口组BswM_EthIf_PortGroupLinkStateChg(PortGroupIdx, PortGroupState)optLink ETHTRCV_LINK_STATE_ACTIVEEthSwt_GetPortSignalQuality(...)EthTrcv_GetPhySignalQuality(...)EthIf_SignalQualityResultType aktualisieren

时序图:周期性链路查询、累加、向EthSM或BswM报告以及信号质量轮询。来源:[SWS_EthIf_00407]、[SWS_EthIf_00259]、[SWS_EthIf_00262]、[SWS_EthIf_00261]、[SWS_EthIf_00408]、[SWS_EthIf_00409]、EthIf-SWS 第91页、EthIf-SWS 第92页

端口组通过EthIf_SwitchPortGroupIdxType [SWS_EthIf_91101]和异步服务EthIf_SwitchPortGroupRequestMode [SWS_EthIf_91102]进行控制。激活时,EthIf首先设置端口模式,然后发起链路请求[SWS_EthIf_00272]。

关断为延迟进行。仅当所有引用的组均请求ETH_MODE_DOWN时,定时器EthIfSwitchOffPortTimedelay才启动[SWS_EthIf_00270]。在其超时后,依次执行EthSwt_PortLinkStateRequest和EthSwt_SetSwitchPortMode,且均带有DOWN [SWS_EthIf_00271]。新的激活请求作用于正在运行的定时器[SWS_EthIf_00483];推测理解:定时器可能会被中止。 问题 Q-be6e407c499a793b (未决)

EthIf_StartAllPorts [SWS_EthIf_91103]接通所有受影响的端口[SWS_EthIf_00275]。在EthIfPortStartupActiveTime超时后,EthIf停用在此之前未被主动请求的那些端口[SWS_EthIf_00276]。

portgroup down ETH_MODE_DOWN active ETH_MODE_ACTIVE down->active EthIf_SwitchPortGroupRequestMode(ETH_MODE_ACTIVE): EthSwt_SetSwitchPortMode(ACTIVE), EthSwt_PortLinkStateRequest(ACTIVE) startup aktiv durch EthIf_StartAllPorts (Frist EthIfPortStartupActiveTime) down->startup EthIf_StartAllPorts delay 关闭延迟 (定时器 EthIfSwitchOffPortTimedelay) active->delay 所有引用的端口组 均请求 ETH_MODE_DOWN delay->down Timer abgelaufen: EthSwt_PortLinkStateRequest(DOWN), EthSwt_SetSwitchPortMode(DOWN) delay->active erneut ETH_MODE_ACTIVE angefordert (Timerabbruch: Interpretation) startup->down 时限已到,未被请求: EthSwt_PortLinkStateRequest(DOWN), ... startup->active 在时限内 请求为 ETH_MODE_ACTIVE

状态图:端口组请求下交换机端口的生命周期,带有关断延迟和StartAllPorts;定时器中止为推测理解。来源:[SWS_EthIf_00272]、[SWS_EthIf_00270]、[SWS_EthIf_00271]、[SWS_EthIf_00483]、[SWS_EthIf_00275]、[SWS_EthIf_00276]、EthIf-SWS 第77页

唤醒、休眠与透传的特殊服务

EthIf_CheckWakeup [SWS_EthIf_00244]以异步方式工作。Integration Code调用该服务,亦可在中断上下文中调用EthIf-SWS 第56页。EthIf转发至所有受影响收发器的EthTrcv_CheckWakeup [SWS_EthIf_00245]以及交换机的EthSwt_SwitchCheckWakeup [SWS_EthIf_00500]。通过EthIfWakeUpSupport可关闭该服务[SWS_EthIf_00248]。

对于主机ECU,EcuM规范建议按需轮询(Polling on demand)。EthIf是否在EcuM_CheckWakeupHook中被调用取决于具体实现EcuM-SWS 第192页、EcuM-SWS 第189页。

带有以太网交换机的主机 ECU 的唤醒检查ETH-Hardware (PHY)EcuMIntegration CodeEthIfEthSwtEthTrcvWake-up-InterruptEcuM_CheckWakeupHook(WakeupSource)此处对 EthIf 的调用取决于具体实现EthIf_CheckWakeup(WakeupSource)loop所有受影响的以太网交换机EthSwt_SwitchCheckWakeup(...)loop所有受影响的收发器(EthIfTransceiver / 端口组)EthTrcv_CheckWakeup(...)E_OK:检查作业已接受实际检查为异步在 EthTrcv_MainFunction 中

时序图:主机ECU通过EthIf向交换机和收发器驱动程序进行唤醒检查。来源:[SWS_EthIf_00244]、[SWS_EthIf_00245]、[SWS_EthIf_00500]、EcuM-SWS 第192页、EcuM-SWS 第189页

对于反方向存在草案(DRAFT)需求:EthIf_SleepIndication [SWS_EthIf_91006]导致EthSM_SleepIndication [SWS_EthIf_00497]。一旦没有定时器运行,EthIf即检查硬件是否已达到请求的模式[SWS_EthIf_00498]。对于作为被动从机(Passive Slave)工作的收发器,EthIf还会检查是否存在意外的链路丢失[SWS_EthIf_00499]。唤醒原因由EthIf_GetPhyWakeupReason通过EthTrcv_GetBusWuReason提供[SWS_EthIf_91004]、[SWS_EthIf_00486]。EthIf_SetTransceiverWakeupMode已作废(OBSOLETE)[SWS_EthIf_00233]。

许多服务仅执行透传:

配置与实例关联

在EthIf的上下文中通过索引寻址:EthIfController使用CtrlIdx,收发器使用TrcvIdx,交换机使用SwitchIdx。一个EthIfController可以引用一个收发器、一个交换机或一个端口组[SWS_EthIf_00266]、[SWS_EthIf_00478]、[SWS_EthIf_00264]。通过EthIfVlanID它还可以代表一个VLAN [SWS_EthIf_00250]。EthIf_GetVlanId [SWS_EthIf_00301]和EthIf_GetCtrlIdxList [SWS_EthIf_00298]使这些实例在运行时可见。可选服务在编译前启用或禁用:

范围切换出处
EthIfGlobalTimeSupport时间戳服务[SWS_EthIf_00164], [SWS_EthIf_00170]
EthIfWakeUpSupportEthIf_CheckWakeup[SWS_EthIf_00248]
EthIfEnableWEthApi无线服务[SWS_EthIf_00342]
EthIfSwitchManagementSupport交换机管理[SWS_EthIf_00279]
EthIfGetPortMacAddrApi, EthIfGetArlTableMAC地址和端口搜索,ARL表[SWS_EthIf_00192], [SWS_EthIf_00198]
EthIfStoreConfigurationApi, EthIfResetConfigurationApi保存或复位已学习的MAC/端口表[SWS_EthIf_00216], [SWS_EthIf_00221]
EthIfVerifyConfigApi交换机配置检查[SWS_EthIf_00305]
EthIfGetAndResetMeasurementDataApi测量数据[SWS_EthIf_00316]

根据R24-11的文档出处,中断或轮询接收由参数EthIfEnableRxInterrupt EthIf-SWS 第174页控制。

发生错误时的行为

EthIf向DET报告开发错误。[SWS_EthIf_00017]定义了包括ETHIF_E_INV_CTRL_IDX(0x01)和ETHIF_E_INV_TRCV_IDX(0x02)等。各服务的需求还额外使用:

若DET被关闭,许多服务则返回E_NOT_OK [SWS_EthIf_00325]、[SWS_EthIf_00326]。与此不同,[SWS_EthIf_00319]给出了代码ETHIF_E_NOTINIT。

运行时错误通过返回值显现:

在网络层级,EthIf对丢弃的帧进行计数,并可选地将其作为安全事件报告[SWS_EthIf_00309]、[SWS_EthIf_00503]。EthIf将链路丢失传播给用户或EthSM或BswM [SWS_EthIf_00230]、[SWS_EthIf_00262]、[SWS_EthIf_00261]。对于作为被动从机工作的收发器,EthIf还会检测意外的链路断开(Link-Down)[SWS_EthIf_00499]。

进一步详细证据

基于有效载荷中所包含证据的人工智能生成模块指南。唯有AUTOSAR规范Ethernet Interface R20-11具有规范效力。来自其他版本的文档出处均已标注。

Ethernet Interface (EthIf)

Abstracts Ethernet controller and transceiver hardware for upper protocol layers.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

函数 EthIf_Init [SWS_EthIf_00024] 📄 PDF

void EthIf_Init (const EthIf_ConfigType* CfgPtr);

Initializes the Ethernet Interface

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5453d77780ab 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_Init 初始化以太网接口模块([SWS_EthIf_00024])。它同步执行,不可重入(Non Reentrant),并可通过头文件 EthIf.h 获得,其服务 ID 为 0x01。作为唯一的传入参数,该函数需要指针 CfgPtr,该指针指向类型为 EthIf_ConfigType 的具体实现特定配置结构体。既不存在 inout 参数也不存在 out 参数,且函数没有返回值([SWS_EthIf_00024])。

并发与调用上下文

由于 EthIf_Init 不可重入,因此不得进行并发或嵌套调用 [SWS_EthIf_00024]。由于有效载荷中未详细描述具体的调用上下文,因此该调用通常应在 ECU 初始化序列期间、使用其他以太网服务之前执行一次。 问题 Q-07e92f9f3c15ea5b (未决)

顺序条件与交互

调用 EthIf_Init 是使用该模块所有其他函数的强制先决条件。若启用了开发错误检测(Development Error Detection),以太网接口的众多服务在执行前都会检查此前是否已调用 EthIf_Init:

本使用说明为自动生成,基于 AUTOSAR Classic R20-11 规范。

实现者指南即将推出(复杂度 I2)

函数 EthIf_SetControllerMode [SWS_EthIf_00034] 📄 PDF

Std_ReturnType EthIf_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);

Enables / disables the indexed controller thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ae12ff5b506f 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

函数 EthIf_SetControllerMode 在以太网接口上下文中激活或停用由 CtrlIdx 指定的以太网控制器 [SWS_EthIf_00034]。通过参数 CtrlMode 请求以下状态 [SWS_EthIf_00034]:

  • ETH_MODE_DOWN:禁用控制器。
  • ETH_MODE_ACTIVE:激活控制器。
  • ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST:激活控制器并请求网络唤醒。

该函数以异步方式工作 [SWS_EthIf_00034]。它在成功执行时返回 E_OK,或在无法更改控制器模式时返回 E_NOT_OK [SWS_EthIf_00034]。

交互与转发

若针对引用了“control”类型 EthIfSwitchPortGroup 的控制器以 ETH_MODE_ACTIVE 调用 EthIf_SetControllerMode,且该模式是首次为该端口请求且其状态为 ETH_MODE_DOWN,则 EthIf 会将调用转发给该组的所有端口。此时将依次执行带有 ETH_MODE_ACTIVE 的 EthSwt_SetSwitchPortMode 以及带有 ETHTRCV_LINK_STATE_ACTIVE 的 EthSwt_PortLinkStateRequest [SWS_EthIf_00264]。

当请求 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 时,无论当前模式如何,EthIf 均按如下方式转发调用:

  • 当引用 EthIfTransceiver 时:调用带有 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 的 EthTrcv_SetTransceiverMode,随后在当前状态为 ETHTRCV_LINK_STATE_DOWN 时调用带有 ETHTRCV_LINK_STATE_ACTIVE 的 EthTrcv_TransceiverLinkStateRequest [SWS_EthIf_00479]。
  • 当引用 EthIfSwitch 或“control”类型的 EthIfSwitchPortGroup 时:调用带有 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 的 EthSwt_SetSwitchPortMode,随后在当前状态为 ETHTRCV_LINK_STATE_DOWN 时调用带有 ETHTRCV_LINK_STATE_ACTIVE 的 EthSwt_PortLinkStateRequest [SWS_EthIf_00480],[SWS_EthIf_00481]。

限制

该函数不可重入(Non Reentrant),可通过 EthIf.h 获取 [SWS_EthIf_00034]。

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I2)

函数 EthIf_SetTransceiverWakeupMode [SWS_EthIf_00233] 📄 PDF

Std_ReturnType EthIf_SetTransceiverWakeupMode (uint8 TrcvIdx, EthTrcv_WakeupModeType TrcvWakeupMode);

Enables / disables the wake up mode or clear the wake - up reason of the indexed transceiver Tags: atp.Status=obsolete

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d9ee9c3c6e19 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步且不可重入的函数 EthIf_SetTransceiverWakeupMode(服务 ID 0x2e)用于设置 Ethernet Interface 中通过 TrcvIdx 寻址的收发器的唤醒模式,或重置其唤醒原因 [SWS_EthIf_00233]。该函数在头文件 EthIf.h 中声明,并在发布版本 AUTOSAR CP R20-11 中标记为已过时(obsolete)[SWS_EthIf_00233]。

控制通过传递参数 TrcvWakeupMode 进行 [SWS_EthIf_00233]:

  • ETHTRCV_WUM_ENABLE:激活收发器的唤醒 [SWS_EthIf_00233]。如果分配的驱动程序 EthIfTransceiverIdx 当前处于状态 ETHTRCV_WUM_DISABLE,则该调用将被转发给 EthTrcv_SetTransceiverWakeupMode [SWS_EthIf_00234]。
  • ETHTRCV_WUM_DISABLE:停用收发器的唤醒 [SWS_EthIf_00233]。只要驱动程序的当前状态为 ETHTRCV_WUM_ENABLE,该函数就会将调用转发给 EthTrcv_SetTransceiverWakeupMode [SWS_EthIf_00268]。
  • ETHTRCV_WUM_CLEAR:清除索引收发器的唤醒原因 [SWS_EthIf_00233]。

作为返回值,该调用在成功执行时返回 E_OK,如果无法更改唤醒模式或无法清除唤醒原因,则返回 E_NOT_OK [SWS_EthIf_00233]。由于接口定义为不可重入,因此不允许并发调用 [SWS_EthIf_00233]。

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetTransceiverWakeupModethernetInterface [SWS_EthIf_00238] 📄 PDF

Std_ReturnType EthIf_GetTransceiverWakeupMode (uint8 TrcvIdx, EthTrcv_WakeupModeType* TrcvWakeupModePtr);

Returns the wake up mode of the indexed tran sceiver Tags: atp.Status=obsolete

函数 EthIf_CheckWakeup [SWS_EthIf_00244] 📄 PDF

Std_ReturnType EthIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);

This API request the affected Ethernet hardware to c heck for a signaled wake - up. The used Ethernet hardware could be an Ethernet switch or Ethernet transceiver (PHY). This is used e.g. for Ethernet hardware which is compliant to the specification of Open Alliance TC10. This API is called by the integration code. The function could be called in context of the interrupt or on task level.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 99f093847096 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_CheckWakeup 请求受影响的以太网硬件检查所指示的唤醒 [SWS_EthIf_00244]。例如,这用于符合 OPEN Alliance TC10 规范的以太网硬件 [SWS_EthIf_00244]。调用由集成代码异步且可重入地发起,可选择在中断上下文中或在任务级发起 [SWS_EthIf_00244]。

作为输入参数,使用类型为 EcuM_WakeupSourceType 的 WakeupSource,它指定了触发源设备(以太网收发器或以太网交换机)[SWS_EthIf_00244]。如果硬件接受了检查请求,则返回值是 E_OK,否则在请求被拒绝时返回 E_NOT_OK [SWS_EthIf_00244]。模块在内部将调用转发给下层驱动程序:

  • 对于所有受影响的以太网收发器(通过 EthIfTransceiver 或 EthIfSwitchPortGroups 引用),调用各收发器驱动程序的 EthTrcv_CheckWakeup [SWS_EthIf_00245]。
  • 对于所有受影响的以太网交换机(通过 EthIfSwitch 引用),调用相应交换机驱动程序的 EthSwt_SwitchCheckWakeup [SWS_EthIf_00500]。

EthIf_CheckWakeup 的可用性可在预编译期通过配置参数 EthIfWakeUpSupport 进行激活和停用 [SWS_EthIf_00248]。该 API 通过头文件 EthIf.h 提供 [SWS_EthIf_00244]。

此使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetSwitchPortWakeupReason [SWS_EthIf_00488] 📄 PDF

Std_ReturnType EthIf_GetSwitchPortWakeupReason (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_WakeupReasonType* WakeupReasonPtr);

This function obtains the wake up reasons of the indexed Ethernet switch port by

函数 EthIf_GetPhysAddr [SWS_EthIf_00061] 📄 PDF

void EthIf_GetPhysAddr (uint8 CtrlIdx, uint8* PhysAddrPtr);

Obtains the physical source address used by the indexed controller

函数 EthIf_SetPhysAddr [SWS_EthIf_00132] 📄 PDF

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

Sets the physical source address used by the indexed controller.

函数 EthIf_UpdatePhysAddrFilter [SWS_EthIf_00139] 📄 PDF

Std_ReturnType EthIf_UpdatePhysAddrFilter (uint8 CtrlIdx, const uint8* PhysAddrPtr, Eth_FilterActionType Action);

Update the physical 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 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0059e8b2ee6e 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_UpdatePhysAddrFilter([SWS_EthIf_00139])用于更新通过 CtrlIdx 指定的 Ethernet 控制器的地址过滤器。通过参数 Action(类型为 Eth_FilterActionType)向过滤器添加或从中移除物理地址。

为了进行配置,PhysAddrPtr 期望一个指向网络字节序物理 MAC 地址的指针,该地址表示 Layer-2 Ethernet 数据包的组播目标地址 [SWS_EthIf_00139]。尽管文本函数描述中提到了源地址,但这可能属于编辑疏忽,因为参数规范具有约束力地规定了组播目标地址。 问题 Q-312e20e5eadda94a (未决)

关于执行流程和限制,适用以下规定 [SWS_EthIf_00139]:

  • 返回值:如果过滤器配置更改成功,该函数返回 E_OK;如果更改失败,则返回 E_NOT_OK。源文档中未定义特定的 DET 或 DEM 错误代码。
  • 硬件支持:如果底层 Ethernet 控制器在硬件方面无法执行过滤,则软件必须承担此过滤任务。
  • 并发性:对于相同的控制器索引(CtrlIdx),该调用不可重入,但对于不同的控制器,允许并发执行。

此使用说明由 AI 基于规范 R20-11 生成。

函数 EthIf_GetArlTable [SWS_EthIf_00196] 📄 PDF

Std_ReturnType EthIf_GetArlTable (uint8 switchIdx, uint16* numberOfElements, Eth_MacVlanType* arlTableListPointer);

Obtains the address resolution ta ble of a switch and copies the list into a user provided buffer. The function will copy all or number Of

函数 EthIf_GetAndResetMeasurementData [SWS_EthIf_91011] 📄 PDF

Std_ReturnType EthIf_GetAndResetMeasurementData (EthIf_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Allows to read and reset detailed measurement data for diagnostic purposes. Get all Measurement Idx's at once is not supported. ETHIF_ MEAS_ ALL shall only be used to reset all Measurement Idx's at once. A NULL_ PTR shall be provided for Measurement Data Ptr in this case.

函数 EthIf_StoreConfiguration [SWS_EthIf_00214] 📄 PDF

Std_ReturnType EthIf_StoreConfiguration (uint8 SwitchIdx);

The function shall request to store the configuration of the learned MAC/ Port tables of a Ethernet switch in a persistent manner. This could be used by e.g. a CDD.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 31fa677de79c 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EthIf_StoreConfiguration 用于请求对 Ethernet 交换机已学习的 MAC/端口表进行持久化存储 [SWS_EthIf_00214]。例如,Complex Device Driver(CDD)被列为典型的调用方 [SWS_EthIf_00214]。该接口可通过头文件 EthIf.h 访问,并具有 Service-ID 0x2c [SWS_EthIf_00214]。

通过输入参数 SwitchIdx 传递 Ethernet 交换机驱动程序上下文中目标交换机的索引 [SWS_EthIf_00214]。该函数返回状态 Std_ReturnType 作为返回值:值 E_OK 表示存储请求已被接受,而 E_NOT_OK 则指示未被接受 [SWS_EthIf_00214]。由于规范将执行标为同步/异步,因此接收请求大概率是同步进行的,而实际的持久化推测在下游模块中异步处理。 问题 Q-4f10e936c7d30258 (未决)

限制与错误处理

关于并发性,EthIf_StoreConfiguration 被指定为不可重入(Non Reentrant)[SWS_EthIf_00214]。因此,调用方必须避免并行调用或对其进行同步。未为此接口定义特定的 DET 或 DEM 错误报告;任务接收失败仅通过返回值 E_NOT_OK 报告 [SWS_EthIf_00214]。

此使用说明为自动创建。源文档的更改将导致重新生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_ResetConfiguration [SWS_EthIf_00219] 📄 PDF

Std_ReturnType EthIf_ResetConfiguration (uint8 SwitchIdx);

The function shall request to reset the configuration of the learned MAC/ Port tables of a Eth ernet switch in a persistent manner. This could be used by e.g. a CDD. The statically configured entries shall still remain.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 46cb0df40dd4 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EthIf_ResetConfiguration 用于请求对 Ethernet 交换机动态学习的 MAC 和端口表进行持久化重置 [SWS_EthIf_00219]。静态配置的条目在配置中保持不变 [SWS_EthIf_00219]。例如,Complex Device Driver(CDD)可充当该接口的调用方 [SWS_EthIf_00219]。

通过传入参数 SwitchIdx 指定 Ethernet 交换机驱动程序上下文中相关交换机的索引 [SWS_EthIf_00219]。关于执行语义,该操作被标为同步/异步 [SWS_EthIf_00219];这可能意味着接收请求得到同步确认,而硬件表的重置则异步进行。 问题 Q-9e7f89ec9e809fd0 (未决)

返回值与错误处理

作为返回值,该函数提供类型为 Std_ReturnType 的状态[SWS_EthIf_00219]:

在本规范范围内,未记录该函数的具体 DET 或 DEM 错误报告。

并发性与限制

该接口被指定为不可重入(Non Reentrant)[SWS_EthIf_00219]。因此,调用方必须确保不发生并发或中断调用。该函数通过头文件 EthIf.h 包含 [SWS_EthIf_00219]。

此使用说明基于 AUTOSAR Release R20-11 的规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetCurrentTime [SWS_EthIf_00154] 📄 PDF

Std_ReturnType EthIf_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, the remaining bits will be filled with 0. Important Note: Eth If_ Get Curren t Time may be called within an exclusive area.

函数 EthIf_EnableEgressTimeStamp [SWS_EthIf_00160] 📄 PDF

void EthIf_EnableEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx thernetInterface); ⚠️

Activates 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 stamped" by network design.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3c09f202ad0f 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_EnableEgressTimeStamp 用于为专用消息对象或发送缓冲区激活发送时间戳采集(Egress Time Stamping)[SWS_EthIf_00160]。该接口通过头文件 EthIf.h 提供 [SWS_EthIf_00160]。

参数与调用

调用时,该函数期望传递两个输入参数 [SWS_EthIf_00160]:

该函数没有返回值(void),也没有输入或输出参数 [SWS_EthIf_00160]。

硬件行为与并发性

硬件行为因控制器而异:某些硬件类型在一次性配置后永久保存发送时间戳标记,而其他控制器则必须在每次单独传输之前都需要该标记 [SWS_EthIf_00160]。解释:在没有永久存储的控制器上,该函数随后可能必须在每次发送过程之前由应用程序重新调用。 问题 Q-e87b424598f8a684 (未决)根据规范,不存在停用选项,因为根据网络设计,相应的消息类型会被永久标记时间戳 [SWS_EthIf_00160]。

在并发性方面,该函数被定义为不可重入(Non Reentrant)[SWS_EthIf_00160]。

本使用说明是基于规范 AUTOSAR R20-11 自动生成的。

函数 EthIf_GetEgressTimeStamp [SWS_EthIf_00166] 📄 PDF

Std_ReturnType EthIf_GetEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_TimeStampQualType* timeQualPtr, thernetInterface* timeStampPtr); ⚠️

Reads back the egress time stamp on a dedicated message object. It must be called within the Tx Confirmation() function.

函数 EthIf_GetIngressTimeStamp [SWS_EthIf_00172] 📄 PDF

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

Reads back the ingress time stamp on a dedicated message object. It must be called within the Rx Indication() function.

函数 EthIf_SwitchPortGroupRequestMode [SWS_EthIf_91102] 📄 PDF

Std_ReturnType EthIf_SwitchPortGroupRequestMode (EthIf_SwitchPortGroupIdxType PortGroupIdx, Eth_ModeType PortMode);

Request a mode for the Eth If Swt Port Group. The call shall be forwarded to Eth Swt by calling Eth Swt_ Set Switch P ort Mode for all Eth Swt Ports referenced by the port group.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 93249af97580 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

异步函数 EthIf_SwitchPortGroupRequestMode 请求交换机端口组的运行模式([SWS_EthIf_91102])。该调用被指定为不可重入,并传入端口组的索引(PortGroupIdx)以及所需的目标模式(PortMode)。可用模式包括用于停用的 ETH_MODE_DOWN、用于激活的 ETH_MODE_ACTIVE 以及用于带网络唤醒激活的 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST([SWS_EthIf_91102])。成功启动时,函数返回 E_OK,否则返回 E_NOT_OK([SWS_EthIf_91102])。

原则上,EthIf 通过对所有引用的端口调用 EthSwt_SetSwitchPortMode 将请求转发给下层交换机([SWS_EthIf_91102])。在此过程中,不同模式适用特定的行为规则:

  • 停用(ETH_MODE_DOWN):若端口当前处于状态 ETH_MODE_ACTIVE,且已为引用这些端口的所有组请求了 ETH_MODE_DOWN,则 EthIf 启动一个延迟时间为 EthIfSwitchOffPortTimedelay 的定时器([SWS_EthIf_00270])。
  • 激活(ETH_MODE_ACTIVE 或 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST):针对相应端口组的端口正在运行的关闭延迟定时器将被立即中止([SWS_EthIf_00483])。
  • 唤醒请求(ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST):无论当前端口模式如何,该调用都必须严格按照固定顺序转发给该组的所有端口:首先调用带有 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 的 EthSwt_SetSwitchPortMode,若当前链路状态为 ETHTRCV_LINK_STATE_DOWN,紧接着调用带有 ETHTRCV_LINK_STATE_ACTIVE 的 EthSwt_PortLinkStateRequest([SWS_EthIf_00482])。

该服务未列出特定的 DET 或 DEM 错误消息;模式更改失败将直接通过返回值 E_NOT_OK 指示([SWS_EthIf_91102])。

此使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I2)

函数 EthIf_StartAllPorts [SWS_EthIf_91103] 📄 PDF

Std_ReturnType EthIf_StartAllPorts (void);

Request to set all configured and affected Eth Swt Ports to ETH_ MODE_ ACTIVE

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 482f0b4972cd 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_StartAllPorts 用于请求将所有已配置且受影响的以太网交换机端口置于状态 ETH_MODE_ACTIVE([SWS_EthIf_91103])。调用无参数,具有异步语义,并被指定为可重入([SWS_EthIf_91103])。作为返回值,E_OK 指示接受请求,而 E_NOT_OK 指示拒绝([SWS_EthIf_91103])。

在调用 EthIf_StartAllPorts 之后,EthIf 按照严格定义的顺序将控制命令转发给以太网交换机的所有受影响端口(EthSwtPorts)([SWS_EthIf_00275]):

  • 若当前模式为 ETH_MODE_DOWN,首先调用带有 ETH_MODE_ACTIVE 的 EthSwt_SetSwitchPortMode([SWS_EthIf_00275])。
  • 随后,若当前链路状态为 ETHTRCV_LINK_STATE_DOWN,则调用带有 ETHTRCV_LINK_STATE_ACTIVE 的 EthSwt_PortLinkStateRequest,并为所有这些端口启动一个时间跨度为 EthIfPortStartupActiveTime 的定时器([SWS_EthIf_00275])。

如果通过这种方式激活的端口未在时间跨度 EthIfPortStartupActiveTime 内被以 ETH_MODE_ACTIVE 正常请求,EthIf 将自动再次停用该端口([SWS_EthIf_00276])。停用强制以相反顺序进行:

  • 首先调用带有 ETHTRCV_LINK_STATE_DOWN 的 EthSwt_PortLinkStateRequest([SWS_EthIf_00276])。
  • 随后调用带有 ETH_MODE_DOWN 的 EthSwt_SetSwitchPortMode([SWS_EthIf_00276])。

本使用说明基于 AUTOSAR Classic Platform R20-11 规范。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetSwitchMgmtInfo [SWS_EthIf_91003] 📄 PDF

Std_ReturnType EthIf_SetSwitchMgmtInfo (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType* MgmtInfoPtr);

Provides additional management information along to an Ethernet frame that requires special treatment within the Switch. It has to be called between Eth If_ Provide Tx Buffer() and Eth If_ Transmit() of the related frame.

函数 EthIf_GetTxMgmtObject [SWS_EthIf_91106] 📄 PDF

Std_ReturnType EthIf_GetTxMgmtObject (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtObjectType* * MgmtObjectPtr);

Request the Mgmt Object of the (in this context) unique Buf Idx.

函数 EthIf_SwitchEnableTimeStamping [SWS_EthIf_91007] 📄 PDF

Std_ReturnType EthIf_SwitchEnableTimeStamping (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType* MgmtInfo);

Activates egress time stamping on a dedicated message object, addressed by Ctrl Idx and Buf Idx.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 97b7a2a9a3c5 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchEnableTimeStamping([SWS_EthIf_91007])激活交换机级别特定消息对象的出口时间戳(Egress-Time-Stamping)采集。关联的传输对象通过控制器索引 CtrlIdx 以及缓冲区索引 BufIdx 进行寻址。

调用与参数

调用同步进行([SWS_EthIf_91007])。作为输入参数,该函数期望 EthIf 上下文内的控制器索引 CtrlIdx,以及应用程序期望时间戳记录的消息缓冲区的 BufIdx。通过类型为 EthSwt_MgmtInfoType* 的输出参数 MgmtInfo 提供关联的管理信息([SWS_EthIf_91007])。

返回值与行为

该函数通过类型为 Std_ReturnType 的返回值提示结果([SWS_EthIf_91007]):

限制与并发性

该接口被指定为不可重入(Non Reentrant)([SWS_EthIf_91007])。因此,调用者必须确保阻止并行调用。声明通过头文件 EthIf.h 提供([SWS_EthIf_91007])。

此使用说明基于 AUTOSAR R20-11 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_VerifyConfig [SWS_EthIf_91012] 📄 PDF

Std_ReturnType EthIf_VerifyConfig (uint8 SwitchIdx, boolean* Result);

Forwarded t o Eth Swt_ Verify Config. Eth Swt_ Verify Config verifies the Switch thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface Configuration depending on the HW - Architecture, HW - capability and the intended accuracy of this verification.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 775ea0d621ed 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步接口函数 EthIf_VerifyConfig 用于检查交换机配置,并将调用直接转发给 EthSwt_VerifyConfig [SWS_EthIf_91012]。实际的验证由 Ethernet 交换机驱动程序根据各硬件架构、硬件功能和预期的检查精度执行 [SWS_EthIf_91012]。

用法与参数

该函数可通过头文件 EthIf.h 使用,其 Service-ID 为 0x40,并需要两个参数 [SWS_EthIf_91012]:

  • SwitchIdx(in):Ethernet 交换机驱动程序上下文中交换机的索引。
  • Result(out):指向用于接收验证结果的布尔值的指针。TRUE 表示成功检查的配置,而 FALSE 则指示检测到损坏。

作为返回值,Std_ReturnType 报告执行状态:E_OK 表示验证已成功完成,而 E_NOT_OK 指示配置检查失败 [SWS_EthIf_91012]。

并发与错误处理

该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_91012]。因此,调用方必须确保不发生竞争调用。由于 Payload 未列出 DET 或 DEM 的具体错误代码,因此详细的参数检查(例如索引或指针的有效性验证)推测由驱动程序端或特定实现进行处理。 问题 Q-03b5f343e97bec7f (未决)

本使用说明自动生成,且完全基于来自 AUTOSAR R20-11 的规范数据。

函数 EthIf_SetForwardingMode [SWS_EthIf_91013] 📄 PDF

Std_ReturnType EthIf_SetForwardingMode (uint8 SwitchIdx, boolean mode);

Verifies the Switch Configuration. If Configuration is not valid, Switch is reconfigured.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 84d8304b8c11 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_SetForwardingMode 通过头文件 EthIf.h 提供,用于控制 Ethernet 交换机上的帧转发 [SWS_EthIf_91013]。它会验证当前交换机配置,并在检测到无效时执行交换机的重新配置 [SWS_EthIf_91013]。

参数与返回值

在调用时(Service-ID 0x41),传递以下输入参数 [SWS_EthIf_91013]:

  • SwitchIdx:Ethernet 交换机驱动程序上下文中相关交换机的索引 [SWS_EthIf_91013]。
  • mode:用于激活(TRUE)或停用(FALSE)帧转发的布尔开关 [SWS_EthIf_91013]。

该函数提供以下返回值Std_ReturnType [SWS_EthIf_91013]:

并发性与限制

该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_91013]。因此,调用方必须确保对相同或并行的交换机上下文的调用按序进行,且不发生竞争调用。标准中未为此服务定义 DET 或 DEM 的特定错误代码。

此使用说明由系统自动生成,基于 AUTOSAR 规范。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetTrcvSignalQuality [SWS_EthIf_91056] 📄 PDF

Std_ReturnType EthIf_GetTrcvSignalQuality (uint8 TrcvIdx, EthIf_SignalQualityResultType* ResultPtr);

Retrieves the signal quality of the link of the given Ethernet transceiver

函数 EthIf_GetSwitchPortSignalQuality [SWS_EthIf_91058] 📄 PDF

Std_ReturnType EthIf_GetSwitchPortSignalQuality (uint8 SwitchIdx, uint8 SwitchPortIdx, EthIf_SignalQualityResultType* ResultPtr);

Retrieves the signal quality of the link of the given Ethernet switch port

函数 EthIf_ClearTrcvSignalQuality [SWS_EthIf_91059] 📄 PDF

Std_ReturnType EthIf_ClearTrcvSignalQuality (uint8 TrcvIdx);

Clear the stored signal quality of the link of the given Ethernet transceiver

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: b5e0adba4624 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_ClearTrcvSignalQuality 用于同步清除特定收发器的 Ethernet 连接已保存的信号质量值 [SWS_EthIf_91059]。为此,调用方通过参数 TrcvIdx 传入 Ethernet Interface 上下文中的收发器索引,随后相应的测量值将被清除 [SWS_EthIf_00400]。

作为返回值,接口提供类型 Std_ReturnType:如果重置信号质量成功,则报告 E_OK;否则操作失败并返回 E_NOT_OK [SWS_EthIf_91059]。Interpretation:错误值 E_NOT_OK 可能归因于无效的索引参数或转发给下层驱动程序时的错误,因为有效载荷中未提及具体的错误代码或 DET 条目。 问题 Q-40d8f0c1fc7ba11e (未决)

在并发性方面,该服务对于不同的收发器索引实现为可重入,但对于相同的 TrcvIdx 明确为不可重入 [SWS_EthIf_91059]。因此,不得从并发上下文中同时针对相同收发器进行多次调用,且必须相应地加以保护。

在模块交互中,该调用专门清除通过 TrcvIdx 寻址的 EthIfTransceiver 的类型为 EthIf_SignalQualityResultType 的已存储信号质量值 [SWS_EthIf_00400]。该服务 ID 为 0x19 的同步接口声明通过头文件 EthIf.h 提供 [SWS_EthIf_91059]。

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_ClearSwitchPortSignalQuality [SWS_EthIf_91060] 📄 PDF

Std_ReturnType EthIf_ClearSwitchPortSignalQuality (uint8 SwitchIdx, uint8 SwitchPortIdx);

Clear the stored signal quality of the link of the given Et hernet switch port

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 821340633a61 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步函数 EthIf_ClearSwitchPortSignalQuality 用于重置特定 Ethernet 交换机端口连接的已保存信号质量值 [SWS_EthIf_91060]。目标端口通过两个输入参数寻址:SwitchIdx(Ethernet 交换机索引)和 SwitchPortIdx(接口上下文内的端口索引)[SWS_EthIf_91060]。该函数可通过头文件 EthIf.h 获取 [SWS_EthIf_91060]。

交互与数据结构

根据 [SWS_EthIf_00404],该调用清除所寻址交换机端口内部保留的信号质量值,这些值符合类型 EthIf_SignalQualityResultType。这使得上层模块能够有针对性地丢弃历史测量值,并启动对连接质量的重新评估。

错误处理

操作的成功与否通过类型为 Std_ReturnType 的返回值指示:清除成功时,函数返回 E_OK;否则返回 E_NOT_OK [SWS_EthIf_91060]。有效载荷中未定义具体的 DET 或 DEM 错误代码。Interpretation:返回值 E_NOT_OK 可能会在传入无效索引或底层交换机驱动程序无法执行重置时出现。 问题 Q-fc42f5b3e5414f6a (未决)

并发性与限制

在重入性方面,EthIf_ClearSwitchPortSignalQuality 针对不同的交换机和交换机端口索引是可重入的 [SWS_EthIf_91060]。然而,针对相同的交换机端口(SwitchPortIdx),该函数被指定为不可重入 [SWS_EthIf_91060]。因此,调用方必须确保避免针对同一端口发生并发调用,或通过适当的同步机制进行保护。

本文字由 AI 生成,用作参考文档。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPhyTestMode [SWS_EthIf_91016] 📄 PDF

Std_ReturnType EthIf_SetPhyTestMode (uint8 TrcvIdx, EthTrcv_PhyTestModeType Mode);

Activates a given test mode.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 64928adfaeea 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步接口函数 EthIf_SetPhyTestMode 用于在 Ethernet 收发器上激活预设的测试模式 [SWS_EthIf_91016]。该服务在头文件 EthIf.h 中声明,并可通过十六进制 Service-ID 0x17 进行标识 [SWS_EthIf_91016]。

调用时,该函数需要传入两个输入参数 [SWS_EthIf_91016]:

  • TrcvIdx:确定 Ethernet Interface 上下文中目标收发器的数值索引 [SWS_EthIf_91016]。
  • Mode:定义要激活的具​​体测试模式,类型为 EthTrcv_PhyTestModeType [SWS_EthIf_91016]。

不存在输入和输出参数 [SWS_EthIf_91016]。作为返回值,该服务返回 Std_ReturnType 类型的状态 [SWS_EthIf_91016]。返回值 E_OK 确认测试模式激活请求已被成功接受 [SWS_EthIf_91016]。相反,值 E_NOT_OK 表示请求被拒绝且无法激活测试模式 [SWS_EthIf_91016]。

关于并发性,EthIf_SetPhyTestMode 被指定为针对不同收发器索引(TrcvIdx)可重入 [SWS_EthIf_91016]。对于相同的收发器索引,执行明确为不可重入 [SWS_EthIf_91016]。因此,调用方必须确保避免针对同一收发器实例发生竞争调用,而是按序协调进行。

本文本由 AI 基于规范生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPhyLoopbackMode [SWS_EthIf_91018] 📄 PDF

Std_ReturnType EthIf_SetPhyLoopbackMode (uint8 TrcvIdx, EthTrcv_PhyLoopbackModeType Mode);

Activates a given loopback mode.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f13ccd8e218e 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步函数 EthIf_SetPhyLoopbackMode 用于激活 Ethernet 收发器上的指定环回模式 [SWS_EthIf_91018]。声明可通过头文件 EthIf.h 获取 [SWS_EthIf_91018]。

在调用时,该函数需要两个输入参数:

  • TrcvIdx:Ethernet Interface 上下文中的收发器索引 [SWS_EthIf_91018]。
  • Mode:要激活的环回模式,类型为 EthTrcv_PhyLoopbackModeType [SWS_EthIf_91018]。

作为返回值,该函数提供一个类型为 Std_ReturnType 的状态:E_OK 表示请求已被接受,而 E_NOT_OK 则表明请求无法被接受 [SWS_EthIf_91018]。Interpretation:该函数可能会将调用同步转发给负责 TrcvIdx 的 Ethernet 收发器驱动程序。 问题 Q-c4736bbfd250cca0 (未决)

错误处理

规范摘录中未定义具体的错误代码(如 DET 消息或 DEM 事件)。如果接受请求失败,将通过返回值 E_NOT_OK 立即告知调用方 [SWS_EthIf_91018]。调用方在继续后续测试或诊断流程之前,必须检查该返回值。

并发性与限制

该函数针对不同的收发器索引是可重入的(TrcvIdx),但针对相同的收发器索引明确为不可重入 [SWS_EthIf_91018]。因此,调用方必须确保避免针对同一收发器实例发生并发调用,或通过适当的同步机制进行保护 [SWS_EthIf_91018]。

此文本由 AI 创建,并基于 AUTOSAR 规范。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPhyTxMode [SWS_EthIf_91005] 📄 PDF

Std_ReturnType EthIf_SetPhyTxMode (uint8 TrcvIdx, EthTrcv_PhyTxModeType Mode);

Activates a given transmission mode. Tags: atp.Status=draft

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 938ed4c4359d 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步接口函数 EthIf_SetPhyTxMode 用于为 Ethernet 收发器激活指定的传输模式 [SWS_EthIf_91005]。该函数在头文件 EthIf.h 中声明,服务 ID 为 0x13 [SWS_EthIf_91005]。

对于调用,该函数期望两个输入参数 [SWS_EthIf_91005]:

  • TrcvIdx:Ethernet 接口上下文中相应收发器的数字索引。
  • Mode:类型为 EthTrcv_PhyTxModeType 的待具体激活的发送模式。

执行同步进行。作为返回值,该函数提供类型为 Std_ReturnType 的状态 [SWS_EthIf_91005]。值 E_OK 确认已成功接受请求,而 E_NOT_OK 发出无法接受请求的信号 [SWS_EthIf_91005]。规范数据中未列出特定错误码或向开发错误管理(DET)或诊断事件管理(DEM)发送的通知。

关于并发行为,EthIf_SetPhyTxMode 针对不同的收发器索引是可重入的(TrcvIdx)[SWS_EthIf_91005]。但是,如果针对相同的收发器索引发出调用,则该函数被定义为不可重入,并需要同步或顺序调用 [SWS_EthIf_91005]。

作为形式上的限制,需要注意的是,该接口元素在规范 AUTOSAR CP R20-11 中被标记为状态 draft [SWS_EthIf_91005]。

本使用提示由 AI 基于 AUTOSAR CP R20-11 规范创建。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetCableDiagnosticsResult [SWS_EthIf_91014] 📄 PDF

Std_ReturnType EthIf_GetCableDiagnosticsResult (uint8 TrcvIdx, EthTrcv_CableDiagResultType* ResultPtr);

Retrieves the cable diagnostics result of a given transceiver.

函数 EthIf_GetBufWRxParams [SWS_EthIf_91002] 📄 PDF

Std_ReturnType EthIf_GetBufWRxParams (uint8 CtrlIdx, const WEth_BufWRxParamIdType* RxParamIds, uint32* ParamValues, uint8 NumParams);

Read out values related to the receive direction of the transceiver for a received packet. For example, this could be RSSI or Channel belonging to one single packet.

函数 EthIf_GetBufWTxParams [SWS_EthIf_91054] 📄 PDF

Std_ReturnType EthIf_GetBufWTxParams (uint8 CtrlIdx, const WEth_BufWTxParamIdType* TxParamIds, uint32* ParamValues, uint8 NumParams);

Read out values related to the transmit direction of the transceiver for a transmitted packet. For example, this could be transaction ID belonging to one single packet.

函数 EthIf_SetBufWTxParams [SWS_EthIf_91017] 📄 PDF

Std_ReturnType EthIf_SetBufWTxParams (uint8 CtrlIdx, Eth_BufIdxType BufIdx, const WEth_BufWTxParamIdType* TxParamIds, const uint32* ParamValues, uint8 NumParams);

Set values related to the transmit direction of the transceiver for a specific buffer (packet to be sent). For example, this can be the desired transmit power or the channel belonging to one single packet.

函数 EthIf_SetRadioParams [SWS_EthIf_91026] 📄 PDF

Std_ReturnType EthIf_SetRadioParams (uint8 TrcvId, const WEthTrcv_SetRadioParamIdType* ParamIds, const uint32* ParamValue, uint8 NumParams);

Set values related to a transceiver's wireless radio. For example, this could be the selection of the radio settings (channel, ...).

函数 EthIf_SetChanRxParams [SWS_EthIf_91034] 📄 PDF

Std_ReturnType EthIf_SetChanRxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_SetChanRxParamIdType* ParamIds, const uint32* ParamValues, uint8 NumParams);

Set values related to the receive direction of a transceiver's wireless channel. For example, this could be a channel parameter like the frequency.

函数 EthIf_SetChanTxParams [SWS_EthIf_91042] 📄 PDF

Std_ReturnType EthIf_SetChanTxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_SetChanTxParamIdType* TxParamIds, const uint32* ParamValues, uint8 NumParams);

Set values related to the transmit direction of a transceiver's wireless channel. For example, this could be the bitrate of a channel.

函数 EthIf_GetChanRxParams [SWS_EthIf_91050] 📄 PDF

Std_ReturnType EthIf_GetChanRxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_GetChanRxParamIdType* ParamIds, thernetInterface uint32* ParamValues, uint8 NumParams); ⚠️

Read values related to the receive direction of the transceiver. For example, this could be a Channel Busy Ratio (CBR) or the average Channel Idle Time (CIT).

函数 EthIf_ProvideTxBuffer [SWS_EthIf_00067] 📄 PDF

BufReq_ReturnType EthIf_ProvideTxBuffer (uint8 CtrlIdx, Eth_FrameType FrameType, uint8 Priority, Eth_BufIdxType* BufIdxPtr, uint8* * BufPtr, uint16* LenBytePtr);

Provides access to a transmit buffer of the specified Ethernet controller.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3376c496dada 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步且可重入的函数 EthIf_ProvideTxBuffer(服务 ID 0x09)授予对通过 CtrlIdx 指定的 Ethernet 控制器的发送缓冲区的访问权,并通过头文件 EthIf.h 可用 [SWS_EthIf_00067]。

为了请求缓冲区,调用者传递控制器索引(CtrlIdx)、Ethernet 帧类型(FrameType)以及用于 VLAN 标签的 3 位 PCP 字段的优先级(Priority)[SWS_EthIf_00067]。通过输入和输出参数 LenBytePtr,调用者以字节为单位指定所需的缓冲区大小,并取回实际提供的长度 [SWS_EthIf_00067]。成功分配后,该函数通过 BufPtr 提供指向缓冲区的指针,并通过 BufIdxPtr 提供用于后续请求的缓冲区资源索引 [SWS_EthIf_00067]。

缓冲区请求的结果通过返回类型 BufReq_ReturnType 报告 [SWS_EthIf_00067]:

本使用说明由 AI 基于 AUTOSAR CP R20-11 规范生成。

函数 EthIf_Transmit [SWS_EthIf_00075] 📄 PDF

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

Triggers transmission of a previously filled transmit buffer

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c6420d48f21a 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_Transmit 触发先前已提供并填充的发送缓冲区通过以太网接口进行传输 [SWS_EthIf_00075]。

用法与参数

通过 EthIf.h 中声明的接口进行调用,并带有以下传入参数 [SWS_EthIf_00075]:

  • CtrlIdx:模块上下文中以太网控制器的索引 EthIf。
  • BufIdx:待传输缓冲区资源的索引。
  • FrameType:Ethernet 帧类型。
  • TxConfirmation:控制发送确认的激活。
  • LenByte:以字节为单位的数据长度。
  • PhysAddrPtr:网络字节序的目标物理地址(MAC 地址)。

返回值和并发性

作为返回值,函数在成功触发传输时返回 E_OK,若传输失败则返回 E_NOT_OK [SWS_EthIf_00075]。对于使用不同缓冲区和控制器索引(BufIdx 和 CtrlIdx)的调用,该函数是可重入的 [SWS_EthIf_00075]。

本使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetLinkState [SWS_EthIf_91109] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetLinkState (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_LinkStateType* LinkStatePtr);

Obtains the link state of the indexed switch port

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 195c682ee5fe 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EthIf_91109],函数 EthIf_SwitchPortGetLinkState 用于查询特定交换机端口的当前链路状态。传入 Ethernet Switch Driver 上下文中的交换机索引 SwitchIdx 以及所寻址交换机上的端口索引 SwitchPortIdx。查询结果通过指针 LinkStatePtr 提供,其取值为 ETHTRCV_LINK_STATE_DOWN(端口断开)或 ETHTRCV_LINK_STATE_ACTIVE(端口连接)。规范将执行行为标示为同步或异步;这可能取决于底层的交换机驱动程序或硬件连接方式。 问题 Q-dde6f9e8f1b8ba52 (未决)

作为返回值,函数提供 Std_ReturnType([SWS_EthIf_91109])。查询成功时返回 E_OK。如果确定链路状态失败,或者在交换机处于状态 ETHSWT_STATE_UNINIT 或 ETHSWT_STATE_INIT 时调用该函数,则返回 E_NOT_OK。

在并发性方面,该函数被指定为不可重入(Non Reentrant)([SWS_EthIf_91109]),因此必须排除在同一上下文中的并发调用。声明可通过带有服务 ID 0x4b 的头文件 EthIf.h 获取。

本文由 AI 生成;以所引用的 AUTOSAR 规范为准。

实现者指南即将推出(复杂度 I1)

函数 EthIf_TransceiverGetLinkState [SWS_EthIf_91110] 📄 PDF

Std_ReturnType EthIf_TransceiverGetLinkState (uint8 TrcvIdx, EthTrcv_LinkStateType* LinkStatePtr);

Obta ins the link state of the indexed transceiver

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9458911dc392 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

根据 [SWS_EthIf_91110],同步函数 EthIf_TransceiverGetLinkState 用于查询通过 TrcvIdx 寻址的 Ethernet 收发器的当前链路状态(Link State)。接口声明通过头文件 EthIf.h 提供 [SWS_EthIf_91110]。

调用时会传递以下参数[SWS_EthIf_91110]:

  • TrcvIdx(输入):Ethernet Transceiver Driver 上下文中的收发器索引。
  • LinkStatePtr(输出):指向用于存储所获取状态(类型为 EthTrcv_LinkStateType)的存储位置的指针。可能的结果值为用于连接状态收发器的 ETHTRCV_LINK_STATE_ACTIVE 以及用于断开状态收发器的 ETHTRCV_LINK_STATE_DOWN。

作为返回值,函数提供类型为 Std_ReturnType 的状态代码:E_OK 表示执行成功,而 E_NOT_OK 则表明收发器无法初始化 [SWS_EthIf_91110]。

错误处理与边界条件

如果查询失败,具有服务 ID 0x4c 的服务将提供返回值 E_NOT_OK [SWS_EthIf_91110]。函数规范中未列出具体的 DET 或 DEM 错误消息。

并发性

该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_91110]。Interpretation:由于缺乏重入性,从多个线程或任务上下文并发调用应当是不允许的,必要时需要由调用方进行同步。 问题 Q-0459aa9b4c187439 (未决)

本使用说明基于规范 SWS_EthIf_91110 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetBaudRate [SWS_EthIf_91111] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetBaudRate (thernetInterface uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_BaudRateType* BaudRatePtr); ⚠️

Obtains the baud rate of the indexed switch port

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 420db0a0bb52 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EthIf_91111],函数 EthIf_SwitchPortGetBaudRate 用于查询特定 Ethernet 交换机端口的当前传输速率。调用时会传入交换机索引(SwitchIdx)以及所寻址交换机上的端口索引(SwitchPortIdx)。查询结果通过类型为 EthTrcv_BaudRateType* 的指针 BaudRatePtr 提供,该指针可表示如 ETHTRCV_BAUD_RATE_10MBIT、ETHTRCV_BAUD_RATE_100MBIT、ETHTRCV_BAUD_RATE_1000MBIT 或 ETHTRCV_BAUD_RATE_2500MBIT 的速率 [SWS_EthIf_91111]。

在错误行为方面,成功获取波特率时函数返回 E_OK。返回值 E_NOT_OK 表示无法读取指定交换机端口的波特率,或者交换机驱动程序处于状态 ETHSWT_STATE_UNINIT 或 ETHSWT_STATE_INIT [SWS_EthIf_91111]。

规范将该函数标示为不可重入(Non Reentrant)以及同步/异步 [SWS_EthIf_91111]。同步或异步行为可能取决于底层 Ethernet 交换机驱动程序的连接和实现。 问题 Q-1f4d760ff944df9d (未决)由于缺乏重入性,调用方必须确保避免并行调用该接口。

本使用说明自动生成,基于 AUTOSAR 规范 R20-11。

实现者指南即将推出(复杂度 I1)

函数 EthIf_TransceiverGetBaudRate [SWS_EthIf_91112] 📄 PDF

Std_ReturnType EthIf_TransceiverGetBaudRate (uint8 TrcvIdx, EthTrcv_BaudRateType* BaudRatePtr);

Obtains the baud rate of the indexed transceiver

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 792ee7d557d1 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

具有服务 ID 0x4e 的同步函数 EthIf_TransceiverGetBaudRate 用于读取带索引的 Ethernet 收发器的当前传输速率 [SWS_EthIf_91112]。它是模块 EthIf 的组成部分,并通过头文件 EthIf.h 提供 [SWS_EthIf_91112]。

类型为 uint8 的输入参数 TrcvIdx 用于在 Ethernet 收发器驱动程序的上下文中标识收发器 [SWS_EthIf_91112]。不存在输入输出参数 [SWS_EthIf_91112]。查询结果通过输出参数 BaudRatePtr 返回 [SWS_EthIf_91112]。类型 Eth_Trcv_BaudRateType 的有效值为 ETHTRCV_BAUD_RATE_10MBIT(10 MBit/s)、ETHTRCV_BAUD_RATE_100MBIT(100 MBit/s)、ETHTRCV_BAUD_RATE_1000MBIT(1000 MBit/s)以及 ETHTRCV_BAUD_RATE_2500MBIT(2500 MBit/s)[SWS_EthIf_91112]。

该函数返回一个类型为 Std_ReturnType 的状态:调用成功时传递 E_OK [SWS_EthIf_91112]。如果收发器无法初始化,则服务失败并报告 E_NOT_OK [SWS_EthIf_91112]。

在调用上下文和并发性方面,EthIf_TransceiverGetBaudRate 被定义为同步且不可重入(Non Reentrant)的接口 [SWS_EthIf_91112]。调用层必须确保避免针对此服务的竞争性调用,或在调用方级别进行串行化 [SWS_EthIf_91112]。

此文本由 AI 基于 AUTOSAR CP R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetDuplexMode [SWS_EthIf_91113] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetDuplexMode (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_DuplexModeType* DuplexModePtr);

Obtains the duplex mode of the indexed switch port

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f64160e278b6 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchPortGetDuplexMode 用于查询 Ethernet 交换机上带索引端口的当前双工模式 [SWS_EthIf_91113]。它将调用转发给通过 SwitchIdx 分配的 Ethernet 交换机驱动程序的函数 EthSwt_GetDuplexMode [SWS_EthIf_00428]。

参数与接口

  • SwitchIdx:驱动程序上下文中的 Ethernet 交换机索引 [SWS_EthIf_91113]。
  • SwitchPortIdx:所寻址交换机上相关端口的索引 [SWS_EthIf_91113]。
  • DuplexModePtr:类型为 EthTrcv_DuplexModeType* 的输出指针,用于接收所确定的模式,即 ETHTRCV_DUPLEX_MODE_HALF(半双工)或 ETHTRCV_DUPLEXMODE_FULL(全双工)[SWS_EthIf_91113]。

执行与错误处理

返回值 E_OK 表示查询成功 [SWS_EthIf_91113]。如果无法确定端口的双工模式,或者驱动程序处于状态 ETHSWT_STATE_UNINIT 或 ETHSWT_STATE_INIT,则函数返回 E_NOT_OK [SWS_EthIf_91113]。

该接口不可重入(Non Reentrant),并在规范中被声明为同步/异步 [SWS_EthIf_91113]。Interpretation:实际的同步或异步工作方式可能取决于所连接交换机驱动程序的特性。 问题 Q-339413722431978f (未决)

本使用说明基于规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_TransceiverGetDuplexMode [SWS_EthIf_91114] 📄 PDF

Std_ReturnType EthIf_TransceiverGetDuplexMode (uint8 TrcvIdx, EthTrcv_DuplexModeType* DuplexModePtr);

Obtains the duplex mode of the indexed tra nsceiver

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 003ecb88f2c1 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EthIf_91114],同步函数 EthIf_TransceiverGetDuplexMode 确定带索引的 Ethernet 收发器的当前双工模式。

用法与参数

调用以同步方式进行,并被指定为不可重入(Non Reentrant)[SWS_EthIf_91114]:

  • TrcvIdx:作为输入参数传入 Ethernet 收发器驱动程序上下文中的收发器索引 [SWS_EthIf_91114]。
  • DuplexModePtr:用作指向类型 EthTrcv_DuplexModeType 的输出指针,以接收结果。可能的值为 ETHTRCV_DUPLEX_MODE_HALF(半双工)或 ETHTRCV_DUPLEX_MODE_FULL(全双工)[SWS_EthIf_91114]。

返回值与错误处理

作为返回值,函数提供一个 Std_ReturnType [SWS_EthIf_91114]:

  • E_OK:双工模式已成功查询,并通过 DuplexModePtr 提供 [SWS_EthIf_91114]。
  • E_NOT_OK:确定失败,根据规范,例如当收发器无法初始化时 [SWS_EthIf_91114]。

限制与并发性

由于接口不可重入,在没有外部同步的情况下,不得针对相同或不同的收发器实例进行并行调用。声明可通过头文件 EthIf.h 获取 [SWS_EthIf_91114]。

本使用说明基于 AUTOSAR R20-11 规范数据自动创建。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetCounterValues [SWS_EthIf_91115] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetCounterValues (uint8 SwitchIdx, thernetInterface uint8 SwitchPortIdx, Eth_CounterType* CounterPtr); ⚠️

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

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 7e473c4bc2cc 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_SwitchPortGetCounterValues 用于根据 [SWS_EthIf_91115] 读取特定 Ethernet 交换机端口的计数器值(Drop Counter)。通过头文件 EthIf.h 提供,该函数接收交换机索引 SwitchIdx 以及端口索引 SwitchPortIdx,并通过指针 CounterPtr 写回计数器值([SWS_EthIf_91115])。

工作原理和转发

根据 [SWS_EthIf_00432],EthIf_SwitchPortGetCounterValues 将请求直接转发给各 Ethernet 交换机驱动程序的函数 EthSwt_GetCounterValues。返回的计数器值参考 IETF RFC 1757、RFC 1643 和 RFC 2233 标准,其中精确的语义分配给结构 Eth_CounterType([SWS_EthIf_91115])。

返回值与错误处理

作为返回值,函数返回 Std_ReturnType([SWS_EthIf_91115]):

并发性与限制

该函数被指定为不可重入(Non Reentrant)([SWS_EthIf_91115])。因此,必须在调用者层面对并发调用进行同步。解释:调用者可能还负责为 CounterPtr 提供有效且足够大的存储区域,因为规范中未提及内部缓冲区分配。 问题 Q-140661eaa9693cce (未决)

本使用说明是基于 AUTOSAR 规范 R20-11 自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetRxStats [SWS_EthIf_91116] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetRxStats (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_RxStatsType* RxStatsPtr);

Returns a list of statistic counters defined with E th_ Rx Tats Type. The majority of these Counters are derived from the IETF RFC2819.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f181e127df41 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_SwitchPortGetRxStats([SWS_EthIf_91116])用于查询 Ethernet 交换机端口的接收统计计数器。它可通过头文件 EthIf.h 获取,并由服务 ID 0x52 标识([SWS_EthIf_91116])。

调用需要以下参数([SWS_EthIf_91116]):

  • SwitchIdx:Ethernet交换机驱动程序上下文中的Ethernet交换机索引。
  • SwitchPortIdx:所寻址交换机上的端口索引。
  • RxStatsPtr:指向类型为 Eth_RxStatsType 的结构的指针,计数器值将写入该结构中。这些值大部分派生自 IETF RFC 2819(远程网络监控管理信息库,Remote Network Monitoring Management Information Base)。

返回值与错误处理

该函数提供一个 Std_ReturnType([SWS_EthIf_91116])作为结果:

  • E_OK:统计数据已成功读取。
  • E_NOT_OK:无法获取计数器值([SWS_EthIf_91116])。针对此调用未指定具体的 DET 或 DEM 错误消息。

并发性与限制

该函数被归类为不可重入(Non Reentrant)([SWS_EthIf_91116])。由于同步性被标示为“Synchronous /Asynchronous”,实际的阻塞行为可能取决于底层 Ethernet 交换机驱动程序的实现([SWS_EthIf_91116])。 问题 Q-d1e839075bf42e7f (未决)调用方必须避免对同一接口进行并行访问。

本文由 AI 基于 AUTOSAR R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetTxStats [SWS_EthIf_91117] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetTxStats (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxStatsType* TxStatsPtr);

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.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 55ba1781a74a 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchPortGetTxStats 用于根据 IETF RFC1213 读取 Ethernet 交换机特定端口的传输统计信息 [SWS_EthIf_91117]。它可通过具有服务 ID 0x53 的头文件 EthIf.h 获取 [SWS_EthIf_91117]。

用法与参数

调用时,交换机索引(SwitchIdx)和所寻址交换机上的端口索引(SwitchPortIdx)作为输入参数传入 [SWS_EthIf_91117]。所获取的计数器读数通过类型为 Eth_TxStatsType* 的指针 TxStatsPtr 提供 [SWS_EthIf_91117]。如果计数器不可用或不受支持,则该计数器的最大可能值表示无效值 [SWS_EthIf_91117]。

返回值与错误处理

该函数返回类型为 Std_ReturnType 的状态 [SWS_EthIf_91117]:

源文献中未指明具体的错误代码或发往 DET 或 DEM 的消息,因此错误情况必须主要通过返回值 E_NOT_OK 进行捕获 [SWS_EthIf_91117]。

并发性与限制

根据规范,EthIf_SwitchPortGetTxStats 被定义为异步(Asynchronous)且不可重入(Non Reentrant)[SWS_EthIf_91117]。由于缺乏重入性,在没有上层同步的情况下不得进行并发调用 [SWS_EthIf_91117]。由于该服务被声明为异步,所传入的缓冲区 TxStatsPtr 可能必须保持有效直至操作完全完成(Interpretation:异步查询时的缓冲区稳定性)[SWS_EthIf_91117]。 问题 Q-8a14618d6990206b (未决)

此使用说明基于规范 SWS_EthIf_91117 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetTxErrorCounterValues [SWS_EthIf_91118] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetTxErrorCounterValues (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxErrorCounterValuesType* TxStatsPtr);

Returns the list of Transmission Error Counters out of IETF RFC1213 and RFC16 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.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6f5b693504bb 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

通过 EthIf.h 提供的同步函数 EthIf_SwitchPortGetTxErrorCounterValues(服务 ID 0x54)读取 Ethernet 交换机某一端口的传输错误计数器列表 [SWS_EthIf_91118]。这些计数器符合 IETF RFC1213 以及 RFC1643 的定义,并通过输出参数 TxStatsPtr 中的类型 Eth_TxErrorCounterValuesType 提供 [SWS_EthIf_91118]。

调用时,SwitchIdx 寻址驱动程序上下文中的交换机,SwitchPortIdx 寻址交换机上的具体端口 [SWS_EthIf_91118]。该函数在成功确定值时返回 E_OK,如果无法获取传输统计信息,则返回 E_NOTOK [SWS_EthIf_91118]。达到最大可能值的计数器值明确表示无效或不可用的计数器 [SWS_EthIf_91118]。

作为执行限制规定,该函数不可重入(Non Reentrant)[SWS_EthIf_91118]。在体系结构联合中,EthIf_SwitchPortGetTxErrorCounterValues 将调用直接转发给相应 Ethernet 交换机驱动程序的函数 EthSwt_GetTxErrorCounterValues [SWS_EthIf_00438]。

此文本由 AI 基于规范要求生成。

函数 EthIf_SwitchPortGetMacLearningMode [SWS_EthIf_91119] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetMacLearningMode (thernetInterface uint8 SwitchIdx, uint8 SwitchPortIdx, EthSwt_MacLearningType* MacLearningModePtr); ⚠️

Returns the MAC learning mode, i.e. 1.) HW learning enabled, 2.) Hardware l earning disabled, 3.) Software learning enabled. Note: This feature is hardware dependent, i.e. the switch hardware needs to support the different learning modes

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6e598d708685 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchPortGetMacLearningMode 查询特定交换机端口当前的 MAC 学习模式([SWS_EthIf_91119])。可获取的模式包括启用硬件学习、禁用硬件学习以及启用软件学习([SWS_EthIf_91119])。此函数的可用性取决于硬件,因为相应的交换机硬件必须支持不同的学习模式([SWS_EthIf_91119])。

调用上下文与参数

该接口通过头文件 EthIf.h 提供,且服务 ID 为 0x55([SWS_EthIf_91119])。调用时须传递以下参数:

  • SwitchIdx(in):以太网交换机驱动上下文中交换机的索引([SWS_EthIf_91119])。
  • SwitchPortIdx(in):寻址交换机上的端口索引([SWS_EthIf_91119])。
  • MacLearningModePtr(out):指向类型为 EthSwt_MacLearningType 的存储位置的指针,所获取的模式将存放在该位置([SWS_EthIf_91119])。

同步、并发与返回值

执行被指定为同步/异步,且为不可重入(Non Reentrant)([SWS_EthIf_91119])。返回值使用 Std_ReturnType,具有以下状态:

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetSwitchIdentifier [SWS_EthIf_91121] 📄 PDF

Std_ReturnType EthIf_GetSwitchIdentifier (uint8 SwitchIdx, uint32* OrgUniqueIdPtr);

Obtain the Organizationally Unique Identifier that is given by the IEEE of the indexed Ethernet switch. This function shall provide the OUI of Ethernet switch. The OUI has a size of 24 bit. If a ethernet switch can provide the OUI the 8 most significant bits of the OUI shall be set to 0x00xxxxxx. If a Ethernet switch can not provide the OUI the 8 most significant bits of the OUI shall be set to 0x FFxxxxxx. Availa ble via Eth If.h

函数 EthIf_WritePortMirrorConfiguration [SWS_EthIf_91122] 📄 PDF

Std_ReturnType EthIf_WritePortMirrorConfiguration (uint8 MirroredSwitchIdx, const EthSwt_PortMirrorCfgType* PortMirrorConfigurationPtr);

Service EthIf_WritePortMirrorConfiguration.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: b40bb6db2341 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步接口 EthIf_WritePortMirrorConfiguration 用于将端口镜像配置保存至以太网交换机驱动 [SWS_EthIf_91122] 内部的影子缓冲区中。

调用时传递以下输入参数 [SWS_EthIf_91122]:

  • MirroredSwitchIdx:以太网交换机驱动上下文中相关交换机的索引,待镜像的交换机端口位于该交换机上 [SWS_EthIf_91122]。
  • PortMirrorConfigurationPtr:指向结构体 EthSwt_PortMirrorCfgType 配置数据的指针 [SWS_EthIf_91122]。

类型为 Std_ReturnType 的返回值指示执行状态 [SWS_EthIf_91122]:

  • E_OK:已成功为索引端口写入端口镜像配置 [SWS_EthIf_91122]。
  • E_NOT_OK:无法写入配置,例如由于索引交换机不可用 [SWS_EthIf_91122]。
  • ETHSWT_PORT_MIRRORING_CONFIGURATION_NOT_SUPPORTED:交换机硬件或以太网交换机驱动不支持端口镜像 [SWS_EthIf_91122]。

该函数被指定为不可重入(Non Reentrant),并通过头文件 EthIf.h 提供 [SWS_EthIf_91122]。解释:调用方可能必须通过上层机制协调并发访问,因为未指定内部同步保护机制。 问题 Q-c731aedd871251a4 (未决)

此文本由 AI 生成,且完全基于 SWS_EthIf_91122 的规范要求。

实现者指南即将推出(复杂度 I1)

函数 EthIf_ReadPortMirrorConfiguration [SWS_EthIf_91123] 📄 PDF

Std_ReturnType EthIf_ReadPortMirrorConfiguration (uint8 MirroredSwitchIdx, EthSwt_PortMirrorCfgType* PortMirrorConfigurationPtr);

Obtain the port mirror configuration of the given Ethernet switch.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ccaf63f78cda 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_ReadPortMirrorConfiguration 用于查询特定以太网交换机的端口镜像配置 [SWS_EthIf_91123]。它在头文件 EthIf.h 中声明,且服务 ID 为 0x59。执行行为被指定为异步(Asynchronous),其中直接调用返回类型为 Std_ReturnType 的状态值 [SWS_EthIf_91123]。

参数与返回值

  • MirroredSwitchIdx(in):以太网交换机驱动上下文中以太网交换机的索引,待镜像的交换机端口位于该交换机上 [SWS_EthIf_91123]。
  • PortMirrorConfigurationPtr(out):指向用于存放所读取配置的存储区域的指针 [SWS_EthIf_91123]。
  • 返回值:E_OK 指示配置读取成功。出错时返回 E_NOT_OK,例如当索引以太网交换机不可用时 [SWS_EthIf_91123]。

协同交互与并发性

为了执行,EthIf_ReadPortMirrorConfiguration 将调用直接转发至相应以太网交换机驱动的函数 EthSwt_ReadPortMirrorConfiguration [SWS_EthIf_00448]。该函数被定义为不可重入(Non Reentrant)[SWS_EthIf_91123];因此调用方必须避免对同一接口进行并行调用。

本使用说明基于 AUTOSAR Classic Platform R20-11 规范。

实现者指南即将推出(复杂度 I1)

函数 EthIf_DeletePortMirrorConfiguration [SWS_EthIf_91124] 📄 PDF

Std_ReturnType EthIf_DeletePortMirrorConfiguration (uint8 MirroredSwitchIdx);

Delete the stored port mirror configuration of the given Mirrored Switch Idx. If no port mirror configuration was found for the given Mirrored Switch Idx, the return value shall be E_ OK.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 61d650b885a8 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_DeletePortMirrorConfiguration 用于删除特定交换机([SWS_EthIf_91124])已保存的端口镜像配置。调用方通过参数 Mirrored Switch Idx 传递该交换机在 Ethernet Switch Driver([SWS_EthIf_91124])上下文中的索引。该接口具有服务 ID 0x5a,并通过头文件 EthIf.h 提供([SWS_EthIf_91124])。

类型为 Std_ReturnType 的返回值告知清除结果([SWS_EthIf_91124]):

  • E_OK:端口镜像配置已成功清除([SWS_EthIf_91124])。如果未找到指定交换机索引的已保存配置,根据定义该函数同样返回 E_OK([SWS_EthIf_91124])。
  • E_NOT_OK:清除配置失败([SWS_EthIf_91124])。例如,在调用时端口镜像仍处于激活状态时即为该情况([SWS_EthIf_91124])。

关于并发性,该函数对于不同的交换机索引是可重入的(Mirrored Switch Idx),但在针对同一索引进行多次调用时是不可重入的([SWS_EthIf_91124])。由于活动的镜像被明确列为 E_NOT_OK 的错误原因,因此在清除配置之前可能需要停用端口镜像([SWS_EthIf_91124])。 问题 Q-b9e5665de687dbba (未决)

本使用说明是基于 AUTOSAR R20-11 的规范自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetPortMirrorState [SWS_EthIf_91125] 📄 PDF

Std_ReturnType EthIf_GetPortMirrorState (uint8 SwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType* PortMirrorStatePtr);

Obtain the current status of the port mirroring for the indexed Ethernet switch port

函数 EthIf_SetPortMirrorState [SWS_EthIf_91126] 📄 PDF

Std_ReturnType EthIf_SetPortMirrorState (uint8 MirroredSwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType PortMirrorState);

Request to set the given port mirroring state of the port mirror configuration for the given Ethernet switch.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f443f14f320e 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_SetPortMirrorState 用于为指定的以太网交换机设置所需的端口镜像配置状态([SWS_EthIf_91126])。它可通过头文件 EthIf.h 使用([SWS_EthIf_91126])。

调用时该函数需要三个参数([SWS_EthIf_91126]):

  • MirroredSwitchIdx:Ethernet Switch Driver上下文中的Ethernet交换机索引,要激活或停用的端口镜像配置位于该交换机上。
  • PortIdx:所寻址Ethernet交换机上的端口索引。
  • PortMirrorState:要请求的端口镜像状态,为 PORT_MIRRORING_ENABLED 或 PORT_MIRRORING_DISABLED。

类型为 Std_ReturnType 的返回值指示请求的结果([SWS_EthIf_91126]):

  • E_OK:已成功为指定交换机端口设置所请求的状态。
  • E_NOT_OK:设置失败,例如当寻址的交换机不可用或不存在端口镜像配置时。

执行是同步进行的,并被指定为不可重入(Non Reentrant)([SWS_EthIf_91126])。在分层结构中,Ethernet Interface 负责转发:根据 [SWS_EthIf_00454],EthIf_SetPortMirrorState 将调用直接转发给负责的 Ethernet Switch Driver 的函数 EthSwt_SetPortMirrorState。

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPortTestMode [SWS_EthIf_91127] 📄 PDF

Std_ReturnType EthIf_SetPortTestMode (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTestModeType Mode);

Activates a given test mode of the indexed Ethernet switch port.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3e1f0657b21d 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SetPortTestMode 用于激活以太网交换机索引端口上的预定测试模式 [SWS_EthIf_91127]。该同步服务通过头文件 EthIf.h 提供,服务 ID 为 0x5d [SWS_EthIf_91127]。

参数与返回值

为了配置测试模式,该接口需要三个输入参数,同时不存在输入/输出参数或纯输出参数 [SWS_EthIf_91127]:

  • SwitchIdx(uint8):相应以太网交换机驱动上下文中交换机的索引 [SWS_EthIf_91127]。
  • PortIdx(uint8):寻址以太网交换机上的端口索引 [SWS_EthIf_91127]。
  • Mode(EthTrcv_PhyTestModeType):要在该交换机端口上激活的测试模式 [SWS_EthIf_91127]。

类型为 Std_ReturnType 的返回值指示操作成功与否 [SWS_EthIf_91127]:

  • E_OK:已成功为索引以太网交换机端口设置端口测试模式 [SWS_EthIf_91127]。
  • E_NOT_OK:设置端口测试模式不成功,例如当寻址的以太网交换机端口不可用时 [SWS_EthIf_91127]。

并发性与交互

该函数被指定为不可重入(Non Reentrant)并以同步方式工作 [SWS_EthIf_91127]。调用时,EthIf_SetPortTestMode 将请求直接转发给相应以太网交换机驱动的下层函数 EthSwt_SetPortTestMode [SWS_EthIf_00456]。

本使用说明是基于 AUTOSAR R20-11 的规范自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPortLoopbackMode [SWS_EthIf_91128] 📄 PDF

Std_ReturnType EthIf_SetPortLoopbackMode (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyLoopbackModeType Mode);

Activates a given test loop - back mode of the indexed Ethernet switch port.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 618d1a1fe688 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

函数 EthIf_SetPortLoopbackMode 用于为以太网交换机的索引端口激活预定的测试环回模式 [SWS_EthIf_91128]。声明通过头文件 EthIf.h 提供 [SWS_EthIf_91128]。调用时须传递以下输入参数:

  • SwitchIdx:Ethernet交换机驱动程序上下文内的Ethernet交换机索引[SWS_EthIf_91128]。
  • PortIdx:此前寻址的交换机上相关端口的索引 [SWS_EthIf_91128]。
  • Mode:要激活的类型为 EthTrcv_PhyLoopbackModeType 的环回模式 [SWS_EthIf_91128]。

交互与转发

该函数不会在硬件层面上独立执行配置。相反,EthIf_SetPortLoopbackMode 将调用直接转发给关联以太网交换机驱动的函数 EthSwt_SetPortLoopbackMode [SWS_EthIf_00458]。

错误处理与返回值

返回值类型为 Std_ReturnType [SWS_EthIf_91128]:

  • E_OK:已成功为以太网交换机的索引端口激活环回模式 [SWS_EthIf_91128]。
  • E_NOT_OK:激活失败,例如当索引以太网交换机端口不可用时 [SWS_EthIf_91128]。

规范中未针对此服务列出具体的 DET 或 DEM 错误代码。

并发性与限制

执行完全同步进行,且该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_91128]。调用方必须防止并行调用。解释:由于涉及测试模式的切换,因此调用通常在任务层面的初始化、测试或诊断序列中进行。 问题 Q-cb4575c4a1d9c48b (未决)

本文本由 AI 基于规范生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SetPortTxMode [SWS_EthIf_91129] 📄 PDF

Std_ReturnType EthIf_SetPortTxMode (thernetInterface uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTxModeType Mode); ⚠️

Activates a given transmission mode of the indexed Ethernet switch port.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: b8b46f4cfbae 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EthIf_SetPortTxMode 为索引以太网交换机端口激活预定的传输模式 [SWS_EthIf_91129]。它可通过头文件 EthIf.h 使用,且服务 ID 为 0x5f [SWS_EthIf_91129]。

使用

调用通过两个索引寻址目标端口并传递所需模式 [SWS_EthIf_91129]:

  • SwitchIdx:以太网交换机驱动上下文中交换机的索引。
  • PortIdx:所寻址交换机上的端口索引。
  • Mode:类型为 EthTrcv_PhyTxModeType 的待激活传输模式。

该函数提供以下返回值Std_ReturnType [SWS_EthIf_91129]:

  • E_OK:已成功为索引交换机端口激活传输模式。
  • E_NOT_OK:激活失败,例如当索引交换机端口不可用时。

并发性与限制

该接口被指定为不可重入(Non Reentrant)[SWS_EthIf_91129]。因此,调用实体必须确保不会发生并发调用。函数定义中未列出特定的 DET 或 DEM 错误消息;根据规范,错误行为仅限于返回 E_NOT_OK [SWS_EthIf_91129]。

此使用说明由 AI 基于 AUTOSAR Classic Release R20-11 的规范生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_GetPortCableDiagnosticsResult [SWS_EthIf_91130] 📄 PDF

Std_ReturnType EthIf_GetPortCableDiagnosticsResult (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_CableDiagResultType* ResultPtr);

Retrieves the cable diagnostics result of the indexed Ethernet switch port respectively the referenced Ethernet Transceiver Driver.

函数 EthIf_RunPortCableDiagnostic [SWS_EthIf_91131] 📄 PDF

Std_ReturnType EthIf_RunPortCableDiagnostic (uint8 SwitchIdx, uint8 PortIdx);

Trigger the cable diagnostics of the given Ethernet Switch port (Port Idx) by calling Eth Trcv_ Run Cable Diagnostic of the referenced Ethernet transceiver.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 71c8b4be21c9 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

异步接口 EthIf_RunPortCableDiagnostic 触发以太网交换机选定端口的电缆诊断 [SWS_EthIf_91131]。调用时传递参数 SwitchIdx(以太网交换机驱动上下文中交换机的索引)和 PortIdx(交换机上寻址端口的索引)。一旦电缆诊断触发被接受,函数即返回 E_OK;若触发被拒绝,则返回 E_NOT_OK [SWS_EthIf_91131]。

交互与前置条件

在执行 EthIf_RunPortCableDiagnostic 时,EthIf 有义务确保相应的 EthIfController 处于运行状态 ETH_MODE_ACTIVE [SWS_EthIf_00464]。在此条件下,Ethernet Interface 将调用转发给关联交换机驱动程序的函数 EthSwt_RunPortCableDiagnostic [SWS_EthIf_00464]。

并发性与限制

对于 SwitchIdx 和 PortIdx 相互不同的值,该函数是可重入的 [SWS_EthIf_91131]。然而,对于相同的交换机和端口索引对,调用被指定为不可重入,因此必须避免在同一端口上并行执行。

本使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_RunCableDiagnostic [SWS_EthIf_91132] 📄 PDF

Std_ReturnType EthIf_RunCableDiagnostic (uint8 TrcvIdx);

Trigger the cable diagnostics for the given Ethernet transceiver.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 30a5efdd1b22 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

函数 EthIf_RunCableDiagnostic 触发指定以太网收发器的电缆诊断 [SWS_EthIf_91132]。它通过头文件 EthIf.h 提供,并在服务 ID 0x62 下管理 [SWS_EthIf_91132]。传递参数为 TrcvIdx,其映射了以太网收发器驱动上下文中目标收发器的索引 [SWS_EthIf_91132]。

执行以异步方式进行 [SWS_EthIf_91132]。类型为 Std_ReturnType 的返回值指示触发是否被接受:

错误处理

如果电缆诊断被拒绝,函数将立即返回 E_NOT_OK [SWS_EthIf_91132]。本规范中未为此函数定义具体的开发或生产错误(DET/DEM)。

并发性与限制

在并发性方面,EthIf_RunCableDiagnostic 对于具有不同索引的调用是可重入的(TrcvIdx),但对于同一收发器索引则是不可重入的 [SWS_EthIf_91132]。调用方必须防止在同一收发器上同时发生诊断请求。解释:由于该函数完全以异步方式工作且不返回结果数据,因此诊断结果的提供可能通过单独的机制进行。 问题 Q-c65c009cd2e00dea (未决)

此文本由 AI 基于规范 SWS_EthIf_91132 生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchGetCfgDataRaw [SWS_EthIf_91133] 📄 PDF

Std_ReturnType EthIf_SwitchGetCfgDataRaw (uint8 SwitchIdx, uint32 Offset, uint16 Length, uint8* BufferPtr);

Retrieves the data in memory of the indexed Ethernet switch in variable length

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: be1ed9572145 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

接口函数 EthIf_SwitchGetCfgDataRaw 用于读取索引以太网交换机变长的配置或内存数据 [SWS_EthIf_91133]。在分层模型中,该模块不独立处理调用,而是将其直接转发给主管以太网交换机驱动的函数 EthSwt_GetCfgDataRaw [SWS_EthIf_00468]。该函数在头文件 EthIf.h 中声明,且服务 ID 为 0x63 [SWS_EthIf_91133]。

调用与参数

调用以异步方式进行,且仅启动读取操作 [SWS_EthIf_91133]。该函数所需的参数包括:

  • SwitchIdx:以太网交换机驱动上下文中以太网交换机的索引 [SWS_EthIf_91133],
  • Offset:以太网交换机内存中读取过程开始的起始偏移量 [SWS_EthIf_91133],
  • Length:要读取和复制的数据字节数 [SWS_EthIf_91133],
  • BufferPtr:指向目标存储位置的指针,数据将被复制到该位置 [SWS_EthIf_91133]。

当成功触发读取过程时,该函数返回 E_OK 作为返回值 [SWS_EthIf_91133]。如果无法触发该过程——例如当寻址的交换机不可用时——将报告 E_NOT_OK [SWS_EthIf_91133]。

并发性

该函数被定义为不可重入(Non Reentrant)[SWS_EthIf_91133]。因此,调用方必须确保按顺序进行调用。解释:由于异步特性,在从 E_OK 返回时,缓冲区内容可能尚未最终填满,而是由驱动延迟提供。 问题 Q-0abda93fb8830dd4 (未决)

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchGetCfgDataInfo [SWS_EthIf_91134] 📄 PDF

Std_ReturnType EthIf_SwitchGetCfgDataInfo (uint8 SwitchIdx, uint32* DataSizePtr, uint32* DataAdressPtr);

Retrieves the total size of data and the memory start address of the indexed Ethernet Switch.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: b29ad2e3bc3d 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchGetCfgDataInfo 获取索引以太网交换机配置数据的总大小以及配置寄存器的起始地址 [SWS_EthIf_91134]。该接口在头文件 EthIf.h 中声明,并在服务 ID 0x64 下管理 [SWS_EthIf_91134]。

该函数接收以下参数 [SWS_EthIf_91134]:

  • SwitchIdx(in):以太网交换机驱动上下文中以太网交换机的索引。
  • DataSizePtr(out):指向用于复制配置数据总大小的存储位置的指针。
  • DataAdressPtr(out):指向用于复制配置寄存器起始地址的存储位置的指针。

作为返回值,如果成功获取数据,该函数返回 E_OK;如果操作失败(例如由于索引的交换机不可用),则返回 E_NOT_OK [SWS_EthIf_91134]。在当前规范范围内,未针对该服务定义特定的 DET 或 DEM 错误代码。

关于调用上下文,该函数被规范为可重入的,且形式上为异步的 [SWS_EthIf_91134]。由于未规范回调机制,返回 E_OK 时数据的提供应当是立即可用的(Interpretation:异步分类推测表明存在内部驱动访问)。 问题 Q-bf49882a16548ea4 (未决)

本段文本由人工智能生成,并基于 AUTOSAR 标准的规范。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortGetMaxFIFOBufferFillLevel [SWS_EthIf_91135] 📄 PDF

Std_ReturnType EthIf_SwitchPortGetMaxFIFOBufferFillLevel (uint8 SwitchPortIdx, uint8 PortIdx, uint8 SwitchPortEgressFifoIdx, uint32* SwitchPortEgressFifoBufferLevelPtr);

Service EthIf_SwitchPortGetMaxFIFOBufferFillLevel.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c2027ddc769c 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用与调用

函数 EthIf_SwitchPortGetMaxFIFOBufferFillLevel 用于确定以太网交换机特定出口端口自上次读访问以来分配的最大 FIFO 缓冲区内存(以字节为单位)[SWS_EthIf_91135]。例如,调用可由复杂设备驱动程序(CDD)发起 [SWS_EthIf_91135]。为了进行寻址,会传递交换机索引(SwitchPortIdx)、端口索引(PortIdx)和 FIFO 索引(SwitchPortEgressFifoIdx)。确定的填充级别将写入 SwitchPortEgressFifoBufferLevelPtr 所指向的存储区 [SWS_EthIf_91135]。

并发性与执行

该函数具有异步执行语义 [SWS_EthIf_91135]。它针对不同的交换机和端口索引是可重入的,但对于相同的 SwitchPortIdx 和 PortIdx 组合不得并发调用 [SWS_EthIf_91135]。由于具有异步语义且同时传递指针,被引用的结果存储区在操作完成之前应当必须保持有效。 问题 Q-c941ffec278a86cd (未决)

错误处理与驱动交互

成功获取时,函数返回 E_OK,否则返回 E_NOT_OK [SWS_EthIf_91135]。如果交换机硬件不支持基于端口确定最大 FIFO 缓冲区填充级别,则目标地址 SwitchPortEgressFifoBufferLevelPtr 处的值将被设置为 0xFFFFFFFF [SWS_EthIf_91135]。该模块将调用转发至关联以太网交换机驱动的驱动函数 EthSwt_GetMaxFIFOBufferFillLevel 以便进一步执行 [SWS_EthIf_00472]。

本文本由 AI 基于规范生成。

函数 EthIf_TransceiverGetMacMethod [SWS_EthIf_91021] 📄 PDF

Std_ReturnType EthIf_TransceiverGetMacMethod (uint8* TrcvIdx, EthTrcv_MacMethodType* MacModePtr);

Obtains the media access mode of the transceiver. Tags: atp.Status=draft thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 4607d60f7e1b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_TransceiverGetMacMethod(服务 ID 0x66)用于同步查询 Ethernet 收发器所配置的介质访问控制方法 [SWS_EthIf_91021]。它可通过头文件 EthIf.h 获取,并使用以下接口参数:

  • TrcvIdx(in):Ethernet 收发器驱动程序上下文内的收发器索引 [SWS_EthIf_91021]。
  • MacModePtr(out):指向用于存储所获取访问方法的存储位置的指针,类型为 EthTrcv_MacMethodType [SWS_EthIf_91021]。有效的结果值为 ETHTRCV_MAC_TYPE_CSMA_CD(带冲突检测的载波侦听多路访问,Carrier-Sense Multiple Access mit Collision Detection)和 ETHTRCV_MAC_TYPE_PLCA(物理层冲突避免,Physical Layer Collision Avoidance)。

返回值与错误处理

作为返回值,该接口返回类型为 Std_ReturnType 的状态 [SWS_EthIf_91021]:

  • E_OK:已成功读取介质访问控制方法,并通过 MacModePtr 提供。
  • E_NOT_OK:对收发器的请求未被接受 [SWS_EthIf_91021]。规范中未针对此服务列出具体的 DET 或 DEM 错误代码。

并发性与边界条件

执行以同步方式进行,但该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_91021]。因此,调用方必须排除在同一驱动程序上下文内发生并发或中断性调用。此外需要注意的是,该服务在 Release R20-11 中的状态标示为 atp.Status=draft [SWS_EthIf_91021]。

本使用说明基于 EthIf_TransceiverGetMacMethod 的 AUTOSAR 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_RxIndication [SWS_EthIf_00085] 📄 PDF

void EthIf_RxIndication (uint8 CtrlIdx, Eth_FrameType FrameType, boolean IsBroadcast, const uint8* PhysAddrPtr, const Eth_DataType* DataPtr, uint16 LenByte);

Handles a received frame received by the indexed controller

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f4f8ac8a7932 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

同步函数 EthIf_RxIndication 处理通过索引指定的物理以太网控制器接收到的以太网帧 [SWS_EthIf_00085]。该服务没有返回值,并在以太网接口内部处理接收数据的转发 [SWS_EthIf_00085]。解释:一旦新的接收数据完整就绪,调用通常应由下层以太网驱动程序(Eth)发起。 问题 Q-c3d25d0b89e6cd7f (未决)

范围

为了进行进一步处理,该函数接收以下参数 [SWS_EthIf_00085]:

并发性与限制

该接口被声明为不可重入(Non Reentrant),并通过头文件 EthIf.h 在服务 ID 0x10 下提供 [SWS_EthIf_00085]。调用者必须确保不发生并发调用。对于该函数,规范范围内未指明特定的错误码、返回值或 DET/DEM 消息。

本段文本由系统自动生成。所有信息均完全基于当前 AUTOSAR 版本的规范数据。

函数 EthIf_TxConfirmation [SWS_EthIf_00091] 📄 PDF

void EthIf_TxConfirmation (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Std_ReturnType Result);

Confirms frame transmission by the indexed controller

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: da5fb02ebb8b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

同步函数 EthIf_TxConfirmation(服务 ID 0x11)确认由 CtrlIdx 引用的物理以太网控制器所进行的以太网帧传输 [SWS_EthIf_00091]。该函数没有返回值,可通过头文件 EthIf.h 获取 [SWS_EthIf_00091]。

输入参数定义如下 [SWS_EthIf_00091]:

  • CtrlIdx(uint8):以太网接口上下文中物理以太网控制器的索引。
  • BufIdx(Eth_BufIdxType):已传输缓冲区的索引。
  • Result(Std_ReturnType):传输结果;E_OK 表示发送过程成功,E_NOT_OK 表示传输错误。

与上层模块的交互

根据 [SWS_EthIf_00255],EthIf_TxConfirmation 通过其回调 <UL>_TxConfirmation 将接收到的传输结果 Result 转发给已配置的上层。

并发性与限制

该函数被指定为不可重入(Non Reentrant)[SWS_EthIf_00091]。因此必须避免并行调用。规范摘录中未规定特定的 DET 或 DEM 错误消息;错误仅通过值为 E_NOT_OK 的参数 Result 进行传递 [SWS_EthIf_00091]。

本段文本由 AI 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_CtrlModeIndication [SWS_EthIf_00231] 📄 PDF

void EthIf_CtrlModeIndication (uint8 CtrlIdx, thernetInterface Eth_ModeType CtrlMode); ⚠️

Called asynchronously when mode has been read out. Triggered by previous Eth_ Set Controller Mode call. Can directly be called within the trigger functions.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 01a40e36c664 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EthIf_00231],一旦以太网控制器的运行模式被成功读取,通知函数 EthIf_CtrlModeIndication 就会被调用。触发是在先前调用 Eth_SetControllerMode 之后异步发生的,其中调用可以直接在各触发函数内部进行。函数本身具有同步执行语义,且不返回任何值([SWS_EthIf_00231])。

通过参数传入以太网接口上下文中物理以太网控制器的索引(CtrlIdx)以及报告的控制器模式(CtrlMode)([SWS_EthIf_00231])。在并发性方面,[SWS_EthIf_00231] 规定该函数对于同一控制器索引是不可重入的,但对于不同索引可以可重入地执行。

关于与其他模块的交互,相关要求提到了后续操作,但在当前版本中这些操作已被归类为已废弃(obsolete):

  • 根据 [SWS_EthIf_00267](OBSOLETE),在此函数的上下文中,若存在相应的控制引用,则原计划为交换机端口组的所有端口调用 EthSwt_SetSwitchPortMode,并在 ETH_MODE_DOWN 时解决与活动组的冲突。
  • 根据 [SWS_EthIf_00413](OBSOLETE),在此函数的上下文中,若存在收发器引用,则原计划根据先前请求的是 ETH_MODE_ACTIVE 还是 ETH_MODE_DOWN,调用带有 ETHTRCV_LINK_STATE_ACTIVE 或 ETHTRCV_LINK_STATE_DOWN 的 EthTrcv_TransceiverLinkStateRequest。

此文本由 AI 基于 AUTOSAR CP R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_TrcvModeIndication [SWS_EthIf_00232] 📄 PDF

void EthIf_TrcvModeIndication (uint8 TrcvIdx, Eth_ModeType TrcvMode);

Called asynchronously when a mode change has been read out. If the function is triggered by previous call of Eth Trcv_ Set Transceiver Mode it can directly be called within the trigger function. Ava ilable via Eth If.h

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3c15a8bf107b 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_TrcvModeIndication 用作 Ethernet 接口的通知接口,一旦读取到收发器的模式切换,就会调用该接口 [SWS_EthIf_00232]。它通过头文件 EthIf.h 可用,并具有服务 ID 0x0f [SWS_EthIf_00232]。

函数本身的执行被指定为同步,而当确定模式切换时,调用是异步进行的 [SWS_EthIf_00232]。如果该函数是由先前对 EthTrcv_SetTransceiverMode 的调用触发的,则允许直接在该触发函数内调用它 [SWS_EthIf_00232]。

参数与返回值

  • TrcvIdx:Ethernet 接口上下文中 Ethernet 收发器的索引(输入参数)[SWS_EthIf_00232]。
  • TrcvMode:类型为 Eth_ModeType 的 Ethernet 收发器的已发信号运行模式(输入参数)[SWS_EthIf_00232]。
  • 返回值:无(void)[SWS_EthIf_00232]。

并发性与可重入性

该函数针对同一索引被指定为不可重入,而针对不同索引则为可重入 [SWS_EthIf_00232]。在此,规范表提到了 Ctrl Idx,在此时收发器接口的上下文中,大概可以解释为指代收发器或控制器索引 [SWS_EthIf_00232]。 问题 Q-c0123f1ef0e4ec71 (未决)

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SwitchPortModeIndication [SWS_EthIf_91055] 📄 PDF

void EthIf_SwitchPortModeIndication (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_ModeType PortMode);

The Eth If shall determine the expected notifications based on the Eth Swt Port configuration. In case the Eth Swt Port references an Eth Trcv the Eth If expects a notification from the Eth Trcv via API Eth If_ Trcv Mode Indication(). Otherwise the Eth If expects a notification from the Eth Swt via API Eth If_ Switch Port Mode Indication()

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 57f47c2f8434 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EthIf_SwitchPortModeIndication 用作 Ethernet Interface(EthIf)的异步通知接口,以接收由 Ethernet Switch Driver 报告的 Ethernet 交换机端口模式更改 [SWS_EthIf_91055]。

使用与交互

EthIf 根据相应交换机端口的配置确定预期的通知:如果交换机端口引用了收发器(EthTrcv),则 EthIf 改为预期通过 EthIf_TrcvModeIndication() 接收通知;否则,预期通过 EthIf_SwitchPortModeIndication() 接收来自 Ethernet Switch Driver 的通知 [SWS_EthIf_91055]。

  • SwitchIdx:Ethernet Switch Driver 上下文中的 Ethernet 交换机索引 [SWS_EthIf_91055]。
  • SwitchPortIdx:所寻址 Ethernet 交换机上的端口索引 [SWS_EthIf_91055]。
  • PortMode:新报告的交换机端口模式,类型为 Eth_ModeType [SWS_EthIf_91055]。

执行属性与限制

该函数没有返回值(void),服务 ID 为 0x46 [SWS_EthIf_91055]。它被指定为异步(Asynchronous)且不可重入(Non Reentrant)[SWS_EthIf_91055]。因此,调用方必须确保避免针对此服务的竞争性调用。有效载荷中未针对此函数定义具体的 DET 或 DEM 错误消息。

本使用说明基于规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EthIf_SleepIndication [SWS_EthIf_91006] 📄 PDF

void EthIf_SleepIndication (uint8 TrcvIdx);

This API is called by the corresponding Eth Trcv, if a sleep indication was detected on the network. This could be used e.g. for Ethernet hardware which is compliant to the OA TC10. In this ca se the Ethernet hardware (PHY) detect an Sleep.Indication which was triggered by a Sleep.Request of the connected link partner. Tags: atp.Status=draft

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d3c958a96e74 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EthIf_SleepIndication 用作 Ethernet 接口的通知接口。一旦相应的 Ethernet 收发器驱动程序(EthTrcv)在网络上注册了睡眠指示,就会调用该函数 [SWS_EthIf_91006]。作为唯一的输入参数传递 TrcvIdx,该参数在模块 EthIf 上下文中唯一标识发送信号的 Ethernet 收发器的索引 [SWS_EthIf_91006]。该函数既没有输入/输出值也没有返回值,并且同步执行通知 [SWS_EthIf_91006]。

硬件交互

一个主要用例是与符合 OPEN Alliance TC10 规范设计的 Ethernet 硬件配合使用 [SWS_EthIf_91006]。在此场景中,收发器(PHY)在硬件级别检测到 Sleep.Indication,这是由直接连接的链路对端的睡眠请求(Sleep.Request)触发的 [SWS_EthIf_91006]。

并发性与限制

该接口被定义为同步且可重入,并通过头文件 EthIf.h 提供(服务 ID 0x68)[SWS_EthIf_91006]。在系统集成时应考虑到,该元素带有标签 atp.Status=draft,被标记为草案 [SWS_EthIf_91006]。规范范围中未定义具体的错误处理例程或 DET 错误码;正式的错误检查大概仅在未来的规范版本中进行。 问题 Q-680af6c43439167f (未决)

本使用说明是基于规范 AUTOSAR R20-11 自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EthIf_MainFunctionRx [SWS_EthIf_00097] 📄 PDF

void EthIf_MainFunctionRx (void);

The function checks for new received frames and issues reception indications in polling mode.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 26bf586c58f7 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EthIf_MainFunctionRx 在 Ethernet 接口(EthIf)中承担核心任务,在轮询模式下检查新到达的数据帧,并向上层触发相应的接收指示(Reception Indications)[SWS_EthIf_00097]。它以签名 void EthIf_MainFunctionRx (void) 定义,因此不接收任何调用参数且不提供返回值 [SWS_EthIf_00097]。十六进制值 0x20 被确定为服务 ID [SWS_EthIf_00097]。

该函数通过头文件 SchM_EthIf.h 提供 [SWS_EthIf_00097]。这表明可以理解为:其调用由调度管理器(SchM)或操作系统在基础软件的周期性任务上下文中周期性执行。

并发与错误处理

由于接收帧的检查和转发被指定在轮询模式下 [SWS_EthIf_00097],因此顺畅的接收操作需要对调用进行充分的时间节拍控制。延迟执行可能会导致将传入消息转发至上层软件组件时出现延迟。 问题 Q-554ef0cf302c3aa3 (未决)规范中未针对该函数列出特定错误码、开发错误(DET)或向 DEM 发送的错误报告。

本使用提示由 AI 生成,并总结了 AUTOSAR CP R20-11 规范版本的要求。

实现者指南即将推出(复杂度 I1)

函数 EthIf_MainFunctionTx [SWS_EthIf_00113] 📄 PDF

void EthIf_MainFunctionTx (void);

The function issues transmission confirmations in polling mode. It checks also for transceiver state changes.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c427e9416514 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

主函数 EthIf_MainFunctionTx 用于在 Ethernet 接口模块 [SWS_EthIf_00113] 内周期性处理发送操作和状态查询。它具有十六进制服务 ID 0x21,并根据其签名 void EthIf_MainFunctionTx (void) 在没有传递参数且没有返回值的情况下执行,因此整个处理均基于状态进行 [SWS_EthIf_00113]。

在运行过程中,该服务在 Ethernet 通信中承担两项核心任务:

  • 发送确认:在轮询模式下,该函数向上层发出成功完成传输的确认(Transmission Confirmations)[SWS_EthIf_00113]。
  • 收发器状态:它监控并检查系统中所连接 Ethernet 收发器发生的状态变化 [SWS_EthIf_00113]。

在系统集成方面,该接口通过头文件 SchM_EthIf.h 可用 [SWS_EthIf_00113]。解释:从通过 SchM_EthIf.h 提供可能得出,该调用由 BSW 调度器(SchM)在周期性任务的上下文中周期性执行。 问题 Q-b9dde07f9cc74a95 (未决)这确保了在轮询操作中挂起的发送确认和收发器状态变更能够定期处理,且不依赖中断。

本规范范围中未针对此服务定义特定错误码、通过 DET 或 DEM 的单独错误处理例程以及重入性要求,因此未予列出。

本使用说明基于 AUTOSAR Classic Release R20-11 规范的规定。

实现者指南即将推出(复杂度 I1)

函数 EthIf_MainFunctionState [SWS_EthIf_91104] 📄 PDF

void EthIf_MainFunctionState (void);

The function is polling different communication hardware (Ethernet transceiver, Ethernet switch ports) related information, e.g. link state, signal quality.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ad2bcae76976 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EthIf_MainFunctionState 用于轮询(Polling)所连接的 Ethernet 通信硬件(例如 Ethernet 收发器和 Ethernet 交换机端口)的状态和诊断信息 [SWS_EthIf_91104]。其中包括例如连接状态(Link State)以及信号质量 [SWS_EthIf_91104]。该函数既没有输入参数也没有输出参数,并且不返回值(void EthIf_MainFunctionState(void),服务 ID 0x05)[SWS_EthIf_91104]。执行行为被指定为异步 [SWS_EthIf_91104]。

并发性与调用条件

该函数被定义为不可重入(Non Reentrant)[SWS_EthIf_91104]。因此,在任何时候都不得并行执行或自中断执行。由于该接口通过头文件 EthIf_SchM.h 提供 [SWS_EthIf_91104],因此周期性调用通常可能在 BSW 调度器(SchM)的任务上下文中进行。 问题 Q-10d02355b276be90 (未决)

交互与配置

根据 [SWS_EthIf_00407],EthIf_MainFunctionState 必须严格按照配置的周期性 EthIfMainFunctionStatePeriod 查询硬件信息。这确保了 Ethernet 接口中物理接口参数的定期更新。

本提示由 AI 基于 AUTOSAR 规范生成,不能替代正式的集成检查。

实现者指南即将推出(复杂度 I1)

类型 EthIf_SwitchPortGroupIdxType [SWS_EthIf_91101] 📄 PDF

Data Type that represents the Ethernet interface switch port group index. The index is zero based and unique for every configured switch port group.

类型 EthIf_SignalQualityResultType [SWS_EthIf_91057] 📄 PDF

-

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c6d5744fb7a0 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

数据结构 EthIf_SignalQualityResultType([SWS_EthIf_91057])用于以太网层面的连接质量采集和诊断,并通过头文件 EthIf.h 提供。

该结构聚合了基本类型为 uint32 的三个测量物理量:

  • ActualSignalQuality:表示以太网连接当前存在的信号质量。
  • HighestSignalQuality:记录自上次复位以来测得的该连接的最高信号质量。
  • LowestSignalQuality:记录自上次复位以来测得的该连接的最低信号质量。

在与模块 EthIf 协同工作时,极值反映了连接稳定性的变化过程。内部保存的历史值的复位通过专用接口进行控制:

  • 对于通过 TrcvIdx 指定的收发器,函数 EthIf_ClearTrcvSignalQuality 复位已保存的信号质量值([SWS_EthIf_00400])。
  • 对于通过 SwitchIdx 和 SwitchPortIdx 标识的交换机端口,EthIf_ClearSwitchPortSignalQuality 清除已保存的信号质量值([SWS_EthIf_00404])。

解释:由于有效载荷未提及具体的读取函数,该结构推测可能用作收发器和交换机端口相应状态查询的输出参数,以便将当前信号质量与极值进行比对。 问题 Q-8e5f2914bade574c (未决)

本段文本由 AI 生成,完全基于 R20-11 的规范要求。

实现者指南即将推出(复杂度 I1)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_EthIf
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_EthIf@rel:R20-11#fd2cde72
Content hash
fd2cde72
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_EthernetInterface.pdf#nameddest=SWS_EthIf_00024

主题图

详细视图

请在大纲中选择一个条目。

初始化与状态

Returns the version information of this module

void EthIf_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);
EthIf_Init 函数

Initializes the Ethernet Interface

void EthIf_Init (const EthIf_ConfigType* CfgPtr);

服务 · Get…

Allows to read and reset detailed measurement data for diagnostic purposes. Get all Measurement Idx's at once is not supported. ETHIF_ MEAS_ ALL shall only be used to reset all Measurement Idx's at once. A NULL_ PTR shall be provided for Measurement Data Ptr in this case.

Std_ReturnType EthIf_GetAndResetMeasurementData (EthIf_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Obtains the address resolution ta ble of a switch and copies the list into a user provided buffer. The function will copy all or number Of

Std_ReturnType EthIf_GetArlTable (uint8 switchIdx, uint16* numberOfElements, Eth_MacVlanType* arlTableListPointer);

Read out values related to the receive direction of the transceiver for a received packet. For example, this could be RSSI or Channel belonging to one single packet.

Std_ReturnType EthIf_GetBufWRxParams (uint8 CtrlIdx, const WEth_BufWRxParamIdType* RxParamIds, uint32* ParamValues, uint8 NumParams);

Read out values related to the transmit direction of the transceiver for a transmitted packet. For example, this could be transaction ID belonging to one single packet.

Std_ReturnType EthIf_GetBufWTxParams (uint8 CtrlIdx, const WEth_BufWTxParamIdType* TxParamIds, uint32* ParamValues, uint8 NumParams);

Retrieves the cable diagnostics result of a given transceiver.

Std_ReturnType EthIf_GetCableDiagnosticsResult (uint8 TrcvIdx, EthTrcv_CableDiagResultType* ResultPtr);

Read values related to the receive direction of the transceiver. For example, this could be a Channel Busy Ratio (CBR) or the average Channel Idle Time (CIT).

Std_ReturnType EthIf_GetChanRxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_GetChanRxParamIdType* ParamIds, thernetInterface uint32* ParamValues, uint8 NumParams); ⚠️

Obtains the state of the ind exed controller

Std_ReturnType EthIf_GetControllerMode (uint8 CtrlIdx, Eth_ModeType* CtrlModePtr);

Returns the number and index of all active Ethernet controllers.

Std_ReturnType EthIf_GetCtrlIdxList (uint8* NumberOfCtrlIdx, uint8* CtrlIdxListPtr);

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, the remaining bits will be filled with 0. Important Note: Eth If_ Get Curren t Time may be called within an exclusive area.

Std_ReturnType EthIf_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 EthIf_GetEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_TimeStampQualType* timeQualPtr, thernetInterface* timeStampPtr); ⚠️

Reads back the ingress time stamp on a dedicated message object. It must be called within the Rx Indication() function.

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

Obtains the PHY identifier of the Ethernet Interface according to IEEE 802.3 - chapter 22.2.4.3.1 PHY Identifer.

Std_ReturnType EthIf_GetPhyIdentifier (uint8 TrcvIdx, uint32* OrgUniqueIdPtr, uint8* ModelNrPtr, uint8* RevisionNrPtr);

Obtains the physical source address used by the indexed controller

void EthIf_GetPhysAddr (uint8 CtrlIdx, uint8* PhysAddrPtr);

Tags: atp.Status=draft

Std_ReturnType EthIf_GetPhyWakeupReason (uint8 TrcvIdx, EthTrcv_WakeupReasonType* WakeupReasonPtr);

Retrieves the cable diagnostics result of the indexed Ethernet switch port respectively the referenced Ethernet Transceiver Driver.

Std_ReturnType EthIf_GetPortCableDiagnosticsResult (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_CableDiagResultType* ResultPtr);

Obtains the port over which this MAC - address can be reached

Std_ReturnType EthIf_GetPortMacAddr (const uint8* MacAddrPtr, uint8* SwitchIdxPtr, uint8* PortIdxPtr);

Obtain the current status of the port mirroring for the indexed Ethernet switch port

Std_ReturnType EthIf_GetPortMirrorState (uint8 SwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType* PortMirrorStatePtr);

Request the Mgmt Object of the (in this context) unique Data Ptr.

Std_ReturnType EthIf_GetRxMgmtObject (uint8 CtrlIdx, Eth_DataType* DataPtr, EthSwt_MgmtObjectType* * MgmtObjectPtr);

Obtain the Organizationally Unique Identifier that is given by the IEEE of the indexed Ethernet switch. This function shall provide the OUI of Ethernet switch. The OUI has a size of 24 bit. If a ethernet switch can provide the OUI the 8 most significant bits of the OUI shall be set to 0x00xxxxxx. If a Ethernet switch can not provide the OUI the 8 most significant bits of the OUI shall be set to 0x FFxxxxxx. Availa ble via Eth If.h

Std_ReturnType EthIf_GetSwitchIdentifier (uint8 SwitchIdx, uint32* OrgUniqueIdPtr);

This function retrieves the OUI (24 bit) of the indexed Ethernet switch port.

Std_ReturnType EthIf_GetSwitchPortIdentifier (uint8 SwitchIdx, uint8 SwitchPortIdx, uint32* OrgUniqueIdPtr, uint8* ModelNrPtr, uint8* RevisionNrPtr);

Obtains the mode of the indexed switch port

Std_ReturnType EthIf_GetSwitchPortMode (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_ModeType* PortModePtr);

Retrieves the signal quality of the link of the given Ethernet switch port

Std_ReturnType EthIf_GetSwitchPortSignalQuality (uint8 SwitchIdx, uint8 SwitchPortIdx, EthIf_SignalQualityResultType* ResultPtr);

This function obtains the wake up reasons of the indexed Ethernet switch port by

Std_ReturnType EthIf_GetSwitchPortWakeupReason (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_WakeupReasonType* WakeupReasonPtr);

Obtains the state of the indexed transceiver

Std_ReturnType EthIf_GetTransceiverMode (uint8 TrcvIdx, Eth_ModeType* TrcvModePtr);

Returns the wake up mode of the indexed tran sceiver Tags: atp.Status=obsolete

Std_ReturnType EthIf_GetTransceiverWakeupMode (uint8 TrcvIdx, EthTrcv_WakeupModeType* TrcvWakeupModePtr);

Retrieves the signal quality of the link of the given Ethernet transceiver

Std_ReturnType EthIf_GetTrcvSignalQuality (uint8 TrcvIdx, EthIf_SignalQualityResultType* ResultPtr);

Request the Mgmt Object of the (in this context) unique Buf Idx.

Std_ReturnType EthIf_GetTxMgmtObject (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtObjectType* * MgmtObjectPtr);

Returns the VLAN identifier of the requested Ethernet controller.

Std_ReturnType EthIf_GetVlanId (uint8 CtrlIdx, uint16* VlanIdPtr);

服务 · Set…

Set values related to the transmit direction of the transceiver for a specific buffer (packet to be sent). For example, this can be the desired transmit power or the channel belonging to one single packet.

Std_ReturnType EthIf_SetBufWTxParams (uint8 CtrlIdx, Eth_BufIdxType BufIdx, const WEth_BufWTxParamIdType* TxParamIds, const uint32* ParamValues, uint8 NumParams);

Set values related to the receive direction of a transceiver's wireless channel. For example, this could be a channel parameter like the frequency.

Std_ReturnType EthIf_SetChanRxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_SetChanRxParamIdType* ParamIds, const uint32* ParamValues, uint8 NumParams);

Set values related to the transmit direction of a transceiver's wireless channel. For example, this could be the bitrate of a channel.

Std_ReturnType EthIf_SetChanTxParams (uint8 TrcvId, uint8 RadioId, const WEthTrcv_SetChanTxParamIdType* TxParamIds, const uint32* ParamValues, uint8 NumParams);

Enables / disables the indexed controller thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface

Std_ReturnType EthIf_SetControllerMode (uint8 CtrlIdx, Eth_ModeType CtrlMode);

Verifies the Switch Configuration. If Configuration is not valid, Switch is reconfigured.

Std_ReturnType EthIf_SetForwardingMode (uint8 SwitchIdx, boolean mode);

Activates a given loopback mode.

Std_ReturnType EthIf_SetPhyLoopbackMode (uint8 TrcvIdx, EthTrcv_PhyLoopbackModeType Mode);

Sets the physical source address used by the indexed controller.

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

Activates a given test mode.

Std_ReturnType EthIf_SetPhyTestMode (uint8 TrcvIdx, EthTrcv_PhyTestModeType Mode);

Activates a given transmission mode. Tags: atp.Status=draft

Std_ReturnType EthIf_SetPhyTxMode (uint8 TrcvIdx, EthTrcv_PhyTxModeType Mode);

Activates a given test loop - back mode of the indexed Ethernet switch port.

Std_ReturnType EthIf_SetPortLoopbackMode (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyLoopbackModeType Mode);

Request to set the given port mirroring state of the port mirror configuration for the given Ethernet switch.

Std_ReturnType EthIf_SetPortMirrorState (uint8 MirroredSwitchIdx, uint8 PortIdx, EthSwt_PortMirrorStateType PortMirrorState);

Activates a given test mode of the indexed Ethernet switch port.

Std_ReturnType EthIf_SetPortTestMode (uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTestModeType Mode);

Activates a given transmission mode of the indexed Ethernet switch port.

Std_ReturnType EthIf_SetPortTxMode (thernetInterface uint8 SwitchIdx, uint8 PortIdx, EthTrcv_PhyTxModeType Mode); ⚠️

Set values related to a transceiver's wireless radio. For example, this could be the selection of the radio settings (channel, ...).

Std_ReturnType EthIf_SetRadioParams (uint8 TrcvId, const WEthTrcv_SetRadioParamIdType* ParamIds, const uint32* ParamValue, uint8 NumParams);

Provides additional management information along to an Ethernet frame that requires special treatment within the Switch. It has to be called between Eth If_ Provide Tx Buffer() and Eth If_ Transmit() of the related frame.

Std_ReturnType EthIf_SetSwitchMgmtInfo (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType* MgmtInfoPtr);

Enables / disables the wake up mode or clear the wake - up reason of the indexed transceiver Tags: atp.Status=obsolete

Std_ReturnType EthIf_SetTransceiverWakeupMode (uint8 TrcvIdx, EthTrcv_WakeupModeType TrcvWakeupMode);

服务 · Switch…

Activates egress time stamping on a dedicated message object, addressed by Ctrl Idx and Buf Idx.

Std_ReturnType EthIf_SwitchEnableTimeStamping (uint8 CtrlIdx, Eth_BufIdxType BufIdx, EthSwt_MgmtInfoType* MgmtInfo);

Retrieves the total size of data and the memory start address of the indexed Ethernet Switch.

Std_ReturnType EthIf_SwitchGetCfgDataInfo (uint8 SwitchIdx, uint32* DataSizePtr, uint32* DataAdressPtr);

Retrieves the data in memory of the indexed Ethernet switch in variable length

Std_ReturnType EthIf_SwitchGetCfgDataRaw (uint8 SwitchIdx, uint32 Offset, uint16 Length, uint8* BufferPtr);

Obtains the baud rate of the indexed switch port

Std_ReturnType EthIf_SwitchPortGetBaudRate (thernetInterface uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_BaudRateType* BaudRatePtr); ⚠️

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

Std_ReturnType EthIf_SwitchPortGetCounterValues (uint8 SwitchIdx, thernetInterface uint8 SwitchPortIdx, Eth_CounterType* CounterPtr); ⚠️

Obtains the duplex mode of the indexed switch port

Std_ReturnType EthIf_SwitchPortGetDuplexMode (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_DuplexModeType* DuplexModePtr);

Obtains the link state of the indexed switch port

Std_ReturnType EthIf_SwitchPortGetLinkState (uint8 SwitchIdx, uint8 SwitchPortIdx, EthTrcv_LinkStateType* LinkStatePtr);

Returns the MAC learning mode, i.e. 1.) HW learning enabled, 2.) Hardware l earning disabled, 3.) Software learning enabled. Note: This feature is hardware dependent, i.e. the switch hardware needs to support the different learning modes

Std_ReturnType EthIf_SwitchPortGetMacLearningMode (thernetInterface uint8 SwitchIdx, uint8 SwitchPortIdx, EthSwt_MacLearningType* MacLearningModePtr); ⚠️

Service EthIf_SwitchPortGetMaxFIFOBufferFillLevel.

Std_ReturnType EthIf_SwitchPortGetMaxFIFOBufferFillLevel (uint8 SwitchPortIdx, uint8 PortIdx, uint8 SwitchPortEgressFifoIdx, uint32* SwitchPortEgressFifoBufferLevelPtr);

Returns a list of statistic counters defined with E th_ Rx Tats Type. The majority of these Counters are derived from the IETF RFC2819.

Std_ReturnType EthIf_SwitchPortGetRxStats (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_RxStatsType* RxStatsPtr);

Returns the list of Transmission Error Counters out of IETF RFC1213 and RFC16 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 EthIf_SwitchPortGetTxErrorCounterValues (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxErrorCounterValuesType* TxStatsPtr);

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 EthIf_SwitchPortGetTxStats (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_TxStatsType* TxStatsPtr);

Request a mode for the Eth If Swt Port Group. The call shall be forwarded to Eth Swt by calling Eth Swt_ Set Switch P ort Mode for all Eth Swt Ports referenced by the port group.

Std_ReturnType EthIf_SwitchPortGroupRequestMode (EthIf_SwitchPortGroupIdxType PortGroupIdx, Eth_ModeType PortMode);

The Eth If shall determine the expected notifications based on the Eth Swt Port configuration. In case the Eth Swt Port references an Eth Trcv the Eth If expects a notification from the Eth Trcv via API Eth If_ Trcv Mode Indication(). Otherwise the Eth If expects a notification from the Eth Swt via API Eth If_ Switch Port Mode Indication()

void EthIf_SwitchPortModeIndication (uint8 SwitchIdx, uint8 SwitchPortIdx, Eth_ModeType PortMode);

服务 · Transceiver…

Obtains the baud rate of the indexed transceiver

Std_ReturnType EthIf_TransceiverGetBaudRate (uint8 TrcvIdx, EthTrcv_BaudRateType* BaudRatePtr);

Obtains the duplex mode of the indexed tra nsceiver

Std_ReturnType EthIf_TransceiverGetDuplexMode (uint8 TrcvIdx, EthTrcv_DuplexModeType* DuplexModePtr);

Obta ins the link state of the indexed transceiver

Std_ReturnType EthIf_TransceiverGetLinkState (uint8 TrcvIdx, EthTrcv_LinkStateType* LinkStatePtr);

Obtains the media access mode of the transceiver. Tags: atp.Status=draft thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface

Std_ReturnType EthIf_TransceiverGetMacMethod (uint8* TrcvIdx, EthTrcv_MacMethodType* MacModePtr);

服务 · 其他

This API request the affected Ethernet hardware to c heck for a signaled wake - up. The used Ethernet hardware could be an Ethernet switch or Ethernet transceiver (PHY). This is used e.g. for Ethernet hardware which is compliant to the specification of Open Alliance TC10. This API is called by the integration code. The function could be called in context of the interrupt or on task level.

Std_ReturnType EthIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);

Clear the stored signal quality of the link of the given Et hernet switch port

Std_ReturnType EthIf_ClearSwitchPortSignalQuality (uint8 SwitchIdx, uint8 SwitchPortIdx);

Clear the stored signal quality of the link of the given Ethernet transceiver

Std_ReturnType EthIf_ClearTrcvSignalQuality (uint8 TrcvIdx);

Called asynchronously when mode has been read out. Triggered by previous Eth_ Set Controller Mode call. Can directly be called within the trigger functions.

void EthIf_CtrlModeIndication (uint8 CtrlIdx, thernetInterface Eth_ModeType CtrlMode); ⚠️

Delete the stored port mirror configuration of the given Mirrored Switch Idx. If no port mirror configuration was found for the given Mirrored Switch Idx, the return value shall be E_ OK.

Std_ReturnType EthIf_DeletePortMirrorConfiguration (uint8 MirroredSwitchIdx);

Activates 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 stamped" by network design.

void EthIf_EnableEgressTimeStamp (uint8 CtrlIdx, Eth_BufIdxType BufIdx thernetInterface); ⚠️

Provides access to a transmit buffer of the specified Ethernet controller.

BufReq_ReturnType EthIf_ProvideTxBuffer (uint8 CtrlIdx, Eth_FrameType FrameType, uint8 Priority, Eth_BufIdxType* BufIdxPtr, uint8* * BufPtr, uint16* LenBytePtr);

Obtain the port mirror configuration of the given Ethernet switch.

Std_ReturnType EthIf_ReadPortMirrorConfiguration (uint8 MirroredSwitchIdx, EthSwt_PortMirrorCfgType* PortMirrorConfigurationPtr);

The function shall request to reset the configuration of the learned MAC/ Port tables of a Eth ernet switch in a persistent manner. This could be used by e.g. a CDD. The statically configured entries shall still remain.

Std_ReturnType EthIf_ResetConfiguration (uint8 SwitchIdx);

Trigger the cable diagnostics for the given Ethernet transceiver.

Std_ReturnType EthIf_RunCableDiagnostic (uint8 TrcvIdx);

Trigger the cable diagnostics of the given Ethernet Switch port (Port Idx) by calling Eth Trcv_ Run Cable Diagnostic of the referenced Ethernet transceiver.

Std_ReturnType EthIf_RunPortCableDiagnostic (uint8 SwitchIdx, uint8 PortIdx);

This API is called by the corresponding Eth Trcv, if a sleep indication was detected on the network. This could be used e.g. for Ethernet hardware which is compliant to the OA TC10. In this ca se the Ethernet hardware (PHY) detect an Sleep.Indication which was triggered by a Sleep.Request of the connected link partner. Tags: atp.Status=draft

void EthIf_SleepIndication (uint8 TrcvIdx);

Request to set all configured and affected Eth Swt Ports to ETH_ MODE_ ACTIVE

Std_ReturnType EthIf_StartAllPorts (void);

The function shall request to store the configuration of the learned MAC/ Port tables of a Ethernet switch in a persistent manner. This could be used by e.g. a CDD.

Std_ReturnType EthIf_StoreConfiguration (uint8 SwitchIdx);

Triggers transmission of a previously filled transmit buffer

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

Called asynchronously when a mode change has been read out. If the function is triggered by previous call of Eth Trcv_ Set Transceiver Mode it can directly be called within the trigger function. Ava ilable via Eth If.h

void EthIf_TrcvModeIndication (uint8 TrcvIdx, Eth_ModeType TrcvMode);

Update the physical 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 EthIf_UpdatePhysAddrFilter (uint8 CtrlIdx, const uint8* PhysAddrPtr, Eth_FilterActionType Action);

Forwarded t o Eth Swt_ Verify Config. Eth Swt_ Verify Config verifies the Switch thernet Interface AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_EthernetInterface Configuration depending on the HW - Architecture, HW - capability and the intended accuracy of this verification.

Std_ReturnType EthIf_VerifyConfig (uint8 SwitchIdx, boolean* Result);

Service EthIf_WritePortMirrorConfiguration.

Std_ReturnType EthIf_WritePortMirrorConfiguration (uint8 MirroredSwitchIdx, const EthSwt_PortMirrorCfgType* PortMirrorConfigurationPtr);

回调

Handles a received frame received by the indexed controller

void EthIf_RxIndication (uint8 CtrlIdx, Eth_FrameType FrameType, boolean IsBroadcast, const uint8* PhysAddrPtr, const Eth_DataType* DataPtr, uint16 LenByte);

Confirms frame transmission by the indexed controller

void EthIf_TxConfirmation (uint8 CtrlIdx, Eth_BufIdxType BufIdx, Std_ReturnType Result);

周期性

The function checks for new received frames and issues reception indications in polling mode.

void EthIf_MainFunctionRx (void);

The function is polling different communication hardware (Ethernet transceiver, Ethernet switch ports) related information, e.g. link state, signal quality.

void EthIf_MainFunctionState (void);

The function issues transmission confirmations in polling mode. It checks also for transceiver state changes.

void EthIf_MainFunctionTx (void);

类型

Implementation specific structure of the post build configuration

Index to select specific measurement data

Data Type that represents the Ethernet interface switch port group index. The index is zero based and unique for every configured switch port group.