RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181] 80/4780/12
authorBalaji Shankaran <balaji.shankaran@radisys.com>
Wed, 23 Sep 2020 10:03:08 +0000 (15:33 +0530)
committersphoorthi <sphoorthi.dayanand@radisys.com>
Sat, 17 Oct 2020 08:19:58 +0000 (13:49 +0530)
Change-Id: Id82e815c89a404682d18cf3bf73a874489b90f62
Signed-off-by: Balaji Shankaran <balaji.shankaran@radisys.com>
Signed-off-by: balajihands <balaji.shankaran@radisys.com>
Signed-off-by: sphoorthi <sphoorthi.dayanand@radisys.com>
88 files changed:
docs/README
src/5gnrmac/lwr_mac_fsm.c
src/5gnrmac/lwr_mac_fsm.h
src/5gnrmac/lwr_mac_utils.h
src/5gnrmac/mac.h
src/5gnrmac/mac_cfg_hdl.c
src/5gnrmac/mac_demux.c
src/5gnrmac/mac_msg_hdl.c
src/5gnrmac/mac_mux.c
src/5gnrmac/mac_rach.c
src/5gnrmac/mac_slot_ind.c
src/5gnrmac/mac_stop_ind.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrmac/mac_upr_inf_api.c
src/5gnrmac/mac_upr_inf_api.h
src/5gnrmac/mac_utils.c
src/5gnrmac/mac_utils.h
src/5gnrmac/rg_ex_ms.c
src/5gnrmac/rg_ptmi.c
src/5gnrmac/rg_ptui.c
src/5gnrrlc/kw.x
src/5gnrrlc/kw_amm_dl.c
src/5gnrrlc/kw_amm_ul.c
src/5gnrrlc/kw_dbm_dl.c
src/5gnrrlc/kw_dbm_ul.c
src/5gnrrlc/kw_dl.x
src/5gnrrlc/kw_dl_ex_ms.c
src/5gnrrlc/kw_lim.c
src/5gnrrlc/kw_lmm.c
src/5gnrrlc/kw_ptli.c
src/5gnrrlc/kw_ptmi.c
src/5gnrrlc/kw_ptui.c
src/5gnrrlc/kw_tmm_dl.c
src/5gnrrlc/kw_tmm_ul.c
src/5gnrrlc/kw_tmr.c
src/5gnrrlc/kw_udx.x
src/5gnrrlc/kw_udx_dl.c
src/5gnrrlc/kw_udx_ptdl.c
src/5gnrrlc/kw_udx_ptul.c
src/5gnrrlc/kw_udx_ul.c
src/5gnrrlc/kw_uim.c
src/5gnrrlc/kw_ul.x
src/5gnrrlc/kw_ul_ex_ms.c
src/5gnrrlc/kw_umm_dl.c
src/5gnrrlc/kw_umm_ul.c
src/5gnrrlc/kw_utl_dl.c
src/5gnrrlc/kw_utl_ul.c
src/5gnrrlc/mac_stub.c
src/5gnrrlc/rlc_lwr_inf_api.c [new file with mode: 0644]
src/5gnrrlc/rlc_lwr_inf_api.h [moved from src/5gnrrlc/rlc_utils.c with 70% similarity]
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_utils.h
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_rach.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_ue_mgr.c
src/5gnrsch/sch_utils.h
src/cm/common_def.c
src/cm/common_def.h
src/cm/du_app_mac_inf.h
src/cm/du_app_rlc_inf.h
src/cm/kwu.x
src/cm/lkw.c
src/cm/lkw.x
src/cm/lrg.c
src/cm/lrg.x
src/cm/mac_sch_interface.c
src/cm/mac_sch_interface.h
src/cm/rgu.c
src/cm/rgu.h
src/cm/rgu.x
src/cm/rlc_mac_inf.c [new file with mode: 0644]
src/cm/rlc_mac_inf.h [new file with mode: 0644]
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_stub_egtp.c
src/du_app/du_cfg.h
src/du_app/du_e2ap_msg_hdl.c
src/du_app/du_egtp.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_mgr.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c
src/du_app/du_sctp.c
src/du_app/du_ue_mgr.c
src/phy_stub/l1_bdy1.c
src/ric_stub/ric_e2ap_msg_hdl.c

index 3a0bf8a..c8ba9eb 100644 (file)
@@ -24,7 +24,10 @@ Pre-requisite for Compilation :
 2. GCC version 4.6.3 and above
 3. Install LKSCTP
    a. On Ubuntu : sudo apt-get install -y libsctp-dev
-   b. On CentOS : yum install lksctp-tools
+   b. On CentOS : yum install lksctp-tools-devel
+4. Install PCAP:
+   a. On ubuntu : sudo apt-get install -y libpcap-dev
+   b. On CentOS : yum install libpcap-devel
 
 
 How to Clean and Build:
index 1751190..03af085 100644 (file)
@@ -2300,7 +2300,7 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo)
        * RBLen = length of contiguously allocted RBs
        * Spec 38.214 Sec 5.1.2.2.2
        */
-      coreset0Size= sib1PdcchInfo->coreset0Cfg.coreSetSize;
+      coreset0Size= sib1PdcchInfo->coresetCfg.coreSetSize;
       rbStart = 0;              /* For SIB1 */
       //rbStart = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.startPrb;
       rbLen = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.numPrb;
@@ -2439,7 +2439,7 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo)
        */
 
       /* TODO: Fill values of coreset0Size, rbStart and rbLen */
-      coreset0Size= rarPdcchInfo->coreset0Cfg.coreSetSize;
+      coreset0Size= rarPdcchInfo->coresetCfg.coreSetSize;
       rbStart = 0;              /* For SIB1 */
       //rbStart = rarPdcchInfo->dci.pdschCfg->freqAlloc.rbStart;
       rbLen = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.numPrb;
@@ -2508,22 +2508,22 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo)
 
 /*******************************************************************
  *
- * @brief fills msg4 Dl DCI PDU required for DL TTI info in MAC
+ * @brief fills DL DCI PDU required for DL TTI info in MAC
  *
  * @details
  *
- *    Function : fillMsg4DlDciPdu
+ *    Function : fillDlMsgDlDciPdu
  *
  *    Functionality:
- *         -Fills the Msg4 Dl DCI PDU
+ *         -Fills the Dl DCI PDU  
  *
  * @params[in] Pointer to fapi_dl_dci_t
  *             Pointer to PdcchCfg
  * @return ROK
  *
  ******************************************************************/
-void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
-      Msg4Info *msg4Info)
+void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\
+      DlMsgInfo *dlMsgInfo)
 {
    if(dlDciPtr != NULLP)
    {
@@ -2531,7 +2531,7 @@ void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
       uint8_t bytePos;
       uint8_t bitPos;
 
-      uint16_t coreset0Size = 0;
+      uint16_t coresetSize = 0;
       uint16_t rbStart = 0;
       uint16_t rbLen = 0;
       uint8_t  dciFormatId;
@@ -2549,7 +2549,7 @@ void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
 
       /* Size(in bits) of each field in DCI format 1_0 */
       uint8_t dciFormatIdSize    = 1;
-      uint8_t freqDomResAssignSize;
+      uint8_t freqDomResAssignSize = 0;
       uint8_t timeDomResAssignSize = 4;
       uint8_t VRB2PRBMapSize       = 1;
       uint8_t modNCodSchemeSize    = 5;
@@ -2561,18 +2561,18 @@ void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
       uint8_t pucchResoIndSize     = 3;
       uint8_t harqFeedbackIndSize  = 3;
 
-      dlDciPtr->rnti = msg4PdcchInfo->dci.rnti;
-      dlDciPtr->scramblingId = msg4PdcchInfo->dci.scramblingId;    
-      dlDciPtr->scramblingRnti = msg4PdcchInfo->dci.scramblingRnti;
-      dlDciPtr->cceIndex = msg4PdcchInfo->dci.cceIndex;
-      dlDciPtr->aggregationLevel = msg4PdcchInfo->dci.aggregLevel;
-      dlDciPtr->pc_and_bform.numPrgs = msg4PdcchInfo->dci.beamPdcchInfo.numPrgs;
-      dlDciPtr->pc_and_bform.prgSize = msg4PdcchInfo->dci.beamPdcchInfo.prgSize;
-      dlDciPtr->pc_and_bform.digBfInterfaces = msg4PdcchInfo->dci.beamPdcchInfo.digBfInterfaces;
-      dlDciPtr->pc_and_bform.pmi_bfi[0].pmIdx = msg4PdcchInfo->dci.beamPdcchInfo.prg[0].pmIdx;
-      dlDciPtr->pc_and_bform.pmi_bfi[0].beamIdx[0].beamidx = msg4PdcchInfo->dci.beamPdcchInfo.prg[0].beamIdx[0];
-      dlDciPtr->beta_pdcch_1_0 = msg4PdcchInfo->dci.txPdcchPower.powerValue;           
-      dlDciPtr->powerControlOfssetSS = msg4PdcchInfo->dci.txPdcchPower.powerControlOffsetSS;
+      dlDciPtr->rnti = pdcchInfo->dci.rnti;
+      dlDciPtr->scramblingId = pdcchInfo->dci.scramblingId;
+      dlDciPtr->scramblingRnti = pdcchInfo->dci.scramblingRnti;
+      dlDciPtr->cceIndex = pdcchInfo->dci.cceIndex;
+      dlDciPtr->aggregationLevel = pdcchInfo->dci.aggregLevel;
+      dlDciPtr->pc_and_bform.numPrgs = pdcchInfo->dci.beamPdcchInfo.numPrgs;
+      dlDciPtr->pc_and_bform.prgSize = pdcchInfo->dci.beamPdcchInfo.prgSize;
+      dlDciPtr->pc_and_bform.digBfInterfaces = pdcchInfo->dci.beamPdcchInfo.digBfInterfaces;
+      dlDciPtr->pc_and_bform.pmi_bfi[0].pmIdx = pdcchInfo->dci.beamPdcchInfo.prg[0].pmIdx;
+      dlDciPtr->pc_and_bform.pmi_bfi[0].beamIdx[0].beamidx = pdcchInfo->dci.beamPdcchInfo.prg[0].beamIdx[0];
+      dlDciPtr->beta_pdcch_1_0 = pdcchInfo->dci.txPdcchPower.powerValue;
+      dlDciPtr->powerControlOfssetSS = pdcchInfo->dci.txPdcchPower.powerControlOffsetSS;
 
       /* Calculating freq domain resource allocation field value and size
        * coreset0Size = Size of coreset 0
@@ -2580,35 +2580,33 @@ void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
        * RBLen = length of contiguously allocted RBs
        * Spec 38.214 Sec 5.1.2.2.2
        */
+      coresetSize = pdcchInfo->coresetCfg.coreSetSize;
+      rbStart = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.startPrb;
+      rbLen = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.numPrb;
 
-      /* TODO: Fill values of coreset0Size, rbStart and rbLen */
-      coreset0Size = msg4PdcchInfo->coreset0Cfg.coreSetSize;
-      //rbStart = msg4PdcchInfo->dci.pdschCfg->freqAlloc.rbStart;
-      rbLen = msg4PdcchInfo->dci.pdschCfg->pdschFreqAlloc.freqAlloc.numPrb;
-
-      if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
+      if((rbLen >=1) && (rbLen <= coresetSize - rbStart))
       {
-        if((rbLen - 1) <= floor(coreset0Size / 2))
-           freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
-        else
-           freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
-                              + (coreset0Size - 1 - rbStart);
+         if((rbLen - 1) <= floor(coresetSize / 2))
+            freqDomResAssign = (coresetSize * (rbLen-1)) + rbStart;
+         else
+            freqDomResAssign = (coresetSize * (coresetSize - rbLen + 1)) \
+                               + (coresetSize - 1 - rbStart);
 
-        freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
+         freqDomResAssignSize = ceil(log2(coresetSize * (coresetSize + 1) / 2));
       }
 
       /* Fetching DCI field values */
-      dciFormatId      = msg4Info->dciFormatId; /* DCI indentifier for DL */
-      timeDomResAssign = msg4PdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1;
-      VRB2PRBMap       = msg4PdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
-      modNCodScheme    = msg4PdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
-      ndi              = msg4Info->ndi;      
-      redundancyVer    = msg4PdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
-      harqProcessNum   = msg4Info->harqProcNum; 
-      dlAssignmentIdx  = msg4Info->dlAssignIdx;
-      pucchTpc         = msg4Info->pucchTpc;
-      pucchResoInd     = msg4Info->pucchResInd;
-      harqFeedbackInd  = msg4Info->harqFeedbackInd;
+      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;
 
       /* Reversing bits in each DCI field */
       dciFormatId      = reverseBits(dciFormatId, dciFormatIdSize);
@@ -2627,56 +2625,56 @@ void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
 
       /* Calulating total number of bytes in buffer */
       dlDciPtr->payloadSizeBits = (dciFormatIdSize + freqDomResAssignSize\
-           + timeDomResAssignSize + VRB2PRBMapSize + modNCodSchemeSize\
-           + ndiSize + redundancyVerSize + harqProcessNumSize + dlAssignmentIdxSize\
-           + pucchTpcSize + pucchResoIndSize + harqFeedbackIndSize);
+            + timeDomResAssignSize + VRB2PRBMapSize + modNCodSchemeSize\
+            + ndiSize + redundancyVerSize + harqProcessNumSize + dlAssignmentIdxSize\
+            + pucchTpcSize + pucchResoIndSize + harqFeedbackIndSize);
 
       numBytes = dlDciPtr->payloadSizeBits / 8;
       if(dlDciPtr->payloadSizeBits % 8)
-        numBytes += 1;
+         numBytes += 1;
 
       if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
       {
-        DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
-        return;
+         DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
+         return;
       }
 
       /* Initialize buffer */
       for(bytePos = 0; bytePos < numBytes; bytePos++)
-        dlDciPtr->payload[bytePos] = 0;
+         dlDciPtr->payload[bytePos] = 0;
 
       bytePos = numBytes - 1;
       bitPos = 0;
 
       /* Packing DCI format fields */
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           dciFormatId, dciFormatIdSize);
+            dciFormatId, dciFormatIdSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           freqDomResAssign, freqDomResAssignSize);
+            freqDomResAssign, freqDomResAssignSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           timeDomResAssign, timeDomResAssignSize);
+            timeDomResAssign, timeDomResAssignSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           VRB2PRBMap, VRB2PRBMapSize);
+            VRB2PRBMap, VRB2PRBMapSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           modNCodScheme, modNCodSchemeSize);
+            modNCodScheme, modNCodSchemeSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           ndi, ndiSize);
+            ndi, ndiSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           redundancyVer, redundancyVerSize);
+            redundancyVer, redundancyVerSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           redundancyVer, redundancyVerSize);
+            redundancyVer, redundancyVerSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           harqProcessNum, harqProcessNumSize);
+            harqProcessNum, harqProcessNumSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           dlAssignmentIdx, dlAssignmentIdxSize);
+            dlAssignmentIdx, dlAssignmentIdxSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           pucchTpc, pucchTpcSize);
+            pucchTpc, pucchTpcSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           pucchResoInd, pucchResoIndSize);
+            pucchResoInd, pucchResoIndSize);
       fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
-           harqFeedbackInd, harqFeedbackIndSize);
+            harqFeedbackInd, harqFeedbackIndSize);
    }
-} /* fillMsg4DlDciPdu */
+}
 
 /*******************************************************************
  *
@@ -2716,12 +2714,12 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \
         bwp = &dlInfo->rarAlloc->bwp;
         fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
       }
-      else if(rntiType == TC_RNTI_TYPE)
+      else if(rntiType == TC_RNTI_TYPE || rntiType == C_RNTI_TYPE)
       {
-        pdcchInfo = &dlInfo->msg4Alloc->msg4PdcchCfg;
-        bwp = &dlInfo->msg4Alloc->bwp;
-        fillMsg4DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
-              &dlInfo->msg4Alloc->msg4Info);
+         pdcchInfo = &dlInfo->dlMsgAlloc->dlMsgPdcchCfg;
+        bwp = &dlInfo->dlMsgAlloc->bwp;
+         fillDlMsgDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
+           &dlInfo->dlMsgAlloc->dlMsgInfo);
       }
       else
       {
@@ -2733,15 +2731,15 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \
       dlTtiReqPdu->pdu.pdcch_pdu.bwpStart = bwp->freqAlloc.startPrb;
       dlTtiReqPdu->pdu.pdcch_pdu.subCarrierSpacing = bwp->subcarrierSpacing; 
       dlTtiReqPdu->pdu.pdcch_pdu.cyclicPrefix = bwp->cyclicPrefix; 
-      dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pdcchInfo->coreset0Cfg.startSymbolIndex;
-      dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pdcchInfo->coreset0Cfg.durationSymbols;
-      memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pdcchInfo->coreset0Cfg.freqDomainResource, 6);
-      dlTtiReqPdu->pdu.pdcch_pdu.cceRegMappingType = pdcchInfo->coreset0Cfg.cceRegMappingType;
-      dlTtiReqPdu->pdu.pdcch_pdu.regBundleSize = pdcchInfo->coreset0Cfg.regBundleSize;
-      dlTtiReqPdu->pdu.pdcch_pdu.interleaverSize = pdcchInfo->coreset0Cfg.interleaverSize;
-      dlTtiReqPdu->pdu.pdcch_pdu.coreSetSize = pdcchInfo->coreset0Cfg.coreSetType;
-      dlTtiReqPdu->pdu.pdcch_pdu.shiftIndex =  pdcchInfo->coreset0Cfg.shiftIndex;
-      dlTtiReqPdu->pdu.pdcch_pdu.precoderGranularity = pdcchInfo->coreset0Cfg.precoderGranularity;
+      dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pdcchInfo->coresetCfg.startSymbolIndex;
+      dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pdcchInfo->coresetCfg.durationSymbols;
+      memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pdcchInfo->coresetCfg.freqDomainResource, 6);
+      dlTtiReqPdu->pdu.pdcch_pdu.cceRegMappingType = pdcchInfo->coresetCfg.cceRegMappingType;
+      dlTtiReqPdu->pdu.pdcch_pdu.regBundleSize = pdcchInfo->coresetCfg.regBundleSize;
+      dlTtiReqPdu->pdu.pdcch_pdu.interleaverSize = pdcchInfo->coresetCfg.interleaverSize;
+      dlTtiReqPdu->pdu.pdcch_pdu.coreSetSize = pdcchInfo->coresetCfg.coreSetType;
+      dlTtiReqPdu->pdu.pdcch_pdu.shiftIndex =  pdcchInfo->coresetCfg.shiftIndex;
+      dlTtiReqPdu->pdu.pdcch_pdu.precoderGranularity = pdcchInfo->coresetCfg.precoderGranularity;
       dlTtiReqPdu->pdu.pdcch_pdu.numDlDci = pdcchInfo->numDlDci;
       dlTtiReqPdu->pdu.pdcch_pdu.coreSetType = coreSetType;
 
@@ -2872,12 +2870,11 @@ uint8_t calcDlTtiReqPduCount(DlSchedInfo *dlInfo)
       /* PDCCH and PDSCH PDU is filled */
       count += 2;
    }
-   if(dlInfo->msg4Alloc != NULLP)
+   if(dlInfo->dlMsgAlloc != NULLP)
    {
       /* PDCCH and PDSCH PDU is filled */
       count += 2;
    }
-
    return count;
 }
 
@@ -2908,11 +2905,10 @@ uint8_t calcTxDataReqPduCount(DlSchedInfo *dlInfo)
    {
       count++;
    }
-   if(dlInfo->msg4Alloc != NULLP)
+   if(dlInfo->dlMsgAlloc != NULLP)
    {
       count++;
    }
-
    return count;
 }
 /***********************************************************************
@@ -3023,27 +3019,27 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
 
 /***********************************************************************
  *
- * @brief fills the Msg4 TX-DATA request message
+ * @brief fills the DL dedicated Msg TX-DATA request message
  *
  * @details
  *
- *    Function : fillMsg4TxDataReq
+ *    Function : fillDlMsgTxDataReq
  *
  *    Functionality:
- *         - fills the Msg4 TX-DATA request message
+ *         - fills the Dl Dedicated Msg TX-DATA request message
  *
  * @params[in]    fapi_tx_pdu_desc_t *pduDesc
- * @params[in]    Msg4Info *msg4Info
+ * @params[in]    DlMsgInfo *dlMsgInfo
  * @params[in]    uint32_t *msgLen
  * @params[in]    uint16_t pduIndex
  * @return ROK
  *
  * ********************************************************************/
-uint8_t fillMsg4TxDataReq(fapi_tx_pdu_desc_t *pduDesc, Msg4Info *msg4Info,
+uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, DlMsgInfo *dlMsgInfo,
       uint16_t pduIndex)
 {
    uint32_t pduLen = 0;
-   uint8_t *msg4TxDataValue = NULLP;
+   uint8_t *dedMsgTxDataValue = NULLP;
 
    pduDesc[pduIndex].pdu_index = pduIndex;
    pduDesc[pduIndex].num_tlvs = 1;
@@ -3051,30 +3047,31 @@ uint8_t fillMsg4TxDataReq(fapi_tx_pdu_desc_t *pduDesc, Msg4Info *msg4Info,
    /* fill the TLV */
    /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
    pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
-   pduDesc[pduIndex].tlvs[0].tl.length = msg4Info->msg4PduLen;
-   LWR_MAC_ALLOC(msg4TxDataValue, msg4Info->msg4PduLen);
-   if(msg4TxDataValue == NULLP)
+   pduDesc[pduIndex].tlvs[0].tl.length = dlMsgInfo->dlMsgPduLen;
+   LWR_MAC_ALLOC(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
+   if(dedMsgTxDataValue == NULLP)
    {
       return RFAILED;
    }
-   memcpy(msg4TxDataValue, msg4Info->msg4Pdu, msg4Info->msg4PduLen);
-   pduDesc[pduIndex].tlvs[0].value = msg4TxDataValue;
+   memcpy(dedMsgTxDataValue, dlMsgInfo->dlMsgPdu, dlMsgInfo->dlMsgPduLen);
+   pduDesc[pduIndex].tlvs[0].value = dedMsgTxDataValue;
 
    /* The total length of the PDU description and PDU data */
    pduLen += 8; /* size of PDU length 2 bytes, PDU index 2 bytes, numTLV 4 bytes */
    pduLen += sizeof(fapi_uint8_ptr_tlv_t); /* only 1 TLV is present */
-   pduDesc[pduIndex].pdu_length = pduLen; 
+   pduDesc[pduIndex].pdu_length = pduLen;
 
    /* TODO: The pointer value which was stored, needs to be free-ed at PHY *
     * But since we did not implement WLS, this has to be done here
     */
-#ifndef INTEL_WLS   
-   MAC_FREE(msg4TxDataValue, msg4Info->msg4PduLen);
+#ifndef INTEL_WLS
+   MAC_FREE(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
 #endif
 
    return ROK;
 }
 
+
 #endif /* FAPI */
 /*******************************************************************
  *
@@ -3188,24 +3185,44 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
               DU_LOG("\nLWR_MAC: RAR sent...");
               printf("\033[0m");
            }
-           if(currDlSlot->dlInfo.msg4Alloc != NULLP)
+           if(currDlSlot->dlInfo.dlMsgAlloc != NULLP)
            {
-              /* Filling Msg4 param */
-              rntiType = TC_RNTI_TYPE;
-              fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
-                    &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
-              numPduEncoded++;
-              fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
-                    &currDlSlot->dlInfo.msg4Alloc->msg4PdschCfg,
-                    currDlSlot->dlInfo.msg4Alloc->bwp,
-                    pduIndex);
-              numPduEncoded++;
-              pduIndex++;
+              if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu != NULLP)
+              {
+                 /* Filling Msg4 param */
+                 printf("\033[1;32m");
+                 if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+                 {
+                    rntiType = TC_RNTI_TYPE;
+                    fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+                          &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
+                    DU_LOG("\nLWR_MAC: MSG4 sent...");
+                 }
+                 else
+                 { 
+                    /* Filling other DL msg params */
+                    rntiType = C_RNTI_TYPE;
+                    fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+                          &currDlSlot->dlInfo, rntiType, CORESET_TYPE1);
+                    DU_LOG("\nLWR_MAC: DL MSG sent...");
+                 }
+                 printf("\033[0m");
 
-              printf("\033[1;32m");
-              DU_LOG("\nLWR_MAC: MSG4 sent...");
-              printf("\033[0m");
+                 numPduEncoded++;
+                 fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+                       &currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg,
+                       currDlSlot->dlInfo.dlMsgAlloc->bwp,
+                       pduIndex);
+                 numPduEncoded++;
+                 pduIndex++;
+              }
+               else
+              {
+                  MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc, sizeof(DlMsgAlloc));
+                 currDlSlot->dlInfo.dlMsgAlloc = NULLP;
+              }
            }
+
            msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
            fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
            LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), \
@@ -3280,9 +3297,9 @@ uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
       {
         txDataReqMsgSize += dlInfo->rarAlloc->rarInfo.rarPduLen;
       }
-      if(dlInfo->msg4Alloc != NULLP)
+      if(dlInfo->dlMsgAlloc != NULLP)
       {
-        txDataReqMsgSize += dlInfo->msg4Alloc->msg4Info.msg4PduLen;
+        txDataReqMsgSize += dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPduLen;
       }
 
       LWR_MAC_ALLOC(txDataReq, txDataReqMsgSize);
@@ -3311,19 +3328,20 @@ uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
         MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc));
         dlInfo->rarAlloc = NULLP;
       }
-      if(dlInfo->msg4Alloc != NULLP && dlInfo->msg4Alloc->msg4Info.msg4Pdu != NULLP)
+      if(dlInfo->dlMsgAlloc != NULLP)
       {
-        fillMsg4TxDataReq(txDataReq->pdu_desc, &dlInfo->msg4Alloc->\
-              msg4Info, pduIndex);
-        pduIndex++;
-        txDataReq->num_pdus++;
-
-        MAC_FREE(dlInfo->msg4Alloc->msg4Info.msg4Pdu,\
-              dlInfo->msg4Alloc->msg4Info.msg4PduLen);
-        dlInfo->msg4Alloc->msg4Info.msg4Pdu = NULLP;
-        MAC_FREE(dlInfo->msg4Alloc,sizeof(Msg4Alloc));
-        dlInfo->msg4Alloc = NULLP;
+         fillDlMsgTxDataReq(txDataReq->pdu_desc, \
+           &dlInfo->dlMsgAlloc->dlMsgInfo, pduIndex);
+         pduIndex++;
+         txDataReq->num_pdus++;
+
+         MAC_FREE(dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPdu,\
+            dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPduLen);
+         dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPdu = NULLP;
+         MAC_FREE(dlInfo->dlMsgAlloc, sizeof(DlMsgAlloc));
+         dlInfo->dlMsgAlloc = NULLP;
       }
+
       msgLen = txDataReqMsgSize - sizeof(fapi_msg_t);
       fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
       LwrMacSendToPhy(txDataReq->header.msg_id, txDataReqMsgSize, \
index 14aa322..77685d8 100644 (file)
@@ -32,7 +32,8 @@
 typedef enum{
    SI_RNTI_TYPE,
    RA_RNTI_TYPE,
-   TC_RNTI_TYPE
+   TC_RNTI_TYPE,
+   C_RNTI_TYPE
 }RntiType;
 
 uint8_t lwr_mac_procInvalidEvt(void *msg);
@@ -44,6 +45,9 @@ uint8_t lwr_mac_procStartReqEvt(void *msg);
 uint8_t lwr_mac_procStopReqEvt(void *msg);
 void sendToLowerMac(uint16_t, uint32_t, void *);
 void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
+uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo);
+uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo);
+uint16_t fillUlDciReq(SlotIndInfo currTimingInfo);
 
 typedef uint8_t (*lwrMacFsmHdlr)(void *);
 #endif
index a9da027..4f9f12a 100644 (file)
 #define FILL_PST_LWR_MAC_TO_MAC(_pst, _event)               \
 {                                                           \
    _pst.selector  = ODU_SELECTOR_TC;                        \
-   _pst.srcEnt    = ENTLWRMAC;                                  \
-   _pst.dstEnt    = ENTMAC;                                  \
+   _pst.srcEnt    = ENTLWRMAC;                              \
+   _pst.dstEnt    = ENTMAC;                                 \
    _pst.dstInst   = 0;                                      \
    _pst.srcInst   = 0;                                      \
-   _pst.dstProcId = SFndProcId();                           \
-   _pst.srcProcId = SFndProcId();                           \
+   _pst.dstProcId = ODU_GET_PROCID();                      \
+   _pst.srcProcId = ODU_GET_PROCID();                      \
    _pst.region = MAC_MEM_REGION;                            \
    _pst.pool = MAC_POOL;                                    \
    _pst.event = _event;                                     \
index 88eeb87..947fbcc 100644 (file)
@@ -95,9 +95,9 @@ typedef enum
 
 typedef enum
 {
-   LC_STATE_INACTIVE,
-   LC_STATE_ACTIVE
-}LcState;
+   MAC_LC_STATE_INACTIVE,
+   MAC_LC_STATE_ACTIVE
+}MacLcState;
 
 typedef struct macDlSlot
 {
@@ -164,14 +164,14 @@ typedef struct ulLcCb
 {
    uint8_t   lcId;      /* Logical Channel Id */
    uint8_t   lcGrpId;   /* Logical Channel group */
-   LcState   lcActive;  /* Is LC active ? */
+   MacLcState lcActive;  /* Is LC active ? */
 }UlLcCb;
 
 /* Downlink dedicated logical channel info */
 typedef struct dlLcCb
 {
    uint8_t   lcId;      /* Logical channel Id */ 
-   LcState   lcState;  /* Is LC active ? */
+   MacLcState   lcState;  /* Is LC active ? */
 }DlLcCb;
 
 /* BSR Information */
@@ -187,7 +187,7 @@ typedef struct ueUlCb
 {
    uint8_t    maxReTx;     /* MAX HARQ retransmission */
    uint8_t    numUlLc;     /* Number of uplink logical channels */       
-   UlLcCb     lcCb[MAX_NUM_LOGICAL_CHANNELS];    /* Uplink dedicated logocal channels */
+   UlLcCb     lcCb[MAX_NUM_LC];    /* Uplink dedicated logocal channels */
 }UeUlCb;
 
 /* UE specific DL Info */
@@ -195,7 +195,7 @@ typedef struct ueDlCb
 {
    DlHarqEnt  dlHarqEnt;      /* DL HARQ entity */
    uint8_t    numDlLc;        /* Number of downlink logical channels */
-   DlLcCb     lcCb[MAX_NUM_LOGICAL_CHANNELS];  /* Downlink dedicated logical channels */
+   DlLcCb     lcCb[MAX_NUM_LC];  /* Downlink dedicated logical channels */
 }UeDlCb;
 
 /* UE Cb */
@@ -214,6 +214,7 @@ typedef struct macUeCb
 struct macCellCb
 {
    uint16_t    cellId;
+   uint8_t     crntiMap;
    MacRaCbInfo macRaCb[MAX_NUM_UE];
    MacDlSlot   dlSlot[MAX_SLOT_SUPPORTED];
    MacUlSlot   ulSlot[MAX_SLOT_SUPPORTED];
@@ -232,18 +233,21 @@ typedef struct macCb
 
 /* global variable */
 MacCb macCb;
+
+/* Function declarations */
 void fillRarPdu(RarInfo *rarInfo);
-void createMacRaCb(uint16_t cellId, uint16_t crnti);
-void fillMsg4DlData(uint16_t cellId, MacDlData *dlData, uint8_t *msg4Pdu);
+void createMacRaCb(RachIndInfo *rachIndInfo);
+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, SlotIndInfo slotInfo, RxDataIndPdu *rxDataIndPdu);
-void fillMg4Pdu(Msg4Alloc *msg4Alloc);
+void fillMg4Pdu(DlMsgAlloc *msg4Alloc);
 void buildAndSendMuxPdu(SlotIndInfo 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);
 uint8_t macProcUlData(uint16_t cellId, uint16_t rnti, SlotIndInfo slotInfo, \
    uint8_t lcId, uint16_t pduLen, uint8_t *pdu);
+uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotIndInfo slotInfo);
 #endif
 /**********************************************************************
   End of file
index d03bbdd..f75f847 100644 (file)
 #include "common_def.h"
 #include "lrg.h"
 #include "lrg.x"
-#include "rgu.h"
-#include "rgu.x"
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
 #include "mac.h"
+#include "rlc_mac_inf.h"
 #include "mac_upr_inf_api.h"
 #include "lwr_mac.h"
 #include "lwr_mac_fsm.h"
index fe6198b..8d9a878 100644 (file)
@@ -47,6 +47,7 @@ extern uint32_t shortBsrBytesTable[MAX_SHORT_BSR_TABLE_ENTRIES];
  * ****************************************************************/
 uint8_t unpackRxData(uint16_t cellId, SlotIndInfo slotInfo, RxDataIndPdu *rxDataIndPdu)
 {
+   uint8_t   ueIdx;       /* Iterator for UE list */
    uint8_t   lcId;        /* LC ID of a sub pdu */
    uint8_t   fBit = 0;    /* Value of F Bit in MAC sub-header */
    uint8_t   idx = 0;     /* Iterator for received PDU */
@@ -60,6 +61,8 @@ uint8_t unpackRxData(uint16_t cellId, SlotIndInfo slotInfo, RxDataIndPdu *rxData
    GET_CELL_IDX(cellId, cellIdx);
    pduLen = rxDataIndPdu->pduLength;
    rxDataPdu = rxDataIndPdu->pduData;
+   GET_UE_IDX(rxDataIndPdu->rnti, ueIdx);
+   ueIdx = ueIdx -1;
 
    while(pduLen > 0)
    {
@@ -92,7 +95,7 @@ uint8_t unpackRxData(uint16_t cellId, SlotIndInfo slotInfo, RxDataIndPdu *rxData
               idx = idx + length;
 
               /* store msg3 pdu in macRaCb for CRI value */
-              memcpy(macCb.macCell[cellIdx]->macRaCb[0].msg3Pdu, pdu, length);
+              memcpy(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg3Pdu, pdu, length);
 
               /* Send UL-CCCH Indication to DU APP */
               ret = macProcUlCcchInd(macCb.macCell[cellIdx]->cellId, rxDataIndPdu->rnti, length, pdu);
@@ -126,6 +129,16 @@ uint8_t unpackRxData(uint16_t cellId, SlotIndInfo slotInfo, RxDataIndPdu *rxData
               memcpy(pdu, &rxDataPdu[idx], length);
               pduLen -= length;
               idx = idx + length;
+
+              /* Delete RA cb once RRC setup complete received */
+              if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == rxDataIndPdu->rnti)
+              {
+                 MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu, \
+                    macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
+                  MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
+                      macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
+                 memset(&macCb.macCell[cellIdx]->macRaCb[ueIdx], 0, sizeof(MacRaCbInfo));
+              }
               
               /* Send UL Data to RLC */
               ret = macProcUlData(cellId, rxDataIndPdu->rnti, slotInfo, lcId, length, pdu);
index 8210880..11c4b9c 100644 (file)
 /* header include files -- defines (.h)  */
 #include "common_def.h"
 #include "lrg.h"
-#include "rgu.h"
 #include "lrg.x"
-#include "rgu.x"
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
+#include "rlc_mac_inf.h"
 #include "mac_upr_inf_api.h"
 #include "lwr_mac.h"
 #ifdef INTEL_FAPI
 
 extern MacCb  macCb;
 
-extern void sendToLowerMac(uint16_t msgType, uint32_t msgLen, void *msg);
-uint16_t buildMacPdu(RlcMacData *dlData);
+uint16_t buildMacPdu(RlcData *dlData);
+#ifdef EGTP_TEST
+void macStubBuildUlData(Buffer *mBuf);
+#endif
 
 /* Function pointer for sending crc ind from MAC to SCH */
 MacSchCrcIndFunc macSchCrcIndOpts[]=
@@ -79,7 +80,7 @@ MacSchSrUciIndFunc macSchSrUciIndOpts[]=
  *
  * @details
  *
- *    Function : sendDlRlcBoInfoMacToSch
+ *    Function : sendDlRlcBoInfoToSch
  *
  *    Functionality:
  *       Sends DL BO Info to SCH
@@ -89,7 +90,7 @@ MacSchSrUciIndFunc macSchSrUciIndOpts[]=
  *         RFAILED - failure
  *
  ****************************************************************/
-uint8_t sendDlRlcBoInfoMacToSch(DlRlcBOInfo *dlBoInfo)
+uint8_t sendDlRlcBoInfoToSch(DlRlcBoInfo *dlBoInfo)
 {
    Pst pst;
 
@@ -196,7 +197,7 @@ uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
  *
  * @details
  *
- *    Function : MacRlcProcDlData 
+ *    Function : MacProcRlcDlData 
  *
  *    Functionality:
  *      Processes DL data from RLC
@@ -207,8 +208,57 @@ uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint16_t MacRlcProcDlData(Pst* pst, SpId spId, RlcMacData *dlData)
+uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData)
 {
+   uint8_t pduIdx;
+   uint8_t  *txPdu;
+   uint16_t tbSize;
+   MacDlData macDlData;
+   MacDlSlot *currDlSlot = NULLP;
+
+   DU_LOG("\nMAC: Received DL data for sfn=%d slot=%d", \
+      dlData->slotInfo.sfn, dlData->slotInfo.slot);
+
+   /* Copy the pdus to be muxed into mac Dl data */
+   macDlData.numPdu = dlData->numPdu;
+   for(pduIdx = 0;  pduIdx < dlData->numPdu; pduIdx++)
+   {
+      macDlData.pduInfo[pduIdx].lcId = dlData->pduInfo[pduIdx].lcId;
+      macDlData.pduInfo[pduIdx].pduLen = dlData->pduInfo[pduIdx].pduLen;
+      macDlData.pduInfo[pduIdx].dlPdu = dlData->pduInfo[pduIdx].pduBuf;
+   }
+
+   /* Store DL data in the scheduled slot */
+   currDlSlot = &macCb.macCell[dlData->cellId -1]->dlSlot[dlData->slotInfo.slot];
+   if(currDlSlot)
+   {
+      if(currDlSlot->dlInfo.dlMsgAlloc)
+      {
+        tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+        MAC_ALLOC(txPdu, tbSize);
+        if(!txPdu)
+        {
+           DU_LOG("\nMAC : Memory allocation failed in MacProcRlcDlData");
+           return RFAILED;
+        }
+        macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+        currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+        currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+      }
+   }
+
+   /* Free memory */
+   for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
+   {
+      MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData->pduInfo[pduIdx].pduBuf,\
+         dlData->pduInfo[pduIdx].pduLen);
+   }
+   if(pstInfo->selector == ODU_SELECTOR_LWLC)
+   {
+      MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
+   }
+
    return ROK;
 }
 
@@ -236,16 +286,16 @@ uint8_t macProcUlData(uint16_t cellId, uint16_t rnti, SlotIndInfo slotInfo, \
 uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
 {
    Pst         pst;
-   RlcMacData  *ulData;
+   RlcData  *ulData;
 
    /* Filling RLC Ul Data*/
-   MAC_ALLOC_SHRABL_BUF(ulData, sizeof(RlcMacData));
+   MAC_ALLOC_SHRABL_BUF(ulData, sizeof(RlcData));
    if(!ulData)
    {
       DU_LOG("\nMAC : Memory allocation failed while sending UL data to RLC");
       return RFAILED;
    }
-   memset(ulData, 0, sizeof(RlcMacData));
+   memset(ulData, 0, sizeof(RlcData));
    ulData->cellId = cellId; 
    ulData->rnti = rnti;
    memcpy(&ulData->slotInfo, &slotInfo, sizeof(SlotIndInfo));
@@ -263,7 +313,7 @@ uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
 
    /* Filling Post and send to RLC */
    memset(&pst, 0, sizeof(Pst));
-   FILL_PST_MAC_TO_RLC(pst, 0, EVTRLCULDAT);
+   FILL_PST_MAC_TO_RLC(pst, 0, EVENT_UL_DATA_TO_RLC);
    MacSendUlDataToRlc(&pst, ulData);
 
    return ROK;
@@ -276,7 +326,7 @@ uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
  *
  * @details
  *
- *    Function : MacRlcProcBOStatus
+ *    Function : MacProcRlcBOStatus
  *
  *    Functionality:
  *      Processes BO status from RLC
@@ -287,11 +337,78 @@ uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint16_t MacRlcProcBOStatus(Pst* pst, SpId spId, RlcMacBOStatus*      boStatus)
+uint8_t MacProcRlcBoStatus(Pst* pst, RlcBoStatus* boStatus)
 {
+   DlRlcBoInfo  dlBoInfo;
+
+   dlBoInfo.cellId = boStatus->cellId;
+   GET_CRNTI(dlBoInfo.crnti, boStatus->ueIdx);
+   dlBoInfo.lcId = boStatus->lcId;
+   dlBoInfo.dataVolume = boStatus->bo;
+
+   sendDlRlcBoInfoToSch(&dlBoInfo); 
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      MAC_FREE_SHRABL_BUF(pst->region, pst->pool, boStatus, sizeof(RlcBoStatus));
+   }
+
    return ROK;
 }
 
+/*******************************************************************
+ *
+ * @brief Send LC schedule result report to RLC
+ *
+ * @details
+ *
+ *    Function : sendSchRptToRlc 
+ *
+ *    Functionality: Send LC schedule result report to RLC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotIndInfo slotInfo)
+{
+   Pst      pst;
+   uint8_t  lcIdx;
+   RlcSchedResultRpt  *schedRpt = NULLP;
+   
+   MAC_ALLOC_SHRABL_BUF(schedRpt, sizeof(RlcSchedResultRpt));
+   if(!schedRpt)
+   {
+      DU_LOG("\nMAC: Memory allocation failure in sendSchResultRepToRlc");
+      return RFAILED;
+   }
+   DU_LOG("\nMAC: Send scheduled result report for sfn %d slot %d", slotInfo.sfn, slotInfo.slot);
+
+   schedRpt->cellId = dlInfo.cellId;
+   schedRpt->rnti = dlInfo.dlMsgAlloc->crnti;
+   schedRpt->numLc = dlInfo.dlMsgAlloc->numLc;
+   schedRpt->slotInfo.sfn = slotInfo.sfn;
+   schedRpt->slotInfo.slot = slotInfo.slot;
+
+   for(lcIdx = 0; lcIdx < schedRpt->numLc; lcIdx++)
+   {
+      schedRpt->lcSch[lcIdx].lcId = dlInfo.dlMsgAlloc->lcSchInfo[lcIdx].lcId;
+      schedRpt->lcSch[lcIdx].bufSize = dlInfo.dlMsgAlloc->lcSchInfo[lcIdx].schBytes;
+      schedRpt->lcSch[lcIdx].commCh = false;
+   }
+
+   /* Fill Pst */
+   FILL_PST_MAC_TO_RLC(pst, RLC_DL_INST, EVENT_SCHED_RESULT_TO_RLC);
+   if(MacSendSchedResultRptToRlc(&pst, schedRpt) != ROK)
+   {
+      DU_LOG("\nMAC: Failed to send Schedule result report to RLC");
+      MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, schedRpt, sizeof(RlcSchedResultRpt));
+      return RFAILED;
+   }
+
+   return ROK;
+}
 
 /*******************************************************************
  *
@@ -370,10 +487,11 @@ uint8_t MacProcCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo)
  * ****************************************************************/
 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
 {
+   uint8_t  ueIdx = 0;
    uint16_t cellIdx;
    uint16_t idx;
-   DlRlcBOInfo  dlBoInfo;
-   memset(&dlBoInfo, 0, sizeof(DlRlcBOInfo));
+   DlRlcBoInfo  dlBoInfo;
+   memset(&dlBoInfo, 0, sizeof(DlRlcBoInfo));
 
    DU_LOG("\nMAC : Handling DL CCCH IND");
 
@@ -381,32 +499,31 @@ uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
 
    dlBoInfo.cellId = dlCcchIndInfo->cellId;
    dlBoInfo.crnti = dlCcchIndInfo->crnti;
-   dlBoInfo.numLc = 0;
 
    if(dlCcchIndInfo->msgType == RRC_SETUP)
    {
-      dlBoInfo.boInfo[dlBoInfo.numLc].lcId = SRB_ID_0;    // SRB ID 0 for msg4
-      dlBoInfo.boInfo[SRB_ID_0].dataVolume = \
-         dlCcchIndInfo->dlCcchMsgLen;
-      dlBoInfo.numLc++;
+      dlBoInfo.lcId = SRB0_LCID;    // SRB ID 0 for msg4
+      dlBoInfo.dataVolume = dlCcchIndInfo->dlCcchMsgLen;
 
       /* storing Msg4 Pdu in raCb */
-      if(macCb.macCell[cellIdx]->macRaCb[0].crnti == dlCcchIndInfo->crnti)
+      GET_UE_IDX(dlBoInfo.crnti, ueIdx);
+      ueIdx = ueIdx -1;
+      if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == dlCcchIndInfo->crnti)
       {
-        macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen = dlCcchIndInfo->dlCcchMsgLen;
-        MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu, \
-           macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
-        if(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu)
+        macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen = dlCcchIndInfo->dlCcchMsgLen;
+        MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu, \
+           macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
+        if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu)
         {
            for(idx = 0; idx < dlCcchIndInfo->dlCcchMsgLen; idx++)
            {
-              macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu[idx] =\
+              macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu[idx] =\
                  dlCcchIndInfo->dlCcchMsg[idx];
            }
         }
       }
    }
-   sendDlRlcBoInfoMacToSch(&dlBoInfo);
+   sendDlRlcBoInfoToSch(&dlBoInfo);
 
    MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlCcchIndInfo->dlCcchMsg, \
         dlCcchIndInfo->dlCcchMsgLen);
index e20d8bb..8017f57 100644 (file)
@@ -25,6 +25,7 @@
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
 #include "mac.h"
+#include "mac_utils.h"
 
 /*******************************************************************
  *
@@ -190,15 +191,27 @@ void fillRarPdu(RarInfo *rarInfo)
  * @return void
  *
  * ****************************************************************/
-void createMacRaCb(uint16_t cellId, uint16_t crnti)
+void createMacRaCb(RachIndInfo *rachIndInfo)
 {
-   uint8_t idx = 0; /* supporting 1 UE */
-   uint16_t cellIdx;
+   uint8_t  ueIdx = 0;
+   uint16_t crnti = 0;
+   uint16_t cellIdx = 0;
 
-   GET_CELL_IDX(cellId, cellIdx);
+   GET_CELL_IDX(rachIndInfo->cellId, cellIdx);
+   
+   crnti = getNewCrnti(&macCb.macCell[cellIdx]->crntiMap);
+   if(crnti == -1)
+      return;
 
-   macCb.macCell[cellIdx]->macRaCb[idx].cellId = cellId;
-   macCb.macCell[cellIdx]->macRaCb[idx].crnti = crnti;
+   GET_UE_IDX(crnti, ueIdx);
+   ueIdx = ueIdx -1;
+
+   /* store in rach ind structure */
+   rachIndInfo->crnti  = crnti;
+
+   /* store in raCb */
+   macCb.macCell[cellIdx]->macRaCb[ueIdx].cellId = rachIndInfo->cellId;
+   macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti  = crnti;
 }
 
 /*************************************************
@@ -214,21 +227,14 @@ void createMacRaCb(uint16_t cellId, uint16_t crnti)
  *             msg4Pdu pointer
  ************************************************/
 
-void fillMsg4DlData(uint16_t cellId, MacDlData *dlData, uint8_t *msg4Pdu)
+void fillMsg4DlData(MacDlData *dlData, uint16_t msg4PduLen, uint8_t *msg4Pdu)
 {
    uint8_t idx = 0;
-   uint16_t idx2;
-   uint16_t cellIdx;
-
-   GET_CELL_IDX(cellId, cellIdx);
 
    dlData->numPdu = 1;
    dlData->pduInfo[idx].lcId = MAC_LCID_CCCH;
-   dlData->pduInfo[idx].pduLen = macCb.macCell[cellIdx]->macRaCb[idx].msg4PduLen;
-   for(idx2 = 0; idx2 <  dlData->pduInfo[idx].pduLen; idx2++)
-   {
-      dlData->pduInfo[idx].dlPdu[idx2] = msg4Pdu[idx2];
-   }
+   dlData->pduInfo[idx].pduLen = msg4PduLen;
+   memcpy(dlData->pduInfo[idx].dlPdu, msg4Pdu, msg4PduLen);
 }
 
 /*************************************************
@@ -266,11 +272,11 @@ void fillMacCe(MacCeInfo *macCeInfo, uint8_t *msg3Pdu)
  *    Functionality:
  *     The MAC PDU will be MUXed and formed
  *
- * @params[in] MacDlData *, MacCeInfo *, msg4TxPdu *, tbSize
+ * @params[in] MacDlData *, MacCeInfo *, txPdu *, tbSize
  * @return void
  * ****************************************************************/
 
-void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize)
+void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *txPdu, uint16_t tbSize)
 {
    uint8_t bytePos = 0;
    uint8_t bitPos = 7;
@@ -291,24 +297,27 @@ void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint
    uint8_t lenFieldSize = 0;      /* 8-bit or 16-bit L field  */
 
    /* PACK ALL MAC CE */
-   for(idx = 0; idx < macCeData->numCes; idx++)
+   if(macCeData != NULLP)
    {
-      lcid = macCeData->macCe[idx].macCeLcid;
-      switch(lcid)
+      for(idx = 0; idx < macCeData->numCes; idx++)
       {
-        case MAC_LCID_CRI:
-           {
-              /* Packing fields into MAC PDU R/R/LCID */
-              packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
-              packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
-              memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
-                    MAX_CRI_SIZE);
-              bytePos += MAX_CRI_SIZE;
+        lcid = macCeData->macCe[idx].macCeLcid;
+        switch(lcid)
+        {
+           case MAC_LCID_CRI:
+              {
+                 /* Packing fields into MAC PDU R/R/LCID */
+                 packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
+                 packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+                 memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
+                       MAX_CRI_SIZE);
+                 bytePos += MAX_CRI_SIZE;
+                 break;
+              }
+           default:
+              DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
               break;
-           }
-        default:
-           DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
-           break;
+        }
       }
    }
 
@@ -319,6 +328,7 @@ void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint
       switch(lcid)
       {
         case MAC_LCID_CCCH:
+        case MAC_LCID_MIN ... MAC_LCID_MAX :
            {
               lenField = dlData->pduInfo[idx].pduLen;
               if(dlData->pduInfo[idx].pduLen > 255)
@@ -357,10 +367,10 @@ void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint
       packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
    }
 
-   /*Storing the muxed pdu in macRaCb */
-   if(msg4TxPdu != NULLP)
+   /*Storing the muxed pdu */
+   if(txPdu != NULLP)
    {
-      memcpy(msg4TxPdu, macPdu, tbSize);
+      memcpy(txPdu, macPdu, tbSize);
    }
 }
 
index d153018..a34642d 100644 (file)
@@ -85,9 +85,7 @@ uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd)
    pduIdx = 0;
    preambleIdx = 0;
 
-   rachIndInfo.cellId = rachInd->rachPdu[pduIdx].pci;
-   /* TODO : A.ocate unique crnti for each ue */
-   rachIndInfo.crnti = 100;
+   rachIndInfo.cellId = rachInd->cellId;
    rachIndInfo.timingInfo.sfn = rachInd->timingInfo.sfn;
    rachIndInfo.timingInfo.slot = rachInd->timingInfo.slot;
    rachIndInfo.slotIdx = rachInd->rachPdu[pduIdx].slotIdx;
@@ -99,7 +97,7 @@ uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd)
                           rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].timingAdv;
 
    /* storing the value in macRaCb */
-   createMacRaCb(rachIndInfo.cellId, rachIndInfo.crnti);
+   createMacRaCb(&rachIndInfo);
 
    return(sendRachIndMacToSch(&rachIndInfo));
 }
index 6b70ebb..e058b78 100644 (file)
 #include "common_def.h"
 #include "lrg.h"
 #include "lrg.x"
-#include "rgu.h"
-#include "rgu.x"
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
+#include "rlc_mac_inf.h"
 #include "mac.h"
 #include "mac_upr_inf_api.h"
 #include "lwr_mac_fsm.h"
 #include "mac_utils.h"
 
-/* Function declarations */
-extern uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo);
-extern uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo);
-extern uint16_t fillUlDciReq(SlotIndInfo currTimingInfo);
-
 /* function pointers for packing slot ind from mac to sch */
 MacSchSlotIndFunc macSchSlotIndOpts[] =
 {
@@ -83,15 +77,26 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
         fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
       }
 
-      if(dlSchedInfo->msg4Alloc != NULLP)
+      if(dlSchedInfo->dlMsgAlloc != NULLP)
       {
-        Msg4Alloc *msg4Alloc = NULLP;
         currDlSlot = &macCb.macCell[cellIdx]->\
-           dlSlot[dlSchedInfo->schSlotValue.msg4Time.slot];
-        currDlSlot->dlInfo.msg4Alloc = dlSchedInfo->msg4Alloc; /* copy msg4 alloc pointer in MAC slot info */
-        msg4Alloc = dlSchedInfo->msg4Alloc;
-        macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = msg4Alloc->msg4PdschCfg.codeword[0].tbSize;
+           dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
+        currDlSlot->dlInfo.dlMsgAlloc = dlSchedInfo->dlMsgAlloc; /* copy msg4 alloc pointer in MAC slot info */
+         currDlSlot->dlInfo.cellId = dlSchedInfo->cellId;
+
+         /* Check if the downlink pdu is msg4 */
+        if(dlSchedInfo->dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+        {
+           macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = dlSchedInfo->dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+        }
+        else
+        {
+           memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+           /* Send LC schedule result to RLC */
+           sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime);
+        }
       }
+
       if(dlSchedInfo->ulGrant != NULLP)
       {
         currDlSlot = &macCb.macCell[cellIdx]->\
@@ -110,11 +115,12 @@ uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
  * 
  *      Forming and filling of Msg4Pdu
  *           
- *  @param[in]  Msg4Alloc  *msg4Alloc
+ *  @param[in]  DlMsgAlloc  *msg4Alloc
  *  @return  void
  **/
-void fillMsg4Pdu(uint16_t cellId, Msg4Alloc *msg4Alloc)
+void fillMsg4Pdu(uint16_t cellId, DlMsgAlloc *msg4Alloc)
 {
+   uint8_t   ueIdx;
    uint16_t  cellIdx;
    MacDlData msg4DlData;
    MacCeInfo  macCeData;
@@ -124,24 +130,27 @@ void fillMsg4Pdu(uint16_t cellId, Msg4Alloc *msg4Alloc)
    memset(&msg4DlData, 0, sizeof(MacDlData));
    memset(&macCeData, 0, sizeof(MacCeInfo));
 
-   if(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu != NULLP)
+   GET_UE_IDX(msg4Alloc->dlMsgInfo.crnti, ueIdx);
+   ueIdx = ueIdx -1;
+   if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu != NULLP)
    {
-      MAC_ALLOC(msg4DlData.pduInfo[0].dlPdu, \
-           macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
-      if(msg4DlData.pduInfo[0].dlPdu != NULLP)
+      MAC_ALLOC(msg4DlData.pduInfo[ueIdx].dlPdu, \
+           macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
+      if(msg4DlData.pduInfo[ueIdx].dlPdu != NULLP)
       {
-        fillMsg4DlData(cellId, &msg4DlData, macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu);
-        fillMacCe(&macCeData, macCb.macCell[cellIdx]->macRaCb[0].msg3Pdu);
+        fillMsg4DlData(&msg4DlData, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen,\
+            macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu);
+        fillMacCe(&macCeData, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg3Pdu);
         /* Forming Mux Pdu */
-        macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu = NULLP;
-        MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, \
-           macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
-        if(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu != NULLP)
+        macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu = NULLP;
+        MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
+           macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
+        if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu != NULLP)
         {
-           memset(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, 0, \
-              macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
-           macMuxPdu(&msg4DlData, &macCeData, macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu,\
-                 macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
+           memset(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, 0, \
+              macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
+           macMuxPdu(&msg4DlData, &macCeData, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu,\
+                 macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
 
         }
         else
@@ -149,29 +158,25 @@ void fillMsg4Pdu(uint16_t cellId, Msg4Alloc *msg4Alloc)
            DU_LOG("\nMAC: Failed allocating memory for msg4TxPdu");
         }
         /* Free memory allocated */
-        MAC_FREE(msg4DlData.pduInfo[0].dlPdu, macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
+        MAC_FREE(msg4DlData.pduInfo[0].dlPdu, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
       }
    }
 
    /* storing msg4 Pdu in macDlSlot */
-   if(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu)
+   if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu)
    {
-      msg4Alloc->msg4Info.msg4PduLen = macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize;
-      MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, msg4Alloc->msg4Info.msg4PduLen);
-      if(msg4Alloc->msg4Info.msg4Pdu != NULLP)
+      msg4Alloc->dlMsgInfo.dlMsgPduLen = macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize;
+      MAC_ALLOC(msg4Alloc->dlMsgInfo.dlMsgPdu, msg4Alloc->dlMsgInfo.dlMsgPduLen);
+      if(msg4Alloc->dlMsgInfo.dlMsgPdu != NULLP)
       {
-        memcpy(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, \
-              msg4Alloc->msg4Info.msg4PduLen);
+        memcpy(msg4Alloc->dlMsgInfo.dlMsgPdu, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
+              msg4Alloc->dlMsgInfo.dlMsgPduLen);
       }
    }
    else
    {
       DU_LOG("\nMAC: Failed at macMuxPdu()");
    }
-   /* TODO: Free all allocated memory, after the usage */
-   /* MAC_FREE(macCb.macCell->macRaCb[0].msg4TxPdu, \
-      macCb.macCell->macRaCb[0].msg4TbSize); // TODO: To be freed after re-transmission is successful.
-      MAC_FREE(macCb.macCell->macRaCb[0].msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen); */
 }
 
 /**
@@ -198,10 +203,13 @@ void buildAndSendMuxPdu(SlotIndInfo currTimingInfo)
 
    ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA);
    currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot];
-   if(currDlSlot->dlInfo.msg4Alloc)
+   if(currDlSlot->dlInfo.dlMsgAlloc)
    {
-      fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.msg4Alloc);
-      currDlSlot = NULLP;
+      if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+      {
+         fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.dlMsgAlloc);
+         currDlSlot = NULLP;
+      }
    }
 }
 
index 1718c38..124565f 100644 (file)
 #include "common_def.h"
 #include "lrg.h"
 #include "lrg.x"
-#include "rgu.h"
-#include "rgu.x"
 #include "du_app_mac_inf.h"
 #include "mac_sch_interface.h"
 #include "lwr_mac_upr_inf.h"
+#include "rlc_mac_inf.h"
 #include "mac.h"
 #include "mac_upr_inf_api.h"
 #include "mac_utils.h"
index 2ab31c1..f901ce9 100644 (file)
@@ -664,10 +664,10 @@ uint8_t sendAddUeCreateReqToSch(MacUeCfg *ueCfg)
    }
 
    schUeCfg.numLc = ueCfg->numLcs;
-   if(schUeCfg.numLc > MAX_NUM_LOGICAL_CHANNELS)
+   if(schUeCfg.numLc > MAX_NUM_LC)
    {
       DU_LOG("\nMAC : Number of Logical channels %d exceeds max limit %d",\
-           schUeCfg.numLc, MAX_NUM_LOGICAL_CHANNELS);
+           schUeCfg.numLc, MAX_NUM_LC);
    }  
    for(idx = 0; idx < schUeCfg.numLc; idx++)
    {
@@ -862,17 +862,17 @@ uint8_t createUeCb(MacUeCfg *ueCfg)
    }
 
    /* Fill SRB1 info */
-   if(ueCfg->numLcs > MAX_NUM_LOGICAL_CHANNELS)
+   if(ueCfg->numLcs > MAX_NUM_LC)
    {
       DU_LOG("\nMAC : Number of LC to configure[%d] exceeds limit[%d]",\
-           ueCfg->numLcs, MAX_NUM_LOGICAL_CHANNELS);
+           ueCfg->numLcs, MAX_NUM_LC);
       return RFAILED;
    }
 
    for(lcIdx = 0; lcIdx < ueCfg->numLcs; lcIdx++)
    {
       ueCb->dlInfo.lcCb[ueCb->dlInfo.numDlLc].lcId = ueCfg->lcCfgList[lcIdx].lcId;
-      ueCb->dlInfo.lcCb[ueCb->dlInfo.numDlLc].lcState = LC_STATE_ACTIVE;
+      ueCb->dlInfo.lcCb[ueCb->dlInfo.numDlLc].lcState = MAC_LC_STATE_ACTIVE;
       ueCb->dlInfo.numDlLc++;
    }
 
index be8c36d..6992add 100644 (file)
@@ -19,9 +19,8 @@
 /* This file contains the definitions for Upper Interface APIs that are
  * invoked from MAC */
 #include "common_def.h"
-#include "rgu.h"
-#include "rgu.x"
 #include "du_app_mac_inf.h"
+#include "rlc_mac_inf.h"
 #include "mac_upr_inf_api.h"
 
 /* Funtion pointer options for slot indication */
@@ -55,6 +54,15 @@ RlcMacUlDataFunc rlcMacSendUlDataOpts[] =
    packRlcUlData
 };
 
+/* Funtion pointer options for schedule result reporting */
+RlcMacSchedResultRptFunc rlcMacSchedResultRptOpts[] =
+{
+   packRlcSchedResultRpt,
+   RlcProcSchedResultRpt,
+   packRlcSchedResultRpt
+};
+        
+
 /*******************************************************************
  *
  * @brief Send slot indication to MAC
@@ -137,11 +145,31 @@ uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t MacSendUlDataToRlc(Pst *pst, RlcMacData *ulData)
+uint8_t MacSendUlDataToRlc(Pst *pst, RlcData *ulData)
 {
    return (*rlcMacSendUlDataOpts[pst->selector])(pst, ulData);
 }
 
+/*******************************************************************
+ *
+ * @brief Send Schedule result report to RLC
+ *
+ * @details
+ *
+ *    Function : MacSendSchedResultRptToRlc
+ *
+ *    Functionality: Send Schedule result report to RLC
+ *
+ * @params[in] Post structure
+ *             Schedule result report
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSendSchedResultRptToRlc(Pst *pst, RlcSchedResultRpt *schedRpt)
+{
+   return (*rlcMacSchedResultRptOpts[pst->selector])(pst, schedRpt);
+}
 
 /**********************************************************************
   End of file
index 7bda9d4..bc7216c 100644 (file)
@@ -22,7 +22,8 @@
 uint8_t MacDuAppSlotInd(Pst *pst, SlotIndInfo *slotInfo);
 uint8_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId);
 uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
-uint8_t MacSendUlDataToRlc(Pst *pst, RlcMacData *ulData);
+uint8_t MacSendUlDataToRlc(Pst *pst, RlcData *ulData);
+uint8_t MacSendSchedResultRptToRlc(Pst *pst, RlcSchedResultRpt *schedRpt);
 
 /**********************************************************************
          End of file
index 8607227..00af807 100644 (file)
@@ -24,3 +24,40 @@ uint32_t shortBsrBytesTable[MAX_SHORT_BSR_TABLE_ENTRIES] = { 0, 10, 14, 20, 28,
    38, 53, 74, 102, 142, 198, 276, 384, 535, 745, 1038, 1446, 2014, 2806, 3909, \
    5446, 7587, 10570, 14726, 20516, 28581, 39818, 55474, 77284, 107669, 150000, \
    150001 };
+
+/*******************************************************************
+ *
+ * @brief Allocates a crnti for new UE 
+ *
+ * @details
+ *
+ *    Function : getNewCrnti
+ *
+ *    Functionality: Allocates a crnti for new UE
+ *
+ * @params[in] CRNTI bit map
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t getNewCrnti(uint8_t *crntiMap)
+{
+   uint8_t bitIdx = 0;  /* bit position */
+   uint8_t mask = 1;    /* bit mask */
+   uint16_t newCrnti;   /* new crnti */
+
+   while(bitIdx < 8)
+   {
+      /* Find the first unset bit in crntiMap and allocate
+       * this as new crnti */
+      if((*crntiMap & (mask << bitIdx)) == 0)
+      {
+         newCrnti = ODU_START_CRNTI + bitIdx;
+        SET_ONE_BIT(bitIdx, *crntiMap);
+        return newCrnti;
+      }
+      else
+         bitIdx++;
+   }
+   return -1;
+}
index 620faab..c35bbeb 100644 (file)
    pst.intfVer   = 0;                                  \
 }
 
+/* Function declaration */
+uint16_t getNewCrnti(uint8_t *crntiMap);
+
 /**********************************************************************
          End of file
 **********************************************************************/
index 6fded63..a1da997 100755 (executable)
@@ -56,6 +56,7 @@ registered with SSI during the LTE MAC Task initialization.
 #include "rg_prg.x"        /*PRG interface includes*/
 #include "du_app_mac_inf.h"
 #include "rg.x"            /* typedefs for MAC */
+#include "rlc_mac_inf.h"
 
 /**
  * @brief Task Activation callback function Entity SM. 
@@ -220,11 +221,11 @@ Buffer  *mBuf;                      /* message buffer       */
       case EVTRGUUBNDREQ:
          cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
          break;
-      case EVTRLCDLDAT:
-         unpackDlData(MacRlcProcDlData, pst, mBuf);
+      case EVENT_DL_DATA_TO_MAC:
+         unpackRlcDlData(MacProcRlcDlData, pst, mBuf);
          break;
-      case EVTRLCBOSTA:
-         unpackBOStatus(MacRlcProcBOStatus, pst, mBuf);
+      case EVENT_BO_STATUS_TO_MAC:
+         unpackRlcBoStatus(MacProcRlcBoStatus, pst, mBuf);
          break;
 #ifdef LTE_L2_MEAS
 
index cec067c..87419c3 100755 (executable)
@@ -99,7 +99,7 @@ PRIVATE CONSTANT LrgCfgCfm RgMiLrgCfgCfmMt[RG_MAX_LRG_USR] =
 #ifdef SM 
    SmMiLrgCfgCfm,                  /* 1 - Tightly coupled SM */
 #else
-   PtMiLrgCfgCfm,                  /* 1 - Tightly coupled SM  */
+   //PtMiLrgCfgCfm,                  /* 1 - Tightly coupled SM  */
 #endif
 };
 
@@ -114,7 +114,7 @@ PRIVATE CONSTANT LrgSchCfgCfm RgMiLrgSchCfgCfmMt[RG_MAX_LRG_USR] =
 #ifdef SM 
    SmMiLrgSchCfgCfm,                  /* 1 - Tightly coupled SM */
 #else
-   PtMiLrgSchCfgCfm,                  /* 1 - Tightly coupled SM  */
+   //PtMiLrgSchCfgCfm,                  /* 1 - Tightly coupled SM  */
 #endif
 };
 
index 24a449e..aad4709 100755 (executable)
@@ -325,7 +325,7 @@ PRIVATE CONSTANT RguCDatInd RgUiRguCDatIndMt[RG_MAX_RGU_USR] =
    PtUiRguCDatInd,
 #endif
 #ifdef KW
-   RlcLiRguCDatInd,
+   //RlcProcCommLcUlData,
 #else
    PtUiRguCDatInd,
 #endif
@@ -346,7 +346,7 @@ PRIVATE CONSTANT RguDDatInd RgUiRguDDatIndMt[RG_MAX_RGU_USR] =
    PtUiRguDDatInd,
 #endif
 #ifdef KW
-   RlcLiRguDDatInd,
+   //RlcProcDedLcUlData,
 #else
    PtUiRguDDatInd,
 #endif
index 227e97f..32adab2 100755 (executable)
@@ -618,20 +618,20 @@ EXTERN RlcCb *rlcCb[MAX_RLC_INSTANCES];   /*!< RLC global control block */
 /****************************************************************************
  *                      EXTERN Declarations
  ***************************************************************************/
-EXTERN S16 rlcGetSId ARGS((SystemId *s));
+S16 rlcGetSId ARGS((SystemId *s));
 
-EXTERN Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
+Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
 
-EXTERN S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
+S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
 
-EXTERN Void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
+void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
 
-EXTERN Void rlcStopTmr  ARGS((RlcCb *gCb, PTR cb, U8 tmrType));
+void rlcStopTmr  ARGS((RlcCb *gCb, PTR cb, U8 tmrType));
 
-EXTERN Bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
+bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
 
 #ifdef LTE_L2_MEAS
-EXTERN Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
+Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
                                    U16 category, 
                                    U16 event, 
                                    U16 cause, 
@@ -639,17 +639,17 @@ EXTERN Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
                                    U32 ueId, 
                                    U8 qci));
 
-EXTERN S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
-EXTERN S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,U8 measType));
-EXTERN S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,U8 measType));
-EXTERN S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
-EXTERN S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,U8 measType));
-EXTERN S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,U8 measType));
-EXTERN Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData, 
+S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
+S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,U8 measType));
+S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,U8 measType));
+S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
+S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,U8 measType));
+S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,U8 measType));
+Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData, 
                                          RlcL2MeasRbCb *rbL2Cb,
                                          U8 measType));
 #else /* LTE_L2_MEAS */
-EXTERN Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
+Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
                                   U16 category, 
                                   U16 event, 
                                   U16 cause, 
index 33f9f21..29d612d 100755 (executable)
@@ -135,9 +135,9 @@ PRIVATE Void  rlcAssembleSdus ARGS ((RlcCb *gCb,
                                     RlcDlRbCb *rbCb, 
                                     RlcDatReq *rlcDatReq));
 
-PRIVATE Bool rlcAmmDlCheckAndSetPoll ARGS ((RlcCb *gCb,
+bool rlcAmmDlCheckAndSetPoll ARGS ((RlcCb *gCb,
                                            RlcDlRbCb *rbCb, 
-                                           Bool newPdu, 
+                                           bool newPdu, 
                                            MsgLen bufSz));
 
 PRIVATE Void rlcAmmCreatePdu ARGS ((RlcCb *gCb,
@@ -251,28 +251,17 @@ KwuDatCfmInfo   **datCfm
  * 
  * @return  Void
 */
-#ifdef ANSI
-Void rlcAmmSendDStaRsp
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcAmDl     *amDl
-)
-#else
-Void rlcAmmSendDStaRsp(gCb, rbCb, amDl)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcAmDl     *amDl;
-#endif
+void rlcAmmSendDedLcBoStatus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl)
 {
-   S32 bo = rlcAmmCalculateBo(amDl);
+   int32_t bo = rlcAmmCalculateBo(amDl);
 
    if(bo)
    {
-      rlcUtlSndDStaRsp(gCb, rbCb, bo, amDl->estHdrSz, amDl->cntrlBo ?TRUE:FALSE,amDl->cntrlBo);
+      rlcUtlSendDedLcBoStatus(gCb, rbCb, bo, amDl->estHdrSz, \
+         amDl->cntrlBo ?TRUE:FALSE,amDl->cntrlBo);
    }
    
-   RETVOID;
+   return;
 }
 
 /**
@@ -1001,7 +990,7 @@ RlcUdxStaPdu   *pStaPdu;
       canged inside the above called functions */
    if (oldRetxBo != AMDL.retxBo)
    {
-      rlcAmmSendDStaRsp(gCb, rbCb, &AMDL);
+      rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
    }
 
    RETVOID;
@@ -1083,31 +1072,16 @@ U32 kwRxSdu;
  * @return Void
  *      -# RETVOID
 */
-#ifdef ANSI
-Void rlcAmmQSdu
-(
-RlcCb            *gCb,
-RlcDlRbCb        *rbCb,
-Buffer          *mBuf,
-KwuDatReqInfo   *datReq
-)
-#else
-Void rlcAmmQSdu(gCb, rbCb, mBuf, datReq)
-RlcCb            *gCb;
-RlcDlRbCb        *rbCb;
-Buffer          *mBuf;
-KwuDatReqInfo   *datReq;
-#endif
+void rlcAmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, KwuDatReqInfo *datReq)
 {
    RlcSdu       *sdu;
 #ifdef LTE_L2_MEAS
 #ifndef L2_L3_SPLIT
 #ifdef TENB_STATS
-   U32         rlcWinSz; 
+   uint32_t         rlcWinSz; 
 #endif
 #endif
 #endif
-   TRC2(rlcAmmQSdu)
 
    /* Allocate sdu */
    RLC_ALLOC_WC(gCb,sdu, sizeof(RlcSdu)); 
@@ -1115,11 +1089,9 @@ KwuDatReqInfo   *datReq;
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if (sdu == NULLP)
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-               "Memory allocation failed UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
-      RETVOID;
+      DU_LOG("\n RLC : rlcAmmQSdu : Memory allocation failed UEID:%d CELLID:%d",\
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+      return;
    }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -1128,7 +1100,7 @@ KwuDatReqInfo   *datReq;
    rlcUtlGetCurrTime(&sdu->arrTime);
    /* Discard new changes ends */
    /* Assign values to sdu */
-   SFndLenMsg(mBuf, &sdu->sduSz);
+   ODU_GET_MSG_LEN(mBuf, &sdu->sduSz);
 
    sdu->mBuf = mBuf;
    sdu->actSz = sdu->sduSz;
@@ -1139,7 +1111,7 @@ KwuDatReqInfo   *datReq;
 #ifndef RGL_SPECIFIC_CHANGES
 #ifdef MSPD
 {
-extern U32 dlrate_kwu;
+extern uint32_t dlrate_kwu;
 dlrate_kwu += sdu->sduSz;
 }
 #endif
@@ -1148,11 +1120,8 @@ dlrate_kwu += sdu->sduSz;
     * queue */
    if (AMDL.nxtTx == NULLP)
    {
-      RLOG_ARG2(L_UNUSED,DBG_RBID, rbCb->rlcId.rbId,
-               "rlcAmmQSdu: Received SDU will be transmitted next"
-               "UEID:%d CELLID:%d",
-                rbCb->rlcId.ueId,
-                rbCb->rlcId.cellId);
+      DU_LOG("\nRLC : rlcAmmQSdu: Received SDU will be transmitted next \
+         UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
       AMDL.nxtTx = sdu;
    }
 
@@ -1199,10 +1168,10 @@ dlrate_kwu += sdu->sduSz;
 
    if(!rlcDlUtlIsReestInProgress(rbCb))
    {
-      rlcAmmSendDStaRsp(gCb, rbCb, &AMDL);
+      rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
    }
 
-   RETVOID;
+   return;
 } 
 
 /**
@@ -1221,25 +1190,11 @@ dlrate_kwu += sdu->sduSz;
  *  @return Void 
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmDlAssembleCntrlInfo 
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcDatReq   *rlcDatReq
-)
-#else
-PRIVATE Void rlcAmmDlAssembleCntrlInfo(gCb, rbCb, rlcDatReq)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcDatReq   *rlcDatReq;
-#endif
+void rlcAmmDlAssembleCntrlInfo(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq)
 {
    RlcUdxDlSapCb   *sapCb;
    MsgLen         macHdrEstmt;
 
-   TRC2(rlcAmmDlAssembleCntrlInfo)
-
    macHdrEstmt = (rbCb->m.amDl.cntrlBo < 256) ?
                   RLC_MAC_HDR_SZ2 : RLC_MAC_HDR_SZ3;
    /* Eliminate fixed hdr size (14bits including ACK_SN) */
@@ -1255,7 +1210,7 @@ RlcDatReq   *rlcDatReq;
       rlcAmmCreateStatusPdu(gCb,rbCb,rlcDatReq);
 
       sapCb = RLC_GET_DL_SAPCB(gCb, rbCb);
-          rlcDlUdxStaProhTmrStart(&(gCb->u.dlCb->udxDlSap->pst), 
+      rlcDlUdxStaProhTmrStart(&(gCb->u.dlCb->udxDlSap->pst), 
                              sapCb->suId, &(rbCb->rlcId));
          
       /* Update number of pdus in pduInfo */
@@ -1273,7 +1228,7 @@ RlcDatReq   *rlcDatReq;
       gRlcStats.amRlcStats.numDLStaPduSent++;
    }
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -1303,25 +1258,8 @@ RlcDatReq   *rlcDatReq;
  * @return Void
  *
  */
-#ifdef ANSI
-Void rlcAmmProcessSdus
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcDatReq   *rlcDatReq,
-Bool       fillCtrlPdu
-)
-#else
-Void rlcAmmProcessSdus(gCb, rbCb, rlcDatReq,fillCtrlPdu)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcDatReq   *rlcDatReq;
-Bool       fillCtrlPdu;
-#endif    
+void rlcAmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq, bool fillCtrlPdu)
 {
-   TRC2(rlcAmmProcessSdus)
-
-
    /* Assemble control information. fillCtrlPdu parameter check is added for CA
     * It is used to force cntrl Pdu scheduling on PCell. for Non CA case this
     * flag will always be TRUE. In CA case, for PCELL it is TRUE and for SCEll
@@ -1342,10 +1280,8 @@ Bool       fillCtrlPdu;
       }
       else
       {
-         RLOG_ARG2(L_ERROR, DBG_RBID, rbCb->rlcId.rbId,
-                  "Miscomputation of control Bo. UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcAmmProcessSdus: Miscomputation of control Bo. \
+           UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
       }
       AMDL.cntrlBo = 0;
    }   
@@ -1381,7 +1317,7 @@ Bool       fillCtrlPdu;
    {
       gRlcStats.amRlcStats.numDLBytesUnused += rlcDatReq->pduSz;
    }
-   RETVOID;
+   return;
 } 
 
 /**
@@ -1402,28 +1338,11 @@ Bool       fillCtrlPdu;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcSplitPdu
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcRetx     *crnt,
-RlcRetx     *next,
-U16        size
-)
-#else
-PRIVATE Void rlcSplitPdu(gCb, rbCb, crnt, next, size)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcRetx     *crnt;
-RlcRetx     *next;
-U16        size;
-#endif
+void rlcSplitPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcRetx *crnt, RlcRetx *next, uint16_t size)
 {
-   U8            si;
+   uint8_t        si;
    RlcAmDl        *amDl = &AMDL;
 
-   TRC2(rlcSplitPdu)
    /* Set the SN for the new segment */
    next->amHdr.sn = crnt->amHdr.sn;
 
@@ -1459,7 +1378,7 @@ U16        size;
    next->sduMap.sduSz = next->segSz;
 
    /* Segment the payload into two parts based on the size passed */
-   SSegMsg(crnt->seg, size, &next->seg);
+   ODU_SEGMENT_MSG(crnt->seg, size, &next->seg);
    next->retxCnt     = crnt->retxCnt;
    next->yetToConst  = TRUE;
    next->pendingReTrans    = crnt->pendingReTrans;
@@ -1496,7 +1415,7 @@ U16        size;
    AMDL.nxtRetx = next;
    amDl->estHdrSz += next->hdrSz;
    
-   RETVOID;
+   return;
 }
 
 /**
@@ -1524,36 +1443,21 @@ U16        size;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcResegRetxPdus 
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcDatReq   *rlcDatReq
-)
-#else
-PRIVATE Void rlcResegRetxPdus(gCb, rbCb, rlcDatReq)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcDatReq   *rlcDatReq;
-#endif
+void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq)
 {
    RlcAmDl   *amDl;
    RlcRetx   *retx;
-   U8       hdr[RLC_MAX_HDRSZ];
-   U16      idx; 
+   uint8_t   hdr[RLC_MAX_HDRSZ];
+   uint16_t  idx; 
    Buffer   *pdu;
    MsgLen   pduSz; 
 #ifdef LTE_L2_MEAS
-   U16        sduIdx;
+   uint16_     sduIdx;
    RlcL2MeasTb *l2MeasTb;
    RlclchInfo  *lchInfo;
-   U8         numSdus;
+   uint8_t     numSdus;
 #endif
 
-   TRC2(rlcResegRetxPdus)
-
-
    amDl  = &AMDL;
 #ifdef LTE_L2_MEAS
    /* TODO : This shoould be taken care in new Trasmissions */
@@ -1561,14 +1465,14 @@ RlcDatReq   *rlcDatReq;
    l2MeasTb = rlcUtlGetCurMeasTb(gCb, rbCb);
    if (l2MeasTb == NULLP)
    {
-      RETVOID;
+      return;
    }
    /* TODO : This lcid needs to be searched in case of normal Tx */
    /* In retx here, its fine as this will be higher priority */
    lchInfo = &l2MeasTb->lchInfo[l2MeasTb->numLchInfo];
    if (l2MeasTb->numLchInfo >= RLC_MAX_ACTV_DRB)
    {
-      RETVOID;
+      return;
    }
    l2MeasTb->numLchInfo++;
    lchInfo->lcId = rbCb->lch.lChId;
@@ -1578,7 +1482,7 @@ RlcDatReq   *rlcDatReq;
    while ((rlcDatReq->pduSz > 0) && (amDl->nxtRetx != NULLP)&&
           (rlcDatReq->pduInfo.numPdu < RLC_MAX_PDU))
    {
-      U16 tmpSz;
+      uint16_t tmpSz;
       
       retx = amDl->nxtRetx;
       /* kw003.201 : Add header size to seg size to determine if the      */
@@ -1592,27 +1496,24 @@ RlcDatReq   *rlcDatReq;
       /* kw003.201 - We should have at least one more than basic header */
       if (rlcDatReq->pduSz <= retx->hdrSz)
       {
-         RETVOID;
+         return;
       }
       rlcGetNxtRetx(gCb, &(amDl->nxtRetx));
 
       /* Send retx buf without segmentation */
       if (rlcDatReq->pduSz >= pduSz)
       {
-         U8 pollBit;
+         uint8_t pollBit;
          
-         RLOG_ARG2(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                  "rlcResegRetxPdus: Send retx buf without segmentation "
-                  "UEID:%d CELLID:%d", 
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcResegRetxPdus: Send retx buf without segmentation "
+            "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
          if (retx->yetToConst)
          {
             /* Construct hdr with the available hdr values */ 
             rlcConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx);
             /* Add header to the pdu/segment */
-            SAddPreMsgMultInOrder(hdr, idx + 1, retx->seg);
+            ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx + 1, retx->seg);
             retx->yetToConst = FALSE;
          } 
 
@@ -1645,10 +1546,8 @@ RlcDatReq   *rlcDatReq;
          
          /* Segment this pdu / portion of pdu. Insert this segment into */
          /* retxLst and update offset                                   */
-         RLOG_ARG2(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                  "rlcResegRetxPdus: Segment retx buf UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcResegRetxPdus: Segment retx buf UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
          /* Eliminate fixed header size if the pdu is segmented for the */
          /* first time                                                  */
@@ -1676,7 +1575,7 @@ RlcDatReq   *rlcDatReq;
          }
          if (rlcDatReq->pduSz <= 0)
          {
-            RETVOID;
+            return;
          }
 
          /* Allocate memory for tracking a new segment */
@@ -1684,11 +1583,9 @@ RlcDatReq   *rlcDatReq;
 #if (ERRCLASS & ERRCLS_ADD_RES)
          if (tNode == NULLP)
          {
-            RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-                     "Memory allocation failed UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
-            RETVOID;
+            DU_LOG("\nRLC: rlcResegRetxPdus: Memory allocation failed UEID:%d CELLID:%d",
+               rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+            return;
          }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -1722,7 +1619,7 @@ RlcDatReq   *rlcDatReq;
 #endif
          /* Construct hdr with the available hdr values */
          rlcConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx);
-         SAddPreMsgMultInOrder(hdr, idx + 1, retx->seg);
+         ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx + 1, retx->seg);
 
          retx->hdrSz = idx + 1;
 
@@ -1746,22 +1643,14 @@ RlcDatReq   *rlcDatReq;
       amDl->retxBo -= retx->segSz;
    }
 #ifndef ALIGN_64BIT
-   RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                 "rlcResegRetxPdus: retxBo after resegmentation = %ld"
-                 "UEID:%d CELLID:%d", 
-                 amDl->retxBo,
-                 rbCb->rlcId.ueId,
-                 rbCb->rlcId.cellId);
+   DU_LOG("\nRLC: rlcResegRetxPdus: retxBo after resegmentation = %ld"
+      "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 #else
-   RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                 "rlcResegRetxPdus: retxBo after resegmentation = %d "
-                 "UEID:%d CELLID:%d", 
-                 amDl->retxBo,
-                 rbCb->rlcId.ueId,
-                 rbCb->rlcId.cellId);
+   DU_LOG("\nRLC: rlcResegRetxPdus: retxBo after resegmentation = %d "
+      "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 #endif
 
-   RETVOID;
+   return;
 }
 
 
@@ -1785,61 +1674,46 @@ RlcDatReq   *rlcDatReq;
  * @return  Void 
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAssembleSdus 
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcDatReq   *rlcDatReq
-)
-#else
-PRIVATE Void rlcAssembleSdus (gCb, rbCb, rlcDatReq)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcDatReq   *rlcDatReq;
-#endif
+void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq)
 {
    Buffer          *pdu         = NULLP;
    MsgLen          macGrntSz    = rlcDatReq->pduSz;
    RlcAmDl          *amDl        = &AMDL;
    RlcSdu           *sdu         = amDl->nxtTx;
    RlcSduMap        sduMap;
-   Bool            nxtTxUpd     = FALSE;
+   bool            nxtTxUpd     = FALSE;
    KwuDiscSduInfo  *discSduInfo = NULLP;
    RlcKwuSapCb* rlckwuSap = gCb->u.dlCb->rlcKwuDlSap + RLC_UI_PDCP;
 #ifdef LTE_L2_MEAS
    RlcContSduLst     contSduLst;  /*Contained sduLst */
-   S32              dataVol    = amDl->bo;
-   U32              *totMacGrant = &rlcDatReq->totMacGrant;
+   int32_t           dataVol    = amDl->bo;
+   uint32_t          *totMacGrant = &rlcDatReq->totMacGrant;
    RlcL2MeasDlIpTh   *dlIpThPut = &rbCb->l2MeasIpThruput.dlIpTh;
-   U8               *sduIdx    = &dlIpThPut->lastSduIdx;
-   Bool             newIdx;
-   Bool             isSduSegmented;
-   S32              oldBo;
+   uint8_t           *sduIdx    = &dlIpThPut->lastSduIdx;
+   bool             newIdx;
+   bool             isSduSegmented;
+   int32_t          oldBo;
    RlclchInfo        lchInfo;
    RlclchInfo        *dstLchInfo;
-   U32              segSduCnt = 0;
-   U32              lchIdx;
-   U32              numSdus = 0;
-   U32              currSduIdx = 0;
+   uint32_t          segSduCnt = 0;
+   uint32_t          lchIdx;
+   uint32_t          numSdus = 0;
+   uint32_t          currSduIdx = 0;
    RlcL2MeasTb       *l2MeasTb;
 #endif
    /* Discard new changes starts */
    Ticks                timeDiff = 0;
    Ticks                curTime  = 0;
-   U8                   numNewPdu = 0;
+   uint8_t              numNewPdu = 0;
    RlcTx                 *txBuf = NULLP;
    /* Discard new changes ends */
-   VOLATILE U32         startTime = 0;
-   U32                  hdrEstmt;
-   U32                  fixedHdrSz;
-   U32                  pduSz;
+   VOLATILE uint32_t    startTime = 0;
+   uint32_t             hdrEstmt;
+   uint32_t             fixedHdrSz;
+   uint32_t             pduSz;
    RlcAmHdr              *amHdr = NULLP;
    RlcDlPduInfo          *pduInfo = NULLP;
 
-   TRC2(rlcAssembleSdus)
-
-
 #ifdef LTE_L2_MEAS   
    contSduLst.numSdus = 0; 
    contSduLst.lcId = rbCb->lch.lChId;
@@ -1857,11 +1731,9 @@ RlcDatReq   *rlcDatReq;
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if (discSduInfo == NULLP)
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, 
-               "Memory allocation failed UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
-      RETVOID;
+      DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d",
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+      return;
    }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -1912,11 +1784,8 @@ RlcDatReq   *rlcDatReq;
             /* store the info for sending it to PDCP */
             if(discSduInfo->numSduIds > 500)
             {
-               RLOG_ARG2(L_ERROR,DBG_RBID, rbCb->rlcId.rbId, 
-                     "This is a big error, we shouldn't be here"
-                     "UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
+               DU_LOG("\nRLC: rlcAssembleSdus: This is a big error, we shouldn't be here"
+                  "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
                break;
             }
 
@@ -1938,7 +1807,7 @@ RlcDatReq   *rlcDatReq;
                sdu = NULLP;
 
             /*stopping Task*/
-            SStopTask(startTime, PID_RLC_AMM_DISC_SDUS);
+            ODU_STOP_TASK(startTime, PID_RLC_AMM_DISC_SDUS);
             continue;
          }
       }
@@ -1992,13 +1861,11 @@ RlcDatReq   *rlcDatReq;
 #if (ERRCLASS & ERRCLS_ADD_RES)
          if (txBuf == NULLP)
          {
-            U32 avblMem = 0;
+            uint32_t avblMem = 0;
             SRegInfoShow(gCb->init.region, &avblMem);
-            RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, 
-                  "Memory allocation failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
-            RETVOID;
+            DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d",
+               rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+            return;
          }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -2013,13 +1880,11 @@ RlcDatReq   *rlcDatReq;
 #if (ERRCLASS & ERRCLS_ADD_RES)
       if (pduInfo == NULLP)
       {
-         U32 avblMem = 0;
+         uint32_t avblMem = 0;
          SRegInfoShow(gCb->init.region, &avblMem);
-         RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, 
-               "Memory allocation failed UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
-         RETVOID;
+         DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+         return;
       }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -2138,7 +2003,7 @@ RlcDatReq   *rlcDatReq;
 #endif
 
          /* Segment the SDU to the size of the PDU and update header Info */
-         SSegMsg(sdu->mBuf, macGrntSz, &remSeg);
+         ODU_SEGMENT_MSG(sdu->mBuf, macGrntSz, &remSeg);
          pdu = sdu->mBuf;      
          sdu->mBuf = remSeg;
 
@@ -2268,21 +2133,10 @@ RlcDatReq   *rlcDatReq;
    }
 
 
-#ifndef ALIGN_64BIT
-   RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-         "rlcAssembleSdus: BO after assembly = %ld UEID:%d CELLID:%d",
-         amDl->bo,
-         rbCb->rlcId.ueId,
-         rbCb->rlcId.cellId);
-#else
-   RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
-         "rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d",
-         amDl->bo,
-         rbCb->rlcId.ueId,
-         rbCb->rlcId.cellId);
-#endif
+   DU_LOG("\nRLC: rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d",
+      amDl->bo, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -2308,28 +2162,11 @@ RlcDatReq   *rlcDatReq;
  *      -# 0 - Poll bit is not set
  *
  */
-#ifdef ANSI
-PRIVATE Bool rlcAmmDlCheckAndSetPoll
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-Bool       newPdu,
-MsgLen     bufSz
-)
-#else
-PRIVATE Bool rlcAmmDlCheckAndSetPoll(gCb, rbCb, newPdu, bufSz)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-Bool       newPdu;
-MsgLen     bufSz;
-#endif
+bool rlcAmmDlCheckAndSetPoll(RlcCb *gCb, RlcDlRbCb *rbCb, bool newPdu, MsgLen bufSz)
 { 
-   Bool     pollBit = FALSE;
+   bool     pollBit = FALSE;
    RlcAmDl   *amDl = &(rbCb->m.amDl);
 
-   TRC2(rlcAmmDlCheckAndSetPoll)
-
    /* If it's a new PDU increment PDU without poll and bytes without poll
     and check if they cross the configured number of poll pdu and poll bytes*/ 
    if (newPdu)
@@ -2359,11 +2196,8 @@ MsgLen     bufSz;
 
       amDl->pollSn = (amDl->txNext - 1) & amDl->snModMask;
 
-      RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-                "rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", 
-                amDl->pollSn,
-                rbCb->rlcId.ueId,
-                rbCb->rlcId.cellId);
+      DU_LOG("\nRLC: rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", 
+         amDl->pollSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
       /* kw005.201: Fix for poll retransmission timer. 
        * Timer is stopped if it is already running and 
@@ -2397,33 +2231,15 @@ MsgLen     bufSz;
  *  @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmCreatePdu
-(  
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcAmHdr    *amHdr,
-RlcDlPduInfo *pduInfo,
-Buffer     *pdu
-)
-#else
-PRIVATE Void rlcAmmCreatePdu(gCb, rbCb, pduInfo, amHdr, pdu)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcAmHdr    *amHdr;
-RlcDlPduInfo *pduInfo;
-Buffer     *pdu;
-#endif
+void rlcAmmCreatePdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmHdr *amHdr,
+RlcDlPduInfo *pduInfo, Buffer *pdu)
 {
-   U8       hdr[RLC_MAX_HDRSZ];
-   U16      idx;
+   uint8_t   hdr[RLC_MAX_HDRSZ];
+   uint16_t  idx;
    RlcTx     *txBuf;
-   MsgLen   pduSz;
+   MsgLen    pduSz;
    RlcAmDl   *amDl = &(rbCb->m.amDl);
 
-   TRC2(rlcAmmCreatePdu)
-
-
    /* Update sn */
    amHdr->sn = amDl->txNext;
 
@@ -2436,7 +2252,7 @@ Buffer     *pdu;
    }
 
    /* Update hdr Info */
-   SFndLenMsg(pdu, &pduSz);
+   ODU_GET_MSG_LEN(pdu, &pduSz);
 
    /* passing newPDU = TRUE*/
    amHdr->p = rlcAmmDlCheckAndSetPoll(gCb,rbCb, TRUE, pduSz);
@@ -2445,7 +2261,7 @@ Buffer     *pdu;
    rlcConstructAmHdr(amHdr, hdr, amDl->snLen, &idx);
 
    /* Concatenate hdr and data */
-   SAddPreMsgMultInOrder(hdr, idx+1, pdu);
+   ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx+1, pdu);
    
    txBuf = rlcUtlGetTxBuf(amDl->txBufLst, amHdr->sn);
    rlcCpyMsg(gCb,pdu,&(pduInfo->pdu));
@@ -2465,7 +2281,7 @@ Buffer     *pdu;
 
    gCb->genSts.bytesSent += pduSz;
    
-   RETVOID;
+   return;
 }
 
 /**
@@ -2575,7 +2391,7 @@ RlcRetx        *retx;
             rbCb->m.amDl.cntrlBo = 0;
             rbCb->m.amDl.retxBo = 0;
             /* Sending BO update to SCH */
-            rlcUtlSndDStaRsp(gCb, rbCb, 0,0,0,0);
+            rlcUtlSendDedLcBoStatus(gCb, rbCb, 0,0,0,0);
             rlcAmmSndStaInd(gCb, rbCb, retx);
             gRlcStats.amRlcStats.numDLMaxRetx++;
          }
@@ -2824,22 +2640,10 @@ RlcRetx     *retx;
  *  @return  Void 
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcGetNxtRetx 
-(
-RlcCb     *gCb,
-RlcRetx   **retx
-)
-#else
-PRIVATE Void rlcGetNxtRetx(gCb, retx)
-RlcCb     *gCb;
-RlcRetx   **retx;
-#endif
+void rlcGetNxtRetx(RlcCb *gCb, RlcRetx **retx)
 {
    CmLList *tNode;
 
-   TRC2(rlcGetNxtRetx);
-
    do
    {
       tNode = &((*retx)->lstEnt);
@@ -2856,7 +2660,7 @@ RlcRetx   **retx;
       }
    }while((*retx)->pendingReTrans == FALSE);
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -3074,7 +2878,7 @@ RlcDlRbCb   *rbCb;
             AMDL.nxtRetx = retx;
          }
          
-         rlcAmmSendDStaRsp(gCb, rbCb, &AMDL);         
+         rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);         
          RETVOID;
       }
       /* Get the last node in retxLst */
@@ -3084,7 +2888,7 @@ RlcDlRbCb   *rbCb;
       if (retx != NULLP)
       {
          rlcAmmDlMarkPduForReTx(gCb, rbCb, retx);
-         rlcAmmSendDStaRsp(gCb, rbCb, &AMDL);         
+         rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);         
       }
    }
 
@@ -3275,24 +3079,8 @@ KwuDatCfmInfo   **datCfm;
  * @return Void            
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcConstructAmHdr
-(
-RlcAmHdr   *amHdr,
-U8        *hdr,
-U8         snLen,
-U16       *idx
-)
-#else
-PRIVATE Void rlcConstructAmHdr(amHdr, hdr, snLen, idx)
-RlcAmHdr   *amHdr;
-U8        *hdr;
-U8         snLen;
-U16       *idx;
-#endif
+void rlcConstructAmHdr(RlcAmHdr *amHdr, uint8_t *hdr, uint8_t snLen, uint16_t *idx)
 {
-   TRC2(rlcConstructAmHdr);
-                                                            
    *idx = 0;
     hdr[0] = RLC_DATA_BITMASK;
     
@@ -3321,7 +3109,7 @@ U16       *idx;
       hdr[(*idx)] = (U8)(amHdr->so & 0xFF);
    }                                                        
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -3519,34 +3307,19 @@ RlcDlRbCb   *rbCb;
  * @return Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmCreateStatusPdu
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,
-RlcDatReq   *rlcDatReq
-)
-#else
-PRIVATE Void rlcAmmCreateStatusPdu(gCb, rbCb, rlcDatReq)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;
-RlcDatReq   *rlcDatReq;
-#endif
+void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq)
 {
     RlcSn          sn;                      /* sequence number */
     RlcSn          ack_sn;                  /* Ack sequence number */
     Buffer        *mBuf;           /* control pdu buffer */
     MsgLen        cntrlPduSz;          /* control pdu size */
-    U8            cntrlPdu[RLC_MAX_CNTRL_FIELDS];   /* control pdu to be added to mBuf */
+    uint8_t       cntrlPdu[RLC_MAX_CNTRL_FIELDS];   /* control pdu to be added to mBuf */
     RlcUdxDlStaPdu   *pStaPdu;
-    U16             bytesToEncode = 0; /* bytes required to encode the STATUS PDU */
-    U16             encIdx = 0;
-    U16             prevEncIdx = 0;
+    uint16_t         bytesToEncode = 0; /* bytes required to encode the STATUS PDU */
+    uint16_t         encIdx = 0;
+    uint16_t         prevEncIdx = 0;
     RlcNackInfo      *rlcNackInfo;
-    U16           nkCnt = 0;
-
-    TRC2(rlcAmmCreateStatusPdu)
-
+    uint16_t         nkCnt = 0;
 
     pStaPdu = AMDL.pStaPdu;
 
@@ -3668,12 +3441,8 @@ RlcDatReq   *rlcDatReq;
         /* set ACK SN */
        {
 
-          RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-                "rlcAssembleCntrlInfo: ACK PDU's SN = %d"
-                "UEID:%d CELLID:%d",
-                ack_sn,
-                rbCb->rlcId.ueId,
-                rbCb->rlcId.cellId);
+          DU_LOG("\nRLC: rlcAssembleCntrlInfo: ACK PDU's SN = %d"\
+             "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
           cntrlPdu[0] |= (ack_sn & 0xF00)>> 8; 
           cntrlPdu[1] =  (U8)ack_sn;
@@ -3790,13 +3559,8 @@ RlcDatReq   *rlcDatReq;
        /* set ACK SN */
        {
 
-          RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-                "rlcAssembleCntrlInfo: ACK PDU's SN = %d"
-                "UEID:%d CELLID:%d",
-                ack_sn,
-                rbCb->rlcId.ueId,
-                rbCb->rlcId.cellId);
-
+          DU_LOG("\nRLC: rlcAssembleCntrlInfo: ACK PDU's SN = %d"
+             "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId,rbCb->rlcId.cellId);
 
           cntrlPdu[0] |=  (ack_sn & 0x3C000) >> 14;
           cntrlPdu[1] =  (ack_sn & 0x3FC0) >> 6;
@@ -3807,11 +3571,9 @@ RlcDatReq   *rlcDatReq;
     else
     {
        /* ERROR Log */
-       RLOG_ARG3(L_ERROR,DBG_RBID,rbCb->rlcId.rbId, 
-             "rlcAssembleCntrlInfo:Conf SN LEN  %d  is INVALID !!!! UEID:%d CELLID:%d",
-             rbCb->m.amDl.snLen,
-             rbCb->rlcId.ueId,
-             rbCb->rlcId.cellId);
+       DU_LOG("\nRLC: rlcAssembleCntrlInfo:Conf SN LEN  %d  is INVALID !!!! \
+          UEID:%d CELLID:%d", rbCb->m.amDl.snLen, rbCb->rlcId.ueId,
+         rbCb->rlcId.cellId);
     }
 
 
@@ -3825,13 +3587,13 @@ RlcDatReq   *rlcDatReq;
 #endif
 
     cntrlPduSz = encIdx;
-    SAddPstMsgMult (cntrlPdu, cntrlPduSz, mBuf);
+    ODU_ADD_POST_MSG_MULT(cntrlPdu, cntrlPduSz, mBuf);
 
     rlcDatReq->pduSz -= cntrlPduSz;
     /* Add mBuf to AMDL.mBuf */
     AMDL.mBuf = mBuf;
  
-    RETVOID;
+    return;
 }
 
 #ifdef RLC_STA_PROC_IN_MAC/* RLC Status PDU Processing */
index 59c337c..570f70a 100755 (executable)
@@ -90,25 +90,25 @@ extern U32  isMemThreshReached(Region region);
 
 /* private function declarations */
 
-PRIVATE Void rlcAmmUlAssembleCntrlInfo ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
+void rlcAmmUlAssembleCntrlInfo ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
 
-PRIVATE S16 rlcAmmExtractHdr ARGS ((RlcCb *gCb,
+uint8_t rlcAmmExtractHdr ARGS ((RlcCb *gCb,
                                 RlcUlRbCb   *rbCb,
                                 Buffer *pdu,
                                 RlcAmHdr *amHdr,
-                                U8 *fByte));
+                                uint8_t *fByte));
 
-PRIVATE Bool rlcAmmUlPlacePduInRecBuf ARGS ((RlcCb *gCb,
-                                            Buffer *pdu,
-                                            RlcUlRbCb *rbCb,
-                                            RlcAmHdr *amHdr));
+bool rlcAmmUlPlacePduInRecBuf ARGS ((RlcCb *gCb,
+                                     Buffer *pdu,
+                                     RlcUlRbCb *rbCb,
+                                     RlcAmHdr *amHdr));
 
-PRIVATE Void rlcAmmTriggerStatus ARGS ((RlcCb *gCb,
-                                    RlcUlRbCb *rbCb,
-                                    RlcSn sn,
-                                    Bool discFlg));
+void rlcAmmTriggerStatus ARGS ((RlcCb *gCb,
+                                RlcUlRbCb *rbCb,
+                                RlcSn sn,
+                                bool discFlg));
 
-PRIVATE S16  rlcAmmUlReassembleSdus ARGS ((RlcCb *gCb,
+uint8_t  rlcAmmUlReassembleSdus ARGS ((RlcCb *gCb,
                                      RlcUlRbCb *rbCb,
                                      RlcAmRecBuf *recBuf));
 
@@ -159,125 +159,104 @@ PRIVATE Void rlcAmmUlHndlStatusPdu ARGS ((RlcCb *gCb,
  *    The number of bytes required to encode this NACK information
  *
  */
-#ifdef ANSI
-PRIVATE S16 rlcAmmUlSetNackInfo
-(
-RlcUlRbCb      *rbCb,
-RlcSn          sn,
-Bool          isSegment,
-U16           soStart,
-U16           soEnd,
-RlcUdxDlStaPdu *statusPdu,
-RlcSn          *prevNackSn
-)
-#else
-PRIVATE S16 rlcAmmUlSetNackInfo(rbCb, sn, isSegment, soStart, statusPdu, prevNackSn)
-RlcUlRbCb      *rbCb;
-RlcSn          sn;
-Bool          isSegment;
-U16           soStart;
-U16           soEnd;
-RlcUdxDlStaPdu *statusPdu,
-RlcSn          *prevNackSn;
-#endif
+uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \
+   uint16_t soStart, uint16_t soEnd, RlcUdxDlStaPdu *statusPdu, RlcSn *prevNackSn)
 {
    RlcNackInfo   *nackInfo = (statusPdu->nackInfo + statusPdu->nackCount);
-   S16           sizeToBeEncd = 0; /* Status PDu size to be encoded */
-
-   TRC2(rlcAmmUlSetNackInfo)
-
-      /* In following cases we should increment the nackCnt & fill new NACK_SN info:
-       *    1) First NACK_SN of the statusdPdu
-       *    2) NACK_SN is not continuous with previous
-       *    3) NACK_SN is same as previuos but segments are not continuous
-       *    4) NACK_SN is continuous with previous but previous NACK_SN segments
-       *       are not missing in sequence till end
-       */
-      if((*prevNackSn == 0xffffffff) || ((((*prevNackSn) + 1) & AMUL.snModMask) != sn) ||
-            (((*prevNackSn) == sn) && (((nackInfo->soEnd + 1) != soStart))) ||
-            ((nackInfo->isSegment) && (((*prevNackSn) + 1) == sn) && (nackInfo->soEnd != RLC_ALL_BYTES_MISSING)))
+   uint16_t       sizeToBeEncd = 0; /* Status PDu size to be encoded */
+
+   /* In following cases we should increment the nackCnt & fill new NACK_SN info:
+    *    1) First NACK_SN of the statusdPdu
+    *    2) NACK_SN is not continuous with previous
+    *    3) NACK_SN is same as previuos but segments are not continuous
+    *    4) NACK_SN is continuous with previous but previous NACK_SN segments
+    *       are not missing in sequence till end
+    */
+   if((*prevNackSn == 0xffffffff) || ((((*prevNackSn) + 1) & AMUL.snModMask) != sn) ||
+        (((*prevNackSn) == sn) && (((nackInfo->soEnd + 1) != soStart))) ||
+        ((nackInfo->isSegment) && (((*prevNackSn) + 1) == sn) && (nackInfo->soEnd != RLC_ALL_BYTES_MISSING)))
+   {
+      if(nackInfo->nackRange)
       {
-         if(nackInfo->nackRange)
-         {
-            if((nackInfo->soEnd) && (!nackInfo->soStart))
-            {
-               /*First nack_sn of this nackRange not segmented but last is segmented */
-               sizeToBeEncd = 5; /*32 for soStart and soEnd and 8 for nackRange */ 
-            }
-            else
-            {
-               /*First nack_sn of this nackRange was segmented */
-               sizeToBeEncd = 1; /*8 for nackRange */ 
-            }
-         }
+        if((nackInfo->soEnd) && (!nackInfo->soStart))
+        {
+           /*First nack_sn of this nackRange not segmented but last is segmented */
+           sizeToBeEncd = 5; /*32 for soStart and soEnd and 8 for nackRange */ 
+        }
+        else
+        {
+           /*First nack_sn of this nackRange was segmented */
+           sizeToBeEncd = 1; /*8 for nackRange */ 
+        }
+      }
 
-         if(*prevNackSn != 0xffffffff)
-         {
-            /* Increment nackCount as this sn is continous */
-            statusPdu->nackCount++;
-            nackInfo = statusPdu->nackInfo + statusPdu->nackCount;
-         }
+      if(*prevNackSn != 0xffffffff)
+      {
+        /* Increment nackCount as this sn is continous */
+        statusPdu->nackCount++;
+        nackInfo = statusPdu->nackInfo + statusPdu->nackCount;
+      }
 
-         nackInfo->sn = sn;
-         nackInfo->isSegment = isSegment;
-         nackInfo->soStart = soStart;
-         nackInfo->soEnd   = soEnd;
-         nackInfo->nackRange = 0;
+      nackInfo->sn = sn;
+      nackInfo->isSegment = isSegment;
+      nackInfo->soStart = soStart;
+      nackInfo->soEnd   = soEnd;
+      nackInfo->nackRange = 0;
 
-         if(isSegment)
-         {
-            sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?6:7); /* NACK,E1,E2,Sostart,SoEnd */
-         }
-         else
-         {
-            sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?2:3); /* NACK,E1,E2 */
-         }
+      if(isSegment)
+      {
+        sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?6:7); /* NACK,E1,E2,Sostart,SoEnd */
       }
       else
       {
-         if(!(nackInfo->nackRange))
-         {
-            nackInfo->nackRange++;
-         }
-         /* This case means there are continuous SNs/Segments. If it is the next
-          * Sn then increment nackRnage. if same SN but different segment then
-          * dont increment nackRange */
-         if((((*prevNackSn) + 1) & AMUL.snModMask) == sn)
-         {
-            nackInfo->nackRange++;
-         }
-
-         /* If NackRange is reached to max value then increment statusPdu->nackCount*/
-         if(nackInfo->nackRange == 255)
-         {
-            statusPdu->nackCount++;
-            if(nackInfo->isSegment)
-            {
-               sizeToBeEncd = 1; /* return only nackRangeSize*/
-            }
-            else if (isSegment)
-            {
-               /* First SN was not segmented of this nackRange but last SN is segmented */
-               sizeToBeEncd = 5; /* return size of soSatrt + soEnd + nackRnage */
-            }
-         }
+        sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?2:3); /* NACK,E1,E2 */
+      }
+   }
+   else
+   {
+      if(!(nackInfo->nackRange))
+      {
+        nackInfo->nackRange++;
+      }
+      /* This case means there are continuous SNs/Segments. If it is the next
+       * Sn then increment nackRnage. if same SN but different segment then
+       * dont increment nackRange */
+      if((((*prevNackSn) + 1) & AMUL.snModMask) == sn)
+      {
+        nackInfo->nackRange++;
+      }
 
-         if(isSegment)
-         {
-            nackInfo->isSegment = isSegment;
-            nackInfo->soEnd = soEnd;
-         }
-         else if(nackInfo->isSegment)
-         {
-            nackInfo->soEnd = RLC_ALL_BYTES_MISSING;
-         }
-         else
-         {
-            nackInfo->soStart = 0;
-            nackInfo->soEnd =   0;
-         }
+      /* If NackRange is reached to max value then increment statusPdu->nackCount*/
+      if(nackInfo->nackRange == 255)
+      {
+        statusPdu->nackCount++;
+        if(nackInfo->isSegment)
+        {
+           sizeToBeEncd = 1; /* return only nackRangeSize*/
+        }
+        else if (isSegment)
+        {
+           /* First SN was not segmented of this nackRange but last SN is segmented */
+           sizeToBeEncd = 5; /* return size of soSatrt + soEnd + nackRnage */
+        }
+      }
 
+      if(isSegment)
+      {
+        nackInfo->isSegment = isSegment;
+        nackInfo->soEnd = soEnd;
       }
+      else if(nackInfo->isSegment)
+      {
+        nackInfo->soEnd = RLC_ALL_BYTES_MISSING;
+      }
+      else
+      {
+        nackInfo->soStart = 0;
+        nackInfo->soEnd =   0;
+      }
+
+   }
    *prevNackSn = sn;
 
    return (sizeToBeEncd);
@@ -299,17 +278,7 @@ RlcSn          *prevNackSn;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmUlAssembleCntrlInfo
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb
-)
-#else
-PRIVATE Void rlcAmmUlAssembleCntrlInfo(gCb, rbCb)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-#endif
+void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb)
 {
    RlcUdxDlStaPdu   *pStatusPdu;
    RlcNackInfo      *nackInfo;
@@ -317,18 +286,15 @@ RlcUlRbCb   *rbCb;
    RlcSn            mSn;               /* Mod val of sequence number */
    RlcSn            rxHighestStatus;              /* Mod val of rxHighestStatus */
    RlcSeg           *seg;              /* pdu segment */
-   U16             nackCnt = 0;       /* Index for staPdu */
-   U16             seqSo;             /* segmment offset */
+   uint16_t         nackCnt = 0;       /* Index for staPdu */
+   uint16_t         seqSo;             /* segmment offset */
    RlcUdxUlSapCb    *sapCb;
-   U16             staPduEncSize = 3; /* size that would be of the encoded
+   uint16_t         staPduEncSize = 3; /* size that would be of the encoded
                                           STATUS PDU, it is in bits; 15 for
                                           first fixed part of STATUS PDU */
    RlcAmRecBuf      *recBuf = NULLP;
    RlcSn            prevNackSn = 0xffffffff;
 
-   TRC2(rlcAmmUlAssembleCntrlInfo)
-
-
    sapCb = RLC_GET_UDX_SAP(gCb);
 
    RLC_ALLOC_SHRABL_BUF(sapCb->pst.region,
@@ -340,7 +306,7 @@ RlcUlRbCb   *rbCb;
    /* Memory allocation failure can not be expected  */
    if(!pStatusPdu)
    {
-     RETVOID;
+     return;
    }
 #endif
 
@@ -355,11 +321,8 @@ RlcUlRbCb   *rbCb;
       /* For missing PDUs */
       if ((NULLP  == recBuf) && nackCnt < RLC_MAX_NACK_CNT )
       {
-         RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                  "Missing PDU's SN = %d UEID:%d CELLID:%d", 
-                  sn,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing PDU's SN = %d UEID:%d \
+           CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          staPduEncSize += rlcAmmUlSetNackInfo(rbCb,
                                              sn,
                                              FALSE, /* isSegment */
@@ -389,18 +352,11 @@ RlcUlRbCb   *rbCb;
                                                    pStatusPdu,
                                                    &prevNackSn);
 
-               RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                             "Missing byte segment's" 
-                             " SN:%d UEID:%d CELLID:%d",
-                             sn,
-                             rbCb->rlcId.ueId,
-                             rbCb->rlcId.cellId);
-               RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                             "soStart and soEnd = %d, %d UEID:%d CELLID:%d",
-                             seqSo,
-                             seg->amHdr.so - 1,
-                             rbCb->rlcId.ueId,
-                             rbCb->rlcId.cellId);
+               DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing byte segment's" 
+                  " SN:%d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+               DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d \
+                  UEID:%d CELLID:%d", seqSo, seg->amHdr.so - 1, rbCb->rlcId.ueId,
+                   rbCb->rlcId.cellId);
             }
 
             seqSo = seg->soEnd + 1;
@@ -420,18 +376,12 @@ RlcUlRbCb   *rbCb;
                                                 pStatusPdu,
                                                 &prevNackSn);
 
-            RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                          "rlcAmmUlAssembleCntrlInfo: Missing (last) byte " 
-                          "segment's SN:%d UEID:%d CELLID:%d",
-                          sn,
-                          rbCb->rlcId.ueId,
-                          rbCb->rlcId.cellId);
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                          "soStart and soEnd = %d, %d UEID:%d CELLID:%d",
-                          seqSo,
-                          RLC_ALL_BYTES_MISSING,
-                          rbCb->rlcId.ueId,
-                          rbCb->rlcId.cellId);
+            DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing (last) byte " 
+               "segment's SN:%d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId,
+               rbCb->rlcId.cellId);
+            DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d\
+              UEID:%d CELLID:%d", seqSo, RLC_ALL_BYTES_MISSING, rbCb->rlcId.ueId,
+               rbCb->rlcId.cellId);
          }
       }
       
@@ -487,12 +437,9 @@ RlcUlRbCb   *rbCb;
       pStatusPdu->ackSn = sn;
    }
 
-   RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
-            "rlcAmmUlAssembleCntrlInfo: ACK PDU's SN = %d"
-            "UEID:%d CELLID:%d",
-            pStatusPdu->ackSn,
-            rbCb->rlcId.ueId,
-            rbCb->rlcId.cellId);
+    DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: ACK PDU's SN = %d"
+       "UEID:%d CELLID:%d", pStatusPdu->ackSn, rbCb->rlcId.ueId,
+       rbCb->rlcId.cellId);
 
    pStatusPdu->controlBo = staPduEncSize; /*Its already in bytes */
 
@@ -505,17 +452,15 @@ RlcUlRbCb   *rbCb;
                         &rbCb->rlcId,
                         pStatusPdu) != ROK)
    {
-      RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-               "Failed to Send Sta Pdu UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
+      DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Failed to Send Sta Pdu UEID:%d \
+         CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
       RLC_FREE_SHRABL_BUF_WC(sapCb->pst.region,
                            sapCb->pst.pool,
                            pStatusPdu, 
                            sizeof(RlcUdxDlStaPdu));
    }
 
-   RETVOID;
+   return;
 }
 
 #ifdef XEON_SPECIFIC_CHANGES
@@ -542,78 +487,41 @@ U32 drpRlcDrbPack;
  *
  */
 #ifdef LTE_L2_MEAS
-#ifdef ANSI
-Void rlcAmmProcessPdus
-(
-RlcCb                    *gCb,
-RlcUlRbCb                *rbCb,
-KwPduInfo               *pduInfo,
-U32                     ttiCnt
-)
-#else
-Void rlcAmmProcessPdus(gCb, rbCb, pduInfo, ulTimeInfo)
-RlcCb                    *gCb;
-RlcUlRbCb                *rbCb;
-KwPduInfo               *pduInfo;
-U32                     ttiCnt;
-#endif
-#else
-#ifdef ANSI
-Void rlcAmmProcessPdus
-(
-RlcCb        *gCb,
-RlcUlRbCb    *rbCb,
-KwPduInfo   *pduInfo
-)
+void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo, uint32_t ttiCnt)
 #else
-Void rlcAmmProcessPdus(gCb, rbCb, pduInfo)
-RlcCb        *gCb;
-RlcUlRbCb    *rbCb;
-KwPduInfo   *pduInfo;
-#endif
+void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo)
 #endif
 {
    Buffer    *pdu;
    RlcAmUl    *amUl;
    RlcAmHdr   amHdr;
-   U8        numPdu = 0;
-   U8        numPduToProcess;
+   uint8_t    numPdu = 0;
+   uint8_t    numPduToProcess;
    RlcSn      sn;
    RlcSn      tSn;
    RlcSn      mSn;
-   U8        fByte;
-   Bool      discFlg;
+   uint8_t    fByte;
+   bool      discFlg;
 #ifdef LTE_L2_MEAS_RLC
    MsgLen              rlcSduSz;  /*Holds length of Rlc Sdu*/
 #endif /* LTE_L2_MEAS */
 
-   TRC2(rlcAmmProcessPdus)
-
-
    amUl = &AMUL;
 
    numPduToProcess = RLC_MIN(pduInfo->numPdu, RGU_MAX_PDU);
-   RLOG_ARG4(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-            "numPdu[%ld],numPduToProcess[%ld] UEID:%ld CELLID:%ld",
-            numPdu,
-            numPduToProcess,
-            rbCb->rlcId.ueId,
-            rbCb->rlcId.cellId);
+   DU_LOG("\nRLC : rlcAmmProcessPdus: numPdu[%d],numPduToProcess[%d] UEID:%d CELLID:%d",
+            numPdu, numPduToProcess, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
-   //printf ("++++++++++++  5GNRLOG numPduToProcess %d \n", numPduToProcess);
    while (numPdu < numPduToProcess)
    {
-   //printf ("++++++++++++  5GNRLOG processing pdu  %d \n", numPdu);
       discFlg = FALSE;
       pdu = pduInfo->mBuf[numPdu++];
 
       if (! pdu)
       {
 
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "Null Pdu UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcAmmProcessPdus: Null Pdu UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          gCb->genSts.errorPdusRecv++;
          break;
       }
@@ -621,7 +529,7 @@ KwPduInfo   *pduInfo;
 #ifndef TENB_ACC
 #ifndef LTE_PAL_ENB
       MsgLen len;
-      SFndLenMsg(pdu, &len);
+      ODU_GET_MSG_LEN(pdu, &len);
       ulrate_rgu += len;
 #endif
 #endif
@@ -632,10 +540,8 @@ KwPduInfo   *pduInfo;
          a single pointer */
       if (rlcAmmExtractHdr(gCb, rbCb, pdu, &amHdr, &fByte) != ROK)
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "Header Extraction Failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcAmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          RLC_FREE_BUF(pdu);
          gCb->genSts.errorPdusRecv++;
          continue;
@@ -649,12 +555,9 @@ KwPduInfo   *pduInfo;
       }
       if((amHdr.si == RLC_SI_LAST_SEG) && (!amHdr.so))
       {
-         RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
-               "rlcAmmProcessPdus: Dropping PDU because SO can't be zero for last segment sn:%u "
-               "UEID:%d CELLID:%d",
-               amHdr.sn,
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcAmmProcessPdus: Dropping PDU because SO can't be zero\
+           for last segment sn:%u UEID:%d CELLID:%d", amHdr.sn, rbCb->rlcId.ueId,
+            rbCb->rlcId.cellId);
          RLC_FREE_BUF(pdu);
          continue;
       }
@@ -704,7 +607,7 @@ KwPduInfo   *pduInfo;
       if (rlcAmmUlPlacePduInRecBuf(gCb,pdu, rbCb, &amHdr) == TRUE)
       {
          RlcAmRecBuf      *recBuf;
-         Bool   tmrRunning;
+         bool   tmrRunning;
          RlcSn   tVrMr;
          RlcSn   mrxNextHighestRcvd;
 
@@ -719,11 +622,8 @@ KwPduInfo   *pduInfo;
          {
             amUl->rxNextHighestRcvd = ((sn + 1) & (amUl->snModMask)); 
 
-            RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
-                  "rlcAmmProcessPdus: Updated rxNextHighestRcvd = %d UEID:%d CELLID:%d",
-                  amUl->rxNextHighestRcvd,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+            DU_LOG("\nRLC: rlcAmmProcessPdus: Updated rxNextHighestRcvd = %d UEID:%d CELLID:%d",
+               amUl->rxNextHighestRcvd, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          }
          
          recBuf = rlcUtlGetRecBuf(amUl->recBufLst, sn);
@@ -816,11 +716,9 @@ KwPduInfo   *pduInfo;
                rlcStartTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR);
                amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd;
 
-               RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                        "rlcAmmProcessPdus: Updated rxNextStatusTrig = %d UEID:%d CELLID:%d",
-                        amUl->rxNextStatusTrig,
-                        rbCb->rlcId.ueId,
-                        rbCb->rlcId.cellId);
+               DU_LOG("\nRLC: rlcAmmProcessPdus: Updated rxNextStatusTrig = %d \
+                 UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId,
+                  rbCb->rlcId.cellId);
             }
          }
       }
@@ -845,7 +743,7 @@ KwPduInfo   *pduInfo;
       rlcAmmUlAssembleCntrlInfo(gCb,rbCb);
    }
 
-   RETVOID;
+   return;
 }
 
 
@@ -870,37 +768,18 @@ KwPduInfo   *pduInfo;
  *     -# RFAILED
  *
  */
-#ifdef ANSI
-PRIVATE S16 rlcAmmExtractHdr
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,
-Buffer     *pdu,
-RlcAmHdr    *amHdr,
-U8         *fByte
-)
-#else
-PRIVATE S16 rlcAmmExtractHdr(gCb, rbCb, pdu, amHdr, fByte)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-Buffer     *pdu;
-RlcAmHdr    *amHdr;
-U8         *fByte;
-#endif
+uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amHdr, uint8_t *fByte)
 {
-   U8         snByte;
-   RlcSn        sn = 0;
+   uint8_t    snByte;
+   RlcSn      sn = 0;
    MsgLen     pduSz;
-   RlcExtHdr   hdrInfo;
-
-   TRC2(rlcAmmExtractHdr)
-
+   RlcExtHdr  hdrInfo;
 
    RLC_MEM_ZERO(&hdrInfo, sizeof(RlcExtHdr));
 
    /* Extract fixed part of the header */
-   SFndLenMsg(pdu,&pduSz);
-   SRemPreMsg(fByte, pdu);
+   ODU_GET_MSG_LEN(pdu,&pduSz);
+   ODU_REM_PRE_MSG(fByte, pdu);
    amHdr->dc = (*fByte & RLC_DC_POS) >> RLC_DC_SHT;
    if (RLC_CNTRL_PDU == amHdr->dc)
    {
@@ -915,16 +794,16 @@ U8         *fByte;
    /* 12 BIT SN */
    if (rbCb->m.amUl.snLen == RLC_AM_CFG_12BIT_SN_LEN)
    {
-      SRemPreMsg(&snByte, pdu);
+      ODU_REM_PRE_MSG(&snByte, pdu);
       sn = (RlcSn)(((*fByte & RLC_SN_POS_12BIT) << RLC_BYTE_LEN ) | snByte);
       amHdr->sn = sn;
    }
    else if (rbCb->m.amUl.snLen == RLC_AM_CFG_18BIT_SN_LEN)
    {
-      SRemPreMsg(&snByte, pdu);
+      ODU_REM_PRE_MSG(&snByte, pdu);
       sn = (RlcSn)(((*fByte & RLC_SN_POS_18BIT) << RLC_BYTE_LEN ) | snByte);
 
-      SRemPreMsg(&snByte, pdu);
+      ODU_REM_PRE_MSG(&snByte, pdu);
       sn = ((sn << RLC_BYTE_LEN) | snByte);
 
       amHdr->sn = sn;
@@ -937,7 +816,6 @@ U8         *fByte;
       pduSz -= 2;
    }
 
-   //printf ("++++++++++++ 5GNRLOG HDR extracted DATA : sn %d  \n", sn);
    return ROK;
 }
 
@@ -1088,34 +966,17 @@ U8         *fByte;
  *  @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmUlHndlStatusPdu
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,
-Buffer     *cntrlPdu,
-U8         *fByte
-)
-#else
-PRIVATE Void rlcAmmUlHndlStatusPdu(gCb, rbCb, cntrlPdu, fByte)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-Buffer     *cntrlPdu;
-U8         *fByte;
-#endif
+void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_t *fByte)
 {
-   U8             e1;
-   RlcExtHdr       hdrInfo;
-   RlcUdxStaPdu    *pStaPdu;
-   RlcUdxUlSapCb   *sapCb;
-   U8             e3; /* NACK RANGE : 5GNR */
-   U32            snLen;
-   U32            snRange;
-   U32            resrvdBitsAckSn=0;
-   U32            resrvdBitsNackSn=0;
-
-   TRC2(rlcAmmUlHndlStatusPdu)
-
+   uint8_t          e1;
+   RlcExtHdr        hdrInfo;
+   RlcUdxStaPdu     *pStaPdu;
+   RlcUdxUlSapCb    *sapCb;
+   uint8_t          e3; /* NACK RANGE : 5GNR */
+   uint32_t         snLen;
+   uint32_t         snRange;
+   uint32_t         resrvdBitsAckSn=0;
+   uint32_t         resrvdBitsNackSn=0;
 
    RLC_MEM_ZERO(&hdrInfo, sizeof(RlcExtHdr));
 
@@ -1126,12 +987,9 @@ U8         *fByte;
    /* D/C has been shifted in the calling function */
    if (hdrInfo.hdr & 0xE0)
    {
-      RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-               "Reserved value for CPT received UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
-
-      RETVOID;
+      DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: Reserved value for CPT received UEID:%d \
+         CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+      return;
    }
 
    sapCb = RLC_GET_UDX_SAP(gCb);
@@ -1145,7 +1003,7 @@ U8         *fByte;
    /* Memory allocation failure can not be expected  */
    if(!pStaPdu)
    {
-     RETVOID;
+     return;
    }
 #endif   
 
@@ -1182,11 +1040,8 @@ U8         *fByte;
    hdrInfo.len = RLC_E1_LEN;
    rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo);
    e1 = (U8)hdrInfo.val;
-   RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-            "rlcAmmUlHndlStatusPdu: ACK SN = %d UEID:%d CELLID:%d",
-            pStaPdu->ackSn,
-            rbCb->rlcId.ueId,
-            rbCb->rlcId.cellId);
+   DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: ACK SN = %d UEID:%d CELLID:%d",
+      pStaPdu->ackSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
    /* Extract the Reserved Bits after ACK SN field */
    hdrInfo.len = resrvdBitsAckSn;
@@ -1233,13 +1088,10 @@ U8         *fByte;
          rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo);
          pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd   = hdrInfo.val;
 
-         RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                       "rlcAmmUlHndlStatusPdu: soStart and soEnd = %d %d"
-                       "UEID:%d CELLID:%d",
-                       pStaPdu->nackInfo[pStaPdu->nackCnt].soStart,
-                       pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd,      
-                       rbCb->rlcId.ueId,
-                       rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: soStart and soEnd = %d %d"
+            "UEID:%d CELLID:%d", pStaPdu->nackInfo[pStaPdu->nackCnt].soStart,
+            pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd, rbCb->rlcId.ueId,
+            rbCb->rlcId.cellId);
       }                                                                
       else
       {
@@ -1276,7 +1128,7 @@ U8         *fByte;
    /* Parse & send Status PDU to RLC-DL */
    rlcUlUdxStaUpdReq(&(sapCb->pst), sapCb->spId, &rbCb->rlcId, pStaPdu);
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -1292,22 +1144,10 @@ U8         *fByte;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmUlRlsAllSegs
-(
-RlcCb         *gCb,
-RlcAmRecBuf   *recBuf
-)
-#else
-PRIVATE Void rlcAmmUlRlsAllSegs(gCb,recBuf)
-RlcCb         *gCb;
-RlcAmRecBuf   *recBuf;
-#endif
+void rlcAmmUlRlsAllSegs(RlcCb *gCb, RlcAmRecBuf *recBuf)
 {
    RlcSeg *seg;
 
-   TRC2(rlcAmmUlRlsAllSegs)
-
    RLC_LLIST_FIRST_SEG(recBuf->segLst, seg);
    while (seg != NULLP)
    {
@@ -1317,7 +1157,7 @@ RlcAmRecBuf   *recBuf;
       RLC_LLIST_FIRST_SEG(recBuf->segLst, seg);
    }
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -1340,31 +1180,13 @@ RlcAmRecBuf   *recBuf;
  *   -#TRUE  Successful insertion into the receiver buffer
  *   -#FALSE Possibly a duplicate segment
  */
-#ifdef ANSI
-PRIVATE Bool rlcAmmAddRcvdSeg
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,
-RlcAmHdr    *amHdr,
-Buffer     *pdu,
-U16        pduSz
-)
-#else
-PRIVATE Bool rlcAmmAddRcvdSeg(gCb, rbCb, amHdr, pdu, pduSz)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-RlcAmHdr    *amHdr;
-Buffer     *pdu;
-U16        pduSz;
-#endif
+bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, uint16_t pduSz)
 {
    RlcAmRecBuf   *recBuf = NULLP;
    RlcSeg        *seg;
    RlcSeg        *tseg;
-   U16          soEnd;       /* Holds the SoEnd of received segment */
-   U16          expSo = 0;   /* Expected SO */
-
-   TRC2(rlcAmmAddRcvdSeg)
+   uint16_t      soEnd;       /* Holds the SoEnd of received segment */
+   uint16_t      expSo = 0;   /* Expected SO */
 
    soEnd = amHdr->so + pduSz - 1;
    recBuf =  rlcUtlGetRecBuf(AMUL.recBufLst, amHdr->sn);
@@ -1375,13 +1197,11 @@ U16        pduSz;
 #if (ERRCLASS & ERRCLS_ADD_RES)
       if (recBuf == NULLP)
       {
-         RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-                  "Memory allocation failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC: rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
          RLC_FREE_BUF(pdu);
-         return (FALSE);
+         return FALSE;
       }
 #endif /* ERRCLASS & ERRCLS_RES */
       rlcUtlStoreRecBuf(AMUL.recBufLst, recBuf, amHdr->sn);
@@ -1391,7 +1211,7 @@ U16        pduSz;
       if (recBuf->allRcvd == TRUE)
       {
          RLC_FREE_BUF(pdu);
-         return (FALSE);
+         return FALSE;
       }
    }
                        
@@ -1411,7 +1231,7 @@ U16        pduSz;
       /* This is a duplicate segment */
       gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
       RLC_FREE_BUF(pdu);
-      return (FALSE);
+      return FALSE;
    }
 
    if ((seg) && (seg->amHdr.so <= soEnd))
@@ -1419,7 +1239,7 @@ U16        pduSz;
       /* This is a duplicate segment */
       gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
       RLC_FREE_BUF(pdu);
-      return (FALSE);
+      return FALSE;
    }
 
    /* If we have come this far, we have to add this segment to the   */
@@ -1429,12 +1249,10 @@ U16        pduSz;
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if (tseg == NULLP)
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, 
-               "Memory allocation failed UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
+      DU_LOG("\nRLC: rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d",
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);
       RLC_FREE_BUF(pdu);
-      return (FALSE);
+      return FALSE;
    }
 #endif /* ERRCLASS & ERRCLS_RES */
 
@@ -1456,7 +1274,7 @@ U16        pduSz;
    tseg->lstEnt.node = (PTR)tseg;
    rlcAmmUpdExpByteSeg(gCb,&AMUL,tseg);
 
-   return (TRUE);
+   return TRUE;
 }
 
 /**
@@ -1477,29 +1295,12 @@ U16        pduSz;
  *     -# FALSE
  *
  */
-#ifdef ANSI
-PRIVATE Bool rlcAmmUlPlacePduInRecBuf
-(
-RlcCb       *gCb,
-Buffer     *pdu,
-RlcUlRbCb   *rbCb,
-RlcAmHdr    *amHdr
-)
-#else
-PRIVATE Bool rlcAmmUlPlacePduInRecBuf(gCb, pdu, rbCb, amHdr)
-RlcCb       *gCb;
-Buffer     *pdu;
-RlcUlRbCb   *rbCb;
-RlcAmHdr    *amHdr;
-#endif
+bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr *amHdr)
 {
    RlcSn     sn;
    MsgLen   pduSz;
    RlcAmUl   *amUl = &(rbCb->m.amUl);
 
-   TRC2(rlcAmmUlPlacePduInRecBuf)
-
-
    sn = amHdr->sn;
    SFndLenMsg(pdu, &pduSz);
 
@@ -1508,16 +1309,12 @@ RlcAmHdr    *amHdr;
    if (!RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(sn, amUl))
    {
       gRlcStats.amRlcStats.numRlcAmCellDropOutWinRx++;
-      RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
-                    "rlcAmmUlPlacePduInRecBuf: SN  %d outside the window"
-                    "UEID:%d CELLID:%d",
-                    sn,
-                    rbCb->rlcId.ueId,
-                    rbCb->rlcId.cellId);
+      DU_LOG("\nRLC: rlcAmmUlPlacePduInRecBuf: SN  %d outside the window"
+         "UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
       gCb->genSts.unexpPdusRecv++;
       RLC_FREE_BUF(pdu);
-      return (FALSE);
+      return FALSE;
    }
 
    if (amHdr->si == 0)
@@ -1533,12 +1330,10 @@ RlcAmHdr    *amHdr;
 #if (ERRCLASS & ERRCLS_ADD_RES)
          if (recBuf == NULLP)
          {
-            RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-                     "Memory allocation failed UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
+            DU_LOG("\nRLC: rlcAmmUlPlacePduInRecBuf: Memory allocation failed \
+              UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
             RLC_FREE_BUF(pdu);
-            return (FALSE);
+            return FALSE;
          }
 #endif /* ERRCLASS & ERRCLS_RES */
          rlcUtlStoreRecBuf(AMUL.recBufLst, recBuf, sn);
@@ -1552,7 +1347,7 @@ RlcAmHdr    *amHdr;
          gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
          gCb->genSts.unexpPdusRecv++;
          RLC_FREE_BUF(pdu);
-         return (FALSE);
+         return FALSE;
       }
       recBuf->isDelvUpperLayer = FALSE;
       recBuf->pdu = pdu;
@@ -1560,7 +1355,7 @@ RlcAmHdr    *amHdr;
       recBuf->allRcvd = TRUE;
       gRlcStats.amRlcStats.numRlcAmCellSduRx++;
       RLC_MEM_CPY(&recBuf->amHdr, amHdr, sizeof(RlcAmHdr));
-      return (TRUE);
+      return TRUE;
    }
    else
    {
@@ -1593,31 +1388,14 @@ RlcAmHdr    *amHdr;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmTriggerStatus
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,
-RlcSn       sn,
-Bool       discFlg
-)
-#else
-PRIVATE Void rlcAmmTriggerStatus(gCb,rbCb, sn, discFlg)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-RlcSn       sn;
-Bool       discFlg;
-#endif
+void rlcAmmTriggerStatus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg)
 {
-   Bool     tmrRunning;
+   bool     tmrRunning;
    RlcSn     tSn;
    RlcSn     tVrMr;
    RlcSn     trxHighestStatus;
    RlcAmUl   *amUl = &(rbCb->m.amUl);
 
-   TRC2(rlcAmmTriggerStatus)
-
-
    MODAMR(amUl->vrMr, tVrMr, amUl->rxNext, amUl->snModMask);
    MODAMR(amUl->rxHighestStatus, trxHighestStatus, amUl->rxNext, amUl->snModMask);
    MODAMR(sn , tSn, amUl->rxNext, amUl->snModMask);
@@ -1626,10 +1404,8 @@ Bool       discFlg;
     * The "=" in the 2nd condition is removed */
    if ((discFlg) || (tSn < trxHighestStatus) || (tSn >= tVrMr))
    {
-      RLOG_ARG2(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, 
-               "rlcAmmTriggerStatus: Set Status Trigger UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
+      DU_LOG("\nRLC: rlcAmmTriggerStatus: Set Status Trigger UEID:%d CELLID:%d",
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
       amUl->staTrg = TRUE;
       amUl->gatherStaPduInfo = FALSE;
@@ -1643,7 +1419,7 @@ Bool       discFlg;
       }
    }
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -1664,25 +1440,9 @@ Bool       discFlg;
  * @return  Void
  *
  */
-#ifdef ANSI
-PRIVATE Void rlcAmmProcPduOrSeg
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,
-RlcAmHdr    *amHdr,
-Buffer     *pdu
-)
-#else
-PRIVATE Void rlcAmmProcPduOrSeg(gCb, rbCb, amHdr, pdu)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;
-RlcAmHdr    *amHdr;
-Buffer     *pdu;
-#endif
+void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu)
 {
 
-   TRC2(rlcAmmProcPduOrSeg)
-
    if ((AMUL.expSn != amHdr->sn) || (AMUL.expSo != amHdr->so))
    {
       /* Release the existing partial SDU as we have PDUs or */
@@ -1703,23 +1463,23 @@ Buffer     *pdu;
    }
    else if(amHdr->si == 0x03)
    {/* Middle or last segment of the SUD */
-      SCatMsg(AMUL.partialSdu,pdu, M1M2);
+      ODU_CAT_MSG(AMUL.partialSdu,pdu, M1M2);
       RLC_FREE_BUF_WC(pdu);
       pdu = NULLP;
    }
    else if (amHdr->si ==  0x02)
    {
-      SCatMsg(pdu,AMUL.partialSdu,M2M1);
+      ODU_CAT_MSG(pdu,AMUL.partialSdu,M2M1);
       RLC_FREE_BUF_WC(AMUL.partialSdu);
    }
 
    if (pdu != NULLP)
    {
       AMUL.partialSdu = NULLP;
-      rlcUtlSndDatInd(gCb,rbCb, pdu);
+      rlcUtlSendUlDataToDu(gCb,rbCb, pdu);
    }
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -1742,23 +1502,10 @@ Buffer     *pdu;
  *      -# RFAILED
  *
  */
-#ifdef ANSI
-PRIVATE S16 rlcAmmUlReassembleSdus
-(
-RlcCb         *gCb,
-RlcUlRbCb     *rbCb,
-RlcAmRecBuf   *recBuf
-)
-#else
-PRIVATE S16 rlcAmmUlReassembleSdus(gCb, rbCb, recBuf)
-RlcCb         *gCb;
-RlcUlRbCb     *rbCb;
-RlcAmRecBuf   *recBuf;
-#endif
+uint8_t rlcAmmUlReassembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf)
 {
    RlcSeg        *seg;
 
-   TRC2(rlcAmmUlReassembleSdus)
    //if (recBuf->amHdr.rf == 0)
    if (recBuf->amHdr.si == 0)
    {
@@ -2034,37 +1781,23 @@ RlcUlRbCb    *rbCb;
  *
  */
 
-#ifdef ANSI
-PRIVATE Void rlcAmmExtractElmnt
-(
-RlcCb       *gCb,
-Buffer     *pdu,
-RlcExtHdr   *hdrInfo
-)
-#else
-PRIVATE Void rlcAmmExtractElmnt(gCb, pdu, hdrInfo)
-RlcCb       *gCb;
-Buffer     *pdu;
-RlcExtHdr   *hdrInfo;
-#endif
+void rlcAmmExtractElmnt(RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo)
 {
-   U8   hdr;
-   U8   pLen = hdrInfo->pLen;
-   U8   len  = (U8)hdrInfo->len;
-   U32  val;
-   U8   tHdr;
-   U8   fLen;
-   U8   rLen;
+   uint8_t   hdr;
+   uint8_t   pLen = hdrInfo->pLen;
+   uint8_t   len  = (U8)hdrInfo->len;
+   uint32_t  val;
+   uint8_t   tHdr;
+   uint8_t   fLen;
+   uint8_t   rLen;
    /* U8   rLen1 = 0; */
-   U16  tVal;
-
-   TRC2(rlcAmmExtractElmnt);
+   uint16_t  tVal;
 
    hdr = hdrInfo->hdr;
 
    if (pLen == 0)
    {
-      SRemPreMsg(&hdr, pdu);
+      ODU_REM_PRE_MSG(&hdr, pdu);
       pLen = 8;
    }
    tHdr = hdr;
@@ -2081,7 +1814,7 @@ RlcExtHdr   *hdrInfo;
       val = val >> (RLC_BYTE_LEN - fLen);
       val = val << (len - fLen);
       rLen = len - fLen;
-      SRemPreMsg(&hdr, pdu);
+      ODU_REM_PRE_MSG(&hdr, pdu);
       tHdr = hdr;
       if (rLen <= 8)
       {
@@ -2097,7 +1830,7 @@ RlcExtHdr   *hdrInfo;
         tVal = tVal << rLen;
         val = val | tVal;
 
-        SRemPreMsg(&hdr, pdu);
+        ODU_REM_PRE_MSG(&hdr, pdu);
         tHdr = hdr;
         hdr = hdr >> (RLC_BYTE_LEN - rLen);
         val = val | hdr;
@@ -2110,7 +1843,7 @@ RlcExtHdr   *hdrInfo;
    hdrInfo->hdr = hdr;
    hdrInfo->val = val;
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -2131,32 +1864,17 @@ RlcExtHdr   *hdrInfo;
  *
  */
 
-#ifdef ANSI
-PRIVATE Void rlcAmmUpdExpByteSeg
-(
-RlcCb     *gCb,
-RlcAmUl   *amUl,
-RlcSeg    *seg
-)
-#else
-PRIVATE Void rlcAmmUpdExpByteSeg(gCb, amUl, seg)
-RlcCb     *gCb;
-RlcAmUl   *amUl;
-RlcSeg    *seg;
-#endif
+void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg)
 {
-   U16    newExpSo; /* The new expected SO */
-   RlcSn   sn = seg->amHdr.sn;
-   Bool   lstRcvd=FALSE;
+   uint16_t  newExpSo; /* The new expected SO */
+   RlcSn     sn = seg->amHdr.sn;
+   bool      lstRcvd=FALSE;
    RlcAmRecBuf *recBuf = NULLP;
    
-   TRC2(rlcAmmUpdExpByteSeg);
-
-
    recBuf = rlcUtlGetRecBuf(amUl->recBufLst, sn);
    if ((recBuf == NULLP) || (recBuf && (seg->amHdr.so != recBuf->expSo)))
    {
-      RETVOID;
+      return;
    }
 
    newExpSo   = seg->soEnd + 1;
@@ -2186,7 +1904,7 @@ RlcSeg    *seg;
       else
       {
          recBuf->expSo = newExpSo;
-         RETVOID;
+         return;
       }
    }
    if (lstRcvd == TRUE)
@@ -2195,7 +1913,7 @@ RlcSeg    *seg;
       gRlcStats.amRlcStats.numRlcAmCellSduRx++;
    }
 
-   RETVOID;
+   return;
 }
 
 /**
index 373df48..f051b7c 100755 (executable)
@@ -224,22 +224,8 @@ RlcCb *gCb;
  *
  *  @return  Void
 */
-#ifdef ANSI
-Void rlcDbmFetchDlRbCbByRbId
-(
-RlcCb         *gCb,
-CmLteRlcId   *rlcId,
-RlcDlRbCb     **rbCb
-)
-#else
-Void rlcDbmFetchDlRbCbByRbId(gCb, rlcId, rbCb)
-RlcCb         *gCb;
-CmLteRlcId   *rlcId;
-RlcDlRbCb     **rbCb;
-#endif
+void rlcDbmFetchDlRbCbByRbId(RlcCb *gCb,CmLteRlcId *rlcId, RlcDlRbCb **rbCb)
 {
-   TRC3(rlcDbmFetchDlRbCbByRbId)
-
    *rbCb= NULLP;
    
    /* Check for UE CB or CELL CB */
@@ -249,22 +235,17 @@ RlcDlRbCb     **rbCb;
       
       if(rlcId->rbId >= RLC_MAX_RB_PER_CELL)
       {
-         RLOG_ARG3(L_ERROR,DBG_RBID,rlcId->rbId ,
-               "Invalid RbId, Max is [%d] UEID:%d CELLID:%d",
-               RLC_MAX_RB_PER_CELL,
-               rlcId->ueId,
-               rlcId->cellId);
-         RETVOID;
+         DU_LOG("\nRLC : rlcDbmFetchDlRbCbByRbId : Invalid RbId, Max is [%d] \
+           UEID:%d CELLID:%d", RLC_MAX_RB_PER_CELL, rlcId->ueId, rlcId->cellId);
+         return;
       }
 
       rlcDbmFetchDlCellCb(gCb,rlcId->cellId, &cellCb);
       if(!cellCb)
       {
-         RLOG_ARG2(L_ERROR,DBG_CELLID,rlcId->cellId,
-               "CellCb not found UEID:%d RBID:%d",
-               rlcId->ueId, 
-               rlcId->rbId);
-         RETVOID;
+         DU_LOG("\nRLC : rlcDbmFetchDlRbCbByRbId : CellCb[%d] not found UEID:%d \
+           RBID:%d", rlcId->cellId, rlcId->ueId, rlcId->rbId);
+         return;
       }
 
       *rbCb = cellCb->rbCb[rlcId->rbId];
@@ -274,27 +255,22 @@ RlcDlRbCb     **rbCb;
       RlcDlUeCb *ueCb;
       if (!(RLC_VALIDATE_UE_RBID(rlcId->rbType, rlcId->rbId)))
       {
-         RLOG_ARG3(L_ERROR,DBG_RBID, rlcId->rbId,
-               "Invalid RbId for RbType[%d] RBID:%d CELLID:%d",
-               rlcId->rbType,
-               rlcId->ueId,
-               rlcId->cellId);
-         RETVOID;
+         DU_LOG("\n rlcDbmFetchDlRbCbByRbId : Invalid RbId[%d] for RbType[%d] \
+           RBID:%d CELLID:%d", rlcId->rbId, rlcId->rbType, rlcId->ueId, rlcId->cellId);
+         return;
       }
       
       if (ROK != rlcDbmFetchDlUeCb(gCb,rlcId->ueId, rlcId->cellId, &ueCb))
       {
-         RLOG_ARG2(L_ERROR,DBG_CELLID, rlcId->cellId,
-               "UeId [%d]: UeCb not found RBID:%d",
-               rlcId->ueId,
-               rlcId->rbId);
-         RETVOID;
+         DU_LOG("\n rlcDbmFetchDlRbCbByRbId : UeId [%d]: UeCb not found RBID:%d",\
+            rlcId->ueId, rlcId->rbId);
+         return;
       }
 
       RLC_DBM_GET_RBCB_FROM_UECB(rlcId->rbId, rlcId->rbType, ueCb, *rbCb);
    }
 
-   RETVOID;
+   return;
 } /* rlcDbmFetchDlRbCbByRbId */
 
 \f
@@ -314,29 +290,11 @@ RlcDlRbCb     **rbCb;
  * @return  Void
  *
 */
-#ifdef ANSI
-Void rlcDbmFetchDlRbCbFromLchId
-(
-RlcCb          *gCb,
-CmLteRnti     ueId,  
-CmLteCellId   cellId,
-CmLteLcId     lcId,  
-RlcDlRbCb      **rbCb
-)
-#else
-Void rlcDbmFetchDlRbCbFromLchId(gCb, ueId, cellId, lcId, rbCb)
-RlcCb          *gCb;
-CmLteRnti     ueId;  
-CmLteCellId   cellId;
-CmLteLcId     lcId; 
-RlcDlRbCb      **rbCb; 
-#endif
+void rlcDbmFetchDlRbCbFromLchId(RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId, \
+CmLteLcId lcId, RlcDlRbCb **rbCb)
 {
    RlcDlUeCb *ueCb;
    
-   TRC3(rlcDbmFetchDlRbCbFromLchId)
-
-
    /* Check for UE CB or CELL CB */
    if (ueId == 0)
    {
@@ -345,23 +303,24 @@ RlcDlRbCb      **rbCb;
       rlcDbmFetchDlCellCb(gCb, cellId, &cellCb);
       if(!cellCb)
       {
-         RLOG_ARG1(L_ERROR,DBG_CELLID,cellId,"CellCb not found UEID:%d",ueId);
-         RETVOID;
+         DU_LOG("\nRLC: rlcDbmFetchDlRbCbFromLchId: CellCb[%d] not found UEID:%d", \
+           cellId, ueId);
+         return;
       }
 
       *rbCb = cellCb->lCh[lcId - 1].dlRbCb;
-      RETVOID;
+      return;
    }
 
    if (rlcDbmFetchDlUeCb(gCb, ueId, cellId, &ueCb) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID, cellId,"UeId [%d]: UeCb not found",ueId);
-      RETVOID;
+      DU_LOG("\nRLC: rlcDbmFetchDlRbCbFromLchId: UeId [%d]: UeCb not found",ueId);
+      return;
    }
 
    *rbCb = ueCb->lCh[lcId - 1].dlRbCb;
 
-   RETVOID;
+   return;
 } /* rlcDbmFetchDlRbCbFromLchId */
 
 \f
@@ -517,28 +476,10 @@ RlcDlUeCb      **ueCb;
  *    -# ROK 
  *    -# RFAILED 
 */
-#ifdef ANSI
-S16 rlcDbmFetchDlUeCb
-(
-RlcCb          *gCb,
-CmLteRnti     ueId, 
-CmLteCellId   cellId,
-RlcDlUeCb      **ueCb
-)
-#else
-S16 rlcDbmFetchDlUeCb(gCb,ueId, cellId, ueCb)
-RlcCb          *gCb;
-CmLteRnti     ueId;  
-CmLteCellId   cellId;
-RlcDlUeCb      **ueCb;
-#endif
+uint8_t rlcDbmFetchDlUeCb(RlcCb *gCb, CmLteRnti ueId, CmLteCellId  cellId, RlcDlUeCb **ueCb)
 {
-
-   TRC3(rlcDbmFetchDlUeCb)
-
-
    return (cmHashListFind(&(gCb->u.dlCb->ueLstCp), 
-                           (U8 *)&(ueId), 
+                           (uint8_t *)&(ueId), 
                            sizeof(CmLteRnti),
                            RLC_DEF_SEQ_NUM, 
                            (PTR *) ueCb));
@@ -751,23 +692,8 @@ RlcDlCellCb    **cellCb;
  *    -# RFAILED 
  *
 */
-#ifdef ANSI
-S16 rlcDbmFetchDlCellCb
-(
-RlcCb          *gCb,
-CmLteCellId   cellId, 
-RlcDlCellCb    **cellCb
-)
-#else
-S16 rlcDbmFetchDlCellCb(gCb,cellId, cellCb)
-RlcCb          *gCb;
-CmLteCellId   cellId;  
-RlcDlCellCb    **cellCb;
-#endif
+uint8_t rlcDbmFetchDlCellCb(RlcCb *gCb, CmLteCellId  cellId, RlcDlCellCb **cellCb)
 {
-   TRC3(rlcDbmFetchDlCellCb)
-
-
    *cellCb = NULLP;
    
    if(ROK != cmHashListFind(&(gCb->u.dlCb->cellLstCp), 
@@ -776,7 +702,7 @@ RlcDlCellCb    **cellCb;
                             RLC_DEF_SEQ_NUM, 
                             (PTR*) cellCb))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID, cellId,"CellCb not found");
+      DU_LOG("\nRLC : CellCb [%d] not found", cellId);
       return RFAILED;
    }
 
index cdd5f6b..6c0b1be 100755 (executable)
@@ -276,29 +276,11 @@ RlcUlRbCb     **rbCb;
  * @return  Void
  *
 */
-#ifdef ANSI
-Void rlcDbmFetchUlRbCbFromLchId
-(
-RlcCb          *gCb,
-CmLteRnti     ueId,      
-CmLteCellId   cellId,   
-CmLteLcId     lcId,    
-RlcUlRbCb      **rbCb  
-)
-#else
-Void rlcDbmFetchUlRbCbFromLchId(gCb, ueId, cellId, lcId, rbCb)
-RlcCb          *gCb;
-CmLteRnti     ueId;     
-CmLteCellId   cellId;  
-CmLteLcId     lcId;   
-RlcUlRbCb      **rbCb;
-#endif
+void rlcDbmFetchUlRbCbFromLchId(RlcCb *gCb, CmLteRnti ueId, CmLteCellId cellId,\
+   CmLteLcId lcId, RlcUlRbCb **rbCb)
 {
    RlcUlUeCb *ueCb;
 
-   TRC3(rlcDbmFetchUlRbCbFromLchId)
-
-
    *rbCb = NULLP;
    
    /* Check for UE CB or CELL CB */
@@ -309,23 +291,24 @@ RlcUlRbCb      **rbCb;
       rlcDbmFetchUlCellCb(gCb,cellId, &cellCb);
       if(!cellCb)
       {
-         RLOG_ARG1(L_ERROR,DBG_CELLID,cellId,"CellCb not found UEID:%d",ueId);
-         RETVOID;
+         DU_LOG("\nRLC : rlcDbmFetchUlRbCbFromLchId: CellCb[%d] not found UEID:%d",\
+           cellId, ueId);
+         return;
       }
 
       *rbCb = cellCb->lCh[lcId - 1].ulRbCb;
-      RETVOID;
+      return;
    }
    
    if (rlcDbmFetchUlUeCb(gCb,ueId, cellId, &ueCb) != ROK)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID, cellId,"UeId [%d]: UeCb not found",ueId);
-      RETVOID;
+      DU_LOG("\nRLC : rlcDbmFetchUlRbCbFromLchId: UeId [%d]: UeCb not found",ueId);
+      return;
    }
 
    *rbCb = ueCb->lCh[lcId - 1].ulRbCb;
 
-   RETVOID;
+   return;
 } /* kwDbmFetchRbCbFromLchId */
 
 \f
@@ -626,27 +609,10 @@ RlcCb *gCb;
  *    -# ROK 
  *    -# RFAILED 
 */
-#ifdef ANSI
-S16 rlcDbmFetchUlUeCb
-(
-RlcCb          *gCb,
-CmLteRnti     ueId,  
-CmLteCellId   cellId, 
-RlcUlUeCb      **ueCb   
-)
-#else
-S16 rlcDbmFetchUlUeCb(gCb,ueId, cellId, ueCb)
-RlcCb          *gCb;
-CmLteRnti     ueId;     
-CmLteCellId   cellId;    
-RlcUlUeCb      **ueCb;     
-#endif
+uint8_t rlcDbmFetchUlUeCb(RlcCb *gCb, CmLteRnti ueId, CmLteCellId  cellId, RlcUlUeCb **ueCb)
 {
-   TRC3(rlcDbmFetchUlUeCb)
-
-
    return (cmHashListFind(&(gCb->u.ulCb->ueLstCp), 
-                           (U8 *)&(ueId), sizeof(CmLteRnti),
+                           (uint8_t *)&(ueId), sizeof(CmLteRnti),
                            RLC_DEF_SEQ_NUM, 
                            (PTR *) ueCb));
 }
@@ -820,32 +786,17 @@ RlcUlCellCb    *cellCb;
  *    -# RFAILED 
  *
 */
-#ifdef ANSI
-Void rlcDbmFetchUlCellCb
-(
-RlcCb          *gCb,
-CmLteCellId   cellId,     
-RlcUlCellCb    **cellCb   
-)
-#else
-Void rlcDbmFetchUlCellCb(gCb, cellId, cellCb)
-RlcCb          *gCb;
-CmLteCellId   cellId;    
-RlcUlCellCb    **cellCb;  
-#endif
+void rlcDbmFetchUlCellCb(RlcCb *gCb, CmLteCellId cellId, RlcUlCellCb **cellCb)
 {
-   TRC3(rlcDbmFetchUlCellCb)
-
-
    *cellCb = NULLP;
    if(ROK != cmHashListFind(&(gCb->u.ulCb->cellLstCp), 
-                            (U8 *)&(cellId),sizeof(CmLteCellId), 
+                            (uint8_t *)&(cellId),sizeof(CmLteCellId), 
                             RLC_DEF_SEQ_NUM, (PTR*) cellCb))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID, cellId,"CellCb not found");
+      DU_LOG("\nRLC : rlcDbmFetchUlCellCb : CellCb[%d] not found", cellId);
    }
 
-   RETVOID;
+   return;
 }
 
 \f
index 00c2a13..759f918 100755 (executable)
@@ -540,43 +540,43 @@ struct rlcDlUeCb
 /****************************************************************************
  *                    Configuration Functions 
  ***************************************************************************/ 
-EXTERN S16 rlcCfgAddDlRb ARGS ((RlcCb *gCb, 
+S16 rlcCfgAddDlRb ARGS ((RlcCb *gCb, 
                               CmLteRnti ueId, 
                               CmLteCellId cellId, 
                               RlcEntCfgInfo *entCfg, 
                               RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgReCfgDlRb ARGS ((RlcCb *gCb, 
+S16 rlcCfgReCfgDlRb ARGS ((RlcCb *gCb, 
                                  CmLteRnti ueId, 
                                  CmLteCellId cellId, 
                                  RlcEntCfgInfo *entCfg, 
                                  RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgDelDlRb ARGS ((RlcCb *gCb, 
+S16 rlcCfgDelDlRb ARGS ((RlcCb *gCb, 
                                CmLteRnti ueId, 
                                CmLteCellId cellId, 
                                RlcEntCfgInfo *entCfg, 
                                RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgDelDlUe ARGS ((RlcCb *gCb, 
+S16 rlcCfgDelDlUe ARGS ((RlcCb *gCb, 
                                CmLteRnti ueId, 
                                CmLteCellId cellId, 
                                RlcEntCfgInfo *entCfg, 
                                RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgReEstDlRb ARGS ((RlcCb *gCb, 
+S16 rlcCfgReEstDlRb ARGS ((RlcCb *gCb, 
                                  CmLteRnti ueId, 
                                  CmLteCellId cellId, 
                                  Bool sndReEst,
                                  RlcEntCfgInfo *entCfg, 
                                  RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgDelDlCell ARGS ((RlcCb *gCb, 
+S16 rlcCfgDelDlCell ARGS ((RlcCb *gCb, 
                                  CmLteCellId cellId, 
                                  RlcEntCfgInfo *entCfg,
                                  RlcEntCfgCfmInfo *entCfm));
 
-EXTERN S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb, 
+S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb, 
                                   CkwUeInfo *ueInfo, 
                                   CkwUeInfo *newUeInfo, 
                                   CmStatus  *status));
@@ -584,226 +584,226 @@ EXTERN S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb,
 /****************************************************************************
  *                    DBM module Functions 
  ***************************************************************************/
-EXTERN S16 rlcDbmDlInit ARGS ((RlcCb *gCb));
+S16 rlcDbmDlInit ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcDbmDlDeInit ARGS ((RlcCb *gCb));
+Void rlcDbmDlDeInit ARGS ((RlcCb *gCb));
 
-EXTERN S16 rlcDbmCreateDlUeCb ARGS ((RlcCb *gCb,     
+S16 rlcDbmCreateDlUeCb ARGS ((RlcCb *gCb,     
                                     CmLteRnti ueId,   
                                     CmLteCellId cellId,
                                     RlcDlUeCb **ueCb));
 
-EXTERN S16 rlcDbmFetchDlUeCb ARGS ((RlcCb *gCb,        
+uint8_t rlcDbmFetchDlUeCb ARGS ((RlcCb *gCb,        
                                    CmLteRnti ueId,      
                                    CmLteCellId cellId,     
                                    RlcDlUeCb **ueCb));
 
-EXTERN Void rlcDbmDelDlUeCb ARGS ((RlcCb *gCb,       
+Void rlcDbmDelDlUeCb ARGS ((RlcCb *gCb,       
                                   RlcDlUeCb *ueCb, 
                                   Bool abortFlag));
 
-EXTERN Void rlcDbmDelAllDlUe ARGS ((RlcCb *gCb));
+Void rlcDbmDelAllDlUe ARGS ((RlcCb *gCb));
 
-EXTERN S16 rlcDbmCreateDlCellCb ARGS ((RlcCb *gCb,      
-                                      CmLteCellId cellId,   
-                                      RlcDlCellCb **cellCb));
+S16 rlcDbmCreateDlCellCb ARGS ((RlcCb *gCb,      
+                                    CmLteCellId cellId,   
+                                    RlcDlCellCb **cellCb));
 
-EXTERN S16 rlcDbmFetchDlCellCb ARGS ((RlcCb *gCb, 
+uint8_t rlcDbmFetchDlCellCb ARGS ((RlcCb *gCb, 
                                      CmLteCellId cellId, 
                                      RlcDlCellCb **cellCb));
 
-EXTERN Void rlcDbmDelDlCellCb ARGS ((RlcCb *gCb, RlcDlCellCb *cellCb));
+Void rlcDbmDelDlCellCb ARGS ((RlcCb *gCb, RlcDlCellCb *cellCb));
 
-EXTERN Void rlcDbmDelAllDlCell ARGS ((RlcCb *gCb));
+Void rlcDbmDelAllDlCell ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcDbmFetchDlRbCbByRbId ARGS ((RlcCb *gCb, 
+Void rlcDbmFetchDlRbCbByRbId ARGS ((RlcCb *gCb, 
                                           CmLteRlcId *rlcId, 
                                           RlcDlRbCb **rbCb));
 
-EXTERN Void rlcDbmFetchDlRbCbFromLchId ARGS ((RlcCb *gCb,       
+Void rlcDbmFetchDlRbCbFromLchId ARGS ((RlcCb *gCb,       
                                              CmLteRnti ueId,     
                                              CmLteCellId cellId,    
                                              CmLteLcId lcId,      
                                              RlcDlRbCb **rbCb));
 
-EXTERN Void rlcDbmDelAllDlRb ARGS ((RlcCb *gCb, RlcDlRbCb **rbCbLst, U8 numRbCb));
+Void rlcDbmDelAllDlRb ARGS ((RlcCb *gCb, RlcDlRbCb **rbCbLst, U8 numRbCb));
 
-EXTERN S16 rlcDbmDlShutdown ARGS ((RlcCb *gCb));
+S16 rlcDbmDlShutdown ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcUtlGetCurrTime ARGS((U32 *time));
-EXTERN Void rlcUtlTrigPdbFlowCntrl ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, U32 pktAdmitCnt ));
+Void rlcUtlGetCurrTime ARGS((U32 *time));
+Void rlcUtlTrigPdbFlowCntrl ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, U32 pktAdmitCnt ));
 #ifdef LTE_L2_MEAS
-EXTERN Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb));
+Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb));
 
 #endif
 
 /****************************************************************************
  *                    Transparent Mode Functions 
  ***************************************************************************/
-EXTERN Void rlcTmmQSdu ARGS ((RlcCb *gCb,
+Void rlcTmmQSdu ARGS ((RlcCb *gCb,
                             RlcDlRbCb *rbCb,
                             KwuDatReqInfo *datReqInfo,
                             Buffer *mBuf));
-EXTERN Void rlcTmmSndToLi ARGS ((RlcCb     *gCb,
+Void rlcTmmSendToMac ARGS ((RlcCb     *gCb,
                                 SuId     suId,
                                 RlcDlRbCb *rbCb, 
                                 RguCStaIndInfo *staInd));
 
-EXTERN Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
+Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
 
 /****************************************************************************
  *                    Unacknowledged Mode Functions 
  ***************************************************************************/
-EXTERN Void rlcUmmQSdu ARGS ((RlcCb *gCb, 
+Void rlcUmmQSdu ARGS ((RlcCb *gCb, 
                              RlcDlRbCb *rbCb,
                              KwuDatReqInfo *datReq, 
                              Buffer *mBuf));
 
-EXTERN Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, U32 sduId));
+Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, U32 sduId));
 
-EXTERN Void rlcDlUmmReEstablish ARGS ((RlcCb *gCb, 
+Void rlcDlUmmReEstablish ARGS ((RlcCb *gCb, 
                                       CmLteRlcId rlcId, 
                                       Bool sndReEst,
                                       RlcDlRbCb *rbCb));
 
-EXTERN Void rlcUmmProcessSdus ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb,RlcDatReq *datReq));
+Void rlcUmmProcessSdus ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb,RlcDatReq *datReq));
 
-EXTERN Void rlcUmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
+Void rlcUmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
 
 /****************************************************************************
  *                    Acknowledged Mode Functions 
  ***************************************************************************/
 
-EXTERN S32 rlcAmmCalculateBo ARGS ((RlcAmDl *amDl));
+S32 rlcAmmCalculateBo ARGS ((RlcAmDl *amDl));
 
-EXTERN Void rlcAmmSendDStaRsp ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl));
+Void rlcAmmSendDedLcBoStatus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl));
 
-EXTERN Void rlcAmmQSdu ARGS((RlcCb *gCb,
+Void rlcAmmQSdu ARGS((RlcCb *gCb,
                             RlcDlRbCb *rbCb,
                             Buffer *mBuf, 
                             KwuDatReqInfo *datReq));
 
-EXTERN Void rlcAmmProcessSdus ARGS((RlcCb *gCb, 
+void rlcAmmProcessSdus ARGS((RlcCb *gCb, 
                                    RlcDlRbCb *rbCb, 
                                    RlcDatReq *rlcDatReq,
-                                   Bool staPduPres));
+                                   bool staPduPres));
 
-EXTERN Void rlcAmmDlReEstablish ARGS((RlcCb *gCb, 
+Void rlcAmmDlReEstablish ARGS((RlcCb *gCb, 
                                      CmLteRlcId rlcId, 
                                      RlcDlRbCb *rbCb));
 
-EXTERN Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb  *gCb,
+Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb  *gCb,
                                         RlcDlRbCb  *rbCb,
                                         RlcUdxStaPdu *pStaPdu));
 
-EXTERN S16 rlcAmmDiscSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, U32 sduId));
+S16 rlcAmmDiscSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, U32 sduId));
 
-EXTERN Void rlcAmmPollRetxTmrExp ARGS((RlcCb *gCB, RlcDlRbCb *rbCb));
+Void rlcAmmPollRetxTmrExp ARGS((RlcCb *gCB, RlcDlRbCb *rbCb));
 
-EXTERN Void rlcAmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
+Void rlcAmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
 
 /****************************************************************************
  *                    Utility Functions 
  ***************************************************************************/
 
-EXTERN Void rlcUtlStoreTxBuf ARGS ((CmLListCp        *txBufLst,
+Void rlcUtlStoreTxBuf ARGS ((CmLListCp        *txBufLst,
                                     RlcTx       *txBuf,
                                     RlcSn              sn
                                    ));
-EXTERN RlcTx* rlcUtlGetTxBuf ARGS ((CmLListCp        *txBufLst,
+RlcTx* rlcUtlGetTxBuf ARGS ((CmLListCp        *txBufLst,
                                   RlcSn              sn
                                   ));
-EXTERN Void rlcUtlDelTxBuf ARGS ((CmLListCp        *txBufLst,
+Void rlcUtlDelTxBuf ARGS ((CmLListCp        *txBufLst,
                                   RlcTx            *txBuf,
                                   RlcCb              *gCb
                                   ));
-EXTERN Void rlcUtlRemovTxBuf ARGS ((CmLListCp      *txBufLst,
+Void rlcUtlRemovTxBuf ARGS ((CmLListCp      *txBufLst,
                                   RlcTx            *txBuf,
                                   RlcCb              *gCb
                                   ));
 
-EXTERN S16 rlcUtlSndDStaRsp ARGS ((RlcCb *gCb,
+uint8_t rlcUtlSendDedLcBoStatus ARGS ((RlcCb *gCb,
                                   RlcDlRbCb *rbCb,
-                                  S32 bo,
-                                  S32 estHdrSz,
-                                  Bool staPduPrsnt,
-                                  U32 staPduBo));
+                                  int32_t bo,
+                                  int32_t estHdrSz,
+                                  bool staPduPrsnt,
+                                  uint32_t staPduBo));
 
 #ifdef LTE_L2_MEAS_RLC
-EXTERN Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, CmLListCp *sduQ));
+Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, CmLListCp *sduQ));
 #else /* LTE_L2_MEAS */
-EXTERN Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb,CmLListCp *sduQ));
+Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb,CmLListCp *sduQ));
 #endif /* LTE_L2_MEAS */
 
-EXTERN Void rlcUtlCalcLiForSdu ARGS ((RlcCb *gCb,
+Void rlcUtlCalcLiForSdu ARGS ((RlcCb *gCb,
                                      U16 numLi, 
                                      MsgLen msgLen,
                                      S16 *pduSz));
 
-EXTERN S16 rlcUtlSndToLi ARGS ((RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo));
+uint8_t rlcUtlSendToMac ARGS ((RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo));
 
-EXTERN Void rlcUtlIncrementKwuStsSduTx ARGS((RlcKwuSapCb *rlckwuSap));
+Void rlcUtlIncrementKwuStsSduTx ARGS((RlcKwuSapCb *rlckwuSap));
 
-EXTERN Void rlcUtlIncrementGenStsBytesAndPdusSent ARGS((RlcGenSts *genSts, 
+Void rlcUtlIncrementGenStsBytesAndPdusSent ARGS((RlcGenSts *genSts, 
                                                        Buffer *pdu));
 
-EXTERN Void rlcUtlFreeDlMemory ARGS ((RlcCb *gCb));
+Void rlcUtlFreeDlMemory ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcUtlInitToBeFreed ARGS ((RlcCb *gCb, RlcDlDataToBeFreed *toBeFreed));
+Void rlcUtlInitToBeFreed ARGS ((RlcCb *gCb, RlcDlDataToBeFreed *toBeFreed));
 
-EXTERN Void rlcUtlInitializeSelfPst ARGS((RlcCb *gCb));
+Void rlcUtlInitializeSelfPst ARGS((RlcCb *gCb));
 
-EXTERN Void rlcUtlRaiseDlCleanupEvent ARGS((RlcCb *gCb));
+Void rlcUtlRaiseDlCleanupEvent ARGS((RlcCb *gCb));
 
-EXTERN Void rlcUtlAddSduToBeFreedQueue ARGS((RlcCb *gCb, RlcSdu *sdu));
+Void rlcUtlAddSduToBeFreedQueue ARGS((RlcCb *gCb, RlcSdu *sdu));
 
-EXTERN Void rlcUtlAddReTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcRetx *retx));
+Void rlcUtlAddReTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcRetx *retx));
 
-EXTERN Void rlcUtlAddTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcTx *pdu));
+Void rlcUtlAddTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcTx *pdu));
 
 #ifdef LTE_L2_MEAS
-EXTERN S16 rlcUtlL2MeasDlInit ARGS((RlcCb *gCb));
+S16 rlcUtlL2MeasDlInit ARGS((RlcCb *gCb));
 #endif
 
 /****************************************************************************
  *                    Debug Functions 
  ***************************************************************************/
-EXTERN Void ResetRLCStats ARGS((Void));
+Void ResetRLCStats ARGS((Void));
 
-EXTERN Void PrintRLCStats ARGS((Void));
+Void PrintRLCStats ARGS((Void));
 
-EXTERN Void DumpRLCDlDebugInformation ARGS((Void));
+Void DumpRLCDlDebugInformation ARGS((Void));
 
 /****************************************************************************
  *                    Activation Functions 
  ***************************************************************************/
-EXTERN S16 rlcDlActvInit ARGS ((Ent ent,Inst inst,Region region,Reason reason)); 
+S16 rlcDlActvInit ARGS ((Ent ent,Inst inst,Region region,Reason reason)); 
 
-EXTERN S16 rlcDlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
+S16 rlcDlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
 
-EXTERN Bool rlcDlUtlIsReestInProgress ARGS ((RlcDlRbCb *rbCb));
+bool rlcDlUtlIsReestInProgress ARGS ((RlcDlRbCb *rbCb));
 
-EXTERN Void rlcDlUtlResetReestInProgress ARGS ((RlcDlRbCb *rbCb));
+Void rlcDlUtlResetReestInProgress ARGS ((RlcDlRbCb *rbCb));
 
-EXTERN Void rlcDlUtlResetReestInProgress ARGS (( RlcDlRbCb *rbCb));
+Void rlcDlUtlResetReestInProgress ARGS (( RlcDlRbCb *rbCb));
 
-EXTERN Void rlcDlUtlSetReestInProgressForAllRBs ARGS ((RlcCb *gCb, RlcDlUeCb
+Void rlcDlUtlSetReestInProgressForAllRBs ARGS ((RlcCb *gCb, RlcDlUeCb
          *ueCb));
-EXTERN Void rlcDlUtlSetReestInProgressForRB ARGS (( RlcCb *gCb, RlcDlRbCb *rbCb));
+Void rlcDlUtlSetReestInProgressForRB ARGS (( RlcCb *gCb, RlcDlRbCb *rbCb));
 
 #ifdef LTE_L2_MEAS
-EXTERN Void rlcUtlUpdateContainedSduLst ARGS ((
+Void rlcUtlUpdateContainedSduLst ARGS ((
 U8  sduIdx, 
 RlcContSduLst  *contSduLst
 ));
-EXTERN Void rlcUtlUpdateOutStandingSduLst ARGS ((
+Void rlcUtlUpdateOutStandingSduLst ARGS ((
 RlcL2MeasDlIpTh   *dlIpThPut, 
 U8               sduIdx, 
 MsgLen           sduLen, 
 U32              sduId,
 Bool             newIdx
 ));
-EXTERN Void rlcUtlUpdateBurstSdus ARGS((
+Void rlcUtlUpdateBurstSdus ARGS((
 RlcCb            *gCb,         
 RlcDlRbCb        *rbCb,
 RlcContSduLst    *contSduLst,
@@ -811,38 +811,43 @@ S32             dataVol,
 U32             schPduSz
 ));
 
-EXTERN RlcL2MeasTb * rlcUtlGetCurMeasTb ARGS((
+RlcL2MeasTb * rlcUtlGetCurMeasTb ARGS((
 RlcCb     *gCb,
 RlcDlRbCb *rbCb
 ));
 
-EXTERN S16 rlcUtlSndDlL2MeasNCfm ARGS((RlcCb *gCb,
+S16 rlcUtlSndDlL2MeasNCfm ARGS((RlcCb *gCb,
                                       RlcL2MeasReqEvt *measReqEvt,
                                       RlcL2MeasCfmEvt *measCfmEvt));
 
-EXTERN S16 rlcUtlSndDlL2MeasCfm  ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
+S16 rlcUtlSndDlL2MeasCfm  ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
 
-EXTERN S16 rlcUtlProcHarqInd  ARGS (( RlcCb *gCb, RguHarqStatusInd *staInd, RlcDlUeCb *ueCb, 
+S16 rlcUtlProcHarqInd  ARGS (( RlcCb *gCb, RguHarqStatusInd *staInd, RlcDlUeCb *ueCb, 
                                      U8 tbIdx));
-EXTERN Void rlcUtlResetDlL2MeasInRlcRb ARGS ((RlcCb *gCb,
+Void rlcUtlResetDlL2MeasInRlcRb ARGS ((RlcCb *gCb,
                                             RlcL2MeasCb *measCb,
                                             U8 measType));
 
-EXTERN S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, U8  measType,U8  status));
+S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, U8  measType,U8  status));
 
-EXTERN S16 rlcUtlValidateIpThL2Meas ARGS((RlcL2MeasReqEvt *measReqEvt, 
+S16 rlcUtlValidateIpThL2Meas ARGS((RlcL2MeasReqEvt *measReqEvt, 
                                      RlcL2MeasCfmEvt *measCfmEvt)); 
                                     
-EXTERN S16 rlcFetchLchInfo ARGS ((RlcL2MeasReqEvt *measReqEvt,
+S16 rlcFetchLchInfo ARGS ((RlcL2MeasReqEvt *measReqEvt,
                                  RlcL2MeasCfmEvt *measCfmEvt,
                                  U16             ueId,
                                  CmLteLcId *lChId,
                                  U8 *numLch));
 
-EXTERN S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,U16 ueIdx, Bool enable,
+S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,U16 ueIdx, Bool enable,
                                     CmLteLcId  *lChId, U8 *numLCh));
 #endif
-EXTERN Void rlcUtlFreeDlMem ARGS(( Void));
+
+uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo* datReq, Buffer *buf);
+uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo  *staInd);
+uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo  *staInd);
+
+Void rlcUtlFreeDlMem ARGS(( Void));
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index ea4fc8f..26b0190 100755 (executable)
@@ -59,6 +59,7 @@ static int RLOG_FILE_ID=195;
 #include "kw_udx.x"
 #include "kw_dl.x"
 #include "du_app_rlc_inf.h"
+#include "rlc_mac_inf.h"
 
 #include "ctf.h"
 S16 rlcUtlDlBatchProcPkts(Void);
@@ -182,7 +183,7 @@ Reason reason;              /* reason */
    tRlcCb->init.acnt    = TRUE;          /* enable accounting */
    tRlcCb->init.usta    = TRUE;          /* enable unsolicited status */
    tRlcCb->init.trc     = FALSE;         /* enable trace */
-   tRlcCb->init.procId  = SFndProcId();
+   tRlcCb->init.procId  = ODU_GET_PROCID();
 
    rlcCb[inst] = tRlcCb;
 
@@ -284,7 +285,7 @@ Buffer *mBuf;           /* message buffer */
 #ifdef LCKWU
                case KWU_EVT_DAT_REQ:              /* Data request */
                   {
-                     ret = cmUnpkKwuDatReq(RlcUiKwuDatReq, pst, mBuf);
+                     //ret = cmUnpkKwuDatReq(rlcProcDlData, pst, mBuf);
                      break;
                   }
 #endif /* LCKWU */
@@ -409,13 +410,13 @@ Buffer *mBuf;           /* message buffer */
 #ifdef L2_L3_SPLIT
                case KWU_EVT_CPLANE_DAT_REQ:       /* C-Plane Data request */
                   {
-                     ret = cmUnpkKwuDatReq(RlcUiKwuDatReq, pst, mBuf);
+                     ret = cmUnpkKwuDatReq(rlcProcDlData, pst, mBuf);
                      break;
                   }
 #else
                case KWU_EVT_DAT_REQ:              /* Data request */
                   {
-                     ret = cmUnpkKwuDatReq(RlcUiKwuDatReq, pst, mBuf);
+                     //ret = cmUnpkKwuDatReq(rlcProcDlData, pst, mBuf);
                      break;
                   }
 #endif
@@ -460,13 +461,13 @@ Buffer *mBuf;           /* message buffer */
                case KWU_EVT_CPLANE_DAT_REQ:       /* C-Plane Data request */
                case KWU_EVT_UPLANE_DAT_REQ:       /* U-Plane Data request */
                   {
-                     ret = cmUnpkKwuDatReq(RlcUiKwuDatReq, pst, mBuf);
+                     ret = cmUnpkKwuDatReq(rlcProcDlData, pst, mBuf);
                      break;
                   }
 #else
                case KWU_EVT_DAT_REQ:              /* Data request */
                   {
-                     ret = cmUnpkKwuDatReq(RlcUiKwuDatReq, pst, mBuf);
+                     //ret = cmUnpkKwuDatReq(rlcProcDlData, pst, mBuf);
                      break;
                   }
 #endif
@@ -500,9 +501,9 @@ Buffer *mBuf;           /* message buffer */
                      ret = cmUnpkRguBndCfm(RlcLiRguBndCfm, pst, mBuf );
                      break;
                   }
-               case EVTSCHREP:    /* Dedicated Channel Status Response */
+               case EVENT_SCHED_RESULT_TO_RLC: 
                   {
-                     ret = unpackSchedRep(RlcMacProcSchedRep, pst, mBuf);
+                     ret = unpackSchedResultRpt(RlcProcSchedResultRpt, pst, mBuf);
                      break;
                   }
                   /* kw005.201 added support for L2 Measurement */
index 10b467f..12fb70f 100755 (executable)
                This file contains following functions
       
         --RlcLiRguBndCfm
-        --RlcLiRguCDatInd
-        --RlcLiRguDDatInd
-        --RlcLiRguCStaInd
-        --RlcLiRguDStaInd
+        --rlcProcCommLcUlData
+        --rlcProcDedLcUlData
+        --rlcProcCommLcSchedRpt
+        --rlcProcDedLcSchedRpt
         --RlcLiRguHqStaInd
 
      File:     kw_lim.c
@@ -72,6 +72,7 @@ static int RLOG_FILE_ID=196;
 #include "kw_dl.x"
 #include "kw_ul.x"
 #include "rlc_utils.h"
+#include "rlc_mac_inf.h"
 
 #ifdef __cplusplus
 EXTERN "C" {
@@ -189,108 +190,6 @@ U8     status;
    return (ROK);
 } /* RlcLiRguBndCfm */
 
-/**
- * @brief Handler to process PDU received from MAC
- *
- * @details
- *    This function receives the PDU from MAC.
- *    seggregates common and dedicated logical channel
- *    PDU and call respective handler.
- *
- * @param[in] pst     Post structure
- * @param[in] suId    Service User ID
- * @param[in] datInd  Data Indication Information 
- *
- * @return  S16
- *    -# ROK 
- *    -# RFAILED 
- *
-*/
-
-uint8_t RlcProcUlData(Pst *pst, RlcMacData *ulData)
-{
-   U8              idx;
-   U8              lcId;                    /* Logical Channel */
-   U8              numDLch = 0;             /* Number of dedicated logical channel */
-   Bool            dLchPduPres;             /* PDU received on dedicated logical channel */
-   RguLchDatInd    dLchData[RGU_MAX_LC];  /* PDU info on dedicated logical channel */
-   RguDDatIndInfo  *dLchUlDat;               /* UL data on dedicated logical channel */
-   RguCDatIndInfo  *cLchUlDat;               /* UL data on common logical channel */
-   uint16_t        copyLen;
-
-   /* Initializing dedicated logical channel Database */
-   for(idx = 0; idx < RGU_MAX_LC; idx++)
-   {
-      dLchData[idx].lcId = idx;
-      dLchData[idx].pdu.numPdu = 0;
-   }
-   
-   dLchPduPres = FALSE;
-  
-   /* Seggregate PDUs received on common and dedicated channels
-    * and call common channel's handler */
-   for(idx = 0; idx< ulData->numPdu; idx++)
-   {
-      if(ulData->pduInfo[idx].commCh)
-      {
-        RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, cLchUlDat, sizeof(RguCDatIndInfo));
-        cmMemset((U8*)cLchUlDat, (U8)0, sizeof(RguCDatIndInfo));
-
-        cLchUlDat->cellId = ulData->cellId;
-        GET_UE_IDX(ulData->rnti, cLchUlDat->rnti);
-        cLchUlDat->lcId   = ulData->pduInfo[idx].lcId;
-
-        /* Copy fixed buffer to message */
-        if(SGetMsg(RLC_MEM_REGION_UL, RLC_POOL, &cLchUlDat->pdu) != ROK)
-        {
-           DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
-           return RFAILED;
-        }
-        reverseFixBuf(ulData->pduInfo[idx].pduBuf, ulData->pduInfo[idx].pduLen);
-        SCpyFixMsg(ulData->pduInfo[idx].pduBuf, cLchUlDat->pdu, 0, \
-              ulData->pduInfo[idx].pduLen, (MsgLen *)&copyLen);
-
-        RlcLiRguCDatInd(pst, 0, cLchUlDat);
-      } 
-      else
-      {
-        if(!dLchPduPres)
-        {
-           RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchUlDat, sizeof(RguDDatIndInfo));
-           dLchPduPres = TRUE;
-        }
-
-        lcId = ulData->pduInfo[idx].lcId;
-        dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu] = ulData->pduInfo[idx].pduBuf;
-        dLchData[lcId].pdu.numPdu++; 
-      }
-   }
-   /* If any PDU received on dedicated logical channel, copy into RguDDatIndInfo
-    * and call its handler */ 
-   if(dLchPduPres)
-   {
-      dLchUlDat->cellId = ulData->cellId;
-      dLchUlDat->rnti   = ulData->rnti;
-
-      for(idx = 0; idx < RGU_MAX_LC; idx++)
-      {
-        if(dLchData[idx].pdu.numPdu)
-        {
-           cmMemcpy((U8 *)&dLchUlDat->lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd));
-           numDLch++;      
-        }
-      }
-      dLchUlDat->numLch = numDLch;
-      RlcLiRguDDatInd(pst, 0, dLchUlDat);
-   }
-    
-
-   RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData, sizeof(RlcMacData));
-   return ROK;
-   
-}/* End of RlcProcUlData */
-
 int   rlcDDatIndRcvd;
 int   rlcCDatIndRcvd;
 /**
@@ -309,41 +208,27 @@ int   rlcCDatIndRcvd;
  *    -# RFAILED 
  *
 */
-#ifdef ANSI
-S16 RlcLiRguCDatInd
-(
-Pst              *pst,   
-SuId             suId,  
-RguCDatIndInfo   *datInd
-)
-#else
-S16 RlcLiRguCDatInd(pst,suId,datInd)
-Pst              *pst; 
-SuId             suId;
-RguCDatIndInfo   *datInd;
-#endif
+uint8_t rlcProcCommLcUlData(Pst *pst, SuId suId, RguCDatIndInfo *datInd)
 {
    RlcUlRbCb   *rbCb; 
    RlcCb       *tRlcCb; 
 
    rlcCDatIndRcvd++;
-   TRC3(RlcLiRguCDatInd)
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (pst->dstInst >= MAX_RLC_INSTANCES)
    {
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguCDatIndInfo));
-      return  (RFAILED);
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguCDatIndInfo));
+      return RFAILED;
    }
 #endif
 
    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
 
-
 #if (ERRCLASS & ERRCLS_DEBUG)
    if (tRlcCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
    {
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguCDatIndInfo));
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguCDatIndInfo));
       return RFAILED;
    }
 #endif
@@ -352,9 +237,9 @@ RguCDatIndInfo   *datInd;
 #if (ERRCLASS & ERRCLS_DEBUG)
    if(RLC_MAX_LCH_PER_CELL <= datInd->lcId)
    {
-      RLOG_ARG1(L_ERROR,DBG_LCID,datInd->lcId, "Invalid LcId, Max is [%d]",
-         RLC_MAX_LCH_PER_CELL);
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguCDatIndInfo));
+      DU_LOG("\nRLC : rlcProcCommLcUlData : Invalid LcId [%d], Max is [%d]",\
+         datInd->lcId, RLC_MAX_LCH_PER_CELL);
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguCDatIndInfo));
       return RFAILED;
    }
 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
@@ -363,23 +248,23 @@ RguCDatIndInfo   *datInd;
    rlcDbmFetchUlRbCbFromLchId(tRlcCb, datInd->rnti, datInd->cellId, datInd->lcId, &rbCb);
    if (!rbCb)
    {
-      RLOG_ARG1(L_ERROR, DBG_CELLID,datInd->cellId, "LcId [%d] not found",
+      DU_LOG("\nRLC : rlcProcCommLcUlData : LcId [%d] not found",
          datInd->lcId);
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguCDatIndInfo));
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguCDatIndInfo));
       return RFAILED;
    }
 
    /* Dispatch to TM Module */
 #ifdef CCPU_OPT
-   rlcTmmRcvFrmLi(tRlcCb, rbCb, datInd->rnti, datInd->pdu);
+   rlcTmmRcvFrmMac(tRlcCb, rbCb, datInd->rnti, datInd->pdu);
 #else /* CCPU_OPT */
-   rlcTmmRcvFrmLi(tRlcCb, rbCb, datInd->pdu);
+   rlcTmmRcvFrmMac(tRlcCb, rbCb, datInd->pdu);
 #endif /* CCPU_OPT */
 
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguCDatIndInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguCDatIndInfo));
 
    return (ROK);
-} /* RlcLiRguCDatInd */
+} /* rlcProcCommLcUlData */
 
 /**
  * @brief Handler to process PDU received from MAC for 
@@ -399,131 +284,36 @@ RguCDatIndInfo   *datInd;
  *
 */
  
-#ifdef ANSI
-S16 RlcLiRguDDatInd
-(
-Pst              *pst,   
-SuId             suId,  
-RguDDatIndInfo   *datInd
-)
-#else
-S16 RlcLiRguDDatInd(pst, suId, datInd)
-Pst              *pst; 
-SuId             suId;
-RguDDatIndInfo   *datInd;
-#endif
+uint8_t rlcProcDedLcUlData(Pst *pst, SuId suId, RguDDatIndInfo *datInd)
 {
-   TRC3(RlcLiRguDDatInd)
-
    rlcDDatIndRcvd++;
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (pst->dstInst >= MAX_RLC_INSTANCES)
    {
-       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguDDatIndInfo));
-       return  (RFAILED);
+       RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguDDatIndInfo));
+       return RFAILED;
    }
 #endif
 
 #if (ERRCLASS & ERRCLS_DEBUG)
    if (((RlcCb*)RLC_GET_RLCCB(pst->dstInst))->genCfg.rlcMode == LKW_RLC_MODE_DL)
    {
-       RLOG1(L_DEBUG,"RlcLiRguDDatInd(pst, suId(%d))recieved in DL Inst",suId);
-       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguDDatIndInfo));
+       DU_LOG("\nRLC : rlcProcDedLcUlData : suId(%d))recieved in DL Inst", suId);
+       RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguDDatIndInfo));
        return RFAILED;
    }
 #endif
-   rlcUtlRcvFrmLi(RLC_GET_RLCCB(pst->dstInst),datInd);
+   rlcUtlRcvFrmMac(RLC_GET_RLCCB(pst->dstInst),datInd);
 #ifndef SS_RBUF 
 #ifdef SS_LOCKLESS_MEMORY
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datInd, sizeof(RguDDatIndInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguDDatIndInfo));
 #else
-   RLC_PST_FREE(pst->region, pst->pool, datInd, sizeof(RguDDatIndInfo));
+   RLC_PST_FREE(RLC_MEM_REGION_UL, RLC_POOL, datInd, sizeof(RguDDatIndInfo));
 #endif
 #endif
 
-   return (ROK);
-} /* RlcLiRguDDatInd */
-
-
-/*******************************************************************
- *
- * @brief Handler for extracting common and dedicated channel
- *      Scheduling result report. 
- *
- * @details
- *
- *    Function : RlcMacProcSchedRep
- *
- *    Functionality:
- *     Handler for extracting common and dedicated channel
- *      Scheduling result report
- *
- * @params[in] 
- * @return ROK     - success
- *         RFAILED - failure
- *
- * ****************************************************************/
-uint16_t RlcMacProcSchedRep(Pst *pst, SuId suId, RlcMacSchedRepInfo *schRep)
-{
-   U8 idx;                     /* Iterator */
-   U8 nmbDLch = 0;                 /* Number of dedicated logical channles */
-   RguCStaIndInfo   *cLchSchInfo;    /* Common logical channel scheduling result */
-   RguDStaIndInfo   *dLchSchInfo;  /* Dedicated logical channel scheduling result */
-
-   DU_LOG("\nRLC : Received scheduling report from MAC");
-
-   for(idx=0; idx < schRep->nmbLch; idx++)
-   {
-       /* If it is common channel, fill status indication information 
-        * and trigger the handler for each common lch separately */
-       if(schRep->lchSta[idx].commCh)
-       {
-          RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, cLchSchInfo, sizeof(RguCStaIndInfo));
-          cmMemset((U8*)cLchSchInfo, (U8)0, sizeof(RguCStaIndInfo)); 
-
-          cLchSchInfo->cellId  = schRep->cellId;
-          cLchSchInfo->lcId    = schRep->lchSta[idx].lchStaInd.lcId;
-          //cLchSchInfo->transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
-          cLchSchInfo->rnti    = schRep->rnti;
-
-          RlcLiRguCStaInd(pst, suId, cLchSchInfo);
-          
-       }
-       else
-       {
-          /* Fill status info structure if at least one dedicated channel 
-           * scheduling report is received */
-          if(nmbDLch == 0)
-          {
-             RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchSchInfo, sizeof(RguDStaIndInfo));
-
-             dLchSchInfo->cellId = schRep->cellId;
-             dLchSchInfo->nmbOfUeGrantPerTti = 1;
-             dLchSchInfo->staInd[0].rnti = schRep->rnti;
-             //dLchSchInfo->staInd[0].transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
-             dLchSchInfo->staInd[0].nmbOfTbs = 1;
-             //dLchSchInfo->staInd[0].fillCrlPdu = /* TODO : Check the value needed to be filled */
-          }
-
-          /* Fill logical channel scheduling info */
-          cmMemcpy((U8 *)&dLchSchInfo->staInd[0].staIndTb[0].lchStaInd[nmbDLch], (U8 *)&schRep->lchSta[idx].lchStaInd, sizeof(RguLchStaInd));
-          nmbDLch++;
-
-       }
-
-   }
-
-   /* Calling handler for all dedicated channels scheduling*/
-   if(nmbDLch)
-   {
-      dLchSchInfo->staInd[0].staIndTb[0].nmbLch = nmbDLch;
-      RlcLiRguDStaInd(pst, suId, dLchSchInfo);
-   }
-   
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRepInfo));
-
    return ROK;
-}
+} /* rlcProcDedLcUlData */
 
 /**
  * @brief Handler for trigerring the data transfer from RLC to MAC
@@ -543,52 +333,32 @@ uint16_t RlcMacProcSchedRep(Pst *pst, SuId suId, RlcMacSchedRepInfo *schRep)
  *    -# RFAILED 
  *
 */ 
-#ifdef ANSI
-S16 RlcLiRguCStaInd
-(
-Pst              *pst,  
-SuId             suId,
-RguCStaIndInfo   *staInd  
-)
-#else
-S16 RlcLiRguCStaInd(pst,suId,staInd)
-Pst              *pst;   
-SuId             suId; 
-RguCStaIndInfo   *staInd; 
-#endif
+uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo *staInd)
 {
    RlcDlRbCb   *rbCb;  
    RlcCb       *tRlcCb;
 
-   TRC3(RlcLiRguCStaInd)
-
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (pst->dstInst >= MAX_RLC_INSTANCES)
    {
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
       return  (RFAILED);
    }
 #endif
 
    tRlcCb = RLC_GET_RLCCB(pst->dstInst);
 
-
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if ((suId >= tRlcCb->genCfg.maxRguSaps) || (suId < 0))
    {
-      RLCLOGERROR(tRlcCb,
-            ERRCLS_INT_PAR, 
-            EKW040, 
-            (ErrVal) suId,
-            "RlcLiRguCStaInd: Invalid RGU suId\n");
-      return (RFAILED); 
+      DU_LOG("\nRLC: rlcProcCommLcSchedRpt: Invalid RGU suId %d\n", suId);
+      return RFAILED; 
    }
    if (tRlcCb->genCfg.rlcMode == LKW_RLC_MODE_UL)
    {
-       RLOG_ARG1(L_ERROR,DBG_LCID,staInd->lcId,
-             "Received in RLC UL CELLID:%d",
+       DU_LOG("\nRLC: rlcProcCommLcSchedRpt: Received in RLC UL CELLID:%d",
              staInd->cellId);
-       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+       RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
        return RFAILED;
    }
 #endif
@@ -599,11 +369,9 @@ RguCStaIndInfo   *staInd;
 #if (ERRCLASS & ERRCLS_DEBUG)
    if(RLC_MAX_LCH_PER_CELL < staInd->lcId)
    {
-      RLOG_ARG2(L_ERROR,DBG_LCID,staInd->lcId, 
-            "Invalid LcId, Max is [%d] CELLID:%d",
-            RLC_MAX_LCH_PER_CELL,
-            staInd->cellId);
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+      DU_LOG("\nRLC: rlcProcCommLcSchedRpt: Invalid LcId, Max is [%d] CELLID:%d",
+         RLC_MAX_LCH_PER_CELL, staInd->cellId);
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
       return RFAILED;
    }
 #endif /* (ERRCLASS & ERRCLS_DEBUG) */
@@ -611,34 +379,26 @@ RguCStaIndInfo   *staInd;
    rlcDbmFetchDlRbCbFromLchId(tRlcCb,0, staInd->cellId, staInd->lcId, &rbCb);
    if(!rbCb)                                               
    {
-      RLOG_ARG1(L_ERROR, DBG_CELLID,staInd->cellId, 
-            "LcId [%d] not found CELLID:%d",
-            staInd->lcId);
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+      DU_LOG("\nRLC: rlcProcCommLcSchedRpt: LcId [%d] not found CELLID:%d",
+         staInd->lcId, staInd->cellId);
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
       return RFAILED;
    }
 
    /* Dispatch to TM Module */
    rbCb->transId = staInd->transId;
-   /* ccpu00136940 */
-  /* If trace flag is enabled send the trace indication */
-   if(tRlcCb->init.trc == TRUE)
-   {
-     /* Populate the trace params */
-      rlcLmmSendTrc(tRlcCb,EVTRGUCSTAIND, NULLP);
-   }                            
-   rlcTmmSndToLi(tRlcCb, suId, rbCb, staInd);
+   rlcTmmSendToMac(tRlcCb, suId, rbCb, staInd);
 #ifndef SS_RBUF
 #ifdef SS_LOCKLESS_MEMORY
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
 #else
-   RLC_PST_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+   RLC_PST_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
 #endif
 #else
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguCStaIndInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguCStaIndInfo));
 #endif
-   return (ROK);
-} /* RlcLiRguCStaInd */
+   return ROK;
+} /* rlcProcCommLcSchedRpt */
 
 /**
  * @brief Handler for trigerring the data transfer from RLC to MAC
@@ -659,28 +419,15 @@ RguCStaIndInfo   *staInd;
  *    -# RFAILED 
  *
 */ 
-#ifdef ANSI
-S16 RlcLiRguDStaInd
-(
-Pst              *pst,  
-SuId             suId,
-RguDStaIndInfo   *staInd 
-)
-#else
-S16 RlcLiRguDStaInd(pst, suId, staInd)
-Pst              *pst; 
-SuId             suId; 
-RguDStaIndInfo   *staInd; 
-#endif
+uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo *staInd)
 {
    RlcCb        *gCb;
-   TRC3(RlcLiRguDStaInd)
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (pst->dstInst >= MAX_RLC_INSTANCES)
    {
-      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguDStaIndInfo));
-      return  (RFAILED);
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguDStaIndInfo));
+      return RFAILED;
    }
 #endif
 
@@ -689,26 +436,22 @@ RguDStaIndInfo   *staInd;
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (((RlcCb*)RLC_GET_RLCCB(pst->dstInst))->genCfg.rlcMode == LKW_RLC_MODE_UL)
    {
-       RLOG_ARG0(L_ERROR,DBG_CELLID,staInd->cellId,"Received in RLC UL ");
-       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguDStaIndInfo));
+       DU_LOG("\nRLC: rlcProcDedLcSchedRpt: Received in RLC UL ");
+       RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguDStaIndInfo));
        return RFAILED;
    }
    if ((suId >= gCb->genCfg.maxRguSaps) || (suId < 0))
    {
-      RLCLOGERROR(gCb,
-            ERRCLS_INT_PAR, 
-            EKW040, 
-            (ErrVal) suId,
-            "RlcLiRguDStaInd: Invalid RGU suId\n");
+      DU_LOG("\nRLC: rlcProcDedLcSchedRpt: Invalid RGU suId %d\n", suId);
       return (RFAILED); 
    }
 #endif
-   rlcUtlSndToLi(gCb, suId, staInd);
+   rlcUtlSendToMac(gCb, suId, staInd);
 
    /* kw002.201 :Freeing from proper region */
-   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, staInd, sizeof(RguDStaIndInfo));
-   return (ROK);
-} /* RlcLiRguDStaInd */
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, staInd, sizeof(RguDStaIndInfo));
+   return ROK;
+} /* rlcProcDedLcSchedRpt */
 
 /**
  * @brief Handler for handling the flow cntrl Ind from MAC
index 5ffe050..2772e41 100755 (executable)
@@ -566,13 +566,13 @@ Header    *hdr;
  */
 
 #ifdef ANSI
-S16 RlcMiRlcConfigReq 
+uint8_t RlcMiRlcConfigReq 
 (
 Pst       *pst, 
 RlcMngmt   *cfg
 )
 #else
-S16 RlcMiRlcConfigReq (pst, cfg)
+uint8_t RlcMiRlcConfigReq (pst, cfg)
 Pst       *pst;
 RlcMngmt   *cfg;
 #endif
@@ -722,13 +722,13 @@ RlcMngmt   *cfg;
  *    -# RFAILED
  */
 #ifdef ANSI
-S16 RlcMiLkwCntrlReq
+uint8_t RlcMiLkwCntrlReq
 (
 Pst       *pst, 
 RlcMngmt   *cntrl
 )
 #else
-S16 RlcMiLkwCntrlReq(pst, cntrl)
+uint8_t RlcMiLkwCntrlReq(pst, cntrl)
 Pst       *pst;
 RlcMngmt   *cntrl;
 #endif
index c41ca38..558bc77 100755 (executable)
 #include "ss_rbuf.h"
 #include "ss_rbuf.x"
 
-#ifdef EGTP_TEST
-#include "mac_stub.h"
-#endif /* EGTP_TEST */
-
 #ifndef LCKWLIRGU
 #define PTKWRGU
 #endif
@@ -126,49 +122,6 @@ RguBndReq kwLiRguUbndReqMt[] =
 #endif /* LCRGUIRGU */
 };
 
-/* RGU Dedicated Channel Data Request primitive */
-
-RlcMacDlData rlcMacSendDlDataOpts[] =
-{
-#ifdef EGTP_TEST
-   macStubSendDlData,
-   macStubSendDlData,
-   macStubSendDlData,
-#else /* EGTP_TEST */
-#ifdef LCKWLIRGU
-   packDlData,            /* 0 - loosely coupled */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   MacRlcProcDlData,      /* 1 - tightly coupled, MAC  */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   packDlData,            /* 0 - loosely coupled */
-#endif /* LCRGUIRGU */
-#endif /* EGTP_TEST */
-};
-
-
-/* RLC logical Channel Status primitive */
-
-RlcMacBoStatus rlcMacSendBOStatusOpts[] =
-{
-#ifdef EGTP_TEST
-   macStubBOStatus,
-   macStubBOStatus,
-   macStubBOStatus,
-#else /* EGTP_TEST */
-#ifdef LCKWLIRGU
-   packBOStatus,            /* 0 - loosely coupled */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   MacRlcProcBOStatus,            /* 1 - tightly coupled, MAC  */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   packBOStatus,            /* 0 - LWLC loosely coupled */
-#endif /* LCRGUIRGU */
-#endif /* EGTP_TEST */
-};
-
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
 #ifdef LTE_RLC_R9
@@ -276,113 +229,6 @@ Reason      reason;
 
 } /* end of RlcLiRguUbndReq */
 
-\f  
-/**
- *
- * @brief 
- *
- *        Handler for sending PDU(s) from RLC to MAC for dedicated logical channels. 
- *
- * @b Description:
- *
- *        This function sends PDU(s) to MAC via one or more dedicated 
- *        logical channels along with the Buffer Occupancy of these
- *        channels.
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] datIndInfo  Data Request Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-S16 RlcMacSendDlData
-(
-Pst               *post,
-SpId              spId,
-RlcMacData       *dlData
-)
-#else
-S16 RlcMacSendDlData(post, spId, dlData)
-Pst               *post;
-SpId              spId;
-RlcMacData        *dlData;
-#endif
-{
-   TRC3(RlcMacSendDlData)
-#ifdef RLC_MAC_DAT_REQ_RBUF
-        post->event=EVTRGUDDATREQ;
-      if((rlcLiRguDatReqRbuf(post, spId, datReq)) != ROK)
-      {
-
-      SPutStaticBuffer(post->region, post->pool,                      
-                      (Data *) datReq, sizeof(RguDDatReqInfo), 0);             
-         return RFAILED;
-      }
-#else
-   /* jump to specific primitive depending on configured selector */
-   (*rlcMacSendDlDataOpts[post->selector])(post, spId, dlData);
-#endif 
-   return ROK;
-
-} /* end of RlcLiRguDDatReq */
-
-
-\f  
-/**
- *
- * @brief  
- *
- *        Handler for reporting the Buffer Occupancy to MAC 
- *        for logical channels.
- *
- * @b Description:
- *
- *        This function reports the Buffer Occupancy of one or more
- *         logical channels to MAC. 
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] boSta       BO Status Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-S16 RlcMacSendBOStatus
-(
-Pst               *post,
-SpId              spId,
-RlcMacBOStatus    *boSta
-)
-#else
-S16 RlcMacSendBOStatus(post, spId, staRsp)
-Pst               *post;
-SpId              spId;
-RlcMacBOStatus    *boSta;
-#endif
-{
-   TRC3(RlcMacSendBOStatus)
-#if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
-       post->event= EVTRGUDSTARSP;
-      if((rlcLiRguStaRspRbuf(post, spId, staRsp)) != ROK)
-      {
-         return RFAILED;
-      }
-#endif 
-   /* jump to specific primitive depending on configured selector */
-   (*rlcMacSendBOStatusOpts[post->selector])(post, spId, boSta);
-
-   return ROK;
-
-} /* end of RlcMacSendBOStatus */
-
-
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
 #ifdef LTE_RLC_R9
@@ -467,7 +313,7 @@ Void;
       SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].nPktProc++;;//Number of pkt processed in tti
       if(datInd != NULLP)
       {
-         RlcLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+         RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd);
       }
       else
       {
@@ -491,7 +337,7 @@ Void;
    while(NULLP != elmIndx)
    {
       datInd = (RguDDatIndInfo *)elmIndx;
-      RlcLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+      RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd);
 
       elmIndx = NULLP;
       datInd = NULLP;
index cf38892..5f32542 100755 (executable)
 /* local defines */
 #define MAXKWMI 2               /* max. layer management interfaces */
 
-#ifndef LCKWMILKW
-#define PTKWLKW
-#endif
-
-
-#ifndef SM
-#define PTKWLKW
-#endif
-
-
-\f
-#ifdef PTKWLKW
-/* portable functions */
-
-PRIVATE S16 PtMiRlcConfigCfm    ARGS((Pst *pst, RlcMngmt *cfm));
-PRIVATE S16 PtMiLkwCntrlCfm  ARGS((Pst *pst, RlcMngmt *cfm));
-PRIVATE S16 PtMiLkwStaInd    ARGS((Pst *pst, RlcMngmt *usta));
-
-PRIVATE S16 PtMiLkwStaCfm    ARGS((Pst *pst, RlcMngmt *cfm));
-PRIVATE S16 PtMiLkwStsCfm    ARGS((Pst *pst, Action action,
-                                RlcMngmt *cfm));
-PRIVATE S16 PtMiLkwTrcInd    ARGS((Pst *pst, RlcMngmt *trc,
-                                Buffer *mBuf));
-/* kw005.201 added support for L2 Measurement */
-#ifdef LTE_L2_MEAS
-PRIVATE S16 PtMiLkwL2MeasCfm   ARGS((Pst *pst, RlcL2MeasCfmEvt *measEvt));
-PRIVATE S16 PtMiLkwL2MeasStopCfm   ARGS((Pst *pst, U8 measType,U8 status));
-#endif /*  LTE_L2_MEAS */
-#endif /* PTKWLKW */
-
 \f
 /*********************************************************************
  *             Primitives for LKW interface 
@@ -97,13 +67,9 @@ PRIVATE RlcConfigCfm rlcMiRlcConfigCfmMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW
    packRlcConfigCfm,            /* 0 - loosely coupled - fc */
-#else
-   PtMiRlcConfigCfm,            /* 0 - tightly coupled portable */
 #endif /* LCRLMILKW */
 #ifdef SM
    SmMiRlcConfigCfm,            /* 1 - tightly coupled layer management*/
-#else
-   PtMiRlcConfigCfm,            /* 1 - tightly coupled portable */
 #endif /* SM */
 };
 
@@ -113,13 +79,9 @@ PRIVATE LkwCntrlCfm kwMiLkwCntrlCfmMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW 
    cmPkLkwCntrlCfm,          /* 0 - loosely coupled - fc */
-#else
-   PtMiLkwCntrlCfm,          /* 0 - tightly coupled portable */
 #endif /* LCRLMILKW */
 #ifdef SM
    SmMiLkwCntrlCfm,          /* 1 - tightly coupled layer management*/
-#else
-   PtMiLkwCntrlCfm,          /* 1 - tightly coupled portable */
 #endif /* SM */
 };
 
@@ -129,13 +91,9 @@ PRIVATE LkwStaInd kwMiLkwStaIndMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW 
    cmPkLkwStaInd,            /* 0 - loosely coupled  */
-#else
-   PtMiLkwStaInd,            /* 0 - tightly coupled, portable */
 #endif /* LCKWMILKW */
 #ifdef SM
    SmMiLkwStaInd,            /* 1 - tightly coupled, layer management */
-#else
-   PtMiLkwStaInd,            /* 1 - tightly coupled, portable */
 #endif /* SM */
 };
 
@@ -145,13 +103,9 @@ PRIVATE LkwStaCfm kwMiLkwStaCfmMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW 
    cmPkLkwStaCfm,            /* 0 - loosely coupled  */
-#else
-   PtMiLkwStaCfm,            /* 0 - tightly coupled, portable */
 #endif /* LCKWMILKW */
 #ifdef SM
    SmMiLkwStaCfm,            /* 1 - tightly coupled, layer management */
-#else
-   PtMiLkwStaCfm,            /* 1 - tightly coupled, portable */
 #endif /* SM */
 };
 
@@ -161,13 +115,9 @@ PRIVATE LkwStsCfm kwMiLkwStsCfmMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW
    cmPkLkwStsCfm,            /* 0 - loosely coupled  */
-#else
-   PtMiLkwStsCfm,            /* 0 - tightly coupled, portable */
 #endif /* LCRLMILKW */
 #ifdef SM
    SmMiLkwStsCfm,            /* 1 - tightly coupled, layer management */
-#else
-   PtMiLkwStsCfm,            /* 1 - tightly coupled, portable */
 #endif /* SM */
 };
 
@@ -177,13 +127,9 @@ PRIVATE LkwTrcInd kwMiLkwTrcIndMt[MAXKWMI] =
 {
 #ifdef LCKWMILKW
    cmPkLkwTrcInd,            /* 0 - loosely coupled  */
-#else
-   PtMiLkwTrcInd,            /* 0 - tightly coupled, portable */
 #endif /* LCKWMILKW */
 #ifdef SM
    SmMiLkwTrcInd,            /* 1 - tightly coupled, layer management */
-#else
-   PtMiLkwTrcInd,            /* 1 - tightly coupled, portable */
 #endif /* SM */
 };
 
@@ -193,26 +139,18 @@ PRIVATE CONSTANT LkwL2MeasCfm rlcMiLkwL2MeasCfmMt[] =
 {
 #ifdef LCKWMILKW
    cmPkLkwL2MeasCfm,
-#else
-   PtMiLkwL2MeasCfm,
 #endif
 #ifdef SM
    SmMiLkwL2MeasCfm,
-#else
-   PtMiLkwL2MeasCfm,
 #endif
 };
 PRIVATE CONSTANT LkwL2MeasStopCfm RlcMiLkwL2MeasStopCfmMt[] =
 {
 #ifdef LCKWMILKW
    cmPkLkwL2MeasStopCfm,
-#else
-   PtMiLkwL2MeasStopCfm,
 #endif
 #ifdef SM
    SmMiLkwL2MeasStopCfm,
-#else
-   PtMiLkwL2MeasStopCfm,
 #endif
 };
 #endif /*  LTE_L2_MEAS */
@@ -495,285 +433,6 @@ U8  status;
 
 }
 #endif /*  LTE_L2_MEAS */
-#ifdef PTKWLKW
-
-\f
-/*************************************************************************
- *                         Porting Functions
- ************************************************************************/
-/*
- *
- *       Fun:   configuration  Confirm
- *
- *       Desc:  This function is used to confirm the receipt of configuration
- *              request from layer management.
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-
-#ifdef ANSI
-S16 PtMiRlcConfigCfm
-(
-Pst *pst,                    /* post structure */
-RlcMngmt *cfm                 /* Layer Management structure */
-)
-#else
-S16 PtMiRlcConfigCfm(pst, cfm)
-Pst *pst;                    /* post structure */
-RlcMngmt *cfm;                /* Layer Management structure */
-#endif
-{
-   TRC3(PtMiRlcConfigCfm)
-
-   UNUSED(pst);
-   UNUSED(cfm);
-
-   TRC2(PtMiRlcConfigCfm() : function is not implemented)
-
-   return ROK;
-} /* end of PtMiRlcConfigCfm */
-
-/*
- *
- *       Fun:   Control Confirmation
- *
- *       Desc:  This function is the portable version of used to
- *              confirm the receipt of configuration request from
- *              layer management.
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-
-#ifdef ANSI
-PRIVATE S16 PtMiLkwCntrlCfm
-(
-Pst *pst,                 /* Post structure */
-RlcMngmt *cfm              /* Layer Management structure */
-)
-#else
-PRIVATE S16 PtMiLkwCntrlCfm(pst, cfm)
-Pst *pst;                 /* Post structure */
-RlcMngmt *cfm;             /* Layer Management structure */
-#endif
-{
-   TRC3(PtMiLkwCntrlCfm);
-
-   UNUSED(pst);
-   UNUSED(cfm);
-
-   TRC2(PtMiLkwCntrlCfm() :  function is not implemented)
-
-   return ROK;
-} /* end of PtMiLkwCntrlCfm */
-
-
-/*
- *
- *       Fun:   unsolicited status indication
- *
- *       Desc:  This function is the portable version  used to
- *              send the status indication to the layer manager
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-#ifdef ANSI
-PRIVATE S16 PtMiLkwStaInd
-(
-Pst *pst,                    /* post structure */
-RlcMngmt *usta                /* unsolicited status */
-)
-#else
-PRIVATE S16 PtMiLkwStaInd(pst, usta)
-Pst *pst;                    /* post structure */
-RlcMngmt *usta;               /* unsolicited status */
-#endif
-{
-   TRC3(PtMiLkwStaInd)
-
-   UNUSED(pst);
-   UNUSED(usta);
-
-   TRC2(PtMiLkwStaInd() : function is not implemented)
-
-   return ROK;
-} /* end of PtMiLkwStaInd */
-
-
-/*
- *
- *       Fun:   portable function for solicited status confirmation
- *
- *       Desc:  This function is the portable version  used to
- *              send the status confirmation to the layer manager
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-#ifdef ANSI
-PRIVATE S16 PtMiLkwStaCfm
-(
-Pst *pst,                    /* post structure */
-RlcMngmt *cfm                 /* solicited status confirmation */
-)
-#else
-PRIVATE S16 PtMiLkwStaCfm(pst, cfm)
-Pst *pst;                    /* post structure */
-RlcMngmt *cfm;                /* solicited status confirmation */
-#endif
-{
-   TRC3(PtMiLkwStaCfm)
-
-   UNUSED(pst);
-   UNUSED(cfm);
-
-   return ROK;
-} /* end of PtMiLkwStaCfm */
-
-
-/*
- *
- *       Fun:   portable function for statistics confirmation
- *
- *       Desc:  This function is the portable version  used to
- *              send the statistics confirmation to the layer manager
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-#ifdef ANSI
-PRIVATE S16 PtMiLkwStsCfm
-(
-Pst *pst,                    /* post structure */
-Action action,               /* action */
-RlcMngmt *cfm                 /* statistics confirmation */
-)
-#else
-PRIVATE S16 PtMiLkwStsCfm(pst, action, cfm)
-Pst *pst;                    /* post structure */
-Action action;               /* action */
-RlcMngmt *cfm;                /* statistics confirmation */
-#endif
-{
-   TRC3(PtMiLkwStsCfm)
-
-   UNUSED(pst);
-   UNUSED(action);
-   UNUSED(cfm);
-
-   return ROK;
-} /* end of PtMiLkwStsCfm */
-
-
-/*
- *
- *       Fun:   portable function for trace indication
- *
- *       Desc:  This function is the portable version  used to
- *              send trace indication to the layer manager
- *
- *       Ret:   ROK      - ok
- *
- *       Notes: None
- *
- *       File:  kw_ptmi.c
- *
- */
-#ifdef ANSI
-PRIVATE S16 PtMiLkwTrcInd
-(
-Pst *pst,                    /* post structure */
-RlcMngmt *trc,                /* trace indication */
-Buffer *mBuf                 /* message buffer */
-)
-#else
-PRIVATE S16 PtMiLkwTrcInd(pst, trc, mBuf)
-Pst *pst;                    /* post structure */
-RlcMngmt *trc;                /* trace indication */
-Buffer *mBuf;                /* message buffer */
-#endif
-{
-   TRC3(PtMiLkwTrcInd)
-
-   UNUSED(pst);
-   UNUSED(trc);
-   UNUSED(mBuf);
-
-   return ROK;
-} /* end of PtMiLkwTrcInd */
-
-/* kw005.201 added support for L2 Measurement */
-#ifdef LTE_L2_MEAS
-#ifdef ANSI
-PRIVATE S16 PtMiLkwL2MeasCfm
-(
-Pst * pst,
-RlcL2MeasCfmEvt * measEvt
-)
-#else
-PRIVATE S16 PtMiLkwL2MeasCfm(pst, measEvt)
-Pst * pst;
-RlcL2MeasCfmEvt * measEvt;
-#endif
-{
-
-   TRC3(PtMiLkwL2MeasCfm)
-
-   UNUSED(pst);
-   UNUSED(measEvt);
-
-   return ROK;
-
-}
-#ifdef ANSI
-PRIVATE S16 PtMiLkwL2MeasStopCfm
-(
-Pst * pst,
-U8 measType,
-U8 status
-)
-#else
-PRIVATE S16 PtMiLkwL2MeasStopCfm(pst, measType,status)
-Pst * pst;
-U8  measType;
-U8  status;
-#endif
-{
-
-   TRC3(PtMiLkwL2MeasStopCfm)
-
-   UNUSED(pst);
-   UNUSED(measType);
-   UNUSED(status);
-
-   return ROK;
-
-}
-#endif /*  LTE_L2_MEAS */
-#endif /* PTKWLKW */
-
 
 /********************************************************************30**
 
index 7b2028c..e9f8756 100755 (executable)
@@ -62,25 +62,6 @@ static int RLOG_FILE_ID=199;
 #include "mt_plat_t33.x"
 #endif
 
-#ifndef LCKWUIKWU
-#define PTKWKWU
-#endif
-
-#ifndef LCKWUICKW
-#define PTKWCKW
-#endif
-
-#ifndef NH
-#define PTKWKWU
-#define PTKWCKW
-#endif
-
-#ifndef PJ 
-#define PTKWKWU
-#define PTKWCKW
-#endif
-
-
 #ifdef __cplusplus
 EXTERN "C" {
 #endif /* __cplusplus */
@@ -317,27 +298,27 @@ U8   status;                    /* Status */
  *      -# RFAILED
  */
 #ifdef ANSI
-S16 RlcUiKwuDatInd
+S16 rlcSendUlDataToDu
 (
 Pst               *pst,
 KwuDatIndInfo     *datInd,
 Buffer            *mBuf
 )
 #else
-S16 RlcUiKwuDatInd(pst, datInd, mBuf)
+S16 rlcSendUlDataToDu(pst, datInd, mBuf)
 Pst               *pst;
 KwuDatIndInfo     *datInd;
 Buffer            *mBuf;
 #endif
 {
-   TRC3(RlcUiKwuDatInd)
+   TRC3(rlcSendUlDataToDu)
 
    /* jump to specific primitive depending on configured selector */
    (*kwUiKwuDatIndMt[pst->selector])(pst, datInd, mBuf);
 
    return ROK;
 
-} /* end of RlcUiKwuDatInd */
+} /* end of rlcSendUlDataToDu */
 
    int rlcDatCfmsSent = 0;
 \f
@@ -835,13 +816,13 @@ Void;
       datReq = (RxmBufReq *)elmIndx;
       if(datReq->mBuf != NULLP)
       {
-        cmUnpkKwuDatReq(RlcUiKwuDatReq, &datReq->pst, datReq->mBuf);
+        cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
       }
       else
       {
          RLOG0(L_ERROR, "mBuf is NULL");
          if(datReq->mBuf)
-          cmUnpkKwuDatReq(RlcUiKwuDatReq, &datReq->pst, datReq->mBuf);
+          cmUnpkKwuDatReq(rlcProcDlData, &datReq->pst, datReq->mBuf);
 
       }
       SsRngInfoTbl[SS_RNG_BUF_RX_TO_DLRLC].nPktProc++;//Number of pkt processed in tti
@@ -926,7 +907,7 @@ Void;
       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;;//Number of pkt processed in tti
       if(kwuDatReqDetl->mBuf != NULLP)
       {
-         RlcUiKwuDatReq(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
+         rlcProcDlData(&rlcDlRbfuPst, kwuDatReqDetl->spId, &datReq, kwuDatReqDetl->mBuf);
       }
       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
       rngBufDeqIndx++;
index 26c5a3c..d3d938c 100755 (executable)
                reassembly.This file contains following functions
                 
                   --rlcTmmQSdu
-                  --rlcTmmSndToLi
-                  --rlcTmmRcvFrmLi
+                  --rlcTmmSendToMac
+                  --rlcTmmRcvFrmMac
                   --kwTmmReEstablish 
 
      File:     kw_tmm_dl.c
 
 **********************************************************************/
-static const char* RLOG_MODULE_NAME="TMM";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=200;
 /** 
  * @file kw_tmm_dl.c
  * @brief RLC Transparent Mode module
@@ -63,10 +60,13 @@ static int RLOG_FILE_ID=200;
 #include "kw.x"
 #include "kw_udx.x"
 #include "kw_dl.x"
+#include "rlc_utils.h"
+#include "rlc_mac_inf.h"
+#include "rlc_lwr_inf_api.h"
 
 #define RLC_MODULE (RLC_DBGMASK_TM | RLC_DBGMASK_DL)
 
-PRIVATE Void rlcTmmSndStaRsp ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, 
+PRIVATE Void rlcTmmSendBoSta ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, 
                                  MsgLen bo, KwuDatReqInfo *datReqInfo));
 extern U32 rgMacGT ;  
 /** @addtogroup tmmode */
@@ -147,7 +147,7 @@ Buffer          *mBuf;
    cmLListAdd2Tail(&(rbCb->m.tm.sduQ), &(sdu->lstEnt));  
    sdu->lstEnt.node = (PTR)sdu; 
 
-   rlcTmmSndStaRsp(gCb, rbCb, sdu->sduSz, datReqInfo); 
+   rlcTmmSendBoSta(gCb, rbCb, sdu->sduSz, datReqInfo); 
    RETVOID;
 }
 
@@ -167,30 +167,16 @@ Buffer          *mBuf;
 *    -# ROK 
 *    -# RFAILED         
 */
-#ifdef ANSI
-Void rlcTmmSndToLi
-(
-RlcCb             *gCb,
-SuId             suId,
-RlcDlRbCb         *rbCb,              
-RguCStaIndInfo   *staInd
-)
-#else
-Void rlcTmmSndToLi(gCb, suId, rbCb, staInd)
-RlcCb             *gCb;
-SuId             suId;
-RlcDlRbCb         *rbCb;             
-RguCStaIndInfo   *staInd;
-#endif
+void rlcTmmSendToMac(RlcCb *gCb, SuId suId, RlcDlRbCb *rbCb, RguCStaIndInfo *staInd)
 {
+   Pst              pst;
    CmLList          *node;          /* Current Link List Node */
-   RlcSdu            *sdu;           /* SDU */
-   RlcMacData       *dlData;
-   S16   timeDiff = 0;
-   Ticks curTime  = 0;
-
-   TRC2(rlcTmmSndToLi)
-
+   RlcSdu           *sdu;           /* SDU */
+   RlcData          *dlData;
+   uint16_t         pduLen;
+   uint16_t         copyLen;
+   int16_t          timeDiff = 0;
+   Ticks            curTime  = 0;
 
    CM_LLIST_FIRST_NODE(&(rbCb->m.tm.sduQ), 
                        node);
@@ -203,7 +189,7 @@ RguCStaIndInfo   *staInd;
       if ( rbCb->lch.lChType == CM_LTE_LCH_BCCH ||
             rbCb->lch.lChType == CM_LTE_LCH_PCCH )
       {
-         U16 sfn, slot;
+         uint16_t sfn, slot;
          /* MS_FIX: syed sfn is of 10 bytes rather than 8 */
 #ifdef EMTC_ENABLE
          /* As part of CATM feature cross slot scheduling is implemented , so there is some delta(currently 2)
@@ -242,18 +228,11 @@ RguCStaIndInfo   *staInd;
                (sdu->mode.tm.slot != ((slot+TFU_DELTA)%10)))
          {
             node = node->next;
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                  "Releasing SDU of RNTI = %d for RNTI = %d UEID:%d CELLID:%d",
-                  sdu->mode.tm.rnti, 
-                  staInd->rnti,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                  "sfn %d slot %d  UEID:%d CELLID:%d",
-                  sfn, 
-                  slot,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
+            DU_LOG("\nRLC: rlcTmmSendToMac: Releasing SDU of RNTI = %d for RNTI = %d \
+              UEID:%d CELLID:%d", sdu->mode.tm.rnti, staInd->rnti, rbCb->rlcId.ueId,
+               rbCb->rlcId.cellId);   
+            DU_LOG("\nRLC: rlcTmmSendToMac: sfn %d slot %d  UEID:%d CELLID:%d",
+                  sfn, slot, rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
             cmLListDelFrm(&(rbCb->m.tm.sduQ), &sdu->lstEnt);
             RLC_FREE_BUF(sdu->mBuf);
             RLC_FREE(gCb, sdu, sizeof(RlcSdu));
@@ -274,30 +253,19 @@ RguCStaIndInfo   *staInd;
          {
             timeDiff = curTime - sdu->arrTime;
          }
-         RLOG_ARG4(L_DEBUG, DBG_RBID,rbCb->rlcId.rbId,
-               "TMM: TmSdu Sta Indication received for Rnti %d Sdu Rnti %d "
-               " UEID:%d CELLID:%d", 
-               staInd->rnti, 
-               sdu->mode.tm.rnti,
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);   
-         RLOG_ARG4(L_DEBUG, DBG_RBID,rbCb->rlcId.rbId,
-               "TMM: TmSdu Sta Indication received : timeDiff %d SduQCnt %lu"
-               " UEID:%d CELLID:%d", 
-               timeDiff, 
-               rbCb->m.tm.sduQ.count,
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);   
+         DU_LOG("\nRLC: rlcTmmSendToMac: TMM: TmSdu Sta Indication received \
+           for Rnti %d Sdu Rnti %d UEID:%d CELLID:%d", staInd->rnti, 
+            sdu->mode.tm.rnti, rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+        DU_LOG("\nRLC: rlcTmmSendToMac: TMM: TmSdu Sta Indication received : \
+           timeDiff %d SduQCnt %d UEID:%d CELLID:%d", timeDiff, rbCb->m.tm.sduQ.count,
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
          if (timeDiff > 40)
          {
             /* Memory leak needs to be fixed */
             node = node->next;
-            RLOG_ARG3(L_DEBUG, DBG_RBID,rbCb->rlcId.rbId,
-                  " timeDiff greater than 40, so deleting the Sdu %u "
-                  " UEID:%d CELLID:%d", 
-                  sdu->mode.tm.rnti,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
+            DU_LOG("\nRLC: rlcTmmSendToMac: timeDiff greater than 40, so deleting\
+              the Sdu %u UEID:%d CELLID:%d", sdu->mode.tm.rnti, rbCb->rlcId.ueId,
+               rbCb->rlcId.cellId);   
             cmLListDelFrm(&(rbCb->m.tm.sduQ), &sdu->lstEnt);
             RLC_FREE_BUF(sdu->mBuf);
             RLC_FREE(gCb, sdu, sizeof(RlcSdu));
@@ -308,36 +276,20 @@ RguCStaIndInfo   *staInd;
          {
             /* Memory leak needs to be fixed */
             node = node->next;
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                  "TMM: Searching for Rnti %d Skipping Sdu for Rnti %d"
-                  " UEID:%d CELLID:%d", 
-                  staInd->rnti,
-                  sdu->mode.tm.rnti, 
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                  " timeDiff %d sdu->arrTime %d"
-                  " UEID:%d CELLID:%d", 
-                  timeDiff, 
-                  sdu->arrTime,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
-            RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                  "curTime %d SduQCnt %lu and continuing"
-                  " UEID:%d CELLID:%d", 
-                   curTime, 
-                   rbCb->m.tm.sduQ.count,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
+           DU_LOG("\nRLC: rlcTmmSendToMac: TMM: Searching for Rnti %d Skipping \
+              Sdu for Rnti %d UEID:%d CELLID:%d", staInd->rnti, sdu->mode.tm.rnti, 
+               rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+           DU_LOG("\nRLC: rlcTmmSendToMac: timeDiff %d sdu->arrTime %d UEID:%d CELLID:%d", 
+                timeDiff, sdu->arrTime, rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+            DU_LOG("\nRLC: rlcTmmSendToMac: curTime %d SduQCnt %d and continuing"
+               " UEID:%d CELLID:%d", curTime, rbCb->m.tm.sduQ.count, rbCb->rlcId.ueId,
+               rbCb->rlcId.cellId);   
             continue;
          }
          else
          {
-            RLOG_ARG3(L_DEBUG, DBG_RBID,rbCb->rlcId.rbId,
-                  "TMM: TmSdu found %u UEID:%d CELLID:%d",
-                  sdu->mode.tm.rnti,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);   
+            DU_LOG("\nRLC: rlcTmmSendToMac: TMM: TmSdu found %u UEID:%d CELLID:%d",
+               sdu->mode.tm.rnti, rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
             break;
          }
       }
@@ -345,25 +297,20 @@ RguCStaIndInfo   *staInd;
    }
    if ( node == NULLP )
    {
-      RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-               "SDU not found TM Queue is empty UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);   
-      RETVOID;
+      DU_LOG("\nRLC: rlcTmmSendToMac: SDU not found TM Queue is empty UEID:%d CELLID:%d",
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+      return;
    }
    sdu = (RlcSdu *)node->node;
 
-    RLC_ALLOC_SHRABL_BUF(gCb->u.dlCb->rguDlSap[suId].pst.region,
-                        gCb->u.dlCb->rguDlSap[suId].pst.pool,
-                        dlData,(Size)sizeof(RlcMacData));
+    RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                        dlData,(Size)sizeof(RlcData));
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if ( dlData == NULLP )
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-            "Memory Allocation failed UEID:%d CELLID:%d",   
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);   
-      RETVOID; 
+      DU_LOG("\nRLC: rlcTmmSendToMac: Memory Allocation failed UEID:%d CELLID:%d",   
+         rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+      return; 
    }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */
 
@@ -374,7 +321,22 @@ RguCStaIndInfo   *staInd;
    dlData->numPdu = 1;
    dlData->pduInfo[0].commCh = TRUE;
    dlData->pduInfo[0].lcId = rbCb->lch.lChId;
-   dlData->pduInfo[0].pduBuf =  sdu->mBuf;
+
+   /* Copy Message to fixed buffer to send */
+   ODU_GET_MSG_LEN(sdu->mBuf, (MsgLen *)&pduLen);
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+      dlData->pduInfo[0].pduBuf, pduLen);
+   if (dlData->pduInfo[0].pduBuf == NULLP )
+   {
+      DU_LOG("Memory allocation failed");
+      return;
+   }
+   ODU_COPY_MSG_TO_FIX_BUF(sdu->mBuf, 0, pduLen, \
+      dlData->pduInfo[0].pduBuf, (MsgLen *)&copyLen);
+   dlData->pduInfo[0].pduLen = pduLen;
+
+   /* Free message */
+   ODU_PUT_MSG_BUF(sdu->mBuf);
 
    /* kw005.201 ccpu00117318, updating the statistics */
    gCb->genSts.bytesSent += sdu->sduSz;
@@ -388,17 +350,19 @@ RguCStaIndInfo   *staInd;
                  &sdu->lstEnt); 
    RLC_FREE(gCb,sdu, sizeof(RlcSdu));
 
-   /* If trace flag is enabled send the trace indication */
-   if(gCb->init.trc == TRUE)
+   /* Fill Pst structure. Copying rguSap->pst to pst to avoid any
+    * changes in rguSap->pst */
+   memset(&pst, 0, sizeof(Pst));
+   FILL_PST_RLC_TO_MAC(pst, RLC_DL_INST, EVENT_DL_DATA_TO_MAC);
+
+   if(RlcSendDlDataToMac(&pst, dlData) != ROK)
    {
-      /* Populate the trace params */
-      rlcLmmSendTrc(gCb,EVTRLCDLDAT, NULLP);
-   }
-   
-   RlcMacSendDlData(&(gCb->u.dlCb->rguDlSap[suId].pst),
-                   gCb->u.dlCb->rguDlSap[suId].spId,
-                   dlData);
-   RETVOID;
+      RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[0].pduBuf, \
+         dlData->pduInfo[0].pduLen);
+      RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData, sizeof(RlcData));
+   } 
+
+   return;
 }
 
 /**
@@ -458,47 +422,22 @@ RlcDlRbCb   *rbCb;
  *    -# RFAILED 
  */
 
-#ifdef ANSI
-PRIVATE Void rlcTmmSndStaRsp
-(
-RlcCb            *gCb,
-RlcDlRbCb        *rbCb,                 
-MsgLen          bo,                    
-KwuDatReqInfo   *datReqInfo         
-)
-#else
-PRIVATE Void rlcTmmSndStaRsp(rbCb,bo,datReqInfo)
-RlcCb            *gCb;
-RlcDlRbCb        *rbCb;               
-MsgLen          bo;                
-KwuDatReqInfo   *datReqInfo;   
-#endif
+void rlcTmmSendBoSta(RlcCb *gCb, RlcDlRbCb *rbCb, MsgLen bo, KwuDatReqInfo *datReqInfo)
 {
-//   RguCStaRspInfo   *staRspInfo;   /* Status Response Information */
-   RlcMacBOStatus   *boStatus;      /* Buffer occupancy status information */
-   RlcRguSapCb       *rguSap;       /* SAP Information */
-
-   TRC3(rlcTmmSndStaRsp)
+   Pst              pst;            /* Post structure */    
+   RlcBoStatus      *boStatus;      /* Buffer occupancy status information */
 
-
-   rguSap = &(gCb->u.dlCb->rguDlSap[rbCb->rguSapId]);
-
-   RLC_ALLOC_SHRABL_BUF(gCb->u.dlCb->rguDlSap[rbCb->rguSapId].pst.region,
-                       gCb->u.dlCb->rguDlSap[rbCb->rguSapId].pst.pool,
-                       boStatus, sizeof(RguCStaRspInfo));
-#if (ERRCLASS & ERRCLS_ADD_RES)
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                       boStatus, sizeof(RlcBoStatus));
    if ( boStatus == NULLP )
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-            "Memory Allocation failed UEID:%d CELLID:%d",
-            rbCb->rlcId.ueId,
-            rbCb->rlcId.cellId);   
-      RETVOID;
+      DU_LOG("Memory Allocation failed UEID:%d CELLID:%d",\
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);   
+      return;
    }
-#endif /* ERRCLASS & ERRCLS_ADD_RES */
 
    boStatus->cellId = rbCb->rlcId.cellId;
-   boStatus->rnti = rbCb->rlcId.ueId;
+   boStatus->ueIdx = rbCb->rlcId.ueId;
    boStatus->commCh = TRUE;
    boStatus->lcId = rbCb->lch.lChId;
    boStatus->bo = bo;
@@ -507,12 +446,20 @@ KwuDatReqInfo   *datReqInfo;
    if(gCb->init.trc == TRUE)
    {
       /* Populate the trace params */
-      rlcLmmSendTrc(gCb, EVTRLCBOSTA, NULLP);
+      rlcLmmSendTrc(gCb, EVENT_BO_STATUS_TO_MAC, NULLP);
    }
 
-   RlcMacSendBOStatus(&rguSap->pst, rguSap->spId, boStatus);
+   /* Fill Pst structure. Copying rguSap->pst to pst to avoid any
+    * changes in rguSap->pst */
+   memset(&pst, 0, sizeof(Pst));
+   FILL_PST_RLC_TO_MAC(pst, RLC_DL_INST, EVENT_DL_DATA_TO_MAC);
 
-   RETVOID;
+   if(RlcSendBoStatusToMac(&pst, boStatus) != ROK)
+   {
+      RLC_FREE_SHRABL_BUF(pst.region, pst.pool, boStatus, sizeof(RlcBoStatus));
+   }
+
+   return;
 } 
 
 #ifdef _cplusplus
index 6777cdf..55337b3 100755 (executable)
@@ -26,8 +26,8 @@
                reassembly.This file contains following functions
                 
                   --rlcTmmQSdu
-                  --rlcTmmSndToLi
-                  --rlcTmmRcvFrmLi
+                  --rlcTmmSendToMac
+                  --rlcTmmRcvFrmMac
                   --kwTmmReEstablish 
 
      File:     kw_tmm_ul.c
@@ -109,7 +109,7 @@ U8 rrcUeCapabilityInfo[] =
 #ifdef PJ
    Pst ulPst2 ={100,100,217,0,216,0,PRIOR0,0,68,0,1,0,0};
 #endif
-  TRC2(rlcTmmRcvFrmLi
+  TRC2(rlcTmmRcvFrmMac
 
   if(1 == rrcMsgType)
   {
@@ -129,7 +129,7 @@ U8 rrcUeCapabilityInfo[] =
 
    RLOG1(L_INFO,"Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
    printf("Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
-   RlcUiKwuDatInd(&ulPst1, datIndInfo, pdu);
+   rlcSendUlDataToDu(&ulPst1, datIndInfo, pdu);
  }
  else if(2 == rrcMsgType)
  {
@@ -245,53 +245,19 @@ U8 rrcUeCapabilityInfo[] =
  *    -# RFAILED 
  */
 #ifdef CCPU_OPT
-#ifdef ANSI
-Void rlcTmmRcvFrmLi
-(
-RlcCb        *gCb,
-RlcUlRbCb    *rbCb,  
-CmLteRnti   tCrnti,  
-Buffer      *pdu      
-)
-#else
-Void rlcTmmRcvFrmLi(gCb,rbCb, tCrnti, pdu)
-RlcCb        *gCb;
-RlcUlRbCb    *rbCb;  
-CmLteRnti   tCrnti; 
-Buffer      *pdu;  
-#endif
-#else
-#ifdef ANSI
-Void rlcTmmRcvFrmLi
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,         
-Buffer     *pdu            
-)
+void rlcTmmRcvFrmMac(RlcCb *gCb, RlcUlRbCb *rbCb, CmLteRnti tCrnti, Buffer *pdu)
 #else
-Void rlcTmmRcvFrmLi(gCb,rbCb, pdu)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;         
-Buffer     *pdu;         
+void rlcTmmRcvFrmMac(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu)
 #endif
-#endif 
 {
    RlcUlRrcMsgInfo  *ulRrcMsgInfo;
    uint16_t         msgLen;
    uint16_t         copyLen;    /* Number of bytes copied */
    Pst              pst;
  
-   TRC2(rlcTmmRcvFrmLi) 
-
    gCb->genSts.pdusRecv++;
-   SFndLenMsg(pdu, (MsgLen *)&msgLen);
+   ODU_GET_MSG_LEN(pdu, (MsgLen *)&msgLen);
    gCb->genSts.bytesRecv += msgLen;
-   /* If trace flag is enabled send the trace indication */
-   if(gCb->init.trc == TRUE)
-   {
-      /* Populate the trace params */
-      rlcLmmSendTrc(gCb, EVENT_UL_RRC_MSG_TRANS_TO_DU, pdu);
-   }
   
    /* Filling UL RRC Message Info */
    RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL,
@@ -305,25 +271,25 @@ Buffer     *pdu;
          ulRrcMsgInfo->rrcMsg, msgLen);
       if (ulRrcMsgInfo->rrcMsg)
       {
-         SCpyMsgFix(pdu, 0, msgLen, ulRrcMsgInfo->rrcMsg, (MsgLen *)&copyLen);
+         ODU_COPY_MSG_TO_FIX_BUF(pdu, 0, msgLen, ulRrcMsgInfo->rrcMsg, (MsgLen *)&copyLen);
          ulRrcMsgInfo->msgLen = msgLen;
 
          /* Sending UL RRC Message transfeer to DU APP */
          memset(&pst, 0, sizeof(Pst));
-         FILL_PST_RLC_TO_DUAPP(pst, SFndProcId(), RLC_UL_INST, EVENT_UL_RRC_MSG_TRANS_TO_DU);
+         FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_RRC_MSG_TRANS_TO_DU);
          rlcSendUlRrcMsgToDu(&pst, ulRrcMsgInfo);
       }
       else
       {
-         DU_LOG("\nRLC : Memory allocation failed");
+         DU_LOG("\nRLC : rlcTmmRcvFrmMac: Memory allocation failed for UL RRC Msg");
       }
    }
    else
    {
-      DU_LOG("\nRLC : Memory allocation failed");
+      DU_LOG("\nRLC : rlcTmmRcvFrmMac: Memory allocation failed for ulRrcMsgInfo");
    }
  
-   RETVOID;
+   return;
 }
 
 /**
index 1d1db7b..e133325 100755 (executable)
         File:    kw_tmr.c
   
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="TMR";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=202;
-
 
 /* header (.h) include files */
 #include "common_def.h"
@@ -102,19 +98,7 @@ PRIVATE Void rlcBndTmrExpiry(PTR cb);
  *
  * @return  Void
 */
-#ifdef ANSI
-Void rlcStartTmr
-(
-RlcCb  *gCb,
-PTR   cb,          
-S16   tmrEvnt     
-)
-#else
-Void rlcStartTmr (gCb,cb, tmrEvnt)
-RlcCb  *gCb;
-PTR   cb;        
-S16   tmrEvnt;  
-#endif
+void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt)
 {
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
@@ -124,8 +108,6 @@ S16   tmrEvnt;
    CmTmrArg arg;
    arg.wait = 0;
 
-   TRC2(rlcStartTmr)
-
    /* kw002.201 Adjusting the wait time as per timeRes configured by layer manager */
    switch (tmrEvnt)
    {
@@ -200,7 +182,7 @@ S16   tmrEvnt;
 #endif
       default:
       {
-         RLOG0(L_ERROR, "Invalid tmr Evnt");
+         DU_LOG("\nRLC : rlcStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
       }
    } 
 
@@ -215,7 +197,7 @@ S16   tmrEvnt;
       cmPlcCbTq(&arg);
    }
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -228,26 +210,13 @@ S16   tmrEvnt;
  *
  * @return  Void
 */
-#ifdef ANSI
-Void rlcStopTmr
-(
-RlcCb   *gCb,
-PTR    cb,
-U8     tmrType
-)
-#else
-Void rlcStopTmr (gCb, cb, tmrType)
-RlcCb   *gCb;
-PTR    cb; 
-U8     tmrType;
-#endif
+void rlcStopTmr(RlcCb *gCb, PTR cb, uint8_t tmrType)
 {
    CmTmrArg   arg;
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
    RlcL2MeasEvtCb *measEvtCb = NULLP;
 #endif
-   TRC2(rlcStopTmr)
 
    arg.timers = NULLP;
 
@@ -295,7 +264,7 @@ U8     tmrType;
 #endif
       default:
       {
-         RLOG0(L_ERROR, "Invalid tmr Evnt");
+         DU_LOG("\nRLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType);
       }
    } 
    if (tmrType != TMR0)
@@ -309,7 +278,7 @@ U8     tmrType;
       cmRmvCbTq(&arg);
    }
    
-   RETVOID;
+   return;
 }
 
 /**
@@ -399,22 +368,8 @@ S16   tmrEvnt;
  *      -# ROK 
  *      -# RFAILED 
 */
-#ifdef ANSI
-Bool rlcChkTmr
-(
-RlcCb   *gCb,
-PTR    cb,
-S16    tmrEvnt
-)
-#else
-Bool rlcChkTmr(gCb,cb, tmrEvnt)
-RlcCb   *gCb;
-PTR    cb;
-S16    tmrEvnt;
-#endif
+bool rlcChkTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt)
 {
-   TRC2(rlcChkTmr)
-
    switch (tmrEvnt)
    {
       case RLC_EVT_UMUL_REORD_TMR:
@@ -443,11 +398,11 @@ S16    tmrEvnt;
       }
       default:
       {
-         RLOG0(L_ERROR, "Invalid tmr Evnt");
+         DU_LOG("\nRLC : rlcChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
       }
    } 
 
-   return (FALSE);
+   return FALSE;
 }
 
 /**
index 8d30dc9..abc6c49 100755 (executable)
@@ -135,164 +135,164 @@ typedef S16 (*UdxL2MeasStopReq) ARGS((Pst* pst,
 #endif
 
 #ifdef LCUDX
-EXTERN S16 cmPkUdxBndCfm ARGS((Pst* pst, SuId suId,U8  status ));
-EXTERN S16 cmPkUdxBndReq ARGS((Pst* pst, SuId suId,SpId  spId ));
-EXTERN S16 cmPkUdxUbndReq ARGS((Pst* pst, SuId suId,Reason reason));
-EXTERN S16 cmPkUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
-EXTERN S16 cmPkUdxCfgCfm ARGS(( Pst* pst,SuId suId,RlcCfgCfmInfo *cfmInfo));
-EXTERN S16 cmPkUdxStaUpdReq ARGS((Pst* pst,SpId spId,CmLteRlcId *rlcId,
+S16 cmPkUdxBndCfm ARGS((Pst* pst, SuId suId,U8  status ));
+S16 cmPkUdxBndReq ARGS((Pst* pst, SuId suId,SpId  spId ));
+S16 cmPkUdxUbndReq ARGS((Pst* pst, SuId suId,Reason reason));
+S16 cmPkUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
+S16 cmPkUdxCfgCfm ARGS(( Pst* pst,SuId suId,RlcCfgCfmInfo *cfmInfo));
+S16 cmPkUdxStaUpdReq ARGS((Pst* pst,SpId spId,CmLteRlcId *rlcId,
                                RlcUdxStaPdu         *pStaPdu ));
-EXTERN S16 cmPkUdxUeIdChgReq ARGS((Pst *pst, SpId spId, U32 transId, 
+S16 cmPkUdxUeIdChgReq ARGS((Pst *pst, SpId spId, U32 transId, 
                                   CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
-EXTERN S16 cmPkUdxUeIdChgCfm ARGS((Pst *pst, SuId suId, U32 transId, 
+S16 cmPkUdxUeIdChgCfm ARGS((Pst *pst, SuId suId, U32 transId, 
                                    CmStatus status));
 
 
-EXTERN S16 cmPkUdxStaUpdCfm ARGS((Pst* pst,SuId  suId,CmLteRlcId  *rlcId,
+S16 cmPkUdxStaUpdCfm ARGS((Pst* pst,SuId  suId,CmLteRlcId  *rlcId,
                              RlcUdxBufLst  *pBufLst));
 
-EXTERN S16 cmPkUdxStaPduReq ARGS(( Pst* pst,SpId  spId, CmLteRlcId *rlcId,
+S16 cmPkUdxStaPduReq ARGS(( Pst* pst,SpId  spId, CmLteRlcId *rlcId,
                              RlcUdxDlStaPdu  *pStaPdu ));
-EXTERN S16 cmPkUdxStaProhTmrStart ARGS((Pst *pst, 
+S16 cmPkUdxStaProhTmrStart ARGS((Pst *pst, 
                                         SpId spId, 
                                         CmLteRlcId *rlcId));
 
 #ifdef LTE_L2_MEAS
-EXTERN S16 cmPkUdxL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measReqEvt)); 
-EXTERN S16 cmPkUdxL2MeasSendReq ARGS((Pst *pst, U8 measType)); 
-EXTERN S16 cmPkUdxL2MeasStopReq ARGS((Pst *pst, U8 measType)); 
+S16 cmPkUdxL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measReqEvt)); 
+S16 cmPkUdxL2MeasSendReq ARGS((Pst *pst, U8 measType)); 
+S16 cmPkUdxL2MeasStopReq ARGS((Pst *pst, U8 measType)); 
 #endif
 
-EXTERN S16 cmUnpkUdxBndCfm ARGS((UdxBndCfm func,Pst* pst, Buffer *mBuf ));
-EXTERN S16 cmUnpkUdxBndReq ARGS((UdxBndReq func,Pst* pst, Buffer *mBuf ));
-EXTERN S16 cmUnpkUdxUbndReq ARGS((UdxUbndReq func,Pst* pst, Buffer *mBuf));
-EXTERN S16 cmUnpkUdxCfgReq ARGS((UdxCfgReq func,Pst *pst, Buffer *mBuf));
-EXTERN S16 cmUnpkUdxCfgCfm ARGS((UdxCfgCfm func , Pst* pst,Buffer *mBuf));
-EXTERN S16 cmUnpkUdxStaUpdReq ARGS((UdxStaUpdReq func,Pst* pst,Buffer *mBuf));
-EXTERN S16 cmUnpkUdxUeIdChgReq ARGS((UdxUeIdChgReq func,Pst *pst, Buffer *mBuf)); 
-EXTERN S16 cmUnpkUdxUeIdChgCfm ARGS((UdxUeIdChgCfm func,Pst *pst, Buffer *mBuf)); 
+S16 cmUnpkUdxBndCfm ARGS((UdxBndCfm func,Pst* pst, Buffer *mBuf ));
+S16 cmUnpkUdxBndReq ARGS((UdxBndReq func,Pst* pst, Buffer *mBuf ));
+S16 cmUnpkUdxUbndReq ARGS((UdxUbndReq func,Pst* pst, Buffer *mBuf));
+S16 cmUnpkUdxCfgReq ARGS((UdxCfgReq func,Pst *pst, Buffer *mBuf));
+S16 cmUnpkUdxCfgCfm ARGS((UdxCfgCfm func , Pst* pst,Buffer *mBuf));
+S16 cmUnpkUdxStaUpdReq ARGS((UdxStaUpdReq func,Pst* pst,Buffer *mBuf));
+S16 cmUnpkUdxUeIdChgReq ARGS((UdxUeIdChgReq func,Pst *pst, Buffer *mBuf)); 
+S16 cmUnpkUdxUeIdChgCfm ARGS((UdxUeIdChgCfm func,Pst *pst, Buffer *mBuf)); 
 
-EXTERN S16 cmUnpkUdxStaUpdCfm ARGS((UdxStaUpdCfm func,Pst* pst,Buffer *mBuf));
+S16 cmUnpkUdxStaUpdCfm ARGS((UdxStaUpdCfm func,Pst* pst,Buffer *mBuf));
 
-EXTERN S16 cmUnpkUdxStaPduReq ARGS((UdxStaPduReq func, Pst* pst, Buffer *mBuf));
+S16 cmUnpkUdxStaPduReq ARGS((UdxStaPduReq func, Pst* pst, Buffer *mBuf));
 
-EXTERN S16 cmUnpkUdxStaProhTmrStart ARGS((UdxStaProhTmrStart func,
+S16 cmUnpkUdxStaProhTmrStart ARGS((UdxStaProhTmrStart func,
                                           Pst* pst,
                                           Buffer *mBuf));
 
 #ifdef LTE_L2_MEAS
-EXTERN S16 cmUnpkUdxL2MeasReq ARGS((UdxL2MeasReq func, Pst* pst, Buffer *mBuf));
-EXTERN S16 cmUnpkUdxL2MeasSendReq ARGS((UdxL2MeasSendReq func, Pst* pst, Buffer *mBuf));
-EXTERN S16 cmUnpkUdxL2MeasStopReq ARGS((UdxL2MeasStopReq func, Pst* pst, Buffer *mBuf));
+S16 cmUnpkUdxL2MeasReq ARGS((UdxL2MeasReq func, Pst* pst, Buffer *mBuf));
+S16 cmUnpkUdxL2MeasSendReq ARGS((UdxL2MeasSendReq func, Pst* pst, Buffer *mBuf));
+S16 cmUnpkUdxL2MeasStopReq ARGS((UdxL2MeasStopReq func, Pst* pst, Buffer *mBuf));
 #endif
 #endif
 
 #ifdef KW
-EXTERN S16 rlcUlUdxBndReq ARGS((Pst* pst, SuId suId, SpId spId));
+S16 rlcUlUdxBndReq ARGS((Pst* pst, SuId suId, SpId spId));
 
-EXTERN S16 rlcDlUdxBndReq ARGS((Pst* pst, SuId suId, SpId spId));
+S16 rlcDlUdxBndReq ARGS((Pst* pst, SuId suId, SpId spId));
 
-EXTERN S16 rlcDlUdxBndCfm ARGS((Pst* pst, SuId suId, U8 status));
+S16 rlcDlUdxBndCfm ARGS((Pst* pst, SuId suId, U8 status));
 
-EXTERN S16 rlcUlUdxBndCfm ARGS((Pst* pst, SuId suId, U8 status));
+S16 rlcUlUdxBndCfm ARGS((Pst* pst, SuId suId, U8 status));
 
-EXTERN S16 rlcDlUdxCfgCfm ARGS((Pst* pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
+S16 rlcDlUdxCfgCfm ARGS((Pst* pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
 
-EXTERN S16 rlcUlUdxCfgCfm ARGS((Pst* pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
+S16 rlcUlUdxCfgCfm ARGS((Pst* pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
 
-EXTERN S16 rlcDlUdxUeIdChgCfm ARGS((Pst *pst, 
+S16 rlcDlUdxUeIdChgCfm ARGS((Pst *pst, 
                                    SuId suId, 
                                    U32 transId,  
                                    CmStatus status));
 
-EXTERN S16 rlcUlUdxUeIdChgCfm ARGS((Pst *pst, 
+S16 rlcUlUdxUeIdChgCfm ARGS((Pst *pst, 
                                    SuId suId, 
                                    U32 transId, 
                                    CmStatus status));
 
-EXTERN S16 rlcUlUdxUbndReq ARGS((Pst* pst, SuId suId, Reason reason));
+S16 rlcUlUdxUbndReq ARGS((Pst* pst, SuId suId, Reason reason));
 
-EXTERN S16 rlcDlUdxUbndReq ARGS((Pst* pst, SuId suId, Reason reason));
+S16 rlcDlUdxUbndReq ARGS((Pst* pst, SuId suId, Reason reason));
 
-EXTERN S16 rlcUlUdxUeIdChgReq ARGS((Pst *pst, 
+S16 rlcUlUdxUeIdChgReq ARGS((Pst *pst, 
                                    SpId spId, 
                                    U32 transId, 
                                    CkwUeInfo *ueInfo, 
                                    CkwUeInfo *newUeInfo));
 
-EXTERN S16 rlcUlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
+S16 rlcUlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
 
-EXTERN S16 rlcDlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
+S16 rlcDlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
 
-EXTERN S16 rlcUlUdxStaUpdReq ARGS((Pst* pst,
+uint8_t rlcUlUdxStaUpdReq ARGS((Pst* pst,
                                   SpId spId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxStaPdu *pStaPdu));
 
-EXTERN S16 rlcDlUdxStaUpdReq ARGS((Pst* pst,
+S16 rlcDlUdxStaUpdReq ARGS((Pst* pst,
                                   SpId spId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxStaPdu *pStaPdu));
 
-EXTERN S16 rlcDlUdxStaUpdCfm ARGS((Pst* pst,
+S16 rlcDlUdxStaUpdCfm ARGS((Pst* pst,
                                   SuId suId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxBufLst *pBufLst));
 
-EXTERN S16 rlcUlUdxStaUpdCfm ARGS((Pst* pst,
+S16 rlcUlUdxStaUpdCfm ARGS((Pst* pst,
                                   SuId suId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxBufLst *pBufLst));
 
-EXTERN S16 rlcUlUdxStaPduReq ARGS((Pst *pst,
+uint8_t rlcUlUdxStaPduReq ARGS((Pst *pst,
                                   SpId spId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxDlStaPdu *pStaPdu ));
 
-EXTERN S16 rlcDlUdxStaPduReq ARGS((Pst *pst,
+S16 rlcDlUdxStaPduReq ARGS((Pst *pst,
                                   SpId spId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxDlStaPdu *pStaPdu));
 
-EXTERN S16 rlcDlUdxUeIdChgReq ARGS((Pst *pst, 
+S16 rlcDlUdxUeIdChgReq ARGS((Pst *pst, 
                                    SpId spId, 
                                    U32 transId, 
                                    CkwUeInfo *ueInfo, 
                                    CkwUeInfo *newUeInfo));
 
-EXTERN S16 rlcDlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
+S16 rlcDlUdxCfgReq ARGS((Pst *pst, SpId spId, RlcCfgInfo *cfgInfo));
 
 
-EXTERN S16 rlcUlUdxStaUpdCfm ARGS((Pst* pst,
+S16 rlcUlUdxStaUpdCfm ARGS((Pst* pst,
                                   SuId suId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxBufLst *pBufLst));
 
-EXTERN S16 rlcDlUdxStaPduReq ARGS((Pst *pst,
+S16 rlcDlUdxStaPduReq ARGS((Pst *pst,
                                   SpId spId,
                                   CmLteRlcId *rlcId,
                                   RlcUdxDlStaPdu *pStaPdu));
 
-EXTERN S16 rlcUlUdxStaProhTmrStart ARGS((Pst *pst,
+S16 rlcUlUdxStaProhTmrStart ARGS((Pst *pst,
                                         SpId spId,
                                         CmLteRlcId *rlcId ));
 
-EXTERN S16 rlcDlUdxStaProhTmrStart ARGS((Pst *pst,
+uint8_t rlcDlUdxStaProhTmrStart ARGS((Pst *pst,
                                         SpId spId,
                                         CmLteRlcId *rlcId ));
 
 #ifdef LTE_L2_MEAS
-EXTERN S16 rlcDlUdxL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measReqEvt)); 
+S16 rlcDlUdxL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measReqEvt)); 
 
-EXTERN S16 rlcDlUdxL2MeasSendReq ARGS((Pst *pst, U8 status)); 
+S16 rlcDlUdxL2MeasSendReq ARGS((Pst *pst, U8 status)); 
 
-EXTERN S16 rlcDlUdxL2MeasStopReq ARGS((Pst *pst, U8 status)); 
+S16 rlcDlUdxL2MeasStopReq ARGS((Pst *pst, U8 status)); 
 
-EXTERN S16 rlcUlUdxL2MeasReq ARGS((Pst* pst, RlcL2MeasReqEvt *measReqEvt));
+S16 rlcUlUdxL2MeasReq ARGS((Pst* pst, RlcL2MeasReqEvt *measReqEvt));
 
-EXTERN S16 rlcUlUdxL2MeasSendReq ARGS((Pst *pst, U8 status));
+S16 rlcUlUdxL2MeasSendReq ARGS((Pst *pst, U8 status));
 
-EXTERN S16 rlcUlUdxL2MeasStopReq ARGS((Pst* pst, U8 measType));
+S16 rlcUlUdxL2MeasStopReq ARGS((Pst* pst, U8 measType));
 #endif
 
 #endif
index 1155b9d..6e3ee49 100755 (executable)
@@ -546,7 +546,7 @@ RlcUdxDlStaPdu   *pStaPdu;
    }
    
    AMDL.pStaPdu = pStaPdu;
-   rlcAmmSendDStaRsp(tRlcCb, rbCb, &AMDL);             
+   rlcAmmSendDedLcBoStatus(tRlcCb, rbCb, &AMDL);             
 
    return  (ROK);
 }
index fdf4801..baafe66 100755 (executable)
@@ -428,23 +428,8 @@ CmStatus      status;
 } /* end of rlcDlUdxBndCfm */
 
 
-
-#ifdef ANSI
-S16 rlcDlUdxStaProhTmrStart
-(
-Pst                 *pst,                       /* post structure */
-SuId                suId,                      /* Service User Id */
-CmLteRlcId          *rlcId
-)
-#else
-S16 rlcDlUdxStaProhTmrStart(pst, suId, rlcId)
-Pst           *pst;            /* post structure */
-SuId          suId;            /* Service User Id */
-CmLteRlcId    *rlcId;
-#endif
+uint8_t rlcDlUdxStaProhTmrStart(Pst *pst, SuId suId, CmLteRlcId *rlcId)
 {
-   TRC3(rlcDlUdxStaProhTmrStart)
-
    /* jump to specific primitive depending on configured selector */
    (*rlcDlUdxStaProhTmrStartMt[pst->selector])(pst, suId, rlcId);
 
index 7b6916a..a6c3fa8 100755 (executable)
@@ -622,16 +622,8 @@ CkwUeInfo *newUeInfo;          /* Config Info */
 
 
 
-S16  rlcUlUdxStaPduReq
-(
-Pst*                pst,
-SpId                spId,
-CmLteRlcId          *rlcId,
-RlcUdxDlStaPdu       *pStaPdu
-)
+uint8_t rlcUlUdxStaPduReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxDlStaPdu *pStaPdu)
 {
-   TRC3(rlcUlUdxStaPduReq);
-
    return ((*rlcUlUdxStaPduReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
 }
 
@@ -647,25 +639,8 @@ RlcUdxDlStaPdu       *pStaPdu
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-S16  rlcUlUdxStaUpdReq
-(
-Pst*                pst,
-SpId                spId,
-CmLteRlcId          *rlcId,
-RlcUdxStaPdu         *pStaPdu
-)
-#else
-S16 rlcUlUdxStaUpdReq(pst, rlcId, pStaPdu)
-Pst*                pst;
-SpId                spId;
-CmLteRlcId          *rlcId;
-RlcUdxStaPdu         *pStaPdu;
-#endif
+uint8_t rlcUlUdxStaUpdReq(Pst* pst, SpId spId, CmLteRlcId *rlcId, RlcUdxStaPdu *pStaPdu)
 {
-
-   TRC3(rlcUlUdxStaUpdReq);
-
    return ((*rlcUlUdxStaUpdReqMt[pst->selector])(pst,spId, rlcId, pStaPdu));
 } /* end of RlcUlmDlmStaUpd*/
 
index ac6dc98..ca9c89d 100755 (executable)
@@ -60,9 +60,9 @@ static int RLOG_FILE_ID=204;
 #include "kw_dl.x"
 #include "kw_ul.x"
 
-#include "rlc_utils.h"
 #include "du_app_rlc_inf.h"
 #include "rlc_mgr.h"
+#include "rlc_utils.h"
 
 #define RLC_MODULE RLC_DBGMASK_UDX
 /* local defines */
@@ -286,7 +286,7 @@ RlcCfgCfmInfo   *cfmInfo;
    }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */
    rlcHdlCrlcUlCfgReq(tRlcCb,cfgTmpData, cfmInfo, cfgCfm);
-   FILL_PST_RLC_TO_DUAPP(rspPst, tRlcCb->genCfg.lmPst.dstProcId, RLC_UL_INST, EVENT_RLC_UL_UE_CREATE_RSP);
+   FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UL_UE_CREATE_RSP);
    SendRlcUlUeCreateRspToDu(&rspPst, cfgCfm);
 
    /* free the memory from DL */
index 0bb8e36..daf15f8 100755 (executable)
@@ -31,7 +31,7 @@
 
         --RlcUiKwuBndReq
         --RlcUiKwuUbndReq
-        --RlcUiKwuDatReq
+        --rlcProcDlData
         --RlcUiKwuDiscSduReq 
 
      File:     kw_uim.c
@@ -781,36 +781,22 @@ Reason   reason;
  * @param[in] datreq  Data Request Information
  * @param[in] mBuf        Data Buffer (SDU) 
  *
- * @return  S16
+ * @return  uint8_t
  *    -# ROK 
  *    -# RFAILED
  */
-#ifdef ANSI
-S16 RlcUiKwuDatReq
-(
-Pst             *pst,   
-KwuDatReqInfo   *datReq, 
-Buffer          *mBuf   
-)
-#else
-S16 RlcUiKwuDatReq(pst, datReq, mBuf)
-Pst             *pst;  
-KwuDatReqInfo   *datReq; 
-Buffer          *mBuf;  
-#endif
+uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo *datReq, Buffer *mBuf)
 {
-   S16          ret = ROK;   /* Return Value */
+   uint8_t       ret = ROK;   /* Return Value */
    RlcDlRbCb     *rbCb;       /* RB Control Block */
    RlcCb         *tRlcCb;
 
-   TRC3(RlcUiKwuDatReq)
-
    DU_LOG("\nRLC : Received DL Data");
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(pst->dstInst >= MAX_RLC_INSTANCES)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 #endif
@@ -821,7 +807,7 @@ Buffer          *mBuf;
    rlcDbmFetchDlRbCbByRbId(tRlcCb, &datReq->rlcId, &rbCb);
    if(!rbCb)
    {
-      RLOG_ARG2(L_WARNING, DBG_UEID,datReq->rlcId.ueId, "CellId[%u]:DL RbId [%d] not found",
+      DU_LOG("\nRLC : CellId[%u]:DL RbId [%d] not found",
             datReq->rlcId.cellId,datReq->rlcId.rbId);
       RLC_FREE_BUF(mBuf);
 
@@ -860,11 +846,11 @@ Buffer          *mBuf;
       }
       default:
       {
-         RLOG0(L_ERROR, "Invalid RB Mode");
+         DU_LOG("\nRLC : Invalid RB Mode");
          break;
       }
    }
-   return (ret);
+   return ret;
 } 
 
 \f
index 4474eb2..2e1484a 100755 (executable)
@@ -348,65 +348,65 @@ typedef struct rlcUlCfgTmpData
  *                    Configuration Functions 
  ***************************************************************************/
 
-EXTERN S16 rlcValidateRbCfgParams ARGS ((RlcCb *gCb,
+S16 rlcValidateRbCfgParams ARGS ((RlcCb *gCb,
                                         CmLteRnti   ueId,
                                         CmLteCellId cellId,
                                         RlcEntCfgInfo  *cfgToValidate,
                                         CmStatus        *status));
-EXTERN S16 rlcCfgValidateUlRb ARGS (( RlcCb *gCb,
+S16 rlcCfgValidateUlRb ARGS (( RlcCb *gCb,
                                     RlcEntCfgInfo *cfgToValidate,
                                     RlcUlEntTmpData *cfgInfo, 
                                     RlcUlCfgTmpData *cfg));
 
-EXTERN S16 rlcCfgRollBackUlRb ARGS ((RlcCb *gCb,
+S16 rlcCfgRollBackUlRb ARGS ((RlcCb *gCb,
                                     CmLteRnti ueId,
                                     RlcEntCfgInfo *cfgToValidate,
                                     RlcUlEntTmpData *cfgTempData));
 
-EXTERN Void rlcCfgApplyUlRb ARGS ((RlcCb *gCb,
+Void rlcCfgApplyUlRb ARGS ((RlcCb *gCb,
                                   RlcEntCfgInfo *cfgToAply,
                                   RlcUlEntTmpData *cfgTmpData,
                                   RlcUlCfgTmpData *cfgTmpInfo));
 
-EXTERN S16 rlcCfgValidateReEstRb ARGS ((RlcCb *gCb,
+S16 rlcCfgValidateReEstRb ARGS ((RlcCb *gCb,
                                        CmLteRnti  ueId,
                                        CmLteCellId cellId,
                                        RlcEntCfgInfo *cfgToValidate,
                                        RlcUlEntTmpData   *cfgTmpData));
 
-EXTERN Void rlcCfgApplyReEstUlRb ARGS ((RlcCb *gCb,
+Void rlcCfgApplyReEstUlRb ARGS ((RlcCb *gCb,
                                       CmLteRnti ueId,
                                       CmLteCellId cellId,
                                       Bool sndReEstInd,
                                       RlcUlEntTmpData *cfgTmpData));
 
-EXTERN Void rlcCfgApplyDelUlCell ARGS ((RlcCb *gCb,
+Void rlcCfgApplyDelUlCell ARGS ((RlcCb *gCb,
                                       RlcUlCfgTmpData *cfgTmpData));
 
-EXTERN S16 rlcCfgValidateDelUlCell ARGS ((RlcCb *gCb,
+S16 rlcCfgValidateDelUlCell ARGS ((RlcCb *gCb,
                                          CmLteCellId cellId,
                                          RlcEntCfgInfo *cfgToValidate,
                                          RlcUlEntTmpData   *cfgTmpData,
                                          RlcUlCfgTmpData *cfgInfo));
 
-EXTERN S16 rlcCfgValidateDelUlUe ARGS ((RlcCb *gCb,
+S16 rlcCfgValidateDelUlUe ARGS ((RlcCb *gCb,
                                        RlcEntCfgInfo *cfgToValidate,
                                        RlcUlEntTmpData *cfgTmpData,
                                        RlcUlCfgTmpData *cfgInfo));
 
-EXTERN Void rlcCfgApplyDelUlUe ARGS ((RlcCb *gCb,
+Void rlcCfgApplyDelUlUe ARGS ((RlcCb *gCb,
                                     RlcUlCfgTmpData *cfgTmpData));
 
-EXTERN Void rlcUlHdlCfgReq ARGS ((RlcCb *gCb,
+Void rlcUlHdlCfgReq ARGS ((RlcCb *gCb,
                                      RlcUlCfgTmpData *cfgInfo,
                                      RlcCfgInfo *cfg));
 
-EXTERN Void rlcCfgApplyUlUeIdChng ARGS ((RlcCb *gCb,
+Void rlcCfgApplyUlUeIdChng ARGS ((RlcCb *gCb,
                                         CkwUeInfo *ueInfo,
                                         CkwUeInfo *newUeInfo,
                                         RlcUlCfgTmpData *cfgTmpInfo));
 
-EXTERN S16 rlcCfgValidateUeIdChng ARGS ((RlcCb *gCb,
+S16 rlcCfgValidateUeIdChng ARGS ((RlcCb *gCb,
                                         CkwUeInfo *ueInfo,
                                         CkwUeInfo *newUeInfo,
                                         RlcUlCfgTmpData *cfgTmpInfo));
@@ -414,188 +414,192 @@ EXTERN S16 rlcCfgValidateUeIdChng ARGS ((RlcCb *gCb,
 /****************************************************************************
  *                    DBM module Functions 
  ***************************************************************************/
-EXTERN S16 rlcDbmUlInit ARGS ((RlcCb *gCb));
+S16 rlcDbmUlInit ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcDbmUlDeInit ARGS ((RlcCb *gCb));
+Void rlcDbmUlDeInit ARGS ((RlcCb *gCb));
 
-EXTERN S16 rlcDbmAddUlUeCb ARGS ((RlcCb *gCb,
+S16 rlcDbmAddUlUeCb ARGS ((RlcCb *gCb,
                                     CmLteRnti ueId,
                                     CmLteCellId cellId,
                                     RlcUlUeCb *ueCb));
 
-EXTERN S16 rlcDbmFetchUlUeCb ARGS ((RlcCb *gCb,
+uint8_t rlcDbmFetchUlUeCb ARGS ((RlcCb *gCb,
                                    CmLteRnti ueId,
                                    CmLteCellId cellId,
                                    RlcUlUeCb **ueCb));
 
-EXTERN Void rlcDbmDelUlUeCb ARGS ((RlcCb *gCb,   
+Void rlcDbmDelUlUeCb ARGS ((RlcCb *gCb,   
                                   RlcUlUeCb *ueCb,
                                   Bool abortFlag));
 
-EXTERN Void rlcDbmDelAllUlUe ARGS ((RlcCb *gCb));
+Void rlcDbmDelAllUlUe ARGS ((RlcCb *gCb));
 
-EXTERN S16 rlcDbmAddUlCellCb ARGS ((RlcCb *gCb,
+S16 rlcDbmAddUlCellCb ARGS ((RlcCb *gCb,
                                       CmLteCellId cellId,
                                       RlcUlCellCb *cellCb));
 
-EXTERN Void rlcDbmFetchUlCellCb ARGS ((RlcCb *gCb, 
+Void rlcDbmFetchUlCellCb ARGS ((RlcCb *gCb, 
                                       CmLteCellId cellId,
                                       RlcUlCellCb **cellCb));
 
-EXTERN Void rlcDbmDelUlCellCb ARGS ((RlcCb *gCb,  
+Void rlcDbmDelUlCellCb ARGS ((RlcCb *gCb,  
                                    RlcUlCellCb *cellCb));
 
-EXTERN Void rlcDbmDelAllUlCell ARGS ((RlcCb *gCb));
+Void rlcDbmDelAllUlCell ARGS ((RlcCb *gCb));
 
-EXTERN Void rlcDbmFetchUlRbCbByRbId ARGS ((RlcCb *gCb, 
+Void rlcDbmFetchUlRbCbByRbId ARGS ((RlcCb *gCb, 
                                           CmLteRlcId *rlcId, 
                                           RlcUlRbCb **rbCb));
 
-EXTERN Void rlcDbmFetchUlRbCbFromLchId ARGS ((RlcCb *gCb, 
+Void rlcDbmFetchUlRbCbFromLchId ARGS ((RlcCb *gCb, 
                                              CmLteRnti ueId, 
                                              CmLteCellId cellId, 
                                              CmLteLcId lcId,  
                                              RlcUlRbCb **rbCb));
 
-EXTERN Void rlcDbmDelAllUlRb ARGS ((RlcCb *gCb, 
+Void rlcDbmDelAllUlRb ARGS ((RlcCb *gCb, 
                                    RlcUlRbCb **rbCbLst, 
                                    U8 numRbCb));
 
-EXTERN S16 rlcDbmAddUlTransaction ARGS((RlcCb *gCb, RlcUlCfgTmpData *cfg));
+S16 rlcDbmAddUlTransaction ARGS((RlcCb *gCb, RlcUlCfgTmpData *cfg));
 
-EXTERN S16 rlcDbmFindUlTransaction ARGS((RlcCb *gCb, 
+S16 rlcDbmFindUlTransaction ARGS((RlcCb *gCb, 
                                         U32 transId, 
                                         RlcUlCfgTmpData **cfg));
 
-EXTERN S16 rlcDbmDelUlTransaction ARGS((RlcCb *gCb, RlcUlCfgTmpData *cfg));
+S16 rlcDbmDelUlTransaction ARGS((RlcCb *gCb, RlcUlCfgTmpData *cfg));
 
-EXTERN S16 rlcDbmDelAllUlTransactions ARGS((RlcCb *gCb));
+S16 rlcDbmDelAllUlTransactions ARGS((RlcCb *gCb));
 
-EXTERN Void rlcDbmUlShutdown ARGS ((RlcCb *gCb));
+Void rlcDbmUlShutdown ARGS ((RlcCb *gCb));
 
 /****************************************************************************
  *                    Transparent Mode Functions 
  ***************************************************************************/
 #ifdef CCPU_OPT
-EXTERN Void rlcTmmRcvFrmLi ARGS ((RlcCb *gCb, 
-                                       RlcUlRbCb *rbCb,
-                                       CmLteRnti tCrnti, 
-                                       Buffer *pdu));
-#else /* CCPU_OPT */
-EXTERN Void rlcTmmRcvFrmLi ARGS ((RlcCb *gCb,
-                                       RlcUlRbCb *rbCb,
-                                       Buffer *pdu));
-#endif /* CCPU_OPT */
-
-EXTERN Void rlcTmmUlReEstablish ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
+void rlcTmmRcvFrmMac ARGS ((RlcCb *gCb,
+                            RlcUlRbCb *rbCb,
+                           CmLteRnti   tCrnti,
+                            Buffer *pdu));
+
+#else
+void rlcTmmRcvFrmMac ARGS ((RlcCb *gCb,
+                            RlcUlRbCb *rbCb,
+                            Buffer *pdu));
+#endif                                
+
+Void rlcTmmUlReEstablish ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
 
 /****************************************************************************
  *                    Unacknowledged Mode Functions 
  ***************************************************************************/
 #ifdef LTE_L2_MEAS
-EXTERN Void rlcUmmProcessPdus ARGS((RlcCb *gCb,
+Void rlcUmmProcessPdus ARGS((RlcCb *gCb,
                                   RlcUlRbCb *rbCb, 
                                   KwPduInfo *pduInfo,
                                   U32 ttiCnt));
 #else 
-EXTERN Void rlcUmmProcessPdus ARGS ((RlcCb *gCb, 
+Void rlcUmmProcessPdus ARGS ((RlcCb *gCb, 
                                     RlcUlRbCb *rbCb,
                                     KwPduInfo *pduInfo));
 #endif 
-EXTERN Void rlcUmmUlReEstablish ARGS ((RlcCb *gCb, 
+Void rlcUmmUlReEstablish ARGS ((RlcCb *gCb, 
                                      CmLteRlcId *rlcId, 
                                      RlcUlRbCb *rbCb));
 
-EXTERN Void rlcUmmReOrdTmrExp ARGS((RlcCb *gCb, RlcUlRbCb  *rbCb));
+Void rlcUmmReOrdTmrExp ARGS((RlcCb *gCb, RlcUlRbCb  *rbCb));
 
 
-EXTERN Void rlcUmmFreeUlRbCb ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb)); 
+Void rlcUmmFreeUlRbCb ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb)); 
 
 /****************************************************************************
  *                    Acknowledged Mode Functions 
  ***************************************************************************/
-EXTERN Void rlcAmmUlReEstablish ARGS((RlcCb *gCb, 
+Void rlcAmmUlReEstablish ARGS((RlcCb *gCb, 
                                      CmLteRlcId rlcId, 
                                      Bool sndReEst,
                                      RlcUlRbCb *rbCb));
 #ifdef LTE_L2_MEAS
-EXTERN Void rlcAmmProcessPdus ARGS((RlcCb *gCb,
+Void rlcAmmProcessPdus ARGS((RlcCb *gCb,
                                   RlcUlRbCb *rbCb, 
                                   KwPduInfo *pduInfo,
                                   U32 ttiCnt));
 #else
-EXTERN Void rlcAmmProcessPdus ARGS((RlcCb *gCb, 
+Void rlcAmmProcessPdus ARGS((RlcCb *gCb, 
                                   RlcUlRbCb *rbCb,
                                   KwPduInfo *pduInfo));
 #endif 
 
-EXTERN Void rlcAmmReOrdTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb));
+Void rlcAmmReOrdTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb));
 
-EXTERN Void rlcAmmStaProTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb));
+Void rlcAmmStaProTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb));
 
-EXTERN Void rlcAmmFreeUlRbCb ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
+Void rlcAmmFreeUlRbCb ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb));
 
 /****************************************************************************
  *                    Utility Functions 
  ***************************************************************************/
-EXTERN Void rlcUtlStoreRecBuf ARGS ((CmLListCp        *recBufLst,
+Void rlcUtlStoreRecBuf ARGS ((CmLListCp        *recBufLst,
                                     RlcAmRecBuf       *recBuf,
                                     RlcSn              sn
                                    ));
-EXTERN RlcAmRecBuf* rlcUtlGetRecBuf ARGS ((CmLListCp        *recBufLst,
+RlcAmRecBuf* rlcUtlGetRecBuf ARGS ((CmLListCp        *recBufLst,
                                   RlcSn              sn
                                   ));
-EXTERN Void rlcUtlDelRecBuf ARGS ((CmLListCp        *recBufLst,
+Void rlcUtlDelRecBuf ARGS ((CmLListCp        *recBufLst,
                                   RlcAmRecBuf       *recBuf,
                                   RlcCb              *gCb
                                   ));
 
-EXTERN S16 rlcUtlRcvFrmLi ARGS ((RlcCb *gCb, KwDatIndInfo *datIndInfo));
+uint8_t rlcUtlRcvFrmMac ARGS ((RlcCb *gCb, KwDatIndInfo *datIndInfo));
 
-EXTERN S16 rlcUtlSndDatInd ARGS ((RlcCb *gCb,RlcUlRbCb *rbCb, Buffer *sdu));
+uint8_t rlcUtlSendUlDataToDu ARGS ((RlcCb *gCb,RlcUlRbCb *rbCb, Buffer *sdu));
 
 #ifdef LTE_L2_MEAS
-EXTERN S16 rlcUtlHdlL2TmrExp   ARGS (( RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
+S16 rlcUtlHdlL2TmrExp   ARGS (( RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
 
-EXTERN  Void rlcUtlCalUlIpThrPutIncTTI ARGS ((RlcCb *gCb, 
+Void rlcUtlCalUlIpThrPutIncTTI ARGS ((RlcCb *gCb, 
                                              RlcUlRbCb  *rbCb,
                                              U32 ttiCnt));
 
-EXTERN Void rlcUtlCalUlIpThrPut ARGS((RlcCb *gCb, 
+Void rlcUtlCalUlIpThrPut ARGS((RlcCb *gCb, 
                                      RlcUlRbCb *rbCb, 
                                      Buffer *pdu, 
                                      U32 ttiCnt));
 
-EXTERN S16 rlcUtlSndUlL2MeasCfm  ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
+S16 rlcUtlSndUlL2MeasCfm  ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
 
-EXTERN S16 rlcUtlSndUlL2MeasNCfm ARGS ((RlcCb *gCb, 
+S16 rlcUtlSndUlL2MeasNCfm ARGS ((RlcCb *gCb, 
                                        RlcL2MeasReqEvt *measReqEvt,
                                        RlcL2MeasCfmEvt *measCfmEvt));
 
-EXTERN S16 rlcUtlL2MeasUlInit ARGS((RlcCb *gCb));
+S16 rlcUtlL2MeasUlInit ARGS((RlcCb *gCb));
 
-EXTERN Void rlcUtlResetUlL2MeasInRlcRb ARGS((RlcCb *gCb,
+Void rlcUtlResetUlL2MeasInRlcRb ARGS((RlcCb *gCb,
                                            RlcL2MeasCb *measCb,
                                            U8 measType));
 
-EXTERN S16 rlcUtlValidateIpThL2Meas ARGS ((RlcL2MeasReqEvt *measReqEvt,
+S16 rlcUtlValidateIpThL2Meas ARGS ((RlcL2MeasReqEvt *measReqEvt,
          RlcL2MeasCfmEvt *measCfmEvt));
 
 #endif /*  LTE_L2_MEAS */
 /****************************************************************************
  *                    Activation Functions 
  ***************************************************************************/
-EXTERN S16 rlcUlActvInit ARGS ((Ent ent, 
+S16 rlcUlActvInit ARGS ((Ent ent, 
                                Inst inst, 
                                Region region, 
                                Reason reason));
 
-EXTERN S16 rlcUlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
+S16 rlcUlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
 
 /****************************************************************************
  *                    Debug Functions 
  ***************************************************************************/
-EXTERN Void DumpRLCUlDebugInformation ARGS((Void));
+Void DumpRLCUlDebugInformation ARGS((Void));
+
+uint8_t rlcProcCommLcUlData(Pst *pst, SuId suId, RguCDatIndInfo  *datInd);
+uint8_t rlcProcDedLcUlData(Pst *pst, SuId suId, RguDDatIndInfo  *datInd);
 
 #ifdef __cplusplus
 }
index 8f9218d..21574c3 100755 (executable)
@@ -58,6 +58,7 @@ static int RLOG_FILE_ID=206;
 #include "kw_ul.x"
 #include "kw_udx.x"
 
+#include "rlc_mac_inf.h"
 #include "du_app_rlc_inf.h"
 
 #ifdef TENB_STATS 
@@ -171,7 +172,7 @@ Reason reason;              /* reason */
    tRlcCb->init.acnt    = TRUE;          /* enable accounting */
    tRlcCb->init.usta    = TRUE;          /* enable unsolicited status */
    tRlcCb->init.trc     = FALSE;         /* enable trace */
-   tRlcCb->init.procId  = SFndProcId();
+   tRlcCb->init.procId  = ODU_GET_PROCID();
 
    rlcCb[inst] = tRlcCb;
 
@@ -430,9 +431,9 @@ Buffer *mBuf;           /* message buffer */
                      break;
                   }
 
-               case EVTRLCULDAT:    /* Dedicated Channel Data request */
+               case EVENT_UL_DATA_TO_RLC:    /* UL Data request */
                   {
-                     ret = unpackRcvdUlData(RlcProcUlData, pst, mBuf);
+                     ret = unpackRlcUlData(RlcProcUlData, pst, mBuf);
                      break;
                   }
 
index 739d39b..10dfd86 100755 (executable)
@@ -34,9 +34,6 @@
      File:     kw_umm_dl.c
 
 **********************************************************************/
-static const char* RLOG_MODULE_NAME="RLC";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=239;
 /** 
  * @file kw_umm_dl.c
  * @brief RLC Unacknowledged Mode downlink module
@@ -78,7 +75,7 @@ extern U32 buffer_occ;
 extern U32 dlrate_kwu;
 #endif
 
-PRIVATE Void rlcUmmEstHdrSz ARGS ((RlcUmDl *umUl));
+PRIVATE void rlcUmmEstHdrSz ARGS ((RlcUmDl *umUl));
 
 PRIVATE Void rlcUmmCreatePdu ARGS ((RlcCb *gCb,
                                   RlcDlRbCb *rbCb, 
@@ -106,46 +103,29 @@ PRIVATE Void rlcUmmCreatePdu ARGS ((RlcCb *gCb,
  *
  * @return  Void
 */  
-#ifdef ANSI
-Void rlcUmmQSdu       
-(
-RlcCb            *gCb,
-RlcDlRbCb        *rbCb, 
-KwuDatReqInfo   *datReq,  
-Buffer          *mBuf 
-)
-#else
-Void rlcUmmQSdu(gCb,rbCb,datReq,mBuf)
-RlcCb            *gCb;
-RlcDlRbCb        *rbCb;
-KwuDatReqInfo   *datReq; 
-Buffer          *mBuf;
-#endif
+void rlcUmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, KwuDatReqInfo *datReq, Buffer *mBuf)
 {
    MsgLen   len;    /* SDU buffer length */
    RlcSdu    *sdu;   /* SDU */
 
-   TRC2(rlcUmmQSdu)
-
    RLC_UPD_L2_DL_TOT_SDU_STS(gCb,rbCb);
 
    RLC_ALLOC_WC(gCb, sdu, (Size)sizeof(RlcSdu));
 #if (ERRCLASS & ERRCLS_ADD_RES)
    if ( sdu == NULLP )
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-               "Memory allocation failed UEID:%d CELLID:%d",
+      DU_LOG("\nRLC : Memory allocation failed in rlcUmmQSdu for UEID:%d CELLID:%d",\
                rbCb->rlcId.ueId,
                rbCb->rlcId.cellId);
-      SPutMsg(mBuf);
-      RETVOID;
+      ODU_PUT_MSG_BUF(mBuf);
+      return;
    }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */
 
 /* Discard new changes starts */
    rlcUtlGetCurrTime(&sdu->arrTime);
 /* Discard new changes ends */
-   SFndLenMsg(mBuf,&len);
+   ODU_GET_MSG_LEN(mBuf,&len);
 
    sdu->mBuf = mBuf;
    sdu->sduSz = len;
@@ -170,7 +150,7 @@ Buffer          *mBuf;
 
    if(!rlcDlUtlIsReestInProgress(rbCb))
    {
-      rlcUtlSndDStaRsp(gCb,rbCb,rbCb->m.umDl.bo,rbCb->m.umDl.estHdrSz,FALSE,0);
+      rlcUtlSendDedLcBoStatus(gCb,rbCb,rbCb->m.umDl.bo,rbCb->m.umDl.estHdrSz,FALSE,0);
    }
    
    /* kw005.201 added support for L2 Measurement */
@@ -183,7 +163,7 @@ Buffer          *mBuf;
    }
 #endif
 
-   RETVOID;    
+   return;    
 }
 
 
@@ -205,46 +185,30 @@ Buffer          *mBuf;
  *    -# ROK       In case of success
  *    -# RFAILED   If allocation of Sdu fails
 */  
-#ifdef ANSI
-Void rlcUmmProcessSdus
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,   
-RlcDatReq   *datReq   
-)
-#else
-Void rlcUmmProcessSdus(gCb, rbCb, datReq)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb; 
-RlcDatReq   *datReq;
-#endif
+void rlcUmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *datReq)
 {
    CmLList     *firstNode;   /* First Node in SDU queue */
-   U8          fi=0;           /* Framing Info */
+   uint8_t      fi=0;           /* Framing Info */
    Buffer      *pdu;         /* Buffer for holding the formed PDU */
    KwPduInfo   *pduInfo;     /* PDU Info pointer */
-   S16         pduSz;        /* PDU Size to be constructed */
+   int16_t     pduSz;        /* PDU Size to be constructed */
    
    /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
    RlcContSduLst         contSduLst;  /*Contained sduLst */
-   S32                  dataVol    = rbCb->m.umDl.bo;
-   U32*                 totMacGrant= &(datReq->totMacGrant);
+   int32_t               dataVol    = rbCb->m.umDl.bo;
+   uint32_t*             totMacGrant= &(datReq->totMacGrant);
    RlcL2MeasDlIpTh       *dlIpThPut = &rbCb->l2MeasIpThruput.dlIpTh;
-   U8                   *sduIdx    = &dlIpThPut->lastSduIdx;
-   Bool                 newIdx = FALSE;
-   S32                  oldBo;
+   uint8_t               *sduIdx    = &dlIpThPut->lastSduIdx;
+   bool                  newIdx = FALSE;
+   int32_t               oldBo;
    RlclchInfo            lchInfo = {0};
-   U32                  segSduCnt = 0;
+   uint32_t              segSduCnt = 0;
 #endif
    Ticks                curTime  = 0;
-   S16                  timeDiff = 0;
+   int16_t              timeDiff = 0;
    RlcSdu                *sdu;
 
-
-   TRC2(rlcUmmProcessSdus)
-
-
    pdu = NULLP;
 
    pduInfo = &(datReq->pduInfo);
@@ -409,7 +373,7 @@ RlcDatReq   *datReq;
          }
          else
          {
-            SCatMsg(pdu, sdu->mBuf ,M1M2);
+            ODU_CAT_MSG(pdu, sdu->mBuf ,M1M2);
          }
          rbCb->m.umDl.bo -= sdu->sduSz;
 
@@ -431,10 +395,8 @@ RlcDatReq   *datReq;
             {
                 /* Could not transmit what MAC asked for because the number 
                  * of PDUs to be transmitted has reached maximum. */
-               RLOG_ARG2(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, 
-                        "Maximum Pdu limit has been reached UEID:%d CELLID:%d",
-                        rbCb->rlcId.ueId,
-                        rbCb->rlcId.cellId);
+              DU_LOG("\nRLC: rlcUmmProcessSdus: Maximum Pdu limit has been reached\
+                 UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
                break;
             }
          }
@@ -478,7 +440,7 @@ RlcDatReq   *datReq;
       {
          Buffer *remSdu;
        
-         SSegMsg(sdu->mBuf,pduSz,&remSdu);
+         ODU_SEGMENT_MSG(sdu->mBuf,pduSz,&remSdu);
         
 #ifdef LTE_L2_MEAS
         if(RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(gCb, rbCb))
@@ -510,7 +472,7 @@ RlcDatReq   *datReq;
          }
          else 
          {
-            SCatMsg(pdu, sdu->mBuf, M1M2);
+            ODU_CAT_MSG(pdu, sdu->mBuf, M1M2);
             RLC_FREE_BUF_WC(sdu->mBuf);
          }
 
@@ -588,7 +550,7 @@ RlcDatReq   *datReq;
       datReq->boRep.oldestSduArrTime = 
         ((RlcSdu *)(rbCb->m.umDl.sduQ.first->node))->arrTime;
    }
-   RETVOID
+   return
 }
 
 /**
@@ -656,29 +618,13 @@ RlcDlRbCb       *rbCb;
  *
  * @return  Void
 */ 
-#ifdef ANSI
-PRIVATE Void rlcUmmCreatePdu
-(
-RlcCb        *gCb,
-RlcDlRbCb    *rbCb,           
-Buffer      *pdu,           
-U8          fi, 
-KwPduInfo   *datReqPduInfo
-)
-#else
-PRIVATE Void rlcUmmCreatePdu(gCb, rbCb, pdu, fi, datReqPduInfo)
-RlcCb        *gCb;
-RlcDlRbCb    *rbCb;          
-Buffer      *pdu;           
-U8          fi;
-KwPduInfo   *datReqPduInfo
-#endif
+void rlcUmmCreatePdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *pdu, uint8_t fi, KwPduInfo *datReqPduInfo)
 {
-   RlcSn   sn;        /*  Sequence Number */
-   U32    liCount;   /*  LI count */
-   U8     e = 0;     /* Extension Bit */
-   U32    count;     /* Loop Counter */
-   U32    hdrSz;
+   RlcSn     sn;        /*  Sequence Number */
+   uint32_t  liCount;   /*  LI count */
+   uint8_t   e = 0;     /* Extension Bit */
+   uint32_t  count;     /* Loop Counter */
+   uint32_t  hdrSz;
 
    /* create a big array to store the header, assuming 3 bytes per 2 L1s 
     * (2 bytes if only a single LI) and 2 bytes for the 
@@ -686,17 +632,14 @@ KwPduInfo   *datReqPduInfo
     * size of header = ( NumLi /2 ) * 3 + (NumLi % 2) * 2 + 2;
     * where NumLi = Number of Length Indicators to be sent
    */
-   U8 hdr[((RLC_MAX_DL_LI >> 1) * 3) + ((RLC_MAX_DL_LI & 0x01) << 1) + 2];
-   U32 idx = 0; /* To index to the hdr array */
+   uint8_t hdr[((RLC_MAX_DL_LI >> 1) * 3) + ((RLC_MAX_DL_LI & 0x01) << 1) + 2];
+   uint32_t idx = 0; /* To index to the hdr array */
    
    /* Note: idx is not checked against crossing the hdr array bound as 
     * liCount will be < RLC_MAX_DL_LI and as per the size calculated above; 
     * idx cannot cross the array
     */
 
-   TRC2(rlcUmmCreatePdu) 
-
-
    /* stats updated before for bytes sent before adding RLC headers */
    rlcUtlIncrementGenStsBytesAndPdusSent(&gCb->genSts, pdu);
          
@@ -773,10 +716,10 @@ KwPduInfo   *datReqPduInfo
    rbCb->m.umDl.vtUs = (rbCb->m.umDl.vtUs + 1) & rbCb->m.umDl.modBitMask;
 
    /* add the header to the beginning of the pdu */
-   SAddPreMsgMultInOrder(hdr, idx, pdu);
+   ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx, pdu);
 
    datReqPduInfo->mBuf[datReqPduInfo->numPdu++] = pdu;
-   RETVOID;
+   return;
 }
 
 /**
@@ -792,15 +735,7 @@ KwPduInfo   *datReqPduInfo
  *
  * @return  Void
 */ 
-#ifdef ANSI
-PRIVATE Void rlcUmmEstHdrSz
-(
-RlcUmDl *umDl          
-)
-#else
-PRIVATE Void rlcUmmEstHdrSz(umDl)
-RlcUmDl *umDl;          
-#endif
+void rlcUmmEstHdrSz(RlcUmDl *umDl)
 {
    /* The header size is estimated as :
           If sdu count = 0 then 0
@@ -809,7 +744,7 @@ RlcUmDl *umDl;
     */   
    umDl->estHdrSz = (umDl->sduQ.count)?((umDl->sduQ.count << 1) + 1) : 0;
    
-   RETVOID;
+   return;
 }
 
 /**
index 8c4f897..5551654 100755 (executable)
      File:     kw_umm_ul.c
 
 **********************************************************************/
-static const char* RLOG_MODULE_NAME="RLC";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=240;
-
 /** 
  * @file kw_umm_ul.c
  * @brief RLC Unacknowledged Mode uplink module
@@ -69,12 +65,12 @@ static int RLOG_FILE_ID=240;
 
 #define RLC_MODULE (RLC_DBGMASK_UM | RLC_DBGMASK_UL)
 
-PRIVATE S16 rlcUmmExtractHdr ARGS ((RlcCb *gCb, 
+uint8_t rlcUmmExtractHdr ARGS ((RlcCb *gCb, 
                                    RlcUlRbCb *rbCb,
                                    Buffer *pdu,
                                    RlcUmHdr *umHdr));
 
-PRIVATE Void rlcUmmReAssembleSdus ARGS ((RlcCb *gCb,
+void rlcUmmReAssembleSdus ARGS ((RlcCb *gCb,
                                         RlcUlRbCb *rbCb,
                                         RlcUmRecBuf *umRecBuf));
 
@@ -96,7 +92,7 @@ extern U32 isMemThreshReached(Region region);
  *
  * @return  Void
 */ 
-PRIVATE Void rlcUmmFindNextVRUR (RlcUmUl* umUl, RlcSn nextSn)
+void rlcUmmFindNextVRUR (RlcUmUl* umUl, RlcSn nextSn)
 {
    RlcSn ur = RLC_UM_GET_VALUE(umUl->vrUr, *umUl);
    
@@ -127,8 +123,7 @@ PRIVATE Void rlcUmmFindNextVRUR (RlcUmUl* umUl, RlcSn nextSn)
  *
  * @return  Void
 */
-PRIVATE S16 rlcUmmCheckSnInReordWindow (RlcSn sn, 
-                                       CONSTANT RlcUmUl* CONSTANT umUl)  
+int16_t rlcUmmCheckSnInReordWindow (RlcSn sn, CONSTANT RlcUmUl* CONSTANT umUl)  
 {
    return (RLC_UM_GET_VALUE(sn, *umUl) < RLC_UM_GET_VALUE(umUl->vrUh, *umUl)); 
 }
@@ -150,51 +145,20 @@ PRIVATE S16 rlcUmmCheckSnInReordWindow (RlcSn sn,
 */
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
-
-#ifdef ANSI
-Void rlcUmmProcessPdus
-(
-RlcCb      *gCb,
-RlcUlRbCb  *rbCb,                   /* Rb Control Block */
-KwPduInfo *pduInfo,                 /* Pdu  data and related information */
-U32       ttiCnt                  /* ttiCnt received from MAC */
-)
-#else
-Void rlcUmmProcessPdus(rbCb,pduInfo,ttiCnt)
-RlcCb      *gCb;
-RlcUlRbCb  *rbCb;                   /* Rb Control Block */
-KwPduInfo *pduInfo;                /* Pdu  data and related information */
-U32       ttiCnt;                  /* ttiCnt received from MAC */
-#endif
-#else
-#ifdef ANSI
-Void rlcUmmProcessPdus
-(
-RlcCb      *gCb,
-RlcUlRbCb  *rbCb,                /* Rb Control Block */
-KwPduInfo *pduInfo              /* Pdu  data and related information */
-)
+void rlcUmmProcessPdus(RlcCb *gCb, RlcUlRbCb  *rbCb, KwPduInfo *pduInfo, uint32_t ttiCnt)
 #else
-Void rlcUmmProcessPdus(rbCb,pduInfo)
-RlcCb      *gCb;
-RlcUlRbCb  *rbCb;                /* Rb Control Block */
-KwPduInfo *pduInfo;             /* Pdu  data and related information */
-#endif
+void rlcUmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo)
 #endif
 {
-   RlcSn          *vrUh;      /* vr(uh) */
-   RlcSn          *vrUr;      /* vr(ur) */
+   RlcSn         *vrUh;      /* vr(uh) */
+   RlcSn         *vrUr;      /* vr(ur) */
    RlcSn         *vrUx;      /* vr(ux) */
-   U16          curSn;      /* Current Sequence Number */
-   U32          pduCount;   /* PDU count */
-   U32          count;      /* Loop counter */
+   uint16_t      curSn;      /* Current Sequence Number */
+   uint32_t      pduCount;   /* PDU count */
+   uint32_t      count;      /* Loop counter */
    RlcUmRecBuf   **recBuf;   /* UM Reception Buffer */
 
-   Bool         tmrRunning;   /* Boolean for checking Tmr */
-/* kw005.201 added support for L2 Measurement */
-
-   TRC2(rlcUmmProcessPdus)
-
+   bool         tmrRunning;   /* Boolean for checking Tmr */
 
    count = 0;
 
@@ -217,9 +181,9 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
 #ifndef RGL_SPECIFIC_CHANGES
 #ifndef TENB_ACC
 #ifndef LTE_PAL_ENB
-      extern U32 ulrate_rgu;
+      extern uint32_t ulrate_rgu;
       MsgLen len;
-      SFndLenMsg(pdu, &len);
+      ODU_GET_MSG_LEN(pdu, &len);
       ulrate_rgu += len;
 #endif
 #endif      
@@ -229,13 +193,10 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
 #if (ERRCLASS & ERRCLS_ADD_RES)
       if (tmpRecBuf == NULLP)
       {   
-         RLOG_ARG2(L_FATAL, DBG_RBID,rbCb->rlcId.rbId,
-                  "Memory allocation failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
-         SPutMsg(pdu);
-
-         RETVOID;
+         DU_LOG("\nRLC : rlcUmmProcessPdus: Memory allocation failed UEID:%d CELLID:%d",\
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+         ODU_PUT_MSG_BUF(pdu);
+        return;
       }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */      
       /* ccpu00142274 - UL memory based flow control*/ 
@@ -246,7 +207,7 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
 #ifndef XEON_SPECIFIC_CHANGES    
      if(isMemThreshReached(rlcCb[0]->init.region) == TRUE)
      {
-        extern U32 rlculdrop;
+        extern uint32_t rlculdrop;
         rlculdrop++;
         RLC_FREE_BUF(pdu);
         RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
@@ -262,16 +223,14 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
       /* get the pdu header */
       if (rlcUmmExtractHdr(gCb, rbCb, pdu, &(tmpRecBuf->umHdr)))  
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "Header Extraction Failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d",\
+             rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
          /* Header extraction is a problem. 
           * log an error and free the allocated memory */
          /* ccpu00136940 */
          RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
-         SPutMsg(pdu);
+         ODU_PUT_MSG_BUF(pdu);
          count++;
          /* kw005.201 ccpu00117318, updating the statistics */
          gCb->genSts.errorPdusRecv++;
@@ -288,11 +247,8 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
           (seqNum < ur)) 
       {
          /* PDU needs to be discarded */
-         RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
-                  "Received a duplicate pdu with sn %d UEID:%d CELLID:%d",
-                  curSn,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmProcessPdus: Received a duplicate pdu with sn %d \
+           UEID:%d CELLID:%d", curSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
 
          RLC_FREE_BUF(pdu);
          RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
@@ -313,7 +269,7 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
       recBuf[curSn] = tmpRecBuf;
 
       recBuf[curSn]->pdu = pdu;
-      SFndLenMsg(pdu,&(recBuf[curSn]->pduSz));
+      ODU_GET_MSG_LEN(pdu,&(recBuf[curSn]->pduSz));
       /* kw005.201 ccpu00117318, updating the statistics */
       gCb->genSts.bytesRecv += recBuf[curSn]->pduSz;
       
@@ -401,7 +357,7 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
 #ifdef LTE_L2_MEAS
    rlcUtlCalUlIpThrPutIncTTI(gCb, rbCb,ttiCnt);
 #endif /* LTE_L2_MEAS */
-   RETVOID;   
+   return;   
 }
 
 /**
@@ -417,31 +373,16 @@ KwPduInfo *pduInfo;             /* Pdu  data and related information */
  *
  * @return  Void
 */
-#ifdef ANSI
-PRIVATE Void rlcUmmReAssembleSdus
-(
-RlcCb         *gCb,
-RlcUlRbCb     *rbCb,   
-RlcUmRecBuf   *umRecBuf 
-)
-#else
-PRIVATE Void rlcUmmReAssembleSdus(gCb,rbCb,umRecBuf)
-RlcCb         *gCb;
-RlcUlRbCb     *rbCb;     
-RlcUmRecBuf   *umRecBuf; 
-#endif
+void rlcUmmReAssembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcUmRecBuf *umRecBuf)
 {
-   U32      liCount;        /* LI count */
-   U32      count;          /* Loop counter */
-   U8       fi;             /* Framing Info */
-   U16      sn;             /* Sequence Number of current PDU */
-   MsgLen   len;            /* PDU Length */
-   Buffer   *sdu;           /* SDU to be sent to upper layer */
-   Buffer   *remPdu;        /* Remaining PDU */
-   Buffer   **partialSdu;   /* Partial SDU */
-
-   TRC2(rlcUmmReAssembleSdus)  
-
+   uint32_t  liCount;        /* LI count */
+   uint32_t  count;          /* Loop counter */
+   uint8_t   fi;             /* Framing Info */
+   uint16_t  sn;             /* Sequence Number of current PDU */
+   MsgLen    len;            /* PDU Length */
+   Buffer    *sdu;           /* SDU to be sent to upper layer */
+   Buffer    *remPdu;        /* Remaining PDU */
+   Buffer    **partialSdu;   /* Partial SDU */
 
    liCount = umRecBuf->umHdr.numLi;
    fi = umRecBuf->umHdr.fi;
@@ -455,13 +396,13 @@ RlcUmRecBuf   *umRecBuf;
       {
          if (!(umRecBuf->pdu))
          {
-            RETVOID;
+            return;
          }
-         SFndLenMsg(umRecBuf->pdu,&len);
+         ODU_GET_MSG_LEN(umRecBuf->pdu,&len);
       }
          
       /* get the sdu out of the pdu */
-      SSegMsg(umRecBuf->pdu,len,&remPdu);
+      ODU_SEGMENT_MSG(umRecBuf->pdu,len,&remPdu);
       sdu = umRecBuf->pdu;
       umRecBuf->pdu = remPdu;
       
@@ -493,11 +434,11 @@ RlcUmRecBuf   *umRecBuf;
             if ((*partialSdu) && 
                 (sn == ((rbCb->m.umUl.sn + 1) & rbCb->m.umUl.modBitMask)))
             {
-               SCatMsg(*partialSdu,sdu,M1M2);
+               ODU_CAT_MSG(*partialSdu,sdu,M1M2);
                RLC_FREE_BUF(sdu);
                if (liCount > 0 || !(fi & 1))
                {
-                  rlcUtlSndDatInd(gCb,rbCb,*partialSdu);
+                  rlcUtlSendUlDataToDu(gCb,rbCb,*partialSdu);
                   *partialSdu = NULLP;
                }
             }
@@ -524,7 +465,7 @@ RlcUmRecBuf   *umRecBuf;
             
             if (liCount > 0 || !( fi & 1))
             {
-               rlcUtlSndDatInd(gCb,rbCb,sdu);
+               rlcUtlSendUlDataToDu(gCb,rbCb,sdu);
             }
             else
             {
@@ -545,7 +486,7 @@ RlcUmRecBuf   *umRecBuf;
          }
          else
          {
-            rlcUtlSndDatInd(gCb, rbCb, sdu);
+            rlcUtlSendUlDataToDu(gCb, rbCb, sdu);
          }
       }
       /*  
@@ -553,12 +494,12 @@ RlcUmRecBuf   *umRecBuf;
          just send the SDU to the upper layer */
       else
       {
-         rlcUtlSndDatInd(gCb, rbCb, sdu);
+         rlcUtlSendUlDataToDu(gCb, rbCb, sdu);
       }
    }
    rbCb->m.umUl.sn = sn;
 
-   RETVOID;
+   return;
 }
 
 /**
@@ -650,50 +591,30 @@ RlcUlRbCb     *rbCb;
  *      -# TRUE 
  *      -# FALSE
 */
-#ifdef ANSI
-PRIVATE S16 rlcUmmExtractHdr
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb, 
-Buffer     *pdu, 
-RlcUmHdr    *umHdr 
-)
-#else
-PRIVATE S16 rlcUmmExtractHdr(gCb, rbCb, pdu, umHdr)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb; 
-Buffer     *pdu; 
-RlcUmHdr    *umHdr; 
-#endif
+uint8_t rlcUmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcUmHdr *umHdr)
 {
-   U8        e;         /* Extension Bit */
+   uint8_t   e;         /* Extension Bit */
    Data      dst[2];    /* Destination Buffer */
-   S32       totalSz;   /* Sum of LIs */
+   int32_t   totalSz;   /* Sum of LIs */
    MsgLen    pduSz;     /* PDU size */
 #if (ERRCLASS & ERRCLS_DEBUG)
-   S16       ret;       /* Return Value */
+   uint8_t   ret;       /* Return Value */
 #endif
 
-   TRC3(rlcUmmExtractHdr)
-
-
-   SFndLenMsg(pdu,&pduSz);
+   ODU_GET_MSG_LEN(pdu,&pduSz);
  
    if ( rbCb->m.umUl.snLen == 1)
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-      ret = SRemPreMsg(dst,pdu);
+      ret = ODU_REM_PRE_MSG(dst,pdu);
       if (ret != ROK)
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "SRemPreMsg Failed for 5 bit SN UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
-
+         DU_LOG("\nRLC : rlcUmmExtractHdr : ODU_REM_PRE_MSG Failed for 5 bit SN \
+           UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          return RFAILED;
       }
 #else
-      SRemPreMsg(dst,pdu);
+      ODU_REM_PRE_MSG(dst,pdu);
 #endif
       pduSz--;
       umHdr->sn = (dst[0]) & 0x1F; 
@@ -704,17 +625,15 @@ RlcUmHdr    *umHdr;
    {
       /* snLen - sequnce length will be 10 bits requiring 2 bytes */ 
 #if (ERRCLASS & ERRCLS_DEBUG)
-      ret = SRemPreMsgMult(dst,2,pdu);
+      ret = ODU_REM_PRE_MSG_MULT(dst,2,pdu);
       if (ret != ROK)
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "SRemPreMsgMult Failed for 10 bits SN UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmExtractHdr : ODU_REM_PRE_MSG_MULT Failed for 10 bits SN \
+           UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          return RFAILED;
       }
 #else
-      SRemPreMsgMult(dst,2,pdu);
+      ODU_REM_PRE_MSG_MULT(dst,2,pdu);
 #endif
       pduSz -= 2;
    
@@ -734,42 +653,31 @@ RlcUmHdr    *umHdr;
    while(e && umHdr->numLi < RLC_MAX_UL_LI )
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-      ret = SRemPreMsgMult(dst,2,pdu);
+      ret = ODU_REM_PRE_MSG_MULT(dst,2,pdu);
       if (ret != ROK)
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "SRemPreMsgMult Failed UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmExtractHdr : ODU_REM_PRE_MSG_MULT Failed UEID:%d CELLID:%d",\
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          return RFAILED;
       }
 #else
-      SRemPreMsgMult(dst,2,pdu);
+      ODU_REM_PRE_MSG_MULT(dst,2,pdu);
 #endif
       umHdr->li[umHdr->numLi] = ((dst[0]) & 0x7F) << 4;
       umHdr->li[umHdr->numLi] |= dst[1] >> 4;
       if ( 0 == umHdr->li[umHdr->numLi] )
       {
-         RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "Received LI as 0 UEID:%d CELLID:%d",
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmExtractHdr : Received LI as 0 UEID:%d CELLID:%d",
+            rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          return RFAILED; 
       }
       totalSz += umHdr->li[umHdr->numLi];
       if ( pduSz <=  totalSz )
       {
-         RLOG_ARG3(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "SN [%d]: UEID:%d CELLID:%d",
-                  umHdr->sn, 
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
-         RLOG_ARG4(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                  "Corrupted PDU as TotSz[%lu] PduSz[%lu] UEID:%d CELLID:%d ",
-                  totalSz, 
-                  pduSz,
-                  rbCb->rlcId.ueId,
-                  rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmExtractHdr : SN [%d]: UEID:%d CELLID:%d",\
+            umHdr->sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+         DU_LOG("\nRLC : rlcUmmExtractHdr : Corrupted PDU as TotSz[%d] PduSz[%d] \
+           UEID:%d CELLID:%d ", totalSz, pduSz, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
          return RFAILED; /* the situation where in the PDU size 
                             is something that does not match with 
                             the size in LIs*/
@@ -786,27 +694,23 @@ RlcUmHdr    *umHdr;
 
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-         ret = SRemPreMsg(dst,pdu);
+         ret = ODU_REM_PRE_MSG(dst,pdu);
          if (ret != ROK)
          {
-            RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                     "SRemPreMsg Failed UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
+            DU_LOG("\nRLC : rlcUmmExtractHdr : ODU_REM_PRE_MSG Failed UEID:%d CELLID:%d",
+               rbCb->rlcId.ueId, rbCb->rlcId.cellId);
             return RFAILED;
          }
 #else
-         SRemPreMsg(dst,pdu);
+         ODU_REM_PRE_MSG(dst,pdu);
 #endif
          umHdr->li[umHdr->numLi] |= ( dst[0] );    /* The first byte lies in 
                                                    the first 8 bits.We want 
                                                    them in the last 8 bits */
          if ( 0 == umHdr->li[umHdr->numLi] )
          {
-            RLOG_ARG2(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
-                     "Received LI as 0 UEID:%d CELLID:%d",
-                     rbCb->rlcId.ueId,
-                     rbCb->rlcId.cellId);
+            DU_LOG("\nRLC : rlcUmmExtractHdr :Received LI as 0 UEID:%d CELLID:%d",
+               rbCb->rlcId.ueId, rbCb->rlcId.cellId);
             return RFAILED; 
          }
          totalSz += umHdr->li[umHdr->numLi];
index 1d1c3fb..46bfc35 100755 (executable)
      Desc:     Source code for RLC Utility Module
                This file contains following functions
 
-                  --rlcUtlSndToLi
-                  --rlcUtlRcvFrmLi
+                  --rlcUtlSendToMac
+                  --rlcUtlRcvFrmMac
                   --rlcUtlEmptySduQ
-                  --rlcUtlSndDStaRsp
-                  --rlcUtlSndDatInd 
+                  --rlcUtlSendDedLcBoStatus
+                  --rlcUtlSendUlDataToDu 
                   --kwUtlShutDown
 
      File:     kw_utl_dl.c
@@ -71,6 +71,10 @@ static int RLOG_FILE_ID=209;
 #include "kw_udx.x"        /* UDX interface includes */
 #include "kw_dl.x"         /* RLC downlink includes */
 
+#include "rlc_utils.h"
+#include "rlc_mac_inf.h"
+#include "rlc_lwr_inf_api.h"
+
 #include "ss_rbuf.h"
 #include "ss_rbuf.x" 
 
@@ -209,45 +213,36 @@ Void PrintRLCStats(Void)
  *    This function stores DL PDU info for all logical channels
  *    of per UE grant per TTI and sends to MAC
  *
- *    Function : RlcLiRguDDatReq 
+ *    Function : rlcSendDedLcDlData 
  *
  * @params[in] 
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-#ifdef ANSI
-S16 RlcLiRguDDatReq
-(
-Pst               *post,
-SpId              spId,
-RguDDatReqInfo    *datReqInfo
-)
-#else
-S16 RlcLiRguDDatReq(post, spId, datReqInfo)
-Pst               *post;
-SpId              spId;
-RguDDatReqInfo    *datReqInfo;
-#endif
+uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo)
 {
-   U8               ueIdx;      /* UE info list iterator */ 
-   U8               tbIdx;      /* TB info list iterator */
-   U8               lchIdx;     /* Lch info list iterator */
-   U8               pduIdx;     /* RLC PDU list iterator */
+   uint8_t          ueIdx;      /* UE info list iterator */ 
+   uint8_t          tbIdx;      /* TB info list iterator */
+   uint8_t          lchIdx;     /* Lch info list iterator */
+   uint8_t          pduIdx;     /* RLC PDU list iterator */
    RguDDatReqPerUe  datPerUe;   /* DL data info per UE */
    RguDatReqTb      datPerTb;   /* DL data info per TB */
    RguLchDatReq     datPerLch;  /* DL data info per Lch */
-   RlcMacData       *dlData;    /* DL data to be sent to MAC */
-
-   TRC3(RlcLiRguDDatReq)
+   RlcData          *dlData;    /* DL data to be sent to MAC */
+   Pst              pst;        /* Post structure */
+   uint16_t         pduLen;     /* PDU length */
+   uint16_t         copyLen;    /* Number of bytes copied */
 
    dlData = NULLP;
-   RLC_ALLOC_SHRABL_BUF(post->region, post->pool,
-                       dlData, sizeof(RlcMacData));
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                       dlData, sizeof(RlcData));
 #if (ERRCLASS & ERRCLS_ADD_RES)
-   if ( datReqInfo == NULLP )
+   if ( dlData == NULLP )
    {
-      RLOG0(L_FATAL,"Memory allocation failed");
+      DU_LOG("\nRLC: rlcSendDedLcDlData: Memory allocation failed for dl data");
+      RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+          datReqInfo, sizeof(RguDDatReqInfo));
       return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */
@@ -256,11 +251,14 @@ RguDDatReqInfo    *datReqInfo;
    {
       datPerUe = datReqInfo->datReq[ueIdx];
 
-      cmMemset((U8 *)dlData, 0, sizeof(RlcMacData));
+      memset((uint8_t *)dlData, 0, sizeof(RlcData));
 
       dlData->cellId = datReqInfo->cellId;
       dlData->rnti = datPerUe.rnti;
-      //dlData->timeToTx = datPerUe.transId; /* Derive timing info from transId */
+
+      /* Retrieving sfn/slot from transId. It was filled in RlcProcSchedResultRpt */
+      dlData->slotInfo.sfn = datPerUe.transId >> 16;
+      dlData->slotInfo.slot = datPerUe.transId & 0xffff;
       dlData->numPdu = 0;
 
       for(tbIdx = 0; tbIdx < datPerUe.nmbOfTbs; tbIdx++)
@@ -273,22 +271,58 @@ RguDDatReqInfo    *datReqInfo;
             {
                dlData->pduInfo[dlData->numPdu].commCh = FALSE;
                dlData->pduInfo[dlData->numPdu].lcId = datPerLch.lcId;
-               dlData->pduInfo[dlData->numPdu].pduBuf = datPerLch.pdu.mBuf[pduIdx];
+
+               /* Copy Message to fixed buffer to send */
+              ODU_GET_MSG_LEN(datPerLch.pdu.mBuf[pduIdx], (MsgLen *)&pduLen);
+              RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                 dlData->pduInfo[dlData->numPdu].pduBuf, pduLen);
+
+              if (dlData->pduInfo[dlData->numPdu].pduBuf == NULLP )
+              {
+                 DU_LOG("\nRLC: rlcSendDedLcDlData: Memory allocation failed");
+                 for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
+                 {
+                    RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\
+                      dlData->pduInfo[pduIdx].pduLen);
+                 }
+                 RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                    dlData, sizeof(RlcData));
+                 RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
+                    datReqInfo, sizeof(RguDDatReqInfo));
+                 return RFAILED;
+              }
+
+               ODU_COPY_MSG_TO_FIX_BUF(datPerLch.pdu.mBuf[pduIdx], 0, pduLen, \
+                 dlData->pduInfo[dlData->numPdu].pduBuf, (MsgLen *)&copyLen);
+              dlData->pduInfo[dlData->numPdu].pduLen = pduLen;
+
+               /* Free message */
+              ODU_PUT_MSG_BUF(datPerLch.pdu.mBuf[pduIdx]);
+
                dlData->numPdu++;
             }/* For per PDU */
          }/* For Data per Lch */
       }/* For Data per Tb */
-      RlcMacSendDlData(post, spId, dlData);
+
+      /* Sending DL Data per UE to MAC */
+      memset(&pst, 0, sizeof(Pst));
+      FILL_PST_RLC_TO_MAC(pst, RLC_DL_INST, EVENT_DL_DATA_TO_MAC);
+      if(RlcSendDlDataToMac(&pst, dlData) != ROK)
+      {
+         for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
+        {
+           RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\
+              dlData->pduInfo[pduIdx].pduLen);
+        }
+         RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData, sizeof(RlcData));
+      }
    } /* For Data per UE */
 
-   /* Check if to be freed here */
-   
-   RLC_FREE_SHRABL_BUF(post->region, 
-            post->pool, 
+   RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
             datReqInfo, sizeof(RguDDatReqInfo));
    
    return ROK;
-}/* End of RlcLiRguDDatReq */
+}/* End of rlcSendDedLcDlData */
 
 /**
  *
@@ -310,55 +344,41 @@ RguDDatReqInfo    *datReqInfo;
  *      -# RFAILED
  *
  */
-#ifdef ANSI
-S16 rlcUtlSndToLi
-(
-RlcCb            *gCb,
-SuId            suId,
-KwDStaIndInfo   *staIndInfo
-)
-#else
-S16 rlcUtlSndToLi(gCb, suId, staIndInfo)
-RlcCb            *gCb;
-SuId            suId;
-KwDStaIndInfo   *staIndInfo; 
-#endif
+uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
 {
+   uint8_t           numPdu = 0;
+   uint16_t          ueIdx;
    RlcDlUeCb         *ueCb;         /* UE control block */
-   U32              count;         /* Loop Counter */
-   U32              numTb;         /* Number of Tbs */
+   uint32_t          count;         /* Loop Counter */
+   uint32_t          numTb;         /* Number of Tbs */
    RlcDlRbCb         *rbCb;         /* RB Control Block */
    RlcDatReq         datReq;        /* PDUs Information */
    RguDDatReqInfo   *datReqInfo;   /* Data Request Information */
-   RlcRguSapCb       *rguSap;       /* MAC SAP CB */
-   U32              totNumPdu;     /* Total number of PDUS */
+   RlcRguSapCb      *rguSap;       /* MAC SAP CB */
+   uint32_t         totNumPdu;     /* Total number of PDUS */
    RguStaIndTb      *staIndTb = NULLP;
    RguDatReqTb      *datReqTb = NULLP;
    RguDStaIndPerUe  *staInd = NULLP;
 #ifdef LTE_L2_MEAS   
-    U32 grantPerLch[RGU_MAX_LC] = {0};
+   uint32_t   grantPerLch[RGU_MAX_LC] = {0};
 #endif
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS_LOSS_DELAY
-   U8        snIdx1;
-   U8        snIdx2;
+   uint8_t        snIdx1;
+   uint8_t        snIdx2;
 #endif /* LTE_L2_MEAS */
-   U32 idx;
+   uint32_t  idx;
 
 //Debug
-   U32 staIndSz=0,datIndSz = 0;
-   TRC2(rlcUtlSndToLi)
-
+   uint32_t staIndSz=0,datIndSz = 0;
 
    datReqInfo = NULLP;
-   RLC_ALLOC_SHRABL_BUF(gCb->u.dlCb->rguDlSap->pst.region,
-                       gCb->u.dlCb->rguDlSap->pst.pool,
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL,
                        datReqInfo,sizeof(RguDDatReqInfo));
 #if (ERRCLASS & ERRCLS_ADD_RES)
       if ( datReqInfo == NULLP )
       {
-         RLOG_ARG0(L_FATAL,DBG_CELLID,staIndInfo->cellId,
-                  "Memory allocation failed");
+         DU_LOG("\nRLC: rlcUtlSendToMac: Memory allocation failed");
          return RFAILED;
       }
 #endif /* ERRCLASS & ERRCLS_ADD_RES */
@@ -366,12 +386,12 @@ KwDStaIndInfo   *staIndInfo;
    {
       staInd = &staIndInfo->staInd[idx];
       /* Fetch Ue control block */
-      if(ROK != rlcDbmFetchDlUeCb(gCb,staInd->rnti,staIndInfo->cellId,&ueCb))
+      GET_UE_IDX(staInd->rnti, ueIdx);
+      if(ROK != rlcDbmFetchDlUeCb(gCb, ueIdx, staIndInfo->cellId,&ueCb))
       {
          /* Fetch UeCb failed */
-         RLOG_ARG1(L_ERROR, DBG_CELLID,staIndInfo->cellId, 
-                  "UeId[%u]:ueCb not found",
-                  staInd->rnti);
+         DU_LOG("\nRLC: rlcUtlSendToMac: UeId[%u]:ueCb not found",
+            staInd->rnti);
          /* If ueCb is not found for current rnti then continue to look for next rnti*/
          continue; 
       }
@@ -428,15 +448,13 @@ KwDStaIndInfo   *staIndInfo;
                   continue;
                }
                totNumPdu += datReq.pduInfo.numPdu;
-               cmMemcpy((U8 *)(&(datReqTb->lchData[count].pdu)),
-                     (U8 *)(&(datReq.pduInfo)),sizeof(KwPduInfo));
+               memcpy(&(datReqTb->lchData[count].pdu),
+                  &(datReq.pduInfo),sizeof(KwPduInfo));
 
-//Debug
-               U8 numPdu = 0;
                for (;numPdu < datReqTb->lchData[count].pdu.numPdu ; numPdu ++)
                {
                   MsgLen len = 0;
-                  SFndLenMsg(datReqTb->lchData[count].pdu.mBuf[numPdu],&len);
+                  ODU_GET_MSG_LEN(datReqTb->lchData[count].pdu.mBuf[numPdu],&len);
                   datIndSz += len; 
                }
                datReqTb->lchData[count].setMaxUlPrio = FALSE;
@@ -495,7 +513,7 @@ KwDStaIndInfo   *staIndInfo;
                datReqTb->lchData[count].boReport.oldestSduArrTime = 
                                              datReq.boRep.oldestSduArrTime;
                /* kw004.201 Used SSI function to initialize the variable */
-               cmMemset( (U8 *)&datReq, 0, sizeof(RlcDatReq) ); 
+               memset(&datReq, 0, sizeof(RlcDatReq) ); 
             }
          }
 #ifdef LTE_L2_MEAS
@@ -539,16 +557,9 @@ KwDStaIndInfo   *staIndInfo;
    }
    datReqInfo->cellId  = staIndInfo->cellId;
    datReqInfo->nmbOfUeGrantPerTti = staIndInfo->nmbOfUeGrantPerTti;
-   /* If trace flag is enabled send the trace indication */
-   if(TRUE == gCb->init.trc )
-   {
-      /* Populate the trace params */
-      rlcLmmSendTrc(gCb,EVTRGUDDATREQ, NULLP);
-   }
 
    rguSap = &(gCb->u.dlCb->rguDlSap[suId]);
-//Debug
-   RlcLiRguDDatReq(&rguSap->pst,rguSap->spId,datReqInfo); 
+   rlcSendDedLcDlData(&rguSap->pst,rguSap->spId,datReqInfo); 
    return ROK;
 }
 
@@ -572,58 +583,38 @@ KwDStaIndInfo   *staIndInfo;
  *      -# ROK 
  *      -# RFAILED
  */
-#ifdef ANSI
-S16 rlcUtlSndDStaRsp
-(
-RlcCb       *gCb,
-RlcDlRbCb   *rbCb,     
-S32        bo,        
-S32        estHdrSz,  
-Bool       staPduPrsnt,
-U32        staPduBo
-)
-#else
-S16 rlcUtlSndDStaRsp(gCb,rbCb,bo,estHdrSz,staPduPrsnt,staPduBo)
-RlcCb       *gCb;
-RlcDlRbCb   *rbCb;      
-S32        bo;         
-S32        estHdrSz;   
-Bool       staPduPrsnt;
-U32        staPduBo;
-#endif
+uint8_t rlcUtlSendDedLcBoStatus(RlcCb *gCb, RlcDlRbCb *rbCb, int32_t bo, \
+   int32_t estHdrSz, bool staPduPrsnt, uint32_t staPduBo)
 {
-   RlcMacBOStatus   boStatus;      /* Buffer occupancy status information */
-   RlcRguSapCb       *rguSap;       /* MAC SAP Information */
-   TRC3(rlcUtlSndDStaRsp)
+   Pst           pst;           /* Post info */
+   RlcBoStatus   *boStatus;      /* Buffer occupancy status information */
+
 #ifndef TENB_ACC
-   if ((rbCb->lastRprtdBoToMac > (U32)8000) && (rbCb->boUnRprtdCnt < (U32)5) 
+   if ((rbCb->lastRprtdBoToMac > (uint32_t)8000) && (rbCb->boUnRprtdCnt < (uint32_t)5) 
        && (!staPduPrsnt) && ((CM_LTE_MODE_AM == rbCb->mode ) && (AMDL.nxtRetx == NULLP)))
    {
       rbCb->boUnRprtdCnt++;
       return ROK;
    }
 #endif
+   rbCb->boUnRprtdCnt = (uint32_t)0;
+   rbCb->lastRprtdBoToMac = (uint32_t)bo;
 
-   rguSap = &(gCb->u.dlCb->rguDlSap[rbCb->rguSapId]);
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, \
+      boStatus, sizeof(RlcBoStatus));
 
-   rbCb->boUnRprtdCnt = (U32)0;
-   rbCb->lastRprtdBoToMac = (U32)bo;
+   boStatus->cellId = rbCb->rlcId.cellId;
+   boStatus->ueIdx = rbCb->rlcId.ueId;
+   boStatus->commCh = FALSE; 
+   boStatus->lcId = rbCb->lch.lChId;
+   boStatus->bo = bo;
 
-   boStatus.cellId = rbCb->rlcId.cellId;
-   boStatus.rnti = rbCb->rlcId.ueId;
-   boStatus.commCh = FALSE; 
-   boStatus.lcId = rbCb->lch.lChId;
-   boStatus.bo = bo;
-
-   /* If trace flag is enabled send the trace indication */
-   if(gCb->init.trc == TRUE)
+   FILL_PST_RLC_TO_MAC(pst, RLC_DL_INST, EVENT_BO_STATUS_TO_MAC);
+   /* Send Status Response to MAC layer */
+   if(RlcSendBoStatusToMac(&pst, boStatus) != ROK)
    {
-      /* Populate the trace params */
-      rlcLmmSendTrc(gCb, EVTRLCBOSTA, NULLP);
+      RLC_FREE_SHRABL_BUF(pst.region, pst.pool, boStatus, sizeof(RlcBoStatus));
    }
-   /* Send Status Response to MAC layer */
-   RlcMacSendBOStatus(&rguSap->pst,rguSap->spId,&boStatus);
-
 
    return ROK;
 }
@@ -722,24 +713,8 @@ CmLListCp   *sduQ;
  *
  * @return  void 
  */
-#ifdef ANSI
-Void rlcUtlCalcLiForSdu
-(
-RlcCb     *gCb,
-U16      numLi, 
-MsgLen   msgLen,
-S16      *pduSz 
-)
-#else
-Void rlcUtlCalcLiForSdu(gCb,numLi,msgLen,pduSz)
-RlcCb     *gCb;
-U16      numLi; 
-MsgLen   msgLen;
-S16      *pduSz;
-#endif 
+void rlcUtlCalcLiForSdu(RlcCb *gCb, uint16_t numLi, MsgLen msgLen, int16_t *pduSz)
 {
-   TRC2(rlcUtlCalcLiForSdu)
-
    if ( (*pduSz > msgLen)  && (msgLen < RLC_2K_BYTE))
    {
       if(0 == (numLi & RLC_BIT0)) /* check if number of LIs are odd or even */
@@ -753,7 +728,7 @@ S16      *pduSz;
          *pduSz -= 1;
       }
    }
-   RETVOID;
+   return;
 }
 
 /**
@@ -803,7 +778,7 @@ RlcDlRbCb *rbCb;
       rbCb->m.umDl.estHdrSz= 0;
    }
 
-   rlcUtlSndDStaRsp(gCb, rbCb, 0, 0, FALSE,0);
+   rlcUtlSendDedLcBoStatus(gCb, rbCb, 0, 0, FALSE,0);
 
    RETVOID;
 }
@@ -819,18 +794,8 @@ RlcDlRbCb *rbCb;
  *          TRUE  : Re-establishment is in progress
  *          FALSE : Re-establishment is not in progress
  */
-#ifdef ANSI
-Bool rlcDlUtlIsReestInProgress
-(
-RlcDlRbCb *rbCb
-)
-#else
-Bool rlcDlUtlIsReestInProgress(rbCb)
-RlcDlRbCb *rbCb;
-#endif 
+bool rlcDlUtlIsReestInProgress(RlcDlRbCb *rbCb)
 {
-   TRC2(rlcDlUtlSetReestInProgressForRB)
-
    return (rbCb->reestInProgress);
 }
 
@@ -926,18 +891,10 @@ RlcDlUeCb *ueCb;
  *
  * @return  Void
  */
-#ifdef ANSI
-Void rlcUtlIncrementKwuStsSduTx
-(
-RlcKwuSapCb *rlckwuSap 
-)
-#else
-Void rlcUtlIncrementKwuStsSduTx(rlckwuSap)
-RlcKwuSapCb *rlckwuSap;
-#endif
+void rlcUtlIncrementKwuStsSduTx(RlcKwuSapCb *rlckwuSap)
 {
    rlckwuSap->sts.sduTx++;
-   RETVOID;
+   return;
 }
 
 /**
@@ -950,23 +907,13 @@ RlcKwuSapCb *rlckwuSap;
  *
  * @return  Void
  */
-#ifdef ANSI
-Void rlcUtlIncrementGenStsBytesAndPdusSent
-(
-RlcGenSts   *genSts,
-Buffer     *pdu   
-)
-#else
-Void rlcUtlIncrementGenStsBytesAndPdusSent(genSts, pdu)
-RlcGenSts   *genSts;
-Buffer     *pdu; 
-#endif
+void rlcUtlIncrementGenStsBytesAndPdusSent(RlcGenSts *genSts, Buffer *pdu)
 {
    MsgLen bytesSent;
-   SFndLenMsg(pdu, &bytesSent);
+   ODU_GET_MSG_LEN(pdu, &bytesSent);
    genSts->bytesSent += bytesSent;
    genSts->pdusSent++;
-   RETVOID;
+   return;
 }
 
 /**
@@ -1038,24 +985,16 @@ RlcCb *gCb;
  *
  * @return  Void
  */
-#ifdef ANSI
-Void rlcUtlRaiseDlCleanupEvent
-(
-RlcCb *gCb  
-)
-#else
-Void rlcUtlRaiseDlCleanupEvent(gCb)
-RlcCb *gCb;
-#endif
+void rlcUtlRaiseDlCleanupEvent(RlcCb *gCb)
 {
 #ifdef KWSELFPSTDLCLEAN
    if(!gCb->u.dlCb->eventInQueue)
    {
-      SPstTsk(&gCb->u.dlCb->selfPst, gCb->u.dlCb->selfPstMBuf);
+      ODU_POST_TASK(&gCb->u.dlCb->selfPst, gCb->u.dlCb->selfPstMBuf);
       gCb->u.dlCb->eventInQueue = TRUE;
    }
 #endif
-   RETVOID;
+   return;
 }
 
 /**
@@ -1067,20 +1006,10 @@ RlcCb *gCb;
  *
  * @return  Void
  */
-#ifdef ANSI
-Void rlcUtlAddSduToBeFreedQueue
-(
-RlcCb    *gCb,
-RlcSdu   *sdu
-)
-#else
-Void rlcUtlAddSduToBeFreedQueue(gCb, sdu)
-RlcCb    *gCb;
-RlcSdu   *sdu;
-#endif
+void rlcUtlAddSduToBeFreedQueue(RlcCb *gCb, RlcSdu *sdu)
 {
    cmLListAdd2Tail(&(gCb->u.dlCb->toBeFreed.sduLst), &(sdu->lstEnt));
-   RETVOID;
+   return;
 }
 
 /**
@@ -2246,18 +2175,8 @@ Void;
  *  @return  Void
  */
 
-#ifdef ANSI
-void rlcUtlGetCurrTime
-(
- U32  *currTime
-)
-#else
-void rlcUtlGetCurrTime(U32 *currTime)
-U32   *currTime;
-#endif
+void rlcUtlGetCurrTime(uint32_t  *currTime)
 {
-   TRC2(rlcUtlGetCurrTime)
-
    /* Need t define else part for PAL */
    *currTime = SGetTtiCount();
 }
@@ -2359,30 +2278,16 @@ U32        pktAdmitCnt;
  *
  *  @return  Void
  */
-#ifdef ANSI
-Void rlcUtlStoreTxBuf 
-(
-CmLListCp        *txBufLst,
-RlcTx             *txBuf,
-RlcSn              sn
-)
-#else
-Void rlcUtlStoreTxBuf(txBufLst, txBuf, sn)
-CmLListCp        *txBufLst;
-RlcTx             *txBuf;
-RlcSn              sn;
-#endif
+void rlcUtlStoreTxBuf(CmLListCp *txBufLst, RlcTx *txBuf, RlcSn sn)
 {
-   U32             hashKey; 
+   uint32_t   hashKey; 
 
-   TRC3(kwUtlStoretxBuf)
-   //printf("S-sn(%d)\n", sn);
    hashKey = (sn % RLC_TX_BUF_BIN_SIZE );
    txBuf->sn = sn; 
    txBuf->lnk.node = (PTR)txBuf;
    cmLListAdd2Tail(&(txBufLst[hashKey]), &txBuf->lnk);
 
-   RETVOID;
+   return;
 } /* rlcUtlStoreRecBuf */
 
 /**
@@ -2399,26 +2304,13 @@ RlcSn              sn;
  *
  *  @return  Void
  */
-#ifdef ANSI
-RlcTx* rlcUtlGetTxBuf 
-(
-CmLListCp        *txBufLst,
-RlcSn             sn
-)
-#else
-RlcTx* rlcUtlGetTxBuf(txBufLst, sn)
-CmLListCp        *txBufLst;
-RlcSn             sn;
-#endif
+RlcTx* rlcUtlGetTxBuf(CmLListCp *txBufLst, RlcSn sn)
 {
-   U32                 hashKey; 
+   uint32_t            hashKey; 
    CmLListCp           *txBufLstCp;
-   RlcTx                *txBuf;
+   RlcTx               *txBuf;
    CmLList             *node = NULLP;
 
-   TRC3(rlcUtlGetTxBuf)
-   //printf("G-sn(%d)\n", sn);
-
    hashKey = (sn % RLC_TX_BUF_BIN_SIZE ); 
  
    txBufLstCp = &txBufLst[hashKey];
@@ -2432,7 +2324,7 @@ RlcSn             sn;
       }
       CM_LLIST_NEXT_NODE(txBufLstCp, node);
    }
-   return (NULLP);
+   return NULLP;
 } /* rlcUtlStoreTxBuf */
 /**
  *
index 1b70dce..f5b17d6 100755 (executable)
      Desc:     Source code for RLC Utility Module
                This file contains following functions
 
-                  --rlcUtlSndToLi
-                  --rlcUtlRcvFrmLi
+                  --rlcUtlSendToMac
+                  --rlcUtlRcvFrmMac
                   --rlcUtlEmptySduQ
-                  --rlcUtlSndDatInd 
+                  --rlcUtlSendUlDataToDu 
                   --kwUtlShutDown
 
      File:     kw_utl_ul.c
@@ -67,8 +67,10 @@ static int RLOG_FILE_ID=210;
 
 #include "kw.x"            /* RLC inlcudes */
 #include "kw_ul.x"         /* RLC uplink includes */
-#include "ss_rbuf.h"
-#include "ss_rbuf.x"
+#include "rlc_utils.h"
+#include "du_app_rlc_inf.h"
+#include "rlc_upr_inf_api.h"
+
 #ifdef SS_RBUF
 S16 SMrkUlPkt(Buffer *mbuf);
 #endif
@@ -95,26 +97,12 @@ RlcAmRecBuf* rlcUtlGetRecBuf(CmLListCp *recBufLst, RlcSn sn);
  *      -# RFAILED
  *
  */
-#ifdef ANSI
-S16 rlcUtlRcvFrmLi
-(
-RlcCb           *gCb,                              
-KwDatIndInfo   *datIndInfo                       
-)
-#else
-S16 rlcUtlRcvFrmLi(gCb,datIndInfo)  
-RlcCb           *gCb;                     
-KwDatIndInfo   *datIndInfo;             
-#endif
+uint8_t rlcUtlRcvFrmMac(RlcCb *gCb, KwDatIndInfo  *datIndInfo)
 {
-   U32         count;      /* Loop Counter */
+   uint32_t    count;      /* Loop Counter */
    KwPduInfo   *pduInfo;   /* PDU Information */
    RlcUlRbCb    *rbCb;      /* RB Control Block */
    RlcUlUeCb    *ueCb;      /* UE Control Block */
-/* kw005.201 added support for L2 Measurement */
-
-   TRC2(rlcUtlRcvFrmLi)
-
 
    ueCb = NULLP;
    
@@ -122,11 +110,10 @@ KwDatIndInfo   *datIndInfo;
    if( ROK != rlcDbmFetchUlUeCb(gCb,datIndInfo->rnti,datIndInfo->cellId,&(ueCb)))
    {
       /* Fetch UeCb failed */
-      RLOG_ARG1(L_ERROR,DBG_CELLID,datIndInfo->cellId,
-               "UEID:%d UeCb not found",
+      DU_LOG("\nRLC : rlcUtlRcvFrmMac : UEID:%d UeCb not found",
                datIndInfo->rnti);
       /* free the buffers inside the datIndInfo */
-      U32 i,j;
+      uint32_t i,j;
       for(i = 0; i< datIndInfo->numLch; i++)
       {
          for(j = 0; j < datIndInfo->lchData[i].pdu.numPdu; j++)
@@ -163,7 +150,7 @@ KwDatIndInfo   *datIndInfo;
        */
       if(rbCb == NULLP)
       {
-         U32 j;
+         uint32_t j;
          for(j = 0; j < pduInfo->numPdu; j++)
          {
             if(pduInfo->mBuf[j])
@@ -214,27 +201,15 @@ KwDatIndInfo   *datIndInfo;
  * @return  S16
  *      -# ROK 
  */
-#ifdef ANSI
-S16 rlcUtlSndDatInd
-(
-RlcCb       *gCb,
-RlcUlRbCb   *rbCb,                   
-Buffer     *sdu                    
-)
-#else
-S16 rlcUtlSndDatInd(gCb,rbCb,sdu)
-RlcCb       *gCb;
-RlcUlRbCb   *rbCb;                  
-Buffer     *sdu;                    
-#endif
+uint8_t rlcUtlSendUlDataToDu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *sdu)
 {
 #ifndef KW_PDCP
    KwuDatIndInfo   *datIndInfo;   /* Data Indication Information */
    KwuDatIndInfo datIndInfoTmp;
 #endif
-
-   TRC3(rlcUtlSndDatInd)
-
+   RlcUlRrcMsgInfo *ulRrcMsgInfo;
+   uint16_t        msgLen, copyLen;
+   Pst             pst;
 
 #ifndef KW_PDCP
    /* Creating static memory for KwuDatIndInfo. #else will be 
@@ -244,10 +219,8 @@ Buffer     *sdu;
 #if (ERRCLASS & ERRCLS_ADD_RES )
    if ( datIndInfo == NULLP  )
    {
-      RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId,
-               "Memory allocation failed UEID:%d CELLID:%d",
-               rbCb->rlcId.ueId,
-               rbCb->rlcId.cellId);
+      DU_LOG("\nRLC : rlcUtlSendUlDataToDu: Memory allocation failed UEID:%d \
+         CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
       RLC_FREE_BUF(sdu);
       return RFAILED;
    }
@@ -259,18 +232,42 @@ Buffer     *sdu;
    datIndInfo->isOutOfSeq = rbCb->m.amUl.isOutOfSeq; 
 #endif /* KW_PDCP */
    
-   /* If trace flag is enabled send the trace indication */
-   if(gCb->init.trc == TRUE)
+   /* Filling UL RRC Message Info */
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL,
+      ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
+   if (ulRrcMsgInfo)
    {
-      /* Populate the trace params */
-      rlcLmmSendTrc(gCb,KWU_EVT_DAT_IND, sdu);
-   }
-#ifndef KW_PDCP
+       ulRrcMsgInfo->cellId = rbCb->rlcId.cellId;
+       ulRrcMsgInfo->ueIdx = rbCb->rlcId.ueId;
+       ulRrcMsgInfo->lcId = rbCb->lch.lChId;
+       RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL,
+          ulRrcMsgInfo->rrcMsg, msgLen);
+       if (ulRrcMsgInfo->rrcMsg)
+       {
+          ODU_GET_MSG_LEN(sdu, (MsgLen *)&msgLen);
+          ODU_COPY_MSG_TO_FIX_BUF(sdu, 0, msgLen, ulRrcMsgInfo->rrcMsg, (MsgLen *)&copyLen);
+          ulRrcMsgInfo->msgLen = msgLen;
+
+          /* Sending UL RRC Message transfeer to DU APP */
+          memset(&pst, 0, sizeof(Pst));
+          FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_RRC_MSG_TRANS_TO_DU);
+          rlcSendUlRrcMsgToDu(&pst, ulRrcMsgInfo);
+       }
+       else
+       {
+          DU_LOG("\nRLC : rlcUtlSendUlDataToDu: Memory allocation failed for rrcMsg");
+         RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
+         return RFAILED;
+       }
+    }
+    else
+    {
+       DU_LOG("\nRLC : rlcUtlSendUlDataToDu: Memory allocation failed for ulRrcMsgInfo");
+       return RFAILED;
+    }
 
-   RlcUiKwuDatInd(&gCb->genCfg.lmPst, datIndInfo, sdu);
-#endif   
-   return (ROK);
-} /* rlcUtlSndDatInd */
+   return ROK;
+} /* rlcUtlSendUlDataToDu */
 
 
 PRIVATE Void dumpRLCUlRbInformation(RlcUlRbCb* ulRbCb)
@@ -1077,29 +1074,15 @@ U8             measType;
  *
  *  @return  Void
  */
-#ifdef ANSI
-Void rlcUtlStoreRecBuf 
-(
-CmLListCp        *recBufLst,
-RlcAmRecBuf       *recBuf,
-RlcSn              sn
-)
-#else
-Void rlcUtlStoreRecBuf(recBufLst, recBuf, sn)
-CmLListCp        *recBufLst;
-RlcAmRecBuf       *recBuf;
-RlcSn              sn;
-#endif
+void rlcUtlStoreRecBuf(CmLListCp *recBufLst, RlcAmRecBuf *recBuf, RlcSn sn)
 {
-   U32             hashKey; 
-
-   TRC3(rlcUtlStoreRecBuf)
+   uint32_t    hashKey; 
    
    hashKey = (sn % RLC_RCV_BUF_BIN_SIZE ); 
    recBuf->lnk.node = (PTR)recBuf;
    cmLListAdd2Tail(&(recBufLst[hashKey]), &recBuf->lnk);
 
-   RETVOID;
+   return;
 } /* rlcUtlStoreRecBuf */
 
 /**
@@ -1116,25 +1099,13 @@ RlcSn              sn;
  *
  *  @return  Void
  */
-#ifdef ANSI
-RlcAmRecBuf* rlcUtlGetRecBuf 
-(
-CmLListCp        *recBufLst,
-RlcSn             sn
-)
-#else
-RlcAmRecBuf* rlcUtlGetRecBuf(recBufLst, sn)
-CmLListCp        *recBufLst;
-RlcSn             sn;
-#endif
+RlcAmRecBuf* rlcUtlGetRecBuf(CmLListCp *recBufLst, RlcSn sn)
 {
-   U32                 hashKey; 
+   uint32_t            hashKey; 
    CmLListCp           *recBufLstCp;
    RlcAmRecBuf          *recBuf;
    CmLList             *node = NULLP;
 
-   TRC3(rlcUtlGetRecBuf)
-
    hashKey = (sn % RLC_RCV_BUF_BIN_SIZE ); 
  
    recBufLstCp = &recBufLst[hashKey];
@@ -1144,11 +1115,11 @@ RlcSn             sn;
       recBuf = (RlcAmRecBuf *) node->node;
       if(recBuf->amHdr.sn == sn)
       {
-         return (recBuf);
+         return recBuf;
       }
       CM_LLIST_NEXT_NODE(recBufLstCp, node);
    }
-   return (NULLP);
+   return NULLP;
 } /* rlcUtlStoreRecBuf */
 /**
  *
@@ -1164,32 +1135,18 @@ RlcSn             sn;
  *
  *  @return  Void
  */
-#ifdef ANSI
-Void rlcUtlDelRecBuf 
-(
-CmLListCp        *recBufLst,
-RlcAmRecBuf       *recBuf,
-RlcCb              *gCb                              
-)
-#else
-Void rlcUtlDelRecBuf(recBufLst, recBufi, gCb)
-CmLListCp        *recBufLst;
-RlcAmRecBuf       *recBuf;
-RlcCb             *gCb;                              
-#endif
+void rlcUtlDelRecBuf(CmLListCp *recBufLst, RlcAmRecBuf *recBuf, RlcCb *gCb)
 {
-   U32                 hashKey; 
+   uint32_t                 hashKey; 
    CmLListCp           *recBufLstCp;
 
-   TRC3(rlcUtlDelRecBuf)
-
    hashKey = (recBuf->amHdr.sn % RLC_RCV_BUF_BIN_SIZE ); 
  
    recBufLstCp = &recBufLst[hashKey];
    cmLListDelFrm(recBufLstCp, &recBuf->lnk);
    RLC_FREE_WC(gCb, recBuf, sizeof(RlcAmRecBuf));
 
-   RETVOID;
+   return;
 } /* rlcUtlDelRecBuf */
 
 
index 7bf768b..3a9e481 100644 (file)
 
 #ifdef EGTP_TEST
 #include "common_def.h"
-#include "mac_stub.h"
 
-uint8_t rlcDatSn = 0;
-uint64_t ulDatNum = 0;
-
-uint8_t macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
-{
-  Pst rspPst;
-  RlcMacSchedRepInfo *schRep;
-
-  DU_LOG("\nMAC : Received BO status from RLC");
-
-//  SGetSBuf(pst->region, pst->pool, (Data **)&rspPst, sizeof(Pst));
-
-  rspPst.selector  = ODU_SELECTOR_TC;
-  rspPst.srcEnt    = pst->dstEnt;
-  rspPst.dstEnt    = pst->srcEnt;
-  rspPst.dstInst   = pst->srcInst;
-  rspPst.dstProcId = pst->srcProcId;
-  rspPst.srcProcId = pst->dstProcId;
-  rspPst.region    = pst->region; 
-  rspPst.pool    = pst->pool;
-
-  /* Filling Scheduling Report */
-  RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRepInfo));
-   
-  schRep->cellId = boSta->cellId;
-  schRep->rnti   = boSta->rnti;
-  schRep->nmbLch = 1;
-  schRep->lchSta[0].commCh = boSta->commCh;
-  schRep->lchSta[0].lchStaInd.lcId = boSta->lcId;
-  schRep->lchSta[0].lchStaInd.totBufSize = boSta->bo + 5; /* Extra buffer space including RLC and MAC Header size */
-
-  DU_LOG("\nMAC : Sending scheduling report to RLC");
-  
-  RlcMacProcSchedRep(&rspPst, 1, schRep);
-
-  return ROK;
-
-}
+#define DU_IP_V4_ADDR "192.168.130.81"
+#define CU_IP_V4_ADDR "192.168.130.82"
 
-uint8_t macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
-{
-   U32 availmem;
-
-   Pst rspPst;
-   Buffer *mBuf;
-   RlcMacData *ulData;
-
-   DU_LOG("\nMAC_STUB : Received DL data from RLC to be sent to PHY"); 
-
-   ODU_PUT_MSG_BUF(dlData->pduInfo[0].pduBuf);
-   dlData->pduInfo[0].pduBuf = NULL;
-
-#if 0
-   RLC_FREE_SHRABL_BUF(pst->region, pst->pool,
-                        dlData, sizeof(RlcMacData));
-{
-   RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool,
-                          ulData, sizeof(RlcMacData));
-
-   SRegInfoShow(2, &availmem);
-   cmMemcpy((U8 *)ulData, (U8 *)dlData, sizeof(RlcMacData));
-#endif
-   
-   ulData = dlData;
-   ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf);
-   macStubBuildUlData(mBuf);
-   ulData->pduInfo[0].pduBuf = mBuf;
-
-   /* Fill response post */
-   rspPst.selector  = ODU_SELECTOR_TC;
-   rspPst.srcEnt    = pst->dstEnt;
-   rspPst.dstEnt    = pst->srcEnt;
-   rspPst.dstInst   = pst->srcInst;
-   rspPst.dstProcId = pst->srcProcId;
-   rspPst.srcProcId = pst->dstProcId;
-   rspPst.region    = pst->region;
-   rspPst.pool      = pst->pool;
-
-   ulDatNum++;
-   DU_LOG("\nMAC_STUB : UL data number %d", ulDatNum);
-   RlcProcUlData(&rspPst, 1, ulData);
-   return ROK;
-}
+uint8_t rlcDatSn = 0;
 
 void macStubBuildUlData(Buffer *mBuf)
 {
    char data[30] = "This is EGTP data from DU";
    int datSize = 30;
-   U32 availmem;
 
    ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf);
 
@@ -186,15 +105,7 @@ void macStubBuildUlData(Buffer *mBuf)
    ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf);
 
    ODU_ADD_PRE_MSG_MULT((Data *)&rlcDatSn, sizeof(uint8_t), mBuf);
-#if 0
-   SRegInfoShow(0, &availmem);
-   SRegInfoShow(1, &availmem);
-   SRegInfoShow(2, &availmem);
-   SRegInfoShow(3, &availmem);
-   SRegInfoShow(4, &availmem);
-#endif
-   //rlcDatSn++;
-   //
+
    if(rlcDatSn++ >15 )
       rlcDatSn = 0;
 
diff --git a/src/5gnrrlc/rlc_lwr_inf_api.c b/src/5gnrrlc/rlc_lwr_inf_api.c
new file mode 100644 (file)
index 0000000..615f9f3
--- /dev/null
@@ -0,0 +1,86 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+/* This file defines API towards lower interface of RLC */
+
+#include "common_def.h"
+#include "rlc_mac_inf.h" 
+
+RlcMacBoStatusFunc rlcMacSendBoStatusOpts[] =
+{
+   packRlcBoStatus,            /* 0 - loosely coupled */
+   MacProcRlcBoStatus,      /* 1 - tightly coupled, MAC  */
+   packRlcBoStatus,            /* 2 - LWLC loosely coupled */
+};
+RlcMacDlDataFunc rlcMacSendDlDataOpts[] =
+{
+   packRlcDlData,            /* 0 - loosely coupled */
+   MacProcRlcDlData,      /* 1 - tightly coupled, MAC  */
+   packRlcDlData,            /* 2 - loosely coupled */
+};
+/**
+ *
+ * @brief  
+ *
+ *        Handler for reporting the Buffer Occupancy to MAC 
+ *        for logical channels.
+ *
+ * @b Description:
+ *
+ *        This function reports the Buffer Occupancy of one or more
+ *         logical channels to MAC. 
+ *
+ *  @param[in] post         Post structure  
+ *  @param[in] spId        Service Provider ID
+ *  @param[in] boSta       BO Status Information 
+ *
+ *  @return  S16
+ *      -# ROK 
+ *      -# RFAILED
+ *
+ */
+uint8_t RlcSendBoStatusToMac(Pst *pst, RlcBoStatus *boSta)
+{
+   /* jump to specific primitive depending on configured selector */
+   return (*rlcMacSendBoStatusOpts[pst->selector])(pst, boSta);
+} /* end of RlcMacSendBOStatus */
+/*******************************************************************
+ *
+ * @brief Sends DL data to MAC
+ *
+ * @details
+ *
+ *    Function : RlcSendDlDataToMac
+ *
+ *    Functionality: Sends DL data to MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcSendDlDataToMac(Pst *pst, RlcData *dlData)
+{
+   /* jump to specific primitive depending on configured selector */
+   return (*rlcMacSendDlDataOpts[pst->selector])(pst, dlData);
+}
+/**********************************************************************
+         End of file
+**********************************************************************/
similarity index 70%
rename from src/5gnrrlc/rlc_utils.c
rename to src/5gnrrlc/rlc_lwr_inf_api.h
index 4f154df..1c1be9c 100644 (file)
 ################################################################################
 *******************************************************************************/
 
-#include "common_def.h"
+/* This file stores defines used at RLC lower mac interface */
 
-/*******************************************************************
- *
- * @brief Reverse fixed buffer
- *
- * @details
- *
- *    Function : reverseFixBuf
- *
- *    Functionality: Reverse fixed buffer
- *
- * @params[in] Fixed buffer to be reversed
- *             Buffer length
- * @return void
- *
- * ****************************************************************/
-void reverseFixBuf(uint8_t *buf, uint16_t len)
-{
-   uint8_t idx, revIdx;
-   uint8_t temp;
-
-   for(idx = 0, revIdx = len-1; idx < len/2; idx++, revIdx--)
-   {
-      temp = buf[idx];
-      buf[idx] = buf[revIdx];
-      buf[revIdx] = temp;
-   }
-   return;
-}
+uint8_t RlcSendBoStatusToMac(Pst *pst, RlcBoStatus *staRsp);
+uint8_t RlcSendDlDataToMac(Pst *pst, RlcData *dlData);
 
 /**********************************************************************
          End of file
 **********************************************************************/
+
index 4c0a977..0633465 100644 (file)
@@ -24,7 +24,9 @@
 #include "kwu.h"           /* KWU defines */
 #include "kw_env.h"        /* RLC environment options */
 #include "kw.h"            /* RLC defines */
-
+#include "kw_udx.h"
+#include "kw_ul.h"
+#include "kw_dl.h"
 
 /* header/extern include files (.x) */
 #include "rgu.x"           
 #include "kwu.x"           /* KWU */
 #include "kw_err.h"
 #include "kw.x"
+#include "kw_udx.x"
+#include "kw_dl.x"
+#include "kw_ul.x"
 
+#include "rlc_mac_inf.h"
 #include "du_app_rlc_inf.h"
 #include "rlc_utils.h"
 #include "rlc_upr_inf_api.h"
@@ -241,7 +247,7 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
 
        /* Sending UL RRC Message transfeer to DU APP */
        memset(&pst, 0, sizeof(Pst));
-       FILL_PST_RLC_TO_DUAPP(pst, SFndProcId(), RLC_UL_INST, EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU);
+       FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU);
        rlcSendRrcDeliveryReportToDu(&pst, rrcDelivery);
     }
     else
@@ -269,7 +275,6 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
  * ****************************************************************/
 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
 {
-   uint16_t      copyLen;
    Buffer        *mBuf;
    KwuDatReqInfo *datReqInfo;
 
@@ -277,6 +282,8 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    if(!datReqInfo)
    {
       DU_LOG("\nRLC : Memory allocation failed in RlcProcDlRrcMsgTransfer");
+      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
+      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
       return RFAILED;
    }
 
@@ -292,16 +299,14 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    {
       DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
       RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
+      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
       return RFAILED;
    }
-   /* ODU_COPY_FIX_BUF_TO_MSG copies fixed buffer in reverse order. Hence reversing the
-    * fixed buffer before copying in order to maintain the actual order*/
-   reverseFixBuf(dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
-   ODU_COPY_FIX_BUF_TO_MSG(dlRrcMsgInfo->rrcMsg, mBuf, 0, dlRrcMsgInfo->msgLen, \
-        (MsgLen *)&copyLen);
-
-   RlcUiKwuDatReq(pst, datReqInfo, mBuf);
-   
+   oduCpyFixBufToMsg(dlRrcMsgInfo->rrcMsg, mBuf, dlRrcMsgInfo->msgLen);
+
+   rlcProcDlData(pst, datReqInfo, mBuf);
+
    /* RRC Delivery report is only send when RRC Delivery status report is true in DL RRC Message */
    if(dlRrcMsgInfo->deliveryStaRpt)
    {
@@ -314,6 +319,252 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
    return ROK;
 }
+
+/*******************************************************************
+ *
+ * @brief Process UL data from UE
+ *
+ * @details
+ *
+ *    Function : RlcProcUlData
+ *
+ *    Functionality:
+ *       This function receives the PDU from MAC.
+ *       seggregates common and dedicated logical channel
+ *       PDU and call respective handler.
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
+{
+   uint8_t         ret = ROK;
+   uint8_t              idx, pduIdx;
+   uint8_t              lcId;                    /* Logical Channel */
+   uint8_t              numDLch = 0;             /* Number of dedicated logical channel */
+   bool            dLchPduPres;             /* PDU received on dedicated logical channel */
+   RguLchDatInd    dLchData[MAX_NUM_LC];  /* PDU info on dedicated logical channel */
+   RguDDatIndInfo  *dLchUlDat;               /* UL data on dedicated logical channel */
+   RguCDatIndInfo  *cLchUlDat;               /* UL data on common logical channel */
+
+   /* Initializing dedicated logical channel Database */
+   for(idx = 0; idx < MAX_NUM_LC; idx++)
+   {
+      dLchData[idx].lcId = idx;
+      dLchData[idx].pdu.numPdu = 0;
+   }
+   dLchPduPres = FALSE;
+
+   /* Seggregate PDUs received on common and dedicated channels
+    * and call common channel's handler */
+   for(idx = 0; idx< ulData->numPdu; idx++)
+   {
+      if(ulData->pduInfo[idx].commCh)
+      {
+         RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \
+           sizeof(RguCDatIndInfo));
+        if(!cLchUlDat)
+        {
+           DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
+           ret = RFAILED;
+           break;
+        }
+         memset(cLchUlDat, 0, sizeof(RguCDatIndInfo));
+
+         cLchUlDat->cellId = ulData->cellId;
+         GET_UE_IDX(ulData->rnti, cLchUlDat->rnti);
+         cLchUlDat->lcId   = ulData->pduInfo[idx].lcId;
+
+         /* Copy fixed buffer to message */
+         if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &cLchUlDat->pdu) != ROK)
+         {
+            DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
+           RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \
+              sizeof(RguCDatIndInfo));
+            ret = RFAILED;
+           break;
+         }
+         oduCpyFixBufToMsg(ulData->pduInfo[idx].pduBuf, cLchUlDat->pdu, \
+           ulData->pduInfo[idx].pduLen);
+
+         rlcProcCommLcUlData(pst, 0, cLchUlDat);
+      }
+      else
+      {
+         if(!dLchPduPres)
+         {
+            RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_UL, RLC_POOL, dLchUlDat, \
+              sizeof(RguDDatIndInfo));
+           if(!dLchUlDat)
+           {
+              DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
+              ret = RFAILED;
+              break;
+           }
+            dLchPduPres = TRUE;
+         }
+
+        /* Copy fixed buffer to message */
+        lcId = ulData->pduInfo[idx].lcId;
+        if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, \
+                 &dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]) != ROK)
+        {
+           DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
+           for(pduIdx=0; pduIdx < dLchData[lcId].pdu.numPdu; pduIdx++)
+           {
+              ODU_PUT_MSG_BUF(dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]);
+           }
+           RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, dLchUlDat, \
+              sizeof(RguDDatIndInfo));
+           ret = RFAILED;
+           break;
+        }
+        oduCpyFixBufToMsg(ulData->pduInfo[idx].pduBuf, \
+              dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu],\
+              ulData->pduInfo[idx].pduLen);
+
+         dLchData[lcId].pdu.numPdu++;
+      }
+   }
+
+   /* If any PDU received on dedicated logical channel, copy into RguDDatIndInfo
+    * and call its handler */
+   if(ret == ROK)
+   {
+      if(dLchPduPres)
+      {
+        dLchUlDat->cellId = ulData->cellId;
+        dLchUlDat->rnti   = ulData->rnti;
+
+        for(idx = 0; idx < MAX_NUM_LC; idx++)
+        {
+           if(dLchData[idx].pdu.numPdu)
+           {
+              memcpy(&dLchUlDat->lchData[numDLch], &dLchData[idx], sizeof(RguLchDatInd));
+              numDLch++;
+           }
+        }
+        dLchUlDat->numLch = numDLch;
+        rlcProcDedLcUlData(pst, 0, dLchUlDat);
+      }
+   }
+
+   for(pduIdx = 0; pduIdx < ulData->numPdu; idx++)
+   {
+      RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData->pduInfo[pduIdx].pduBuf, \
+         ulData->pduInfo[pduIdx].pduLen);
+   }
+   RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData, sizeof(RlcData));
+   return ROK;
+
+}/* End of RlcProcUlData */
+
+/*******************************************************************
+ *
+ * @brief Handler for extracting common and dedicated channel
+ *      Scheduling result report.
+ *
+ * @details
+ *
+ *    Function : RlcProcSchedResultRpt
+ *
+ *    Functionality:
+ *     Handler for extracting common and dedicated channel
+ *      Scheduling result report
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep)
+{
+   uint8_t ret = ROK;
+   uint8_t idx;                     /* Iterator */
+   uint8_t nmbDLch = 0;                 /* Number of dedicated logical channles */
+   RguCStaIndInfo   *cLchSchInfo;    /* Common logical channel scheduling result */
+   RguDStaIndInfo   *dLchSchInfo;  /* Dedicated logical channel scheduling result */
+
+   DU_LOG("\nRLC : Received scheduling report from MAC");
+
+   for(idx=0; idx < schRep->numLc; idx++)
+   {
+      /* If it is common channel, fill status indication information
+       * and trigger the handler for each common lch separately */
+      if(schRep->lcSch[idx].commCh)
+      {
+          RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, cLchSchInfo, \
+            sizeof(RguCStaIndInfo));
+         if(!cLchSchInfo)
+         {
+            DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for cLchSchInfo");
+            ret = RFAILED;
+            break;
+         }
+          memset(cLchSchInfo, 0, sizeof(RguCStaIndInfo));
+
+          cLchSchInfo->cellId  = schRep->cellId;
+          cLchSchInfo->lcId    = schRep->lcSch[idx].lcId;
+          cLchSchInfo->transId = schRep->slotInfo.sfn;
+         cLchSchInfo->transId = (cLchSchInfo->transId << 16) | schRep->slotInfo.slot;
+          cLchSchInfo->rnti = schRep->rnti;
+          rlcProcCommLcSchedRpt(pst, 0, cLchSchInfo);
+
+      }
+      else
+      {
+          /* Fill status info structure if at least one dedicated channel
+           * scheduling report is received */
+          if(nmbDLch == 0)
+          {
+             RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, dLchSchInfo, \
+               sizeof(RguDStaIndInfo));
+             if(!dLchSchInfo)
+             {
+                DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for dLchSchInfo");
+                ret = RFAILED;
+                break;
+             }
+
+             dLchSchInfo->cellId = schRep->cellId;
+             dLchSchInfo->nmbOfUeGrantPerTti = 1;
+            /* MAC sends Scheduling report for one UE at a time. Hence filling
+            only the 0th index of staInd */
+             dLchSchInfo->staInd[0].rnti = schRep->rnti;
+
+            /* Storing sfn/slot into a single 32-bit variable to be used later*/
+            dLchSchInfo->staInd[0].transId = schRep->slotInfo.sfn;
+            dLchSchInfo->staInd[0].transId = \
+               (dLchSchInfo->staInd[0].transId << 16) | schRep->slotInfo.slot; 
+             dLchSchInfo->staInd[0].nmbOfTbs = 1;
+             dLchSchInfo->staInd[0].fillCtrlPdu = true; 
+          }
+
+          /* Fill logical channel scheduling info */
+         dLchSchInfo->staInd[0].staIndTb[0].lchStaInd[nmbDLch].lcId = \
+            schRep->lcSch[idx].lcId;
+         dLchSchInfo->staInd[0].staIndTb[0].lchStaInd[nmbDLch].totBufSize = \
+            schRep->lcSch[idx].bufSize;
+          nmbDLch++;
+      }
+   }
+
+   /* Calling handler for all dedicated channels scheduling*/
+   if(ret == ROK)
+   {
+      if(nmbDLch)
+      {
+         dLchSchInfo->staInd[0].staIndTb[0].nmbLch = nmbDLch;
+         rlcProcDedLcSchedRpt(pst, 0, dLchSchInfo);
+      }
+   }
+
+   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, schRep, sizeof(RlcSchedResultRpt));
+   return ret;
+}
+
 /**********************************************************************
          End of file
 **********************************************************************/
index 4cc614f..8786fa9 100644 (file)
 #define RLC_UL_INST   0
 #define RLC_DL_INST   1
 
+#define PDCP_SN 1
+
 /* Fill Pst structure for sending msg from RLC to DUAPP */
-#define FILL_PST_RLC_TO_DUAPP(_pst, _procId, _srcInst, _event) \
+#define FILL_PST_RLC_TO_DUAPP(_pst, _srcInst, _event) \
 {                                                              \
    _pst.selector    = ODU_SELECTOR_LWLC;                       \
-   _pst.srcEnt      = ENTRLC;                                   \
+   _pst.srcEnt      = ENTRLC;                                  \
    _pst.dstEnt      = ENTDUAPP;                                \
    _pst.dstInst     = 0;                                       \
    _pst.srcInst     = _srcInst;                                \
-   _pst.dstProcId   = _procId;                                 \
-   _pst.srcProcId   = _procId;                                 \
+   _pst.dstProcId   = ODU_GET_PROCID();                        \
+   _pst.srcProcId   = ODU_GET_PROCID();                        \
    if(_srcInst == RLC_UL_INST)                                 \
    {                                                           \
       _pst.region   = RLC_MEM_REGION_UL;                       \
    _pst.intfVer     = 0;                                       \
 }
 
-#define PDCP_SN 1
-void reverseFixBuf(uint8_t *buf, uint16_t len);
+#define FILL_PST_RLC_TO_MAC(_pst, _srcInst, _event)    \
+{                                                      \
+   pst.selector  = ODU_SELECTOR_LWLC;                  \
+   pst.srcEnt    = ENTRLC;                             \
+   pst.dstEnt    = ENTMAC;                             \
+   pst.dstInst   = 0;                                  \
+   pst.srcInst   = _srcInst;                           \
+   pst.dstProcId = ODU_GET_PROCID();                   \
+   pst.srcProcId = ODU_GET_PROCID();                   \
+   if(_srcInst == RLC_UL_INST)                         \
+   {                                                   \
+      pst.region    = RLC_MEM_REGION_UL;               \
+   }                                                   \
+   else if(_srcInst == RLC_DL_INST)                    \
+   {                                                   \
+      pst.region    = RLC_MEM_REGION_DL;               \
+   }                                                   \
+   pst.pool      = RLC_POOL;                           \
+   pst.event     = _event;                             \
+   pst.route     = 0;                                  \
+   pst.prior     = 0;                                  \
+   pst.intfVer   = 0;                                  \
+}
+
 uint16_t getTransId();
 
 /**********************************************************************
index 583cce7..7b1199f 100644 (file)
@@ -50,6 +50,7 @@
 
 extern SchCb schCb[SCH_MAX_INST];
 void SchFillCfmPst(Pst *reqPst,Pst *cfmPst,RgMngmt *cfm);
+
 /* local defines */
 SchCellCfgCfmFunc SchCellCfgCfmOpts[] = 
 {
@@ -95,7 +96,7 @@ uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason)
    schCb[inst].schInit.acnt = FALSE;
    schCb[inst].schInit.usta = FALSE;
    schCb[inst].schInit.trc = FALSE;
-   schCb[inst].schInit.procId = SFndProcId();
+   schCb[inst].schInit.procId = ODU_GET_PROCID();
 
    return ROK;
 } /* schActvInit */
@@ -471,16 +472,16 @@ void fillSchSib1Cfg(Inst schInst, SchSib1Cfg *sib1SchCfg, uint16_t pci, \
    bwp->cyclicPrefix       = 0;              /* normal */
 
    /* fill the PDCCH PDU */
-   pdcch->coreset0Cfg.coreSetSize = numRbs;
-   pdcch->coreset0Cfg.startSymbolIndex = firstSymbol;
-   pdcch->coreset0Cfg.durationSymbols = numSymbols;
-   memcpy(pdcch->coreset0Cfg.freqDomainResource,FreqDomainResource,6);
-   pdcch->coreset0Cfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
-   pdcch->coreset0Cfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.coreSetType = 0;
-   pdcch->coreset0Cfg.shiftIndex = pci;
-   pdcch->coreset0Cfg.precoderGranularity = 0; /* sameAsRegBundle */
+   pdcch->coresetCfg.coreSetSize = numRbs;
+   pdcch->coresetCfg.startSymbolIndex = firstSymbol;
+   pdcch->coresetCfg.durationSymbols = numSymbols;
+   memcpy(pdcch->coresetCfg.freqDomainResource,FreqDomainResource,6);
+   pdcch->coresetCfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
+   pdcch->coresetCfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.coreSetType = 0;
+   pdcch->coresetCfg.shiftIndex = pci;
+   pdcch->coresetCfg.precoderGranularity = 0; /* sameAsRegBundle */
    pdcch->numDlDci = 1;
    pdcch->dci.rnti = SI_RNTI;
    pdcch->dci.scramblingId = pci;
@@ -626,6 +627,10 @@ uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg)
         schCellCfg->ssbSchCfg.ssbOffsetPointA);
    memcpy(&cellCb->cellCfg, schCellCfg, sizeof(SchCellCfg));
 
+   /* Initializing global variables */
+   cellCb->actvUeBitMap = 0;
+   cellCb->boIndBitMap = 0;
+
    /* Fill and send Cell config confirm */
    memset(&rspPst, 0, sizeof(Pst));
    FILL_PST_SCH_TO_MAC(rspPst, pst->dstInst);
@@ -656,37 +661,56 @@ uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo)
+uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
 {
-   uint16_t  lcIdx;
+   uint8_t  lcId = 0;
+   uint16_t ueIdx = 0;
+   uint16_t slot;
+   SchUeCb *ueCb = NULLP;
+   SchCellCb *cell = NULLP;
+   SchDlSlotInfo *schDlSlotInfo = NULLP;
+
    Inst  inst = pst->dstInst-SCH_INST_START;
    DU_LOG("\nSCH : Received RLC BO Status indication");
 
-   SchCellCb *cell = schCb[inst].cells[inst];
-   SchDlSlotInfo *schDlSlotInfo = \
-                                 cell->schDlSlotInfo[(cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + MSG4_DELAY) % SCH_NUM_SLOTS];
+   cell = schCb[inst].cells[inst];
+
+   GET_UE_IDX(dlBoInfo->crnti, ueIdx);
+   ueCb = &cell->ueCb[ueIdx-1];
+   lcId  = dlBoInfo->lcId;
 
-   for(lcIdx = 0; lcIdx < dlBoInfo->numLc; lcIdx++)
+   if(lcId == SRB1_LCID || lcId == SRB2_LCID || lcId == SRB3_LCID || \
+      (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
    {
-      if(dlBoInfo->boInfo[lcIdx].lcId == CCCH_LCID)
-      {
-        SCH_ALLOC(schDlSlotInfo->msg4Info, sizeof(Msg4Info));
-        if(!schDlSlotInfo->msg4Info)
-        {
-           DU_LOG("\nSCH : Memory allocation failed for msg4Info");
-           schDlSlotInfo = NULL;
-           return RFAILED;
-        }
-        schDlSlotInfo->msg4Info->crnti = dlBoInfo->crnti;
-        schDlSlotInfo->msg4Info->ndi = 1;
-        schDlSlotInfo->msg4Info->harqProcNum = 0;
-        schDlSlotInfo->msg4Info->dlAssignIdx = 0;
-        schDlSlotInfo->msg4Info->pucchTpc = 0;
-        schDlSlotInfo->msg4Info->pucchResInd = 0;
-        schDlSlotInfo->msg4Info->harqFeedbackInd = 0;
-        schDlSlotInfo->msg4Info->dciFormatId = 1;
-      }
+      SET_ONE_BIT(ueIdx, cell->boIndBitMap);
+      ueCb->dlLcCtxt[lcId].bo = dlBoInfo->dataVolume;
+   }
+   else if(lcId != SRB0_LCID)
+   {
+      DU_LOG("\nSCH : Invalid LC Id %d in MacSchDlRlcBoInfo", lcId);
+      return RFAILED;
+   }
+
+   slot = (cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + BO_DELTA) % SCH_NUM_SLOTS;
+   schDlSlotInfo = cell->schDlSlotInfo[slot];
+
+   SCH_ALLOC(schDlSlotInfo->dlMsgInfo, sizeof(DlMsgInfo));
+   if(!schDlSlotInfo->dlMsgInfo)
+   {
+      DU_LOG("\nSCH : Memory allocation failed for dlMsgInfo");
+      schDlSlotInfo = NULL;
+      return RFAILED;
    }
+   schDlSlotInfo->dlMsgInfo->crnti = dlBoInfo->crnti;
+   schDlSlotInfo->dlMsgInfo->ndi = 1;
+   schDlSlotInfo->dlMsgInfo->harqProcNum = 0;
+   schDlSlotInfo->dlMsgInfo->dlAssignIdx = 0;
+   schDlSlotInfo->dlMsgInfo->pucchTpc = 0;
+   schDlSlotInfo->dlMsgInfo->pucchResInd = 0;
+   schDlSlotInfo->dlMsgInfo->harqFeedbackInd = 0;
+   schDlSlotInfo->dlMsgInfo->dciFormatId = 1;
+   if(lcId == SRB0_LCID)
+      schDlSlotInfo->dlMsgInfo->isMsg4Pdu = true;
 
    return ROK;
 }
index 5322e8c..2169519 100644 (file)
@@ -43,6 +43,9 @@
 
 #define CRC_FAILED 0
 #define CRC_PASSED 1
+
+#define RLC_HDR_SIZE  3   /* 3 bytes of RLC Header size */
+#define MAC_HDR_SIZE  3   /* 3 bytes of MAC Header */
 #define UL_GRANT_SIZE 224
 
 typedef struct schCellCb SchCellCb;
@@ -54,6 +57,12 @@ typedef enum
    SCH_UE_STATE_ACTIVE
 }SchUeState;
 
+typedef enum
+{
+   SCH_LC_STATE_INACTIVE,
+   SCH_LC_STATE_ACTIVE
+}SchLcState;
+
 /**
  * @brief
  * Structure holding LTE MAC's General Configuration information.
@@ -83,7 +92,7 @@ typedef struct schDlSlotInfo
    SsbInfo   ssbInfo[MAX_SSB_IDX];              /*!< SSB info */
    bool      sib1Pres;                          /*!< Flag to determine if SIB1 is present in this slot */
    RarInfo   *rarInfo;                          /*!< RAR info */
-   Msg4Info  *msg4Info;                         /*!< msg4 info */
+   DlMsgInfo *dlMsgInfo;                       /*!< DL dedicated Msg info */
 }SchDlSlotInfo;
 
 typedef struct schRaCb
@@ -116,7 +125,22 @@ typedef struct bsrInfo
    uint32_t   dataVol;   /* Data volume requested in bytes */
 }BsrInfo;
 
+typedef struct schLcCtxt
+{
+   uint8_t lcp;      // logical Channel Prioritization
+   SchLcState lcState;
+   uint16_t bo;
+}SchDlLcCtxt;
 
+typedef struct schUlLcCtxt
+{
+   SchLcState lcState;
+   uint8_t priority;
+   uint8_t lcGroup;
+   uint8_t schReqId;
+   uint8_t pbr;        // prioritisedBitRate
+   uint8_t bsd;        // bucketSizeDuration
+}SchUlLcCtxt;
 
 /**
  * @brief
@@ -131,6 +155,10 @@ typedef struct schUeCb
    SchCellCb  *cellCb;
    bool       srRcvd;
    BsrInfo    bsrInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
+   uint8_t       numUlLc;
+   SchUlLcCtxt   ulLcCtxt[MAX_NUM_LC];
+   uint8_t       numDlLc;
+   SchDlLcCtxt   dlLcCtxt[MAX_NUM_LC];
 }SchUeCb;
 
 /**
@@ -150,6 +178,8 @@ typedef struct schCellCb
    uint8_t       ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!<start symbol per SSB beam */
    SchRaCb       raCb[MAX_NUM_UE];                  /*!< Rach Cb */
    uint16_t      numActvUe;
+   uint32_t      actvUeBitMap;
+   uint32_t      boIndBitMap;
    SchUeCb       ueCb[MAX_NUM_UE];
 }SchCellCb;
 
@@ -171,13 +201,16 @@ SchCb schCb[SCH_MAX_INST];
 uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,uint16_t slot);
 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
 uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst);
-uint8_t schDlRsrcAllocMsg4(Msg4Alloc *msg4Alloc, SchCellCb *cell, uint16_t slot);
+uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot);
 uint16_t schCalcTbSize(uint16_t payLoadSize);
 uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
 uint16_t schAllocPucchResource(SchCellCb *cell, uint16_t crnti, uint16_t slot);
 uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
 uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo puschInfo, DciInfo *dciInfo);
 uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, SchPuschInfo *puschInfo);
+uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
+   uint16_t accumalatedSize, uint16_t slot);
+uint16_t schAccumalateLcBoSize(SchCellCb *cell, uint16_t ueIdx);
 
 /**********************************************************************
   End of file
index 7e61145..d1e5bdb 100644 (file)
@@ -293,7 +293,7 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
    schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot]; 
    if(schUlSlotInfo->schPuschInfo)
    {
-      ulSchedInfo.crnti = cell->raCb[0].tcrnti;
+      ulSchedInfo.crnti = schUlSlotInfo->schPuschInfo->crnti;
       ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
       memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
            sizeof(SchPuschInfo));
@@ -337,7 +337,7 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t schDlRsrcAllocMsg4(Msg4Alloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
+uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
 {
    uint8_t coreset0Idx = 0;
    uint8_t numRbs = 0;
@@ -351,8 +351,8 @@ uint8_t schDlRsrcAllocMsg4(Msg4Alloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
    uint8_t mcs = 4;  /* MCS fixed to 4 */
    SchBwpDlCfg *initialBwp;
 
-   PdcchCfg *pdcch = &msg4Alloc->msg4PdcchCfg;
-   PdschCfg *pdsch = &msg4Alloc->msg4PdschCfg;
+   PdcchCfg *pdcch = &msg4Alloc->dlMsgPdcchCfg;
+   PdschCfg *pdsch = &msg4Alloc->dlMsgPdschCfg;
    BwpCfg *bwp = &msg4Alloc->bwp;
 
    initialBwp   = &cell->cellCfg.schInitialDlBwp;
@@ -384,18 +384,18 @@ uint8_t schDlRsrcAllocMsg4(Msg4Alloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
    bwp->cyclicPrefix       = initialBwp->bwp.cyclicPrefix;
 
    /* fill the PDCCH PDU */
-   pdcch->coreset0Cfg.startSymbolIndex = firstSymbol;
-   pdcch->coreset0Cfg.durationSymbols = numSymbols;
-   memcpy(pdcch->coreset0Cfg.freqDomainResource,FreqDomainResource,6);
-   pdcch->coreset0Cfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
-   pdcch->coreset0Cfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.coreSetType = 0;
-   pdcch->coreset0Cfg.coreSetSize = numRbs;
-   pdcch->coreset0Cfg.shiftIndex = cell->cellCfg.phyCellId;
-   pdcch->coreset0Cfg.precoderGranularity = 0; /* sameAsRegBundle */
+   pdcch->coresetCfg.startSymbolIndex = firstSymbol;
+   pdcch->coresetCfg.durationSymbols = numSymbols;
+   memcpy(pdcch->coresetCfg.freqDomainResource,FreqDomainResource,6);
+   pdcch->coresetCfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
+   pdcch->coresetCfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.coreSetType = 0;
+   pdcch->coresetCfg.coreSetSize = numRbs;
+   pdcch->coresetCfg.shiftIndex = cell->cellCfg.phyCellId;
+   pdcch->coresetCfg.precoderGranularity = 0; /* sameAsRegBundle */
    pdcch->numDlDci = 1;
-   pdcch->dci.rnti = cell->schDlSlotInfo[slot]->msg4Info->crnti;
+   pdcch->dci.rnti = cell->schDlSlotInfo[slot]->dlMsgInfo->crnti;
    pdcch->dci.scramblingId = cell->cellCfg.phyCellId;
    pdcch->dci.scramblingRnti = 0;
    pdcch->dci.cceIndex = 4; /* considering SIB1 is sent at cce 0-1-2-3 */
@@ -411,7 +411,7 @@ uint8_t schDlRsrcAllocMsg4(Msg4Alloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
    /* fill the PDSCH PDU */
    uint8_t cwCount = 0;
    pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
-   pdsch->rnti = cell->schDlSlotInfo[slot]->msg4Info->crnti;
+   pdsch->rnti = cell->schDlSlotInfo[slot]->dlMsgInfo->crnti;
    pdsch->pduIndex = 0;
    pdsch->numCodewords = 1;
    for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
@@ -473,6 +473,125 @@ uint16_t schAllocPucchResource(SchCellCb *cell,uint16_t crnti, uint16_t slot)
    return ROK;
 }
 
+/*******************************************************************
+ *
+ * @brief Fills pdcch and pdsch info for dedicated DL msg
+ *
+ * @details
+ *
+ *    Function : schDlRsrcAllocDlMsg
+ *
+ *    Functionality:
+ *       Fills pdcch and pdsch info for dl msg
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
+      uint16_t accumalatedSize, uint16_t slot)
+{
+   uint8_t ueIdx;
+   uint16_t tbSize = 0;
+   uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
+   uint8_t mcs = 4;  /* MCS fixed to 4 */
+   PdcchCfg *pdcch = NULLP;
+   PdschCfg *pdsch = NULLP;
+   BwpCfg *bwp = NULLP;
+   SchUeCb ueCb;
+   SchControlRsrcSet coreset1;
+   SchPdschConfig pdschCfg;
+
+   pdcch = &dlMsgAlloc->dlMsgPdcchCfg;
+   pdsch = &dlMsgAlloc->dlMsgPdschCfg;
+   bwp = &dlMsgAlloc->bwp;
+
+   GET_UE_IDX(crnti, ueIdx);
+   ueCb  = cell->ueCb[ueIdx-1];
+   coreset1 = ueCb.ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0];
+   pdschCfg = ueCb.ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg;
+
+   /* fill BWP */
+   bwp->freqAlloc.numPrb = MAX_NUM_RB;
+   bwp->freqAlloc.startPrb = 0;
+   bwp->subcarrierSpacing = cell->cellCfg.sib1SchCfg.bwp.subcarrierSpacing;
+   bwp->cyclicPrefix = cell->cellCfg.sib1SchCfg.bwp.cyclicPrefix;
+
+   /* fill the PDCCH PDU */
+   //Considering coreset1 also starts from same symbol as coreset0
+   pdcch->coresetCfg.startSymbolIndex = coresetIdxTable[0][3];
+   pdcch->coresetCfg.durationSymbols = coreset1.duration;
+   memcpy(pdcch->coresetCfg.freqDomainResource, coreset1.freqDomainRsrc, FREQ_DOM_RSRC_SIZE);
+   pdcch->coresetCfg.cceRegMappingType = coreset1.cceRegMappingType; /* non-interleaved */
+   pdcch->coresetCfg.regBundleSize = 6;   /* must be 6 for non-interleaved */
+   pdcch->coresetCfg.interleaverSize = 0; /* NA for non-interleaved */
+   pdcch->coresetCfg.coreSetType = 1; /* non PBCH coreset */
+   //Considering number of RBs in coreset1 is same as coreset0
+   pdcch->coresetCfg.coreSetSize = coresetIdxTable[0][1];
+   pdcch->coresetCfg.shiftIndex = cell->cellCfg.phyCellId;
+   pdcch->coresetCfg.precoderGranularity =  coreset1.precoderGranularity;
+   pdcch->numDlDci = 1;
+   pdcch->dci.rnti = ueCb.crnti;
+   pdcch->dci.scramblingId = cell->cellCfg.phyCellId;
+   pdcch->dci.scramblingRnti = 0;
+   pdcch->dci.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
+   pdcch->dci.aggregLevel = 4;
+   pdcch->dci.beamPdcchInfo.numPrgs = 1;
+   pdcch->dci.beamPdcchInfo.prgSize = 1;
+   pdcch->dci.beamPdcchInfo.digBfInterfaces = 0;
+   pdcch->dci.beamPdcchInfo.prg[0].pmIdx = 0;
+   pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
+   pdcch->dci.txPdcchPower.powerValue = 0;
+   pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
+
+   /* fill the PDSCH PDU */
+   uint8_t cwCount = 0;
+   pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
+   pdsch->rnti = ueCb.crnti;
+   pdsch->pduIndex = 0;
+   pdsch->numCodewords = 1;
+   for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
+   {
+      pdsch->codeword[cwCount].targetCodeRate = 308;
+      pdsch->codeword[cwCount].qamModOrder = 2;
+      pdsch->codeword[cwCount].mcsIndex = 4; /* mcs configured to 4 */
+      pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
+      pdsch->codeword[cwCount].rvIndex = 0;
+      tbSize = schCalcTbSize(accumalatedSize);
+      pdsch->codeword[cwCount].tbSize = tbSize;
+   }
+   pdsch->dataScramblingId = cell->cellCfg.phyCellId;
+   pdsch->numLayers = 1;
+   pdsch->transmissionScheme = 0;
+   pdsch->refPoint = 0;
+   pdsch->dmrs.dlDmrsSymbPos = 2;
+   pdsch->dmrs.dmrsConfigType = 0; /* type-1 */
+   pdsch->dmrs.dlDmrsScramblingId = cell->cellCfg.phyCellId;
+   pdsch->dmrs.scid = 0;
+   pdsch->dmrs.numDmrsCdmGrpsNoData = 1;
+   pdsch->dmrs.dmrsPorts = 0;
+   pdsch->dmrs.mappingType      = DMRS_MAP_TYPE_A; /* Setting to Type-A */
+   pdsch->dmrs.nrOfDmrsSymbols  = NUM_DMRS_SYMBOLS;
+   pdsch->dmrs.dmrsAddPos       = pdschCfg.dmrsDlCfgForPdschMapTypeA.addPos;
+   pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
+   pdsch->pdschFreqAlloc.freqAlloc.startPrb = 1;
+   pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize,mcs,numPdschSymbols);
+   pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
+   pdsch->pdschTimeAlloc.timeAlloc.startSymb = pdschCfg.timeDomRsrcAllociList[0].startSymbol;
+   pdsch->pdschTimeAlloc.timeAlloc.numSymb = pdschCfg.timeDomRsrcAllociList[0].symbolLength;
+   pdsch->beamPdschInfo.numPrgs = 1;
+   pdsch->beamPdschInfo.prgSize = 1;
+   pdsch->beamPdschInfo.digBfInterfaces = 0;
+   pdsch->beamPdschInfo.prg[0].pmIdx = 0;
+   pdsch->beamPdschInfo.prg[0].beamIdx[0] = 0;
+   pdsch->txPdschPower.powerControlOffset = 0;
+   pdsch->txPdschPower.powerControlOffsetSS = 0;
+
+   pdcch->dci.pdschCfg = pdsch;
+   return ROK;
+}
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 1e4edb2..477b6db 100644 (file)
@@ -62,9 +62,11 @@ extern uint8_t puschDeltaTable[MAX_MU_PUSCH];
 uint16_t calculateRaRnti(uint8_t symbolIdx, uint8_t slotIdx, uint8_t freqIdx)
 {
    uint16_t raRnti = 0;
-       uint8_t ulCarrierIdx = 0; /* configured to 0 */
+   uint8_t ulCarrierIdx = 0; /* configured to 0 */
+   
    raRnti = (1+symbolIdx+(14*slotIdx)+(14*80*freqIdx)+(14*80*8*ulCarrierIdx));
-       return raRnti;
+   
+   return raRnti;
 }
 
 /**
@@ -82,7 +84,10 @@ uint16_t calculateRaRnti(uint8_t symbolIdx, uint8_t slotIdx, uint8_t freqIdx)
  **/
 void createSchRaCb(uint16_t tcrnti, Inst schInst)
 {
-   schCb[schInst].cells[schInst]->raCb[0].tcrnti = tcrnti;
+   uint8_t ueIdx = 0;
+
+   GET_UE_IDX(tcrnti, ueIdx);
+   schCb[schInst].cells[schInst]->raCb[ueIdx -1].tcrnti = tcrnti;
 }
 
 /**
@@ -100,8 +105,8 @@ void createSchRaCb(uint16_t tcrnti, Inst schInst)
  *  @param[out]  msg3NumRb
  *  @return  void
  **/
-uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t *msg3StartRb,
-uint8_t *msg3NumRb)
+uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \
+   uint16_t *msg3StartRb, uint8_t *msg3NumRb)
 {
    SchCellCb      *cell         = NULLP;
    SchUlSlotInfo  *schUlSlotInfo    = NULLP;
@@ -153,6 +158,7 @@ uint8_t *msg3NumRb)
    tbSize = 0;  /* since nPrb has been incremented, recalculating tbSize */
    tbSize = schCalcTbSizeFromNPrb(numRb, mcs, numPdschSymbols);
 
+   schUlSlotInfo->schPuschInfo->crnti             = crnti;
    schUlSlotInfo->schPuschInfo->harqProcId        = SCH_HARQ_PROC_ID;
    schUlSlotInfo->schPuschInfo->resAllocType      = SCH_ALLOC_TYPE_1;
    schUlSlotInfo->schPuschInfo->fdAlloc.startPrb  = startRb;
@@ -220,7 +226,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
    createSchRaCb(rachInd->crnti,schInst);
 
    /* allocate resources for msg3 */
-   ret = schAllocMsg3Pusch(schInst, rarSlot, &msg3StartRb, &msg3NumRb);
+   ret = schAllocMsg3Pusch(schInst, rarSlot, rachInd->crnti, &msg3StartRb, &msg3NumRb);
    if(ret == ROK)
    {
       /* fill RAR info */
@@ -296,15 +302,15 @@ uint8_t schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t of
    bwp->cyclicPrefix       = initialBwp->bwp.cyclicPrefix;
 
    /* fill the PDCCH PDU */
-   pdcch->coreset0Cfg.startSymbolIndex = firstSymbol;
-   pdcch->coreset0Cfg.durationSymbols = numSymbols;
-   memcpy(pdcch->coreset0Cfg.freqDomainResource,FreqDomainResource,6);
-   pdcch->coreset0Cfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
-   pdcch->coreset0Cfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
-   pdcch->coreset0Cfg.coreSetType = 0;
-   pdcch->coreset0Cfg.shiftIndex = pci;
-   pdcch->coreset0Cfg.precoderGranularity = 0; /* sameAsRegBundle */
+   pdcch->coresetCfg.startSymbolIndex = firstSymbol;
+   pdcch->coresetCfg.durationSymbols = numSymbols;
+   memcpy(pdcch->coresetCfg.freqDomainResource, FreqDomainResource, FREQ_DOM_RSRC_SIZE);
+   pdcch->coresetCfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
+   pdcch->coresetCfg.regBundleSize = 6;    /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.interleaverSize = 2;  /* spec-38.211 sec 7.3.2.2 */
+   pdcch->coresetCfg.coreSetType = 0;
+   pdcch->coresetCfg.shiftIndex = pci;
+   pdcch->coresetCfg.precoderGranularity = 0; /* sameAsRegBundle */
    pdcch->numDlDci = 1;
    pdcch->dci.rnti = raRnti; /* RA-RNTI */
    pdcch->dci.scramblingId = pci;
index 0682695..6769eeb 100644 (file)
@@ -113,11 +113,92 @@ void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue)
     *        on PHY_DELTA + SCHED_DELTA + BO_DELTA                 *
     ****************************************************************/
 
-   ADD_DELTA_TO_TIME(slotInd,schSlotValue->currentTime,PHY_DELTA);
-   ADD_DELTA_TO_TIME(slotInd,schSlotValue->broadcastTime,PHY_DELTA+SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd,schSlotValue->rarTime,PHY_DELTA+SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd,schSlotValue->msg4Time,PHY_DELTA+SCHED_DELTA);
-   ADD_DELTA_TO_TIME(slotInd,schSlotValue->dlMsgTime,PHY_DELTA+SCHED_DELTA+BO_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA + SCHED_DELTA);
+   ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA + SCHED_DELTA);
+}
+
+/*******************************************************************
+ *
+ * @brief 
+ *
+ * @details
+ *
+ *    Function : 
+ *
+ *    Functionality:
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlMsgAlloc *dlMsgAlloc)
+{
+   uint8_t ueIdx, lcIdx;
+   uint16_t slot;
+   uint16_t crnti = 0;
+   uint16_t accumalatedSize = 0;
+   SchUeCb *ueCb = NULLP;
+
+   while(cell->boIndBitMap)
+   {
+      slot = dlSchedInfo->schSlotValue.dlMsgTime.slot;
+
+      GET_RIGHT_MOST_SET_BIT(cell->boIndBitMap, ueIdx);
+      GET_CRNTI(crnti,ueIdx);
+      ueCb = &cell->ueCb[ueIdx-1];
+
+      /* allocate PDCCH and PDSCH resources for the ue */
+      SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgAlloc));
+      if(!dlMsgAlloc)
+      {
+        DU_LOG("\nMAC: Memory Allocation failed for ded DL msg alloc");
+        return RFAILED;
+      }
+      memset(dlMsgAlloc, 0, sizeof(DlMsgAlloc));
+      dlSchedInfo->dlMsgAlloc = dlMsgAlloc;
+      dlMsgAlloc->crnti = crnti;
+
+      /* Dl ded Msg info is copied, this was earlier filled in macSchDlRlcBoInfo */
+      memcpy(&dlMsgAlloc->dlMsgInfo, cell->schDlSlotInfo[slot]->dlMsgInfo, \
+           sizeof(DlMsgInfo));
+
+      /* scheduled LC data fill */
+      dlMsgAlloc->numLc = 0;
+      for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++)
+      {
+        if(ueCb->dlLcCtxt[lcIdx].bo)
+        {
+           dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].lcId = lcIdx;
+
+           /* calculation for BO includse RLC and MAC header size */
+           dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes = \
+              ueCb->dlLcCtxt[lcIdx].bo + RLC_HDR_SIZE + MAC_HDR_SIZE;
+           accumalatedSize += dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc].schBytes;
+           dlMsgAlloc->numLc++;
+        }
+        ueCb->dlLcCtxt[lcIdx].bo = 0;
+      }
+
+      /* pdcch and pdsch data is filled */
+      schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, accumalatedSize, slot);
+
+      /* PUCCH resource */
+      schAllocPucchResource(cell, dlMsgAlloc->crnti, slot);
+
+      /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
+      SCH_FREE(cell->schDlSlotInfo[dlSchedInfo->schSlotValue.dlMsgTime.slot]->dlMsgInfo, \
+           sizeof(DlMsgInfo));
+      cell->schDlSlotInfo[dlSchedInfo->schSlotValue.dlMsgTime.slot]->dlMsgInfo = NULL;
+
+      /* after allocation is done, unset the bo bit for that ue */
+      UNSET_ONE_BIT(ueIdx, cell->boIndBitMap);
+   }
+
+   return ROK;
 }
 
 /*******************************************************************
@@ -138,21 +219,23 @@ void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue)
  * ****************************************************************/
 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
 {
-   int ret = ROK;
-   uint8_t ssb_rep, ueIdx, lcgIdx;
+   uint8_t  ret = ROK;
+   uint8_t  ssb_rep, ueIdx, lcgIdx;
    uint16_t slot, sfnSlot = 0;
    DlSchedInfo dlSchedInfo;
+   DlBrdcstAlloc *dlBrdcstAlloc = NULLP;
+   RarAlloc   *rarAlloc = NULLP;
+   DlMsgAlloc  *msg4Alloc = NULLP;
+   DlMsgAlloc *dlMsgAlloc = NULLP;
+   SchCellCb  *cell = NULLP;
+
    memset(&dlSchedInfo,0,sizeof(DlSchedInfo));
-   DlBrdcstAlloc *dlBrdcstAlloc = &dlSchedInfo.brdcstAlloc;
-   RarAlloc  *rarAlloc = NULLP;
-   Msg4Alloc *msg4Alloc = NULLP;
+   schCalcSlotValues(*slotInd, &dlSchedInfo.schSlotValue);
+   dlBrdcstAlloc = &dlSchedInfo.brdcstAlloc;
    dlBrdcstAlloc->ssbTrans = NO_SSB;
    dlBrdcstAlloc->sib1Trans = NO_SIB1;
 
-   SchCellCb *cell = schCb[schInst].cells[schInst];
-
-   schCalcSlotValues(*slotInd, &dlSchedInfo.schSlotValue);
-
+   cell = schCb[schInst].cells[schInst];
    ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
    memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
    dlBrdcstAlloc->ssbIdxSupported = 1;
@@ -231,30 +314,32 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
    }
 
    /* check for MSG4 */
-   if(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info != NULLP)
+   if((cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo != NULLP) &&
+      (cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo->isMsg4Pdu))
    {
-      slot = dlSchedInfo.schSlotValue.msg4Time.slot;
-      SCH_ALLOC(msg4Alloc, sizeof(Msg4Alloc));
+      slot = dlSchedInfo.schSlotValue.dlMsgTime.slot;
+
+      SCH_ALLOC(msg4Alloc, sizeof(DlMsgAlloc));
       if(!msg4Alloc)
       {
         DU_LOG("\nMAC: Memory Allocation failed for msg4 alloc");
         return RFAILED;
       }
 
-      dlSchedInfo.msg4Alloc = msg4Alloc;
+      dlSchedInfo.dlMsgAlloc = msg4Alloc;
 
       /* Msg4 info is copied, this was earlier filled in macSchDlRlcBoInfo */
-      memcpy(&msg4Alloc->msg4Info, cell->schDlSlotInfo[slot]->msg4Info, \
-           sizeof(Msg4Info));
+      memcpy(&msg4Alloc->dlMsgInfo, cell->schDlSlotInfo[slot]->dlMsgInfo, \
+           sizeof(DlMsgInfo));
 
       /* pdcch and pdsch data is filled */
-      schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.msg4Time.slot); 
+      schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot); 
 
       /* PUCCH resource */
-      schAllocPucchResource(cell, msg4Alloc->msg4Info.crnti, dlSchedInfo.schSlotValue.msg4Time.slot);
+      schAllocPucchResource(cell, msg4Alloc->dlMsgInfo.crnti, dlSchedInfo.schSlotValue.dlMsgTime.slot);
 
-      SCH_FREE(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info, sizeof(Msg4Info));
-      cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info = NULL;
+      SCH_FREE(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo, sizeof(DlMsgInfo));
+      cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo = NULL;
    }
    /* check if UL grant must be sent in this slot for a SR/BSR that had been received */
    for(ueIdx=0; ueIdx<cell->numActvUe; ueIdx++)
@@ -300,6 +385,13 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
       }
    }
 
+   /* Check for pending BO grant for LC */
+   if((cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo != NULLP) &&
+      (!cell->schDlSlotInfo[dlSchedInfo.schSlotValue.dlMsgTime.slot]->dlMsgInfo->isMsg4Pdu))
+   {
+      schFillBoGrantDlSchedInfo(cell, &dlSchedInfo, dlMsgAlloc);
+   }
+
    /* send msg to MAC */
    ret = sendDlAllocToMac(&dlSchedInfo, schInst);
    if(ret != ROK)
index 37e8e77..b78ea4d 100644 (file)
@@ -91,6 +91,8 @@ void SchSendUeCfgRspToMac(SchUeCfg *ueCfg, Inst inst,\
 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
 {
    uint8_t      idx;
+   uint8_t      lcId;
+   uint8_t      lcIdx;
    uint16_t     ueIdx;
    SchCellCb    *cellCb;
    SchUeCb      *ueCb;
@@ -144,12 +146,28 @@ uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
 
    /* Fill received Ue Configuration in UeCb */
    memset(ueCb, 0, sizeof(SchUeCb));
-
-   GET_UE_IDX(ueCfg->crnti, ueCb->ueIdx);
+   ueCb->ueIdx = ueIdx;
    ueCb->crnti = ueCfg->crnti;
    memcpy(&ueCb->ueCfg, ueCfg, sizeof(SchUeCfg));
    ueCb->state = SCH_UE_STATE_ACTIVE;
+
+   /* Fill SRB1 info */
+   for(lcIdx = 0; lcIdx < ueCfg->numLc; lcIdx++)
+   {
+       lcId = ueCfg->lcCfgList[lcIdx].lcId;
+       ueCb->dlLcCtxt[lcId].lcp = ueCfg->lcCfgList[lcIdx].dlLcCfg.lcp;
+       ueCb->dlLcCtxt[lcId].lcState = SCH_LC_STATE_ACTIVE;
+       ueCb->dlLcCtxt[lcId].bo = 0;
+       ueCb->numDlLc++;
+       
+       if(ueCfg->lcCfgList[lcIdx].ulLcCfg)
+       {
+          /* TODO : Fill UL LC Cfg. As of now for SRB1, it is null */
+       }
+   }
+
    cellCb->numActvUe++;
+   SET_ONE_BIT(ueCb->ueIdx, cellCb->actvUeBitMap);
 
    ueCb->cellCb = cellCb;
    ueCb->srRcvd = false;
@@ -200,6 +218,7 @@ uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, S
 
   cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb += numRb;
 
+  puschInfo->crnti             = ueCb->crnti; 
   puschInfo->harqProcId        = SCH_HARQ_PROC_ID;
   puschInfo->resAllocType      = SCH_ALLOC_TYPE_1;
   puschInfo->fdAlloc.startPrb  = startRb;
index a6ffdae..8d1e8b7 100644 (file)
 /* Fill post structure for msg from SCH to MAC */
 #define FILL_PST_SCH_TO_MAC(_pst, _inst)                     \
 {                                                            \
-   _pst.srcProcId = SFndProcId();                            \
-   _pst.dstProcId = SFndProcId();                            \
-   _pst.srcEnt    = ENTMAC;                                   \
-   _pst.dstEnt    = ENTMAC;                                   \
+   _pst.srcProcId = ODU_GET_PROCID();                       \
+   _pst.dstProcId = ODU_GET_PROCID();                       \
+   _pst.srcEnt    = ENTMAC;                                  \
+   _pst.dstEnt    = ENTMAC;                                  \
    _pst.srcInst   = 1;                                       \
    _pst.dstInst   = 0;                                       \
    _pst.selector  = ODU_SELECTOR_TC;                         \
index 978d0e7..70c35ad 100644 (file)
@@ -75,6 +75,38 @@ void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqD
    }
 }
 
+/*******************************************************************
+ *
+ * @brief Reverse and copy fixed buffer to mBuf 
+ *
+ * @details
+ *
+ *    Function : oduCpyFixBufToMsg
+ *
+ *    Functionality: Reverse and copy fixed buffer to mBuf
+ *
+ * @params[in] Fixed buffer, msg buffer, length of message
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len)                            
+{
+   uint8_t idx, revIdx, temp;
+   uint16_t copyLen;
+
+   /* ODU_COPY_FIX_BUF_TO_MSG copies fixed buffer in reverse order. \
+    * Hence reversing the fixed buffer before copying in order to \
+    * maintain the actual order*/
+   for(idx = 0, revIdx = len-1; idx < len/2; idx++, revIdx--)   
+   {                                                            
+        temp = fixBuf[idx];                                          
+        fixBuf[idx] = fixBuf[revIdx];                                   
+        fixBuf[revIdx] = temp;                                       
+   }                                                            
+   ODU_COPY_FIX_BUF_TO_MSG(fixBuf, mBuf, 0, len, (MsgLen *)&copyLen);
+}
+
 
 
 /**********************************************************************
index bf7518a..34dfd20 100644 (file)
@@ -57,6 +57,7 @@
 /* MAX values */
 #define MAX_NUM_CELL 1
 #define MAX_NUM_UE   1
+#define MAX_NUM_LC   11
 
 /* 5G ORAN phy delay */
 #define PHY_DELTA 2
 #define ODU_START_CRNTI   100
 #define ODU_END_CRNTI     500
 
+/* LCID */
+#define SRB0_LCID  0
+#define SRB1_LCID  1
+#define SRB2_LCID  2
+#define SRB3_LCID  3
+#define MIN_DRB_LCID 4
+#define MAX_DRB_LCID 10
+
+#define FREQ_DOM_RSRC_SIZE  6      /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
+
 /* Defining macros for common utility functions */
 #define ODU_GET_MSG_BUF SGetMsg
 #define ODU_PUT_MSG_BUF SPutMsg
 #define ODU_ADD_PRE_MSG_MULT SAddPreMsgMult
+#define ODU_ADD_PRE_MSG_MULT_IN_ORDER SAddPreMsgMultInOrder
 #define ODU_ADD_POST_MSG_MULT SAddPstMsgMult
 #define ODU_START_TASK SStartTask
 #define ODU_STOP_TASK SStopTask
 #define ODU_COPY_FIX_BUF_TO_MSG SCpyFixMsg
 #define ODU_REG_TTSK SRegTTsk
 #define ODU_SET_PROC_ID SSetProcId
-#define ODU_FIND_MSG_LEN SFndLenMsg
+#define ODU_GET_MSG_LEN SFndLenMsg
 #define ODU_EXIT_TASK SExitTsk
 #define ODU_PRINT_MSG SPrntMsg
 #define ODU_REM_PRE_MSG SRemPreMsg
+#define ODU_REM_PRE_MSG_MULT SRemPreMsgMult
 #define ODU_REG_TMR_MT SRegTmrMt
+#define ODU_SEGMENT_MSG SSegMsg
+#define ODU_CAT_MSG SCatMsg
+#define ODU_GET_PROCID SFndProcId
 
 #define GET_UE_IDX( _crnti,_ueIdx)         \
 {                                          \
 
 #define GET_CRNTI( _crnti,_ueIdx)          \
 {                                          \
-   _crnti = _ueIdx + ODU_START_CRTNI - 1;  \
+   _crnti = _ueIdx + ODU_START_CRNTI - 1;  \
 }
 
 /* Calculates cellIdx from cellId */
        _byte <<= _startBit;                          \
 }
 
+/* this MACRO set 1 bit at the bit position */
+#define SET_ONE_BIT(_bitPos, _out)            \
+{                                             \
+   _out = ((1<<_bitPos) | _out);              \
+}
+
+/* this MACRO un-set 1 bit at the bit position */
+#define UNSET_ONE_BIT(_bitPos, _out)            \
+{                                               \
+   _out = (~(1<<_bitPos) & _out);               \
+}
+
+/* this MACRO finds the index of the rightmost set bit */
+#define GET_RIGHT_MOST_SET_BIT( _in,_bitPos)        \
+{                                                \
+   _bitPos = __builtin_ctz(_in);                 \
+}
 
 typedef struct slotIndInfo
 {
@@ -131,6 +164,7 @@ typedef struct PlmnIdentity
 }Plmn;
 
 void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain);
+void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len);
 
 #endif
 
index b772a73..237f4d1 100644 (file)
 #define SS_MONITORING_SYMBOL     0x2000; /* symbol-0, set 14th bit */
 #define SIB1_MCS  4
 
-#define SRB_ID_0 0
-#define SRB_ID_1 1
-
 /* Macro for Ue Context */
-#define MAX_NUM_LOGICAL_CHANNELS 11
 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
 #define MAC_NUM_TAGS 4                  /* Max number of timing advance groups */
 #define MAX_NUM_BWP  4                  /* Max number of BWP per serving cell */
 #define MAX_NUM_CRSET  3                /* Max number of control resource set in add/modify/release list */
 #define MAX_NUM_SEARCH_SPC  10          /* Max number of search space in add/modify/release list */
-#define FREQ_DOM_RSRC_SIZE  6           /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2  /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
 #define MAX_NUM_DL_ALLOC 16             /* Max number of pdsch time domain downlink allocation */
 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
@@ -963,7 +958,7 @@ typedef struct macUeCfg
    SpCellCfg spCellCfg;
    MaxAggrBitRate *maxAggrBitRate;
    uint8_t numLcs;
-   LcCfg lcCfgList[MAX_NUM_LOGICAL_CHANNELS];
+   LcCfg lcCfgList[MAX_NUM_LC];
 }MacUeCfg;
 
 typedef struct nrcgi
index 03e0594..6999587 100644 (file)
@@ -27,9 +27,6 @@
 #define EVENT_DL_RRC_MSG_TRANS_TO_RLC 213
 #define EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU 214
 
-/* Macro for Ue Context */
-#define MAX_NUM_LOGICAL_CHANNELS 11
-
 #define RB_ID_SRB 0
 #define RB_ID_DRB 1
 
@@ -483,7 +480,7 @@ typedef struct rlcUeCfg
    uint16_t     cellId;
    uint8_t      ueIdx;
    uint8_t      numLcs;
-   RlcBearerCfg rlcBearerCfg[MAX_NUM_LOGICAL_CHANNELS];
+   RlcBearerCfg rlcBearerCfg[MAX_NUM_LC];
 }RlcUeCfg;
 
 typedef struct rlcUeCfgRsp
index 2017c44..2638979 100755 (executable)
@@ -200,24 +200,6 @@ EXTERN S16 RlcUiKwuUbndReq ARGS((Pst *pst,
          SpId spId,
          Reason reason));
 
-/**
- *@details This primitive is used by RRC to transfer the SDU data to the RLC.
- RLC will send the data to logical channels in the form of PDUs by assembling 
- [concatenating/segmenting/retransmission (in case of AM), concatenating if
- required (in case of UM)] SDUs received from the service user (RRC/PDCP).
-
- * @param[in] pst    -  Pointer to the pst structure
- * @param[in] spId   -  Service provider ID
- * @param[in] datReq -  Data request parameter
- * @param[in] buf    -  RLC SDU
- * @return  S16 
- *   -# ROK
- *   -# RFAILED
- */
-EXTERN S16 RlcUiKwuDatReq ARGS((Pst *pst,
-         KwuDatReqInfo* datReq,
-         Buffer *buf));
-
 /**
  *@details This primitive is used by RLC to transfer the SDU data to the service
  user (RRC/PDCP) recieved from the peer RLC. RLC will send the data to service
@@ -231,12 +213,12 @@ EXTERN S16 RlcUiKwuDatReq ARGS((Pst *pst,
  *   -# ROK
  *   -# RFAILED
  */
-EXTERN S16 RlcUiKwuDatInd ARGS((Pst *pst,
-         KwuDatIndInfo* datInd,
-         Buffer *mBuf));
+EXTERN S16 rlcSendUlDataToDu ARGS((Pst *pst,
+       KwuDatIndInfo* datInd,
+       Buffer *mBuf));
 
 /**
- *@details This primitive is used by RLC as the confirmation for the RlcUiKwuDatReq
+ *@details This primitive is used by RLC as the confirmation for the RlcProcDlData
  to the service user (RLC/PDCP). It is used only in AM mode data transfers for
  RLC.
 
index 340c77b..d18e724 100755 (executable)
@@ -176,14 +176,14 @@ RlcMngmt *cfg;                /* RLC LM structure */
  */
  
 #ifdef ANSI
-S16 unpackRlcConfigReq
+uint8_t unpackRlcConfigReq
 (
 RlcConfigReq func,              /* primitive to call */
 Pst *pst,                    /* post structure */
 Buffer *mBuf                 /* message buffer */
 )
 #else
-S16 unpackRlcConfigReq(func, pst, mBuf)
+uint8_t unpackRlcConfigReq(func, pst, mBuf)
 RlcConfigReq func;              /* primitive to call */
 Pst *pst;                    /* post structure */
 Buffer *mBuf;                /* message buffer */
@@ -343,13 +343,13 @@ Buffer *mBuf;                /* message buffer */
  */
 
 #ifdef ANSI
-S16 cmPkLkwCntrlCfm
+uint8_t cmPkLkwCntrlCfm
 (
 Pst *pst,                    /* post structure */
 RlcMngmt *cfm                 /* RLC LM structure */
 )
 #else
-S16 cmPkLkwCntrlCfm(pst, cfm)
+uint8_t cmPkLkwCntrlCfm(pst, cfm)
 Pst *pst;                    /* post structure */
 RlcMngmt *cfm;                /* RLC LM structure */
 #endif
@@ -511,13 +511,13 @@ Buffer *mBuf;                /* message buffer */
 
 
 #ifdef ANSI
-S16 packRlcConfigCfm
+uint8_t packRlcConfigCfm
 (
 Pst *pst,                    /* post structure */
 RlcMngmt *cfm                 /* RLC LM structure */
 )
 #else
-S16 packRlcConfigCfm(pst,cfm)
+uint8_t packRlcConfigCfm(pst,cfm)
 Pst *pst;                    /* post structure */
 RlcMngmt *cfm;                /* RLC LM structure */
 #endif
@@ -575,14 +575,14 @@ RlcMngmt *cfm;                /* RLC LM structure */
  *      -# Failure : RFAILED
  */
 #ifdef ANSI
-S16 unpackRlcConfigCfm
+uint8_t unpackRlcConfigCfm
 (
 RlcConfigCfm func,              /* primitive to call */
 Pst *pst,                    /* post structure */
 Buffer *mBuf                 /* message buffer */
 )
 #else
-S16 unpackRlcConfigCfm(func, pst, mBuf)
+uint8_t unpackRlcConfigCfm(func, pst, mBuf)
 RlcConfigCfm func;              /* primitive to call */
 Pst *pst;                    /* post structure */
 Buffer *mBuf;                /* message buffer */
index 8a03910..f58b4b6 100755 (executable)
@@ -361,11 +361,11 @@ typedef struct rlcL2MeasCfmEvt
 
 /* Control primitives towards LTE RLC */
 /* Pointer functions to pack/unpack primitives */
-typedef S16 (*RlcConfigReq)   ARGS((Pst *pst, RlcMngmt *cfg));
-typedef S16 (*RlcConfigCfm)   ARGS((Pst *pst, RlcMngmt *cfgCfm));
+typedef uint8_t (*RlcConfigReq)   ARGS((Pst *pst, RlcMngmt *cfg));
+typedef uint8_t (*RlcConfigCfm)   ARGS((Pst *pst, RlcMngmt *cfgCfm));
 
-typedef S16 (*LkwCntrlReq) ARGS((Pst *pst, RlcMngmt *cntl));
-typedef S16 (*LkwCntrlCfm) ARGS((Pst *pst, RlcMngmt *cntlCfm));
+typedef uint8_t (*LkwCntrlReq) ARGS((Pst *pst, RlcMngmt *cntl));
+typedef uint8_t (*LkwCntrlCfm) ARGS((Pst *pst, RlcMngmt *cntlCfm));
 
 typedef S16 (*LkwStaInd)   ARGS((Pst *pst, RlcMngmt *staInd)); 
 typedef S16 (*LkwStaReq)   ARGS((Pst *pst, RlcMngmt *staReq));
@@ -393,7 +393,7 @@ typedef S16 (*LkwL2MeasStopCfm)   ARGS((Pst *pst, U8 measType,U8 status));
 @return ROK if success , RFAILED if failure
 
 */
-EXTERN S16 RlcMiRlcConfigReq ARGS((Pst *pst, RlcMngmt *cfg));
+uint8_t RlcMiRlcConfigReq ARGS((Pst *pst, RlcMngmt *cfg));
 
 /**
 @details This function is called by the RlcMiRlcConfigReq function for responding to configuration requests.The cfm field in the RlcMngmt  structure contains the response value.
@@ -402,7 +402,7 @@ EXTERN S16 RlcMiRlcConfigReq ARGS((Pst *pst, RlcMngmt *cfg));
 @param[in] cfm  - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiRlcConfigCfm ARGS((Pst *pst, RlcMngmt *cfgCfm));
+S16 RlcMiRlcConfigCfm ARGS((Pst *pst, RlcMngmt *cfgCfm));
 
 /**
 @details
@@ -415,7 +415,7 @@ control request primitive is confirmed by a RlcMiLkwCntrlCfm primitive.
 @param[in] cntl - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwCntrlReq ARGS((Pst *pst, RlcMngmt *cntl));
+uint8_t RlcMiLkwCntrlReq ARGS((Pst *pst, RlcMngmt *cntl));
 
 /**
 @details
@@ -425,7 +425,7 @@ This function is called by the RlcMiLkwCntrlReq function to send a control confi
 @param[in] cfm  - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwCntrlCfm ARGS((Pst *pst, RlcMngmt *cntlCfm));
+S16 RlcMiLkwCntrlCfm ARGS((Pst *pst, RlcMngmt *cntlCfm));
 
 /**
 @details
@@ -436,7 +436,7 @@ P,KWSAP, or CKSAP.
 @param[in] cfg  - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwStaReq ARGS((Pst *pst, RlcMngmt *staInd));
+S16 RlcMiLkwStaReq ARGS((Pst *pst, RlcMngmt *staInd));
 
 /**
 @details
@@ -447,7 +447,7 @@ us information to the layer manager.
 @param[in] stacfm - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwStaCfm ARGS((Pst *pst, RlcMngmt *staCfm));
+S16 RlcMiLkwStaCfm ARGS((Pst *pst, RlcMngmt *staCfm));
 
 /**
 @details
@@ -458,7 +458,7 @@ This function processes statistics requests received from the layer manager. Aft
 @param[in] sts   - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwStsReq ARGS((Pst *pst, Action, RlcMngmt *sts));
+S16 RlcMiLkwStsReq ARGS((Pst *pst, Action, RlcMngmt *sts));
 /**
 @details
 This function is called by the RlcMiLkwStsReq function for responding to statisti
@@ -469,7 +469,7 @@ cs requests.
 @param[in] cfg  - Configuration management structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwStsCfm ARGS((Pst *pst, Action action, RlcMngmt *stsCfm));
+S16 RlcMiLkwStsCfm ARGS((Pst *pst, Action action, RlcMngmt *stsCfm));
 /**
 @details
 This function is used by RLC module to send unsolicited trace indications to
@@ -480,7 +480,7 @@ the layer manager, when tracing is enabled by the layer manager through a previo
 @param[in] buf  - buffer 
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwTrcInd ARGS ((Pst *pst, RlcMngmt *trc, Buffer *mBuf));
+S16 RlcMiLkwTrcInd ARGS ((Pst *pst, RlcMngmt *trc, Buffer *mBuf));
 
 /**
 @details This function is used by RLC to send unsolicited status information to the layer manager, when the unsolicited status flag is enabled by the layer manager through a previous control request.
@@ -499,9 +499,9 @@ for Measurement  responding to statisti cs requests.
 @param[in] measEvt - Measurement Request structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measEvt));
-EXTERN S16 RlcMiLkwL2MeasStopReq ARGS((Pst *pst,U8 measType));
-EXTERN S16 RlcMiLkwL2MeasSendReq ARGS((Pst *pst,U8 measType));
+S16 RlcMiLkwL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measEvt));
+S16 RlcMiLkwL2MeasStopReq ARGS((Pst *pst,U8 measType));
+S16 RlcMiLkwL2MeasSendReq ARGS((Pst *pst,U8 measType));
 /**
 @details This function can be used by PDCP to send the measurement values
 after doing L2 measurement that was requested by the layer manager.
@@ -510,13 +510,13 @@ after doing L2 measurement that was requested by the layer manager.
 @param[in] measEvt - Measurement confirmation structure
 @return ROK if success , RFAILED if failure
 */
-EXTERN S16 RlcMiLkwL2MeasCfm ARGS((Pst *pst, RlcL2MeasCfmEvt *measCfm));
-EXTERN S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, U8 measType, U8 status));
+S16 RlcMiLkwL2MeasCfm ARGS((Pst *pst, RlcL2MeasCfmEvt *measCfm));
+S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, U8 measType, U8 status));
 #endif /*  LTE_L2_MEAS */
 
-EXTERN S16 RlcMiLkwStaInd ARGS((Pst *pst, RlcMngmt *staReq));
+S16 RlcMiLkwStaInd ARGS((Pst *pst, RlcMngmt *staReq));
 
-EXTERN Void rlcSendLmAlarm ARGS ((
+Void rlcSendLmAlarm ARGS ((
       U16 category,
       U16  event,
       U16 cause,
@@ -524,79 +524,79 @@ EXTERN Void rlcSendLmAlarm ARGS ((
       U32 ueId));
 
 #ifdef SM
-EXTERN S16 SmMiRlcConfigCfm   ARGS((
+S16 SmMiRlcConfigCfm   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwCntrlCfm ARGS((
+S16 SmMiLkwCntrlCfm ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwStaInd   ARGS((
+S16 SmMiLkwStaInd   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwStaCfm   ARGS((
+S16 SmMiLkwStaCfm   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwStsCfm   ARGS((
+S16 SmMiLkwStsCfm   ARGS((
        Pst *,
        Action,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwTrcInd   ARGS((
+S16 SmMiLkwTrcInd   ARGS((
        Pst *,
        RlcMngmt *,
        Buffer *
        ));
 
-EXTERN S16 SmMiLkwStsReq   ARGS((
+S16 SmMiLkwStsReq   ARGS((
        Pst *,
        Action,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwStaReq   ARGS((
+S16 SmMiLkwStaReq   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiLkwCntrlReq ARGS((
+S16 SmMiLkwCntrlReq ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 SmMiRlcConfigReq   ARGS((
+S16 SmMiRlcConfigReq   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
 /* lkw_x_001.main_2, added support for L2 measurement */
 #ifdef LTE_L2_MEAS
-EXTERN S16 SmMiLkwL2MeasReq   ARGS((
+S16 SmMiLkwL2MeasReq   ARGS((
          Pst *,
          RlcL2MeasReqEvt *
          ));
-EXTERN S16 SmMiLkwL2MeasStopReq ARGS((
+S16 SmMiLkwL2MeasStopReq ARGS((
        Pst            *pst,
        U8             measType
       ));
 
-EXTERN S16 SmMiLkwL2MeasSendReq ARGS((
+S16 SmMiLkwL2MeasSendReq ARGS((
          Pst            *pst,
          U8             measType
          ));
-EXTERN S16 SmMiLkwL2MeasCfm   ARGS((
+S16 SmMiLkwL2MeasCfm   ARGS((
          Pst *,
          RlcL2MeasCfmEvt *
          ));
-EXTERN S16 SmMiLkwL2MeasStopCfm ARGS((
+S16 SmMiLkwL2MeasStopCfm ARGS((
          Pst     *pst,          
          U8      measType,
          U8      status
@@ -604,186 +604,186 @@ EXTERN S16 SmMiLkwL2MeasStopCfm ARGS((
 #endif /*  LTE_L2_MEAS */
 #endif
 
-EXTERN S16 smKwActvInit    ARGS((Ent ent, Inst inst, Region region, Reason reason));
-EXTERN S16 smKwActvTsk     ARGS((Pst *pst, Buffer *mBuf));
+S16 smKwActvInit    ARGS((Ent ent, Inst inst, Region region, Reason reason));
+S16 smKwActvTsk     ARGS((Pst *pst, Buffer *mBuf));
 
 /* pack/unpack functions */
 #ifdef LCLKW 
-EXTERN S16 packRlcConfigReq     ARGS((
+S16 packRlcConfigReq     ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 packRlcConfigCfm     ARGS((
+uint8_t packRlcConfigCfm     ARGS((
        Pst *,
        RlcMngmt *
        ));
 
 
-EXTERN S16 cmPkLkwCntrlReq   ARGS((
+S16 cmPkLkwCntrlReq   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwCntrlCfm   ARGS((
+uint8_t cmPkLkwCntrlCfm   ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwStaInd     ARGS((
+S16 cmPkLkwStaInd     ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwStaReq     ARGS((
+S16 cmPkLkwStaReq     ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwStaCfm     ARGS((
+S16 cmPkLkwStaCfm     ARGS((
        Pst *,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwStsReq     ARGS((
+S16 cmPkLkwStsReq     ARGS((
        Pst *,
        Action,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwStsCfm     ARGS((
+S16 cmPkLkwStsCfm     ARGS((
        Pst *,
        Action,
        RlcMngmt *
        ));
 
-EXTERN S16 cmPkLkwTrcInd     ARGS((
+S16 cmPkLkwTrcInd     ARGS((
        Pst *,
        RlcMngmt *,
        Buffer *
        ));
 
-EXTERN S16 unpackRlcConfigReq   ARGS((
+uint8_t unpackRlcConfigReq   ARGS((
        RlcConfigReq,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 unpackRlcConfigCfm   ARGS((
+uint8_t unpackRlcConfigCfm   ARGS((
        RlcConfigCfm,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwCntrlReq ARGS((
+S16 cmUnpkLkwCntrlReq ARGS((
        RlcConfigReq,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwCntrlCfm ARGS((
+S16 cmUnpkLkwCntrlCfm ARGS((
        RlcConfigCfm,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwStaInd   ARGS((
+S16 cmUnpkLkwStaInd   ARGS((
        LkwStaInd,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwStaReq   ARGS((
+S16 cmUnpkLkwStaReq   ARGS((
        LkwStaReq,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwStaCfm   ARGS((
+S16 cmUnpkLkwStaCfm   ARGS((
        LkwStaCfm,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwStsReq   ARGS((
+S16 cmUnpkLkwStsReq   ARGS((
        LkwStsReq,
        Pst *,
        Buffer *
        ));
 
-EXTERN S16 cmUnpkLkwStsCfm   ARGS((
+S16 cmUnpkLkwStsCfm   ARGS((
        LkwStsCfm,
        Pst *, Buffer *
        ));
 
 
-EXTERN S16 cmUnpkLkwTrcInd   ARGS((
+S16 cmUnpkLkwTrcInd   ARGS((
        LkwTrcInd,
        Pst *,
        Buffer *));
 
 /* lkw_x_001.main_2, added support for L2 measurement */
 #ifdef LTE_L2_MEAS
-EXTERN S16 cmPkLkwL2MeasReq ARGS((
+S16 cmPkLkwL2MeasReq ARGS((
          Pst * pst,
          RlcL2MeasReqEvt * measReqEvt
          ));
-EXTERN S16 cmUnpkLkwL2MeasReq ARGS((
+S16 cmUnpkLkwL2MeasReq ARGS((
          LkwL2MeasReq func,
          Pst *pst,
          Buffer *mBuf
          ));
-EXTERN S16 cmPkLkwL2MeasCfm ARGS((
+S16 cmPkLkwL2MeasCfm ARGS((
          Pst * pst,
          RlcL2MeasCfmEvt *measCfmEvt
          ));
-EXTERN S16 cmUnpkLkwL2MeasCfm ARGS((
+S16 cmUnpkLkwL2MeasCfm ARGS((
          LkwL2MeasCfm func,
          Pst *pst,
          Buffer *mBuf
          ));
-EXTERN S16 cmPkRlcL2MeasReqInfo ARGS((
+S16 cmPkRlcL2MeasReqInfo ARGS((
          RlcL2MeasReqInfo * measReqInfo,
          Buffer *mBuf
          ));
-EXTERN S16 cmUnpkRlcL2MeasReqInfo ARGS((
+S16 cmUnpkRlcL2MeasReqInfo ARGS((
          RlcL2MeasReqInfo * measReqInfo,
          Buffer *mBuf
          ));
-EXTERN S16 cmPkRlcL2MeasCfmInfo ARGS((
+S16 cmPkRlcL2MeasCfmInfo ARGS((
          RlcL2MeasCfmInfo * measCfmInfo,
          Buffer *mBuf,
          U8 measType
          ));
-EXTERN S16 cmUnpkRlcL2MeasCfmInfo ARGS((
+S16 cmUnpkRlcL2MeasCfmInfo ARGS((
          RlcL2MeasCfmInfo * measCfmInfo,
          Buffer *mBuf,
          U8 measType
          ));
-EXTERN S16 cmPkLkwL2MeasStopReq ARGS((
+S16 cmPkLkwL2MeasStopReq ARGS((
          Pst * pst,
          U8 measType
          ));
-EXTERN S16 cmUnpkLkwL2MeasStopReq ARGS((
+S16 cmUnpkLkwL2MeasStopReq ARGS((
          LkwL2MeasStopReq func,
          Pst *pst,
          Buffer *mBuf
          ));
-EXTERN S16 cmPkLkwL2MeasSendReq ARGS((
+S16 cmPkLkwL2MeasSendReq ARGS((
          Pst * pst,
          U8 measType
          ));
-EXTERN S16 cmUnpkLkwL2MeasSendReq ARGS((
+S16 cmUnpkLkwL2MeasSendReq ARGS((
          LkwL2MeasSendReq func,
          Pst *pst,
          Buffer *mBuf
          ));
-EXTERN S16 cmPkLkwL2MeasStopCfm ARGS((
+S16 cmPkLkwL2MeasStopCfm ARGS((
          Pst * pst,
          U8 measType,
          U8 status
          ));
-EXTERN S16 cmUnpkLkwL2MeasStopCfm ARGS((
+S16 cmUnpkLkwL2MeasStopCfm ARGS((
          LkwL2MeasStopCfm func,
          Pst *pst,
          Buffer *mBuf
index 054df20..4b19233 100755 (executable)
@@ -253,13 +253,13 @@ Configuration Confirm from MAC to LM.
 *      -# ROK
 **/
 #ifdef ANSI
-S16 cmPkLrgCfgCfm
+uint8_t cmPkLrgCfgCfm
 (
 Pst * pst,
 RgMngmt * cfm
 )
 #else
-S16 cmPkLrgCfgCfm(pst, cfm)
+uint8_t cmPkLrgCfgCfm(pst, cfm)
 Pst * pst;
 RgMngmt * cfm;
 #endif
@@ -351,13 +351,13 @@ Configuration Confirm from SCH to LM.
 *      -# ROK
 **/
 #ifdef ANSI
-S16 cmPkLrgSchCfgCfm
+uint8_t cmPkLrgSchCfgCfm
 (
 Pst * pst,
 RgMngmt * cfg
 )
 #else
-S16 cmPkLrgSchCfgCfm(pst, cfg)
+uint8_t cmPkLrgSchCfgCfm(pst, cfg)
 Pst * pst;
 RgMngmt * cfg;
 #endif
index d028f8a..8f15a5f 100755 (executable)
@@ -533,12 +533,12 @@ typedef uint8_t (*LrgSchCfgReq)     ARGS((
         RgMngmt    *cfg                /* Management Structure */
      ));
 
-typedef S16 (*LrgCfgCfm)     ARGS((
+typedef uint8_t (*LrgCfgCfm)     ARGS((
         Pst        *pst,               /* Post Structure */
         RgMngmt    *cfg                /* Management Structure */
      ));
 
-typedef S16 (*LrgSchCfgCfm)     ARGS((
+typedef uint8_t (*LrgSchCfgCfm)     ARGS((
         Pst        *pst,               /* Post Structure */
         RgMngmt    *cfg                /* Management Structure */
      ));
@@ -643,7 +643,7 @@ typedef S16 (*LrgSchL2MeasStopCfm)     ARGS((
   * @param cfg pointer to RgMngmt
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+S16 RgMiLrgCfgReq ARGS((Pst *pst, RgMngmt *cfg));
 
  /** @brief This primitive carries the Configuration Request
   * for Scheduler sent from the DU APP to MAC.
@@ -653,7 +653,7 @@ EXTERN S16 RgMiLrgCfgReq ARGS((Pst *pst, RgMngmt *cfg));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN uint8_t MacSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+uint8_t MacSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
 
  /** @brief This primitive carries the Confirmation for a Configuration Request
   * sent from the layer manager to MAC.
@@ -663,7 +663,7 @@ EXTERN uint8_t MacSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
 
  /** @brief This primitive is sent from Layer manager to Scheduler. It carries
   * configuration information towards MAC.
@@ -677,7 +677,7 @@ EXTERN S16 RgMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
   * @param cfg pointer to RgMngmt
   * @return ROK/RFAILED
   */
-EXTERN uint8_t  SchProcGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+uint8_t  SchProcGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
 
  /** @brief This primitive carries the Confirmation for a Configuration Request
   * sent from the layer manager to Scheduler.
@@ -687,7 +687,7 @@ EXTERN uint8_t  SchProcGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
 
  /** @brief This primitive carries the Request for statistics from MAC layer
   * sent from the layer manager.
@@ -701,7 +701,7 @@ EXTERN S16 RgMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
   * @param sts pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgStsReq ARGS((Pst *pst, RgMngmt *sts));
+S16 RgMiLrgStsReq ARGS((Pst *pst, RgMngmt *sts));
 
  /** @brief This primitive carries the Statistics for a Statistics Request
   * sent from the layer manager to MAC.
@@ -711,7 +711,7 @@ EXTERN S16 RgMiLrgStsReq ARGS((Pst *pst, RgMngmt *sts));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
 
  /** @brief This primitive carries the Status request 
   * sent from the layer manager to MAC.
@@ -721,7 +721,7 @@ EXTERN S16 RgMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgStaReq ARGS((Pst *pst, RgMngmt *sta));
+S16 RgMiLrgStaReq ARGS((Pst *pst, RgMngmt *sta));
 
  /** @brief This primitive carries the Confirmation for a Status Request
   * sent from the layer manager to MAC.
@@ -731,7 +731,7 @@ EXTERN S16 RgMiLrgStaReq ARGS((Pst *pst, RgMngmt *sta));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
 
  /** @brief This primitive carries the Unsolicited status indications from MAC
   * to the layer manager i.e. Alarms.
@@ -741,7 +741,7 @@ EXTERN S16 RgMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
   * @param usta pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
+S16 RgMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
  /** @brief This primitive carries the Unsolicited status indications from
   * scheduler to the layer manager i.e. Alarms.
   * @details This primitive is used by Scheduler to inform Layer manager about some
@@ -750,7 +750,7 @@ EXTERN S16 RgMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
   * @param usta pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
+S16 RgMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
 
  /** @brief This primitive carries the control request sent from the layer
   * manager to MAC layer.
@@ -763,7 +763,7 @@ EXTERN S16 RgMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
+S16 RgMiLrgCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
  /** @brief This primitive carries the Confirmation for a Control Request
   * sent from the layer manager to MAC.
   * @details This primitive is used by MAC to inform Layer manager about the
@@ -772,7 +772,7 @@ EXTERN S16 RgMiLrgCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
  /** @brief This primitive carries the control request sent from the layer
   * manager to MAC layer.
   * @details This primitive is sent from the layer manager to control the MAC
@@ -784,7 +784,7 @@ EXTERN S16 RgMiLrgCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
+S16 RgMiLrgSchCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
  /** @brief This primitive carries the Confirmation for a Control Request
   * sent from the layer manager to MAC.
   * @details This primitive is used by MAC to inform Layer manager about the
@@ -793,7 +793,7 @@ EXTERN S16 RgMiLrgSchCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
   * @param cfm pointer to RgMngmt 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
+S16 RgMiLrgSchCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
  /** @brief This primitive carries the a copy of the received buffer from MAC to
   * the layer manager. This is called the Tracing functionality of the layer.
   * @details This primitive is used by MAC to send a copy of the received buffer
@@ -803,7 +803,7 @@ EXTERN S16 RgMiLrgSchCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
   * @param mBuf pointer to Buffer contains the portion of the received message. 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc, Buffer *mBuf));
+S16 RgMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc, Buffer *mBuf));
 #ifdef LTE_L2_MEAS
  /** @brief This primitive is to enable L2 (layer 2) measurements at the MAC
   * layer.
@@ -814,7 +814,7 @@ EXTERN S16 RgMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc, Buffer *mBuf));
   * @param schL2MeasInfo pointer to LrgSchMeasReqInfo 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchL2MeasReq ARGS((Pst *pst, LrgSchMeasReqInfo *schL2MeasInfo));
+S16 RgMiLrgSchL2MeasReq ARGS((Pst *pst, LrgSchMeasReqInfo *schL2MeasInfo));
  /** @brief This primitive carries the results of the L2 Measurements gathered
   * by MAC to the layer manager.
   * 
@@ -824,7 +824,7 @@ EXTERN S16 RgMiLrgSchL2MeasReq ARGS((Pst *pst, LrgSchMeasReqInfo *schL2MeasInfo)
   * @param schL2MeasCfm pointer to LrgSchMeasCfmInfo 
   * @return ROK/RFAILED
   */
-EXTERN S16 RgMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
+S16 RgMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
  /** @brief This primitive is to Stop L2 (layer 2) measurements at the MAC
   * layer.
   *
@@ -835,7 +835,7 @@ EXTERN S16 RgMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm))
   * @return ROK/RFAILED
   */
 
-EXTERN S16 RgMiLrgSchL2MeasStopReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *schL2MeasInfo));
+S16 RgMiLrgSchL2MeasStopReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *schL2MeasInfo));
  /** @brief This primitive is to used to send  L2 (layer 2) measurements at the MAC
   * layer.
   *
@@ -846,7 +846,7 @@ EXTERN S16 RgMiLrgSchL2MeasStopReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *schL2M
   * @return ROK/RFAILED
   */
 
-EXTERN S16 RgMiLrgSchL2MeasSendReq ARGS((Pst *pst,LrgSchMeasSndReqInfo *schL2MeasInfo));
+S16 RgMiLrgSchL2MeasSendReq ARGS((Pst *pst,LrgSchMeasSndReqInfo *schL2MeasInfo));
  /** @brief This primitive carries the confrmratoin  of the L2 Measurements gathered
   * by MAC to the layer manager.
   *
@@ -857,38 +857,38 @@ EXTERN S16 RgMiLrgSchL2MeasSendReq ARGS((Pst *pst,LrgSchMeasSndReqInfo *schL2Mea
   * @return ROK/RFAILED
   */
 
-EXTERN S16 RgMiLrgSchL2MeasStopCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
+S16 RgMiLrgSchL2MeasStopCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
 #endif /* LTE_L2_MEAS */
 #endif /* RG. */
 
 #ifdef SM 
-EXTERN S16 smRgActvInit ARGS((Ent ent,Inst inst, Region region,Reason reason));
-EXTERN S16 smRgActvTsk ARGS((Pst *pst, Buffer *mBuf));
-EXTERN S16 SmMiLrgCfgReq ARGS((Pst *pst, RgMngmt *cfg));
-EXTERN S16 SmMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgSchCfgReq ARGS((Pst *pst, RgMngmt *cfg));
-EXTERN S16 SmMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgStsReq ARGS((Pst *pst, RgMngmt *sts));
-EXTERN S16 SmMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgStaReq ARGS((Pst *pst, RgMngmt *sta));
-EXTERN S16 SmMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
-EXTERN S16 SmMiLrgCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
-EXTERN S16 SmMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
-EXTERN S16 SmMiLrgCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgSchCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
-EXTERN S16 SmMiLrgSchCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
-EXTERN S16 SmMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc, Buffer *mBuf));
+S16 smRgActvInit ARGS((Ent ent,Inst inst, Region region,Reason reason));
+S16 smRgActvTsk ARGS((Pst *pst, Buffer *mBuf));
+S16 SmMiLrgCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+S16 SmMiLrgCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgSchCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+S16 SmMiLrgSchCfgCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgStsReq ARGS((Pst *pst, RgMngmt *sts));
+S16 SmMiLrgStsCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgStaReq ARGS((Pst *pst, RgMngmt *sta));
+S16 SmMiLrgStaCfm ARGS((Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgStaInd ARGS((Pst *pst, RgMngmt *usta));
+S16 SmMiLrgCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
+S16 SmMiLrgSchStaInd ARGS((Pst *pst, RgMngmt *usta));
+S16 SmMiLrgCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgSchCntrlReq ARGS((Pst *pst, RgMngmt *cntrl));
+S16 SmMiLrgSchCntrlCfm ARGS(( Pst *pst, RgMngmt *cfm));
+S16 SmMiLrgTrcInd ARGS((Pst *pst, RgMngmt *trc, Buffer *mBuf));
 /* lrg_x_001.main_3 - ADD -  Added the following functions for LTE_L2_MEAS */
 #ifdef LTE_L2_MEAS
-EXTERN S16 SmMiLrgSchL2MeasStartReq ARGS((Pst *pst, LrgSchMeasReqInfo *schL2MeasReq));
-EXTERN S16 SmMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
-EXTERN S16 SmMiLrgSchL2MeasStopReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *schL2MeasReq));
-EXTERN S16 SmMiLrgSchL2MeasSendReq ARGS((Pst *pst, LrgSchMeasSndReqInfo *schL2MeasReq));
-EXTERN S16 SmMiLrgSchL2MeasStopCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
-EXTERN S16 SmMiLrgSchL2MeasReq ARGS((Pst *pst, LrgSchMeasReqInfo *meas));
-EXTERN S16 SmMiLrgSchL2SendMeasReq ARGS((Pst *pst, LrgSchMeasSndReqInfo *meas));
-EXTERN S16 SmMiLrgSchL2StopMeasReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *meas));
+S16 SmMiLrgSchL2MeasStartReq ARGS((Pst *pst, LrgSchMeasReqInfo *schL2MeasReq));
+S16 SmMiLrgSchL2MeasCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
+S16 SmMiLrgSchL2MeasStopReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *schL2MeasReq));
+S16 SmMiLrgSchL2MeasSendReq ARGS((Pst *pst, LrgSchMeasSndReqInfo *schL2MeasReq));
+S16 SmMiLrgSchL2MeasStopCfm ARGS((Pst *pst, LrgSchMeasCfmInfo *schL2MeasCfm));
+S16 SmMiLrgSchL2MeasReq ARGS((Pst *pst, LrgSchMeasReqInfo *meas));
+S16 SmMiLrgSchL2SendMeasReq ARGS((Pst *pst, LrgSchMeasSndReqInfo *meas));
+S16 SmMiLrgSchL2StopMeasReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *meas));
 #endif /* LTE_L2_MEAS */
 #endif /* SM. */
 
@@ -898,26 +898,26 @@ EXTERN S16 SmMiLrgSchL2StopMeasReq ARGS((Pst *pst, LrgSchMeasStopReqInfo *meas))
 #if (defined(LCLRG))
 /** @brief This API is used to send a 
 Config Request from LM to MAC.*/
-EXTERN S16 cmPkLrgCfgReq ARGS((
+S16 cmPkLrgCfgReq ARGS((
    Pst *                pst,
    RgMngmt *            cfg
 ));
 /** @brief This API is used to send a 
 Configuration Request from LM to MAC. */
-EXTERN S16 cmUnpkLrgCfgReq ARGS((
+S16 cmUnpkLrgCfgReq ARGS((
    LrgCfgReq            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Configuration Request from LM to SCH. */
-EXTERN S16 cmPkLrgSchCfgReq ARGS((
+S16 cmPkLrgSchCfgReq ARGS((
    Pst *                pst,
    RgMngmt *            cfg
 ));
 /** @brief This API is used to send a 
 Configuration Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchCfgReq ARGS((
+S16 cmUnpkLrgSchCfgReq ARGS((
    LrgSchCfgReq         func,
    Pst *                pst,
    Buffer               *mBuf
@@ -926,72 +926,72 @@ EXTERN S16 cmUnpkLrgSchCfgReq ARGS((
 #ifdef LTE_L2_MEAS
 /** @brief This API is used to send a 
 L2 Measurement Request from LM to SCH. */
-EXTERN S16 cmPkLrgSchL2MeasReq ARGS((
+S16 cmPkLrgSchL2MeasReq ARGS((
    Pst *                pst,
    LrgSchMeasReqInfo *  meas
 ));
 /** @brief This API is used to send a 
 L2 Measurement Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchL2MeasReq ARGS((
+S16 cmUnpkLrgSchL2MeasReq ARGS((
    LrgSchL2MeasReq         func,
    Pst *                 pst,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkLrgSchL2MeasCfm ARGS((
+S16 cmPkLrgSchL2MeasCfm ARGS((
     Pst * pst,
     LrgSchMeasCfmInfo  *measInfo
 ));
-EXTERN S16 cmUnpkLrgSchL2MeasCfm ARGS((
+S16 cmUnpkLrgSchL2MeasCfm ARGS((
     LrgSchL2MeasCfm func,
     Pst *pst,
     Buffer *mBuf
 ));
-EXTERN S16 cmPkLrgSchL2MeasReq ARGS((
+S16 cmPkLrgSchL2MeasReq ARGS((
    Pst *                pst,
    LrgSchMeasReqInfo *  meas
 ));
 /** @brief This API is used to send a 
 L2 Measurement Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchL2MeasReq ARGS((
+S16 cmUnpkLrgSchL2MeasReq ARGS((
    LrgSchL2MeasReq         func,
    Pst *                 pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a
 L2 Measurement Stop Request from LM to SCH. */
-EXTERN S16 cmPkLrgSchL2MeasSendReq ARGS((
+S16 cmPkLrgSchL2MeasSendReq ARGS((
    Pst *                pst,
    LrgSchMeasSndReqInfo *  meas
 ));
 /** @brief This API is used to send a 
 L2 Measurement Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchL2MeasSendReq ARGS((
+S16 cmUnpkLrgSchL2MeasSendReq ARGS((
    LrgSchL2MeasSendReq         func,
    Pst *                 pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a
 L2 Measurement Stop Request from LM to SCH. */
-EXTERN S16 cmPkLrgSchL2MeasStopReq ARGS((
+S16 cmPkLrgSchL2MeasStopReq ARGS((
    Pst *                pst,
    LrgSchMeasStopReqInfo *  meas
 ));
 /** @brief This API is used to send a 
 L2 Measurement Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchL2MeasStopReq ARGS((
+S16 cmUnpkLrgSchL2MeasStopReq ARGS((
    LrgSchL2MeasStopReq         func,
    Pst *                 pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to carry
 L2 Measurement Cfm  from SCH. */
-EXTERN S16 cmPkLrgSchL2MeasStopCfm ARGS((
+S16 cmPkLrgSchL2MeasStopCfm ARGS((
     Pst * pst,
     LrgSchMeasCfmInfo  *measInfo
 ));
 /** @brief This API is used to carrya
 L2 Measurement Cfm  from SCH. */
-EXTERN S16 cmUnpkLrgSchL2MeasStopCfm ARGS((
+S16 cmUnpkLrgSchL2MeasStopCfm ARGS((
     LrgSchL2MeasStopCfm func,
     Pst *pst,
     Buffer *mBuf
@@ -999,290 +999,290 @@ EXTERN S16 cmUnpkLrgSchL2MeasStopCfm ARGS((
 #endif
 /** @brief This API is used to send a 
 Configuration Confirm from MAC to LM. */
-EXTERN S16 cmPkLrgCfgCfm ARGS((
+uint8_t cmPkLrgCfgCfm ARGS((
    Pst *                pst,
    RgMngmt *            cfm
 ));
 /** @brief This API is used to send a 
 Configuration Confirm from MAC to LM. */
-EXTERN S16 cmUnpkLrgCfgCfm ARGS((
+S16 cmUnpkLrgCfgCfm ARGS((
    LrgCfgCfm            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Configuration Confirm from SCH to LM. */
-EXTERN S16 cmPkLrgSchCfgCfm ARGS((
+ uint8_t cmPkLrgSchCfgCfm ARGS((
    Pst *                pst,
    RgMngmt *            cfg
 ));
 /** @brief This API is used to send a 
 Configuration Confirm from SCH to LM. */
-EXTERN S16 cmUnpkLrgSchCfgCfm ARGS((
+S16 cmUnpkLrgSchCfgCfm ARGS((
    LrgSchCfgCfm         func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Statistics Request from LM to MAC. */
-EXTERN S16 cmPkLrgStsReq ARGS((
+ S16 cmPkLrgStsReq ARGS((
    Pst *                pst,
    RgMngmt *            sts
 ));
 /** @brief This API is used to send a 
 Statistics Request from LM to MAC. */
-EXTERN S16 cmUnpkLrgStsReq ARGS((
+S16 cmUnpkLrgStsReq ARGS((
    LrgStsReq            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Statistics Confirm from MAC to LM. */
-EXTERN S16 cmPkLrgStsCfm ARGS((
+S16 cmPkLrgStsCfm ARGS((
    Pst *                pst,
    RgMngmt *            cfm
 ));
 /** @brief This API is used to send a 
 Statistics Confirm from MAC to LM. */
-EXTERN S16 cmUnpkLrgStsCfm ARGS((
+S16 cmUnpkLrgStsCfm ARGS((
    LrgStsCfm            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Status Request from LM to MAC. */
-EXTERN S16 cmPkLrgStaReq ARGS((
+S16 cmPkLrgStaReq ARGS((
    Pst *                pst,
    RgMngmt *            sta
 ));
 /** @brief This API is used to send a 
 Status Request from LM to MAC. */
-EXTERN S16 cmUnpkLrgStaReq ARGS((
+S16 cmUnpkLrgStaReq ARGS((
    LrgStaReq            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Status Confirm from MAC to LM. */
-EXTERN S16 cmPkLrgStaCfm ARGS((
+S16 cmPkLrgStaCfm ARGS((
    Pst *                pst,
    RgMngmt *            cfm
 ));
 /** @brief This API is used to send a 
 Status Confirm from MAC to LM. */
-EXTERN S16 cmUnpkLrgStaCfm ARGS((
+S16 cmUnpkLrgStaCfm ARGS((
    LrgStaCfm            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Status Indication from MAC to LM. */
-EXTERN S16 cmPkLrgStaInd ARGS((
+S16 cmPkLrgStaInd ARGS((
    Pst *                pst,
    RgMngmt *            usta
 ));
 /** @brief This API is used to send a 
 Status Indication from MAC to LM. */
-EXTERN S16 cmUnpkLrgStaInd ARGS((
+S16 cmUnpkLrgStaInd ARGS((
    LrgStaInd            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Status Indication from SCH to LM. */
-EXTERN S16 cmPkLrgSchStaInd ARGS((
+S16 cmPkLrgSchStaInd ARGS((
    Pst *                pst,
    RgMngmt *            sta
 ));
 /** @brief This API is used to send a 
 Status Indication from SCH to LM. */
-EXTERN S16 cmUnpkLrgSchStaInd ARGS((
+S16 cmUnpkLrgSchStaInd ARGS((
    LrgSchStaInd         func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Control Request from LM to MAC. */
-EXTERN S16 cmPkLrgCntrlReq ARGS((
+S16 cmPkLrgCntrlReq ARGS((
    Pst *                pst,
    RgMngmt *            cntrl
 ));
 /** @brief This API is used to send a 
 Control Request from LM to MAC. */
-EXTERN S16 cmUnpkLrgCntrlReq ARGS((
+S16 cmUnpkLrgCntrlReq ARGS((
    LrgCntrlReq          func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Control Request from LM to SCH. */
-EXTERN S16 cmPkLrgSchCntrlReq ARGS((
+S16 cmPkLrgSchCntrlReq ARGS((
    Pst *                pst,
    RgMngmt *            cntrl
 ));
 /** @brief This API is used to send a 
 Control Request from LM to SCH. */
-EXTERN S16 cmUnpkLrgSchCntrlReq ARGS((
+S16 cmUnpkLrgSchCntrlReq ARGS((
    LrgSchCntrlReq       func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Control Confirm from MAC to LM.*/
-EXTERN S16 cmPkLrgCntrlCfm ARGS((
+S16 cmPkLrgCntrlCfm ARGS((
    Pst *                pst,
    RgMngmt *            cfm
 ));
 /** @brief This API is used to send a 
 Control Confirm from MAC to LM. */
-EXTERN S16 cmUnpkLrgCntrlCfm ARGS((
+S16 cmUnpkLrgCntrlCfm ARGS((
    LrgCntrlCfm          func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Control Confirm from SCH to LM. */
-EXTERN S16 cmPkLrgSchCntrlCfm ARGS((
+S16 cmPkLrgSchCntrlCfm ARGS((
    Pst *                pst,
    RgMngmt *            cntrl
 ));
 /** @brief This API is used to send a 
 Control Confirm from SCH to LM. */
-EXTERN S16 cmUnpkLrgSchCntrlCfm ARGS((
+S16 cmUnpkLrgSchCntrlCfm ARGS((
    LrgSchCntrlCfm       func,
    Pst *                pst,
    Buffer               *mBuf
 ));
 /** @brief This API is used to send a 
 Trace Indication from MAC to LM. */
-EXTERN S16 cmPkLrgTrcInd ARGS((
+S16 cmPkLrgTrcInd ARGS((
    Pst *                pst,
    RgMngmt *            trc,
    Buffer *             trcBuf
 ));
 /** @brief This API is used to send a 
 Trace Indication from MAC to LM. */
-EXTERN S16 cmUnpkLrgTrcInd ARGS((
+S16 cmUnpkLrgTrcInd ARGS((
    LrgTrcInd            func,
    Pst *                pst,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgGenCfg ARGS((
+S16 cmPkRgGenCfg ARGS((
    RgGenCfg             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgGenCfg ARGS((
+S16 cmUnpkRgGenCfg ARGS((
    RgGenCfg             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgUpSapCfg ARGS((
+S16 cmPkRgUpSapCfg ARGS((
    RgUpSapCfg           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgUpSapCfg ARGS((
+S16 cmUnpkRgUpSapCfg ARGS((
    RgUpSapCfg           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgLowSapCfg ARGS((
+S16 cmPkRgLowSapCfg ARGS((
    RgLowSapCfg          *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgLowSapCfg ARGS((
+S16 cmUnpkRgLowSapCfg ARGS((
    RgLowSapCfg          *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgGenSts ARGS((
+S16 cmPkRgGenSts ARGS((
    RgGenSts             *param,
    Buffer               *mBuf
 ));
 
 #ifdef MAC_SCH_STATS
-EXTERN S16 cmPkRgSchHqRetxStats ARGS((
+S16 cmPkRgSchHqRetxStats ARGS((
    RgSchHqRetxStats     *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSchNackAckStats ARGS((
+S16 cmPkRgSchNackAckStats ARGS((
    RgSchNackAckStats    *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgHqNumRetx ARGS((
+S16 cmPkRgHqNumRetx ARGS((
    RgSchHqNumRetx       *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgAckNack ARGS((
+S16 cmPkRgAckNack ARGS((
    RgAckNack            *param,
    Buffer               *mBuf
 ));
 
-EXTERN S16 cmUnpkRgSchHqRetxStats ARGS((
+S16 cmUnpkRgSchHqRetxStats ARGS((
    RgSchHqRetxStats     *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSchNackAckStats ARGS((
+S16 cmUnpkRgSchNackAckStats ARGS((
    RgSchNackAckStats    *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgHqNumRetx ARGS((
+S16 cmUnpkRgHqNumRetx ARGS((
    RgSchHqNumRetx       *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgAckNack ARGS((
+S16 cmUnpkRgAckNack ARGS((
    RgAckNack            *param,
    Buffer               *mBuf
 ));
 #endif /* MAC_SCH_STATS */
 
-EXTERN S16 cmUnpkRgGenSts ARGS((
+S16 cmUnpkRgGenSts ARGS((
    RgGenSts             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSapSts ARGS((
+S16 cmPkRgSapSts ARGS((
    RgSapSts             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSapSts ARGS((
+S16 cmUnpkRgSapSts ARGS((
    RgSapSts             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSchInstCfg ARGS((
+S16 cmPkRgSchInstCfg ARGS((
    RgSchInstCfg         *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSchInstCfg ARGS((
+S16 cmUnpkRgSchInstCfg ARGS((
    RgSchInstCfg         *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgCfg ARGS((
+S16 cmPkRgCfg ARGS((
    RgCfg                *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgCfg ARGS((
+S16 cmUnpkRgCfg ARGS((
    RgCfg                *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSapSta ARGS((
+S16 cmPkRgSapSta ARGS((
    RgSapSta             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSapSta ARGS((
+S16 cmUnpkRgSapSta ARGS((
    RgSapSta             *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSts ARGS((
+S16 cmPkRgSts ARGS((
    RgSts                *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSts ARGS((
+S16 cmUnpkRgSts ARGS((
    RgSts                *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
 /* lrg_x_001.main_3 - MODIFY -  Modified the below function to hold the event type */
 #ifdef LRG_V1
-EXTERN S16 cmPkRgSsta ARGS((
+S16 cmPkRgSsta ARGS((
    Pst                  *pst,
    RgSsta               *param,
    S16                  elmnt,
@@ -1291,76 +1291,76 @@ EXTERN S16 cmPkRgSsta ARGS((
    Buffer               *mBuf
 ));
 #else /*LRG_V1 not defined */
-EXTERN S16 cmPkRgSsta ARGS((
+S16 cmPkRgSsta ARGS((
    Pst                  *pst,
    RgSsta               *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
 #endif /* LRG_V1 endif */
-EXTERN S16 cmUnpkRgSsta ARGS((
+S16 cmUnpkRgSsta ARGS((
    Pst                  *pst,
    RgSsta               *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgUstaDgn ARGS((
+S16 cmPkRgUstaDgn ARGS((
    RgUstaDgn            *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgUstaDgn ARGS((
+S16 cmUnpkRgUstaDgn ARGS((
    RgUstaDgn            *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgUsta ARGS((
+S16 cmPkRgUsta ARGS((
    RgUsta               *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgUsta ARGS((
+S16 cmUnpkRgUsta ARGS((
    RgUsta               *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgTrc ARGS((
+S16 cmPkRgTrc ARGS((
    RgTrc                *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgTrc ARGS((
+S16 cmUnpkRgTrc ARGS((
    RgTrc                *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgDbgCntrl ARGS((
+S16 cmPkRgDbgCntrl ARGS((
    RgDbgCntrl           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgDbgCntrl ARGS((
+S16 cmUnpkRgDbgCntrl ARGS((
    RgDbgCntrl           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgSapCntrl ARGS((
+S16 cmPkRgSapCntrl ARGS((
    RgSapCntrl           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgSapCntrl ARGS((
+S16 cmUnpkRgSapCntrl ARGS((
    RgSapCntrl           *param,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgCntrl ARGS((
+S16 cmPkRgCntrl ARGS((
    RgCntrl              *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmUnpkRgCntrl ARGS((
+S16 cmUnpkRgCntrl ARGS((
    RgCntrl              *param,
    S16                  elmnt,
    Buffer               *mBuf
 ));
-EXTERN S16 cmPkRgMngmt ARGS((
+S16 cmPkRgMngmt ARGS((
    Pst *pst,
    RgMngmt *param,
    U8 eventType,
    Buffer *mBuf
 ));
-EXTERN S16 cmUnpkRgMngmt ARGS((
+S16 cmUnpkRgMngmt ARGS((
    Pst *pst,
    RgMngmt *param,
    U8 eventType,
@@ -1368,12 +1368,12 @@ EXTERN S16 cmUnpkRgMngmt ARGS((
 ));
 
 #ifdef PHY_ERROR_LOGING
-EXTERN S16 cmPkRgSchUlAllocCntrl ARGS((
+S16 cmPkRgSchUlAllocCntrl ARGS((
    RgSchUlAllocCntrl *param,
    Buffer *mBuf
 ));
 
-EXTERN S16 cmUnpkRgSchUlAllocCntrl ARGS((
+S16 cmUnpkRgSchUlAllocCntrl ARGS((
    RgSchUlAllocCntrl *param,
    Buffer *mBuf
 ));
index 3d0e15d..3dab44f 100644 (file)
@@ -130,7 +130,7 @@ uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo)
+uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
 {
    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
    {
index 26fe41a..0b82447 100644 (file)
@@ -57,7 +57,6 @@
 #define MAX_NUMBER_OF_CRC_IND_BITS 1
 #define MAX_NUMBER_OF_UCI_IND_BITS 1
 #define MAX_SR_BITS_IN_BYTES       1
-#define MAX_NUM_LOGICAL_CHANNELS   11
 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
 /* can we have a common numslot numscs between mac sch */
 #define MAX_SLOTS 10
@@ -73,9 +72,6 @@
 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
 
 #define SD_SIZE   3
-#define CCCH_LCID  0
-#define SRB1_LCID  1
-#define SRB2_LCID  2
 
 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr)          \
 {                                                          \
@@ -485,7 +481,7 @@ typedef struct dlDCI
 typedef struct pdcchCfg
 {
    /* coreset-0 configuration */
-   CoresetCfg coreset0Cfg;
+   CoresetCfg coresetCfg;
 
    uint16_t numDlDci;
    DlDCI    dci; /* as of now its only one DCI, later it will be numDlCi */
@@ -673,7 +669,7 @@ typedef struct rarAlloc
    PdschCfg rarPdschCfg;
 }RarAlloc;
 
-typedef struct msg4Info
+typedef struct dlMsgInfo
 {
    uint16_t crnti;
    uint8_t  ndi;
@@ -683,24 +679,33 @@ typedef struct msg4Info
    uint8_t  pucchResInd;
    uint8_t  harqFeedbackInd;
    uint8_t  dciFormatId;
-   uint8_t  *msg4Pdu;
-   uint16_t  msg4PduLen;
-}Msg4Info;
+   bool     isMsg4Pdu;
+   uint16_t  dlMsgPduLen;
+   uint8_t  *dlMsgPdu;
+}DlMsgInfo;
 
-typedef struct msg4Alloc
+typedef struct lcSchInfo
 {
-   Msg4Info msg4Info;
-   BwpCfg bwp;
-   PdcchCfg msg4PdcchCfg;
-   PdschCfg msg4PdschCfg;
-}Msg4Alloc;
+   uint8_t   lcId;
+   uint16_t  schBytes; /* Number of scheduled bytes */
+}LcSchInfo;
+
+typedef struct dlMsgAlloc
+{
+   uint16_t   crnti;
+   uint8_t    numLc;
+   LcSchInfo  lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
+   BwpCfg     bwp;
+   PdcchCfg   dlMsgPdcchCfg;
+   PdschCfg   dlMsgPdschCfg;
+   DlMsgInfo  dlMsgInfo;
+}DlMsgAlloc;
 
 typedef struct schSlotValue
 {
    SlotIndInfo currentTime;
    SlotIndInfo broadcastTime;
    SlotIndInfo rarTime;
-   SlotIndInfo msg4Time;
    SlotIndInfo dlMsgTime;
    SlotIndInfo ulDciTime;
 }SchSlotValue;
@@ -772,11 +777,14 @@ typedef struct dlSchedInfo
    RarAlloc *rarAlloc;
 
    /* Allocation from MSG4 */
-   Msg4Alloc *msg4Alloc;
+   //Msg4Alloc *msg4Alloc;
 
    /* UL grant in response to BSR */
    DciInfo    *ulGrant;
 
+   /* Allocation from dedicated DL msg */
+   DlMsgAlloc *dlMsgAlloc;
+
 }DlSchedInfo;
 
 typedef struct tbInfo
@@ -789,6 +797,7 @@ typedef struct tbInfo
 
 typedef struct schPuschInfo
 {
+   uint16_t         crnti;
    uint8_t          harqProcId;   /* HARQ Process ID */
    uint8_t          resAllocType; /* Resource allocation type */
    FreqDomainAlloc  fdAlloc;      /* Freq domain allocation */
@@ -855,9 +864,9 @@ typedef struct dlRlcBOInfo
 {
    uint16_t    cellId;
    uint16_t    crnti;
-   uint16_t    numLc;
-   BOInfo      boInfo[MAX_NUM_LOGICAL_CHANNELS];
-}DlRlcBOInfo;
+   uint8_t     lcId;
+   uint32_t    dataVolume;
+}DlRlcBoInfo;
 
 /* Info of Scheduling Request to Add/Modify */
 typedef struct schSchedReqInfo
@@ -1190,7 +1199,7 @@ typedef struct schUeCfg
    SchSpCellCfg       spCellCfg;
    SchAggrMaxBitRate  *aggrMaxBitRate;
    uint8_t            numLc;
-   SchLcCfg           lcCfgList[MAX_NUM_LOGICAL_CHANNELS];
+   SchLcCfg           lcCfgList[MAX_NUM_LC];
 }SchUeCfg;
 
 typedef struct schUeCfgRsp
@@ -1258,7 +1267,7 @@ typedef uint8_t (*MacSchCrcIndFunc) ARGS((
 
 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
         Pst         *pst,         /* Post structure */
-        DlRlcBOInfo *dlBoInfo));   /* DL BO Info */
+        DlRlcBoInfo *dlBoInfo));   /* DL BO Info */
 
 typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
         Pst         *pst,           /* Post structure */
@@ -1299,8 +1308,8 @@ uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
-uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
-uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
+uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
+uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
 uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
index df5714d..3639297 100755 (executable)
@@ -398,286 +398,6 @@ Buffer *mBuf;
    return ((*func)(pst, suId, status));
 }
 
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission
-*
-* @details
-*
-*     Function : packDlData
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguDDatReqInfo  *  datReq
-*  @return   S16
-*      -# ROK
-**/
-uint16_t packDlData
-(
-Pst* pst,
-SpId spId,
-RlcMacData  *dlData
-)
-{
-   Buffer *mBuf = NULLP;
-   TRC3(packDlData)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)dlData, sizeof(RlcMacData));
-      return RFAILED;
-   }
-
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKPK(oduPackPointer,(PTR) dlData, mBuf);
-   }
-   else
-   {
-      /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
-      if (packRlcMacDataInfo(pst, dlData, mBuf) != ROK)
-#else
-      if (packRlcMacDataInfo(dlData, mBuf) != ROK) 
-#endif
-      {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
-                                       sizeof(RlcMacData));
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-
-      if (SPutSBuf(pst->region, pst->pool, 
-                   (Data *)dlData, sizeof(RlcMacData)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      dlData = NULLP;
-   }
-   if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
-#endif      
-      if (dlData != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, 
-                  (Data *)dlData, sizeof(RlcMacData));
-      }
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   pst->event = (Event) EVTRLCDLDAT;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission
-*
-* @details
-*
-*     Function : unpackDlData
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguDDatReqInfo  *  datReq
-*  @return   S16
-*      -# ROK
-**/
-S16 unpackDlData
-(
-RlcMacDlData func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   SpId spId;
-   RlcMacData *dlData;
-   
-   TRC3(unpackDlData)
-
-   if (SUnpkS16(&spId, mBuf) != ROK) {
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKUNPK(oduUnpackPointer,(PTR *) &dlData, mBuf);
-   }
-   else 
-   {
-      if ((SGetSBuf(pst->region, pst->pool, 
-                     (Data **)&dlData, sizeof(RlcMacData))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      cmMemset((U8*)dlData, (U8)0, sizeof(RlcMacData));
-  /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
-      if (unpackRlcMacDataInfo(pst,dlData, mBuf) != ROK)
-#else
-      if (unpackRlcMacDataInfo(dlData, mBuf) != ROK) 
-#endif
-      {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
-                                     sizeof(RlcMacData));
-         return RFAILED;
-      }
-   }
-   SPutMsg(mBuf);
-
-   /* TODO : change function call to send RlcMacData as below: */
-   return ((*func)(pst, spId, dlData));
-   
-   //return ((*func)(pst, spId, datReq));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels
-*
-* @details
-*
-*     Function : packRcvdUlData
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RlcMacData *ulData
-*  @return   S16
-*      -# ROK
-**/
-uint8_t packRlcUlData(Pst* pst, RlcMacData  *ulData)
-{
-   Buffer *mBuf = NULLP;
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
-#endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
-      return RFAILED;
-   }
-
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKPK(oduPackPointer,(PTR)ulData, mBuf);
-   }
-   else
-   {
-      if (packRlcMacDataInfo(ulData, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                (ErrVal)ERGU036, (ErrVal)0, "Packing failed");
-#endif            
-         SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-
-      if (SPutStaticBuffer(pst->region, pst->pool, 
-                      (Data *)ulData, sizeof(RlcMacData),0) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      ulData = NULLP;
-   }
-   pst->event = (Event) EVTRLCULDAT;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels
-*
-* @details
-*
-*     Function : unpackRcvdUlData
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RlcMacData  *ulData
-*  @return   S16
-*      -# ROK
-**/
-uint8_t unpackRcvdUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf)
-{
-   RlcMacData *ulData;
-   
-   TRC3(unpackRcvdUlData)
-
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKUNPK(oduUnpackPointer,(PTR *) &ulData, mBuf);
-   }
-   else 
-   {
-       if ((SGetStaticBuffer(pst->region, pst->pool, 
-                    (Data **)&ulData, sizeof(RlcMacData),0)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      if (unpackRlcMacDataInfo(ulData, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutStaticBuffer(pst->region, pst->pool, 
-                    (Data *)ulData, sizeof(RlcMacData),0);
-         return RFAILED;
-      }
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, ulData));
-}
-
-
 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
 #ifdef LTE_L2_MEAS
 
@@ -936,165 +656,6 @@ Buffer *mBuf;
 #endif
 
 
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels
-*
-* @details
-*
-*     Function : packBOStatus,
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RlcMacBOStatus  *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-uint16_t packBOStatus
-(
-Pst* pst,
-SpId spId,
-RlcMacBOStatus  *boStatus
-)
-{
-   RlcMacBOStatus  *boStaInfo = NULL;
-   Buffer *mBuf = NULLP;
-
-   if(SGetSBuf(pst->region, pst->pool, (Data **)&boStaInfo, sizeof(RlcMacBOStatus)) != ROK)
-   {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
-#endif      
-      return RFAILED;
-   }
-#ifdef ERRCLS_KW
-   /* boStaInfo cant be NULL here */
-   if (boStaInfo == NULLP)
-   {
-      return RFAILED;
-   }
-#endif
-   cmMemcpy((U8 *)boStaInfo, (U8 *)boStatus, sizeof(RlcMacBOStatus)); 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
-
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKPK(oduPackPointer,(PTR) boStaInfo, mBuf);
-   }
-   else
-   {
-      if (packBOStatusInfo(boStatus, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-        SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ERGU057, (ErrVal)0, "Packing failed");
-#endif      
-        SPutMsg(mBuf);
-        return RFAILED;
-     }
-   }
-   if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
-#endif      
-      if (boStaInfo != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
-      }
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-
-   pst->event = (Event)EVTRLCBOSTA;
-   return (SPstTsk(pst,mBuf));
-   SPutMsg(mBuf);
-}
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
-* inform the BO report for dedicated channels
-*
-* @details
-*
-*     Function : unpackBOStatus
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RlcMacBOStatus *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-uint16_t unpackBOStatus
-(
-RlcMacBoStatus func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   SpId spId;
-   RlcMacBOStatus *boSta;
-
-   TRC3(unpackBOStatus)
-
-   if (SUnpkS16(&spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKUNPK(oduUnpackPointer,(PTR *) &boSta, mBuf);
-   }
-   else
-   {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&boSta, 
-                                 sizeof(RlcMacBOStatus))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU061, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      if (unpackBOStatusInfo(boSta, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU062, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
-         return RFAILED;
-      }
-   }
-   SPutMsg(mBuf);
-  // (*func)(pst, spId, boSta);
-   SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
-   return ROK;
-}
-
-
    /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
 \f
@@ -1238,229 +799,78 @@ RguHarqStatusInd  *harqStatusInd;
 #ifdef ANSI
 S16 cmUnpkRguHqStaInd
 (
-RguHqStaInd  func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-S16 cmUnpkRguHqStaInd(func, pst, mBuf)
-RguHqStaInd   func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   RguHarqStatusInd    *hqStaInd;  
-   SuId                suId;
-   U8                  idx;
-
-   TRC3(cmUnpkRguHqStaInd)
-
-   if (SUnpkS16(&suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-#ifdef XEON_SPECIFIC_CHANGES
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
-        sizeof(RguHarqStatusInd))) != ROK) {
-#else   
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKUNPK(oduUnpackPointer,(PTR *) &hqStaInd, mBuf);
-   }  
-   else
-   {   
-      if ((SGetStaticBuffer(pst->region, pst->pool, 
-                  (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
-      {
-#endif         
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
-      CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
-      CMCHKUNPK(oduPackUInt8, &hqStaInd->numTbs, mBuf);
-      for(idx = hqStaInd->numTbs; idx > 0; idx--)
-      {
-         CMCHKUNPK(oduPackUInt32, &hqStaInd->tbId[idx - 1], mBuf);
-      }
-      for(idx = hqStaInd->numTbs; idx > 0; idx--)
-      {
-         CMCHKUNPK(oduPackUInt16, &hqStaInd->status[idx - 1], mBuf);
-      }
-#ifndef XEON_SPECIFIC_CHANGES      
-   }
-#endif   
-   SPutMsg(mBuf);
-   (*func)(pst, suId, hqStaInd);
-#ifdef XEON_SPECIFIC_CHANGES
-   SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
-#else   
-   SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
-#endif   
-   return ROK;
-}
-#endif /* LTE_L2_MEAS */
-
-\f
-/**
-* @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on dedicated channels.
-*
-* @details
-*
-*     Function : packSchedRep
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RlcMacSchedRep*  schRep
-*  @return   S16
-*      -# ROK
-**/
-S16 packSchedRep
-(
-Pst* pst,
-SuId suId,
-RlcMacSchedRepInfo  * schRep
-)
-{
-   Buffer *mBuf = NULLP;
-   TRC3(packSchedRep)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LWLC)
-   {
-      CMCHKPK(oduPackPointer,(PTR) schRep, mBuf);
-   }
-   else
-   {
-      if (packSchedRepInfo(schRep, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
-#endif      
-        SPutSBuf(pst->region, pst->pool, (Data *)schRep, 
-                                         sizeof(RlcMacSchedRepInfo));
-         SPutMsg(mBuf);
-         return RFAILED;
-      } 
-      if (SPutSBuf(pst->region, pst->pool, (Data *)schRep,
-                                  sizeof(RlcMacSchedRepInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU079, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-      schRep= NULLP;
-   }
-   if (SPkS16(suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
-#endif      
-      if (schRep != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
-      }
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-
-   pst->event = (Event) EVTSCHREP;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on dedicated channels.
-*
-* @details
-*
-*     Function : unpackSchedRep
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguDStaIndInfo  *  staInd
-*  @return   S16
-*      -# ROK
-**/
-S16 unpackSchedRep
-(
-RlcMacSchedRep func,
+RguHqStaInd  func,
 Pst *pst,
 Buffer *mBuf
 )
+#else
+S16 cmUnpkRguHqStaInd(func, pst, mBuf)
+RguHqStaInd   func;
+Pst *pst;
+Buffer *mBuf;
+#endif
 {
-   SuId suId;
-   RlcMacSchedRepInfo *schRep;
-   
-   TRC3(unpackSchedRep)
+   RguHarqStatusInd    *hqStaInd;  
+   SuId                suId;
+   U8                  idx;
+
+   TRC3(cmUnpkRguHqStaInd)
 
    if (SUnpkS16(&suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
+          (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
       return RFAILED;
    }
+#ifdef XEON_SPECIFIC_CHANGES
+   if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
+        sizeof(RguHarqStatusInd))) != ROK) {
+#else   
    if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(oduUnpackPointer,(PTR *) &schRep, mBuf);
-   }
-   else 
-   {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&schRep, sizeof(RlcMacSchedRepInfo))) != ROK) {
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &hqStaInd, mBuf);
+   }  
+   else
+   {   
+      if ((SGetStaticBuffer(pst->region, pst->pool, 
+                  (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
+      {
+#endif         
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-         (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
+               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+               (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
          return RFAILED;
       }
-      if (unpackSchedRepInfo(schRep, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
-         return RFAILED;
+      CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
+      CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
+      CMCHKUNPK(oduPackUInt8, &hqStaInd->numTbs, mBuf);
+      for(idx = hqStaInd->numTbs; idx > 0; idx--)
+      {
+         CMCHKUNPK(oduPackUInt32, &hqStaInd->tbId[idx - 1], mBuf);
       }
+      for(idx = hqStaInd->numTbs; idx > 0; idx--)
+      {
+         CMCHKUNPK(oduPackUInt16, &hqStaInd->status[idx - 1], mBuf);
+      }
+#ifndef XEON_SPECIFIC_CHANGES      
    }
+#endif   
    SPutMsg(mBuf);
-   return ((*func)(pst, suId, schRep));
+   (*func)(pst, suId, hqStaInd);
+#ifdef XEON_SPECIFIC_CHANGES
+   SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
+#else   
+   SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
+#endif   
+   return ROK;
 }
+#endif /* LTE_L2_MEAS */
 
 #ifdef ANSI
 S16 cmPkRguLcFlowCntrlInfo
@@ -2559,112 +1969,6 @@ Buffer *mBuf;
    return ROK;
 }
 
-
-\f
-/***********************************************************
-*
-*     Func : packRlcMacDataInfo
-*
-*
-*     Desc : RlcMacData
- * Data Indication from MAC to RLC for dedicated channels of a UE
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-S16 packRlcMacDataInfo
-(
-RlcMacData *param,
-Buffer *mBuf
-)
-#else
-S16 packRlcMacDataInfo(param, mBuf)
-RlcMacData *param;
-Buffer *mBuf;
-#endif
-{
-   S32 i;
-   MsgLen msgLen;
-
-   TRC3(packRlcMacDataInfo);
-
-   for (i=param->numPdu-1; i >= 0; i--)
-   {
-      msgLen = 0;
-      //if (SFndLenMsg(param->pduInfo[i].pduBuf, &msgLen) != ROK)
-      //   return RFAILED;
-      //if (SCatMsg(mBuf, param->pduInfo[i].pduBuf, M1M2) != ROK)
-      //    return RFAILED;      
-      CMCHKPK(cmPkMsgLen, msgLen, mBuf);
-      CMCHKPK(cmPkLteLcId, param->pduInfo[i].lcId, mBuf);
-      CMCHKPK(oduPackBool, param->pduInfo[i].commCh, mBuf);
-   }
-   CMCHKPK(oduUnpackUInt8, param->numPdu, mBuf);
-   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
-   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   //CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : unpackRlcMacDataInfo
-*
-*
-*     Desc : RlcMacData
- * Data Indication from MAC to RLC for dedicated channels of a UE
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-S16 unpackRlcMacDataInfo
-(
-RlcMacData *param,
-Buffer *mBuf
-)
-#else
-S16 unpackRlcMacDataInfo(param, mBuf)
-RlcMacData *param;
-Buffer *mBuf;
-#endif
-{
-   S32 i;
-
-   TRC3(unpackRlcMacDataInfo);
-   
-   //CMCHKUNPK(cmUnpkLteTimingInfo, &param->timeToTx, mBuf);
-   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->numPdu, mBuf);
-   for (i=0; i<param->numPdu; i++) 
-   {
-      MsgLen totalMsgLen;
-
-      CMCHKUNPK(oduUnpackBool, &param->pduInfo[i].commCh, mBuf);
-      CMCHKUNPK(cmUnpkLteLcId, &param->pduInfo[i].lcId, mBuf);
-      CMCHKUNPK(cmUnpkMsgLen, &param->pduInfo[i].pduLen, mBuf);
-      if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
-         return RFAILED;
-      //if (SSegMsg(mBuf, totalMsgLen-param->pduInfo[i].pduLen, &param->pduInfo[i].pduBuf) != ROK)
-      //   return RFAILED;
-   }
-   return ROK;
-}
-
 \f
 /***********************************************************
 *
@@ -2774,88 +2078,6 @@ Buffer *mBuf;
    return ROK;
 }
 
-
-\f
-/***********************************************************
-*
-*     Func : packBOStatusInfo
-*
-*
-*     Desc : RlcMacBOStatus
- * Status Response from RLC to MAC  for dedicated logical channel
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-S16 packBOStatusInfo
-(
-RlcMacBOStatus *param,
-Buffer *mBuf
-)
-#else
-S16 packBOStatusInfo(param, mBuf)
-RlcMacBOStatus *param;
-Buffer *mBuf;
-#endif
-{
-
-   TRC3(packBOStatusInfo);
-
-   CMCHKPK(SPkS32, param->bo, mBuf);
-   CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
-   CMCHKPK(oduPackBool, param->commCh, mBuf);
-   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
-   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   return ROK;
-} /* End of packBOStatusInfo */
-
-
-\f
-/***********************************************************
-*
-*     Func : unpackBOStatusInfo
-*
-*
-*     Desc : RlcMacBOStatus
- * Status Response from RLC to MAC  for dedicated logical channel
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-S16 unpackBOStatusInfo
-(
-RlcMacBOStatus *param,
-Buffer *mBuf
-)
-#else
-S16 unpackBOStatusInfo(param, mBuf)
-RlcMacBOStatus *param;
-Buffer *mBuf;
-#endif
-{
-
-   TRC3(unpackBOStatusInfo);
-
-   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
-   CMCHKUNPK(oduUnpackBool, &param->commCh, mBuf);
-   CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
-   CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
-   return ROK;
-} /* End of unpackBOStatusInfo */
-
 \f
 /***********************************************************
 *
@@ -3020,87 +2242,6 @@ Buffer *mBuf;
    return ROK;
 }
 
-\f
-/***********************************************************
-*
-*     Func : packSchedRepInfo
-*
-*
-*     Desc : RlcMacSchedRep
- * StaInd from MAC to RLC for dedicated logical channels of a UE
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 packSchedRepInfo
-(
-RlcMacSchedRepInfo *param,
-Buffer *mBuf
-)
-{
-   S32 idx;
-
-   TRC3(packSchedRepInfo);
-
-   for(idx = (param->nmbLch-1); idx >= 0; idx--)
-   {
-      CMCHKPK(cmPkRguLchStaInd, &param->lchSta[idx].lchStaInd, mBuf);
-      CMCHKPK(oduPackBool, param->lchSta[idx].commCh, mBuf);
-   }
-   CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
-   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
-   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
-
-   return ROK;
-} /* End of packSchedRepInfo */
-
-
-\f
-/***********************************************************
-*
-*     Func : unpackSchedRepInfo
-*
-*
-*     Desc : RlcMacSchedRep
- * StaInd from MAC to RLC for dedicated logical channels of a UE
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 unpackSchedRepInfo
-(
-RlcMacSchedRepInfo *param,
-Buffer *mBuf
-)
-{
-   S32 idx;
-
-   TRC3(unpackSchedRepInfo);
-
-   CMCHKUNPK(cmUnpkLteTimingInfo, &param->timeToTx, mBuf);
-   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
-   for(idx = 0; idx < param->nmbLch; idx++)
-   {
-      CMCHKUNPK(oduUnpackBool, &param->lchSta[idx].commCh, mBuf);
-      CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchSta[idx].lchStaInd, mBuf);
-   }
-
-   return ROK;
-} /* End of unpackSchedRepInfo */
-
 #endif
 
 /**********************************************************************
index b43785d..6d6beff 100755 (executable)
@@ -66,13 +66,13 @@ extern "C" {
 #define EVTRGUUBNDREQ  2     /*!< Un-Bind Request */
 #define EVTRGUBNDCFM   3     /*!< Bind Confirm */
 #define EVTRGUCDATREQ  4     /*!< Common Channel Data Request */
-//#define EVTRGUCDATIND  5     /*!< Common Channel Data Indication */
+#define EVTRGUCDATIND  5     /*!< Common Channel Data Indication */
 #define EVTRGUDDATREQ  6     /*!< Dedicated Channel Data Request */
-#define EVTRLCULDAT    7     /*!< Dedicated Channel Data Indication */
-#define EVTRLCDLDAT    8     /*!< Common Channel status response */
+#define EVTRGUDDATIND  7     /*!< Dedicated Channel Data Indication */
+#define EVTRGUCSTARSP  8     /*!< Common Channel status response */
 #define EVTRGUCSTAIND  9     /*!< Common Channel status Indication */
-#define EVTRLCBOSTA    10    /*!< Channel buffer occupancy status response */
-#define EVTSCHREP      11    /*!< Logical Channel Scheduling result report*/
+#define EVTRGUDSTARSP  10    /*!< Dedicated Channel status response */
+#define EVTRGUDSTAIND  11    /*!< Dedicated Channel status Indication */
    /*rgu_h_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
 #define EVTRGUHQSTAIND  12    /*!< HARQ status Indication */
index f43567d..fa724ed 100755 (executable)
@@ -259,7 +259,7 @@ typedef struct rguDDatIndInfo
    CmLteRnti    rnti;                /*!< UE ID */
    U8           numLch;              /*!< Number of logical channels within
                                        the UE that has data */
-   RguLchDatInd lchData[RGU_MAX_LC]; /*!< Data buffers of logical channels */
+   RguLchDatInd lchData[MAX_NUM_LC]; /*!< Data buffers of logical channels */
 #ifdef LTE_L2_MEAS
    U32          ttiCnt;              /*!< The Current TTI in the Cell */
    U8           burstInd;            /*!< Indicates the Burst Start or End */
@@ -397,51 +397,6 @@ typedef struct rguInfoRingElem
   Void         *msg;
 }RguInfoRingElem;
 
-/* Buffer occupancy status information */
-typedef struct rlcMacBOStatus
-{
-   CmLteCellId  cellId;     /*!< CELL ID */
-   CmLteRnti    rnti;       /*!< UE ID */
-   Bool         commCh;     /*!< Common or Dedicated Channel */
-   CmLteLcId    lcId;       /*!< Logical channel ID */
-   S32          bo;         /*!< Buffer occupancy reported by RLC */
-}RlcMacBOStatus;
-
-/* Schedule result report from RLC to MAC */
-typedef struct rlcMacLchSta
-{
-   Bool         commCh;     /*!<Common or Dedicated Channel */
-   RguLchStaInd lchStaInd;  /*!<Buffer size allocated for logical channel */
-}RlcMacLchSta;
-
-typedef struct rlcMacSchedRep
-{
-   CmLteTimingInfo timeToTx;  /*!< Air interface time */
-   CmLteCellId  cellId;       /*!< CELL ID */
-   CmLteRnti    rnti;         /*!< Temporary CRNTI */
-   U8           nmbLch;       /*!< Number of logical channels scheduled */
-   RlcMacLchSta lchSta[RGU_MAX_LC];  /*!< Scheduled info of logical channels */
-}RlcMacSchedRepInfo;
-
-/* UL Data i.e. RLC PDU info from RLC to MAC */
-typedef struct rlcMacPduInfo
-{
-   Bool         commCh;   /*!<Common or Dedicated Channel */
-   CmLteLcId    lcId;     /*!< Logical channel ID */
-   MsgLen       pduLen;   /*!< PDU Length */
-   uint8_t      *pduBuf;  /*!< RLC PDU buffer */
-}RlcMacPduInfo;
-
-typedef struct rlcMacData
-{  
-   CmLteCellId     cellId;       /*!< CELL ID */
-   CmLteRnti       rnti;         /*!< Temporary CRNTI */ 
-   SlotIndInfo     slotInfo;     /*!< Timing info */
-   U8              numPdu;       /*!< Number of RLC PDUs */
-   RlcMacPduInfo   pduInfo[RGU_MAX_PDU];
-}RlcMacData;
-
-
 /***********************************************************************
           type definitions for upper layer interface - RLC primitives
  ***********************************************************************/
@@ -474,10 +429,6 @@ typedef S16 (*RguDDatReq) ARGS((
    SpId                 spId,
    RguDDatReqInfo       *datReq));
 
-typedef uint16_t (*RlcMacDlData) ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacData           *dlData));
 /** @brief Data Indication from MAC to RLC to 
  * forward the data received for common channels */
 typedef S16 (*RguCDatInd) ARGS((
@@ -491,9 +442,6 @@ typedef S16 (*RguDDatInd) ARGS((
    SuId                 suId,
    RguDDatIndInfo       *datInd));
 
-typedef uint8_t (*RlcMacUlDataFunc) ARGS((
-   Pst*                 pst,
-   RlcMacData           *ulData));
 /** @brief Status Response from RLC to MAC to 
  * inform the BO report for common channels */
 typedef S16 (*RguCStaRsp) ARGS((
@@ -507,11 +455,6 @@ typedef S16 (*RguDStaRsp) ARGS((
    SpId                 spId,
    RguDStaRspInfo  *    staRsp));
 
-typedef uint16_t (*RlcMacBoStatus) ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacBOStatus       *boStatus));
-
 /** @brief Status Indication from MAC to RLC  
  * as a response to the staRsp primitive from RLC */
 typedef S16 (*RguCStaInd) ARGS((
@@ -525,11 +468,6 @@ typedef S16 (*RguDStaInd) ARGS((
    SuId                 suId,
    RguDStaIndInfo *    staInd));
 
-typedef uint16_t (*RlcMacSchedRep) ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RlcMacSchedRepInfo       *schRep));
-
 typedef S16 (*RguFlowCntrlIndInfo) ARGS((
    Pst                  *pst,
    SuId                 suId,
@@ -593,8 +531,6 @@ EXTERN S16 RgUiRguCDatReq ARGS((Pst* pst,SpId spId,RguCDatReqInfo *datReq));
 */
 EXTERN S16 RgUiRguDDatReq ARGS((Pst* pst,SpId spId,RguDDatReqInfo  *datReq));
 
-EXTERN uint16_t MacRlcProcDlData(Pst* pst, SpId spId, RlcMacData *dlData);
-
 /** @brief Data Indication from MAC to RLC to 
  * forward the data received for common channels
  * @param pst Pointer to the post structure.
@@ -628,8 +564,6 @@ EXTERN S16 RgUiRguCStaRsp ARGS((Pst* pst,SpId spId,RguCStaRspInfo  *staRsp));
 */
 EXTERN S16 RgUiRguDStaRsp ARGS((Pst* pst,SpId spId,RguDStaRspInfo  *staRsp));
 
-EXTERN uint16_t MacRlcProcBOStatus(Pst* pst, SpId spId, RlcMacBOStatus* boStatus);
-
 /** @brief Status Indication from MAC to RLC  
  * as a response to the staRsp primitive from RLC.
  * @param pst Pointer to the post structure.
@@ -696,36 +630,7 @@ EXTERN S16 RlcLiRguCDatReq ARGS((
    SpId                 spId,
    RguCDatReqInfo  *    datReq
 ));
-/** @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission */
-EXTERN S16 RlcMacSendDlData ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacData  *    datReq
-));
 
-/** @brief Handler toprocess UL data from MAC and
- * forwarding to appropriate common/dedicated
- * channel's handler */
-EXTERN uint8_t RlcProcUlData ARGS((
-   Pst*           pst,
-   RlcMacData   *ulData
-));
-
-/** @brief Data Indication from MAC to RLC to 
- * forward the data received for common channels*/
-EXTERN S16 RlcLiRguCDatInd ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RguCDatIndInfo  *    datInd
-));
-/** @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels*/
-EXTERN S16 RlcLiRguDDatInd ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RguDDatIndInfo  *    datInd
-));
 /** @brief Primitive invoked from RLC to MAC to 
  * inform the BO report for common channels*/
 EXTERN S16 RlcLiRguCStaRsp ARGS((
@@ -733,39 +638,6 @@ EXTERN S16 RlcLiRguCStaRsp ARGS((
    SpId                 spId,
    RguCStaRspInfo  *    staRsp
 ));
-/** @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels*/
-EXTERN S16 RlcMacSendBOStatus ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacBOStatus*      boSta
-));
-
-/**@brief Primitive invoked from MAC to RLC to
- * inform scheduling result for logical channels */
-EXTERN uint16_t RlcMacProcSchedRep ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RlcMacSchedRepInfo       *schRep
-));
-/** @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on common channels. */
-EXTERN S16 RlcLiRguCStaInd ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RguCStaIndInfo  *    staInd
-));
-/** @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on dedicated channels. */
-EXTERN S16 RlcLiRguDStaInd ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RguDStaIndInfo  *    staInd
-));
 
 #ifdef LTE_L2_MEAS
 /** @brief HARQ Status Indication from MAC to RLC  
@@ -848,20 +720,7 @@ EXTERN S16 cmUnpkRguCDatReq ARGS((
    Pst*                 pst,
    Buffer               *mBuf
 ));
-/** @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission */
-EXTERN uint16_t packDlData ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacData      *    datReq
-));
-/** @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission */
-EXTERN S16 unpackDlData ARGS((
-   RlcMacDlData         func,
-   Pst*                 pst,
-   Buffer               *mBuf
-));
+
 /** @brief Data Indication from MAC to RLC to 
  * forward the data received for common channels*/
 EXTERN S16 cmPkRguCDatInd ARGS((
@@ -876,19 +735,7 @@ EXTERN S16 cmUnpkRguCDatInd ARGS((
    Pst*                 pst,
    Buffer               *mBuf
 ));
-/** @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels*/
-EXTERN uint8_t packRlcUlData ARGS((
-   Pst*                 pst,
-   RlcMacData  *    ulData
-));
-/** @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels*/
-EXTERN uint8_t unpackRcvdUlData ARGS((
-   RlcMacUlDataFunc     func,
-   Pst*                 pst,
-   Buffer               *mBuf
-));
+
 /** @brief Primitive invoked from RLC to MAC to 
  * inform the BO report for common channels*/
 EXTERN S16 cmPkRguCStaRsp ARGS((
@@ -903,20 +750,7 @@ EXTERN S16 cmUnpkRguCStaRsp ARGS((
    Pst*                 pst,
    Buffer               *mBuf
 ));
-/** @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels*/
-EXTERN uint16_t packBOStatus ARGS((
-   Pst*                 pst,
-   SpId                 spId,
-   RlcMacBOStatus*      boStatus
-));
-/** @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels*/
-EXTERN uint16_t unpackBOStatus ARGS((
-   RlcMacBoStatus       func,
-   Pst*                 pst,
-   Buffer               *mBuf
-));
+
 /** @brief Status Indication from MAC to RLC  
  * as a response to the staRsp primitive from RLC.
  * Informs RLC of the totalBufferSize and Timing Info 
@@ -935,15 +769,7 @@ EXTERN S16 cmUnpkRguCStaInd ARGS((
    Pst*                 pst,
    Buffer               *mBuf
 ));
-/** @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on dedicated channels. */
-EXTERN S16 packSchedRep ARGS((
-   Pst*                 pst,
-   SuId                 suId,
-   RlcMacSchedRepInfo   *staInd
-));
+
 EXTERN S16 cmPkRguFlowCntrlInfo ARGS((
 RguFlowCntrlInd *param, 
 Buffer           *mBuf
@@ -968,15 +794,7 @@ EXTERN S16 cmUnpkRguFlowCntrlInfo ARGS((
 RguFlowCntrlInd *param, 
 Buffer           *mBuf
 ));
-/** @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on dedicated channels. */
-EXTERN S16 unpackSchedRep ARGS((
-   RlcMacSchedRep       func,
-   Pst*                 pst,
-   Buffer               *mBuf
-));
+
 EXTERN S16 cmPkRguPduInfo ARGS((
    RguPduInfo           *param,
    Buffer               *mBuf
@@ -1069,14 +887,6 @@ EXTERN S16 cmUnpkRguLchDatInd ARGS((
    RguLchDatInd         *param,
    Buffer               *mBuf
 ));
-EXTERN S16 packRlcMacDataInfo ARGS((
-   RlcMacData         *param,
-   Buffer               *mBuf
-));
-EXTERN S16 unpackRlcMacDataInfo ARGS((
-   RlcMacData       *param,
-   Buffer               *mBuf
-));
 
 EXTERN S16 cmPkRguCStaRspInfo ARGS((
    RguCStaRspInfo       *param,
@@ -1086,14 +896,7 @@ EXTERN S16 cmUnpkRguCStaRspInfo ARGS((
    RguCStaRspInfo       *param,
    Buffer               *mBuf
 ));
-EXTERN S16 packBOStatusInfo ARGS((
-   RlcMacBOStatus       *param,
-   Buffer               *mBuf
-));
-EXTERN S16 unpackBOStatusInfo ARGS((
-   RlcMacBOStatus       *param,
-   Buffer               *mBuf
-));
+
 EXTERN S16 cmPkRguCStaIndInfo ARGS((
    RguCStaIndInfo       *param,
    Buffer               *mBuf
@@ -1110,15 +913,7 @@ EXTERN S16 cmUnpkRguLchStaInd ARGS((
    RguLchStaInd         *param,
    Buffer               *mBuf
 ));
-EXTERN S16 packSchedRepInfo ARGS((
-   RlcMacSchedRepInfo   *param,
-   Buffer               *mBuf
-));
-EXTERN S16 unpackSchedRepInfo ARGS((
-   RlcMacSchedRepInfo   *param,
-   Buffer               *mBuf
-));
-  
+
 /*rgu_x_001.main_3 - ADD - L2M  & R9 Support */
 #ifdef LTE_L2_MEAS
 /** @brief Request from MAC to RLC for forwarding HARQ Status */
diff --git a/src/cm/rlc_mac_inf.c b/src/cm/rlc_mac_inf.c
new file mode 100644 (file)
index 0000000..c431c68
--- /dev/null
@@ -0,0 +1,298 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+/* This file define APIs at RLC-MAC interface */
+#include "common_def.h"
+#include "rlc_mac_inf.h"
+
+/**
+ * @brief Primitive invoked from RLC to MAC to 
+ * inform the BO report for dedicated channels
+ *
+ * @details
+ *
+ *     Function : packBOStatus,
+ *
+ *  @param[in]   Pst*  pst
+ *  @param[in]   RlcMacBOStatus  *  staRsp
+ *  @return   S16
+ *      -# ROK
+ **/
+uint8_t packRlcBoStatus(Pst* pst, RlcBoStatus  *boStatus)
+{
+   Buffer *mBuf = NULLP;
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      DU_LOG("\nRLC: Memory allocation failed at packBOStatus");
+      return RFAILED;
+   }
+
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      /* light weight loose coupling */
+      CMCHKPK(oduPackPointer,(PTR) boStatus, mBuf);
+   }
+   else
+   {
+      /* light coupling */
+      return RFAILED;
+   }
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/**
+ * @brief Primitive invoked from RLC to MAC to 
+ * inform the BO report for dedicated channels
+ *
+ * @details
+ *
+ *     Function : unpackBOStatus
+ *
+ *  @param[in]   Pst*  pst
+ *  @param[in]   RlcMacBOStatus *  staRsp
+ *  @return   S16
+ *      -# ROK
+ **/
+uint8_t unpackRlcBoStatus(RlcMacBoStatusFunc func, Pst *pst, Buffer *mBuf)
+{
+   RlcBoStatus *boSta;
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+       /* Light weight loose coupling */
+       CMCHKUNPK(oduUnpackPointer,(PTR *) &boSta, mBuf);
+   }
+   else
+   {
+      /* Light Coupling */
+      return RFAILED;
+   }
+   ODU_PUT_MSG_BUF(mBuf);
+   return (*func)(pst, boSta);
+}
+
+/**
+ * @brief Status Indication from MAC to RLC  
+ * as a response to the staRsp primitive from RLC.
+ * Informs RLC of the totalBufferSize and Timing Info 
+ * for the transmission on dedicated channels.
+ *
+ * @details
+ *
+ *     Function : packSchedRep
+ *
+ *  @param[in]   Pst*  pst
+ *  @param[in]   SuId  suId
+ *  @param[in]   RlcMacSchedRep*  schRep
+ *  @return   S16
+ *      -# ROK
+ **/
+uint8_t packRlcSchedResultRpt(Pst* pst, RlcSchedResultRpt *schRep)
+{
+   Buffer *mBuf = NULLP;
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      DU_LOG("\nMAC: Memory allocation failed at packSchResultRep");
+      return RFAILED;
+   }
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      CMCHKPK(oduPackPointer,(PTR) schRep, mBuf);
+   }
+   else
+   {
+      return RFAILED;
+   }
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/**
+ * @brief Status Indication from MAC to RLC  
+ * as a response to the staRsp primitive from RLC.
+ * Informs RLC of the totalBufferSize and Timing Info 
+ * for the transmission on dedicated channels.
+ *
+ * @details
+ *
+ *     Function : unpackSchResultRpt
+ *
+ *  @param[in]   Pst*  pst
+ *  @param[in]   SuId  suId
+ *  @param[in]   RguDStaIndInfo  *  staInd
+ *  @return   S16
+ *      -# ROK
+ **/
+uint8_t unpackSchedResultRpt(RlcMacSchedResultRptFunc func, Pst *pst, Buffer *mBuf)
+{
+   RlcSchedResultRpt *schRep;
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &schRep, mBuf);
+   }
+   else
+   {
+      return RFAILED;
+   }
+   ODU_PUT_MSG_BUF(mBuf);
+   return (*func)(pst, schRep);
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send DL Data from RLC to MAC
+ *
+ * @details
+ *
+ *    Function : packRlcDlData
+ *
+ *    Functionality: Pack and send DL Data from RLC to MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packRlcDlData(Pst* pst, RlcData *dlData)
+{
+   Buffer *mBuf = NULLP;
+
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      DU_LOG("\nRLC: Memory allocation failed at packRlcDlData");
+      return RFAILED;
+   }
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+       CMCHKPK(oduPackPointer,(PTR) dlData, mBuf);
+   }
+   else
+   {
+      return RFAILED;
+   }
+   return ODU_POST_TASK(pst,mBuf);
+
+}
+
+/*******************************************************************
+ *
+ * @brief unpack RLC DL data
+ *
+ * @details
+ *
+ *    Function : unpackRlcDlData
+ *
+ *    Functionality: unpack RLC DL data
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackRlcDlData(RlcMacDlDataFunc func, Pst *pst, Buffer *mBuf)
+{
+   RlcData *dlData;
+
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      CMCHKUNPK(oduUnpackPointer, (PTR *) &dlData, mBuf);
+   }
+   else
+   {
+      return RFAILED;
+   }
+   ODU_PUT_MSG_BUF(mBuf);
+   return((*func)(pst, dlData));
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send UL data from MAC to RLC
+ *
+ * @details
+ *
+ *    Function : packRlcUlData
+ *
+ *    Functionality: Pack and send UL data from MAC to RLC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packRlcUlData(Pst* pst, RlcData *ulData)
+{
+   Buffer *mBuf = NULLP;
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
+   {
+      DU_LOG("\nMAC : Memory allocation failed at packRlcUlData");
+      return RFAILED;
+   }
+
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      CMCHKPK(oduPackPointer,(PTR)ulData, mBuf);
+   }
+   else
+   {
+      return RFAILED;
+   }
+   pst->event = (Event)EVENT_UL_DATA_TO_RLC;
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack RLC UL data
+ *
+ * @details
+ *
+ *    Function : unpackRlcUlData
+ *
+ *    Functionality: Unpack RLC UL data
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackRlcUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf)
+{
+   RlcData *ulData;
+   if (pst->selector == ODU_SELECTOR_LWLC)
+   {
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &ulData, mBuf);
+   }
+   else 
+   {
+      return RFAILED;
+   }
+   ODU_PUT_MSG_BUF(mBuf);
+   return (*func)(pst, ulData);
+}
+
+/**********************************************************************
+         End of file
+**********************************************************************/
diff --git a/src/cm/rlc_mac_inf.h b/src/cm/rlc_mac_inf.h
new file mode 100644 (file)
index 0000000..1a61b7d
--- /dev/null
@@ -0,0 +1,104 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+/* This file containes define for RLC-MAC interface */
+
+/* RLC instances */
+#define RLC_UL_INST  0
+#define RLC_DL_INST  1
+
+/* Event */
+#define EVENT_BO_STATUS_TO_MAC   15
+#define EVENT_SCHED_RESULT_TO_RLC  16 
+#define EVENT_DL_DATA_TO_MAC     17
+#define EVENT_UL_DATA_TO_RLC     18
+
+/* MACRO defines */
+#define MAX_NUM_PDU     16
+
+/* Buffer occupancy status information */
+typedef struct rlcBoStatus
+{
+   uint16_t   cellId;     /*!< CELL ID */
+   uint16_t   ueIdx;      /*!< UE ID */
+   bool       commCh;     /*!< Common or Dedicated Channel */
+   uint8_t    lcId;       /*!< Logical channel ID */
+   uint16_t   bo;         /*!< Buffer occupancy reported by RLC */
+}RlcBoStatus;
+
+/* Scheduled logical channel info */
+typedef struct rlcLcSchInfo
+{
+   bool      commCh;      /* Common or dedicated channel */
+   uint8_t   lcId;        /*!< Logical channel ID */
+   uint16_t  bufSize;  /*!< Total buffer size in bytes scheduled by MAC */
+}RlcLcSchInfo;
+
+/* Schedule result report */
+typedef struct rlcSchedResultRpt
+{
+   //Slot info
+   uint16_t       cellId;       /*!< CELL ID */
+   uint16_t       rnti;         /*!< Temporary CRNTI */
+   uint8_t        numLc;        /*!< Number of logical channels scheduled */
+   SlotIndInfo    slotInfo;     /*!< Timing info */
+   RlcLcSchInfo   lcSch[MAX_NUM_LC];  /*!< Scheduled info of logical channels */
+}RlcSchedResultRpt;
+
+/* DL/UL data transfer */
+typedef struct rlcPduInfo
+{
+   bool       commCh;   /*!<Common or Dedicated Channel */
+   uint8_t    lcId;     /*!< Logical channel ID */
+   uint16_t   pduLen;   /*!< PDU Length */
+   uint8_t    *pduBuf;  /*!< RLC PDU buffer */
+}RlcPduInfo;
+typedef struct rlcMacData
+{
+   // add slot info
+   uint16_t     cellId;       /*!< CELL ID */
+   uint16_t     rnti;         /*!< Temporary CRNTI */
+   SlotIndInfo  slotInfo;     /*!< Timing info */
+   uint8_t      numPdu;       /*!< Number of RLC PDUs */
+   RlcPduInfo   pduInfo[MAX_NUM_PDU];
+}RlcData;
+
+/* Function pointers */
+typedef uint8_t (*RlcMacBoStatusFunc)(Pst* pst, RlcBoStatus  *boStatus);
+typedef uint8_t (*RlcMacSchedResultRptFunc)(Pst *pst, RlcSchedResultRpt *schRpt);
+typedef uint8_t (*RlcMacDlDataFunc)(Pst* pst, RlcData *dlData);
+typedef uint8_t (*RlcMacUlDataFunc)(Pst* pst, RlcData *ulData);
+
+/* Function declarations */
+uint8_t packRlcBoStatus(Pst* pst, RlcBoStatus*  boStatus);
+uint8_t unpackRlcBoStatus(RlcMacBoStatusFunc func, Pst* pst, Buffer *mBuf);
+uint8_t MacProcRlcBoStatus(Pst* pst, RlcBoStatus* boStatus);
+uint8_t packRlcSchedResultRpt(Pst* pst, RlcSchedResultRpt *schRpt);
+uint8_t unpackSchedResultRpt(RlcMacSchedResultRptFunc func, Pst *pst, Buffer *mBuf);
+uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRpt);
+uint8_t packRlcDlData(Pst* pst, RlcData *datReq);
+uint8_t unpackRlcDlData(RlcMacDlDataFunc func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcRlcDlData(Pst* pst, RlcData *dlData);
+uint8_t packRlcUlData(Pst* pst, RlcData *ulData);
+uint8_t unpackRlcUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf);
+uint8_t RlcProcUlData(Pst* pst, RlcData *ulData);
+
+/**********************************************************************
+          End of file
+**********************************************************************/
+
index fb6220e..0d9c523 100644 (file)
@@ -2730,7 +2730,7 @@ void F1APMsgHdlr(Buffer *mBuf)
    ODU_PRINT_MSG(mBuf, 0,0);
 
    /* Copy mBuf into char array to decode it */
-   ODU_FIND_MSG_LEN(mBuf, &recvBufLen);
+   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
    CU_ALLOC(recvBuf, (Size)recvBufLen);
 
    if(recvBuf == NULLP)
index ff8f2d5..b5172a7 100644 (file)
@@ -520,7 +520,7 @@ S16 cuEgtpDecodeHdr(Buffer *mBuf)
    U8       extHdrLen = 0;        /* Extension hdr length */
    Bool     extPres = FALSE;      /* Flag for indication of S, E or P presense flag */
 
-   ODU_FIND_MSG_LEN(mBuf, &bufLen);
+   ODU_GET_MSG_LEN(mBuf, &bufLen);
 
    /* Decode version */
    ODU_REM_PRE_MSG(&tmpByte[0], mBuf);
@@ -676,7 +676,7 @@ S16 BuildAppMsg(EgtpMsg  *egtpMsg)
    MsgLen    mLen;
  
    mLen = 0;
-   ODU_FIND_MSG_LEN(mBuf, &mLen);
+   ODU_GET_MSG_LEN(mBuf, &mLen);
 
    cmMemset((U8 *)&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
    ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
@@ -785,7 +785,7 @@ S16 BuildEgtpMsg(EgtpMsg *egtpMsg)
       teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT3);
    }
  
-   ODU_FIND_MSG_LEN(egtpMsg->msg, &tPduSize);
+   ODU_GET_MSG_LEN(egtpMsg->msg, &tPduSize);
 
    /*Adjust the header to fill the correct length*/
    msgLen = tPduSize +  (EGTP_MAX_HDR_LEN - hdrLen) - 0x08;
index 8e11684..e427dc7 100644 (file)
 #define PHR_PROHIBHIT_TMR 0
 #define PHR_PWR_FACTOR_CHANGE 3
 #define PHR_MODE_OTHER_CG 0
-#define RLC_LCID 1 
-#define SRB_ID_1 1
 #define SN_FIELD_LEN 0
 #define T_POLL_RETRANSMIT 8 
 #define POLL_PDU 0
index d9e5a7f..125f00a 100644 (file)
@@ -1224,7 +1224,7 @@ void E2APMsgHdlr(Buffer *mBuf)
    ODU_PRINT_MSG(mBuf, 0,0);
  
    /* Copy mBuf into char array to decode it */
-   ODU_FIND_MSG_LEN(mBuf, &recvBufLen);
+   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
    DU_ALLOC(recvBuf, (Size)recvBufLen);
 
    if(recvBuf == NULLP)
index 6ec3555..3da1074 100644 (file)
@@ -572,7 +572,7 @@ uint8_t egtpHdlDatInd(EgtpMsg egtpMsg)
       teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT3);
    }
 
-   ODU_FIND_MSG_LEN(egtpMsg.msg, &tPduSize);
+   ODU_GET_MSG_LEN(egtpMsg.msg, (int16_t *)&tPduSize);
 
    /*Adjust the header to fill the correct length*/
    msgLen = tPduSize +  (EGTP_MAX_HDR_LEN - hdrLen) - 0x08;
@@ -752,7 +752,8 @@ uint8_t egtpSendMsg(Buffer *mBuf)
    dstAddr.port = EGTP_DFLT_PORT;
    dstAddr.address = egtpCb.dstCb.dstIp;
 
-   ret = cmInetSendMsg(&(egtpCb.dstCb.sendTptSrvr.sockFd), &dstAddr, &info, mBuf, &txLen, CM_INET_NO_FLAG);
+   ret = cmInetSendMsg(&(egtpCb.dstCb.sendTptSrvr.sockFd), &dstAddr, &info, \
+      mBuf, (int16_t *)&txLen, CM_INET_NO_FLAG);
    if(ret != ROK && ret != RWOULDBLOCK)
    {
       DU_LOG("\nEGTP : Failed sending the message");
@@ -825,7 +826,8 @@ uint8_t egtpRecvMsg()
    while(nMsg < EGTP_MAX_MSG_RECV)
    {
       bufLen = -1;
-      ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &fromAddr, &memInfo, &recvBuf, &bufLen, CM_INET_NO_FLAG);
+      ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &fromAddr, &memInfo, \
+         &recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG);
       if(ret == ROK && recvBuf != NULLP)
       {  
          DU_LOG("\nEGTP : Received DL Message[%d]\n", nMsg+1);
@@ -861,7 +863,7 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    uint8_t       extHdrLen = 0;        /* Extension hdr length */
    bool     extPres = FALSE;      /* Flag for indication of S, E or P presense flag */
  
-   ODU_FIND_MSG_LEN(mBuf, &bufLen);
+   ODU_GET_MSG_LEN(mBuf, (int16_t *)&bufLen);
  
    /* Decode first byte and storing in temporary variable */
    ODU_REM_PRE_MSG(&tmpByte[0], mBuf);
index cf4be45..c16921b 100644 (file)
@@ -74,7 +74,6 @@
 #include "du_f1ap_msg_hdl.h"
 
 extern DuCfgParams duCfgParam;
-uint8_t ServedCellListreturn=RFAILED;
 
 uint8_t procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg);
 uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg);
@@ -959,23 +958,21 @@ void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
            {
               if(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf !=  NULLP)
               {
+                 DU_FREE(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf,\
+                    f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.size);
                  idx1++;
                  if(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_Name.buf != NULLP)
                  {
-                    idx1=4;
-                    if(ServedCellListreturn == ROK)
-                    {
-                       FreeRrcVer(&f1SetupReq->protocolIEs.list.array[idx1]->value.choice.RRC_Version);
-                    }
-                    idx1--;
-                    FreeServedCellList(&f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_Served_Cells_List);
-                    idx1--;
                     DU_FREE(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_Name.buf,
-                          strlen((char *)duCfgParam.duName));
+                       strlen((char *)duCfgParam.duName));
+
+                    idx1++;
+                    FreeServedCellList(&f1SetupReq->protocolIEs.list.array[idx1]->value.\
+                       choice.GNB_DU_Served_Cells_List);
+
+                    idx1++;
+                    FreeRrcVer(&f1SetupReq->protocolIEs.list.array[idx1]->value.choice.RRC_Version);
                  }
-                 idx1--;
-                 DU_FREE(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf,\
-                       f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.size);
               }
            }
            for(idx=0; idx<f1SetupReq->protocolIEs.list.count; idx++)
@@ -1123,9 +1120,8 @@ uint8_t BuildAndSendF1SetupReq()
       f1SetupReq->protocolIEs.list.array[idx2]->value.present = \
                                                                F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
       duServedCell = &f1SetupReq->protocolIEs.list.\
-                    array[idx2]->value.choice.GNB_DU_Served_Cells_List;
-      ServedCellListreturn = BuildServedCellList(duServedCell);
-      if(ServedCellListreturn != ROK)
+                  array[idx2]->value.choice.GNB_DU_Served_Cells_List;
+      if((BuildServedCellList(duServedCell)) != ROK)
       {
         break;
       }
@@ -2457,17 +2453,20 @@ uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddMod
    }
 
    idx = 0;
-   rlcBearerList->list.array[idx]->logicalChannelIdentity = RLC_LCID;
+   rlcBearerList->list.array[idx]->logicalChannelIdentity = SRB1_LCID;
 
-   DU_ALLOC(rlcBearerList->list.array[idx]->servedRadioBearer, sizeof(struct RLC_BearerConfig__servedRadioBearer));
+   DU_ALLOC(rlcBearerList->list.array[idx]->servedRadioBearer, \
+      sizeof(struct RLC_BearerConfig__servedRadioBearer));
    if(!rlcBearerList->list.array[idx]->servedRadioBearer)
    {
       DU_LOG("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
       return RFAILED;
    }
 
-   rlcBearerList->list.array[idx]->servedRadioBearer->present = RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
-   rlcBearerList->list.array[idx]->servedRadioBearer->choice.srb_Identity = SRB_ID_1;
+   rlcBearerList->list.array[idx]->servedRadioBearer->present = \
+      RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
+   rlcBearerList->list.array[idx]->servedRadioBearer->choice.srb_Identity = \
+      SRB1_LCID;
 
    rlcBearerList->list.array[idx]->reestablishRLC = NULLP;
    rlcBearerList->list.array[idx]->rlc_Config = NULLP;
@@ -2485,7 +2484,8 @@ uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddMod
    }
 
    rlcBearerList->list.array[idx]->mac_LogicalChannelConfig = NULLP;
-   DU_ALLOC(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, sizeof(struct LogicalChannelConfig));
+   DU_ALLOC(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, \
+      sizeof(struct LogicalChannelConfig));
    if(!rlcBearerList->list.array[idx]->mac_LogicalChannelConfig)
    {
       DU_LOG("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
@@ -6027,7 +6027,7 @@ void F1APMsgHdlr(Buffer *mBuf)
    ODU_PRINT_MSG(mBuf, 0,0);
 
    /* Copy mBuf into char array to decode it */
-   ODU_FIND_MSG_LEN(mBuf, &recvBufLen);
+   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
    DU_ALLOC(recvBuf, (Size)recvBufLen);
 
    if(recvBuf == NULLP)
index a02ec5c..c880613 100644 (file)
@@ -74,19 +74,19 @@ typedef enum
 typedef struct cellCfgParams
 {
    NrEcgi      nrEcgi;         /* ECGI */
-   uint16_t         nrPci;          /* PCI */
-   uint16_t         fiveGsTac;         /* 5gSTac */
-   Plmn      plmn[MAX_PLMN]; /* List of serving PLMN IDs */
-   uint32_t         maxUe;          /* max UE per slot */
+   uint16_t    nrPci;          /* PCI */
+   uint16_t    fiveGsTac;         /* 5gSTac */
+   Plmn        plmn[MAX_PLMN]; /* List of serving PLMN IDs */
+   uint32_t    maxUe;          /* max UE per slot */
 }CellCfgParams;
 
 typedef struct duUeCb
 {
-   uint32_t gnbDuUeF1apId; /* GNB DU UE F1AP ID */
-   uint32_t gnbCuUeF1apId; /* GNB CU UE F1AP ID */
-   UeState  ueState;
-   MacUeCfg macUeCfg;
-   RlcUeCfg rlcUeCfg;
+   uint32_t    gnbDuUeF1apId; /* GNB DU UE F1AP ID */
+   uint32_t    gnbCuUeF1apId; /* GNB CU UE F1AP ID */
+   UeState     ueState;
+   MacUeCfg    macUeCfg;
+   RlcUeCfg    rlcUeCfg;
 }DuUeCb;
 
 typedef struct duCellCb
@@ -107,8 +107,8 @@ typedef struct duLSapCb
    State       sapState;
    Mem         mem;
    CmTimer     timer;
-   uint8_t          bndRetryCnt;
-   uint8_t          maxBndRetry;
+   uint8_t     bndRetryCnt;
+   uint8_t     maxBndRetry;
    TmrCfg      bndTmr;
 }DuLSapCb;
 
index fce7500..76fabd6 100644 (file)
@@ -71,7 +71,7 @@ uint8_t duActvInit(Ent entity, Inst inst, Region region, Reason reason)
 
    memset(&duCb, 0, sizeof(DuCb));
 
-   duCb.init.procId  = SFndProcId();
+   duCb.init.procId  = ODU_GET_PROCID();
    duCb.init.ent     = entity;
    duCb.init.inst    = inst;
    duCb.init.region  = region;
@@ -168,11 +168,6 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
                  {
                     break;
                  }
-              case KWU_EVT_DAT_IND:
-                 {
-                    ret = cmUnpkKwuDatInd(duHdlRlcUlData, pst, mBuf);
-                    break;
-                 }
               case EVENT_RLC_UL_UE_CREATE_RSP:
                  {
                     ret = unpackRlcUlUeCreateRsp(DuProcRlcUlUeCreateRsp, pst, mBuf);
index 6483dca..9964bbe 100644 (file)
@@ -1203,12 +1203,6 @@ uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
    if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK)
    {
       DU_LOG("\nDU_APP : Tunnel management confirm OK");
-
-#ifdef EGTP_TEST
-      duSendUeCreateReqToRlc();
-
-      duSendEgtpTestData();
-#endif      
    }
    else
    {
@@ -1282,7 +1276,7 @@ uint8_t duSendEgtpTestData()
    MsgLen    mLen;
 
    mLen = 0;
-   ODU_FIND_MSG_LEN(mBuf, &mLen);
+   ODU_GET_MSG_LEN(mBuf, &mLen);
 
    memset((uint8_t *)&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
    ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
index 9df6cc9..19a26c7 100644 (file)
@@ -624,7 +624,7 @@ uint8_t  processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32
 {
    uint8_t ret = ROK;
    CM_INET_FD_SET(sockFd, &pollParams->readFd);
-   ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFd);
+   ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, (int16_t *)&pollParams->numFd);
    if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd))
    {
       CM_INET_FD_CLR(sockFd, &pollParams->readFd);
index 5d790bd..b0e9205 100644 (file)
@@ -119,34 +119,6 @@ uint8_t duHdlEgtpDlData(EgtpMsg  *egtpMsg)
    return ROK;
 }
 
-/*******************************************************************
- *
- * @brief Handles UL data and send to CU
- *
- * @details
- *
- *    Function : duHdlRlcUlData
- *
- *    Functionality: 
- *     Processes UL Data from RLC and sends to CU
- * 
- *  @params[in]  Pointer to EGTP Message 
- *  @return ROK     - success
- *          RFAILED - failure
- * 
- *****************************************************************/
-
-uint8_t duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)
-{
-   DU_LOG("\nDU_APP : Received UL Data at DU_APP");
-
-   /* Send UL data to CU via EGTP */
-   duSendEgtpDatInd(mBuf);
-   ODU_PUT_MSG_BUF(mBuf);
-
-   return ROK;
-}
-
 /******************************************************************
  *
  * @brief Builds and Sends DL CCCH Ind to MAC
@@ -163,7 +135,7 @@ uint8_t duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)
  *
  * ****************************************************************/
 uint8_t duBuildAndSendDlCcchInd(uint16_t *cellId, uint16_t *crnti, \
-      DlCcchMsgType msgType, uint8_t *dlCcchMsg, uint16_t dlCcchMsgSize)
+      DlCcchMsgType msgType, uint16_t dlCcchMsgSize, uint8_t *dlCcchMsg)
 {
    uint8_t ret                  = ROK;
    uint16_t idx2;
@@ -237,7 +209,7 @@ uint8_t duBuildAndSendDlCcchInd(uint16_t *cellId, uint16_t *crnti, \
  *
  * ****************************************************************/
 uint8_t duBuildAndSendDlRrcMsgToRlc(uint16_t cellId, RlcUeCfg ueCfg, \
-   uint8_t lcId, bool deliveryStaReq, uint16_t rrcMsgLen, uint8_t *rrcMsg)
+   uint8_t lcId, bool execDup, bool deliveryStaReq, uint16_t rrcMsgLen, uint8_t *rrcMsg)
 {
    Pst  pst;
    uint8_t ret;
@@ -256,7 +228,7 @@ uint8_t duBuildAndSendDlRrcMsgToRlc(uint16_t cellId, RlcUeCfg ueCfg, \
    /* Filling up the RRC msg info */
    dlRrcMsgInfo->cellId = cellId;
    dlRrcMsgInfo->ueIdx = ueCfg.ueIdx;
-   for(lcIdx = 0; lcIdx <= MAX_NUM_LOGICAL_CHANNELS; lcIdx++)
+   for(lcIdx = 0; lcIdx <= MAX_NUM_LC; lcIdx++)
    {
       if(ueCfg.rlcBearerCfg[lcIdx].lcId == lcId)
       {
@@ -267,7 +239,7 @@ uint8_t duBuildAndSendDlRrcMsgToRlc(uint16_t cellId, RlcUeCfg ueCfg, \
         break;
       }
    }
-   dlRrcMsgInfo->execDup = false;
+   dlRrcMsgInfo->execDup = execDup;
    dlRrcMsgInfo->deliveryStaRpt = deliveryStaReq;
    dlRrcMsgInfo->rrcMsg = rrcMsg;
    dlRrcMsgInfo->msgLen = rrcMsgLen;
@@ -304,7 +276,7 @@ uint8_t duBuildAndSendDlRrcMsgToRlc(uint16_t cellId, RlcUeCfg ueCfg, \
 uint8_t procUeContextSetupReq(F1AP_PDU_t *f1apMsg)
 {
    uint8_t    ret = ROK;
-   uint8_t    ieIdx, byteIdx, ueIdx;
+   uint8_t    ieIdx, ueIdx;
    uint8_t    *rrcMsg = NULLP;
    uint16_t   rrcMsgLen;
    uint16_t   cellId, cellIdx;
@@ -339,6 +311,11 @@ uint8_t procUeContextSetupReq(F1AP_PDU_t *f1apMsg)
          case ProtocolIE_ID_id_RRCContainer: 
             {
                rrcMsgLen = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size;
+              if(rrcMsgLen <= 0)
+              {
+                 DU_LOG("\nDU APP : Invalid RRC Msg Length %d in Ue Ctxt Setup Req", rrcMsgLen);
+                 return RFAILED;
+              }
                DU_ALLOC_SHRABL_BUF(rrcMsg, rrcMsgLen);
               if(!rrcMsg)
               {
@@ -378,8 +355,8 @@ uint8_t procUeContextSetupReq(F1AP_PDU_t *f1apMsg)
    /* Sending DL RRC Message to RLC */
    if(ueIdx != MAX_NUM_UE)
    {
-      ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, SRB_ID_1, \
-               deliveryStaReq,  rrcMsgLen, rrcMsg); 
+      ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, SRB1_LCID, \
+               false, deliveryStaReq,  rrcMsgLen, rrcMsg); 
    }
    else
    {
@@ -410,77 +387,97 @@ uint8_t procUeContextSetupReq(F1AP_PDU_t *f1apMsg)
 uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
 {
    DLRRCMessageTransfer_t *dlRrcMsg = NULLP;
-   uint8_t                *dlCcchMsg = NULLP;
-   uint8_t                idx, ret, srbId;
-   uint16_t               idx2, crnti, cellId, dlCcchMsgSize;
+   uint8_t                *rrcMsgPdu = NULLP;
+   uint8_t                ieIdx, ueIdx, cellIdx;
+   uint8_t                ret, srbId;
+   uint16_t               byteIdx, crnti, cellId, rrcMsgSize;
    uint32_t               gnbCuUeF1apId, gnbDuUeF1apId;
-
+   bool                   execDup = false;
+   bool                   deliveryStaRpt = false;
+   bool                   ueFound = false;
+   bool                   ueCcchCtxtFound = false; 
 
    DU_LOG("\nDU_APP : DL RRC message transfer Recevied");
    dlRrcMsg = &f1apMsg->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
 
    ret = ROK;
 
-   for(idx=0; idx<dlRrcMsg->protocolIEs.list.count; idx++)
+   for(ieIdx=0; ieIdx<dlRrcMsg->protocolIEs.list.count; ieIdx++)
    {
-      switch(dlRrcMsg->protocolIEs.list.array[idx]->id)
+      switch(dlRrcMsg->protocolIEs.list.array[ieIdx]->id)
       {
         case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
            {
-              gnbCuUeF1apId = dlRrcMsg->protocolIEs.list.array[idx]->value.choice.GNB_CU_UE_F1AP_ID;
+              gnbCuUeF1apId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
               break;
            }
         case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
            {
-              gnbDuUeF1apId = dlRrcMsg->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
+              gnbDuUeF1apId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
               break;
            }
         case ProtocolIE_ID_id_SRBID:
            {
-              srbId = dlRrcMsg->protocolIEs.list.array[idx]->value.choice.SRBID;
+              srbId = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.SRBID;
               break;
            }
         case ProtocolIE_ID_id_ExecuteDuplication:
-           break;
-
+           {
+              execDup = true;
+              break;
+           }
         case ProtocolIE_ID_id_RRCContainer:
            {
-              if(dlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size > 0)
+              if(dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size > 0)
               {
-                 dlCcchMsgSize = dlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size;
-                 DU_ALLOC(dlCcchMsg, dlCcchMsgSize);
-                 for(idx2 = 0; idx2 < dlCcchMsgSize; idx2++)
+                 rrcMsgSize = dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size;
+                 DU_ALLOC(rrcMsgPdu, rrcMsgSize);
+                 if(!rrcMsgPdu)
+                 {
+                     DU_LOG("\nDU_APP : Memory allocation failed in procDlRrcMsgTrans"); 
+                     return RFAILED;
+                 }
+                 for(byteIdx = 0; byteIdx < rrcMsgSize; byteIdx++)
                  {
-                    dlCcchMsg[idx2] = \
-                       dlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf[idx2];
+                    rrcMsgPdu[byteIdx] = \
+                       dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf[byteIdx];
                  }
               }
               else
               {
                  DU_LOG("\nDU_APP : RRC Container Size is invalid:%ld",\
-                       dlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size);
+                       dlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
+                  return RFAILED;
               }
               break;
            }
-
+         case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+           {
+              deliveryStaRpt = true;
+              break;
+           }
         default:
            DU_LOG("\nDU_APP : Invalid IE received in DL RRC Msg Transfer:%ld",
-                 dlRrcMsg->protocolIEs.list.array[idx]->id);
+                 dlRrcMsg->protocolIEs.list.array[ieIdx]->id);
       }
    }
 
-   for(idx=0; idx<duCb.numUe; idx++)
+   if(srbId == SRB1_LCID) //RRC connection setup
    {
-      if(gnbDuUeF1apId == duCb.ueCcchCtxt[idx].gnbDuUeF1apId)
+      for(ueIdx=0; ueIdx < duCb.numUe; ueIdx++)
       {
-        crnti  = duCb.ueCcchCtxt[idx].crnti;
-        cellId = duCb.ueCcchCtxt[idx].cellId;
-        break;
+         if(gnbDuUeF1apId == duCb.ueCcchCtxt[ueIdx].gnbDuUeF1apId)
+         {
+           ueCcchCtxtFound = true;
+           crnti  = duCb.ueCcchCtxt[ueIdx].crnti;
+           cellId = duCb.ueCcchCtxt[ueIdx].cellId;
+           break;
+         }
       }
    }
-   if(srbId == SRB_ID_1) //RRC connection setup
+   if(ueCcchCtxtFound)
    {
-      ret = duBuildAndSendDlCcchInd(&cellId, &crnti, RRC_SETUP, dlCcchMsg, dlCcchMsgSize);
+      ret = duBuildAndSendDlCcchInd(&cellId, &crnti, RRC_SETUP, rrcMsgSize, rrcMsgPdu);
       if(ret)
       {
         DU_LOG("\nDU_APP: Falied at duBuildAndSendDlCcchInd()");
@@ -489,10 +486,11 @@ uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
       {
         if(duCb.actvCellLst[cellId-1]->numActvUes < MAX_NUM_UE)
         {
-           ret = duCreateUeCb(&duCb.ueCcchCtxt[idx], gnbCuUeF1apId);
+           ret = duCreateUeCb(&duCb.ueCcchCtxt[ueIdx], gnbCuUeF1apId);
            if(ret)
            {
-              DU_LOG("\nDU_APP: Failed at duCreateUeCb for cellId [%d]", duCb.ueCcchCtxt[idx].cellId);
+              DU_LOG("\nDU_APP: Failed at duCreateUeCb for cellId [%d]", \
+                    duCb.ueCcchCtxt[ueIdx].cellId);
               ret = RFAILED;
            }
         }
@@ -502,7 +500,29 @@ uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
            ret = RFAILED;
         }
       }
-   }            
+   }
+   else
+   {
+      for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+      {
+        for(ueIdx = 0 ; ueIdx < MAX_NUM_UE; ueIdx++)
+        {
+           if((gnbCuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId)
+                 && (gnbDuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId))
+           {
+              ueFound = true;
+              ret = duBuildAndSendDlRrcMsgToRlc(duCb.actvCellLst[cellIdx]->cellId, \
+                    duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg, srbId, \
+                    execDup, deliveryStaRpt,  rrcMsgSize, rrcMsgPdu);
+              break; 
+           }
+        }
+        if(ueFound)
+           break;
+      }
+      if(!ueFound)
+        ret = RFAILED;
+   }
    return ret;
 }
 
@@ -872,7 +892,7 @@ void fillLcCfgList(LcCfg *lcCfgInfo)
 {
    if(lcCfgInfo)
    {
-      lcCfgInfo->lcId = SRB_ID_1;
+      lcCfgInfo->lcId = SRB1_LCID;
       lcCfgInfo->drbQos = NULLP;
       lcCfgInfo->snssai = NULLP;
       lcCfgInfo->ulLcCfg = NULLP;
@@ -947,8 +967,8 @@ void fillMacUeCfg(uint16_t cellId, uint8_t ueIdx,\
    /* Filling AMBR for UL and DL */ 
    ueCfg->maxAggrBitRate = NULLP;
    /* Filling LC Context */
-   ueCfg->numLcs = SRB_ID_1;
-   if(ueCfg->numLcs < MAX_NUM_LOGICAL_CHANNELS)
+   ueCfg->numLcs = SRB1_LCID;
+   if(ueCfg->numLcs < MAX_NUM_LC)
    {
       for(idx = 0; idx < ueCfg->numLcs; idx++)
       {   
@@ -1061,13 +1081,13 @@ void fillRlcBearerCfg(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *ueCfg)
    uint8_t idx;
    ueCfg->cellId       = cellId;
    ueCfg->ueIdx        = ueIdx;
-   ueCfg->numLcs       = SRB_ID_1
+   ueCfg->numLcs       = SRB1_LCID
 
    for(idx = 0; idx < ueCfg->numLcs; idx++)
    {
       ueCfg->rlcBearerCfg[idx].rbId         = RB_ID_SRB;
       ueCfg->rlcBearerCfg[idx].rbType       = RB_TYPE_SRB;
-      ueCfg->rlcBearerCfg[idx].lcId         = SRB_ID_1;
+      ueCfg->rlcBearerCfg[idx].lcId         = SRB1_LCID;
       ueCfg->rlcBearerCfg[idx].lcType       = LCH_DCCH;
       ueCfg->rlcBearerCfg[idx].rlcMode      = RLC_AM;
       switch(ueCfg->rlcBearerCfg[idx].rlcMode)
@@ -1330,6 +1350,7 @@ uint8_t DuProcRlcUlUeCreateRsp(Pst *pst, RlcUeCfgRsp *cfgRsp)
    }
    return ret;
 }
+
 /**********************************************************************
   End of file
  ***********************************************************************/
index 85a10f1..00cdacf 100644 (file)
@@ -356,6 +356,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_
    {
       msg5Sent = true;
       type = MSG_TYPE_MSG5;
+      msg5ShortBsrSent = false;
    }
 
 
index e1cd898..7484edd 100644 (file)
@@ -542,7 +542,7 @@ void E2APMsgHdlr(Buffer *mBuf)
    ODU_PRINT_MSG(mBuf, 0,0);
  
    /* Copy mBuf into char array to decode it */
-   ODU_FIND_MSG_LEN(mBuf, &recvBufLen);
+   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
    RIC_ALLOC(recvBuf, (Size)recvBufLen);
 
    if(recvBuf == NULLP)