AM64x MCU+ SDK  08.03.00
icss_dlr.h File Reference

Go to the source code of this file.

Data Structures

struct  exceptionList
 List of MAC ID's which are exempted from Learning, this is for DLR implementation. More...
 
struct  dlrStateMachineVar
 State machine variables, part of DLR Object and L2 implementation. More...
 
struct  superConfig
 Supervisor configuration. Attribute ID 4. More...
 
struct  activeSuperAddr
 Supervisor address, part of DLR Object. Attribute ID 10. More...
 
struct  lastActiveNode
 Last active node at the end of the chain Class for Attributes 6 and 7. More...
 
struct  protocolParticipants
 IP and MAC of the Ring devices. Attribute ID 9. More...
 
struct  dlrStruct
 DLR parent structure through which all other structures can be accessed. More...
 
struct  dlr_Config
 

Macros

#define DEFAULT_DLR_PACKET_SIZE   60
 
#define ETHERNET_FRAME_SIZE_60   60
 
#define IEP_WD_PRE_DIV_10US   2000
 
#define PORT0_WATCH_DOG_ID   0 /*PD_WD*/
 
#define PORT1_WATCH_DOG_ID   1 /*PDI_WD*/
 
#define IS_A_LINK_STATUS_FRAME   DLR_TRUE
 
#define IS_A_NEIGHBOR_STAT_FRAME   DLR_FALSE
 
#define BOTH_LINKS_UP   0x0
 
#define PORT0_IS_DOWN   0x2
 
#define PORT1_IS_DOWN   0x1
 
#define BOTH_LINKS_DOWN   0x3
 
#define PORT0_WD_ISR_MASK   0x2000000
 
#define PORT1_WD_ISR_MASK   0x4000000
 
#define PDI_WD_TRIGGER_RX_SOF   (0 << 4)
 
#define PDI_WD_TRIGGER_LATCH_IN   (1 << 4)
 
#define PDI_WD_TRIGGER_SYNC0_OUT   (2 << 4)
 
#define PDI_WD_TRIGGER_SYNC1_OUT   (3 << 4)
 
#define DEFAULT_BEACON_INTERVAL_VARIABLE   400 /*in microseconds*/
 
#define DEFAULT_BEACON_TIMEOUT_VARIABLE   (DEFAULT_BEACON_INTERVAL_VARIABLE * 4) /*in microseconds*/
 
#define DEFAULT_NEIGHBOR_TIMEOUT_INTERVAL   100 /*in milliseconds*/
 
#define DEFAULT_DLR_PERIODIC_INTERVAL   100 /*in milliseconds*/
 
#define MAX_NUM_RETRIES   2
 
#define BEACON_CPU_STALL_THRESHOLD   4
 
#define DLR_DEFAULT_CAPABILITIES   (1 << 7) | (1 << 1)
 
#define DLR_SIGNON_FRAME_SIZE   ICSS_EMAC_MAXMTU
 
#define DLR_COMMON_FRAME_HEADER_SIZE   18
 
#define DLR_COMMON_FRAME_OFFSET   12
 
#define ICSS_DLR_PORT0_INT_FLAG   0x200000
 
#define ICSS_DLR_PORT1_INT_FLAG   0x400000
 
#define DLR_DMTIMER4_ID   3
 
#define DLR_DMTIMER5_ID   4
 

Typedefs

typedef struct dlr_Config_s * EIP_DLRHandle
 

Enumerations

enum  nodeState { NODE_IDLE = 0, NODE_FAULT = 1, NODE_NORMAL = 2 }
 node state machine states More...
 
enum  ringState { RING_NORMAL = 1, RING_FAULT = 2 }
 ring state values More...
 
enum  nwTopology { LINEAR_TOP = 0, RING_TOP = 1 }
 network topology : possible values for Attribute ID 1 More...
 
enum  nwStatus {
  NORMAL_STAT = 0, RING_FAULT_STAT = 1, UNEXPECTED_LOOP = 2, PARTIAL_FAULT = 3,
  RAPID_FAULT = 4
}
 network status : possible values for Attribute ID 2 More...
 
enum  supervisorStatus {
  BACKUP_NODE = 0, ACTIVE_RING_SUPERVISOR = 1, RING_NODE = 2, NON_DLR = 3,
  FEATURE_UNSUPPORTED = 4
}
 device role: possible values for Attribute ID 3 More...
 

Functions

void EIP_DLR_init (EIP_DLRHandle dlrHandle)
 API to initialize the DLR driver. More...
 
void EIP_DLR_deinit (EIP_DLRHandle dlrHandle)
 API to de-initialize the DLR driver. More...
 
void EIP_DLR_start (EIP_DLRHandle dlrHandle)
 API to start the DLR driver Calling this enables DLR on the device. More...
 
void EIP_DLR_stop (EIP_DLRHandle dlrHandle)
 API to stop the DLR driver Halt DLR. Calling this disables DLR on the device. More...
 
void EIP_DLR_port0ISR (uintptr_t arg)
 Fast ISR for Port 0, bypasses the buffer copy and NDK. More...
 
void EIP_DLR_port1ISR (uintptr_t arg)
 Fast ISR for Port 1, bypasses the buffer copy and NDK. More...
 
void EIP_DLR_beaconTimeoutISR_P0 (uintptr_t arg)
 ISR for beacon timeout for Port 0. More...
 
void EIP_DLR_beaconTimeoutISR_P1 (uintptr_t arg)
 ISR for beacon timeout for Port 1. More...
 
void EIP_DLR_port0ProcessLinkBrk (uint8_t linkStatus, void *arg2)
 Process DLR state machine in the event of a link break on Port0. More...
 
void EIP_DLR_port1ProcessLinkBrk (uint8_t linkStatus, void *arg2)
 Process DLR state machine in the event of a link break on Port1. More...
 
void EIP_DLR_neighborTimeoutISR0 (ClockP_Object *obj, void *arg)
 ISR for Neighbor timeout timer for port 0. More...
 
void EIP_DLR_neighborTimeoutISR1 (ClockP_Object *obj, void *arg)
 ISR for Neighbor timeout timer for port 1. More...
 
void EIP_DLR_addVlanID (uint8_t *src, uint16_t vlanID)
 
void EIP_DLR_genNCReqFrame (EIP_DLRHandle dlrHandle, uint8_t *src, uint8_t sourcePort)
 
void EIP_DLR_genNCResFrame (uint8_t *src, uint8_t sourcePort, uint8_t reqSrcPort, uint32_t sequenceId)
 
void EIP_DLR_genNeighborLinkStatFrame (EIP_DLRHandle dlrHandle, uint8_t *src, uint8_t sourcePort, uint8_t linkOrNeighbor, uint8_t linkStatus)
 
void EIP_DLR_initDLRFrameHeader (uint8_t *src, uint8_t *header)
 
void EIP_DLR_addSignOnNumNodes (uint8_t *src, uint16_t numNodes)
 
void EIP_DLR_processDLRFrame (EIP_DLRHandle dlrHandle, uint8_t *pktBuffer, uint8_t portNum, uint16_t size)
 Processes a sign on and Neighbor check request frame. More...
 
void EIP_DLR_dRAMInit (EIP_DLRHandle dlrHandle)
 
void EIP_DLR_resetStateMachine (EIP_DLRHandle dlrHandle)
 Initialize the state machine when it goes back to idle state. More...
 
void EIP_DLR_setDefaultValue (EIP_DLRHandle dlrHandle)
 
void EIP_DLR_switchToFault (EIP_DLRHandle dlrHandle)
 
void EIP_DLR_switchToNormal (EIP_DLRHandle dlrHandle)
 
int32_t EIP_DLR_isrInit (EIP_DLRHandle dlrHandle)
 
void EIP_DLR_periodicProcessing (ClockP_Object *obj, void *userArg)
 
void EIP_DLR_addToExceptionList (EIP_DLRHandle dlrHandle, uint8_t *macId)
 
void EIP_DLR_clearExceptionList (EIP_DLRHandle dlrHandle)
 
uint8_t EIP_DLR_checkSupervisorException (uint8_t *macId, EIP_DLRHandle dlrHandle)
 
void EIP_DLR_addModuleIPAddress (EIP_DLRHandle dlrHandle, uint32_t newIP)
 
void EIP_DLR_setDivider_WD_IEP (EIP_DLRHandle dlrHandle)
 Sets the clock divider to 1us for IEP watch dog timers. More...
 
void EIP_DLR_enable_WD_IEP (EIP_DLRHandle dlrHandle, uint8_t id)
 Enable the IEP Watch dog timers. More...
 
void EIP_DLR_disable_WD_IEP (EIP_DLRHandle dlrHandle, uint8_t id)
 Disable the IEP Watch dog timers. More...
 
void EIP_DLR_setTimeout_WD_IEP (EIP_DLRHandle dlrHandle, uint16_t periodInMicroSec, uint8_t id)
 Set the timeout value in watchdog. More...
 
void EIP_DLR_set_pdi_wd_trigger_mode (EIP_DLRHandle dlrHandle, uint32_t mode)
 Set the PDI WD trigger mode. More...
 

Macro Definition Documentation

◆ DEFAULT_DLR_PACKET_SIZE

#define DEFAULT_DLR_PACKET_SIZE   60

For future use when Ring Supervisor is implemented

◆ ETHERNET_FRAME_SIZE_60

#define ETHERNET_FRAME_SIZE_60   60

◆ IEP_WD_PRE_DIV_10US

#define IEP_WD_PRE_DIV_10US   2000

Value written to IEP WD Predivider register to configure 1us increment

◆ PORT0_WATCH_DOG_ID

#define PORT0_WATCH_DOG_ID   0 /*PD_WD*/

ID for PD Watchdog in IEP

◆ PORT1_WATCH_DOG_ID

#define PORT1_WATCH_DOG_ID   1 /*PDI_WD*/

ID for PDI Watchdog in IEP

◆ IS_A_LINK_STATUS_FRAME

#define IS_A_LINK_STATUS_FRAME   DLR_TRUE

◆ IS_A_NEIGHBOR_STAT_FRAME

#define IS_A_NEIGHBOR_STAT_FRAME   DLR_FALSE

◆ BOTH_LINKS_UP

#define BOTH_LINKS_UP   0x0

◆ PORT0_IS_DOWN

#define PORT0_IS_DOWN   0x2

◆ PORT1_IS_DOWN

#define PORT1_IS_DOWN   0x1

◆ BOTH_LINKS_DOWN

#define BOTH_LINKS_DOWN   0x3

◆ PORT0_WD_ISR_MASK

#define PORT0_WD_ISR_MASK   0x2000000

◆ PORT1_WD_ISR_MASK

#define PORT1_WD_ISR_MASK   0x4000000

◆ PDI_WD_TRIGGER_RX_SOF

#define PDI_WD_TRIGGER_RX_SOF   (0 << 4)

Watchdog RX Start of Frame Trigger

◆ PDI_WD_TRIGGER_LATCH_IN

#define PDI_WD_TRIGGER_LATCH_IN   (1 << 4)

Watchdog LATCH IN Trigger

◆ PDI_WD_TRIGGER_SYNC0_OUT

#define PDI_WD_TRIGGER_SYNC0_OUT   (2 << 4)

Watchdog SYNC0 Trigger

◆ PDI_WD_TRIGGER_SYNC1_OUT

#define PDI_WD_TRIGGER_SYNC1_OUT   (3 << 4)

Watchdog SYNC1 Trigger

◆ DEFAULT_BEACON_INTERVAL_VARIABLE

#define DEFAULT_BEACON_INTERVAL_VARIABLE   400 /*in microseconds*/

DLR Timer default values, this is redundant since values are eventually read from supervisor

◆ DEFAULT_BEACON_TIMEOUT_VARIABLE

#define DEFAULT_BEACON_TIMEOUT_VARIABLE   (DEFAULT_BEACON_INTERVAL_VARIABLE * 4) /*in microseconds*/

◆ DEFAULT_NEIGHBOR_TIMEOUT_INTERVAL

#define DEFAULT_NEIGHBOR_TIMEOUT_INTERVAL   100 /*in milliseconds*/

◆ DEFAULT_DLR_PERIODIC_INTERVAL

#define DEFAULT_DLR_PERIODIC_INTERVAL   100 /*in milliseconds*/

◆ MAX_NUM_RETRIES

#define MAX_NUM_RETRIES   2

Number of neighbor retries before a neighbor status message is sent

◆ BEACON_CPU_STALL_THRESHOLD

#define BEACON_CPU_STALL_THRESHOLD   4

Number of times beacon timer is triggered before it is disabled

◆ DLR_DEFAULT_CAPABILITIES

#define DLR_DEFAULT_CAPABILITIES   (1 << 7) | (1 << 1)

the value 1 indicates that this is only a ring node capable device, for other values see below

◆ DLR_SIGNON_FRAME_SIZE

#define DLR_SIGNON_FRAME_SIZE   ICSS_EMAC_MAXMTU

◆ DLR_COMMON_FRAME_HEADER_SIZE

#define DLR_COMMON_FRAME_HEADER_SIZE   18

◆ DLR_COMMON_FRAME_OFFSET

#define DLR_COMMON_FRAME_OFFSET   12

◆ ICSS_DLR_PORT0_INT_FLAG

#define ICSS_DLR_PORT0_INT_FLAG   0x200000

DLR port 0 Interrupt Flag for ICSS INTC

◆ ICSS_DLR_PORT1_INT_FLAG

#define ICSS_DLR_PORT1_INT_FLAG   0x400000

DLR port 1 Interrupt Flag for ICSS INTC

◆ DLR_DMTIMER4_ID

#define DLR_DMTIMER4_ID   3

Generic DM Timer 4 ID used for timer creation

◆ DLR_DMTIMER5_ID

#define DLR_DMTIMER5_ID   4

Generic DM Timer 4 ID used for timer creation

Typedef Documentation

◆ EIP_DLRHandle

typedef struct dlr_Config_s* EIP_DLRHandle

Enumeration Type Documentation

◆ nodeState

enum nodeState

node state machine states

Enumerator
NODE_IDLE 

idle state

NODE_FAULT 

fault state

NODE_NORMAL 

normal state

◆ ringState

enum ringState

ring state values

Enumerator
RING_NORMAL 

normal ring

RING_FAULT 

faulty ring

◆ nwTopology

enum nwTopology

network topology : possible values for Attribute ID 1

Enumerator
LINEAR_TOP 

linear topology

RING_TOP 

ring topology

◆ nwStatus

enum nwStatus

network status : possible values for Attribute ID 2

Enumerator
NORMAL_STAT 

normal status

RING_FAULT_STAT 

ring fault status

UNEXPECTED_LOOP 

unexpected loop detected

PARTIAL_FAULT 

ring is partially faulty

RAPID_FAULT 

there is rapid connection/reset

◆ supervisorStatus

device role: possible values for Attribute ID 3

Enumerator
BACKUP_NODE 
ACTIVE_RING_SUPERVISOR 
RING_NODE 
NON_DLR 
FEATURE_UNSUPPORTED 

indicates the device cannot support the currently operating ring parameters (Beacon Interval and/or Beacon Timeout)