DEENESPTFRRUARHIKOZHNL

Ethernet State Manager (EthSM)

ModulEthSM (Ethernet State Manager)
BSW-Modul-ID143
Standard-Header#include "EthSM.h"
SWS-SpezifikationAUTOSAR_CP_SWS_EthernetStateManager.pdf, AUTOSAR_SWS_EthernetStateManager.pdf
Umfang79 Records · 30 Snippets
ClusterEthernet-Stack

Ethernet State Manager (EthSM)

AUTOSAR Classic Communication Services-Modul Ethernet State Manager (EthSM, Spezifikation: AUTOSAR_CP_SWS_EthernetStateManager.pdf, AUTOSAR_SWS_EthernetStateManager.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

函数 EthSM_MainFunction [SWS_EthSM_00035] 📄 PDF

void EthSM_MainFunction(void);

Cyclic Main Function which is called from the Scheduler.

函数 EthSM_RequestComMode [SWS_EthSM_00050] 📄 PDF

Std_ReturnType EthSM_RequestComMode(NetworkHandleType NetworkHandle, ComM_ModeType ComM_Mode);

Handles the communication mode and sets the Ethernet network active or passive.

函数 EthSM_GetCurrentComMode [SWS_EthSM_00055] 📄 PDF

Std_ReturnType EthSM_GetCurrentComMode(NetworkHandleType NetworkHandle, ComM_ModeType* ComM_ModePtr);

This service shall put out the current communication mode of a Ethernet network.

函数 EthSM_TrcvLinkStateChg [SWS_EthSM_00109] 📄 PDF

void EthSM_TrcvLinkStateChg(uint8 CtrlIdx, EthTrcv_LinkStateType TransceiverLinkState);

This service is called by the Ethernet Interface to report a transceiver link state change.

函数 EthSM_TcpIpModeIndication [SWS_EthSM_00110] 📄 PDF

void EthSM_TcpIpModeIndication(uint8 CtrlIdx, TcpIp_StateType TcpIpState);

This service is called by the Tcp Ip to report the actual Tcp Ip state (e.g. online, offline). Available vi a Eth SM_ Tcp Ip.h

函数 EthSM_CtrlModeIndication [SWS_EthSM_00190] 📄 PDF

void EthSM_CtrlModeIndication(uint8 CtrlIdx, Eth_ModeType CtrlMode);

Called when mode has been read out. Either triggered by previous Eth If_ Get Controller Mode or by Eth If_ Set Controller Mode call. Can directly be called within the trigger functions.

函数 EthSM_SleepIndication [SWS_EthSM_91004] 📄 PDF

void EthSM_SleepIndication(uint8 Ctrl_Idx);

This API is called by the Eth If and indicate that a sleep indication was detected on the network. This API is only called if the ECU is acting as a passive communication slave on the corresponding communication channel (the referenced Eth Trcv of the affe cted Eth If Transceiver has set Eth Trcv Act As Slave Passive Enabled to TRUE). This could be used e.g. for Ethernet hardware which is compliant to the OA TC10. In this case the Ethernet hardware detect an Sleep.Indication which was triggered by a Sleep.Re quest of the connected link partner. Tags: atp.Status=draft

类型 EthSM_NetworkModeStateType [SWS_EthSM_00041] 📄 PDF

This type shall define the states of the network mode state machine.

requirement SWS_EthSM_00024 [SWS_EthSM_00024] 📄 PDF

[SWS_EthSM_00024] ⌈The EthSM shall implement for each configured network han- dle one network mode state machine (EthSM statemachine).⌋()

requirement SWS_EthSM_00025 [SWS_EthSM_00025] 📄 PDF

[SWS_EthSM_00025]) shall not be reported towards the BswM.⌋() Note: The BswM need the information about the EthSM internal states (see

requirement SWS_EthSM_00038 [SWS_EthSM_00038] 📄 PDF

If ComM calls the EthSM to r equest a certain communication mode for a certain Ethernet network, the EthSM shall map the requested communication mode to the corresponding EthSM state machine main state: - If communication mode COMM_FULL_COMMUNICATION or COMM_FULL_COMMUNICATION_WITH_WAKE UP_REQUEST is requested, then the EthSM shall request internally the state ETHSM_FULL_COMMUNICATION for the corresponding EthSM statemachine - If communication mode COMM_NO_COMMUNICATION is requested, then EthSM shall request internally the state ETHSM_NO_CO MMUNICATION for the corresponding EthSM statemachine

requirement SWS_EthSM_00051 [SWS_EthSM_00051] 📄 PDF

[SWS_EthSM_00051] ⌈The function EthSM_RequestComMode checks the network handle of the request. It only accepts the request, if the network handle of the re- quest is a handle contained in the EthSM configuration (configuration parameter Eth SMNetworkHandle). In this case the return value is set to E_OK. If it is not contained in the configuration, the function denies the request. In this case the return value is set to E_NOT_OK.⌋

requirement SWS_EthSM_00052 [SWS_EthSM_00052] 📄 PDF

[SWS_EthSM_00052] ⌈The function EthSM_RequestComMode shall report ETHSM_ E_INVALID_NETWORK_HANDLE to the DET, if it does not accept the network handle of the request.⌋

requirement SWS_EthSM_00053 [SWS_EthSM_00053] 📄 PDF

[SWS_EthSM_00053] ⌈If the function EthSM_RequestComMode accepts the function call, it shall store the communication mode for the network handle and the correspond- ing network mode switch of the state machine shall be initiated in the next main function cycle latest.⌋

requirement SWS_EthSM_00054 [SWS_EthSM_00054] 📄 PDF

[SWS_EthSM_00054] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_RequestComMode shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

requirement SWS_EthSM_00057 [SWS_EthSM_00057] 📄 PDF

[SWS_EthSM_00057] ⌈The function EthSM_GetCurrentComMode checks the net- work handle of the service request. It only accepts the service, if the network handle of the request is a handle contained in the EthSM configuration (configuration parameter EthSMNetworkHandle). In this case the return value is set to E_OK. If it is not contained in the configuration, the function denies the request. In this case the return value is set to E_NOT_OK.⌋

requirement SWS_EthSM_00058 [SWS_EthSM_00058] 📄 PDF

[SWS_EthSM_00058] ⌈The function EthSM_GetCurrentComMode shall report ETHSM_E_INVALID_NETWORK_HANDLE to the DET, if it does not accept the network handle of the request.⌋

requirement SWS_EthSM_00059 [SWS_EthSM_00059] 📄 PDF

[SWS_EthSM_00059] ⌈The function EthSM_GetCurrentComMode puts out the cur- rent communication mode for the network handle to the designated pointer of type Com M_ModeType, if it accepts the request.⌋ Remark: Because the Ethernet hardware needs a certain time to proceed with the request and there is currently no notification mechanism specified, the real hardware mode and the mode notified by the EthSM might be different until the hardware is ready.

requirement SWS_EthSM_00060 [SWS_EthSM_00060] 📄 PDF

[SWS_EthSM_00060] Upstream requirements: SRS_BSW_00406, SRS_BSW_00374, SRS_BSW_00003, SRS_BSW_ ⌈The function EthSM_GetCurrentComMode shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

requirement SWS_EthSM_00078 [SWS_EthSM_00078] 📄 PDF

[SWS_EthSM_00078] ⌈It is possible to set the Ethernet State Manager in a dummy mode. In this mode, the Ethernet State Manager doesn’t support the API to the Eth- ernet interface. The API to the ComM is available but the functionality is deactivated. The function calls from the ComM will be answered with the return value E_OK. ⌋ Note: see chapter 10 configuration specification

requirement SWS_EthSM_00083 [SWS_EthSM_00083] 📄 PDF

[SWS_EthSM_00083] ⌈Evertime the EthSM statemachine enters a sub-state, the Eth SM shall report the entered sub-state towards the BswM by calling BswM_EthSM_Cur- rentState(<entered sub-state>) (e.g. when entering sub-state ETHSM_STATE_ON- LINE, EthSM shall call BswM_EthSM_CurrentState(ETHSM_STATE_ONLINE). The transistion to ETHSM_STATE_OFFLINE after initialization (see [SWS_EthSM_00025]) shall not be reported towards the BswM.⌋() Note: The BswM need the information about the EthSM internal states (see

requirement SWS_EthSM_00095 [SWS_EthSM_00095] 📄 PDF

[SWS_EthSM_00095] ⌈The function EthSM_RequestComMode shall report ETHSM_ E_INVALID_NETWORK_MODE to the DET, if it does not accept the mode of the re- quest.⌋

requirement SWS_EthSM_00097 [SWS_EthSM_00097] 📄 PDF

OBSOLETE After the successful transition from ETHSM_ STATE_OFFLINE to ETHSM_ STATE_WAIT_TRCVLINK the Ethernet State Manager shall call the callback function BswM_EthSM_CurrentState of the BswM and transmit the internal state ETHSM_ STATE_WAIT_TRCVLINK .

requirement SWS_EthSM_00112 [SWS_EthSM_00112] 📄 PDF

[SWS_EthSM_00112] ⌈The function EthSM_TrcvLinkStateChg shall report ETHSM_E_PARAM_CONTROLLER to the DET, if it does not accept the CtrlIdx of the function call.⌋

requirement SWS_EthSM_00114 [SWS_EthSM_00114] 📄 PDF

[SWS_EthSM_00114] ⌈If the function EthSM_TrcvLinkStateChg does not report a DET error, it shall store the transceiver link state for the affected network handle. The corresponding network mode switch of the state machine shall be initiated latest in the next main function cycle.⌋

requirement SWS_EthSM_00115 [SWS_EthSM_00115] 📄 PDF

[SWS_EthSM_00115] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_TrcvLinkStateChg shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

requirement SWS_EthSM_00116 [SWS_EthSM_00116] 📄 PDF

[SWS_EthSM_00116] ⌈If the function EthSM_TcpIpModeIndication gets a Ctrl Idx, which is not configured in the configuration of the EthSM module, it shall call the function Det_ReportError with ErrorId parameter ETHSM_E_PARAM_CON- TROLLER.⌋

requirement SWS_EthSM_00118 [SWS_EthSM_00118] 📄 PDF

[SWS_EthSM_00118] ⌈If development error detection is enabled, the parameter Tcp IpState shall be checked for being in the allowed range. In case it is outside of the allowed range, the function EthSM_TcpIpModeIndica- tion shall ignore the state indication and report development error ETHSM_E_IN- VALID_TCP_IP_MODE to the DET.⌋

requirement SWS_EthSM_00119 [SWS_EthSM_00119] 📄 PDF

[SWS_EthSM_00119] ⌈If the function EthSM_TcpIpModeIndication accepts the function call, it shall store the TcpIp state for the affected network handle and the corresponding network mode switch of the state machine shall be initiated in the next main function cycle latest.⌋

requirement SWS_EthSM_00120 [SWS_EthSM_00120] 📄 PDF

[SWS_EthSM_00120] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_TcpIpModeIndication shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

requirement SWS_EthSM_00143 [SWS_EthSM_00143] 📄 PDF

The transition from ET HSM_ STATE_WAIT_ONLINE to ETHSM_ STATE_OFFLINE shall request the TcpIp state TCPIP_STATE_OFFLINE from the TcpIp module.

requirement SWS_EthSM_00146 [SWS_EthSM_00146] 📄 PDF

[SWS_EthSM_00146] Transition from WAIT_ONLINE to ONLINE ⌈If EthSMTcpI- pUsed is TRUE, in the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_ONLINE, if the TcpIp modul reports TCPIP_ STATE_ONLINE for the corresponding network handle. If EthSMTcpIpUsed is FALSE, in the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_ONLINE unconditionally.⌋ Note: The transition is shown as sequence diagram in Figure 9.2.

requirement SWS_EthSM_00150 [SWS_EthSM_00150] 📄 PDF

After the succ essful transition from ETHSM_ STATE_WAIT_ONLINE to ETHSM_ STATE_ONLINE the Ethernet State Manager shall set the main state to ETHSM_FULL_COMMUNICATION and call the callback function ComM_BusSM_ModeIndication of the ComM with communication mode COMM_ FULL _COMM UNICATION .

requirement SWS_EthSM_00154 [SWS_EthSM_00154] 📄 PDF

A fter the successful transition from ETHSM_ STATE_ONLINE to ETHSM_ STATE_WAIT_ONLINE the Ethernet State Manager shall se t the main state to ETHSM_NO_COMMUNICATION and call the callback function ComM_BusSM_ModeIndication of the ComM with communication mode COMM_ NO _COMMUNICATION.

requirement SWS_EthSM_00157 [SWS_EthSM_00157] 📄 PDF

After entering the state ETHSM_STATE_WAIT_OFFLINE, the API TcpIp_Reques tComMode shall be called with TCPIP_STATE_OFFLINE.

requirement SWS_EthSM_00160 [SWS_EthSM_00160] 📄 PDF

[SWS_EthSM_00160] ⌈If EthSMTcpIpUsed is TRUE, in the state ETHSM_STATE_ WAIT_OFFLINE the state machine shall have a transition to ETHSM_STATE_OF- FLINE, if the TcpIp modul reports TCPIP_STATE_OFFLINE for the corresponding net- work handle. If EthSMTcpIpUsed is FALSE, in the state ETHSM_STATE_WAIT_OF- FLINE the state machine shall have a transition to ETHSM_STATE_OFFLINE uncon- ditionally.⌋()

requirement SWS_EthSM_00161 [SWS_EthSM_00161] 📄 PDF

[SWS_EthSM_00161] ⌈The transition from ETHSM_STATE_WAIT_OFFLINE to ETHSM_STATE_OFFLINE shall set the controller mode to ETH_MODE_DOWN.⌋()

requirement SWS_EthSM_00165 [SWS_EthSM_00165] 📄 PDF

After the successful transition from ETHSM_ STATE_WAIT_OFFLINE to ETHSM_ STATE_OFFLINE the Ethernet State Manager shall set the main state to ETHSM_NO_COMMUNICATION and ca ll the callback function Com M_BusS M_ModeIndication of the ComM with communication mode COMM_ N O _COMMUNICATION .

requirement SWS_EthSM_00166 [SWS_EthSM_00166] 📄 PDF

[SWS_EthSM_00166] Transition from ONLINE to ONHOLD ⌈In the state ETHSM_ STATE_ONLINE the state machine shall have a transition to ETHSM_STATE_ON- HOLD, if the Ethernet Interface reports ETHTRCV_LINK_STATE_DOWN for the corre- sponding network handle.⌋ Note: The transition is shown as sequence diagram in Figure 9.3.

requirement SWS_EthSM_00167 [SWS_EthSM_00167] 📄 PDF

[SWS_EthSM_00167] ⌈The transition from ETHSM_STATE_ONLINE to ETHSM_ STATE_ONHOLD shall request the TcpIp state TCPIP_STATE_ONHOLD from the Tcp Ip module.⌋

requirement SWS_EthSM_00188 [SWS_EthSM_00188] 📄 PDF

If the optional configuration parameter ETHSM_E_ LINK_DOWN exists, ETHSM_E_ LINK_DOWN with EventStatus DEM_EVENT_STATUS_FAILED shall be reported to the DEM module when s w i tching from ETHSM_STATE_ ONLINE to ETHSM_STATE_ ONHOLD.

requirement SWS_EthSM_00191 [SWS_EthSM_00191] 📄 PDF

If the function EthSM _C trl ModeIndication gets a Ctrl Id x , which is not configured in the configuration of the Eth SM module, it shall call the function Det_ReportError with ErrorId parameter ETH SM_E_PARAM_CONTROLLER .

requirement SWS_EthSM_00192 [SWS_EthSM_00192] 📄 PDF

If the EthSM module is not initialized, when the function Eth SM_ C trl ModeIndication is ca lled, then the function EthS M_ C trl ModeIndication shall call the function Det_ReportError with ErrorId parameter ETH SM_E_UNINIT .

requirement SWS_EthSM_00196 [SWS_EthSM_00196] 📄 PDF

If the optional configuration parameter ETHSM_E_ LINK_DOWN exists, ETHSM_E_ LINK_DOWN with EventStatus DEM_EVENT_STATUS_ PASSED shall be re ported to the DEM module when switchin g from ETHSM_STATE_ON HOLD to ETHSM_STATE_ ONL INE .

requirement SWS_EthSM_00197 [SWS_EthSM_00197] 📄 PDF

The main function of the EthSM module shall operate the effects of the EthSM state machine, which the EthSM module shall implement for each configured network.

requirement SWS_EthSM_00198 [SWS_EthSM_00198] 📄 PDF

The EthSM shall mo n itor th e requested and current state of the Ethernet Interface Controller . If the EthSM detects a mismatch, it shall bring the hardware back to the corresponding state. (i.e. FullCOM requires the state ETH_MODE_ACTIVE; NoCom requires ETH_MODE_DOWN)

requirement SWS_EthSM_00200 [SWS_EthSM_00200] 📄 PDF

Type of error Related error code Error value Invalid communication mode requested ETHSM_ E_ INVALID_ NETWORK_ MODE 0x01 Eth SM module was not initialized ETHSM_ E_ UNINIT 0x02 Invalid pointer in parameter list ETHSM_ E_ PARAM_ POINTER 0x03 Variant 2 Variant 1 Socket Adapter COTS Stack Ethern et phy sical medium COTS Driver Socket Adapter Adapted COTS Stack Ethernet Interface Ethernet D river Non - AUTOSAR component AUTOSAR component Invalid parameter in parameter list ETHSM_ E_ INVALID_ NETWORK_ HANDLE 0x04 Invalid Tcp Ip state ETHSM_ E_ INVALID_ TCP_ IP_ MODE 0x05 Invalid parameter in parameter list ETHSM_ E_ PARAM_ CONTROLLER 0x07

requirement SWS_EthSM_00202 [SWS_EthSM_00202] 📄 PDF

Error Name: ETHSM_E_LINK_DOWN Short Description: Link down detection Long Description: It shall be reported when the transceiver switches to “down” while communication has already been established and is requested because of communication request Recommended DTC: N/A Detection Criteria: FAIL During transition from ETHSM_STATE_ONLINE to ETHSM_STATE_ONHOLD, which is triggered by EthSM_TrcvLinkStateChg(ETHTRCV_LINK_STATE_DO WN) PA SS During transition from ETHSM_STATE_ONHOLD to ETHSM_STATE_ONLINE, which is triggered by EthSM_TrcvLinkStateChg(ETHTRCV_LINK_STATE_ACTI VE) Secondary Parameters: None Time Required: PRE_FAIL: Immediately PASS: Configuration dependent Monitor Frequency C ontinuous MIL illumniation: N/A

requirement SWS_EthSM_00203 [SWS_EthSM_00203] 📄 PDF

The EthSM statemachine shall co nsist of 2 main states: ETHSM_FULL_COMMUNICATION and ETHSM_NO_COMMUNICATION.

requirement SWS_EthSM_00204 [SWS_EthSM_00204] 📄 PDF

The ETHSM_FULL_COMMUNICATION shall have 3 sub - states: ETHSM_STATE_OFFLINE, ET HSM_STATE_WAIT_TRCVLINK and ETHSM_STATE_WAIT_ONLINE.

requirement SWS_EthSM_00205 [SWS_EthSM_00205] 📄 PDF

T he ETHSM_NO_COMMUNICATION shall have 3 sub - states: ETHSM_STATE_ONLINE, ETHSM_STATE_ON HOLD and ETHSM_STATE_WAIT_OFFLINE.

requirement SWS_EthSM_00206 [SWS_EthSM_00206] 📄 PDF

If EthSM WakeupSleepOnDatalineEnabled is set to TRUE and the EthSM statmachine is in state ETHSM_ STATE_WAIT_TRCVLINK, and ComM request now COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST, then EthSM shall request the corresponding EthIfCtrl with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

requirement SWS_EthSM_00207 [SWS_EthSM_00207] 📄 PDF

If EthSMWakeupSleepOnDatalineEnabled is set to TRUE and EthSM is in state ETHSM_STATE_WAIT_ONLINE and ComM requests now COMM_FULL_COMMUNICATIO N_WITH_WAKEUP_REQUEST , then EthSM shall request the corresponding EthIfCtrl with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

requirement SWS_EthSM_00208 [SWS_EthSM_00208] 📄 PDF

If the EthSM statmachine is in state ETHSM_ STATE_ONLINE, EthSM WakeupSleepOnDatalineEnabled is set to TRUE and ComM request COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST, then the controller m ode of the corresponding EthIfCtrl shall be requested with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

requirement SWS_EthSM_00209 [SWS_EthSM_00209] 📄 PDF

In the state ETHSM_ STATE_WAIT_OFFLINE the state machine sha ll have a tr ansition to ETHSM_ STATE_ONLI NE , if ComM requests COMM_FULL_COMMU N ICATION or COMM_FULL_COMMUNICATION _WITH_WAKEUP_REQUEST for the corresponding network handle.

requirement SWS_EthSM_00210 [SWS_EthSM_00210] 📄 PDF

DRAFT The transition from ETHSM_ STATE_ WAIT_OFFLINE to ETHSM_ STATE_ONLINE shall set the controller mode to ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST, if ComM requested the EthSM statemachine with COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST.

requirement SWS_EthSM_00211 [SWS_EthSM_00211] 📄 PDF

DRAFT The transition from ETHSM_ STAT E_WAIT_OFFLINE to ETHSM_ STATE_WAIT_ONLINE shall request the TcpIp state TCPIP_STATE_ONLINE from the TcpIp module.

requirement SWS_EthSM_00212 [SWS_EthSM_00212] 📄 PDF

If the EthSM statmachin e is in state ETHSM_ STATE_ONHOLD, EthSM WakeupSleepOnDatalineEnabled is set t o TRUE and ComM request COMM_FULL_COMM U N ICATION_WITH_WAKEUP_REQUEST, then the cont roller mode of the corresponding EthIfCtrl shall be requested with ETH_MODE_ACTIVE_WITH_WAKEUP_REQ UEST.

requirement SWS_EthSM_00213 [SWS_EthSM_00213] 📄 PDF

DRAFT If the function EthSM_ SleepIndication gets a CtrlIdx , which is not configured in the configuration of the EthSM module, it shall call the function Det_ReportError with ErrorId parameter ETHSM_E_PARAM _ CONTR OLLER , if development error reporting is enabled (see EthSMDevErrorDetect ) .

requirement SWS_EthSM_00214 [SWS_EthSM_00214] 📄 PDF

DRAFT If the EthSM module is not initialized, when the function EthSM_ SleepIndication is called, then the function EthSM_ SleepIndication shall call the function Det_ReportError with ErrorId parameter ETHSM_E_UNINIT , if development error reporting is enabled (see EthSMDevErrorDetect ) .

requirement SWS_EthSM_00215 [SWS_EthSM_00215] 📄 PDF

DRAFT If EthSM_SleepIndication is called, EthSM shall forward this cal l to C omM by calling ComM_BusSM_BusSleepMode with the corresponding communication channel .

requirement SWS_EthSM_00216 [SWS_EthSM_00216] 📄 PDF

[SWS_EthSM_00216] Transition from ONLINE to WAIT_OFFLINE ⌈In the state ETHSM_STATE_ONLINE the state machine shall do a transition to ETHSM_ STATE_WAIT_OFFLINE, if the ComM requests COMM_SILENT_COMMUNICATION or COMM_NO_COMMUNICATION for the corresponding network handle.⌋ Note: The transition is shown as sequence diagram in Figure 9.2.

requirement SWS_EthSM_00217 [SWS_EthSM_00217] 📄 PDF

[SWS_EthSM_00217] ⌈During the transition between ETHSM_STATE_ONLINE and ETHSM_STATE_WAIT_OFFLINE triggered by EthSM_RequestComMode with COMM_SILENT_COMMUNICATION, the API EthIf_SetControllerMode shall be called with ETH_MODE_ACTIVE_TX_OFFLINE, if EthSMForwardSilentCommunica- tionEnabled is set to TRUE.⌋

requirement SWS_EthSM_00218 [SWS_EthSM_00218] 📄 PDF

[SWS_EthSM_00218] Self transition WAIT_OFFLINE ⌈In the state ETHSM_STATE_ WAIT_OFFLINE, if ComM requests COMM_NO_COMMUNICATION for the corre- sponding network handle, EthSM shall call the API TcpIp_RequestComMode with TCPIP_STATE_OFFLINE.⌋

requirement SWS_EthSM_00220 [SWS_EthSM_00220] 📄 PDF

[SWS_EthSM_00220] ⌈During the transition between ETHSM_STATE_ONLINE and ETHSM_STATE_WAIT_OFFLINE triggered by EthSM_RequestComMode with COMM_NO_COMMUNICATION, the API TcpIp_RequestComMode shall be called with TCPIP_STATE_OFFLINE.⌋

requirement SWS_EthSM_00221 [SWS_EthSM_00221] 📄 PDF

[SWS_EthSM_00221] Self transition WAIT_OFFLINE ⌈In the state ETHSM_STATE_ WAIT_OFFLINE, if ComM requests COMM_FULL_COMMUNICATION for the corre- sponding network handle, EthSM shall set the controller mode to ETH_MODE_ACTIVE and call the API TcpIp_RequestComMode with TCPIP_STATE_ONLINE⌋

requirement SWS_EthSM_00222 [SWS_EthSM_00222] 📄 PDF

[SWS_EthSM_00222] Self transition WAIT_OFFLINE ⌈In the state ETHSM_ STATE_WAIT_OFFLINE, if ComM requests COMM_FULL_COMMUNICATION_ WITH_WAKEUP_REQUEST for the corresponding network handle and EthSMWake- upSleepOnDatalineEnabled is set to TRUE, EthSM shall set the controller mode to ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST and call the API TcpIp_Re- questComMode with TCPIP_STATE_ONLINE⌋

requirement SWS_EthSM_00226 [SWS_EthSM_00226] 📄 PDF

[SWS_EthSM_00226] Transition from WAIT_ONLINE to WAIT_OFFLINE ⌈In the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_WAIT_OFFLINE, if EthSMForwardSilentCommunicationEnabled is set to TRUE and if the ComM requested COMM_SILENT_COMMUNICATION and Tcp Ip modul reports TCPIP_STATE_ONLINE for the corresponding network handle⌋

requirement SWS_EthSM_00227 [SWS_EthSM_00227] 📄 PDF

[SWS_EthSM_00227] During transition from WAIT_ONLINE to WAIT_OFFLINE ⌈During the transition from ETHSM_STATE_WAIT_ONLINE to ETHSM_STATE_ WAIT_OFFLINE EthSM shall call EthIf_SetControllerMode with ETH_MODE_ ACTIVE_TX_OFFLINE⌋

requirement SWS_EthSM_00228 [SWS_EthSM_00228] 📄 PDF

[SWS_EthSM_00228] After transition from WAIT_ONLINE to WAIT_OFFLINE - state change and ComM ⌈After the successful transition from ETHSM_STATE_WAIT_ ONLINE to ETHSM_STATE_WAIT_OFFLINE the Ethernet State Manager shall set the main state to ETHSM_FULL_COMMUNICATION and call ComM_BusSM_ModeIndi- cation with communication mode COMM_FULL_COMMUNICATION.⌋

requirement SWS_EthSM_00229 [SWS_EthSM_00229] 📄 PDF

[SWS_EthSM_00229] Transition from ONHOLD to WAIT_OFFLINE ⌈In the state ETHSM_STATE_ONHOLD the state machine shall have a transition to ETHSM_ STATE_WAIT_OFFLINE, if EthSMForwardSilentCommunicationEnabled is set to TRUE and if the ComM requested COMM_SILENT_COMMUNICATION and the Ether- net interface reports ETHTRCV_LINK_STATE_ACTIVE for the corresponding network handle.⌋

requirement SWS_EthSM_00230 [SWS_EthSM_00230] 📄 PDF

[SWS_EthSM_00230] During transition from ONHOLD to WAIT_OFFLINE ⌈During the transition from ETHSM_STATE_ONHOLD to ETHSM_STATE_WAIT_OFFLINE EthSM shall call EthIf_SetControllerMode with ETH_MODE_ACTIVE_TX_OF- FLINE and TcpIp_RequestComMode with TCPIP_STATE_ONLINE⌋

requirement SWS_EthSM_91001 [SWS_EthSM_91001] 📄 PDF

Module Header File Imported Type Com M Rte_ Com M_ Type.h Com M _ Mode Type Com Stack_ Types Com Stack_ Types.h Network Handle Type Dem Rte_ Dem_ Type.h Dem _ Event Id Type Rte_ Dem_ Type.h Dem _ Event Status Type Eth Eth_ General Types.h Eth _ Mode Type Eth Trcv Eth_ General Types.h Eth Trcv _ Link State Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type Tcp Ip Tcp Ip.h Tcp Ip _ State Type

requirement SWS_EthSM_91002 [SWS_EthSM_91002] 📄 PDF

Bsw M _ Eth S - M _ Current - State Bsw M_ Eth SM.h Function called by Eth SM to indicate its current state. Com M _ Bus S - M _ Mode - Indication Com M.h Indication of the actual bus mode by the corresponding Bus State Manager. Com M shall propagate the indicated state to the users with means of the RTE and Bsw M. Dem _ Set - Event Status Dem.h Called by SW - Cs or BSW modules to report monitor status informat ion to the Dem. BSW modules calling Dem_ Set Event Status can safely ignore the return value. This API will be available only if ({Dem/ Dem Config Set/ Dem Event Parameter/ Dem Event Reporting Type} == STANDARD_ REPORTING) Eth If _ Set - Controller - Mode Eth If.h Enables / disables the indexed controller Tcp Ip _ - Request Com - Mode Tcp Ip.h By this API service the TCP/ IP stack is requested to change the Tcp Ip state of the communication network identified by Eth If controller index.

requirement SWS_EthSM_91003 [SWS_EthSM_91003] 📄 PDF

Com M _ Bus S - M _ Bus Sleep - Mode Com M.h Notification of the corresponding Bus State Manager that the actual bus mode is Bus - Sleep. Only applicable for Com M channels with C om MNm Variant set to SLAVE_ ACTIVE or SLAVE_ PASSIVE. E.g. LIN slaves (Com MNMVariant = SLAVE_ ACTIVE) or Ethernet channels with OA TC10 compliant Ethernet hardware which act as passive communication slave (Com MNMVariant = SLAVE_ PASSIVE and Eth Trcv Act As Slave Passive Enabled set to TRUE) Det _ Report - Det.h Service to report development errors. Error Eth If _ Get - Controller Mode Eth If.h Obtains the state of the indexed controller

requirement SWS_EthSM_NA_00999 [SWS_EthSM_NA_00999] 📄 PDF

[SWS_EthSM_NA_00999] ⌈These requirements are not applicable to this specifica- tion.⌋(SRS_BSW_00344, SRS_BSW_00404, SRS_BSW_00170, SRS_BSW_00395, SRS_BSW_00398, SRS_BSW_00399, SRS_BSW_00400, SRS_BSW_00438, SRS_- BSW_00375, SRS_BSW_00416, SRS_BSW_00437, SRS_BSW_00168, SRS_- BSW_00423, SRS_BSW_00426, SRS_BSW_00427, SRS_BSW_00428, SRS_- BSW_00429, SRS_BSW_00432, SRS_BSW_00433, SRS_BSW_00336, SRS_- BSW_00369, SRS_BSW_00417, SRS_BSW_00161, SRS_BSW_00162, SRS_- BSW_00005, SRS_BSW_00164, SRS_BSW_00325, SRS_BSW_00343, SRS_- BSW_00160, SRS_BSW_00413, SRS_BSW_00347, SRS_BSW_00373, SRS_- BSW_00314, SRS_BSW_00353, SRS_BSW_00328, SRS_BSW_00377, SRS_- BSW_00306, SRS_BSW_00308, SRS_BSW_00309, SRS_BSW_00359, SRS_- BSW_00360, SRS_BSW_00331, SRS_BSW_00010, SRS_BSW_00333, SRS_- BSW_00321, SRS_BSW_00341, SRS_BSW_00334)

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

Record
AUTOSAR/AP/record/CP_MOD_EthSM
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_EthSM@rel:R20-11#8bdd72db
Content hash
8bdd72db
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_EthernetStateManager.pdf#nameddest=SWS_EthSM_00035

初始化与状态

This service puts out the version information of this module.

void EthSM_GetVersionInfo(Std_VersionInfoType* versioninfo);
EthSM_Init 函数

This function initialize the Eth SM.

void EthSM_Init(void);

服务

Called when mode has been read out. Either triggered by previous Eth If_ Get Controller Mode or by Eth If_ Set Controller Mode call. Can directly be called within the trigger functions.

void EthSM_CtrlModeIndication(uint8 CtrlIdx, Eth_ModeType CtrlMode);

This service shall put out the current communication mode of a Ethernet network.

Std_ReturnType EthSM_GetCurrentComMode(NetworkHandleType NetworkHandle, ComM_ModeType* ComM_ModePtr);

Handles the communication mode and sets the Ethernet network active or passive.

Std_ReturnType EthSM_RequestComMode(NetworkHandleType NetworkHandle, ComM_ModeType ComM_Mode);

This API is called by the Eth If and indicate that a sleep indication was detected on the network. This API is only called if the ECU is acting as a passive communication slave on the corresponding communication channel (the referenced Eth Trcv of the affe cted Eth If Transceiver has set Eth Trcv Act As Slave Passive Enabled to TRUE). This could be used e.g. for Ethernet hardware which is compliant to the OA TC10. In this case the Ethernet hardware detect an Sleep.Indication which was triggered by a Sleep.Re quest of the connected link partner. Tags: atp.Status=draft

void EthSM_SleepIndication(uint8 Ctrl_Idx);

This service is called by the Tcp Ip to report the actual Tcp Ip state (e.g. online, offline). Available vi a Eth SM_ Tcp Ip.h

void EthSM_TcpIpModeIndication(uint8 CtrlIdx, TcpIp_StateType TcpIpState);

This service is called by the Ethernet Interface to report a transceiver link state change.

void EthSM_TrcvLinkStateChg(uint8 CtrlIdx, EthTrcv_LinkStateType TransceiverLinkState);

周期性

Cyclic Main Function which is called from the Scheduler.

void EthSM_MainFunction(void);

类型

This type shall define the states of the network mode state machine.

需求

SWS_EthSM_00013 requirement

The EthSM module shall include the ComM_Bus _SM.h head er file.

SWS_EthSM_00024 requirement

[SWS_EthSM_00024] ⌈The EthSM shall implement for each configured network han- dle one network mode state machine (EthSM statemachine).⌋()

SWS_EthSM_00025 requirement

[SWS_EthSM_00025]) shall not be reported towards the BswM.⌋() Note: The BswM need the information about the EthSM internal states (see

SWS_EthSM_00038 requirement

If ComM calls the EthSM to r equest a certain communication mode for a certain Ethernet network, the EthSM shall map the requested communication mode to the corresponding EthSM state machine main state: - If communication mode COMM_FULL_COMMUNICATION or COMM_FULL_COMMUNICATION_WITH_WAKE UP_REQUEST is requested, then the EthSM shall request internally the state ETHSM_FULL_COMMUNICATION for the corresponding EthSM statemachine - If communication mode COMM_NO_COMMUNICATION is requested, then EthSM shall request internally the state ETHSM_NO_CO MMUNICATION for the corresponding EthSM statemachine

SWS_EthSM_00051 requirement

[SWS_EthSM_00051] ⌈The function EthSM_RequestComMode checks the network handle of the request. It only accepts the request, if the network handle of the re- quest is a handle contained in the EthSM configuration (configuration parameter Eth SMNetworkHandle). In this case the return value is set to E_OK. If it is not contained in the configuration, the function denies the request. In this case the return value is set to E_NOT_OK.⌋

SWS_EthSM_00052 requirement

[SWS_EthSM_00052] ⌈The function EthSM_RequestComMode shall report ETHSM_ E_INVALID_NETWORK_HANDLE to the DET, if it does not accept the network handle of the request.⌋

SWS_EthSM_00053 requirement

[SWS_EthSM_00053] ⌈If the function EthSM_RequestComMode accepts the function call, it shall store the communication mode for the network handle and the correspond- ing network mode switch of the state machine shall be initiated in the next main function cycle latest.⌋

SWS_EthSM_00054 requirement

[SWS_EthSM_00054] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_RequestComMode shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

SWS_EthSM_00057 requirement

[SWS_EthSM_00057] ⌈The function EthSM_GetCurrentComMode checks the net- work handle of the service request. It only accepts the service, if the network handle of the request is a handle contained in the EthSM configuration (configuration parameter EthSMNetworkHandle). In this case the return value is set to E_OK. If it is not contained in the configuration, the function denies the request. In this case the return value is set to E_NOT_OK.⌋

SWS_EthSM_00058 requirement

[SWS_EthSM_00058] ⌈The function EthSM_GetCurrentComMode shall report ETHSM_E_INVALID_NETWORK_HANDLE to the DET, if it does not accept the network handle of the request.⌋

SWS_EthSM_00059 requirement

[SWS_EthSM_00059] ⌈The function EthSM_GetCurrentComMode puts out the cur- rent communication mode for the network handle to the designated pointer of type Com M_ModeType, if it accepts the request.⌋ Remark: Because the Ethernet hardware needs a certain time to proceed with the request and there is currently no notification mechanism specified, the real hardware mode and the mode notified by the EthSM might be different until the hardware is ready.

SWS_EthSM_00060 requirement

[SWS_EthSM_00060] Upstream requirements: SRS_BSW_00406, SRS_BSW_00374, SRS_BSW_00003, SRS_BSW_ ⌈The function EthSM_GetCurrentComMode shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

SWS_EthSM_00078 requirement

[SWS_EthSM_00078] ⌈It is possible to set the Ethernet State Manager in a dummy mode. In this mode, the Ethernet State Manager doesn’t support the API to the Eth- ernet interface. The API to the ComM is available but the functionality is deactivated. The function calls from the ComM will be answered with the return value E_OK. ⌋ Note: see chapter 10 configuration specification

SWS_EthSM_00083 requirement

[SWS_EthSM_00083] ⌈Evertime the EthSM statemachine enters a sub-state, the Eth SM shall report the entered sub-state towards the BswM by calling BswM_EthSM_Cur- rentState(<entered sub-state>) (e.g. when entering sub-state ETHSM_STATE_ON- LINE, EthSM shall call BswM_EthSM_CurrentState(ETHSM_STATE_ONLINE). The transistion to ETHSM_STATE_OFFLINE after initialization (see [SWS_EthSM_00025]) shall not be reported towards the BswM.⌋() Note: The BswM need the information about the EthSM internal states (see

SWS_EthSM_00095 requirement

[SWS_EthSM_00095] ⌈The function EthSM_RequestComMode shall report ETHSM_ E_INVALID_NETWORK_MODE to the DET, if it does not accept the mode of the re- quest.⌋

SWS_EthSM_00097 requirement

OBSOLETE After the successful transition from ETHSM_ STATE_OFFLINE to ETHSM_ STATE_WAIT_TRCVLINK the Ethernet State Manager shall call the callback function BswM_EthSM_CurrentState of the BswM and transmit the internal state ETHSM_ STATE_WAIT_TRCVLINK .

SWS_EthSM_00112 requirement

[SWS_EthSM_00112] ⌈The function EthSM_TrcvLinkStateChg shall report ETHSM_E_PARAM_CONTROLLER to the DET, if it does not accept the CtrlIdx of the function call.⌋

SWS_EthSM_00114 requirement

[SWS_EthSM_00114] ⌈If the function EthSM_TrcvLinkStateChg does not report a DET error, it shall store the transceiver link state for the affected network handle. The corresponding network mode switch of the state machine shall be initiated latest in the next main function cycle.⌋

SWS_EthSM_00115 requirement

[SWS_EthSM_00115] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_TrcvLinkStateChg shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

SWS_EthSM_00116 requirement

[SWS_EthSM_00116] ⌈If the function EthSM_TcpIpModeIndication gets a Ctrl Idx, which is not configured in the configuration of the EthSM module, it shall call the function Det_ReportError with ErrorId parameter ETHSM_E_PARAM_CON- TROLLER.⌋

SWS_EthSM_00118 requirement

[SWS_EthSM_00118] ⌈If development error detection is enabled, the parameter Tcp IpState shall be checked for being in the allowed range. In case it is outside of the allowed range, the function EthSM_TcpIpModeIndica- tion shall ignore the state indication and report development error ETHSM_E_IN- VALID_TCP_IP_MODE to the DET.⌋

SWS_EthSM_00119 requirement

[SWS_EthSM_00119] ⌈If the function EthSM_TcpIpModeIndication accepts the function call, it shall store the TcpIp state for the affected network handle and the corresponding network mode switch of the state machine shall be initiated in the next main function cycle latest.⌋

SWS_EthSM_00120 requirement

[SWS_EthSM_00120] Upstream requirements: SRS_BSW_00406 ⌈The function EthSM_TcpIpModeIndication shall report ETHSM_E_UNINIT to the DET, if the EthSM is not initialized yet.⌋

SWS_EthSM_00143 requirement

The transition from ET HSM_ STATE_WAIT_ONLINE to ETHSM_ STATE_OFFLINE shall request the TcpIp state TCPIP_STATE_OFFLINE from the TcpIp module.

SWS_EthSM_00146 requirement

[SWS_EthSM_00146] Transition from WAIT_ONLINE to ONLINE ⌈If EthSMTcpI- pUsed is TRUE, in the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_ONLINE, if the TcpIp modul reports TCPIP_ STATE_ONLINE for the corresponding network handle. If EthSMTcpIpUsed is FALSE, in the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_ONLINE unconditionally.⌋ Note: The transition is shown as sequence diagram in Figure 9.2.

SWS_EthSM_00150 requirement

After the succ essful transition from ETHSM_ STATE_WAIT_ONLINE to ETHSM_ STATE_ONLINE the Ethernet State Manager shall set the main state to ETHSM_FULL_COMMUNICATION and call the callback function ComM_BusSM_ModeIndication of the ComM with communication mode COMM_ FULL _COMM UNICATION .

SWS_EthSM_00154 requirement

A fter the successful transition from ETHSM_ STATE_ONLINE to ETHSM_ STATE_WAIT_ONLINE the Ethernet State Manager shall se t the main state to ETHSM_NO_COMMUNICATION and call the callback function ComM_BusSM_ModeIndication of the ComM with communication mode COMM_ NO _COMMUNICATION.

SWS_EthSM_00157 requirement

After entering the state ETHSM_STATE_WAIT_OFFLINE, the API TcpIp_Reques tComMode shall be called with TCPIP_STATE_OFFLINE.

SWS_EthSM_00160 requirement

[SWS_EthSM_00160] ⌈If EthSMTcpIpUsed is TRUE, in the state ETHSM_STATE_ WAIT_OFFLINE the state machine shall have a transition to ETHSM_STATE_OF- FLINE, if the TcpIp modul reports TCPIP_STATE_OFFLINE for the corresponding net- work handle. If EthSMTcpIpUsed is FALSE, in the state ETHSM_STATE_WAIT_OF- FLINE the state machine shall have a transition to ETHSM_STATE_OFFLINE uncon- ditionally.⌋()

SWS_EthSM_00161 requirement

[SWS_EthSM_00161] ⌈The transition from ETHSM_STATE_WAIT_OFFLINE to ETHSM_STATE_OFFLINE shall set the controller mode to ETH_MODE_DOWN.⌋()

SWS_EthSM_00165 requirement

After the successful transition from ETHSM_ STATE_WAIT_OFFLINE to ETHSM_ STATE_OFFLINE the Ethernet State Manager shall set the main state to ETHSM_NO_COMMUNICATION and ca ll the callback function Com M_BusS M_ModeIndication of the ComM with communication mode COMM_ N O _COMMUNICATION .

SWS_EthSM_00166 requirement

[SWS_EthSM_00166] Transition from ONLINE to ONHOLD ⌈In the state ETHSM_ STATE_ONLINE the state machine shall have a transition to ETHSM_STATE_ON- HOLD, if the Ethernet Interface reports ETHTRCV_LINK_STATE_DOWN for the corre- sponding network handle.⌋ Note: The transition is shown as sequence diagram in Figure 9.3.

SWS_EthSM_00167 requirement

[SWS_EthSM_00167] ⌈The transition from ETHSM_STATE_ONLINE to ETHSM_ STATE_ONHOLD shall request the TcpIp state TCPIP_STATE_ONHOLD from the Tcp Ip module.⌋

SWS_EthSM_00188 requirement

If the optional configuration parameter ETHSM_E_ LINK_DOWN exists, ETHSM_E_ LINK_DOWN with EventStatus DEM_EVENT_STATUS_FAILED shall be reported to the DEM module when s w i tching from ETHSM_STATE_ ONLINE to ETHSM_STATE_ ONHOLD.

SWS_EthSM_00191 requirement

If the function EthSM _C trl ModeIndication gets a Ctrl Id x , which is not configured in the configuration of the Eth SM module, it shall call the function Det_ReportError with ErrorId parameter ETH SM_E_PARAM_CONTROLLER .

SWS_EthSM_00192 requirement

If the EthSM module is not initialized, when the function Eth SM_ C trl ModeIndication is ca lled, then the function EthS M_ C trl ModeIndication shall call the function Det_ReportError with ErrorId parameter ETH SM_E_UNINIT .

SWS_EthSM_00196 requirement

If the optional configuration parameter ETHSM_E_ LINK_DOWN exists, ETHSM_E_ LINK_DOWN with EventStatus DEM_EVENT_STATUS_ PASSED shall be re ported to the DEM module when switchin g from ETHSM_STATE_ON HOLD to ETHSM_STATE_ ONL INE .

SWS_EthSM_00197 requirement

The main function of the EthSM module shall operate the effects of the EthSM state machine, which the EthSM module shall implement for each configured network.

SWS_EthSM_00198 requirement

The EthSM shall mo n itor th e requested and current state of the Ethernet Interface Controller . If the EthSM detects a mismatch, it shall bring the hardware back to the corresponding state. (i.e. FullCOM requires the state ETH_MODE_ACTIVE; NoCom requires ETH_MODE_DOWN)

SWS_EthSM_00200 requirement

Type of error Related error code Error value Invalid communication mode requested ETHSM_ E_ INVALID_ NETWORK_ MODE 0x01 Eth SM module was not initialized ETHSM_ E_ UNINIT 0x02 Invalid pointer in parameter list ETHSM_ E_ PARAM_ POINTER 0x03 Variant 2 Variant 1 Socket Adapter COTS Stack Ethern et phy sical medium COTS Driver Socket Adapter Adapted COTS Stack Ethernet Interface Ethernet D river Non - AUTOSAR component AUTOSAR component Invalid parameter in parameter list ETHSM_ E_ INVALID_ NETWORK_ HANDLE 0x04 Invalid Tcp Ip state ETHSM_ E_ INVALID_ TCP_ IP_ MODE 0x05 Invalid parameter in parameter list ETHSM_ E_ PARAM_ CONTROLLER 0x07

SWS_EthSM_00202 requirement

Error Name: ETHSM_E_LINK_DOWN Short Description: Link down detection Long Description: It shall be reported when the transceiver switches to “down” while communication has already been established and is requested because of communication request Recommended DTC: N/A Detection Criteria: FAIL During transition from ETHSM_STATE_ONLINE to ETHSM_STATE_ONHOLD, which is triggered by EthSM_TrcvLinkStateChg(ETHTRCV_LINK_STATE_DO WN) PA SS During transition from ETHSM_STATE_ONHOLD to ETHSM_STATE_ONLINE, which is triggered by EthSM_TrcvLinkStateChg(ETHTRCV_LINK_STATE_ACTI VE) Secondary Parameters: None Time Required: PRE_FAIL: Immediately PASS: Configuration dependent Monitor Frequency C ontinuous MIL illumniation: N/A

SWS_EthSM_00203 requirement

The EthSM statemachine shall co nsist of 2 main states: ETHSM_FULL_COMMUNICATION and ETHSM_NO_COMMUNICATION.

SWS_EthSM_00204 requirement

The ETHSM_FULL_COMMUNICATION shall have 3 sub - states: ETHSM_STATE_OFFLINE, ET HSM_STATE_WAIT_TRCVLINK and ETHSM_STATE_WAIT_ONLINE.

SWS_EthSM_00205 requirement

T he ETHSM_NO_COMMUNICATION shall have 3 sub - states: ETHSM_STATE_ONLINE, ETHSM_STATE_ON HOLD and ETHSM_STATE_WAIT_OFFLINE.

SWS_EthSM_00206 requirement

If EthSM WakeupSleepOnDatalineEnabled is set to TRUE and the EthSM statmachine is in state ETHSM_ STATE_WAIT_TRCVLINK, and ComM request now COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST, then EthSM shall request the corresponding EthIfCtrl with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

SWS_EthSM_00207 requirement

If EthSMWakeupSleepOnDatalineEnabled is set to TRUE and EthSM is in state ETHSM_STATE_WAIT_ONLINE and ComM requests now COMM_FULL_COMMUNICATIO N_WITH_WAKEUP_REQUEST , then EthSM shall request the corresponding EthIfCtrl with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

SWS_EthSM_00208 requirement

If the EthSM statmachine is in state ETHSM_ STATE_ONLINE, EthSM WakeupSleepOnDatalineEnabled is set to TRUE and ComM request COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST, then the controller m ode of the corresponding EthIfCtrl shall be requested with ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

SWS_EthSM_00209 requirement

In the state ETHSM_ STATE_WAIT_OFFLINE the state machine sha ll have a tr ansition to ETHSM_ STATE_ONLI NE , if ComM requests COMM_FULL_COMMU N ICATION or COMM_FULL_COMMUNICATION _WITH_WAKEUP_REQUEST for the corresponding network handle.

SWS_EthSM_00210 requirement

DRAFT The transition from ETHSM_ STATE_ WAIT_OFFLINE to ETHSM_ STATE_ONLINE shall set the controller mode to ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST, if ComM requested the EthSM statemachine with COMM_FULL_COMMUNICATION_WITH_WAKEUP_REQUEST.

SWS_EthSM_00211 requirement

DRAFT The transition from ETHSM_ STAT E_WAIT_OFFLINE to ETHSM_ STATE_WAIT_ONLINE shall request the TcpIp state TCPIP_STATE_ONLINE from the TcpIp module.

SWS_EthSM_00212 requirement

If the EthSM statmachin e is in state ETHSM_ STATE_ONHOLD, EthSM WakeupSleepOnDatalineEnabled is set t o TRUE and ComM request COMM_FULL_COMM U N ICATION_WITH_WAKEUP_REQUEST, then the cont roller mode of the corresponding EthIfCtrl shall be requested with ETH_MODE_ACTIVE_WITH_WAKEUP_REQ UEST.

SWS_EthSM_00213 requirement

DRAFT If the function EthSM_ SleepIndication gets a CtrlIdx , which is not configured in the configuration of the EthSM module, it shall call the function Det_ReportError with ErrorId parameter ETHSM_E_PARAM _ CONTR OLLER , if development error reporting is enabled (see EthSMDevErrorDetect ) .

SWS_EthSM_00214 requirement

DRAFT If the EthSM module is not initialized, when the function EthSM_ SleepIndication is called, then the function EthSM_ SleepIndication shall call the function Det_ReportError with ErrorId parameter ETHSM_E_UNINIT , if development error reporting is enabled (see EthSMDevErrorDetect ) .

SWS_EthSM_00215 requirement

DRAFT If EthSM_SleepIndication is called, EthSM shall forward this cal l to C omM by calling ComM_BusSM_BusSleepMode with the corresponding communication channel .

SWS_EthSM_00216 requirement

[SWS_EthSM_00216] Transition from ONLINE to WAIT_OFFLINE ⌈In the state ETHSM_STATE_ONLINE the state machine shall do a transition to ETHSM_ STATE_WAIT_OFFLINE, if the ComM requests COMM_SILENT_COMMUNICATION or COMM_NO_COMMUNICATION for the corresponding network handle.⌋ Note: The transition is shown as sequence diagram in Figure 9.2.

SWS_EthSM_00217 requirement

[SWS_EthSM_00217] ⌈During the transition between ETHSM_STATE_ONLINE and ETHSM_STATE_WAIT_OFFLINE triggered by EthSM_RequestComMode with COMM_SILENT_COMMUNICATION, the API EthIf_SetControllerMode shall be called with ETH_MODE_ACTIVE_TX_OFFLINE, if EthSMForwardSilentCommunica- tionEnabled is set to TRUE.⌋

SWS_EthSM_00218 requirement

[SWS_EthSM_00218] Self transition WAIT_OFFLINE ⌈In the state ETHSM_STATE_ WAIT_OFFLINE, if ComM requests COMM_NO_COMMUNICATION for the corre- sponding network handle, EthSM shall call the API TcpIp_RequestComMode with TCPIP_STATE_OFFLINE.⌋

SWS_EthSM_00220 requirement

[SWS_EthSM_00220] ⌈During the transition between ETHSM_STATE_ONLINE and ETHSM_STATE_WAIT_OFFLINE triggered by EthSM_RequestComMode with COMM_NO_COMMUNICATION, the API TcpIp_RequestComMode shall be called with TCPIP_STATE_OFFLINE.⌋

SWS_EthSM_00221 requirement

[SWS_EthSM_00221] Self transition WAIT_OFFLINE ⌈In the state ETHSM_STATE_ WAIT_OFFLINE, if ComM requests COMM_FULL_COMMUNICATION for the corre- sponding network handle, EthSM shall set the controller mode to ETH_MODE_ACTIVE and call the API TcpIp_RequestComMode with TCPIP_STATE_ONLINE⌋

SWS_EthSM_00222 requirement

[SWS_EthSM_00222] Self transition WAIT_OFFLINE ⌈In the state ETHSM_ STATE_WAIT_OFFLINE, if ComM requests COMM_FULL_COMMUNICATION_ WITH_WAKEUP_REQUEST for the corresponding network handle and EthSMWake- upSleepOnDatalineEnabled is set to TRUE, EthSM shall set the controller mode to ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST and call the API TcpIp_Re- questComMode with TCPIP_STATE_ONLINE⌋

SWS_EthSM_00226 requirement

[SWS_EthSM_00226] Transition from WAIT_ONLINE to WAIT_OFFLINE ⌈In the state ETHSM_STATE_WAIT_ONLINE the state machine shall have a transition to ETHSM_STATE_WAIT_OFFLINE, if EthSMForwardSilentCommunicationEnabled is set to TRUE and if the ComM requested COMM_SILENT_COMMUNICATION and Tcp Ip modul reports TCPIP_STATE_ONLINE for the corresponding network handle⌋

SWS_EthSM_00227 requirement

[SWS_EthSM_00227] During transition from WAIT_ONLINE to WAIT_OFFLINE ⌈During the transition from ETHSM_STATE_WAIT_ONLINE to ETHSM_STATE_ WAIT_OFFLINE EthSM shall call EthIf_SetControllerMode with ETH_MODE_ ACTIVE_TX_OFFLINE⌋

SWS_EthSM_00228 requirement

[SWS_EthSM_00228] After transition from WAIT_ONLINE to WAIT_OFFLINE - state change and ComM ⌈After the successful transition from ETHSM_STATE_WAIT_ ONLINE to ETHSM_STATE_WAIT_OFFLINE the Ethernet State Manager shall set the main state to ETHSM_FULL_COMMUNICATION and call ComM_BusSM_ModeIndi- cation with communication mode COMM_FULL_COMMUNICATION.⌋

SWS_EthSM_00229 requirement

[SWS_EthSM_00229] Transition from ONHOLD to WAIT_OFFLINE ⌈In the state ETHSM_STATE_ONHOLD the state machine shall have a transition to ETHSM_ STATE_WAIT_OFFLINE, if EthSMForwardSilentCommunicationEnabled is set to TRUE and if the ComM requested COMM_SILENT_COMMUNICATION and the Ether- net interface reports ETHTRCV_LINK_STATE_ACTIVE for the corresponding network handle.⌋

SWS_EthSM_00230 requirement

[SWS_EthSM_00230] During transition from ONHOLD to WAIT_OFFLINE ⌈During the transition from ETHSM_STATE_ONHOLD to ETHSM_STATE_WAIT_OFFLINE EthSM shall call EthIf_SetControllerMode with ETH_MODE_ACTIVE_TX_OF- FLINE and TcpIp_RequestComMode with TCPIP_STATE_ONLINE⌋

SWS_EthSM_91001 requirement

Module Header File Imported Type Com M Rte_ Com M_ Type.h Com M _ Mode Type Com Stack_ Types Com Stack_ Types.h Network Handle Type Dem Rte_ Dem_ Type.h Dem _ Event Id Type Rte_ Dem_ Type.h Dem _ Event Status Type Eth Eth_ General Types.h Eth _ Mode Type Eth Trcv Eth_ General Types.h Eth Trcv _ Link State Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type Tcp Ip Tcp Ip.h Tcp Ip _ State Type

SWS_EthSM_91002 requirement

Bsw M _ Eth S - M _ Current - State Bsw M_ Eth SM.h Function called by Eth SM to indicate its current state. Com M _ Bus S - M _ Mode - Indication Com M.h Indication of the actual bus mode by the corresponding Bus State Manager. Com M shall propagate the indicated state to the users with means of the RTE and Bsw M. Dem _ Set - Event Status Dem.h Called by SW - Cs or BSW modules to report monitor status informat ion to the Dem. BSW modules calling Dem_ Set Event Status can safely ignore the return value. This API will be available only if ({Dem/ Dem Config Set/ Dem Event Parameter/ Dem Event Reporting Type} == STANDARD_ REPORTING) Eth If _ Set - Controller - Mode Eth If.h Enables / disables the indexed controller Tcp Ip _ - Request Com - Mode Tcp Ip.h By this API service the TCP/ IP stack is requested to change the Tcp Ip state of the communication network identified by Eth If controller index.

SWS_EthSM_91003 requirement

Com M _ Bus S - M _ Bus Sleep - Mode Com M.h Notification of the corresponding Bus State Manager that the actual bus mode is Bus - Sleep. Only applicable for Com M channels with C om MNm Variant set to SLAVE_ ACTIVE or SLAVE_ PASSIVE. E.g. LIN slaves (Com MNMVariant = SLAVE_ ACTIVE) or Ethernet channels with OA TC10 compliant Ethernet hardware which act as passive communication slave (Com MNMVariant = SLAVE_ PASSIVE and Eth Trcv Act As Slave Passive Enabled set to TRUE) Det _ Report - Det.h Service to report development errors. Error Eth If _ Get - Controller Mode Eth If.h Obtains the state of the indexed controller

SWS_EthSM_NA_00999 requirement

[SWS_EthSM_NA_00999] ⌈These requirements are not applicable to this specifica- tion.⌋(SRS_BSW_00344, SRS_BSW_00404, SRS_BSW_00170, SRS_BSW_00395, SRS_BSW_00398, SRS_BSW_00399, SRS_BSW_00400, SRS_BSW_00438, SRS_- BSW_00375, SRS_BSW_00416, SRS_BSW_00437, SRS_BSW_00168, SRS_- BSW_00423, SRS_BSW_00426, SRS_BSW_00427, SRS_BSW_00428, SRS_- BSW_00429, SRS_BSW_00432, SRS_BSW_00433, SRS_BSW_00336, SRS_- BSW_00369, SRS_BSW_00417, SRS_BSW_00161, SRS_BSW_00162, SRS_- BSW_00005, SRS_BSW_00164, SRS_BSW_00325, SRS_BSW_00343, SRS_- BSW_00160, SRS_BSW_00413, SRS_BSW_00347, SRS_BSW_00373, SRS_- BSW_00314, SRS_BSW_00353, SRS_BSW_00328, SRS_BSW_00377, SRS_- BSW_00306, SRS_BSW_00308, SRS_BSW_00309, SRS_BSW_00359, SRS_- BSW_00360, SRS_BSW_00331, SRS_BSW_00010, SRS_BSW_00333, SRS_- BSW_00321, SRS_BSW_00341, SRS_BSW_00334)