[Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-492] WG8 Alignment [RAR Scheduling + Downlink... 38/10438/13
authorlal.harshita <Harshita.Lal@radisys.com>
Fri, 10 Feb 2023 11:51:21 +0000 (17:21 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Wed, 1 Mar 2023 07:19:38 +0000 (12:49 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: I3d4911daa4f61a170bf7c0a154e2bbfa8993f06a
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
17 files changed:
src/5gnrmac/lwr_mac_fsm.c
src/5gnrmac/mac.h
src/5gnrmac/mac_harq_dl.c
src/5gnrmac/mac_harq_dl.h
src/5gnrmac/mac_msg_hdl.c
src/5gnrmac/mac_slot_ind.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_fcfs.c
src/5gnrsch/sch_rach.c
src/5gnrsch/sch_slice_based.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_ue_mgr.c
src/5gnrsch/sch_utils.c
src/cm/mac_sch_interface.h
src/du_app/du_mgr_main.c

index 85f97bc..876e117 100644 (file)
@@ -2546,8 +2546,8 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo)
        * Spec 38.214 Sec 5.1.2.2.2
        */
       coreset0Size= sib1PdcchInfo->coresetCfg.coreSetSize;
-      rbStart = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
-      rbLen = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+      rbStart = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+      rbLen = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
 
       if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
       {
@@ -2561,10 +2561,10 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo)
       }
 
       /* Fetching DCI field values */
-      timeDomResAssign = sib1PdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1;
-      VRB2PRBMap       = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
-      modNCodScheme    = sib1PdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
-      redundancyVer    = sib1PdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
+      timeDomResAssign = sib1PdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1;
+      VRB2PRBMap       = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+      modNCodScheme    = sib1PdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
+      redundancyVer    = sib1PdcchInfo->dci.pdschCfg.codeword[0].rvIndex;
       sysInfoInd       = 0;           /* 0 for SIB1; 1 for SI messages */
       reserved         = 0;
 
@@ -2852,8 +2852,8 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo)
 
       /* TODO: Fill values of coreset0Size, rbStart and rbLen */
       coreset0Size= rarPdcchInfo->coresetCfg.coreSetSize;
-      rbStart = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
-      rbLen = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+      rbStart = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+      rbLen = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
 
       if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
       {
@@ -2867,9 +2867,9 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo)
       }
 
       /* Fetching DCI field values */
-      timeDomResAssign = rarPdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex;
-      VRB2PRBMap       = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
-      modNCodScheme    = rarPdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
+      timeDomResAssign = rarPdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex;
+      VRB2PRBMap       = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+      modNCodScheme    = rarPdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
       tbScaling        = 0; /* configured to 0 scaling */
       reserved         = 0;
 
@@ -2934,7 +2934,7 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo)
  *
  ******************************************************************/
 void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\
-      DlMsgInfo *dlMsgInfo)
+      DlMsgSchInfo *dlMsgSchInfo)
 {
    if(dlDciPtr != NULLP)
    {
@@ -2992,8 +2992,8 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\
        * Spec 38.214 Sec 5.1.2.2.2
        */
       coresetSize = pdcchInfo->coresetCfg.coreSetSize;
-      rbStart = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
-      rbLen = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+      rbStart = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+      rbLen = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
 
       if((rbLen >=1) && (rbLen <= coresetSize - rbStart))
       {
@@ -3007,17 +3007,17 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\
       }
 
       /* Fetching DCI field values */
-      dciFormatId      = dlMsgInfo->dciFormatId;     /* Always set to 1 for DL */
-      timeDomResAssign = pdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1;
-      VRB2PRBMap       = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
-      modNCodScheme    = pdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
-      ndi              = dlMsgInfo->ndi;
-      redundancyVer    = pdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
-      harqProcessNum   = dlMsgInfo->harqProcNum;
-      dlAssignmentIdx  = dlMsgInfo->dlAssignIdx;
-      pucchTpc         = dlMsgInfo->pucchTpc;
-      pucchResoInd     = dlMsgInfo->pucchResInd;
-      harqFeedbackInd  = dlMsgInfo->harqFeedbackInd;
+      dciFormatId      = dlMsgSchInfo->dciFormatId;     /* Always set to 1 for DL */
+      timeDomResAssign = pdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1;
+      VRB2PRBMap       = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+      modNCodScheme    = pdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
+      ndi              = dlMsgSchInfo->transportBlock[0].ndi;
+      redundancyVer    = pdcchInfo->dci.pdschCfg.codeword[0].rvIndex;
+      harqProcessNum   = dlMsgSchInfo->harqProcNum;
+      dlAssignmentIdx  = dlMsgSchInfo->dlAssignIdx;
+      pucchTpc         = dlMsgSchInfo->pucchTpc;
+      pucchResoInd     = dlMsgSchInfo->pucchResInd;
+      harqFeedbackInd  = dlMsgSchInfo->harqFeedbackInd;
 
       /* Reversing bits in each DCI field */
       dciFormatId      = reverseBits(dciFormatId, dciFormatIdSize);
@@ -3171,28 +3171,29 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_
       memset(&dlTtiReqPdu->pdu.pdcch_pdu, 0, sizeof(fapi_dl_pdcch_pdu_t));
       if(rntiType == SI_RNTI_TYPE)
       {
-         pdcchInfo = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg;
+         pdcchInfo = dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg;
          bwp = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp;
          fillSib1DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
       }
       else if(rntiType == RA_RNTI_TYPE)
       {
-         pdcchInfo = &dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg;
+         pdcchInfo = dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg;
          bwp = &dlSlot->dlInfo.rarAlloc[ueIdx]->bwp;
          fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
       }
       else if(rntiType == TC_RNTI_TYPE || rntiType == C_RNTI_TYPE)
       {
-         pdcchInfo = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgPdcchCfg;
-         bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].bwp;
+         pdcchInfo = dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg;
+         bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp;
          fillDlMsgDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
-               &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgInfo);
+               dlSlot->dlInfo.dlMsgAlloc[ueIdx]);
       }
       else
       {
          DU_LOG("\nERROR  -->  LWR_MAC: Failed filling PDCCH Pdu");
          return RFAILED;
       }
+      
       dlTtiReqPdu->pduType = PDCCH_PDU_TYPE;
       dlTtiReqPdu->pdu.pdcch_pdu.bwpSize = bwp->freqAlloc.numPrb;
       dlTtiReqPdu->pdu.pdcch_pdu.bwpStart = bwp->freqAlloc.startPrb;
@@ -3445,7 +3446,7 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot)
       if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP)
       {
          /* PDCCH and PDSCH PDU is filled */
-         if(dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH)
+         if(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg && dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg)
             count += 2;
          else
             count += 1;
@@ -3453,14 +3454,11 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot)
 
       if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
       {
-         for(idx=0; idx<dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
-         {
-            /* PDCCH and PDSCH PDU is filled */
-            if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH)
-               count += 2;
-            else if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres != NONE)
-               count += 1;
-         }
+         /* PDCCH and PDSCH PDU is filled */
+         if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg)
+            count += 1;
+         if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+            count += 1;
       }
    }
    return count;
@@ -3483,7 +3481,7 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot)
  * ********************************************************************/
 uint8_t calcTxDataReqPduCount(MacDlSlot *dlSlot)
 {
-   uint8_t idx = 0, count = 0, ueIdx=0;
+   uint8_t count = 0, ueIdx=0;
 
    if(dlSlot->dlInfo.isBroadcastPres && dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode)
    {
@@ -3496,18 +3494,13 @@ uint8_t calcTxDataReqPduCount(MacDlSlot *dlSlot)
 
    for(ueIdx=0; ueIdx<MAX_NUM_UE; ueIdx++)
    {
-      if((dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) && \
-            ((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)))
+      if((dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) &&  (dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg))
          count++;
 
       if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
       {
-         for(idx=0; idx<dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
-         {
-            if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH || \
-                  dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)
-               count++;
-         }
+         if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+            count++;
       }
    }
    return count;
@@ -3654,7 +3647,7 @@ uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPage
  * @return ROK
  *
  * ********************************************************************/
-uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg pdschCfg)
+uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg *pdschCfg)
 {
    uint16_t payloadSize;
    uint8_t  *rarPayload = NULLP;
@@ -3667,7 +3660,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo
    pduDesc[pduIndex].num_tlvs = 1;
 
    /* fill the TLV */
-   payloadSize = pdschCfg.codeword[0].tbSize;
+   payloadSize = pdschCfg->codeword[0].tbSize;
    pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
    pduDesc[pduIndex].tlvs[0].tl.length = payloadSize;
    LWR_MAC_ALLOC(rarPayload, payloadSize);
@@ -3713,7 +3706,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo
  * @return ROK
  *
  * ********************************************************************/
-uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgInfo *dlMsgInfo, PdschCfg pdschCfg)
+uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgSchInfo *dlMsgSchInfo, PdschCfg *pdschCfg)
 {
    uint16_t payloadSize;
    uint8_t  *dlMsgPayload = NULLP;
@@ -3726,7 +3719,7 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsg
    pduDesc[pduIndex].num_tlvs = 1;
 
    /* fill the TLV */
-   payloadSize = pdschCfg.codeword[0].tbSize;
+   payloadSize = pdschCfg->codeword[0].tbSize;
    pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
    pduDesc[pduIndex].tlvs[0].tl.length = payloadSize;
    LWR_MAC_ALLOC(dlMsgPayload, payloadSize);
@@ -3735,8 +3728,8 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsg
       return RFAILED;
    }
    payloadElem = (fapi_api_queue_elem_t *)dlMsgPayload;
-   FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgInfo->dlMsgPduLen);
-   memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgInfo->dlMsgPdu, dlMsgInfo->dlMsgPduLen);
+   FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgSchInfo->dlMsgPduLen);
+   memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgSchInfo->dlMsgPdu, dlMsgSchInfo->dlMsgPduLen);
 
 #ifdef INTEL_WLS_MEM
    mtGetWlsHdl(&wlsHdlr);
@@ -3889,7 +3882,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo)
 
                                                   /* PDSCH PDU */
                                                   fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
-                                                                  currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg,
+                                                                  &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg,
                                                                   currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp,
                                                                   pduIndex);
                                                   dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex;
@@ -3928,24 +3921,23 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo)
                                   {
                                           /* Filling RAR param */
                                           rntiType = RA_RNTI_TYPE;
-                                          if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \
-                                                          (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU))
-                                          {
+                  if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg)
+                  {
                                                   fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
                                                                   currDlSlot, -1, rntiType, CORESET_TYPE0, ueIdx);
                                                   numPduEncoded++;
-                                          }
-                                          if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \
-                                                          (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU))
+                     MAC_FREE(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg, sizeof(PdcchCfg));
+                  }
+                                          if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg)
                                           {
                                                   fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
-                                                                  &currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg,
+                                                                  currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg,
                                                                   currDlSlot->dlInfo.rarAlloc[ueIdx]->bwp,
                                                                   pduIndex);
                                                   numPduEncoded++;
                                                   pduIndex++;
 
-                                                  DU_LOG("\033[1;32m");
+                     DU_LOG("\033[1;32m");
                                                   DU_LOG("\nDEBUG  -->  LWR_MAC: RAR sent...");
                                                   DU_LOG("\033[0m");
                                           }
@@ -3953,59 +3945,45 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo)
 
                                   if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
                                   {
-                                          for(idx=0; idx<currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
-                                          {
-                                                  /* Filling Msg4 param */
-                                                  if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \
-                                                                  (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU))
-                                                  {
-                                                          if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu)
-                                                          {
-                                                                  rntiType = TC_RNTI_TYPE;
-                                                                  fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
-                                                                                  currDlSlot, idx, rntiType, CORESET_TYPE0, ueIdx);
-                                                          }
-                                                          else
-                                                          { 
-                                                                  /* Filling other DL msg params */
-                                                                  rntiType = C_RNTI_TYPE;
-                                                                  fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
-                                                                                  currDlSlot, idx, rntiType, CORESET_TYPE1, ueIdx);
-                                                          }
-                                                          numPduEncoded++;
-                                                  }
-
-                                                  if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP)
-                                                  {
-                                                          if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \
-                                                                          (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU))
-                                                          {
-                                                                  fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \
-                                                                                  &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\
-                                                                                  currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex);
-                                                                  numPduEncoded++;
-                                                                  pduIndex++;
-
-                                                                  DU_LOG("\033[1;32m");
-                                                                  if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu)
-                                                                  {
-                                                                          DU_LOG("\nDEBUG  -->  LWR_MAC: MSG4 sent...");
-                                                                  }
-                                                                  else
-                                                                  {
-                                                                          DU_LOG("\nDEBUG  -->  LWR_MAC: DL MSG sent...");
-                                                                  }
-                                                                  DU_LOG("\033[0m");
-                                                          }
-
-                                                  }
-                                                  /*   else
-                                                       {
-                                                       MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
-                                                       currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP;
-                                                       }
-                                                       */
-                                          }
+                  if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg)  \
+                  {
+                     rntiType = C_RNTI_TYPE;
+                     fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
+                           currDlSlot, idx, rntiType, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType, ueIdx);
+                     numPduEncoded++;
+                  }
+
+                  if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu != NULLP)
+                  {
+                     if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+                     {
+                        fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \
+                              currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,\
+                              currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp, pduIndex);
+                        numPduEncoded++;
+                        pduIndex++;
+
+                        DU_LOG("\033[1;32m");
+                        if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status))
+                        {
+                           DU_LOG("\nDEBUG  -->  LWR_MAC: MSG4 sent...");
+                           MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool));
+                        }
+                        else
+                        {
+                           DU_LOG("\nDEBUG  -->  LWR_MAC: DL MSG sent...");
+                        }
+                        DU_LOG("\033[0m");
+                     }
+
+                  }
+                  MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg,sizeof(PdcchCfg));
+                  /*   else
+                       {
+                       MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
+                       currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP;
+                       }
+                       */
                                   }
                           }
 
@@ -4104,7 +4082,6 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_
 
    uint8_t  nPdu = 0;
    uint8_t  ueIdx=0;
-   uint8_t  schInfoIdx = 0;
    uint16_t cellIdx=0;
    uint16_t pduIndex = 0;
    fapi_tx_data_req_t       *txDataReq =NULLP;
@@ -4136,8 +4113,9 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_
       if(dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode)
       {
          fillSib1TxDataReq(txDataReq->pdu_desc, pduIndex, &macCb.macCell[cellIdx]->macCellCfg, \
-               dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg);
+               &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg);
          pduIndex++;
+         MAC_FREE(dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg,sizeof(PdcchCfg));
          txDataReq->num_pdus++;
       }
       if(dlSlot->pageAllocInfo != NULLP)
@@ -4153,34 +4131,32 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_
       {
          if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP)
          {
-            if((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU))
+            if((dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg))
             {
                fillRarTxDataReq(txDataReq->pdu_desc, pduIndex, &dlSlot->dlInfo.rarAlloc[ueIdx]->rarInfo,\
                      dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg);
                pduIndex++;
                txDataReq->num_pdus++;
+               MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, sizeof(PdschCfg));
             }
             MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx],sizeof(RarAlloc));
          }
 
          if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
          {
-            for(schInfoIdx=0; schInfoIdx < dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+            if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg) 
             {
-               if((dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH) || \
-                     (dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU))
-               {
-                  fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \
-                        &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo, \
-                        dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg);
-                  pduIndex++;
-                  txDataReq->num_pdus++;
-               }
-               MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu, \
-                     dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen);
-               dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = NULLP;
+               fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \
+                     dlSlot->dlInfo.dlMsgAlloc[ueIdx], \
+                     dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg);
+               pduIndex++;
+               txDataReq->num_pdus++;
+               MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,sizeof(PdschCfg));
             }
-            MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
+            MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu, \
+                  dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen);
+            dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = NULLP;
+            MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgSchInfo));
          }
       }
 
index e84bba3..ea4bfa0 100644 (file)
@@ -124,6 +124,7 @@ typedef struct macCbInfo
    uint8_t     *msg4Pdu;    /* storing DL-CCCH Ind Pdu */
    uint16_t    msg4PduLen;  /* storing DL-CCCH Ind Pdu Len */
    DlHarqProcCb msg4HqInfo; /* HARQ process info for msg 4 */
+   bool         *macMsg4Status;
 }MacRaCbInfo;
 
 typedef struct macCe
@@ -267,7 +268,7 @@ void fillMsg4DlData(MacDlData *dlData, uint16_t msg4PduLen, uint8_t *msg4Pdu);
 void fillMacCe(MacCeInfo  *macCeData, uint8_t *msg3Pdu);
 void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize);
 uint8_t unpackRxData(uint16_t cellId, SlotTimingInfo slotInfo, RxDataIndPdu *rxDataIndPdu);
-void fillMg4Pdu(DlMsgAlloc *msg4Alloc);
+void fillMg4Pdu(DlMsgSchInfo *msg4Alloc);
 void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo);
 uint8_t macProcUlCcchInd(uint16_t cellId, uint16_t crnti, uint16_t rrcContSize, uint8_t *rrcContainer);
 uint8_t macProcShortBsr(uint16_t cellId, uint16_t crnti, uint8_t lcgId, uint32_t bufferSize);
index 1d62851..4a87966 100644 (file)
  *  @return
  *      -# Void
  **/
-void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo schedInfo)
+void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo *schedInfo)
 {
    uint8_t       hqProcId = 0, tbIdx = 0, cwIdx = 0;
    DlHarqEnt     *dlHqEnt = NULLP;
    DlHarqProcCb  *hqProcCb = NULLP;
 
    dlHqEnt = &ueCb->dlInfo.dlHarqEnt;  
-   hqProcId = schedInfo.dlMsgInfo.harqProcNum;
+   hqProcId = schedInfo->harqProcNum;
    hqProcCb = &dlHqEnt->harqProcCb[hqProcId];
 
    /* Check if harqProcId is already present in UE's DL HARQ Entity */
-   if(hqProcCb->procId == schedInfo.dlMsgInfo.harqProcNum)
+   if(hqProcCb->procId == schedInfo->harqProcNum)
    {
       /* Expected Behaviour:
        * If a HARQ proc is already present in DL HARQ entity, it means this HARQ proc 
@@ -72,10 +72,10 @@ void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo sched
 
    /* Fill HARQ Proc Cb */
    hqProcCb->procId = hqProcId;
-   for(cwIdx = 0; cwIdx < schedInfo.dlMsgPdschCfg.numCodewords; cwIdx++)
+   for(cwIdx = 0; cwIdx < schedInfo->dlMsgPdschCfg->numCodewords; cwIdx++)
    {
       memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlMsgTime, sizeof(SlotTimingInfo));
-      hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo.dlMsgPdschCfg.codeword[cwIdx].tbSize;
+      hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo->dlMsgPdschCfg->codeword[cwIdx].tbSize;
       hqProcCb->numTb++;
    }
    return;
index b0b74b4..8ac0e28 100644 (file)
@@ -16,7 +16,7 @@
 ################################################################################
  *******************************************************************************/
 
-void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo schedInfo);
+void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo *schedInfo);
 uint8_t updateNewTbInDlHqProcCb(SlotTimingInfo slotInfo, MacUeCb *ueCb, uint32_t tbSize, uint8_t *txPdu);
 uint8_t* fetchTbfromDlHarqProc(SlotTimingInfo slotInfo, MacUeCb *ueCb, uint8_t hqProcId, uint32_t tbSize);
 uint8_t MacSchReleaseDlHarqProc(Pst *pst, SchRlsHqInfo *rlsHqInfo);
index 7e015af..0369b2c 100644 (file)
@@ -190,7 +190,6 @@ uint8_t MacProcRlcDlData(Pst* pstInfo, RlcDlData *dlData)
    uint8_t   ueId  = 0;
    uint8_t   lcIdx = 0;
    uint8_t   *txPdu = NULLP;
-   uint8_t   schInfoIdx = 0 ;
    uint16_t  cellIdx = 0, txPduLen = 0;
    MacDlData macDlData;
    MacDlSlot *currDlSlot = NULLP;
@@ -222,29 +221,25 @@ uint8_t MacProcRlcDlData(Pst* pstInfo, RlcDlData *dlData)
    currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlData->slotInfo.slot];
    if(currDlSlot->dlInfo.dlMsgAlloc[ueId-1])
    {
-      for(schInfoIdx=0; schInfoIdx<currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->numSchedInfo; schInfoIdx++)
+      if(currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg)
       {
-         if((currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
-               (currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH))
-            break;
-      }
-
-      txPduLen = currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[0].tbSize\
-                 - TX_PAYLOAD_HDR_LEN;
-      MAC_ALLOC(txPdu, txPduLen);
-      if(!txPdu)
-      {
-         DU_LOG("\nERROR  -->  MAC : Memory allocation failed in MacProcRlcDlData");
-         return RFAILED;
+         txPduLen = currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg->codeword[0].tbSize\
+                    - TX_PAYLOAD_HDR_LEN;
+         MAC_ALLOC(txPdu, txPduLen);
+         if(!txPdu)
+         {
+            DU_LOG("\nERROR  -->  MAC : Memory allocation failed in MacProcRlcDlData");
+            return RFAILED;
+         }
+         macMuxPdu(&macDlData, NULLP, txPdu, txPduLen);
+
+         currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPduLen = txPduLen;
+         currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdu = txPdu;
+         /* Add muxed TB to DL HARQ Proc CB. This will be used if retranmission of
+          * TB is requested in future. */
+         updateNewTbInDlHqProcCb(dlData->slotInfo, &macCb.macCell[cellIdx]->ueCb[ueId -1], \
+               currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg->codeword[0].tbSize, txPdu);
       }
-      macMuxPdu(&macDlData, NULLP, txPdu, txPduLen);
-
-      currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen = txPduLen;
-      currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = txPdu;
-      /* Add muxed TB to DL HARQ Proc CB. This will be used if retranmission of
-       * TB is requested in future. */
-      updateNewTbInDlHqProcCb(dlData->slotInfo, &macCb.macCell[cellIdx]->ueCb[ueId -1], \
-         currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[0].tbSize, txPdu);
    }
 
    for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
@@ -399,11 +394,11 @@ uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotTimingInfo slotInfo, uint8_t u
    if(dlInfo.dlMsgAlloc[ueIdx])
    {
       schedRpt->rnti = dlInfo.dlMsgAlloc[ueIdx]->crnti;
-      schedRpt->numLc = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].numLc;
+      schedRpt->numLc = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].numLc;
       for(lcIdx = 0; lcIdx < schedRpt->numLc; lcIdx++)
       {
-         schedRpt->lcSch[lcIdx].lcId = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].lcSchInfo[lcIdx].lcId;
-         schedRpt->lcSch[lcIdx].bufSize = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].lcSchInfo[lcIdx].schBytes;
+         schedRpt->lcSch[lcIdx].lcId = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].lcSchInfo[lcIdx].lcId;
+         schedRpt->lcSch[lcIdx].bufSize = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].lcSchInfo[lcIdx].schBytes;
       }
    }
 
index 042c89d..e17d220 100644 (file)
@@ -54,7 +54,7 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
    uint8_t   *retxTb = NULLP, *txPdu = NULLP;
    uint16_t  txPduLen = 0;
    MacDlSlot      *currDlSlot = NULLP;
-   DlMsgSchInfo   schedInfo;
+   DlMsgSchInfo   *schedInfo;
    DlHarqProcCb   *hqProcCb = NULLP;
 
 #ifdef CALL_FLOW_DEBUG_LOG
@@ -88,85 +88,84 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
                          dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
             currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = dlSchedInfo->dlMsgAlloc[ueIdx]; /* copy msg4 alloc pointer in MAC slot info */
             currDlSlot->dlInfo.cellId = dlSchedInfo->cellId;
+            
+            if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg && dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType == CORESET_TYPE0)
+            {
+               MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool));
+            }
 
             /* Check if the downlink pdu is msg4 */
-            for(schInfoIdx=0; schInfoIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+            if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status))
             {
-               if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu)
-               {
-                  GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.crnti, ueId);
-                  ueIdx = ueId -1;
-                  schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx];
-                  hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
+               GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->crnti, ueId);
+               ueIdx = ueId -1;
+               schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx];
+               hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
 
-                  if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+               if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
+               {
+                  /* First transmission of MSG4 */
+                  hqProcCb->procId = schedInfo->harqProcNum;
+                  for(cwIdx = 0; cwIdx < schedInfo->dlMsgPdschCfg->numCodewords; cwIdx++)
                   {
-                     /* First transmission of MSG4 */
-                     hqProcCb->procId = schedInfo.dlMsgInfo.harqProcNum;
-                     for(cwIdx = 0; cwIdx < schedInfo.dlMsgPdschCfg.numCodewords; cwIdx++)
-                     {
-                        memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
-                              sizeof(SlotTimingInfo));
-                        hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo.dlMsgPdschCfg.codeword[cwIdx].tbSize;
-                        hqProcCb->numTb++;
-                     }
+                     memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+                           sizeof(SlotTimingInfo));
+                     hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+                     hqProcCb->numTb++;
                   }
-                  else
+               }
+               else
+               {
+                  /* MSG4 retransmission */
+                  if(hqProcCb->procId == schedInfo->harqProcNum)
                   {
-                     /* MSG4 retransmission */
-                     if(hqProcCb->procId == schedInfo.dlMsgInfo.harqProcNum)
-                     {
-                        memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
-                                                     sizeof(SlotTimingInfo));
-                     }
+                     memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+                           sizeof(SlotTimingInfo));
                   }
                }
-               else
+            }
+            else
+            {
+               memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+
+               if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
                {
-                  memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
-                  
-                  if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+                  /* If new data transmission is scheduled, send schedule results to RLC */
+                  if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg) 
                   {
-                     /* If new data transmission is scheduled, send schedule results to RLC */
-                     if((dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
-                           (dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH))
-                     {
-                        sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
+                     sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
 
-                        /* Add HARQ Proc to DL HARQ Proc Entity in UE */
-                        addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
-                           dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
-                     }
+                     /* Add HARQ Proc to DL HARQ Proc Entity in UE */
+                     addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+                           dlSchedInfo->dlMsgAlloc[ueIdx]);
                   }
-                  else
+               }
+               else
+               {
+                  /* For retransmission, fetch PDU to be retransmitted from DL HARQ entity and schedule on corresponding slot */
+
+                  /* As of now this loop will run only once for one TB. 
+                   * TODO : update handling of fetched TB appropriately when support for two TB is added 
+                   */
+                  for(cwIdx = 0; cwIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->numCodewords; cwIdx++)
                   {
-                     /* For retransmission, fetch PDU to be retransmitted from DL HARQ entity and schedule on corresponding slot */
-                     
-                     /* As of now this loop will run only once for one TB. 
-                      * TODO : update handling of fetched TB appropriately when support for two TB is added 
-                      */
-                     for(cwIdx = 0; \
-                           cwIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.numCodewords;\
-                           cwIdx++)
+                     /* Fetch TB to be retransmitted */
+                     txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+                     retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
+                           &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+                           dlSchedInfo->dlMsgAlloc[ueIdx]->harqProcNum, txPduLen);
+
+                     /* Store PDU in corresponding DL slot */
+                     MAC_ALLOC(txPdu, txPduLen);
+                     if(!txPdu)
                      {
-                        /* Fetch TB to be retransmitted */
-                        txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[cwIdx].tbSize;
-                        retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
-                              &macCb.macCell[cellIdx]->ueCb[ueIdx], \
-                              dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.harqProcNum, txPduLen);
-
-                        /* Store PDU in corresponding DL slot */
-                        MAC_ALLOC(txPdu, txPduLen);
-                        if(!txPdu)
-                        {
-                           DU_LOG("\nERROR  -->  MAC : Memory allocation failed in MacProcDlAlloc");
-                           return RFAILED;
-                        }   
-                        memcpy(txPdu, retxTb,  txPduLen);
-
-                        currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen = txPduLen;
-                        currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = txPdu;
-                     }
+                        DU_LOG("\nERROR  -->  MAC : Memory allocation failed in MacProcDlAlloc");
+                        return RFAILED;
+                     }   
+                     memcpy(txPdu, retxTb,  txPduLen);
+
+                     currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen = txPduLen;
+                     currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = txPdu;
                   }
                }
             }
@@ -251,7 +250,7 @@ void fillMsg4Pdu(uint16_t cellId, DlMsgSchInfo *msg4SchInfo)
    memset(&msg4DlData, 0, sizeof(MacDlData));
    memset(&macCeData, 0, sizeof(MacCeInfo));
 
-   GET_UE_ID(msg4SchInfo->dlMsgInfo.crnti, ueId);
+   GET_UE_ID(msg4SchInfo->crnti, ueId);
    ueIdx = ueId -1;
 
    if(macCb.macCell[cellIdx] == NULLP)
@@ -297,12 +296,12 @@ void fillMsg4Pdu(uint16_t cellId, DlMsgSchInfo *msg4SchInfo)
    /* storing msg4 Pdu in macDlSlot */
    if(hqProcCb->tbInfo[0].tb)
    {
-      msg4SchInfo->dlMsgInfo.dlMsgPduLen = msg4TxPduLen;
-      MAC_ALLOC(msg4SchInfo->dlMsgInfo.dlMsgPdu, msg4SchInfo->dlMsgInfo.dlMsgPduLen);
-      if(msg4SchInfo->dlMsgInfo.dlMsgPdu != NULLP)
+      msg4SchInfo->dlMsgPduLen = msg4TxPduLen;
+      MAC_ALLOC(msg4SchInfo->dlMsgPdu, msg4SchInfo->dlMsgPduLen);
+      if(msg4SchInfo->dlMsgPdu != NULLP)
       {
-         memcpy(msg4SchInfo->dlMsgInfo.dlMsgPdu, hqProcCb->tbInfo[0].tb, \
-               msg4SchInfo->dlMsgInfo.dlMsgPduLen);
+         memcpy(msg4SchInfo->dlMsgPdu, hqProcCb->tbInfo[0].tb, \
+               msg4SchInfo->dlMsgPduLen);
       }
    }
    else
@@ -327,7 +326,6 @@ void fillMsg4Pdu(uint16_t cellId, DlMsgSchInfo *msg4SchInfo)
 void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo)
 {
    uint8_t   ueIdx;
-   uint8_t   schInfoIdx;
    uint16_t  cellIdx;
    MacDlSlot *currDlSlot = NULLP;
    SlotTimingInfo muxTimingInfo;
@@ -342,14 +340,9 @@ void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo)
    {
       if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx])
       {
-         for(schInfoIdx=0; schInfoIdx<currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+         if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status)&& (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg))
          {
-            if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu) &&
-                  ((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
-                   (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH)))
-            {
-               fillMsg4Pdu(currTimingInfo.cellId, &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
-            }
+            fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]);
          }
       }
    }
index 3c8d5fe..6af8944 100644 (file)
@@ -710,13 +710,7 @@ uint8_t fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots,SchPdcchC
    pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
    /* Storing pdschCfg pointer here. Required to access pdsch config while
       fillig up pdcch pdu */
-   SCH_ALLOC(pdcch->dci.pdschCfg, sizeof(PdschCfg));
-   if(pdcch->dci.pdschCfg == NULLP)
-   {
-      DU_LOG("\nERROR  -->  SCH : Memory allocation failed in %s ", __func__);
-      return RFAILED;
-   }
-   pdsch = pdcch->dci.pdschCfg; 
+   pdsch = &pdcch->dci.pdschCfg; 
 
    /* fill the PDSCH PDU */
    uint8_t cwCount = 0;
@@ -975,7 +969,6 @@ void deleteSchCellCb(SchCellCb *cellCb)
          SCH_FREE(cellCb->cellCfg.plmnInfoList[plmnIdx].snssai, cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport*sizeof(Snssai*));
       }
    }
-   SCH_FREE(cellCb->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg, sizeof(PdschCfg));
 
    for(uint16_t idx =0; idx<MAX_SFN; idx++)
    {
@@ -1336,7 +1329,7 @@ uint8_t allocatePrbDl(SchCellCb *cell, SlotTimingInfo slotTime, \
       if(ssbOccasion && sib1Occasion)
       {
          broadcastPrbStart = cell->cellCfg.dlCfgCommon.schFreqInfoDlSib.offsetToPointA; 
-         broadcastPrbEnd = broadcastPrbStart + SCH_SSB_NUM_PRB + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+         broadcastPrbEnd = broadcastPrbStart + SCH_SSB_NUM_PRB + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
       }
       else if(ssbOccasion)
       {
@@ -1345,8 +1338,8 @@ uint8_t allocatePrbDl(SchCellCb *cell, SlotTimingInfo slotTime, \
       }
       else if(sib1Occasion)
       {
-         broadcastPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.startPrb;
-         broadcastPrbEnd = broadcastPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+         broadcastPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.startPrb;
+         broadcastPrbEnd = broadcastPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
       }
 
       /* Iterate through all free PRB blocks */
@@ -1614,7 +1607,7 @@ uint16_t searchLargestFreeBlock(SchCellCb *cell, SlotTimingInfo slotTime,uint16_
       {
          reservedPrbStart = cell->cellCfg.dlCfgCommon.schFreqInfoDlSib.offsetToPointA; 
          reservedPrbEnd = reservedPrbStart + SCH_SSB_NUM_PRB + \
-                          cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+                          cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
       }
       else if(ssbOccasion)
       {
@@ -1623,8 +1616,8 @@ uint16_t searchLargestFreeBlock(SchCellCb *cell, SlotTimingInfo slotTime,uint16_
       }
       else if(sib1Occasion)
       {
-         reservedPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.startPrb;
-         reservedPrbEnd = reservedPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+         reservedPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.startPrb;
+         reservedPrbEnd = reservedPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
       }
       else
       {
index 44149aa..17a06fd 100644 (file)
@@ -321,7 +321,7 @@ typedef struct schDlSlotInfo
    uint8_t      pdschUe;                  /*!< UE for which PDSCH is scheduled in this slot */
    RarAlloc     *rarAlloc[MAX_NUM_UE];    /*!< RAR allocation per UE*/
    DciInfo      *ulGrant;
-   DlMsgAlloc   *dlMsgAlloc[MAX_NUM_UE];  /*!< Dl msg allocation per UE*/
+   DlMsgSchInfo *dlMsgAlloc[MAX_NUM_UE];  /*!< Dl msg allocation per UE*/
 }SchDlSlotInfo;
 
 typedef struct schRaCb
@@ -710,12 +710,12 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
 uint8_t schFillRar(SchCellCb *cell, SlotTimingInfo rarTime, uint16_t ueId, RarAlloc *rarAlloc, uint8_t k0Index);
 bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchDlHqProcCb **hqP);
 uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t crnti,
-uint32_t tbSize, DlMsgAlloc *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol, uint8_t pdschNumSymbols,bool isRetx, SchDlHqProcCb* hqP);
-uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgAlloc *msg4Alloc,\
+uint32_t tbSize, DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol, uint8_t pdschNumSymbols,bool isRetx, SchDlHqProcCb* hqP);
+uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgSchInfo *msg4Alloc,\
 uint8_t pdschStartSymbol, uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP);
 uint8_t allocatePrbDl(SchCellCb *cell, SlotTimingInfo slotTime, uint8_t startSymbol, uint8_t symbolLength, \
    uint16_t *startPrb, uint16_t numPrb);
-void fillDlMsgInfo(DlMsgInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb* hqP);
+void fillDlMsgInfo(DlMsgSchInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb* hqP);
 bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool dedMsg, uint8_t *pdschStartSymbol,\
 uint8_t *pdschSymblLen, SlotTimingInfo *pdcchTime,  SlotTimingInfo *pdschTime, SlotTimingInfo *pucchTime, bool isRetx, SchDlHqProcCb *hqP);
 RaRspWindowStatus isInRaRspWindow(SchRaReq *raReq, SlotTimingInfo frameToCheck, uint16_t numSlotsPerSystemFrame);
@@ -734,7 +734,7 @@ uint8_t allocatePrbUl(SchCellCb *cell, SlotTimingInfo slotTime, uint8_t startSym
 bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchUlHqProcCb **hqP);
 
 /*Generic Functions*/
-void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc, BsrInfo *bsrInfo, uint32_t *accumalatedBOSize);
+void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgSchInfo *dlMsgAlloc, BsrInfo *bsrInfo, uint32_t *accumalatedBOSize);
 uint16_t searchLargestFreeBlock(SchCellCb *cell, SlotTimingInfo slotTime,uint16_t *startPrb, Direction dir);
 LcInfo* handleLcLList(CmLListCp *lcLL, uint8_t lcId, ActionTypeLL action);
 void prbAllocUsingRRMPolicy(CmLListCp *lcLL, bool dedicatedPRB, uint16_t mcsIdx,uint8_t numSymbols,\
index cb97e8f..75422c3 100644 (file)
@@ -138,9 +138,9 @@ uint8_t schBroadcastSib1Alloc(SchCellCb *cell, SlotTimingInfo slotTime, DlBrdcst
    }
    
    dlBrdcstAlloc->crnti = SI_RNTI;
-   dmrs = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->dmrs;
-   freqAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc;
-   timeAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschTimeAlloc;
+   dmrs = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.dmrs;
+   freqAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc;
+   timeAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschTimeAlloc;
    schDlSlotInfo = cell->schDlSlotInfo[slotTime.slot];
 
    /* Find total symbols used including DMRS */
@@ -167,8 +167,17 @@ uint8_t schBroadcastSib1Alloc(SchCellCb *cell, SlotTimingInfo slotTime, DlBrdcst
    }
 
    memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->sib1SchCfg.bwp, sizeof(BwpCfg)); 
-   memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg)); 
-   schDlSlotInfo->sib1Pres = true;
+   SCH_ALLOC(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg,sizeof(PdcchCfg));
+   if(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg)
+   {
+      memcpy(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg)); 
+      schDlSlotInfo->sib1Pres = true;
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  SCH : Memory allocation failed in %s", __func__);
+      return RFAILED;
+   }
    return ROK;
 }
 
@@ -549,14 +558,14 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
  *       Fills pdcch and pdsch info for msg4
  *
  * @params[in] SchCellCb *cell, SlotTimingInfo msg4Time
- * @params[in] uint8_t ueId, DlMsgAlloc *dlMsgAlloc
+ * @params[in] uint8_t ueId, DlMsgSchInfo *dlMsgAlloc
  * @params[in] uint8_t pdschStartSymbol, uint8_t pdschNumSymbols
  * @params[in] bool isRetx, SchDlHqProcCb *hqP
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgAlloc *dlMsgAlloc,\
+uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgSchInfo *dlMsgAlloc,\
                            uint8_t pdschStartSymbol, uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP)
 {
    uint8_t coreset0Idx = 0;
@@ -584,15 +593,21 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI
       return RFAILED;
    }
 
-   msg4Alloc = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo];
+   msg4Alloc = dlMsgAlloc;
    initialBwp   = &cell->cellCfg.dlCfgCommon.schInitialDlBwp;
-   pdcch = &msg4Alloc->dlMsgPdcchCfg;
-   pdsch = &msg4Alloc->dlMsgPdschCfg;
+   SCH_ALLOC(msg4Alloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+
+   if(!msg4Alloc->dlMsgPdcchCfg)
+   {
+      DU_LOG("\nERROR  --> SCH : Memory allocation failed in %s",__func__);
+      return RFAILED;
+   }
+   pdcch = msg4Alloc->dlMsgPdcchCfg;
    bwp = &msg4Alloc->bwp;
    coreset0Idx  = initialBwp->pdcchCommon.commonSearchSpace.coresetId;
 
-   fillDlMsgInfo(&msg4Alloc->dlMsgInfo, cell->raCb[ueId-1].tcrnti, isRetx, hqP);
-   msg4Alloc->dlMsgInfo.dlMsgPduLen = cell->raCb[ueId-1].dlMsgPduLen;
+   fillDlMsgInfo(msg4Alloc, cell->raCb[ueId-1].tcrnti, isRetx, hqP);
+   msg4Alloc->dlMsgPduLen = cell->raCb[ueId-1].dlMsgPduLen;
 
    /* derive the sib1 coreset0 params from table 13-1 spec 38.213 */
    numRbs     = coresetIdxTable[coreset0Idx][1];
@@ -640,8 +655,8 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI
    pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
    pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
    pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
-   pdcch->dci.pdschCfg = pdsch;
-
+   pdsch = &pdcch->dci.pdschCfg; 
+   
    /* fill the PDSCH PDU */
    uint8_t cwCount = 0;
    pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
@@ -656,7 +671,7 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI
       pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
       if(isRetx != TRUE)
       {
-         tbSize = schCalcTbSize(msg4Alloc->dlMsgInfo.dlMsgPduLen + TX_PAYLOAD_HDR_LEN); /* MSG4 size + FAPI header size*/
+         tbSize = schCalcTbSize(msg4Alloc->dlMsgPduLen + TX_PAYLOAD_HDR_LEN); /* MSG4 size + FAPI header size*/
          hqP->tbInfo[cwCount].tbSzReq = tbSize;
          pdsch->codeword[cwCount].rvIndex = 0;
       }
@@ -710,6 +725,7 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI
       &pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
    {
       DU_LOG("\nERROR  --> SCH : Resource allocation failed for MSG4");
+      SCH_FREE(msg4Alloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
       return RFAILED;
    }
 
@@ -721,7 +737,6 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI
    pdsch->txPdschPower.powerControlOffset = 0;
    pdsch->txPdschPower.powerControlOffsetSS = 0;
 
-   msg4Alloc->dlMsgInfo.isMsg4Pdu = true;
    return ROK;
 }
  
@@ -777,7 +792,7 @@ uint16_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, uint16
  *
  * @params[in] SchCellCb *cell, SlotTimingInfo slotTime
  * @params[in] uint16_t crnti, uint32_t tbSize
- * @params[in] DlMsgAlloc *dlMsgAlloc, uint16_t startPRB
+ * @params[in] DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB
  * @params[in] uint8_t pdschStartSymbol, uint8_t pdschNumSymbols
  * @params[in] bool isRetx, SchDlHqProcCb *hqP
  * @return ROK     - success
@@ -785,10 +800,11 @@ uint16_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, uint16
  *
  * ****************************************************************/
 uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t crnti,
-                uint32_t tbSize, DlMsgAlloc *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol,
+                uint32_t tbSize, DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol,
                 uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP)
 {
    uint8_t ueId=0;
+   uint8_t cwCount = 0;
    PdcchCfg *pdcch = NULLP;
    PdschCfg *pdsch = NULLP;
    BwpCfg *bwp = NULLP;
@@ -797,9 +813,14 @@ uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t c
    SchPdschConfig pdschCfg;
    uint8_t dmrsStartSymbol, startSymbol, numSymbol;
 
-   pdcch = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdcchCfg;
-   pdsch = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdschCfg;
-   bwp = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].bwp;
+   SCH_ALLOC(dlMsgAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+   if(!dlMsgAlloc->dlMsgPdcchCfg)
+   {
+      DU_LOG("\nERROR  -->  SCH : Memory allocation failed in schDlRsrcAllocDlMsg");
+      return RFAILED;
+   }
+   pdcch = dlMsgAlloc->dlMsgPdcchCfg;
+   bwp = &dlMsgAlloc->bwp;
 
    GET_UE_ID(crnti, ueId);
    ueCb  = cell->ueCb[ueId-1];
@@ -839,8 +860,7 @@ uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t c
    pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
    pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
 
-   /* fill the PDSCH PDU */
-   uint8_t cwCount = 0;
+   pdsch = &pdcch->dci.pdschCfg;
    pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
    pdsch->rnti = ueCb.crnti;
    pdsch->pduIndex = 0;
@@ -903,6 +923,7 @@ uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t c
       &pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
    {
       DU_LOG("\nERROR  --> SCH : allocatePrbDl() failed for DL MSG");
+      SCH_FREE(dlMsgAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
       return RFAILED;
    }
 
@@ -914,7 +935,6 @@ uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t c
    pdsch->txPdschPower.powerControlOffset = 0;
    pdsch->txPdschPower.powerControlOffsetSS = 0;
 
-   pdcch->dci.pdschCfg = pdsch;
    return ROK;
 }
 
@@ -1599,12 +1619,11 @@ void prbAllocUsingRRMPolicy(CmLListCp *lcLL, bool isDedicatedPRB, uint16_t mcsId
  * @return void
  *
  * *******************************************************************************************/
-void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc,\
+void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgSchInfo *dlMsgAlloc,\
                                 BsrInfo *bsrInfo, uint32_t *accumalatedBOSize)
 {
    CmLList *node = NULLP, *next = NULLP;
    LcInfo *lcNode = NULLP;
-   DlMsgSchInfo *dlMsgSchInfo = NULLP;
 
    if(lcLL == NULLP)
    {
@@ -1633,20 +1652,20 @@ void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc,\
                lcNode->lcId, lcNode->reqBO, lcNode->allocBO, lcNode->allocPRB);
          if(dlMsgAlloc != NULLP)
          {
-            dlMsgSchInfo = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo];
 
             /*Add this LC to dlMsgAlloc so that if this LC gets allocated, BO
              * report for allocation can be sent to MAC*/
-            dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].lcId = lcNode->lcId;
-            dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].schBytes = lcNode->allocBO;
+            dlMsgAlloc->numOfTbs = 1;
+            dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].lcId = lcNode->lcId;
+            dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].schBytes = lcNode->allocBO;
 
             /*Calculate the Total Payload/BO size allocated*/
-            *accumalatedBOSize += dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].schBytes; 
+            *accumalatedBOSize += dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].schBytes; 
 
             DU_LOG("\nINFO   --> SCH: Added in MAC BO report: LCID:%d,reqBO:%d,Idx:%d, TotalBO Size:%d",\
-                  lcNode->lcId,lcNode->reqBO, dlMsgSchInfo->numLc, *accumalatedBOSize);
+                  lcNode->lcId,lcNode->reqBO, dlMsgAlloc->transportBlock[0].numLc, *accumalatedBOSize);
 
-            dlMsgSchInfo->numLc++;
+            dlMsgAlloc->transportBlock[0].numLc++;
             handleLcLList(lcLL, lcNode->lcId, DELETE);
          }
          else if(bsrInfo != NULLP)
@@ -1677,7 +1696,7 @@ void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc,\
 * @return void
 *
 *******************************************************************/
-void fillDlMsgInfo(DlMsgInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb *hqP)
+void fillDlMsgInfo(DlMsgSchInfo *dlMsgSchInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb *hqP)
 {
    hqP->tbInfo[0].isEnabled = TRUE;
    hqP->tbInfo[0].state = HQ_TB_WAITING;
@@ -1685,14 +1704,14 @@ void fillDlMsgInfo(DlMsgInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProc
    hqP->tbInfo[1].isEnabled = TRUE;
    hqP->tbInfo[1].state = HQ_TB_WAITING;
    hqP->tbInfo[1].txCntr++;
-   dlMsgInfo->crnti = crnti;
-   dlMsgInfo->ndi = hqP->tbInfo[0].ndi; /*How to handle two tb case?TBD*/
-   dlMsgInfo->harqProcNum = hqP->procId;
-   dlMsgInfo->dlAssignIdx = 0;
-   dlMsgInfo->pucchTpc = 0;
-   dlMsgInfo->pucchResInd = 0;
-   dlMsgInfo->harqFeedbackInd = hqP->k1;
-   dlMsgInfo->dciFormatId = 1;
+   dlMsgSchInfo->crnti = crnti;
+   dlMsgSchInfo->transportBlock[0].ndi = hqP->tbInfo[0].ndi; /*How to handle two tb case?TBD*/
+   dlMsgSchInfo->harqProcNum = hqP->procId;
+   dlMsgSchInfo->dlAssignIdx = 0;
+   dlMsgSchInfo->pucchTpc = 0;
+   dlMsgSchInfo->pucchResInd = 0;
+   dlMsgSchInfo->harqFeedbackInd = hqP->k1;
+   dlMsgSchInfo->dciFormatId = 1;
 }
 
 /*******************************************************************
@@ -1720,12 +1739,12 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
 {
    uint8_t pdschStartSymbol = 0, pdschNumSymbols = 0;
    SlotTimingInfo pdcchTime, pdschTime, pucchTime;
-   DlMsgAlloc *dciSlotAlloc = NULLP;    /* Stores info for transmission of PDCCH for Msg4 */
-   DlMsgAlloc  *msg4SlotAlloc = NULLP;   /* Stores info for transmission of PDSCH for Msg4 */
+   DlMsgSchInfo *dciSlotAlloc = NULLP;    /* Stores info for transmission of PDCCH for Msg4 */
+   DlMsgSchInfo *msg4SlotAlloc = NULLP;   /* Stores info for transmission of PDSCH for Msg4 */
 
    if(cell == NULL)
    {
-      DU_LOG("\nERROR  -->  SCH: schDlRsrcAllocMsg4() : Cell is NULL");
+      DU_LOG("\nERROR  -->  SCH: schProcessMsg4Req() : Cell is NULL");
       return RFAILED;
    }
 
@@ -1733,7 +1752,7 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
    {
       if (RFAILED == schDlGetAvlHqProcess(cell, &cell->ueCb[ueId - 1], msg4HqProc))
       {
-         DU_LOG("\nERROR  -->  SCH: schDlRsrcAllocMsg4() : No process");
+         DU_LOG("\nERROR  -->  SCH: schProcessMsg4Req() : No process");
          return RFAILED;
       }
    }
@@ -1741,21 +1760,20 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
    if(findValidK0K1Value(cell, currTime, ueId, false, &pdschStartSymbol, &pdschNumSymbols, &pdcchTime, &pdschTime,\
             &pucchTime, isRetxMsg4, *msg4HqProc) != true )
    {
-      DU_LOG("\nERROR  -->  SCH: schDlRsrcAllocMsg4() : k0 k1 not found");
+      DU_LOG("\nERROR  -->  SCH: schProcessMsg4Req() : k0 k1 not found");
       return RFAILED;
    }
 
    if(cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] == NULL)
    {
-      SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgAlloc));
+      SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgSchInfo));
       if(dciSlotAlloc == NULLP)
       {
          DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciSlotAlloc");
          return RFAILED;
       }
       cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = dciSlotAlloc;
-      memset(dciSlotAlloc, 0, sizeof(DlMsgAlloc));
-      GET_CRNTI(dciSlotAlloc->crnti, ueId);
+      memset(dciSlotAlloc, 0, sizeof(DlMsgSchInfo));
    }
    else
       dciSlotAlloc = cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1];
@@ -1764,13 +1782,11 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
    if((schDlRsrcAllocMsg4(cell, pdschTime, ueId, dciSlotAlloc, pdschStartSymbol, pdschNumSymbols, isRetxMsg4, *msg4HqProc)) != ROK)
    {
       DU_LOG("\nERROR  -->  SCH: Scheduling of Msg4 failed in slot [%d]", pdschTime.slot);
-      if(dciSlotAlloc->numSchedInfo == 0)
+      if(!dciSlotAlloc->dlMsgPdschCfg)
       {
-         SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+         SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
          cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
       }
-      else
-         memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
       return RFAILED;
    }
 
@@ -1779,47 +1795,62 @@ uint8_t schProcessMsg4Req(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
     */
    if(pdcchTime.slot == pdschTime.slot)
    {
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = BOTH;
-      dciSlotAlloc->numSchedInfo++;
+      SCH_ALLOC(dciSlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+      if(!dciSlotAlloc->dlMsgPdschCfg)
+      {
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciSlotAlloc->dlMsgPdschCfg");
+         SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+         SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+         cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+         return RFAILED;
+      }
+      memcpy(dciSlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
    }
    else
    {
       /* Allocate memory to schedule rarSlot to send RAR, pointer will be checked at schProcessSlotInd() */
       if(cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] == NULL)
       {
-         SCH_ALLOC(msg4SlotAlloc, sizeof(DlMsgAlloc));
+         SCH_ALLOC(msg4SlotAlloc, sizeof(DlMsgSchInfo));
          if(msg4SlotAlloc == NULLP)
          {
             DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for msg4SlotAlloc");
-            if(dciSlotAlloc->numSchedInfo == 0)
+            SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+            if(!dciSlotAlloc->dlMsgPdschCfg)
             {
-               SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+               SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
                cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
             }
-            else
-               memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
             return RFAILED;
          }
          cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = msg4SlotAlloc;
-         memset(msg4SlotAlloc, 0, sizeof(DlMsgAlloc));
-         msg4SlotAlloc->crnti = dciSlotAlloc->crnti;
+         memset(msg4SlotAlloc, 0, sizeof(DlMsgSchInfo));
       }
       else
          msg4SlotAlloc = cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1];
 
-      /* Copy all RAR info */
-      memcpy(&msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo], \
-         &dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], sizeof(DlMsgSchInfo));
-      msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].dlMsgPdcchCfg.dci.pdschCfg = \
-         &msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].dlMsgPdschCfg;
-
-      /* Assign correct PDU types in corresponding slots */
-      msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].pduPres = PDSCH_PDU;
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = PDCCH_PDU;
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pdschSlot = pdschTime.slot;
+      /* Copy all msg4 pdschcfg info */
+      msg4SlotAlloc->crnti =dciSlotAlloc->crnti;
+      msg4SlotAlloc->bwp = dciSlotAlloc->bwp;
+      SCH_ALLOC(msg4SlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+      if(msg4SlotAlloc->dlMsgPdschCfg)
+      {
+         memcpy(msg4SlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+      }
+      else
+      {
+         SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));    
+         if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
+         {
+            SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+            cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
 
-      dciSlotAlloc->numSchedInfo++;
-      msg4SlotAlloc->numSchedInfo++;
+         }
+         SCH_FREE(msg4SlotAlloc, sizeof(DlMsgSchInfo));
+         cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for msg4SlotAlloc->dlMsgPdschCfg");
+         return RFAILED;
+      }
    }
 
    /* PUCCH resource */
index 259158e..f8b73fa 100644 (file)
@@ -986,7 +986,7 @@ uint32_t schFcfsScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdschTime,
    uint32_t accumalatedSize = 0;
    CmLListCp *lcLL = NULLP;
    uint16_t rsvdDedicatedPRB = 0;
-   DlMsgAlloc *dciSlotAlloc;
+   DlMsgSchInfo *dciSlotAlloc;
 
    /* TX_PAYLOAD_HDR_LEN: Overhead which is to be Added once for any UE while estimating Accumulated TB Size
     * Following flag added to keep the record whether TX_PAYLOAD_HDR_LEN is added to the first Node getting allocated.
@@ -1002,7 +1002,7 @@ uint32_t schFcfsScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdschTime,
    {
       /*Re-Initalization per UE*/
       /* scheduled LC data fill */
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].numLc = 0;
+      dciSlotAlloc->transportBlock[0].numLc = 0;
       isTxPayloadLenAdded = FALSE; /*Re-initlaize the flag for every UE*/
       accumalatedSize = 0;
 
@@ -1028,17 +1028,14 @@ uint32_t schFcfsScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdschTime,
             {
                DU_LOG("\nERROR  --> SCH : Updation in LC List Failed");
                /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
-               if(dciSlotAlloc->numSchedInfo == 0)
+               if(!dciSlotAlloc->dlMsgPdschCfg)
                {
-                  SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+                  SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
                   (*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
                }
-               else
-                  memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-               return false;
+               return accumalatedSize;
             }
          }
-         ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
       }//End of for loop
 
       if ((fcfsHqProcCb->lcCb.defLcList.count == 0) && (fcfsHqProcCb->lcCb.dedLcList.count == 0))
@@ -1047,16 +1044,13 @@ uint32_t schFcfsScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdschTime,
          UNSET_ONE_BIT((*hqP)->hqEnt->ue->ueId, (*hqP)->hqEnt->cell->boIndBitMap);
 
          /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
-         if(dciSlotAlloc->numSchedInfo == 0)
+         if(!dciSlotAlloc->dlMsgPdschCfg)
          {
-            SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+            SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
             (*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
          }
-         else
-            memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-
          /*TRUE because this UE has nothing to be scheduled*/
-         return true;
+         return accumalatedSize;
       }
    }
 
index 461d766..46b8fba 100644 (file)
@@ -683,13 +683,16 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
       if((schFillRar(cell, rarTime, ueId, dciSlotAlloc, k0Index)) != ROK)
       {
          DU_LOG("\nERROR  -->  SCH: Scheduling of RAR failed in slot [%d]", rarSlot);
-         SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
-         cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+         if(!dciSlotAlloc->rarPdschCfg)
+         {
+            SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+            cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+         }
          return false;
       }
 
       /* Fill RAR info */
-      dciSlotAlloc->rarInfo.raRnti = cell->raReq[ueId-1]->raRnti;
+      dciSlotAlloc->raRnti = cell->raReq[ueId-1]->raRnti;
       dciSlotAlloc->rarInfo.tcrnti = cell->raReq[ueId-1]->rachInd->crnti;
       dciSlotAlloc->rarInfo.RAPID = cell->raReq[ueId-1]->rachInd->preambleIdx;
       dciSlotAlloc->rarInfo.ta = cell->raReq[ueId-1]->rachInd->timingAdv;
@@ -723,7 +726,22 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
        * If not, allocate memory RAR PDSCH slot to store RAR info
        */
       if(dciSlot == rarSlot)
-         dciSlotAlloc->pduPres = BOTH;
+      {
+         SCH_ALLOC(dciSlotAlloc->rarPdschCfg, sizeof(PdschCfg));
+         if(dciSlotAlloc->rarPdschCfg)
+         {
+             memcpy(dciSlotAlloc->rarPdschCfg, &dciSlotAlloc->rarPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+         }
+         else
+         {
+            SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+            SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+            cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+            DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciSlotAlloc->rarPdschCfg");
+            return false;
+         }
+
+      }
       else
       {
          /* Allocate memory to schedule rarSlot to send RAR, pointer will be checked at schProcessSlotInd() */
@@ -731,20 +749,37 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
          if(rarSlotAlloc == NULLP)
          {
             DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for rarSlotAlloc");
-            SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
-            cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+            SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+            if(!dciSlotAlloc->rarPdschCfg)
+            {
+               SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+               cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+            }
             return false;
          }
          cell->schDlSlotInfo[rarSlot]->rarAlloc[ueId-1] = rarSlotAlloc;
 
          /* Copy all RAR info */
-         memcpy(rarSlotAlloc, dciSlotAlloc, sizeof(RarAlloc));
-         rarSlotAlloc->rarPdcchCfg.dci.pdschCfg = &rarSlotAlloc->rarPdschCfg;
-
-         /* Assign correct PDU types in corresponding slots */
-         rarSlotAlloc->pduPres = PDSCH_PDU;
-         dciSlotAlloc->pduPres = PDCCH_PDU;
-         dciSlotAlloc->pdschSlot = rarSlot;  
+         rarSlotAlloc->raRnti = dciSlotAlloc->raRnti;
+         rarSlotAlloc->bwp = dciSlotAlloc->bwp;
+         SCH_ALLOC(rarSlotAlloc->rarPdschCfg, sizeof(PdschCfg));
+         if(rarSlotAlloc->rarPdschCfg)
+         {
+            memcpy(rarSlotAlloc->rarPdschCfg, &dciSlotAlloc->rarPdcchCfg->dci.pdschCfg,sizeof(PdschCfg));
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for rarSlotAlloc->rarPdschCfg");
+            SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+            if(!dciSlotAlloc->rarPdschCfg)
+            {
+               SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+               cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+            }
+            SCH_FREE(rarSlotAlloc, sizeof(RarAlloc));
+            cell->schDlSlotInfo[rarSlot]->rarAlloc[ueId-1] = NULLP;
+            return false;
+         }
       }
 
       cell->schDlSlotInfo[dciSlot]->pdcchUe = ueId;
@@ -861,10 +896,16 @@ uint8_t schFillRar(SchCellCb *cell, SlotTimingInfo rarTime, uint16_t ueId, RarAl
    uint8_t  dmrsStartSymbol, startSymbol, numSymbol ;
    uint16_t numRbs = 0;
    uint16_t tbSize = 0;
+   PdschCfg *pdsch;
 
    SchBwpDlCfg *initialBwp = &cell->cellCfg.dlCfgCommon.schInitialDlBwp;
-   PdcchCfg *pdcch = &rarAlloc->rarPdcchCfg;
-   PdschCfg *pdsch = &rarAlloc->rarPdschCfg;
+   SCH_ALLOC(rarAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+   if(rarAlloc->rarPdcchCfg == NULLP)
+   {
+      DU_LOG("\nERROR  --> SCH : Memory allocation failed in %s",__func__);
+      return RFAILED;
+   }
+   PdcchCfg *pdcch = rarAlloc->rarPdcchCfg;
    BwpCfg *bwp = &rarAlloc->bwp;
 
    /* derive the sib1 coreset0 params from table 13-1 spec 38.213 */
@@ -915,8 +956,8 @@ uint8_t schFillRar(SchCellCb *cell, SlotTimingInfo rarTime, uint16_t ueId, RarAl
    pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
    pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
    pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
-   pdcch->dci.pdschCfg = pdsch;
 
+   pdsch = &pdcch->dci.pdschCfg;
    /* fill the PDSCH PDU */
    uint8_t cwCount = 0;
    pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
@@ -979,6 +1020,7 @@ uint8_t schFillRar(SchCellCb *cell, SlotTimingInfo rarTime, uint16_t ueId, RarAl
       &pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
    {
       DU_LOG("\nERROR  --> SCH : allocatePrbDl() failed for RAR");
+      SCH_FREE(rarAlloc->rarPdcchCfg, sizeof(PdcchCfg));
       return RFAILED;
    }
 
index 80f4af0..656e66a 100644 (file)
@@ -985,7 +985,7 @@ uint32_t schSliceBasedScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdsc
    uint32_t accumalatedSize = 0;
    CmLListCp *lcLL = NULLP;
    uint16_t rsvdDedicatedPRB = 0;
-   DlMsgAlloc *dciSlotAlloc;
+   DlMsgSchInfo *dciSlotAlloc;
 
    /* TX_PAYLOAD_HDR_LEN: Overhead which is to be Added once for any UE while estimating Accumulated TB Size
     * Following flag added to keep the record whether TX_PAYLOAD_HDR_LEN is added to the first Node getting allocated.
@@ -1001,7 +1001,7 @@ uint32_t schSliceBasedScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdsc
    {
       /*Re-Initalization per UE*/
       /* scheduled LC data fill */
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].numLc = 0;
+      dciSlotAlloc->transportBlock[0].numLc = 0;
       isTxPayloadLenAdded = FALSE; /*Re-initlaize the flag for every UE*/
       accumalatedSize = 0;
 
@@ -1027,17 +1027,14 @@ uint32_t schSliceBasedScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdsc
             {
                DU_LOG("\nERROR  --> SCH : Updation in LC List Failed");
                /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
-               if(dciSlotAlloc->numSchedInfo == 0)
+               if(!dciSlotAlloc->dlMsgPdschCfg)
                {
-                  SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+                  SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
                   (*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
                }
-               else
-                  memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-               return false;
+               return accumalatedSize;
             }
          }
-         ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
       }//End of for loop
 
       if ((schSpcHqProcCb->lcCb.defLcList.count == 0) && (schSpcHqProcCb->lcCb.dedLcList.count == 0))
@@ -1046,16 +1043,13 @@ uint32_t schSliceBasedScheduleDlLc(SlotTimingInfo pdcchTime, SlotTimingInfo pdsc
          UNSET_ONE_BIT((*hqP)->hqEnt->ue->ueId, (*hqP)->hqEnt->cell->boIndBitMap);
 
          /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
-         if(dciSlotAlloc->numSchedInfo == 0)
+         if(!dciSlotAlloc->dlMsgPdschCfg)
          {
-            SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+            SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
             (*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
          }
-         else
-            memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-
          /*TRUE because this UE has nothing to be scheduled*/
-         return true;
+         return accumalatedSize;
       }
    }
 
index 861d14a..02f9ca4 100644 (file)
@@ -96,7 +96,7 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
    uint16_t crnti = 0;
    uint32_t accumalatedSize = 0;
    SchUeCb *ueCb = NULLP;
-   DlMsgAlloc *dciSlotAlloc, *dlMsgAlloc;
+   DlMsgSchInfo *dciSlotAlloc, *dlMsgAlloc;
    SlotTimingInfo pdcchTime, pdschTime, pucchTime;
 
    GET_CRNTI(crnti,ueId);
@@ -122,23 +122,22 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
    if(cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] == NULL)
    {
 
-      SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgAlloc));
+      SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgSchInfo));
       if(!dciSlotAlloc)
       {
          DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for ded DL msg alloc");
          return false;
       }
       cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = dciSlotAlloc;
-      memset(dciSlotAlloc, 0, sizeof(DlMsgAlloc));
-      dciSlotAlloc->crnti = crnti;
+      memset(dciSlotAlloc, 0, sizeof(DlMsgSchInfo));
    }
    else
    {
       dciSlotAlloc = cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1];
    }
    /* Dl ded Msg info is copied, this was earlier filled in macSchDlRlcBoInfo */
-   fillDlMsgInfo(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].dlMsgInfo, dciSlotAlloc->crnti, isRetx, *hqP);
-   dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].isRetx = isRetx;
+   fillDlMsgInfo(dciSlotAlloc, crnti, isRetx, *hqP);
+   dciSlotAlloc->transportBlock[0].ndi = isRetx;
 
    accumalatedSize = cell->api->SchScheduleDlLc(pdcchTime, pdschTime, pdschNumSymbols, isRetx, hqP);
 
@@ -152,15 +151,11 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
       DU_LOG("\nERROR  --> SCH : Scheduling of DL dedicated message failed");
 
       /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
-      if(dciSlotAlloc->numSchedInfo == 0)
+      if(!dciSlotAlloc->dlMsgPdschCfg)
       {
-         SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+         SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
          cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = NULL;
       }
-      else
-      {
-         memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-      }
       return false;
    }
 
@@ -181,47 +176,62 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
 
    if(pdcchTime.slot == pdschTime.slot)
    {
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = BOTH;
-      dciSlotAlloc->numSchedInfo++;
+      SCH_ALLOC(dciSlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+      if(!dciSlotAlloc->dlMsgPdschCfg)
+      {
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dciSlotAlloc->dlMsgPdschCfg");
+         SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+         SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+         cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+         return false;
+      }
+      memcpy(dciSlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg,  sizeof(PdschCfg));
    }
    else
    {
       /* Allocate memory to schedule dlMsgAlloc to send DL_Msg, pointer will be checked at schProcessSlotInd() */
       if(cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] == NULLP)
       {
-         SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgAlloc));
+         SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgSchInfo));
          if(dlMsgAlloc == NULLP)
          {
             DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dlMsgAlloc");
-            if(dciSlotAlloc->numSchedInfo == 0)
+            SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+            if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
             {
-               SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+               SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
                cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
             }
-            else
-               memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
             return false;
          }
          cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = dlMsgAlloc;
-         memset(dlMsgAlloc, 0, sizeof(DlMsgAlloc));
-         dlMsgAlloc->crnti = dciSlotAlloc->crnti;
+         memset(dlMsgAlloc, 0, sizeof(DlMsgSchInfo));
       }
       else
          dlMsgAlloc = cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1];
 
       /* Copy all DL_MSG info */
-      memcpy(&dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo], \
-            &dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], sizeof(DlMsgSchInfo));
-      dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdcchCfg.dci.pdschCfg = \
-            &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdschCfg;
-
-      /* Assign correct PDU types in corresponding slots */
-      dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].pduPres = PDSCH_PDU;
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = PDCCH_PDU;
-      dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pdschSlot = pdschTime.slot;
-
-      dciSlotAlloc->numSchedInfo++;
-      dlMsgAlloc->numSchedInfo++;
+      dlMsgAlloc->crnti =crnti;
+      dlMsgAlloc->bwp = dciSlotAlloc->bwp;
+      SCH_ALLOC(dlMsgAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+      if(dlMsgAlloc->dlMsgPdschCfg)
+      {
+         memcpy(dlMsgAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+      }
+      else
+      {
+         SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));    
+         if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
+         {
+            SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+            cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+
+         }
+         SCH_FREE(dlMsgAlloc, sizeof(DlMsgSchInfo));
+         cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+         DU_LOG("\nERROR  -->  SCH : Memory Allocation failed for dlMsgAlloc->dlMsgPdschCfg");
+         return false;
+      }
    }
 
    schAllocPucchResource(cell, pucchTime, crnti, ueCb, isRetx, *hqP);
@@ -488,6 +498,9 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
          {
             ADD_DELTA_TO_TIME((*pucchTime), hqP->pucchTime, 0, cell->numSlots);
          }
+         pdcchTime->cellId = cell->cellId;
+         pdschTime->cellId = cell->cellId;
+
          return true;
       }
    }
index e15981b..51534f9 100644 (file)
@@ -1027,7 +1027,7 @@ uint8_t schFillUlDciForMsg3Retx(SchRaCb *raCb, SchPuschInfo *puschInfo, DciInfo
    dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0]   = 0;
    dciInfo->dciInfo.txPdcchPower.beta_pdcch_1_0       = 0;
    dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
-   dciInfo->dciInfo.pdschCfg                          = NULL; /* No DL data being sent */
+   memset(&dciInfo->dciInfo.pdschCfg, 0, sizeof(PdschCfg));
    msg3HqProc->tbInfo.txCntr++;
 
   puschInfo->harqProcId                       = msg3HqProc->procId;
@@ -1135,7 +1135,7 @@ uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo *puschInfo, DciInfo *dciInfo, b
    dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0]   = 0;
    dciInfo->dciInfo.txPdcchPower.beta_pdcch_1_0       = 0;
    dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
-   dciInfo->dciInfo.pdschCfg                          = NULL; /* No DL data being sent */
+   memset(&dciInfo->dciInfo.pdschCfg, 0, sizeof(PdschCfg));
 
    return ROK;
 }
index d77ec86..32dc7dd 100644 (file)
@@ -893,8 +893,11 @@ CmLList* isPrbAvailable(CmLListCp *freePrbBlockList, uint16_t startPrb, uint16_t
 
       /* Check if requested number of blocks can be allocated from the current block */
       if(freeBlock->numFreePrb < numPrb)
+      {
+         DU_LOG("\nINFO   --> SCH: In isPrbAvailable, numFreePrb:%d is less than reqPrb:%d", freeBlock->numFreePrb, numPrb);
+         node = node->next;
          continue;
-
+      }
       /* Check if requested PRBs belong within the range of current free block */
       if(((startPrb >= freeBlock->startPrb) && (startPrb <= freeBlock->endPrb)) && \
          ((endPrb >= freeBlock->startPrb) && (endPrb <= freeBlock->endPrb)))
index 2c7d5ce..e3efb1c 100644 (file)
@@ -584,7 +584,7 @@ typedef struct dlDCI
    uint8_t aggregLevel;
    BeamformingInfo beamPdcchInfo;
    TxPowerPdcchInfo txPdcchPower;
-   PdschCfg     *pdschCfg;
+   PdschCfg     pdschCfg;
 }DlDCI;
 
 typedef struct pdcchCfg
@@ -913,7 +913,7 @@ typedef struct ssbInfo
 typedef struct sib1AllocInfo
 {
    BwpCfg bwp;
-   PdcchCfg sib1PdcchCfg;
+   PdcchCfg *sib1PdcchCfg;
 }Sib1AllocInfo;
 
 typedef struct prachSchInfo
@@ -958,7 +958,6 @@ typedef struct msg3UlGrant
 
 typedef struct rarInfo
 {
-   uint16_t        raRnti;
    uint8_t         RAPID;
    uint16_t        ta;
    Msg3UlGrant     ulGrant;
@@ -969,54 +968,67 @@ typedef struct rarInfo
 
 typedef struct rarAlloc
 {
-   DlPduType  pduPres;
-   uint8_t    pdschSlot;
-   RarInfo rarInfo;
-   BwpCfg  bwp;
-   PdcchCfg rarPdcchCfg;
-   PdschCfg rarPdschCfg;
+   uint16_t   raRnti;
+   RarInfo    rarInfo;
+   BwpCfg     bwp;
+   PdcchCfg   *rarPdcchCfg;
+   PdschCfg   *rarPdschCfg;
 }RarAlloc;
 
-typedef struct dlMsgInfo
-{
-   uint16_t crnti;
-   uint8_t  ndi;
-   uint8_t  harqProcNum;
-   uint8_t  dlAssignIdx;
-   uint8_t  pucchTpc;
-   uint8_t  pucchResInd;
-   uint8_t  harqFeedbackInd;
-   uint8_t  dciFormatId;
-   bool     isMsg4Pdu;
-   uint16_t  dlMsgPduLen;
-   uint8_t  *dlMsgPdu;
-}DlMsgInfo;
-
 typedef struct lcSchInfo
 {
    uint8_t   lcId;
-   uint32_t  schBytes; /* Number of scheduled bytes */
+   uint32_t  schBytes; 
 }LcSchInfo;
 
-typedef struct dlMsgSchedInfo
+typedef struct ceSchInfo
+{
+   uint8_t   ceLcId;
+   uint8_t   *ceContent; 
+}CeSchInfo;
+
+typedef struct freqDomainAlloc
+{
+   uint8_t          resAllocType; /* Resource allocation type */
+   union
+   {
+      ResAllocType0    type0;
+      ResAllocType1    type1;
+   }resAlloc;
+}FreqDomainAlloc;
+
+typedef struct transportBlock
 {
-   bool       isRetx;
+   uint8_t    mcs;       
+   bool       ndi;       
+   uint8_t    rv;        
+   uint16_t   tbSize;    
+   uint8_t    numCe;
+   CeSchInfo  ceSchInfo[MAX_NUM_LC]; 
    uint8_t    numLc;
-   LcSchInfo  lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
-   BwpCfg     bwp;
-   PdcchCfg   dlMsgPdcchCfg;
-   PdschCfg   dlMsgPdschCfg;
-   DlPduType  pduPres;
-   uint8_t    pdschSlot;
-   DlMsgInfo  dlMsgInfo;
-}DlMsgSchInfo;
+   LcSchInfo  lcSchInfo[MAX_NUM_LC]; 
+}TransportBlock;
 
-typedef struct dlMsgAlloc
+typedef struct dlMsgSchedInfo
 {
-   uint16_t     crnti;
-   uint8_t      numSchedInfo;
-   DlMsgSchInfo dlMsgSchedInfo[2];
-}DlMsgAlloc;
+   uint16_t        crnti;
+   uint8_t         dciFormatId;
+   uint8_t         harqProcNum;
+   bool            vrbPrbMapping;
+   uint8_t         dlAssignIdx;
+   uint8_t         pucchTpc;
+   uint8_t         pucchResInd;
+   uint8_t         harqFeedbackInd;
+   uint16_t        dlMsgPduLen;
+   uint8_t         *dlMsgPdu;
+   FreqDomainAlloc freqAlloc;
+   TimeDomainAlloc timeAlloc;
+   uint8_t         numOfTbs;
+   TransportBlock  transportBlock[2];
+   BwpCfg          bwp;
+   PdcchCfg        *dlMsgPdcchCfg;
+   PdschCfg        *dlMsgPdschCfg;
+}DlMsgSchInfo;
 
 typedef struct schSlotValue
 {
@@ -1027,15 +1039,6 @@ typedef struct schSlotValue
    SlotTimingInfo ulDciTime;
 }SchSlotValue;
 
-typedef struct freqDomainAlloc
-{
-   uint8_t          resAllocType; /* Resource allocation type */
-   union
-   {
-      ResAllocType0    type0;
-      ResAllocType1    type1;
-   }resAlloc;
-}FreqDomainAlloc;
 
 /* Reference -> O-RAN.WG8.AAD.0-v07.00, Table 9-36 DCI Format0_0 Configuration */
 typedef struct format0_0
@@ -1121,7 +1124,7 @@ typedef struct dlSchedInfo
    DciInfo    *ulGrant;
 
    /* Allocation from dedicated DL msg */
-   DlMsgAlloc *dlMsgAlloc[MAX_NUM_UE];
+   DlMsgSchInfo *dlMsgAlloc[MAX_NUM_UE];
 
 }DlSchedInfo;
 
index 8d076f7..fd2902c 100644 (file)
@@ -548,7 +548,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for DU APP failed");
       return RFAILED;
    }
-   //ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
+   ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
 
    /* system task for EGTP */
    if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
@@ -556,7 +556,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for EGTP failed");
       return RFAILED;
    }
-   //ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
+   ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
 
    /* system task for RLC_DL and MAC */
    if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
@@ -566,7 +566,7 @@ uint8_t commonInit()
    }
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-   //ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
+   ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
 
    /* system task for RLC UL */
    if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
@@ -574,7 +574,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for RLC UL failed");
       return RFAILED;
    }
-   //ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
+   ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
 
    /* system task for SCTP receiver thread */
    if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
@@ -582,7 +582,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for SCTP failed");
       return RFAILED;
    }
-   //ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
+   ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
 
    /* system task for lower-mac receiver thread */
    if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
@@ -590,7 +590,7 @@ uint8_t commonInit()
       DU_LOG("\nERROR  -->  DU_APP : System Task creation for Lower MAC failed");
       return RFAILED;
    }
-   //ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
+   ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
 
 #ifndef INTEL_WLS_MEM
    /* system task for phy stub's slot indication generator thread */