X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_ue_mgr.c;h=a27c3e4bdddd57272b84fa5be0a82ecd307c7f45;hb=377a2d180b617d4df038e1780d4a8de98d7c125f;hp=a3a0c55298ac39696adcecd13474bc57b8f001e2;hpb=2dc9d6735bc5ff973a761b7d6b3f71f97e95d60e;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_ue_mgr.c b/src/5gnrsch/sch_ue_mgr.c index a3a0c5529..a27c3e4bd 100644 --- a/src/5gnrsch/sch_ue_mgr.c +++ b/src/5gnrsch/sch_ue_mgr.c @@ -234,12 +234,8 @@ uint8_t fillSchUeCb(SchUeCb *ueCb, SchUeCfg *ueCfg) ueCb->ueCfg.spCellCfgPres = true; } ueCb->state = SCH_UE_STATE_ACTIVE; - if(ueCfg->ambrCfg != NULLP) - { - SCH_ALLOC(ueCb->ueCfg.ambrCfg , sizeof(SchAmbrCfg)); - memcpy(&ueCb->ueCfg.ambrCfg->ulBr , &ueCfg->ambrCfg->ulBr, sizeof(SchAmbrCfg)); - } + ueCb->ueCfg.ambrCfg = ueCfg->ambrCfg; memcpy(&ueCb->ueCfg.dlModInfo, &ueCfg->dlModInfo , sizeof(SchModulationInfo)); memcpy(&ueCb->ueCfg.ulModInfo, &ueCfg->ulModInfo , sizeof(SchModulationInfo)); @@ -422,13 +418,12 @@ uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, S uint16_t puschSlot = 0; uint16_t startRb = 0; uint8_t numRb = 0; - uint8_t numPdschSymbols= 14; uint16_t tbSize = 0; uint8_t buffer = 5; uint8_t idx = 0; SchCellCb *cellCb = ueCb->cellCb; SchUlSlotInfo *schUlSlotInfo = NULLP; - uint8_t k2=0, startSymb=0 , symbLen=0; + uint8_t k2=0, startSymb=0 , symbLen=11; if(ueCb->ueCfg.spCellCfgPres == true) { @@ -440,7 +435,7 @@ uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, S startRb = cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb; tbSize = schCalcTbSize(dataVol + buffer); /* 2 bytes header + some buffer */ - numRb = schCalcNumPrb(tbSize, ueCb->ueCfg.ulModInfo.mcsIndex, numPdschSymbols); + numRb = schCalcNumPrb(tbSize, ueCb->ueCfg.ulModInfo.mcsIndex, symbLen); /* increment PUSCH PRB */ cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb += numRb; @@ -918,17 +913,10 @@ void deleteSchCellCb(SchCellCb *cellCb) { if(cellCb->schDlSlotInfo[idx]) { - SCH_FREE(cellCb->schDlSlotInfo[idx]->rarInfo, sizeof(RarInfo)); - if(cellCb->schDlSlotInfo[idx]->dlMsgInfo) - { - SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPdu,\ - cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPduLen); - SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo, sizeof(DlMsgInfo)); - } SCH_FREE(cellCb->schDlSlotInfo[idx], sizeof(SchDlSlotInfo)); } } - SCH_FREE(cellCb->schDlSlotInfo, sizeof(SchDlSlotInfo)); + SCH_FREE(cellCb->schDlSlotInfo, cellCb->numSlots *sizeof(SchDlSlotInfo*)); } if(cellCb->schUlSlotInfo) { @@ -936,14 +924,13 @@ void deleteSchCellCb(SchCellCb *cellCb) { if(cellCb->schUlSlotInfo[idx]) { - SCH_FREE(cellCb->schUlSlotInfo[idx]->schPuschInfo,sizeof(SchPuschInfo)); SCH_FREE(cellCb->schUlSlotInfo[idx], sizeof(SchUlSlotInfo)); } } - SCH_FREE(cellCb->schUlSlotInfo, sizeof(SchUlSlotInfo)); + SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*)); } - SCH_FREE(cellCb->cellCfg.sib1SchCfg.sib1PdcchCfg.dci.pdschCfg, sizeof(PdschCfg)); memset(cellCb, 0, sizeof(SchCellCb)); + } /*******************************************************************