X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_stop_ind.c;h=6238dce9b09ef85529815111ef06c1a7810c5632;hb=de6a435729e3cad9d4a66329080b8206a64f452c;hp=3249eb1e26881416d2bd32c43b07d67ce31c2782;hpb=0fccb83e55b237d60cf451bab71a0c7242cc6e66;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_stop_ind.c b/src/5gnrmac/mac_stop_ind.c index 3249eb1e2..6238dce9b 100644 --- a/src/5gnrmac/mac_stop_ind.c +++ b/src/5gnrmac/mac_stop_ind.c @@ -16,32 +16,59 @@ ################################################################################ *******************************************************************************/ /* header include files (.h) */ -#include "envopt.h" /* environment options */ -#include "envdep.h" /* environment dependent */ -#include "envind.h" /* environment independent */ -#include "gen.h" /* general */ -#include "ssi.h" /* system services */ -#include "cm_tkns.h" /* Common Token Defines */ -#include "cm_llist.h" /* Common Link List Defines */ -#include "cm_hash.h" /* Common Hash List Defines */ -#include "cm_mblk.h" /* common memory link list library */ -#include "cm_lte.h" /* Common LTE Defines */ -#include "tfu.h" /* RGU Interface includes */ +#include "common_def.h" #include "lrg.h" -#include "gen.x" /* general */ -#include "ssi.x" /* system services */ -#include "cm5.x" /* system services */ -#include "cm_tkns.x" /* Common Token Definitions */ -#include "cm_llist.x" /* Common Link List Definitions */ -#include "cm_lib.x" /* Common Library Definitions */ -#include "cm_hash.x" /* Common Hash List Definitions */ -#include "cm_mblk.x" /* common memory link list library */ -#include "cm_lte.x" /* Common LTE Defines */ -#include "tfu.x" /* RGU Interface includes */ #include "lrg.x" #include "du_app_mac_inf.h" +#include "mac_sch_interface.h" +#include "lwr_mac_upr_inf.h" +#include "rlc_mac_inf.h" #include "mac.h" -#include "du_log.h" +#include "mac_upr_inf_api.h" +#include "mac_utils.h" + +/******************************************************************* + * + * @brief Send stop indication to DU APP + * + * @details + * + * Function : sendStopIndToDuApp + * + * Functionality: + * Send stop indication to DU APP + * + * @params[in] Pst info + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t sendStopIndToDuApp(uint16_t cellId) +{ + Pst pst; + uint8_t ret = ROK; + OduCellId *oduCellId; + + /* Allocate sharable memory */ + MAC_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId)); + if(!oduCellId) + { + DU_LOG("\nERROR --> MAC : Stop Indication memory allocation failed"); + return RFAILED; + } + oduCellId->cellId = cellId; + + /* Fill Pst */ + FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_STOP_IND); + + ret = MacDuAppStopInd(&pst, oduCellId); + if(ret != ROK) + { + DU_LOG("\nERROR --> MAC: Failed to send stop indication to DU APP"); + MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, oduCellId, sizeof(OduCellId)); + } + return ROK; +} /******************************************************************* * @brief process Stop indication to MAC @@ -51,13 +78,18 @@ * Function : fapiMacStopInd * * @param[in] Pst *pst - * @return S16 + * @return * -# ROK * -# RFAILED ******************************************************************/ -PUBLIC S16 fapiMacStopInd(Pst *pst) +uint8_t fapiMacStopInd(Pst *pst, uint16_t *cellId) { uint8_t ret = ROK; - ret = sendStopIndMacToDuApp(); + ret = sendStopIndToDuApp(*cellId); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(uint16_t)); return ret; } + +/********************************************************************** + End of file + ***********************************************************************/