AM64x MCU+ SDK  08.03.00
hsrPrp_red_hsr.h
Go to the documentation of this file.
1 
38 #ifndef RED_HSR_H_
39 #define RED_HSR_H_
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
45 
46 
47 /* ========================================================================== */
48 /* Include Files */
49 /* ========================================================================== */
50 
51 #include "hsrPrp_red_common.h"
52 #include "hsrPrp_handle.h"
53 /* ========================================================================== */
54 /* Macros & Typedefs */
55 /* ========================================================================== */
56 
57 #define ETHER_TYPE_HSR ( 0x892F )
58 #define ETHER_TYPE_HSR_SUP ( ETHER_TYPE_RED_SUP )
59 
60 #define HSR_TAG_SIZE ( 6 )
61 #define HSR_TAG_PATHID_OFFSET ( 2 )
62 #define HSR_LAN_A_MAGIC ( 0x00 )
63 #define HSR_LAN_B_MAGIC ( 0x01 )
65 #define HSR_TLV1_TYPE ( 23 )
67 #define HSR_SUP_SIZE ( RED_SUP_SIZE )
68 #define HSR_SUP_PATH ( RED_SUP_PATH )
69 #define HSR_SUP_VER ( RED_SUP_VER )
70 #define HSR_SUP_PAD ( RED_SUP_PAD )
71 
73 typedef struct _HSR_TAG
74 {
75 
76  uint16_t ether_type;
77  uint16_t path_and_size;
78  uint16_t seq_nr;
80 } HSR_TAG;
81 
83 typedef struct _HSR_SUP_FRAME
84 {
85 
86  uint8_t dst[ETHER_ADDR_LEN];
87  uint8_t src[ETHER_ADDR_LEN];
93  uint8_t padding[HSR_SUP_PAD];
96 
97 /* ========================================================================== */
98 /* Function Declarations */
99 /* ========================================================================== */
113  const uint8_t *pFrame,
114  int32_t frameSize);
123 void HsrFrameUpdatePathId(RED_FRAME *pRedFrame, uint16_t pathId);
139 void HsrSupFrameUpdateSrcAdd(RED_FRAME *pRedFrame, uint8_t *srcAdd);
149 void HsrSupFrameUpdatePathId(RED_FRAME *pRedFrame, uint16_t pathId);
166 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif /* RED_HSR_H_ */
HsrSupFrameUpdateSrcAdd
void HsrSupFrameUpdateSrcAdd(RED_FRAME *pRedFrame, uint8_t *srcAdd)
Updates Source Address of a HSR Supervision frame.
HsrSupFrameAllocate
RED_FRAME * HsrSupFrameAllocate(hsrPrpHandle *)
Allocates a RED_FRAME that holds HSR Supervision frame.
SUP_TAG
Definition: hsrPrp_red_common.h:107
HSR_TAG
Definition: hsrPrp_red_hsr.h:74
ETHER_ADDR_LEN
#define ETHER_ADDR_LEN
Definition: hsrPrp_red_common.h:83
TLV1_TAG
Definition: hsrPrp_red_common.h:117
HSR_SUP_PAD
#define HSR_SUP_PAD
Definition: hsrPrp_red_hsr.h:70
hsrPrpHandle
struct hsrPrp_Config_s hsrPrpHandle
Definition: hsrPrp_handle.h:92
HSR_SUP_FRAME::tlv2_tag
TLV2_TAG tlv2_tag
Definition: hsrPrp_red_hsr.h:91
HSR_TAG::seq_nr
uint16_t seq_nr
Definition: hsrPrp_red_hsr.h:78
HSR_SUP_FRAME
Definition: hsrPrp_red_hsr.h:84
HSR_SUP_FRAME::hsr_tag
HSR_TAG hsr_tag
Definition: hsrPrp_red_hsr.h:88
hsrPrp_red_common.h
Commonly used Macros, structures and Offsets.
HsrFrameFill
void HsrFrameFill(hsrPrpHandle *, RED_FRAME *pRedFrame, const uint8_t *pFrame, int32_t frameSize)
HsrSupFrameUpdatePathId
void HsrSupFrameUpdatePathId(RED_FRAME *pRedFrame, uint16_t pathId)
TLV2_TAG
Definition: hsrPrp_red_common.h:127
HSR_TAG::ether_type
uint16_t ether_type
Definition: hsrPrp_red_hsr.h:76
hsrPrp_handle.h
Include file for hsrPrp_red_hsr.c.
HSR_SUP_FRAME::tlv0_tag
TLV0_TAG tlv0_tag
Definition: hsrPrp_red_hsr.h:92
HsrFrameUpdatePathId
void HsrFrameUpdatePathId(RED_FRAME *pRedFrame, uint16_t pathId)
Updates PATH ID of a RED_FRAME.
TLV0_TAG
Definition: hsrPrp_red_common.h:137
HsrSupFrameUpdateSeqNr
void HsrSupFrameUpdateSeqNr(hsrPrpHandle *, RED_FRAME *pRedFrame)
RED_FRAME
Definition: hsrPrp_red_common.h:146
HsrSupFrameIncrementSeqNr
void HsrSupFrameIncrementSeqNr(hsrPrpHandle *)
HSR_SUP_FRAME::sup_tag
SUP_TAG sup_tag
Definition: hsrPrp_red_hsr.h:89
HSR_TAG::path_and_size
uint16_t path_and_size
Definition: hsrPrp_red_hsr.h:77
HSR_SUP_FRAME::tlv1_tag
TLV1_TAG tlv1_tag
Definition: hsrPrp_red_hsr.h:90