X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_msg_hdl.c;h=eed1dad947aba2f93cd5bb7ee28212e4dae2ec78;hb=49dec2270f1b3c03b36a801e153bf0786edffc24;hp=62d8f9c5c8d5b1e72a7118cb849c8021f68cf081;hpb=134974ec70ab6e0501889e5d162a3b0c806c3bdc;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 62d8f9c5c..eed1dad94 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -17,6 +17,7 @@ *******************************************************************************/ /* header include files -- defines (.h) */ +#include #include "envopt.h" /* environment options */ #include "envdep.h" /* environment dependent */ #include "envind.h" /* environment independent */ @@ -65,6 +66,7 @@ extern MacCb macCb; extern void sendToLowerMac(uint16_t msgType, uint32_t msgLen, void *msg); +uint16_t buildMacPdu(RlcMacData *dlData); /* Function pointer for sending crc ind from MAC to SCH */ MacSchCrcIndFunc macSchCrcIndOpts[]= @@ -190,9 +192,13 @@ uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd) uint16_t pduIdx; DU_LOG("\nMAC : Received Rx Data indication"); + + /* TODO : compare the handle received in RxDataInd with handle send in PUSCH + * PDU, which is stored in raCb */ + for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++) { - unpackRxData(rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]); + unpackRxData(&rxDataInd->pdus[pduIdx]); } return ROK; } @@ -322,28 +328,38 @@ uint16_t MacHdlDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) DlRlcBOInfo dlBoInfo; DU_LOG("\nMAC : Handling DL CCCH IND"); - - /* TODO : Fill DL RLC Buffer status info */ - dlBoInfo.cellId = dlCcchIndInfo->cellId; - dlBoInfo.crnti = dlCcchIndInfo->crnti; - dlBoInfo.numLc = 0; - - if(dlCcchIndInfo->msgType == RRC_SETUP) - { - dlBoInfo.numLc++; - dlBoInfo.boInfo[dlBoInfo.numLc].lcId = 0; // SRB 0 for msg4 - dlBoInfo.boInfo[dlBoInfo.numLc].dataVolume = \ - strlen((const char*)dlCcchIndInfo->dlCcchMsg); + + /* TODO : Fill DL RLC Buffer status info */ + dlBoInfo.cellId = dlCcchIndInfo->cellId; + dlBoInfo.crnti = dlCcchIndInfo->crnti; + dlBoInfo.numLc = 0; + + if(dlCcchIndInfo->msgType == RRC_SETUP) + { + dlBoInfo.numLc++; + dlBoInfo.boInfo[dlBoInfo.numLc].lcId = 0; // SRB 0 for msg4 + dlBoInfo.boInfo[dlBoInfo.numLc].dataVolume = \ + strlen((const char*)dlCcchIndInfo->dlCcchMsg); + + /* storing Msg4 Pdu in raCb */ + if(macCb.macCell->macRaCb[0].crnti == dlCcchIndInfo->crnti) + { + macCb.macCell->macRaCb[0].msg4PduLen = strlen((const char*)dlCcchIndInfo\ + ->dlCcchMsg); + MAC_ALLOC(macCb.macCell->macRaCb[0].msg4Pdu, macCb.macCell->macRaCb[0]\ + .msg4PduLen); + if(macCb.macCell->macRaCb[0].msg4Pdu) + { + memcpy(macCb.macCell->macRaCb[0].msg4Pdu, dlCcchIndInfo->dlCcchMsg,\ + macCb.macCell->macRaCb[0].msg4PduLen); + } + } } - - /* TODO: Store dlCcchMsg in raCb */ - - sendDlRlcBoInfoMacToSch(&dlBoInfo); - - - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo->dlCcchMsg, \ - strlen((const char*)dlCcchIndInfo->dlCcchMsg)); - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo, sizeof(DlCcchIndInfo)); + sendDlRlcBoInfoMacToSch(&dlBoInfo); + + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo->dlCcchMsg, \ + strlen((const char*)dlCcchIndInfo->dlCcchMsg)); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo, sizeof(DlCcchIndInfo)); return ROK; }