AM64x MCU+ SDK  08.03.00
hsrPrp_red_snmp.h File Reference

Introduction

Include file for hsrPrp_red_snmp.c.

Copyright (C) 2021 Texas Instruments Incorporated

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Go to the source code of this file.

Functions

const char * getLreManufacturerName (void)
 Returns the manufacturer name. More...
 
int32_t getLreInterfaceCount (void)
 Returns the number of supported LRE. More...
 
LreNodeType_t getLreNodeType (void)
 Returns lreNodeType specified in LREInterfaceConfigEntry. More...
 
const char * getLreNodeName (void)
 Returns the LRE's node name. Default: "IEC62439-3". More...
 
const char * getLreVersionName (void)
 Returns the LRE's version information. More...
 
int32_t getLrePortAdminState (RedPort_t port, ICSS_EMAC_Handle icssEmacHandle)
 Returns the LRE admin state of a port. More...
 
RED_STATUS setLrePortAdminState (RedPort_t port, int32_t adminState)
 Sets the LRE admin state of a port. More...
 
LreDuplicateDiscard_t getLreDuplicateDiscard (PRUICSS_Handle pruicssHandle)
 Returns whether a duplicate discard algorithm is used at reception. More...
 
RED_STATUS setLreDuplicateDiscard (hsrPrpHandle *hsrPrphandle, LreDuplicateDiscard_t duplicateDiscard, PRUICSS_Handle pruicssHandle)
 Sets whether a duplicate discard algorithm is used at reception. More...
 
LreTransparentReception_t getLreTransparentReception (PRUICSS_Handle pruicssHandle)
 
RED_STATUS setLreTransparentReception (LreTransparentReception_t transparentReception, PRUICSS_Handle pruicssHandle)
 Sets Transparent Reception. More...
 
HSRMode_t getLreHsrLREMode (PRUICSS_Handle pruicssHandle)
 Returns the HSR LRE Mode. More...
 
RED_STATUS setLreHsrLREMode (HSRMode_t mode, PRUICSS_Handle pruicssHandle)
 Sets the HSR LRE Mode. More...
 
SwitchingEndNode_t getLreSwitchingEndNode (void)
 Returns the SwitchingEndNode status. More...
 
LreRedBoxIdentity_t getLreRedBoxIdentity (void)
 Returns the LRE RedBox Identity. More...
 
LreTruthValue_t getLreEvaluateSupervision (void)
 True if the LRE evaluates received supervision frames. False if it drops the supervision frames without evaluating. More...
 
RED_STATUS setLreNodeTableClear (hsrPrpHandle *, LreTableOperation_t action)
 Clears the node table if action is "clearNodeTable". No action is performed if action is noOp. More...
 
RED_STATUS setLreProxyNodeTableClear (LreTableOperation_t action)
 Clears the Proxy Node Table if action is "clearProxyNodeTable". No action is performed if action is noOp. More...
 
RED_STATUS getLreInterfaceStats (LreIfStat_t stat, int32_t *value, PRUICSS_Handle pruicssHandle)
 Returns a single entry of LREInterfaceStatsEntry (see IEC-62439-3-MIB DEFINITIONS). The requested entry is specified by stat. More...
 
const int32_t * getLreInterfaceStatBase (PRUICSS_Handle pruicssHandle)
 Returns the base address of the LREInterfaceStatsEntry (see IEC-62439-3-MIB DEFINITIONS) in the ICSS shared RAM. Using this base address, the host can read the whole LREInterfaceStatsEntry at once. More...
 
int32_t getLreNodeTableSize (PRUICSS_Handle pruicssHandle)
 Returns the node table size. Use this function to determine the size of the buffer to pass to getLreNodeTable. More...
 
int32_t getLreNodeTable (RED_NODE_TABLE *pNodeTable, hsrPrpHandle *hsrPrphandle)
 Copies the complete node table to pNodeTable. More...
 
RemNodeType_t getLreRemNodeType (uint8_t nodeEntryStatus)
 Gets the type of a remote node. More...
 

Function Documentation

◆ getLreManufacturerName()

const char* getLreManufacturerName ( void  )

Returns the manufacturer name.

< General group

Returns
NULL-terminated string.

◆ getLreInterfaceCount()

int32_t getLreInterfaceCount ( void  )

Returns the number of supported LRE.

Returns
Always 1 for the AM335x PRP/HSR implementation. Interface group

◆ getLreNodeType()

LreNodeType_t getLreNodeType ( void  )

Returns lreNodeType specified in LREInterfaceConfigEntry.

Returns
1 prpmode1, 2 hsr.

◆ getLreNodeName()

const char* getLreNodeName ( void  )

Returns the LRE's node name. Default: "IEC62439-3".

Returns
NULL-terminated string.

◆ getLreVersionName()

const char* getLreVersionName ( void  )

Returns the LRE's version information.

Returns
NULL-terminated string.

◆ getLrePortAdminState()

int32_t getLrePortAdminState ( RedPort_t  port,
ICSS_EMAC_Handle  icssEmacHandle 
)

Returns the LRE admin state of a port.

Parameters
port- port number
icssEmacHandleHandle to ICSS EMAC instance. Contains pointers to base addresses
Returns
notActive (1) or active(2).

◆ setLrePortAdminState()

RED_STATUS setLrePortAdminState ( RedPort_t  port,
int32_t  adminState 
)

Sets the LRE admin state of a port.

Parameters
port- port number
adminState- set value: notActive (1) or active(2)
Returns
RED_ERR, always

◆ getLreDuplicateDiscard()

LreDuplicateDiscard_t getLreDuplicateDiscard ( PRUICSS_Handle  pruicssHandle)

Returns whether a duplicate discard algorithm is used at reception.

Parameters
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
doNotDiscard (1) or discard (2).

◆ setLreDuplicateDiscard()

RED_STATUS setLreDuplicateDiscard ( hsrPrpHandle hsrPrphandle,
LreDuplicateDiscard_t  duplicateDiscard,
PRUICSS_Handle  pruicssHandle 
)

Sets whether a duplicate discard algorithm is used at reception.

Parameters
hsrPrphandle
duplicateDiscard- set value: doNotDiscard (1) or discard (2)
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
RED_OK on Success, RED_ERR on Failure

◆ getLreTransparentReception()

LreTransparentReception_t getLreTransparentReception ( PRUICSS_Handle  pruicssHandle)

◆ setLreTransparentReception()

RED_STATUS setLreTransparentReception ( LreTransparentReception_t  transparentReception,
PRUICSS_Handle  pruicssHandle 
)

Sets Transparent Reception.

Parameters
transparentReception- set value: removeRCT (1) or passRCT (2)
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
RED_OK, always

◆ getLreHsrLREMode()

HSRMode_t getLreHsrLREMode ( PRUICSS_Handle  pruicssHandle)

Returns the HSR LRE Mode.

Parameters
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
The HSR Mode.

◆ setLreHsrLREMode()

RED_STATUS setLreHsrLREMode ( HSRMode_t  mode,
PRUICSS_Handle  pruicssHandle 
)

Sets the HSR LRE Mode.

Parameters
modeHSR mode to set.
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
RED_OK on Success, RED_ERR on Failure

◆ getLreSwitchingEndNode()

SwitchingEndNode_t getLreSwitchingEndNode ( void  )

Returns the SwitchingEndNode status.

Returns
The switching end node functionality

◆ getLreRedBoxIdentity()

LreRedBoxIdentity_t getLreRedBoxIdentity ( void  )

Returns the LRE RedBox Identity.

Returns
Always REDBOX_ID1A for the AM335x PRP/HSR implementation.

◆ getLreEvaluateSupervision()

LreTruthValue_t getLreEvaluateSupervision ( void  )

True if the LRE evaluates received supervision frames. False if it drops the supervision frames without evaluating.

Returns
Always LRE_TRUE for the AM335x PRP/HSR implementation.

◆ setLreNodeTableClear()

RED_STATUS setLreNodeTableClear ( hsrPrpHandle ,
LreTableOperation_t  action 
)

Clears the node table if action is "clearNodeTable". No action is performed if action is noOp.

Parameters
action- noOp (0), clearNodeTable (1)
Returns
RED_OK, always

◆ setLreProxyNodeTableClear()

RED_STATUS setLreProxyNodeTableClear ( LreTableOperation_t  action)

Clears the Proxy Node Table if action is "clearProxyNodeTable". No action is performed if action is noOp.

Parameters
action- noOp (0), clearProxyNodeTable (1)
Returns
RED_ERR, always

◆ getLreInterfaceStats()

RED_STATUS getLreInterfaceStats ( LreIfStat_t  stat,
int32_t *  value,
PRUICSS_Handle  pruicssHandle 
)

Returns a single entry of LREInterfaceStatsEntry (see IEC-62439-3-MIB DEFINITIONS). The requested entry is specified by stat.

Parameters
stat- designates the LREInterfaceStatsEntry to be returned
value- returns the MIB LREInterfaceStatsEntry designated by stat
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
RED_OK, always

◆ getLreInterfaceStatBase()

const int32_t* getLreInterfaceStatBase ( PRUICSS_Handle  pruicssHandle)

Returns the base address of the LREInterfaceStatsEntry (see IEC-62439-3-MIB DEFINITIONS) in the ICSS shared RAM. Using this base address, the host can read the whole LREInterfaceStatsEntry at once.

Parameters
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
Base address of LREInterfaceStatsEntry in ICSS shared memory

◆ getLreNodeTableSize()

int32_t getLreNodeTableSize ( PRUICSS_Handle  pruicssHandle)

Returns the node table size. Use this function to determine the size of the buffer to pass to getLreNodeTable.

Parameters
pruicssHandleHandle to PRU ICSS instance. Contains pointers to base addresses
Returns
The size of the node table in entries, -1 on Failure.

◆ getLreNodeTable()

int32_t getLreNodeTable ( RED_NODE_TABLE pNodeTable,
hsrPrpHandle hsrPrphandle 
)

Copies the complete node table to pNodeTable.

Parameters
pNodeTablePointer to memory capable of holding getLreNodeTableSize() node table entries.
hsrPrphandle
Returns
Number of entries in the node table, -1 on Failure.

◆ getLreRemNodeType()

RemNodeType_t getLreRemNodeType ( uint8_t  nodeEntryStatus)

Gets the type of a remote node.

Parameters
nodeEntryStatusvalue to evaluate
Returns
type of remote node