add utility functions.

This commit is contained in:
Gatsby Van
2023-12-20 19:42:26 +08:00
parent acaf8da733
commit ee149c040e
+11 -1
View File
@@ -153,18 +153,28 @@ int32_t ServiceNet_PktHandler(L2_INST* instPtr);
int32_t ServiceNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* schedEntry); int32_t ServiceNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* schedEntry);
// Miscellaneous // Miscellaneous
uint8_t L2_GetNodeId(L2_INST* instPtr);
uint8_t L2_GetClusterId(L2_INST* instPtr);
uint8_t L2_GetHeadId(L2_INST* instPtr);
L2_NODE_TYPE L2_GetNodeType(L2_INST* instPtr);
L2_NODE_STATE L2_GetMainState(L2_INST* instPtr); L2_NODE_STATE L2_GetMainState(L2_INST* instPtr);
L2_RTT_FSM* L2_GetRttDesc(L2_INST* instPtr); L2_RTT_FSM* L2_GetRttFsm(L2_INST* instPtr);
bool L2_isDataAvail(L2_INST* instPtr); bool L2_isDataAvail(L2_INST* instPtr);
bool L2_isCxn2Net(L2_INST* instPtr); bool L2_isCxn2Net(L2_INST* instPtr);
void L2_RcdShift(L2_RCD* rcd, int32_t netxVal); void L2_RcdShift(L2_RCD* rcd, int32_t netxVal);
uint32_t L2_GetFrameLen(L2_FRAME_TYPE l2FrameType); uint32_t L2_GetFrameLen(L2_FRAME_TYPE l2FrameType);
uint32_t L2_GetLastFrameNum(L2_INST* instPtr); uint32_t L2_GetLastFrameNum(L2_INST* instPtr);
uint32_t L2_GetLastSlotNum(L2_INST* instPtr); uint32_t L2_GetLastSlotNum(L2_INST* instPtr);
L2_FRAME_TYPE L2_GetLastFrameType(L2_INST* instPtr);
L2_TOR_TYPE L2_GetLastTor(L2_INST* instPtr);
uint32_t L2_GetCurrentFrameNum(L2_INST* instPtr); uint32_t L2_GetCurrentFrameNum(L2_INST* instPtr);
uint32_t L2_GetCurrentSlotNum(L2_INST* instPtr); uint32_t L2_GetCurrentSlotNum(L2_INST* instPtr);
L2_FRAME_TYPE L2_GetCurrentFrameType(L2_INST* instPtr);
L2_TOR_TYPE L2_GetCurrentTor(L2_INST* instPtr);
uint32_t L2_GetNextFrameNum(L2_INST* instPtr); uint32_t L2_GetNextFrameNum(L2_INST* instPtr);
uint32_t L2_GetNextSlotNum(L2_INST* instPtr); uint32_t L2_GetNextSlotNum(L2_INST* instPtr);
L2_FRAME_TYPE L2_GetNextFrameType(L2_INST* instPtr);
L2_TOR_TYPE L2_GetNextTor(L2_INST* instPtr);
// Time syncronization // Time syncronization
int32_t L2_TimeAlign(L2_INST* instPtr, uint32_t frameNum, uint32_t slotNum); int32_t L2_TimeAlign(L2_INST* instPtr, uint32_t frameNum, uint32_t slotNum);