X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_msg_hdl.c;h=fa8b678b605eb43e40612b9ff2366ab1742bd15a;hb=1931d49496d91723b7c54c63db50ff4ee8ff03b6;hp=01f798995ed1effd9656260b401624cd98be8c1f;hpb=b8044fce6d8a277254f235d128c8729ed0b5e7b0;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 01f798995..fa8b678b6 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 */ @@ -191,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; } @@ -320,7 +325,9 @@ uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo) * ****************************************************************/ uint16_t MacHdlDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) { + uint16_t idx; DlRlcBOInfo dlBoInfo; + memset(&dlBoInfo, 0, sizeof(DlRlcBOInfo)); DU_LOG("\nMAC : Handling DL CCCH IND"); @@ -331,29 +338,31 @@ uint16_t MacHdlDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo) if(dlCcchIndInfo->msgType == RRC_SETUP) { + dlBoInfo.boInfo[dlBoInfo.numLc].lcId = SRB_ID_0; // SRB ID 0 for msg4 + dlBoInfo.boInfo[SRB_ID_0].dataVolume = \ + dlCcchIndInfo->dlCcchMsgLen; 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); + macCb.macCell->macRaCb[0].msg4PduLen = dlCcchIndInfo->dlCcchMsgLen; 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); + for(idx = 0; idx < dlCcchIndInfo->dlCcchMsgLen; idx++) + { + macCb.macCell->macRaCb[0].msg4Pdu[idx] =\ + dlCcchIndInfo->dlCcchMsg[idx]; + } } } } sendDlRlcBoInfoMacToSch(&dlBoInfo); MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo->dlCcchMsg, \ - strlen((const char*)dlCcchIndInfo->dlCcchMsg)); + dlCcchIndInfo->dlCcchMsgLen); MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo, sizeof(DlCcchIndInfo)); return ROK;