X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_fsm.c;h=6f4f8a8c23e0fadfc64bd38d3804f24f1b43055a;hb=7fb274708be5434e1573315b106c554d5562ac42;hp=5b787a346f015b6289dfe3f444b3f4b90da0e894;hpb=c54639b00f6dbf6b737d6345f19b0d0a8febabc0;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 5b787a346..6f4f8a8c2 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -3100,7 +3100,10 @@ uint8_t calcDlTtiReqPduCount(DlSchedInfo *dlInfo) if(dlInfo->rarAlloc != NULLP) { /* PDCCH and PDSCH PDU is filled */ - count += 2; + if(dlInfo->rarAlloc->pduPres == BOTH) + count += 2; + else + count += 1; } if(dlInfo->dlMsgAlloc != NULLP) { @@ -3424,6 +3427,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) DU_LOG("\nDEBUG --> LWR_MAC: MIB sent.."); DU_LOG("\033[0m"); } + if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans) { /* Filling SIB1 param */ @@ -3447,24 +3451,34 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) DU_LOG("\033[0m"); } } + if(currDlSlot->dlInfo.rarAlloc != NULLP) { /* Filling RAR param */ rntiType = RA_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - &currDlSlot->dlInfo, rntiType, CORESET_TYPE0); - numPduEncoded++; - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], - &currDlSlot->dlInfo.rarAlloc->rarPdschCfg, - currDlSlot->dlInfo.rarAlloc->bwp, - pduIndex); - numPduEncoded++; - pduIndex++; + if((currDlSlot->dlInfo.rarAlloc->pduPres == BOTH) || \ + (currDlSlot->dlInfo.rarAlloc->pduPres == PDCCH_PDU)) + { + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ + &currDlSlot->dlInfo, rntiType, CORESET_TYPE0); + numPduEncoded++; + } + if((currDlSlot->dlInfo.rarAlloc->pduPres == BOTH) || \ + (currDlSlot->dlInfo.rarAlloc->pduPres == PDSCH_PDU)) + { + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], + &currDlSlot->dlInfo.rarAlloc->rarPdschCfg, + currDlSlot->dlInfo.rarAlloc->bwp, + pduIndex); + numPduEncoded++; + pduIndex++; - DU_LOG("\033[1;32m"); - DU_LOG("\nDEBUG --> LWR_MAC: RAR sent..."); - DU_LOG("\033[0m"); + DU_LOG("\033[1;32m"); + DU_LOG("\nDEBUG --> LWR_MAC: RAR sent..."); + DU_LOG("\033[0m"); + } } + if(currDlSlot->dlInfo.dlMsgAlloc != NULLP) { if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu != NULLP) @@ -3629,16 +3643,19 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, DlSchedInfo *dlInfo, p_fap pduIndex++; txDataReq->num_pdus++; } + if(dlInfo->rarAlloc != NULLP) { - fillRarTxDataReq(txDataReq->pdu_desc, pduIndex, &dlInfo->rarAlloc->rarInfo,\ - dlInfo->rarAlloc->rarPdschCfg); - pduIndex++; - txDataReq->num_pdus++; - - MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc)); - dlInfo->rarAlloc = NULLP; + if((dlInfo->rarAlloc->pduPres == BOTH) || (dlInfo->rarAlloc->pduPres == PDSCH_PDU)) + { + fillRarTxDataReq(txDataReq->pdu_desc, pduIndex, &dlInfo->rarAlloc->rarInfo,\ + dlInfo->rarAlloc->rarPdschCfg); + pduIndex++; + txDataReq->num_pdus++; + } + MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc)); } + if(dlInfo->dlMsgAlloc != NULLP) { fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, &dlInfo->dlMsgAlloc->dlMsgInfo,\ @@ -3650,7 +3667,6 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, DlSchedInfo *dlInfo, p_fap dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPduLen); dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPdu = NULLP; MAC_FREE(dlInfo->dlMsgAlloc, sizeof(DlMsgAlloc)); - dlInfo->dlMsgAlloc = NULLP; } /* Fill message header */