X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_ue_mgr.c;h=7ede4a5de2210d2a1047c813ac83a2b19ac7b02c;hb=7ebfb1f80967fe83bf169c2915cedf2c9fb5cbf7;hp=1bee3b544c5f87e4fd9c2998a34dec8ebf1569a4;hpb=13d69430713cd381772de495739acff114be7e2a;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_ue_mgr.c b/src/5gnrmac/mac_ue_mgr.c index 1bee3b544..7ede4a5de 100644 --- a/src/5gnrmac/mac_ue_mgr.c +++ b/src/5gnrmac/mac_ue_mgr.c @@ -1606,36 +1606,46 @@ uint8_t fillSchUeCfg(Pst *pst, SchUeCfg *schUeCfg, MacUeCfg *ueCfg) schUeCfg->crnti = ueCfg->crnti; /* Copy MAC cell group config */ - memset(&schUeCfg->macCellGrpCfg, 0, sizeof(SchMacCellGrpCfg)); - if(fillMacCellGroupCfg(ueCfg->macCellGrpCfg, &schUeCfg->macCellGrpCfg) != ROK) + if(ueCfg->macCellGrpCfgPres == true) { - DU_LOG("\nERROR --> MAC : fillMacCellGroupCfg() failed"); - return RFAILED; + schUeCfg->macCellGrpCfgPres = true; + memset(&schUeCfg->macCellGrpCfg, 0, sizeof(SchMacCellGrpCfg)); + if(fillMacCellGroupCfg(ueCfg->macCellGrpCfg, &schUeCfg->macCellGrpCfg) != ROK) + { + DU_LOG("\nERROR --> MAC : fillMacCellGroupCfg() failed"); + return RFAILED; + } } - - /* Copy Physical cell group config */ - memset(&schUeCfg->phyCellGrpCfg, 0,sizeof(SchPhyCellGrpCfg)); - if(fillPhyCellGroupCfg(ueCfg->phyCellGrpCfg, &schUeCfg->phyCellGrpCfg) != ROK) + if(ueCfg->phyCellGrpCfgPres == true) { - DU_LOG("\nERROR --> MAC : fillPhyCellGroupCfg() failed"); - return RFAILED; + schUeCfg->phyCellGrpCfgPres = true; + /* Copy Physical cell group config */ + memset(&schUeCfg->phyCellGrpCfg, 0,sizeof(SchPhyCellGrpCfg)); + if(fillPhyCellGroupCfg(ueCfg->phyCellGrpCfg, &schUeCfg->phyCellGrpCfg) != ROK) + { + DU_LOG("\nERROR --> MAC : fillPhyCellGroupCfg() failed"); + return RFAILED; + } } - /* Copy sp cell config */ - memset(&schUeCfg->spCellCfg, 0, sizeof(SchSpCellCfg)); - if(fillSpCellCfg(ueCfg->spCellCfg, &schUeCfg->spCellCfg) != ROK) + if(ueCfg->spCellCfgPres == true) { - DU_LOG("\nERROR --> MAC : fillSpCellCfg() failed"); - return RFAILED; + schUeCfg->spCellCfgPres = true; + /* Copy sp cell config */ + memset(&schUeCfg->spCellCfg, 0, sizeof(SchSpCellCfg)); + if(fillSpCellCfg(ueCfg->spCellCfg, &schUeCfg->spCellCfg) != ROK) + { + DU_LOG("\nERROR --> MAC : fillSpCellCfg() failed"); + return RFAILED; + } } - if(ueCfg->ambrCfg != NULLP) { MAC_ALLOC(schUeCfg->ambrCfg, sizeof(SchAmbrCfg)); if(!schUeCfg->ambrCfg) { - DU_LOG("\nERROR --> MAC : Memory allocation failed in sendReconfigReqToSch"); - return RFAILED; + DU_LOG("\nERROR --> MAC : Memory allocation failed in sendReconfigReqToSch"); + return RFAILED; } schUeCfg->ambrCfg->ulBr = ueCfg->ambrCfg->ulBr; } @@ -1811,13 +1821,19 @@ uint8_t fillMacUeCb(MacUeCb *ueCb, MacUeCfg *ueCfg, uint8_t cellIdx) ueCb->ueIdx = ueCfg->ueIdx; ueCb->crnti = ueCfg->crnti; ueCb->cellCb = macCb.macCell[cellIdx]; - ueCb->dlInfo.dlHarqEnt.numHarqProcs = \ + if(ueCfg->spCellCfgPres) + { + ueCb->dlInfo.dlHarqEnt.numHarqProcs = \ ueCfg->spCellCfg.servCellCfg.pdschServCellCfg.numHarqProcForPdsch; + } ueCb->state = UE_STATE_ACTIVE; /*TODO: To check the bsr value during implementation */ - ueCb->bsrTmrCfg.periodicTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer; - ueCb->bsrTmrCfg.retxTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.retxTimer; - ueCb->bsrTmrCfg.srDelayTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer; + if(ueCfg->macCellGrpCfgPres) + { + ueCb->bsrTmrCfg.periodicTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer; + ueCb->bsrTmrCfg.retxTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.retxTimer; + ueCb->bsrTmrCfg.srDelayTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer; + } ret = fillMacLcCfgList(ueCb, ueCfg); if(ret == RFAILED) { @@ -2361,20 +2377,20 @@ uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg) if(ret == ROK) { /*Sending Cfg Req to SCH */ - ret = fillSchUeCfg(pst, &schUeCfg, ueCfg); - if(ret != ROK) - DU_LOG("\nERROR --> MAC : Failed to fill sch Ue Cfg at MacProcUeReconfigReq()"); + ret = fillSchUeCfg(pst, &schUeCfg, ueCfg); + if(ret != ROK) + DU_LOG("\nERROR --> MAC : Failed to fill sch Ue Cfg at MacProcUeReconfigReq()"); else - { + { /* Fill event and send UE create request to SCH */ ret = sendUeReqToSch(pst, &schUeCfg); - if(ret != ROK) - DU_LOG("\nERROR --> MAC : Failed to send UE Reconfig Request to SCH"); - } + if(ret != ROK) + DU_LOG("\nERROR --> MAC : Failed to send UE Reconfig Request to SCH"); + } } else { - DU_LOG("\nERROR --> MAC : Failed to store MAC UE Cb "); + DU_LOG("\nERROR --> MAC : Failed to store MAC UE Cb "); } } else