5.1. Real-time Ethernet Driver initialization

The different Real-time Ethernet Driver modules are selected and parameterized by a Real-time Ethernet Driver specific structure. Each Real-time Ethernet Driver specific structure start with a common EC_T_LINK_PARMS structure, followed by some Real-time Ethernet Driver specific members. The common link parameter structure is passed to EC_T_INIT_MASTER_PARMS::pLinkParms with the call of emInitMaster() like in the following example:

/* identify Link Layer in the common struture */
oLinkParmsSockRaw.linkParms.dwSignature = EC_LINK_PARMS_SIGNATURE_SOCKRAW;
oLinkParmsSockRaw.linkParms.dwSize = sizeof(EC_T_LINK_PARMS_SOCKRAW);
OsStrncpy(&oLinkParmsSockRaw.linkParms.szDriverIdent, EC_LINK_PARMS_IDENT_SOCKRAW, EC_DRIVER_IDENT_MAXLEN);

/* specific Link Layer parameters should be set here */

/* pass Link Layer parameters */
oInitMasterParms.dwSignature = ATECAT_SIGNATURE;
oInitMasterParms.dwSize = sizeof(EC_T_INIT_MASTER_PARMS);
oInitMasterParms.pLinkParms = &oLinkParmsSockRaw.linkParms;

/* more parameters should be set here */

/* initialize master */
emInitMaster(dwInstanceId, &oInitMasterParms);

Public Members

[in] Signature of the adapter specific structure containing the EC_T_LINK_PARMS structure

[in] Size of the adapter specific structure containing the EC_T_LINK_PARMS structure

[in] Logging parameters

[in] Name of Link Layer module (driver identification) for Link Layer Selection

[in] Instance of the adapter. if EC_LINKUNIT_PCILOCATION is set: contains PCI address

[in] Mode of operation

[in] Interrupt service thread CPU affinity mask

[in] Task priority of the interrupt service task (not used in polling mode)

[in] Task stack size

[in] 10, 100, 1000 Mbit\s

[in] LinkLayer timimg task parameters

[in] path from which the libraries should be loaded

enum EC_T_LINKMODE

Values:

enumerator EcLinkMode_UNDEFINED

Link is in an undefined state, must be polling or interrupt

enumerator EcLinkMode_INTERRUPT

Link is in interrupt mode and is triggered by interrupts

enumerator EcLinkMode_POLLING

Link is in polling mode and is polled periodically

struct EC_T_LINKLAYER_TIMINGTASK

Public Members

EC_T_LINKLAYER_TIMING eLinkLayerTiming

[in] LinkLayer timing task mode

EC_T_DWORD dwCycleTimeUsec

[in] Cycle time between 2 pfnStartCycle calls in us. Will be set by the master stack for the linklayer.

EC_T_LINK_STARTCYCLE_CALLBACK pfnStartCycle

[in] Callback function called cyclically according dwCycleTimeUsec

EC_T_VOID *pvStartCycleContext

[in] Context passed to each pfnStartCycle call

EC_T_DWORD dwTtsSendOffsetUsec

[in] Time between pfnStartCycle call and TTS frame transmission

EC_T_UINT64 nSystemTime

[in] System

enum EC_T_LINKLAYER_TIMING

Values:

enumerator eLinkLayerTiming_Undefined

Link Layer Timing is undefined must be TTS or TMR

enumerator eLinkLayerTiming_TTS

Real-time Ethernet Driver Time Triggered Send

enumerator eLinkLayerTiming_TMR

Real-time Ethernet Driver Timer

enum EC_T_PHYINTERFACE

Values:

enumerator ePHY_UNDEFINED

undefined

enumerator ePHY_FIXED_LINK

No PHY access at all

enumerator ePHY_MII

MII 10 / 100 MBit

enumerator ePHY_RMII

Reduced MII, 10 / 100 MBit

enumerator ePHY_GMII

Gigabit MII, 10, 100, 1000 MBit

enumerator ePHY_SGMII

Serial (SERDES) Gigabit MII, 10, 100, 1000 MBit

enumerator ePHY_RGMII

Reduced Gigabit MII, 10, 100, 1000 MBit

enumerator ePHY_OSDRIVER

Get interface type from OS

enumerator ePHY_RMII_50MHZ

ePHY_RMII with 50 MHz clock mode

5.1.1. Real-time Ethernet Driver instance selection via PCI location

For some operating systems it is possible to address the Real-time Ethernet Driver instance using its PCI address as an alternative. To do this, EC_LINKUNIT_PCILOCATION (0x01000000) and the PCI location must be set as EC_T_LINK_PARMS::dwInstance.

On Linux the PCI address can be shown using e.g.:

lspci | grep Ethernet
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
05:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

The format of EC_T_LINK_PARMS::dwInstance using PCI bus address is:

0x01bbddff
  • bb Bus Number

  • dd Device Number

  • ff Function Number

EC_T_LINK_PARMS::dwInstance = 0x01001900; //"0000:00:19.0"

On Windows the integer value displayed in properties dialog must be converted to HEX. E.g the number from the following dialog (PCI bus 11, device 0, function 0) corresponds to 0x010B0000 (bus 0x0B).