From: sphoorthi Date: Mon, 23 Nov 2020 10:36:06 +0000 (+0530) Subject: Ue Config Changes aligned with AAD X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=791615463ef2fcc0d6e0697d7860e6e6a56bd9a6;hp=bce97b3fc156581b450ccae095df357701289c78;p=o-du%2Fl2.git Ue Config Changes aligned with AAD Change-Id: I3a67586f5290526c353b479a45fd9dcf624e7538 Signed-off-by: sphoorthi --- diff --git a/src/5gnrmac/mac_ue_mgr.c b/src/5gnrmac/mac_ue_mgr.c index a7e3b2972..da91f174c 100644 --- a/src/5gnrmac/mac_ue_mgr.c +++ b/src/5gnrmac/mac_ue_mgr.c @@ -29,25 +29,25 @@ #include "mac_utils.h" /* function pointers for packing slot ind from mac to sch */ -MacSchUeCreateReqFunc macSchUeCreateReqOpts[] = +MacSchAddUeConfigReqFunc macSchAddUeConfigReqOpts[] = { - packMacSchUeCreateReq, /* packing for loosely coupled */ - MacSchUeCreateReq, /* packing for tightly coupled */ - packMacSchUeCreateReq /* packing for light weight loosely coupled */ + packMacSchAddUeConfigReq, /* packing for loosely coupled */ + MacSchAddUeConfigReq, /* packing for tightly coupled */ + packMacSchAddUeConfigReq /* packing for light weight loosely coupled */ }; -MacDuUeCfgRspFunc MacDuUeCfgRspOpts[] = +MacDuUeCfgRspFunc macDuUeCfgRspOpts[] = { packDuMacUeCfgRsp, /* packing for loosely coupled */ DuProcMacUeCfgRsp, /* packing for tightly coupled */ packDuMacUeCfgRsp /* packing for light weight loosly coupled */ }; -MacSchUeReconfigReqFunc macSchUeReconfigReqOpts[] = +MacSchModUeConfigReqFunc macSchModUeConfigReqOpts[] = { - packMacSchUeReconfigReq, /* packing for loosely coupled */ - MacSchUeReconfigReq, /* packing for tightly coupled */ - packMacSchUeReconfigReq /* packing for light weight loosely coupled */ + packMacSchModUeConfigReq, /* packing for loosely coupled */ + MacSchModUeConfigReq, /* packing for tightly coupled */ + packMacSchModUeConfigReq /* packing for light weight loosely coupled */ }; /******************************************************************* @@ -644,12 +644,12 @@ uint8_t sendUeReqToSch(Pst *pst, SchUeCfg *schUeCfg) switch(pst->event) { case EVENT_MAC_UE_CREATE_REQ: - FILL_PST_MAC_TO_SCH(schPst, EVENT_UE_CREATE_REQ_TO_SCH); - return(*macSchUeCreateReqOpts[schPst.selector])(&schPst, schUeCfg); + FILL_PST_MAC_TO_SCH(schPst, EVENT_ADD_UE_CONFIG_REQ_TO_SCH); + return(*macSchAddUeConfigReqOpts[schPst.selector])(&schPst, schUeCfg); case EVENT_MAC_UE_RECONFIG_REQ: - FILL_PST_MAC_TO_SCH(schPst, EVENT_UE_RECONFIG_REQ_TO_SCH); - return(*macSchUeReconfigReqOpts[schPst.selector])(&schPst,schUeCfg); + FILL_PST_MAC_TO_SCH(schPst, EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH); + return(*macSchModUeConfigReqOpts[schPst.selector])(&schPst,schUeCfg); default: DU_LOG("\n Invalid Pst received %d", pst->event); return RFAILED; @@ -897,18 +897,19 @@ uint8_t fillSchUeCfg(Pst *pst, SchUeCfg *schUeCfg, MacUeCfg *ueCfg) return RFAILED; } - schUeCfg->aggrMaxBitRate = NULL; - if(ueCfg->maxAggrBitRate != NULL) + if(ueCfg->ambrCfg != NULLP) { - MAC_ALLOC(schUeCfg->aggrMaxBitRate, sizeof(SchAggrMaxBitRate)); - if(!schUeCfg->aggrMaxBitRate) + MAC_ALLOC(schUeCfg->ambrCfg, sizeof(SchAmbrCfg)); + if(!schUeCfg->ambrCfg) { DU_LOG("\nMAC : Memory allocation failed in sendReconfigReqToSch"); return RFAILED; } - schUeCfg->aggrMaxBitRate->ulBitRate = ueCfg->maxAggrBitRate->ulBits; - schUeCfg->aggrMaxBitRate->dlBitRate = ueCfg->maxAggrBitRate->dlBits; + schUeCfg->ambrCfg->ulBr = ueCfg->ambrCfg->ulBr; + schUeCfg->ambrCfg->dlBr = ueCfg->ambrCfg->dlBr; } + else + schUeCfg->ambrCfg = NULLP; /* Fill sch Lc Cfg to Add/ Mod/ Del */ ret = fillSchLcCfgList(schUeCfg, ueCfg); @@ -1222,11 +1223,11 @@ uint8_t modifyUeCb(uint8_t cellIdx, MacUeCb *ueCb, MacUeCfg *ueCfg) if((ueCb->ueIdx == ueCfg->ueIdx) && (ueCb->crnti == ueCfg->crnti)\ &&(ueCb->state == UE_STATE_ACTIVE)) { - DU_LOG("\n MAC : Reconfig Req received for CRNTI %d ", ueCfg->crnti); + DU_LOG("\n MAC : Modifying Ue config Req for CRNTI %d ", ueCfg->crnti); ret = fillMacUeCb(ueCb, ueCfg, cellIdx); if(ret != ROK) { - DU_LOG("\nMAC : Failed to modify Ue Cb at modifyUeCb()"); + DU_LOG("\nMAC : Failed to modify MacUeCb at modifyUeCb()"); return ret; } else @@ -1282,11 +1283,15 @@ uint8_t procMacUeCfgData(Pst *pst, MacUeCfg *ueCfg) ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueIdx -1]; switch(pst->event) { - case EVENT_UE_CREATE_RSP_TO_MAC: + case EVENT_UE_CONFIG_RSP_TO_MAC: ret = createUeCb(cellIdx, ueCb, ueCfg); + if(ret != ROK) + DU_LOG("\nMAC: AddUeConfigReq for cellIdx :%d failed in procMacUeCfgData()", cellIdx); break; case EVENT_UE_RECONFIG_RSP_TO_MAC: ret = modifyUeCb(cellIdx, ueCb, ueCfg); + if(ret != ROK) + DU_LOG("\nMAC: ModifyUeConfigReq for cellIdx :%d failed at procMacUeCfgData()", cellIdx); break; default: break; @@ -1422,7 +1427,7 @@ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) /* Fill Post structure and send UE Create response*/ memset(&rspPst, 0, sizeof(Pst)); FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_CREATE_RSP); - return MacDuUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp); + return (*macDuUeCfgRspOpts[rspPst.selector])(&rspPst, cfgRsp); } /******************************************************************* @@ -1462,7 +1467,7 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) /* Fill Post structure and send UE Create response*/ memset(&rspPst, 0, sizeof(Pst)); FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_RECONFIG_RSP); - return MacDuUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp); + return (*macDuUeCfgRspOpts[rspPst.selector])(&rspPst, cfgRsp); } /******************************************************************* @@ -1524,33 +1529,63 @@ uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *schCfgRsp) GET_CELL_IDX(schCfgRsp->cellId, cellIdx); ueCfg = getMacUeCfg(cellIdx, schCfgRsp->ueIdx); + if(ueCfg == NULLP) + { + DU_LOG("\nMAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event); + ret = RFAILED; + } - if(ueCfg) + switch(pst->event) { - if(schCfgRsp->rsp == RSP_NOK) + case EVENT_UE_CONFIG_RSP_TO_MAC: { - DU_LOG("\nMAC : SCH UE Config Response : FAILURE [CRNTI %d] for event %d", schCfgRsp->crnti, pst->event); + if(schCfgRsp->rsp != RSP_NOK) + { + DU_LOG("\nMAC: SCH UeConfigRsp for CRNTI[%d] is success in MacProcSchUeCfgRsp()", schCfgRsp->crnti); + if(ret == ROK) + { + ret = procMacUeCfgData(pst, ueCfg); + if(ret == ROK) + { + result = MAC_DU_APP_RSP_OK; + } + } + } + else + { + DU_LOG("\nMAC: SCH UeConfigRsp for CRNTI[%d] is failed in MacProcSchUeCfgRsp()", schCfgRsp->crnti); + } + ret = MacSendUeCreateRsp(result, schCfgRsp); } - else + break; + + case EVENT_UE_RECONFIG_RSP_TO_MAC: { - DU_LOG("\nMAC : SCH UE Config Response : SUCCESS [CRNTI %d]", schCfgRsp->crnti); - ret = procMacUeCfgData(pst, ueCfg); - if(ret == ROK) + if(schCfgRsp->rsp != RSP_NOK) { - result = MAC_DU_APP_RSP_OK; - } + DU_LOG("\nMAC: SCH UeReconfigRsp for CRNTI[%d] is success in MacProcSchUeCfgRsp()", schCfgRsp->crnti); + if(ret == ROK) + { + ret = procMacUeCfgData(pst, ueCfg); + if(ret == ROK) + { + result = MAC_DU_APP_RSP_OK; + } + } + } + else + { + DU_LOG("\nMAC: SCH UeReconfigRsp for CRNTI[%d] is failed in MacProcSchUeCfgRsp()", schCfgRsp->crnti); + } + ret = MacSendUeReconfigRsp(result, schCfgRsp); } - MAC_FREE(ueCfg, sizeof(MacUeCfg)); - ueCfg = NULLP; - } - if(pst->event == EVENT_UE_CREATE_RSP_TO_MAC) - { - ret = MacSendUeCreateRsp(result, schCfgRsp); - } - if(pst->event == EVENT_UE_RECONFIG_RSP_TO_MAC) - { - ret = MacSendUeReconfigRsp(result, schCfgRsp); + break; + + default: + break; } + MAC_FREE(ueCfg, sizeof(MacUeCfg)); + ueCfg = NULLP; return ret; } diff --git a/src/5gnrsch/sch_ue_mgr.c b/src/5gnrsch/sch_ue_mgr.c index e4612afd0..bb76ede8c 100644 --- a/src/5gnrsch/sch_ue_mgr.c +++ b/src/5gnrsch/sch_ue_mgr.c @@ -58,8 +58,6 @@ void SchSendUeCfgRspToMac(uint16_t event, SchUeCfg *ueCfg, Inst inst,\ { Pst rspPst; - DU_LOG("\nSCH: Sending UE Create response to MAC"); - cfgRsp->cellId = ueCfg->cellId; cfgRsp->crnti = ueCfg->crnti; GET_UE_IDX(ueCfg->crnti, cfgRsp->ueIdx); @@ -68,18 +66,21 @@ void SchSendUeCfgRspToMac(uint16_t event, SchUeCfg *ueCfg, Inst inst,\ /* Filling response post */ memset(&rspPst, 0, sizeof(Pst)); FILL_PST_SCH_TO_MAC(rspPst, inst); - if(event == EVENT_UE_CREATE_REQ_TO_SCH) + if(event == EVENT_ADD_UE_CONFIG_REQ_TO_SCH) { - rspPst.event = EVENT_UE_CREATE_RSP_TO_MAC; + rspPst.event = EVENT_UE_CONFIG_RSP_TO_MAC; + DU_LOG("\nSCH: Sending UE Config response to MAC"); } - else if(event == EVENT_UE_RECONFIG_REQ_TO_SCH) + else if(event == EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH) { rspPst.event = EVENT_UE_RECONFIG_RSP_TO_MAC; + DU_LOG("\nSCH: Sending UE Reconfig response to MAC"); } SchUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp); } /******************************************************************* + * * @brief Function to fill Dl Lc Context in SCH Ue Cb * @@ -293,20 +294,20 @@ SchCellCb *getSchCellCb(uint16_t srcEvent, Inst inst, SchUeCfg *ueCfg) /******************************************************************* * - * @brief Hanles Ue create request from MAC + * @brief Function to Add Ue Config Request from MAC * * @details * - * Function : MacSchUeCreateReq + * Function : MacSchAddUeConfigReq * - * Functionality: Hanles Ue create request from MAC + * Functionality: Function to Add Ue config request from MAC * * @params[in] * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg) +uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) { uint8_t ueIdx, lcIdx, ret = ROK; SchCellCb *cellCb = NULLP; @@ -317,10 +318,10 @@ uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg) if(!ueCfg) { - DU_LOG("\nSCH : UE create request failed at MacSchUeCreateReq()"); + DU_LOG("\nSCH : Adding UE Config Request failed at MacSchAddUeConfigReq()"); return RFAILED; } - DU_LOG("\nSCH : UE Create Request for CRNTI[%d]", ueCfg->crnti); + DU_LOG("\nSCH : Adding UE Config Request for CRNTI[%d]", ueCfg->crnti); cellCb = getSchCellCb(pst->event, inst, ueCfg); /* Search if UE already configured */ @@ -337,7 +338,7 @@ uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg) } else { - DU_LOG("\n SCH : SchUeCb not found at MacSchUeCreateReq() "); + DU_LOG("\n SCH : SchUeCb not found at MacSchAddUeConfigReq() "); SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp); return RFAILED; } @@ -521,20 +522,20 @@ uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo puschInfo, DciInfo *dciInfo) /******************************************************************* * - * @brief Hanles Ue Reconfig request from MAC + * @brief Function to Modify Ue Config request from MAC * * @details * - * Function : MacSchUeReconfigReq + * Function : MacSchModUeConfigReq * - * Functionality: Hanles Ue Reconfig request from MAC + * Functionality: Function to modify Ue Config request from MAC * * @params[in] * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg) +uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg) { uint8_t ueIdx, lcIdx, ret = ROK; SchCellCb *cellCb = NULLP; @@ -545,10 +546,10 @@ uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg) if(!ueCfg) { - DU_LOG("\nSCH : Reconfig request failed at MacSchUeReconfigReq()"); + DU_LOG("\nSCH : Modifying Ue Config request failed at MacSchModUeConfigReq()"); return RFAILED; } - DU_LOG("\nSCH : Reconfig Request for CRNTI[%d]", ueCfg->crnti); + DU_LOG("\nSCH : Modifying Ue Config Request for CRNTI[%d]", ueCfg->crnti); cellCb = getSchCellCb(pst->event, inst, ueCfg); /* Search if UE already configured */ @@ -557,7 +558,7 @@ uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg) if(!ueCb) { - DU_LOG("\n SCH : SchUeCb not found at MacSchUeReconfigReq() "); + DU_LOG("\n SCH : SchUeCb not found at MacSchModUeConfigReq() "); SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp); return RFAILED; } diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index 8a927fa54..c785ec241 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -944,11 +944,11 @@ typedef struct spCellCfg ServCellCfgInfo servCellCfg; }SpCellCfg; -typedef struct maxAggrBitRate +typedef struct ambrCfg { - uint32_t ulBits; - uint32_t dlBits; -}MaxAggrBitRate; + uint32_t ulBr; /* UL Bit rate */ + uint32_t dlBr; /* DL Bit rate */ +}AmbrCfg; /* Single Network Slice Selection assistance Info */ typedef struct snssai @@ -1039,7 +1039,7 @@ typedef struct macUeCfg MacCellGrpCfg macCellGrpCfg; PhyCellGrpCfg phyCellGrpCfg; SpCellCfg spCellCfg; - MaxAggrBitRate *maxAggrBitRate; + AmbrCfg *ambrCfg; uint8_t numLcs; LcCfg lcCfgList[MAX_NUM_LC]; UeCfgState macUeCfgState; /* InActive / Completed */ diff --git a/src/cm/mac_sch_interface.c b/src/cm/mac_sch_interface.c index 14417cd26..a02172406 100644 --- a/src/cm/mac_sch_interface.c +++ b/src/cm/mac_sch_interface.c @@ -219,11 +219,11 @@ uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm) /******************************************************************* * - * @brief Pack and Send UE Create Request from MAC to SCH + * @brief Pack and Send UE Config Request from MAC to SCH * * @details * - * Function : packMacSchUeCreateReq + * Function : packMacSchAddUeConfigReq * * Functionality: * Pack and Send UE Create Request from MAC to SCH @@ -233,7 +233,7 @@ uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm) * RFAILED - failure * * ****************************************************************/ -uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg) +uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) { if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC)) { @@ -329,21 +329,21 @@ uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd) /******************************************************************* * - * @brief Pack and Send UE Reconfig Request from MAC to SCH + * @brief Pack and Send Modify UE Config Request from MAC to SCH * * @details * - * Function : packMacSchUeReconfigReq + * Function : packMacSchModUeConfigReq * * Functionality: - * Pack and Send UE Reconfig Request from MAC to SCH + * Pack and Send Modify UE Config Request from MAC to SCH * * @params[in] * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t packMacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg) +uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg) { if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC)) { diff --git a/src/cm/mac_sch_interface.h b/src/cm/mac_sch_interface.h index 95801bb22..83e9eb5b0 100644 --- a/src/cm/mac_sch_interface.h +++ b/src/cm/mac_sch_interface.h @@ -24,12 +24,12 @@ #define EVENT_RACH_IND_TO_SCH 5 #define EVENT_CRC_IND_TO_SCH 6 #define EVENT_DL_RLC_BO_INFO_TO_SCH 7 -#define EVENT_UE_CREATE_REQ_TO_SCH 8 -#define EVENT_UE_CREATE_RSP_TO_MAC 9 +#define EVENT_ADD_UE_CONFIG_REQ_TO_SCH 8 +#define EVENT_UE_CONFIG_RSP_TO_MAC 9 #define EVENT_SLOT_IND_TO_SCH 10 #define EVENT_SHORT_BSR 11 #define EVENT_UCI_IND_TO_SCH 12 -#define EVENT_UE_RECONFIG_REQ_TO_SCH 13 +#define EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH 13 #define EVENT_UE_RECONFIG_RSP_TO_MAC 14 @@ -1223,11 +1223,11 @@ typedef struct schLcCfg }SchLcCfg; /* Aggregate max bit rate */ -typedef struct aggrMaxBitRate +typedef struct schAmbrCfg { - uint32_t ulBitRate; - uint32_t dlBitRate; -}SchAggrMaxBitRate; + uint32_t ulBr; /* Ul BitRate */ + uint32_t dlBr; /* Dl BitRate */ +}SchAmbrCfg; /* UE configuration */ typedef struct schUeCfg @@ -1237,7 +1237,7 @@ typedef struct schUeCfg SchMacCellGrpCfg macCellGrpCfg; SchPhyCellGrpCfg phyCellGrpCfg; SchSpCellCfg spCellCfg; - SchAggrMaxBitRate *aggrMaxBitRate; + SchAmbrCfg *ambrCfg; uint8_t numLcs; SchLcCfg schLcCfg[MAX_NUM_LC]; }SchUeCfg; @@ -1309,7 +1309,7 @@ typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS(( Pst *pst, /* Post structure */ DlRlcBoInfo *dlBoInfo)); /* DL BO Info */ -typedef uint8_t (*MacSchUeCreateReqFunc) ARGS(( +typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS(( Pst *pst, /* Post structure */ SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */ @@ -1330,7 +1330,7 @@ typedef uint8_t (*MacSchSrUciIndFunc) ARGS(( Pst *pst, /* Post structure */ SrUciIndInfo *uciInd)); /* UCI IND Info */ -typedef uint8_t (*MacSchUeReconfigReqFunc) ARGS(( +typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS(( Pst *pst, /* Post structure */ SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */ @@ -1357,8 +1357,8 @@ uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd); uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd); uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo); uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo); -uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch); -uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch); +uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch); +uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch); uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp); uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp); uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd)); @@ -1368,8 +1368,8 @@ uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd); uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd); uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd); uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd); -uint8_t packMacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfgToSch); -uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfgToSch); +uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch); +uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch); uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp); uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp); diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 6c23d0f05..2b651a024 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -1512,7 +1512,7 @@ uint8_t fillDlDcchRrcMsg(RRCContainer_t *rrcContainer) uint8_t BuildDLRRCContainer(uint8_t rrcMsgType, RRCContainer_t *rrcContainer) { - uint8_t ret, idx2, bufLen; + uint8_t ret, bufLen; ret =ROK; if(rrcMsgType == RRC_SETUP) @@ -1530,11 +1530,8 @@ uint8_t BuildDLRRCContainer(uint8_t rrcMsgType, RRCContainer_t *rrcContainer) CU_ALLOC(rrcContainer->buf, rrcContainer->size); if(rrcContainer->buf != NULLP) { - memset(rrcContainer->buf, 0, encBufSize); - for(idx2 = 0; idx2 < encBufSize; idx2++) - { - rrcContainer->buf[idx2] = buf[idx2]; - } + memset(rrcContainer->buf, 0, bufLen); + memcpy(rrcContainer->buf, buf, bufLen); } } else if(rrcMsgType == RRC_RECONFIG) @@ -1559,11 +1556,8 @@ uint8_t BuildDLRRCContainer(uint8_t rrcMsgType, RRCContainer_t *rrcContainer) CU_ALLOC(rrcContainer->buf, rrcContainer->size); if(rrcContainer->buf != NULLP) { - memset(rrcContainer->buf, 0, encBufSize); - for(idx2 = 0; idx2 < encBufSize; idx2++) - { - rrcContainer->buf[idx2] = buf[idx2]; - } + memset(rrcContainer->buf, 0, bufLen); + memcpy(rrcContainer->buf, buf, bufLen); } } @@ -5779,7 +5773,7 @@ uint8_t BuildAndSendUeContextSetupReq(uint8_t cuUeF1apId, uint8_t duUeF1apId, \ ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest; - elementCnt = 11; + elementCnt = 12; ueSetReq->protocolIEs.list.count = elementCnt; ueSetReq->protocolIEs.list.size = \ elementCnt * sizeof(UEContextSetupRequestIEs_t *); @@ -5908,7 +5902,7 @@ uint8_t BuildAndSendUeContextSetupReq(uint8_t cuUeF1apId, uint8_t duUeF1apId, \ ueSetReq->protocolIEs.list.array[idx]->criticality = Criticality_reject; ueSetReq->protocolIEs.list.array[idx]->value.present = \ UEContextSetupRequestIEs__value_PR_RRCContainer; - char buf[9]={0x00, 0x02, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}; + char secModeBuf[9]={0x00, 0x02, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}; bufLen =9; ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.size = bufLen; CU_ALLOC(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, @@ -5918,11 +5912,8 @@ uint8_t BuildAndSendUeContextSetupReq(uint8_t cuUeF1apId, uint8_t duUeF1apId, \ DU_LOG(" F1AP : Memory allocation for BuildAndSendUeContextSetupReq failed"); break; } - memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, 0, encBufSize); - for(idx1 = 0; idx1 < encBufSize; idx1++) - { - ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf[idx1] = buf[idx1]; - } + memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, 0, bufLen); + memcpy(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, secModeBuf, bufLen); /* RRC delivery status request */ idx++; @@ -5933,7 +5924,27 @@ uint8_t BuildAndSendUeContextSetupReq(uint8_t cuUeF1apId, uint8_t duUeF1apId, \ UEContextSetupRequestIEs__value_PR_RRCDeliveryStatusRequest; ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCDeliveryStatusRequest = \ RRCDeliveryStatusRequest_true; - + + /* Bit Rate hardcoded as in reference logs */ + idx++; + ueSetReq->protocolIEs.list.array[idx]->id = \ + ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL; + ueSetReq->protocolIEs.list.array[idx]->criticality = Criticality_ignore; + ueSetReq->protocolIEs.list.array[idx]->value.present = \ + UEContextSetupRequestIEs__value_PR_BitRate; + char bitRateBuf[4]= {0x3B, 0x37, 0xF4, 0xCD}; + bufLen = 4; + ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.size = bufLen; + CU_ALLOC(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf,\ + ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.size); + if(!ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf) + { + DU_LOG(" F1AP : Failed to allocate memory for Bit Rate in BuildAndSendUeContextSetupReq()"); + break; + } + memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf, 0, bufLen); + memcpy(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf, bitRateBuf, bufLen); + xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg); /* Encode the F1SetupRequest type as APER */ diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 2d8a8a9cd..95bf53ae7 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -5531,9 +5531,10 @@ void freeDuUeCfg(DuUeCfg *ueCfg) DU_FREE(ueCfg->cellGrpCfg, sizeof(CellGroupConfigRrc_t)); ueCfg->cellGrpCfg = NULLP; } - if(ueCfg->maxAggrBitRate) + if(ueCfg->ambrCfg) { - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->maxAggrBitRate, sizeof(MaxAggrBitRate)); + memset(ueCfg->ambrCfg, 0, sizeof(AmbrCfg)); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg)); } for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++) { @@ -7250,7 +7251,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg) { uint8_t ret, ieIdx, ueIdx, lcId, cellIdx; bool ueCbFound = false; - uint32_t gnbCuUeF1apId, gnbDuUeF1apId; + uint32_t gnbCuUeF1apId, gnbDuUeF1apId, bitRateSize; DuUeCb *duUeCb = NULLP; UEContextSetupRequest_t *ueSetReq = NULLP; @@ -7387,32 +7388,29 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg) } break; } - //TODO: To handle maxAggrBitRate case, - // Dependency: The protocolIE is not specified in ASN -#if 0 - case ProtocolIE_ID_id_ULPDUSessionAggregateMaximumBitRate: { + case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL: { /* MaximumBitRate Uplink */ bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size; if(bitRateSize > 0) { - DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.maxAggrBitRate, bitRateSize); - if(!duUeCb->f1UeDb->duUeCfg.maxAggrBitRate) + DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.ambrCfg, bitRateSize); + if(!duUeCb->f1UeDb->duUeCfg.ambrCfg) { DU_LOG("\nDU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq"); ret = RFAILED; } else { - duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->ulBits =\ - *ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf; - duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->dlBits = 0; + memset(duUeCb->f1UeDb->duUeCfg.ambrCfg, 0, sizeof(AmbrCfg)); + memcpy(&duUeCb->f1UeDb->duUeCfg.ambrCfg->ulBr, + ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf, bitRateSize); + duUeCb->f1UeDb->duUeCfg.ambrCfg->dlBr = 0; } } else ret = RFAILED; break; } -#endif default: { break; diff --git a/src/du_app/du_mgr.h b/src/du_app/du_mgr.h index c9f402e8a..971ee09db 100644 --- a/src/du_app/du_mgr.h +++ b/src/du_app/du_mgr.h @@ -104,7 +104,7 @@ typedef struct duUeCfg RlcBearerCfg rlcLcCfg[MAX_NUM_LC]; uint8_t numMacLcs; /* Mac Ue Cfg */ LcCfg macLcCfg[MAX_NUM_LC]; - MaxAggrBitRate *maxAggrBitRate; + AmbrCfg *ambrCfg; }DuUeCfg; typedef struct f1UeContextSetup diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index b1424da90..6fb4026d4 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -1643,7 +1643,7 @@ uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo) if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL) { - DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId); + DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleSlotInd()", slotInfo->cellId); return RFAILED; } @@ -1784,7 +1784,7 @@ uint8_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId) if(cellStopId->cellId <=0 || cellStopId->cellId > MAX_NUM_CELL) { - DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId); + DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleStopInd()", cellStopId->cellId); } if(duGetCellCb(cellStopId->cellId, &cellCb) != ROK) diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 219c2c551..4d17af2ab 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -856,33 +856,35 @@ uint8_t fillMacLcCfgToAddMod(LcCfg *lcCfg, LcCfg *ueSetReqDb) * * @details * - * Function : getMaxAggrBitRate + * Function : fillAmbr * * Functionality: Function to copy bit Rate from ueSetupReqDb * - * @params[in] MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate + * @params[in] AmbrCfg **macAmbr, AmbrCfg *ueDbAmbr * @return ROK/RFAILED * *****************************************************************/ -uint8_t getMaxAggrBitRate(MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate) +uint8_t fillAmbr(AmbrCfg **macAmbr, AmbrCfg *ueDbAmbr) { - if(ueDbBitRate) + if(ueDbAmbr) { - if(!macBitRate) + if(*macAmbr == NULLP) { - DU_ALLOC_SHRABL_BUF(macBitRate, sizeof(MaxAggrBitRate)); - if(!macBitRate) + DU_ALLOC_SHRABL_BUF(*macAmbr, sizeof(AmbrCfg)); + if(*macAmbr == NULLP) { - DU_LOG("\nDUAPP: Memory Alloc Failed at getMaxAggrBitRate()"); + DU_LOG("\nDUAPP: Memory Alloc Failed at fillAmbr()"); return RFAILED; } } - memcpy(macBitRate, ueDbBitRate, sizeof(MaxAggrBitRate)); + memset(*macAmbr, 0, sizeof(AmbrCfg)); + (*macAmbr)->ulBr = ueDbAmbr->ulBr; + (*macAmbr)->dlBr = ueDbAmbr->dlBr; } else { - macBitRate = NULLP; + *macAmbr = NULLP; } return ROK; } @@ -914,7 +916,7 @@ uint8_t sendUeReCfgReqToMac(MacUeCfg *macUeCfg) if(macUeCfg) { /* Processing one Ue at a time to MAC */ - DU_LOG("\nDU_APP: Sending Reconfig Request to MAC"); + DU_LOG("\nDU_APP: Sending Ue Reconfig Request to MAC"); ret = (*packMacUeReconfigReqOpts[pst.selector])(&pst, macUeCfg); if(ret == RFAILED) { @@ -998,7 +1000,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \ fillDefaultMacCellGrpInfo(&macUeCfg->macCellGrpCfg); fillDefaultPhyCellGrpInfo(&macUeCfg->phyCellGrpCfg); fillDefaultSpCellGrpInfo(&macUeCfg->spCellCfg); - macUeCfg->maxAggrBitRate = NULLP; + macUeCfg->ambrCfg = NULLP; fillMacSrb1LcCfg(&macUeCfg->lcCfgList[0]); macUeCfg->numLcs++; } @@ -1024,7 +1026,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \ fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\ NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg); } - ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, ueCfgDb->maxAggrBitRate); + ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg); } /* Filling LC Context */ @@ -1314,7 +1316,7 @@ uint8_t sendUeReCfgReqToRlc(RlcUeCfg *rlcUeCfg) if(rlcUeCfg) { /* Processing one Ue at a time to RLC */ - DU_LOG("\nDU_APP: Sending Reconfig Request to RLC UL"); + DU_LOG("\nDU_APP: Sending Ue Reconfig Request to RLC UL"); ret = (*packRlcUeReconfigReqOpts[pst.selector])(&pst, rlcUeCfg); if(ret == RFAILED) { @@ -1556,7 +1558,7 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb) fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\ NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg); } - ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, f1UeDb->duUeCfg.maxAggrBitRate); + ret = fillAmbr(&macUeCfg->ambrCfg, f1UeDb->duUeCfg.ambrCfg); } /* Filling LC Context */ for(dbIdx = 0; (dbIdx < f1UeDb->duUeCfg.numMacLcs && ret == ROK); dbIdx++) @@ -1964,7 +1966,6 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE; if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK) BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId); - } } else @@ -2097,22 +2098,22 @@ uint8_t duProcUeContextSetupRequest(DuUeCb *ueCb) if(ueCb) { cellId = duCb.actvCellLst[ueCb->f1UeDb->cellIdx]->cellId; + /* Send DL RRC msg for security Mode */ if(ueCb->f1UeDb->dlRrcMsg) { if(ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu) - { + { /* Sending DL RRC Message to RLC */ ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, ueCb->f1UeDb->dlRrcMsg); if(ret == RFAILED) { DU_LOG("\nDU APP : Failed to send DL RRC msg in duProcUeContextSetupRequest()"); DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\ - ueCb->f1UeDb->dlRrcMsg->rrcMsgSize); - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg)); + ueCb->f1UeDb->dlRrcMsg->rrcMsgSize); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg)); } - } + } } - if(ret == ROK) { DU_LOG("\nDU_APP: Processing Ue Context Setup Request for cellId [%d]", cellId); @@ -2126,7 +2127,6 @@ uint8_t duProcUeContextSetupRequest(DuUeCb *ueCb) if(ret == RFAILED) DU_LOG("\nDU_APP: Failed at build ctxt setup req for MAC at duBuildAndSendUeReCfgReqToMac()"); } - } else {