X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2F5gnrmac%2Fmac_rach.c;h=13c85edbec2e4790d53320e6eb77ed91f027c1f5;hb=22dec8bbab96f5bfad385f0a23cd33c95edb2e1f;hp=246e02ba4b36e7203ebb9b1a918a45bf8daecc2a;hpb=ee769160fe5360f0d3ea043deaede2902ae13073;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_rach.c b/src/5gnrmac/mac_rach.c index 246e02ba4..13c85edbe 100644 --- a/src/5gnrmac/mac_rach.c +++ b/src/5gnrmac/mac_rach.c @@ -16,6 +16,7 @@ ################################################################################ *******************************************************************************/ /* header include files (.h) */ +#include #include "envopt.h" /* environment options */ #include "envdep.h" /* environment dependent */ #include "envind.h" /* environment independent */ @@ -99,42 +100,43 @@ uint16_t fapiMacRachInd(Pst *pst, RachInd *rachInd) { uint8_t pduIdx; uint8_t preambleIdx; - RachIndInfo *rachIndInfo; + RachIndInfo rachIndInfo; DU_LOG("\nMAC : Received RACH indication"); /* Considering one pdu and one preamble */ pduIdx = 0; preambleIdx = 0; - rachIndInfo = &macCb.macCell->raCb; - - rachIndInfo->cellId = rachInd->rachPdu[pduIdx].pci; - /* TODO : Allocate unique crnti for each ue */ - rachIndInfo->crnti = 100; - rachIndInfo->timingInfo.sfn = rachInd->timingInfo.sfn; - rachIndInfo->timingInfo.slot = rachInd->timingInfo.slot; - rachIndInfo->slotIdx = rachInd->rachPdu[pduIdx].slotIdx; - rachIndInfo->symbolIdx = rachInd->rachPdu[pduIdx].symbolIdx; - rachIndInfo->freqIdx = rachInd->rachPdu[pduIdx].freqIdx; - rachIndInfo->preambleIdx = \ + rachIndInfo.cellId = rachInd->rachPdu[pduIdx].pci; + /* TODO : A.ocate unique crnti for each ue */ + rachIndInfo.crnti = 100; + rachIndInfo.timingInfo.sfn = rachInd->timingInfo.sfn; + rachIndInfo.timingInfo.slot = rachInd->timingInfo.slot; + rachIndInfo.slotIdx = rachInd->rachPdu[pduIdx].slotIdx; + rachIndInfo.symbolIdx = rachInd->rachPdu[pduIdx].symbolIdx; + rachIndInfo.freqIdx = rachInd->rachPdu[pduIdx].freqIdx; + rachIndInfo.preambleIdx = \ rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].preamIdx; - rachIndInfo->timingAdv = \ + rachIndInfo.timingAdv = \ rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].timingAdv; - return(sendRachIndMacToSch(rachIndInfo)); + /* storing the value in macRaCb */ + createMacRaCb(rachIndInfo.cellId, rachIndInfo.crnti); + + return(sendRachIndMacToSch(&rachIndInfo)); } /* spec-38.211 Table 6.3.3.1-7 */ uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX] = {0, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 23, 27, 34, 46, 69}; -int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo) +int MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo) { - if(ulSchInfo != NULLP) + if(ulSchedInfo != NULLP) { MacUlSlot *currUlSlot = - &macCb.macCell->ulSlot[ulSchInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED]; - memcpy(&currUlSlot->ulCellInfo, ulSchInfo, sizeof(UlSchInfo)); + &macCb.macCell->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED]; + memcpy(&currUlSlot->ulInfo, ulSchedInfo, sizeof(UlSchedInfo)); } return ROK; }