From: svaidhya Date: Sat, 4 May 2024 09:38:59 +0000 (+0530) Subject: [Epic-Id: ODUHIGH-576] [Task-Id: ODUHIGH-586] [SubTask-Id: ODUHIGH-591]| NFAPI_BRANCH... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=4d1b11004abc140062514f76438501311cfffa10;p=o-du%2Fl2.git [Epic-Id: ODUHIGH-576] [Task-Id: ODUHIGH-586] [SubTask-Id: ODUHIGH-591]| NFAPI_BRANCH |Adding Post Packing Functions Change-Id: I34b04460e2a90c66c1d03c228f7982cc890477e3 Signed-off-by: svaidhya --- diff --git a/build/common/pnf_stub.mak b/build/common/pnf_stub.mak index 4a7c14d1b..2123b3450 100644 --- a/build/common/pnf_stub.mak +++ b/build/common/pnf_stub.mak @@ -35,6 +35,7 @@ lib: $(LIB_DIR)/libpnf.a include $(COM_BUILD_DIR)/compile.mak I_OPTS+=-I$(ROOT_DIR)/src/mt +I_OPTS+=-I$(ROOT_DIR)/src/intel_fapi #-------------------------------------------------------------# #Linker macros diff --git a/src/5gnrmac/lwr_mac.h b/src/5gnrmac/lwr_mac.h index 687286fa7..4a9ad3e7a 100644 --- a/src/5gnrmac/lwr_mac.h +++ b/src/5gnrmac/lwr_mac.h @@ -50,6 +50,9 @@ typedef enum{ CONFIG_REQUEST, CONFIG_RESPONSE, START_REQUEST, +#ifdef NFAPI_ENABLED + START_RESPONSE, +#endif STOP_REQUEST, MAX_EVENT }EventState; diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index c7478276f..bca67c557 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -1887,7 +1887,7 @@ uint8_t lwr_mac_procParamRspEvt(void *msg) } } MAC_FREE(cellParam, sizeof(ClCellParam)); - sendToLowerMac(FAPI_CONFIG_REQUEST, 0, (void *)NULL); + sendEventToLowerMacFsm(FAPI_CONFIG_REQUEST, 0, (void *)NULL); return ROK; } else @@ -4921,7 +4921,7 @@ lwrMacFsmHdlr fapiEvtHdlr[MAX_STATE][MAX_EVENT] = * * @details * - * Function : sendToLowerMac + * Function : sendEventToLowerMacFsm * * Functionality: * -Sends message to LowerMac @@ -4933,7 +4933,7 @@ lwrMacFsmHdlr fapiEvtHdlr[MAX_STATE][MAX_EVENT] = * @return void * ******************************************************************/ -void sendToLowerMac(uint16_t msgType, uint32_t msgLen, void *msg) +void sendEventToLowerMacFsm(uint16_t msgType, uint32_t msgLen, void *msg) { lwrMacCb.event = msgType; fapiEvtHdlr[lwrMacCb.phyState][lwrMacCb.event](msg); diff --git a/src/5gnrmac/lwr_mac_fsm.h b/src/5gnrmac/lwr_mac_fsm.h index 067a3cd7a..b46c101a1 100644 --- a/src/5gnrmac/lwr_mac_fsm.h +++ b/src/5gnrmac/lwr_mac_fsm.h @@ -67,7 +67,7 @@ uint8_t lwr_mac_procParamRspEvt(void *msg); uint8_t lwr_mac_procConfigReqEvt(void *msg); uint8_t lwr_mac_procConfigRspEvt(void *msg); uint8_t lwr_mac_procStartReqEvt(void *msg); -void sendToLowerMac(uint16_t, uint32_t, void *); +void sendEventToLowerMacFsm(uint16_t, uint32_t, void *); void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg); uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo); typedef uint8_t (*lwrMacFsmHdlr)(void *); diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index 5c22704f5..cf51a7350 100644 --- a/src/5gnrmac/lwr_mac_handle_phy.c +++ b/src/5gnrmac/lwr_mac_handle_phy.c @@ -570,18 +570,18 @@ void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg) DU_LOG("\nDEBUG --> LWR_MAC: Received FAPI_VENDOR_EXT_UL_IQ_SAMPLES"); //send config req uint16_t cellId = 1; - sendToLowerMac(CONFIG_REQUEST, 0, (void *)&cellId); + sendEventToLowerMacFsm(CONFIG_REQUEST, 0, (void *)&cellId); break; } #endif case FAPI_PARAM_RESPONSE: { - sendToLowerMac(PARAM_RESPONSE, msgSize, msg); + sendEventToLowerMacFsm(PARAM_RESPONSE, msgSize, msg); break; } case FAPI_CONFIG_RESPONSE: { - sendToLowerMac(CONFIG_RESPONSE, msgSize, msg); + sendEventToLowerMacFsm(CONFIG_RESPONSE, msgSize, msg); break; } case FAPI_SLOT_INDICATION: diff --git a/src/5gnrmac/mac_cfg_hdl.c b/src/5gnrmac/mac_cfg_hdl.c index bfac69cbd..6f385c21a 100644 --- a/src/5gnrmac/mac_cfg_hdl.c +++ b/src/5gnrmac/mac_cfg_hdl.c @@ -473,9 +473,9 @@ uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm) { cellId = &schCellCfgCfm->cellId; #ifdef INTEL_TIMER_MODE - sendToLowerMac(UL_IQ_SAMPLE, 0, (void *)cellId); + sendEventToLowerMacFsm(UL_IQ_SAMPLE, 0, (void *)cellId); #else - sendToLowerMac(CONFIG_REQUEST, 0, (void *)cellId); + sendEventToLowerMacFsm(CONFIG_REQUEST, 0, (void *)cellId); #endif } else diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 509b04ff3..b26aa8681 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -515,7 +515,7 @@ uint8_t MacProcCellStart(Pst *pst, CellStartInfo *cellStart) { DU_LOG("\nINFO --> MAC : Handling cell start request"); gConfigInfo.gSlotCount = 0; - sendToLowerMac(START_REQUEST, 0, cellStart); + sendEventToLowerMacFsm(START_REQUEST, 0, cellStart); MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStart, \ sizeof(CellStartInfo)); diff --git a/src/5gnrsch/sch_msg_router.c b/src/5gnrsch/sch_msg_router.c index 4cbd9581e..48d3fa9be 100755 --- a/src/5gnrsch/sch_msg_router.c +++ b/src/5gnrsch/sch_msg_router.c @@ -180,7 +180,7 @@ void callFlowSchMsgRouter(Pst *pst) strcpy(message,"EVENT_DL_CQI_TO_SCH"); break; } - case EVENT_PHR_IND_TO_SCH + case EVENT_PHR_IND_TO_SCH: { strcpy(message,"EVENT_PHR_IND_TO_SCH"); } diff --git a/src/cm/ssi.x b/src/cm/ssi.x index 7a032d89a..dab9c4dbc 100755 --- a/src/cm/ssi.x +++ b/src/cm/ssi.x @@ -937,10 +937,13 @@ S16 rdConQ ARGS((Data data)); S16 SPkS8 ARGS((S8 val,Buffer *mBuf)); S16 oduUnpackUInt8 ARGS((uint8_t val,Buffer *mBuf)); +S16 oduPackPostUInt8 ARGS((uint8_t val,Buffer *mBuf)); S16 SPkS16 ARGS((S16 val,Buffer *mBuf)); S16 oduUnpackUInt16 ARGS((uint16_t val,Buffer *mBuf)); +S16 oduPackPostUInt16 ARGS((uint16_t val,Buffer *mBuf)); S16 SPkS32 ARGS((S32 val,Buffer *mBuf)); S16 oduUnpackUInt32 ARGS((uint32_t val,Buffer *mBuf)); +S16 oduPackPostUInt32 ARGS((uint32_t val,Buffer *mBuf)); /* ssi_x_001.main_49 : added packing of F32 and F64*/ #ifdef SS_FLOAT S16 SPkF32 ARGS((F32 val,Buffer *mBuf)); diff --git a/src/mt/ss_pack.c b/src/mt/ss_pack.c index 2f9635a65..6748f4f4e 100644 --- a/src/mt/ss_pack.c +++ b/src/mt/ss_pack.c @@ -135,6 +135,33 @@ Buffer *mBuf /* message buffer */ #endif return (ret); } /* end of oduUnpackUInt8 */ + +/* +* +* Fun: oduPackPostUInt8 +* +* Desc: This function packs an unsigned 8 bit value into a message. +* +* Ret: ROK - ok +* RFAILED - failed, general (optional) +* ROUTRES - failed, out of resources (optional) +* +* Notes: None +* +* File: ss_pack.c +* +*/ +S16 oduPackPostUInt8 +( +uint8_t val, /* value */ +Buffer *mBuf /* message buffer */ +) +{ + S16 ret; /* return code */ + ret = SAddPstMsg((Data) val, mBuf); + return (ret); +} /* end of oduPackPostUInt8 */ + /* * @@ -217,6 +244,37 @@ Buffer *mBuf /* message buffer */ return (ret); } /* end of oduUnpackUInt16 */ +/* +* +* Fun: oduPackPostUInt16 +* +* Desc: This function packs an unsigned 16 bit value into a message. +* +* Ret: ROK - ok +* RFAILED - failed, general (optional) +* ROUTRES - failed, out of resources (optional) +* +* Notes: None +* +* File: ss_pack.c +* +*/ + +S16 oduPackPostUInt16 +( +uint16_t val, /* value */ +Buffer *mBuf /* message buffer */ +) +{ + Data pkArray[2]; /* array for packing */ + S16 ret; /* return code */ + + pkArray[1] = (Data) GetHiByte(val); + pkArray[0] = (Data) GetLoByte(val); + ret = SAddPstMsgMult(pkArray, (MsgLen) 2, mBuf); + return (ret); +} /* end of oduPackPostUInt16 */ + /* * @@ -317,6 +375,42 @@ Buffer *mBuf /* message buffer */ return (ret); } /* end of oduUnpackUInt32 */ +/* +* +* Fun: oduPackPostUInt32 +* +* Desc: This function packs an unsigned 32 bit value into a message. +* +* Ret: ROK - ok +* RFAILED - failed, general (optional) +* ROUTRES - failed, out of resources (optional) +* +* Notes: None +* +* File: ss_pack.c +* +*/ + +S16 oduPackPostUInt32 +( +uint32_t val, /* value */ +Buffer *mBuf /* message buffer */ +) +{ + uint16_t tmp; /* temporary value */ + Data pkArray[4]; /* packing array */ + S16 ret; /* return code */ + + tmp = (uint16_t) GetHiWord(val); + pkArray[3] = (Data) GetHiByte(tmp); + pkArray[2] = (Data) GetLoByte(tmp); + tmp = (uint16_t) GetLoWord(val); + pkArray[1] = (Data) GetHiByte(tmp); + pkArray[0] = (Data) GetLoByte(tmp); + ret = SAddPstMsgMult(pkArray, (MsgLen) 4, mBuf); + return (ret); +} /* end of oduPackPostUInt32 */ + /*ss038.103 1. Added Floating point support*/ #ifdef SS_FLOAT /*