X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_ex_ms.c;h=387351b9d757a63c75a541702dee3659a9b3ae2c;hb=de6a435729e3cad9d4a66329080b8206a64f452c;hp=052e450c9ad897344b7658acc2ffe8245c04cd6e;hpb=2dc9d6735bc5ff973a761b7d6b3f71f97e95d60e;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_ex_ms.c b/src/5gnrmac/lwr_mac_ex_ms.c index 052e450c9..387351b9d 100644 --- a/src/5gnrmac/lwr_mac_ex_ms.c +++ b/src/5gnrmac/lwr_mac_ex_ms.c @@ -19,8 +19,16 @@ /* This file is the entry point for Lower MAC */ #include "common_def.h" +#include "mac_utils.h" #include "lwr_mac_fsm.h" #include "lwr_mac_phy.h" +#ifdef INTEL_FAPI +#include "nr5g_fapi_internal.h" +#include "fapi_vendor_extension.h" +#endif +#ifndef INTEL_WLS_MEM +#include "lwr_mac_phy_stub_inf.h" +#endif /************************************************************************** * @brief Task Initiation callback function. @@ -47,6 +55,84 @@ uint8_t lwrMacActvInit(Ent entity, Inst inst, Region region, Reason reason) return ROK; } +/************************************************************************** +* @brief function prints src, dest, msg info about all the msgs received +* +* @details +* +* Function : callFlowlwrMacActvTsk +* +* Functionality: +* function prints src, dest, msg info about all the msgs received +* +* @param[in] Pst *pst +* +* @return void +***************************************************************************/ + +void callFlowlwrMacActvTsk(Pst *pst) +{ + char sourceTask[50]; + char destTask[50]="ENTLWRMAC"; + char message[100]; + + switch(pst->srcEnt) + { + case ENTLWRMAC: + { + strcpy(sourceTask,"ENTLWRMAC"); + switch(pst->event) + { +#ifdef INTEL_WLS_MEM + case EVT_START_WLS_RCVR: + { + strcpy(message,"EVT_START_WLS_RCVR"); + break; + } +#endif + default: + { + strcpy(message,"Invalid Event"); + break; + } + } + break; + } + +#ifndef INTEL_WLS_MEM + case ENTPHYSTUB: + { + strcpy(sourceTask,"PHY"); + switch(pst->event) + { + case EVT_PHY_STUB_SLOT_IND: + { + strcpy(message,"EVT_PHY_STUB_SLOT_IND"); + break; + } + + case EVT_PHY_STUB_STOP_IND: + { + strcpy(message,"EVT_PHY_STUB_STOP_IND"); + break; + } + default: + { + strcpy(message,"Invalid Event"); + break; + } + } + break; + } +#endif + + default: + { + strcpy(sourceTask,"Invalid Source Entity Id"); + } + } + DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message); +} /************************************************************************** * @brief Task Activation callback function. * @@ -71,41 +157,82 @@ uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf) { uint8_t ret = ROK; +#ifdef CALL_FLOW_DEBUG_LOG + callFlowlwrMacActvTsk(pst); +#endif + switch(pst->srcEnt) { case ENTLWRMAC: - { - switch(pst->event) - { + { + switch(pst->event) + { #ifdef INTEL_WLS_MEM - case EVT_START_WLS_RCVR: - { - ODU_PUT_MSG_BUF(mBuf); - - /* Allocate memory for intial UL transmission */ - LwrMacEnqueueWlsBlock(); - - /* Start thread to receive from L1 */ - DU_LOG("\nINFO --> LWR MAC: Starting WLS receiver thread"); - LwrMacRecvPhyMsg(); - break; - } + case EVT_START_WLS_RCVR: + { + ODU_PUT_MSG_BUF(mBuf); + + /* Allocate memory for intial UL transmission */ + LwrMacEnqueueWlsBlock(); + + /* Start thread to receive from L1 */ + DU_LOG("\nINFO --> LWR MAC: Starting WLS receiver thread"); + LwrMacRecvPhyMsg(); + break; + } #endif - default: - { - SPutMsg(mBuf); - DU_LOG("\nERROR --> LWR MAC: Invalid event %d received", pst->event); - ret = RFAILED; - } - } - break; - } + default: + { + ODU_PUT_MSG_BUF(mBuf); + DU_LOG("\nERROR --> LWR MAC: Invalid event %d received", pst->event); + ret = RFAILED; + } + } + break; + } + +#ifndef INTEL_WLS_MEM + case ENTPHYSTUB: + { + switch(pst->event) + { + case EVT_PHY_STUB_SLOT_IND: + { + fapi_slot_ind_t *slotIndMsg; + + CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndMsg, mBuf); + ODU_PUT_MSG_BUF(mBuf); + + procPhyMessages(slotIndMsg->header.msg_id, sizeof(fapi_slot_ind_t), (void*)slotIndMsg); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, slotIndMsg, sizeof(fapi_slot_ind_t)); + break; + } + + case EVT_PHY_STUB_STOP_IND: + { + fapi_stop_ind_t *stopIndMsg; + CMCHKUNPK(oduUnpackPointer, (PTR *)&stopIndMsg, mBuf); + ODU_PUT_MSG_BUF(mBuf); + + procPhyMessages(stopIndMsg->header.msg_id, sizeof(fapi_stop_ind_t), (void*)stopIndMsg); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, stopIndMsg, sizeof(fapi_stop_ind_t)); + break; + } + default: + { + DU_LOG("\nERROR --> LWR_MAC: Invalid event %d received from PHY STUB", pst->event); + } + } + break; + } +#endif + default: - { - SPutMsg(mBuf); - DU_LOG("\nERROR --> LWR MAC: Message from invalid source entity %d", pst->srcEnt); - ret = RFAILED; - } + { + ODU_PUT_MSG_BUF(mBuf); + DU_LOG("\nERROR --> LWR MAC: Message from invalid source entity %d", pst->srcEnt); + ret = RFAILED; + } } return ret; }