X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_mux.c;h=82a63c5e9292f263c10968989e6cff5bd84c2827;hb=9f07d42c8d327e4009833fc4c673e4086c4e726e;hp=dc177dae8ca8c5a1b37c3b42a790f23414f255f7;hpb=fe5d6711157dc1d3308a9754893b58b3872cd81a;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_mux.c b/src/5gnrmac/mac_mux.c index dc177dae8..82a63c5e9 100644 --- a/src/5gnrmac/mac_mux.c +++ b/src/5gnrmac/mac_mux.c @@ -226,18 +226,21 @@ void fillRarPdu(RarInfo *rarInfo) * ****************************************************************/ void createMacRaCb(RachIndInfo *rachIndInfo) { - uint8_t ueId = 0, ueIdx = 0; + int8_t ueIdx = -1; uint16_t crnti = 0; uint16_t cellIdx = 0; GET_CELL_IDX(rachIndInfo->cellId, cellIdx); - crnti = getNewCrnti(&macCb.macCell[cellIdx]->crntiMap); - if(crnti == -1) + ueIdx = getFreeBitFromUeBitMap(rachIndInfo->cellId); + if(ueIdx == -1) + { + DU_LOG("\nERROR --> MAC : Failed to find free UE Idx in UE bit map of cell Id [%d]", rachIndInfo->cellId); return; + } - GET_UE_ID(crnti, ueId); - ueIdx = ueId -1; + /* Calculate CRNTI from UE Index */ + GET_CRNTI(crnti, ueIdx+1); /* store in rach ind structure */ rachIndInfo->crnti = crnti;