X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_mac_inf.c;h=75ff5c1e168e632c544e184de9d050efa5a9cfdc;hb=4d45b914f9e94203603d3b9fdbcb1aad361301dd;hp=ba446929c03d4a5c92ca5cad59216f8c463ae829;hpb=e4e50f696285e2554d237169091026bf9f1b6257;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.c b/src/cm/du_app_mac_inf.c index ba446929c..75ff5c1e1 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -17,10 +17,6 @@ *******************************************************************************/ #include "common_def.h" -#include "ss_queue.h" -#include "ss_task.h" -#include "ss_msg.h" -#include "du_cfg.h" #include "du_app_mac_inf.h" /************************************************************************** @@ -40,7 +36,7 @@ * RFAILED - failure * ***************************************************************************/ -int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) +uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) { if(pst->selector == ODU_SELECTOR_LC) { @@ -51,16 +47,16 @@ int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)macCellCfg, mBuf); + CMCHKPK(oduPackPointer,(PTR)macCellCfg, mBuf); DU_LOG("\nDU-APP : MAC CELL config sent"); - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } return ROK; } @@ -83,18 +79,15 @@ int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) * RFAILED - failure * ***************************************************************************/ -int unpackDuMacCellCfg( - DuMacCellCfgReq func, - Pst *pst, - Buffer *mBuf) +uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf) { - U16 ret = ROK; + uint16_t ret = ROK; MacCellCfg *macCellCfg; if(pst->selector == ODU_SELECTOR_LWLC) { /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&macCellCfg, mBuf); ret = (*func)(pst, macCellCfg); } else @@ -123,21 +116,21 @@ int unpackDuMacCellCfg( * RFAILED - failure * ***************************************************************************/ -int packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) +uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) { if(pst->selector == ODU_SELECTOR_LC) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { return RFAILED; } /* pack the transaction ID in CNF structure */ - CMCHKPK(SPkU8, macCellCfgCfm->rsp, mBuf); - CMCHKPK(SPkU16, macCellCfgCfm->transId, mBuf); + CMCHKPK(oduUnpackUInt16, macCellCfgCfm->cellId, mBuf); + CMCHKPK(oduUnpackUInt8, macCellCfgCfm->rsp, mBuf); - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } else if(pst->selector == ODU_SELECTOR_LWLC) { @@ -164,19 +157,15 @@ int packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) * RFAILED - failure * ***************************************************************************/ -int unpackMacCellCfgCfm( - DuMacCellCfgCfm func, - Pst *pst, - Buffer *mBuf) +uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf) { MacCellCfgCfm macCellCfgCfm; if(pst->selector == ODU_SELECTOR_LC) { /* unpack the transaction ID in CNF structure */ - CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf); - CMCHKUNPK(SUnpkU8, &(macCellCfgCfm.rsp), mBuf); - + CMCHKUNPK(oduPackUInt8, &(macCellCfgCfm.rsp), mBuf); + CMCHKUNPK(oduPackUInt16, &(macCellCfgCfm.cellId), mBuf); return (*func)(pst, &macCellCfgCfm); } else @@ -203,7 +192,7 @@ int unpackMacCellCfgCfm( * RFAILED - failure * * ****************************************************************/ -uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo) +uint8_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo) { Buffer *mBuf = NULLP; @@ -215,17 +204,17 @@ uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo) else if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nDU APP : Memory allocation failed for cell start req pack"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)cellStartInfo, mBuf); + CMCHKPK(oduPackPointer,(PTR)cellStartInfo, mBuf); } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -246,21 +235,21 @@ uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf) { MacCellStartInfo *cellStartInfo; if(pst->selector == ODU_SELECTOR_LWLC) { /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStartInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStartInfo, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, cellStartInfo); } else { /* Nothing to do for loose coupling */ - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return ROK; } } @@ -282,7 +271,7 @@ uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo) +uint8_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo) { if(pst->selector == ODU_SELECTOR_LC) { @@ -293,16 +282,16 @@ uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nDU APP : Memory allocation failed for cell stop req pack"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)cellStopInfo, mBuf); + CMCHKPK(oduPackPointer,(PTR)cellStopInfo, mBuf); - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } return ROK; } @@ -325,21 +314,21 @@ uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf) { MacCellStopInfo *cellStopInfo; if(pst->selector == ODU_SELECTOR_LWLC) { /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStopInfo, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, cellStopInfo); } else { /* Nothing to do for loose coupling */ - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return ROK; } } @@ -361,11 +350,11 @@ uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo ) +uint8_t packMacSlotInd(Pst *pst, SlotIndInfo *slotInfo ) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nDU APP : Memory allocation failed for cell start req pack"); return RFAILED; @@ -373,24 +362,24 @@ uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo ) if(pst->selector == ODU_SELECTOR_LC) { - CMCHKPK(SPkU16, slotInfo->cellId, mBuf); - CMCHKPK(SPkU16, slotInfo->sfn, mBuf); - CMCHKPK(SPkU16, slotInfo->slot, mBuf); + CMCHKPK(oduUnpackUInt16, slotInfo->cellId, mBuf); + CMCHKPK(oduUnpackUInt16, slotInfo->sfn, mBuf); + CMCHKPK(oduUnpackUInt16, slotInfo->slot, mBuf); - CM_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotInfo)); + CM_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotIndInfo)); slotInfo = NULL; } else if(pst->selector == ODU_SELECTOR_LWLC) { /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)slotInfo, mBuf); + CMCHKPK(oduPackPointer,(PTR)slotInfo, mBuf); } else { - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -411,33 +400,33 @@ uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo ) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - SlotInfo *slotInfo; + SlotIndInfo *slotInfo; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&slotInfo, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, slotInfo); } else if(pst->selector == ODU_SELECTOR_LC) { - SlotInfo slotInfo; + SlotIndInfo slotInfo; - CMCHKUNPK(SUnpkU16, &(slotInfo.slot), mBuf); - CMCHKUNPK(SUnpkU16, &(slotInfo.sfn), mBuf); - CMCHKUNPK(SUnpkU16, &(slotInfo.cellId), mBuf); + CMCHKUNPK(oduPackUInt16, &(slotInfo.slot), mBuf); + CMCHKUNPK(oduPackUInt16, &(slotInfo.sfn), mBuf); + CMCHKUNPK(oduPackUInt16, &(slotInfo.cellId), mBuf); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, &slotInfo); } else { /* Nothing to do for loose coupling */ - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return ROK; } return ROK; @@ -459,11 +448,11 @@ uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId) +uint8_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nDU APP : Memory allocation failed for stop Ind pack"); return RFAILED; @@ -473,21 +462,21 @@ uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId) { /*pack the payload here*/ DU_LOG("\nDU APP : Packed CellId"); - CMCHKPK(SPkU16, cellStopId->cellId, mBuf); + CMCHKPK(oduUnpackUInt16, cellStopId->cellId, mBuf); CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopId, sizeof(MacCellStopInfo)); cellStopId = NULL; } else if(pst->selector == ODU_SELECTOR_LWLC) { /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)cellStopId, mBuf); + CMCHKPK(oduPackPointer,(PTR)cellStopId, mBuf); } else { - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -508,29 +497,29 @@ uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { MacCellStopInfo *cellStopId; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopId, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStopId, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, cellStopId); } else if(pst->selector == ODU_SELECTOR_LC) { MacCellStopInfo cellStopId; - CMCHKUNPK(SUnpkU16, &(cellStopId.cellId), mBuf); + CMCHKUNPK(oduPackUInt16, &(cellStopId.cellId), mBuf); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, &cellStopId); } else { /* Nothing to do for loose coupling */ - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return ROK; } return ROK; @@ -553,19 +542,19 @@ uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) +uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) { Buffer *mBuf = NULLP; if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nMAC : Memory allocation failed at packMacUlCcchInd"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)ulCcchIndInfo, mBuf); + CMCHKPK(oduPackPointer,(PTR)ulCcchIndInfo, mBuf); } else { @@ -573,7 +562,7 @@ uint16_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -594,22 +583,22 @@ uint16_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { UlCcchIndInfo *ulCcchIndInfo; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&ulCcchIndInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&ulCcchIndInfo, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, ulCcchIndInfo); } else { /* Nothing to do for other selectors */ DU_LOG("\n Only LWLC supported for UL CCCH Ind "); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } return RFAILED; } @@ -632,19 +621,19 @@ uint16_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) +uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) { Buffer *mBuf = NULLP; if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nMAC : Memory allocation failed at packMacDlCcchInd"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)dlCcchIndInfo, mBuf); + CMCHKPK(oduPackPointer,(PTR)dlCcchIndInfo, mBuf); } else { @@ -652,7 +641,7 @@ uint16_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -673,22 +662,22 @@ uint16_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) * RFAILED - failure * * ****************************************************************/ -uint16_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf) +uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { DlCcchIndInfo *dlCcchIndInfo; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&dlCcchIndInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlCcchIndInfo, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, dlCcchIndInfo); } else { /* Nothing to do for other selectors */ DU_LOG("\n Only LWLC supported for DL CCCH Ind "); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } return RFAILED; @@ -718,13 +707,13 @@ uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg) if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nMAC : Memory allocation failed at packDuMacUeCreateReq"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf); + CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf); } else { @@ -732,7 +721,7 @@ uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg) return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -760,15 +749,15 @@ uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf) MacUeCfg *ueCfg; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&ueCfg, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, ueCfg); } else { /* Nothing to do for other selectors */ DU_LOG("\n Only LWLC supported for UE Create Request "); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } return RFAILED; @@ -796,13 +785,13 @@ uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp) if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nMAC : Memory allocation failed at packDuMacUeCfgRsp"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)cfgRsp, mBuf); + CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf); } else { @@ -810,7 +799,7 @@ uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp) return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -835,12 +824,12 @@ uint8_t unpackDuMacUeCreateRsp(DuMacUeCreateRspFunc func, Pst *pst, Buffer *mBuf MacUeCfgRsp *cfgRsp; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&cfgRsp, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); + ODU_PUT_MSG(mBuf); return (*func)(pst, cfgRsp); } - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return RFAILED; }