From fdf994581c1b672158c911a9a5f7a4191832c695 Mon Sep 17 00:00:00 2001 From: sphoorthi Date: Mon, 29 Mar 2021 11:07:40 +0530 Subject: [PATCH] JIRA ID: ODUHIGH-314 : Time domain allocation for SSB in TDD mode Change-Id: Ibd28cd6e6e1524a52f0142f1ba6459a231b48f25 Signed-off-by: sphoorthi --- src/5gnrmac/lwr_mac_fsm.c | 4 +- src/5gnrmac/mac.h | 5 +-- src/5gnrmac/mac_cfg_hdl.c | 1 - src/5gnrmac/mac_rach.c | 2 +- src/5gnrmac/mac_slot_ind.c | 50 +++++++++++------------ src/5gnrsch/sch.h | 5 ++- src/5gnrsch/sch_common.c | 21 +++++----- src/5gnrsch/sch_slot_ind.c | 100 ++++++++++++++++++++++++--------------------- src/5gnrsch/sch_utils.c | 11 ++--- src/5gnrsch/sch_utils.h | 2 +- src/cm/common_def.h | 1 + src/cm/du_app_mac_inf.h | 2 - src/cm/mac_sch_interface.h | 7 +++- src/du_app/du_cfg.c | 1 - src/du_app/du_cfg.h | 2 +- src/du_app/du_egtp.c | 2 + 16 files changed, 114 insertions(+), 102 deletions(-) diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 5790ca04a..bbef58b7b 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -3899,7 +3899,7 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo) /* add PHY delta */ ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA); - currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED]; + currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOTS]; LWR_MAC_ALLOC(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t))); if(ulTtiElem) @@ -4201,7 +4201,7 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) { GET_CELL_IDX(currTimingInfo.cellId, cellIdx); memcpy(&ulDciReqTimingInfo, &currTimingInfo, sizeof(SlotIndInfo)); - currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOT_SUPPORTED]; + currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOTS]; if(currDlSlot->dlInfo.ulGrant != NULLP) { diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index e04e13afe..e64cba274 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -23,7 +23,6 @@ #define MAX_CRI_SIZE 6 #define MAX_MAC_DL_PDU 16 #define MAX_NUM_HARQ_PROC 16 -#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */ #define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */ #define MAC_TQ_SIZE 10 /* Timing Queue Size */ #define MAX_NUM_TIMER 1 /* MAX number of MAC timers */ @@ -182,8 +181,8 @@ struct macCellCb uint16_t cellId; uint8_t crntiMap; MacRaCbInfo macRaCb[MAX_NUM_UE]; - MacDlSlot dlSlot[MAX_SLOT_SUPPORTED]; - MacUlSlot ulSlot[MAX_SLOT_SUPPORTED]; + MacDlSlot dlSlot[MAX_SLOTS]; + MacUlSlot ulSlot[MAX_SLOTS]; uint16_t numActvUe; MacUeCfg *ueCfgTmpData[MAX_NUM_UE]; MacUeCb ueCb[MAX_NUM_UE]; diff --git a/src/5gnrmac/mac_cfg_hdl.c b/src/5gnrmac/mac_cfg_hdl.c index 352f2b8ad..f0a50e594 100644 --- a/src/5gnrmac/mac_cfg_hdl.c +++ b/src/5gnrmac/mac_cfg_hdl.c @@ -218,7 +218,6 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg) /* fill SIB1 scheduler parameters */ schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen; - schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod; schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod; schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex; schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex; diff --git a/src/5gnrmac/mac_rach.c b/src/5gnrmac/mac_rach.c index 18a6200bf..968055938 100644 --- a/src/5gnrmac/mac_rach.c +++ b/src/5gnrmac/mac_rach.c @@ -131,7 +131,7 @@ uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo) if(ulSchedInfo != NULLP) { MacUlSlot *currUlSlot = - &macCb.macCell[cellIdx]->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED]; + &macCb.macCell[cellIdx]->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOTS]; memcpy(&currUlSlot->ulInfo, ulSchedInfo, sizeof(UlSchedInfo)); } return ROK; diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index 2ea5be994..95a21c259 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -61,48 +61,48 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo) GET_CELL_IDX(dlSchedInfo->cellId, cellIdx); if(dlSchedInfo->isBroadcastPres) { - currDlSlot = &macCb.macCell[cellIdx]->\ - dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot]; - currDlSlot->dlInfo.isBroadcastPres = true; - memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc)); + currDlSlot = &macCb.macCell[cellIdx]->\ + dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot]; + currDlSlot->dlInfo.isBroadcastPres = true; + memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc)); currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg = \ - &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg; + &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg; } if(dlSchedInfo->rarAlloc != NULLP) { - currDlSlot = &macCb.macCell[cellIdx]->\ - dlSlot[dlSchedInfo->schSlotValue.rarTime.slot]; - currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc; + currDlSlot = &macCb.macCell[cellIdx]->\ + dlSlot[dlSchedInfo->schSlotValue.rarTime.slot]; + currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc; - /* MUXing of RAR */ - fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo); + /* MUXing of RAR */ + fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo); } if(dlSchedInfo->dlMsgAlloc != NULLP) { - currDlSlot = &macCb.macCell[cellIdx]->\ - dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot]; - currDlSlot->dlInfo.dlMsgAlloc = dlSchedInfo->dlMsgAlloc; /* copy msg4 alloc pointer in MAC slot info */ + currDlSlot = &macCb.macCell[cellIdx]->\ + dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot]; + currDlSlot->dlInfo.dlMsgAlloc = dlSchedInfo->dlMsgAlloc; /* copy msg4 alloc pointer in MAC slot info */ currDlSlot->dlInfo.cellId = dlSchedInfo->cellId; /* Check if the downlink pdu is msg4 */ - if(dlSchedInfo->dlMsgAlloc->dlMsgInfo.isMsg4Pdu) - { - macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = dlSchedInfo->dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize; - } - else - { - memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue)); - /* Send LC schedule result to RLC */ - sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime); - } + if(dlSchedInfo->dlMsgAlloc->dlMsgInfo.isMsg4Pdu) + { + macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = dlSchedInfo->dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize; + } + else + { + memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue)); + /* Send LC schedule result to RLC */ + sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime); + } } if(dlSchedInfo->ulGrant != NULLP) { - currDlSlot = &macCb.macCell[cellIdx]->\ - dlSlot[dlSchedInfo->schSlotValue.ulDciTime.slot]; + currDlSlot = &macCb.macCell[cellIdx]->\ + dlSlot[dlSchedInfo->schSlotValue.ulDciTime.slot]; currDlSlot->dlInfo.ulGrant = dlSchedInfo->ulGrant; } } diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index f6f58222a..c8863994a 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -26,7 +26,8 @@ #define SCH_MU4_NUM_SLOTS 50 #define SCH_MAX_SFN 1024 #define MAX_NUM_RB 106 /* value for numerology 0 15Khz */ -#define SCH_MIB_TRANS 80 +#define SCH_MIB_TRANS 8 /* MIB transmission as per 38.331 is every 80 ms */ +#define SCH_SIB1_TRANS 16 /* SIB1 transmission as per 38.331 is every 160 ms */ #define SCH_NUM_SC_PRB 12 /* number of SCs in a PRB */ #define SCH_MAX_SSB_BEAM 8 /* since we are supporting only SCS=15KHz and 30KHz */ #define SCH_SYMBOL_PER_SLOT 14 @@ -100,6 +101,7 @@ typedef struct schDlSlotInfo { uint16_t totalPrb; /*!< Number of RBs in the cell */ uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */ + uint16_t resAllocBitMap; /*!< Resource allocation bitmap */ bool ssbPres; /*!< Flag to determine if SSB is present in this slot */ uint8_t ssbIdxSupported; /*!< Max SSB index */ SsbInfo ssbInfo[MAX_SSB_IDX]; /*!< SSB info */ @@ -121,6 +123,7 @@ typedef struct schUlSlotInfo { uint16_t totalPrb; /*!< Number of RBs in the cell */ uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */ + uint16_t resAllocBitMap; /*!< Resource allocation bitmap */ uint8_t puschCurrentPrb; /* Current PRB for PUSCH allocation */ bool puschPres; /*!< PUSCH presence field */ SchPuschInfo *schPuschInfo; /*!< PUSCH info */ diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 83d3141cf..22c4dc53a 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -77,29 +77,30 @@ uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc, SsbInfo ssbInfo; schDlSlotInfo = cell->schDlSlotInfo[slot]; + if(dlBrdcstAlloc->ssbTrans) { ssbStartPrb = cell->cellCfg.ssbSchCfg.ssbOffsetPointA; //+Kssb ssbStartSymb = cell->ssbStartSymbArr[dlBrdcstAlloc->ssbIdxSupported-1]; /*since we are - supporting only 1 ssb beam */ + supporting only 1 ssb beam */ /* Assign interface structure */ for(idx=0; idxssbIdxSupported; idx++) { - ssbInfo.ssbIdx = idx; - ssbInfo.fdAlloc.startPrb = ssbStartPrb; - ssbInfo.fdAlloc.numPrb = SCH_SSB_NUM_PRB; - ssbInfo.tdAlloc.startSymb = ssbStartSymb; - ssbInfo.tdAlloc.numSymb = SCH_SSB_NUM_SYMB; - dlBrdcstAlloc->ssbInfo[idx] = ssbInfo; - schDlSlotInfo->ssbInfo[idx] = ssbInfo; + ssbInfo.ssbIdx = idx; + ssbInfo.fdAlloc.startPrb = ssbStartPrb; + ssbInfo.fdAlloc.numPrb = SCH_SSB_NUM_PRB; + ssbInfo.tdAlloc.startSymb = ssbStartSymb; + ssbInfo.tdAlloc.numSymb = SCH_SSB_NUM_SYMB; + dlBrdcstAlloc->ssbInfo[idx] = ssbInfo; + schDlSlotInfo->ssbInfo[idx] = ssbInfo; } schDlSlotInfo->ssbPres = true; schDlSlotInfo->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported; for(idx=ssbStartSymb; idxassignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */ + schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */ } } @@ -116,7 +117,7 @@ uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc, numSib1Prb = schCalcNumPrb(tbSize,mcs,numPdschSymbols); for(idx=0; idxassignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + numSib1Prb; /* 10 PRBs for sib1 */ + schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + numSib1Prb; /* 10 PRBs for sib1 */ } memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->cellCfg.sib1SchCfg.bwp, sizeof(BwpCfg)); memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg)); diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 3a2329355..b61bd2927 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -155,8 +155,8 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgAlloc)); if(!dlMsgAlloc) { - DU_LOG("\nERROR --> SCH : Memory Allocation failed for ded DL msg alloc"); - return RFAILED; + DU_LOG("\nERROR --> SCH : Memory Allocation failed for ded DL msg alloc"); + return RFAILED; } memset(dlMsgAlloc, 0, sizeof(DlMsgAlloc)); dlSchedInfo->dlMsgAlloc = dlMsgAlloc; @@ -170,17 +170,17 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM dlMsgAlloc->numLc = 0; for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++) { - if(ueCb->dlInfo.dlLcCtxt[lcIdx].bo) - { - dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].lcId = lcIdx; - - /* calculation for BO includse RLC and MAC header size */ - dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes = \ - ueCb->dlInfo.dlLcCtxt[lcIdx].bo + MAC_HDR_SIZE; - accumalatedSize += dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes; - dlMsgAlloc->numLc++; - } - ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0; + if(ueCb->dlInfo.dlLcCtxt[lcIdx].bo) + { + dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].lcId = lcIdx; + + /* calculation for BO includse RLC and MAC header size */ + dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes = \ + ueCb->dlInfo.dlLcCtxt[lcIdx].bo + MAC_HDR_SIZE; + accumalatedSize += dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes; + dlMsgAlloc->numLc++; + } + ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0; } /* pdcch and pdsch data is filled */ @@ -225,9 +225,8 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM * ****************************************************************/ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) { - uint8_t ret = ROK; - uint8_t ssb_rep, ueIdx, lcgIdx; - uint16_t slot, sfnSlot = 0; + uint8_t ssb_rep, ueIdx, lcgIdx, ret = ROK; + uint16_t slot; DlSchedInfo dlSchedInfo; DlBrdcstAlloc *dlBrdcstAlloc = NULLP; RarAlloc *rarAlloc = NULLP; @@ -235,7 +234,9 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) DlMsgAlloc *dlMsgAlloc = NULLP; SchCellCb *cell = NULLP; + memset(&dlSchedInfo,0,sizeof(DlSchedInfo)); + dlSchedInfo.dlMsgAlloc = NULLP; schCalcSlotValues(*slotInd, &dlSchedInfo.schSlotValue); dlBrdcstAlloc = &dlSchedInfo.brdcstAlloc; dlBrdcstAlloc->ssbTrans = NO_SSB; @@ -246,23 +247,23 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo)); dlBrdcstAlloc->ssbIdxSupported = 1; - sfnSlot = dlSchedInfo.schSlotValue.broadcastTime.sfn * cell->numSlots + - dlSchedInfo.schSlotValue.broadcastTime.slot; - slot = dlSchedInfo.schSlotValue.currentTime.slot; dlSchedInfo.cellId = cell->cellId; /* Identify SSB ocassion*/ - if (sfnSlot % SCH_MIB_TRANS == 0) + if ((dlSchedInfo.schSlotValue.broadcastTime.sfn % SCH_MIB_TRANS == 0) && (dlSchedInfo.schSlotValue.broadcastTime.slot ==0)) { dlBrdcstAlloc->ssbTrans = SSB_TRANSMISSION; if(!cell->firstSsbTransmitted) cell->firstSsbTransmitted = true; } - else if (cell->firstSsbTransmitted && (sfnSlot % ssb_rep == 0)) + else if (cell->firstSsbTransmitted) { - dlBrdcstAlloc->ssbTrans = SSB_REPEAT; + if((ssb_rep == 5) && ((dlSchedInfo.schSlotValue.broadcastTime.slot == 0 || dlSchedInfo.schSlotValue.broadcastTime.slot == 10))) + dlBrdcstAlloc->ssbTrans = SSB_REPEAT; + else if((dlSchedInfo.schSlotValue.broadcastTime.sfn % (ssb_rep/10) == 0) && dlSchedInfo.schSlotValue.broadcastTime.slot == 0) + dlBrdcstAlloc->ssbTrans = SSB_REPEAT; } else { @@ -270,21 +271,26 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) } /* Identify SIB1 occasions */ - if(sfnSlot % cell->cellCfg.sib1SchCfg.sib1NewTxPeriod == 0) + if((dlSchedInfo.schSlotValue.broadcastTime.sfn % SCH_SIB1_TRANS == 0) && (dlSchedInfo.schSlotValue.broadcastTime.slot ==0)) { dlBrdcstAlloc->sib1Trans = SIB1_TRANSMISSION; if(!cell->firstSib1Transmitted) cell->firstSib1Transmitted = true; } - else if (cell->firstSib1Transmitted && (sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0)) + else if (cell->firstSib1Transmitted) { - dlBrdcstAlloc->sib1Trans = SIB1_REPITITION; + if((dlSchedInfo.schSlotValue.broadcastTime.sfn % (cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod/10) == 0) && + (dlSchedInfo.schSlotValue.broadcastTime.slot == 0)) + { + dlBrdcstAlloc->sib1Trans = SIB1_REPITITION; + } } else { /* not SIB1 occassion */ } + if(dlBrdcstAlloc->ssbTrans || dlBrdcstAlloc->sib1Trans) { dlSchedInfo.isBroadcastPres = true; @@ -292,8 +298,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) ret = schBroadcastAlloc(cell,dlBrdcstAlloc,slot); if(ret != ROK) { - DU_LOG("\nERROR --> SCH : schBroadcastAlloc failed"); - return (ret); + DU_LOG("\nERROR --> SCH : schBroadcastAlloc failed"); + return ret; } } @@ -304,8 +310,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) SCH_ALLOC(rarAlloc, sizeof(RarAlloc)); if(!rarAlloc) { - DU_LOG("\nERROR --> SCH : Memory Allocation failed for RAR alloc"); - return RFAILED; + DU_LOG("\nERROR --> SCH : Memory Allocation failed for RAR alloc"); + return RFAILED; } dlSchedInfo.rarAlloc = rarAlloc; @@ -332,8 +338,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) SCH_ALLOC(msg4Alloc, sizeof(DlMsgAlloc)); if(!msg4Alloc) { - DU_LOG("\nERROR --> SCH : Memory Allocation failed for msg4 alloc"); - return RFAILED; + DU_LOG("\nERROR --> SCH : Memory Allocation failed for msg4 alloc"); + return RFAILED; } dlSchedInfo.dlMsgAlloc = msg4Alloc; @@ -369,28 +375,28 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) for(lcgIdx=0; lcgIdxbsrInfo[lcgIdx].dataVol; - ueCb->bsrInfo[lcgIdx].dataVol = 0; + ueCb->bsrInfo[lcgIdx].dataVol = 0; } if(totDataReq > 0) /* UL grant must be provided for this UE in this slot */ { SchPuschInfo schPuschInfo; memset(&schPuschInfo, 0, sizeof(SchPuschInfo)); - SCH_ALLOC(dciInfo, sizeof(DciInfo)); - if(!dciInfo) - { - DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciInfo alloc"); - return RFAILED; - } - memset(dciInfo,0,sizeof(DciInfo)); - /* update the SFN and SLOT */ - memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo)); - slot = dlSchedInfo.schSlotValue.ulDciTime.slot; - /* Update PUSCH allocation */ - schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo); - /* Fill DCI for UL grant */ - schFillUlDci(ueCb, schPuschInfo, dciInfo); - memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo)); + SCH_ALLOC(dciInfo, sizeof(DciInfo)); + if(!dciInfo) + { + DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciInfo alloc"); + return RFAILED; + } + memset(dciInfo,0,sizeof(DciInfo)); + /* update the SFN and SLOT */ + memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo)); + slot = dlSchedInfo.schSlotValue.ulDciTime.slot; + /* Update PUSCH allocation */ + schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo); + /* Fill DCI for UL grant */ + schFillUlDci(ueCb, schPuschInfo, dciInfo); + memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo)); dlSchedInfo.ulGrant = dciInfo; } } diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 97c6aa3e3..3b9ef66b7 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -616,6 +616,7 @@ void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo) { schUlSlotInfo->assignedPrb[itr] = 0; } + schUlSlotInfo->resAllocBitMap = 0; schUlSlotInfo->puschCurrentPrb = PUSCH_START_RB; schUlSlotInfo->schPuschInfo = NULLP; @@ -641,7 +642,7 @@ void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo) { schDlSlotInfo->assignedPrb[itr] = 0; } - + schDlSlotInfo->resAllocBitMap = 0; for(uint8_t itr=0; itrssbInfo[itr], 0, sizeof(SsbInfo)); @@ -655,18 +656,18 @@ void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo) * * @details * - * Function : schGetSlotFrmt + * Function : schGetSlotSymbFrmt * * This API is invoked to determine if current slot is DL or UL * * @param[in] uint16_t slot - * @param[in] uint32_t slotBitMap from cellCb + * @param[in] uint32_t bitMap from cellCb * @return SlotConfig * -# DL - 0 * -# UL - 1 * -# FLEXI - 2 **/ -SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap) +SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap) { SlotConfig slotFrmt; int mask1 = 0, mask2 = 0; @@ -674,7 +675,7 @@ SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap) slot = (slot%10)*2; mask1 = 1<<(slot); mask2 = 1<<(slot+1); - slotFrmt = ((mask1 & slotBitMap)>>slot) + (2*((mask2 & slotBitMap)>>(slot+1))); + slotFrmt = ((mask1 & bitMap)>>slot) + (2*((mask2 & bitMap)>>(slot+1))); //printf("\n\n\n\n*****FormatType:%d Slot:%d****\n\n\n\n", slotFrmt, slot/2); diff --git a/src/5gnrsch/sch_utils.h b/src/5gnrsch/sch_utils.h index 09ac4c938..195378441 100644 --- a/src/5gnrsch/sch_utils.h +++ b/src/5gnrsch/sch_utils.h @@ -95,7 +95,7 @@ SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti); void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo); void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo); #ifdef NR_TDD -SlotConfig schGetSlotFrmt(uint16_t slot, uint32_t slotBitMap); +SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap); #endif /********************************************************************** diff --git a/src/cm/common_def.h b/src/cm/common_def.h index ca7a9084a..1d3fa7087 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -54,6 +54,7 @@ #include "cm_lib.x" #include "du_log.h" +#define RADIO_FRAME_DURATION 10 /* Time duration of a radio frame in ms */ /* MAX values */ #define MAX_NUM_CELL 1 #define MAX_NUM_UE 1 diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index 92eab3c26..612ec4b23 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -24,7 +24,6 @@ #define NUM_SSB 1 /* max value is 64 */ #define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */ -#define SIB1_NEW_TX_PERIOD 160 #define SIB1_REPETITION_PERIOD 20 #define CORESET_0_INDEX 0 #define CORESET_1_INDEX 1 @@ -544,7 +543,6 @@ typedef struct sib1CellCfg { uint8_t *sib1Pdu; uint16_t sib1PduLen; - uint16_t sib1NewTxPeriod; uint16_t sib1RepetitionPeriod; uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */ uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */ diff --git a/src/cm/mac_sch_interface.h b/src/cm/mac_sch_interface.h index 80ef9bfc7..d8bd6aa53 100644 --- a/src/cm/mac_sch_interface.h +++ b/src/cm/mac_sch_interface.h @@ -62,7 +62,11 @@ #define MAX_SR_BITS_IN_BYTES 1 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8 /* can we have a common numslot numscs between mac sch */ +#ifdef NR_TDD +#define MAX_SLOTS 20 +#else #define MAX_SLOTS 10 +#endif #define MAX_SFN 1024 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */ #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */ @@ -444,7 +448,7 @@ typedef struct dmrsInfo typedef struct pdschFreqAlloc { uint8_t resourceAllocType; - /* since we are using type-1, hence rbBitmap excluded */ + /* since we are using type-1, rbBitmap excluded */ FreqDomainAlloc freqAlloc; uint8_t vrbPrbMapping; } PdschFreqAlloc; @@ -530,7 +534,6 @@ typedef struct { /* parameters recieved from DU-APP */ uint16_t sib1PduLen; - uint16_t sib1NewTxPeriod; uint16_t sib1RepetitionPeriod; uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */ uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */ diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index c61f54868..e94e1f0e0 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -269,7 +269,6 @@ uint8_t readMacCfg() DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \ duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); - duCfgParam.macCellCfg.sib1Cfg.sib1NewTxPeriod = SIB1_NEW_TX_PERIOD; duCfgParam.macCellCfg.sib1Cfg.sib1RepetitionPeriod = SIB1_REPETITION_PERIOD; duCfgParam.macCellCfg.sib1Cfg.coresetZeroIndex = CORESET_0_INDEX; duCfgParam.macCellCfg.sib1Cfg.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX; diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 056c804b4..2a2b1abe5 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -65,7 +65,7 @@ #define PLMN_MNC2 0 #define PLMN_SIZE 3 -/* Spec 30.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */ +/* Spec 38.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */ #define SUL_ARFCN 100 #define SUL_BAND 2 diff --git a/src/du_app/du_egtp.c b/src/du_app/du_egtp.c index 03befe85e..3b7799622 100644 --- a/src/du_app/du_egtp.c +++ b/src/du_app/du_egtp.c @@ -908,6 +908,8 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) ODU_REM_PRE_MSG(&tmpByte[1], mBuf); ODU_REM_PRE_MSG(&tmpByte[2], mBuf); msgLen = (tmpByte[1] << 8) | tmpByte[2]; + UNUSED(msgLen); + UNUSED(version); //DU_LOG("\nDEBUG --> EGTP : msgLen %d", msgLen); -- 2.16.6