[Epic-ID: ODUHIGH-404][Task-ID: ODUHIGH-413] Modification of E2setup request and...
[o-du/l2.git] / src / du_app / du_msg_hdl.c
index 24ae6e0..dda60e2 100644 (file)
@@ -362,22 +362,24 @@ uint8_t duProcCfgComplete()
          memset(cell, 0, sizeof(DuCellCb));
          cell->cellId = ++cellId;
          memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
-         cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
-         cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
-         cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
-         cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
-         cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
+         cell->cellInfo.nrEcgi.plmn.mcc[0] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[0];
+         cell->cellInfo.nrEcgi.plmn.mcc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[1];
+         cell->cellInfo.nrEcgi.plmn.mcc[2] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[2];
+         cell->cellInfo.nrEcgi.plmn.mnc[0] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[0];
+         cell->cellInfo.nrEcgi.plmn.mnc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[1];
+         cell->cellInfo.nrEcgi.plmn.mnc[2] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[2];
          cell->cellInfo.nrEcgi.cellId = cell->cellId;
-         cell->cellInfo.nrPci = NR_PCI
-         cell->cellInfo.fiveGsTac = DU_TAC;
+         cell->cellInfo.nrPci = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci
+         cell->cellInfo.fiveGsTac = duCfgParam.srvdCellLst[0].duCellInfo.tac;
          memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
          for(idx1=0; idx1<MAX_PLMN; idx1++)
          {
-            cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
-            cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
-            cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
-            cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
-            cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
+            cell->cellInfo.plmn[idx1].mcc[0] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[0];
+            cell->cellInfo.plmn[idx1].mcc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[1];
+            cell->cellInfo.plmn[idx1].mcc[2] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[2];
+            cell->cellInfo.plmn[idx1].mnc[0] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[0];
+            cell->cellInfo.plmn[idx1].mnc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[1];
+            cell->cellInfo.plmn[idx1].mnc[2] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[2];
          }
          cell->cellInfo.maxUe = duCfgParam.maxUe;
          cell->cellStatus = CELL_OUT_OF_SERVICE;
@@ -979,15 +981,12 @@ uint8_t duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy)
    {
       if(BuildAndSendF1SetupReq() != ROK)
       {
-        return RFAILED;
+         return RFAILED;
       }
    }
    else if(ricParams.assocId == ntfy->u.assocChange.assocId)
    {
-      if(BuildAndSendE2SetupReq() != ROK)
-      {
-        return RFAILED;
-      }
+       return ROK;
    }
    else
    {
@@ -1710,13 +1709,12 @@ uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
   
    if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
       return RFAILED;
-   if(ulRrcMsgInfo->ueIdx > 0)
+   if(ulRrcMsgInfo->ueId > 0)
    {
-   ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1];
+   ueCb = cellCb->ueCb[ulRrcMsgInfo->ueId -1];
 
 
-   BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
-      ulRrcMsgInfo->rrcMsg);
+   BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, ulRrcMsgInfo->rrcMsg);
 
    DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
    DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
@@ -1749,7 +1747,7 @@ uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryRepor
    if(duGetCellCb(rrcDeliveryReport->cellId, &cellCb) != ROK)
       return RFAILED;
    
-   ueCb = cellCb->ueCb[rrcDeliveryReport->ueIdx -1];
+   ueCb = cellCb->ueCb[rrcDeliveryReport->ueId -1];
    ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
 
    DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
@@ -1774,7 +1772,7 @@ uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryRepor
  * ****************************************************************/
 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
 {
-   uint8_t  rbIdx;
+   uint8_t  teIdx = 0;
    EgtpMsg  egtpMsg;
    Buffer   *mBuf;
 
@@ -1788,14 +1786,15 @@ uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
    egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
 
    /* Fetch EGTP tunnel info */
-   for(rbIdx = 0; rbIdx < duCb.numDrb; rbIdx++)
+   for(teIdx = 0; teIdx < duCb.numTeId; teIdx++)
    {
-      if((duCb.upTnlCfg[rbIdx] != NULLP) && (duCb.upTnlCfg[rbIdx]->ueIdx == ulUserData->ueIdx) && \
-         (duCb.upTnlCfg[rbIdx]->drbId == ulUserData->rbId))
+      /*TODO: If multiple Cell Support is enables then CellId also needs to be validated alongwith ueId and DrbId*/
+      if((duCb.upTnlCfg[teIdx] != NULLP) && (duCb.upTnlCfg[teIdx]->ueId == ulUserData->ueId) && \
+         (duCb.upTnlCfg[teIdx]->drbId == ulUserData->rbId))
       {
-         if(duCb.upTnlCfg[rbIdx]->tnlCfg1)
+         if(duCb.upTnlCfg[teIdx]->tnlCfg1)
          {
-            egtpMsg.msgHdr.teId = duCb.upTnlCfg[rbIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
+            egtpMsg.msgHdr.teId = duCb.upTnlCfg[teIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
             break;
          }
       }