*******************************************************************************/
/* This file contains message handling functionality for DU APP */
-
+#include "common_def.h"
+#include "lrg.h"
+#include "legtp.h"
+#include "lkw.h"
+#include "lrg.x"
+#include "lkw.x"
+#include "du_cfg.h"
#include "du_mgr.h"
#include "du_sctp.h"
#include "du_f1ap_msg_hdl.h"
genCfg->lmPst.region = (inst == RLC_UL_INST) ?
RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
genCfg->lmPst.pool = RLC_POOL;
- genCfg->lmPst.selector = DU_SELECTOR_LC;
+ genCfg->lmPst.selector = ODU_SELECTOR_LC;
/* Fill Header */
kwMngmt.hdr.msgType = TCFG;
kwMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
kwMngmt.hdr.response.mem.pool = DU_POOL;
- kwMngmt.hdr.response.selector = DU_SELECTOR_LC;
+ kwMngmt.hdr.response.selector = ODU_SELECTOR_LC;
/* Fill Pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTKW;
pst.dstInst = inst;
kwMngmt.hdr.response.mem.pool = RLC_POOL;
/* Fill Pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTKW;
pst.dstProcId = DU_PROC;
lSap->ent = ENTRG;
lSap->inst = lsapInst;
lSap->sapId = lsapInst; /* SapId will be stored as suId in MAC */
- lSap->selector = (inst == RLC_UL_INST) ? DU_SELECTOR_LWLC : DU_SELECTOR_TC;
+ lSap->selector = (inst == RLC_UL_INST) ? ODU_SELECTOR_LWLC : ODU_SELECTOR_TC;
kwMngmt.hdr.elmId.elmnt = STRGUSAP;
DU_LOG("\nDU_APP : RLC MAC Lower Sap Cfg Req sent for inst %d", inst);
lSap->inst = (inst == RLC_UL_INST) ?
RLC_DL_INST : RLC_UL_INST;
lSap->sapId = 0;
- lSap->selector = DU_SELECTOR_LC;
+ lSap->selector = ODU_SELECTOR_LC;
kwMngmt.hdr.elmId.elmnt = STUDXSAP;
DU_LOG("\nDU_APP : RLC DL/UL Lower Sap Cfg Req sent for inst %d", inst);
}
uSap = &(kwMngmt.t.cfg.s.sap);
- uSap->selector = DU_SELECTOR_LC;
+ uSap->selector = ODU_SELECTOR_LC;
uSap->mem.region = (inst == RLC_UL_INST) ?
RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
uSap->mem.pool = RLC_POOL;
kwMngmt.hdr.response.mem.pool = RLC_POOL;
/* Fill Pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTKW;
pst.dstProcId = DU_PROC;
U16 idx;
for(idx=0; idx< DEFAULT_CELLS; idx++)
{
- DuCellCb *cell;
+ DuCellCb *cell = NULLP;
DU_ALLOC(cell, sizeof(DuCellCb))
if(cell == NULLP)
{
U32 nci;
U8 idx1;
memset(cell, 0, sizeof(DuCellCb));
- cell->cellId = cellId++;
+ cell->cellId = ++cellId;
cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
nci = (U16)cell->cellInfo.nrEcgi.cellId;
duCb.cfgCellLst[nci-1] = cell;
+ duCb.numCfgCells++;
}
}
if(ret != RFAILED)
genCfg->lmPst.route = RTESPEC;
genCfg->lmPst.region = MAC_MEM_REGION;
genCfg->lmPst.pool = RG_POOL;
- genCfg->lmPst.selector = DU_SELECTOR_LC;
+ genCfg->lmPst.selector = ODU_SELECTOR_LC;
/* Fill Header */
rgMngmt.hdr.msgType = TCFG;
rgMngmt.hdr.response.route = RTESPEC;
rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
rgMngmt.hdr.response.mem.pool = RG_POOL;
- rgMngmt.hdr.response.selector = DU_SELECTOR_LC;
+ rgMngmt.hdr.response.selector = ODU_SELECTOR_LC;
/* Fill Pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstInst = macCfgInst;
uSap->inst = sapId;
uSap->prior = PRIOR0;
uSap->route = RTESPEC;
- uSap->selector = DU_SELECTOR_LC ;
+ uSap->selector = ODU_SELECTOR_LC ;
/* fill header */
rgMngmt.hdr.msgType = TCFG;
rgMngmt.hdr.response.mem.pool = RG_POOL;
/* fill pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstInst = macCfgInst;
kwMngmt.hdr.response.mem.pool = RLC_POOL;
/* Fill pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTKW;
pst.dstProcId = DU_PROC;
pst->dstInst = (Inst)EGTP_INST;
pst->dstProcId = pst->srcProcId;
pst->event = event;
- pst->selector = DU_SELECTOR_LC;
+ pst->selector = ODU_SELECTOR_LC;
pst->pool= DU_POOL;
RETVALUE(ROK);
cfg->genCfg.lmPst.route = RTESPEC;
cfg->genCfg.lmPst.region = MAC_MEM_REGION;
cfg->genCfg.lmPst.pool = RG_POOL;
- cfg->genCfg.lmPst.selector = DU_SELECTOR_LC;
+ cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
/* Fill Header */
rgMngmt.hdr.msgType = TCFG;
rgMngmt.hdr.response.mem.pool = RG_POOL;
/* Fill Pst */
- pst.selector = DU_SELECTOR_LC;
+ pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstProcId = DU_PROC;
DU_SET_ZERO(&pst, sizeof(Pst));
MacCellCfg *duMacCellCfg = NULLP;
- DU_ALLOC(duMacCellCfg, sizeof(MacCellCfg));
+ DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
if(duMacCellCfg == NULLP)
{
return RFAILED;
/* copy the mac config structure from duCfgParams */
memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
- duMacCellCfg->transId = getTransId(); /* transaction ID */
-
/* Fill Pst */
- pst.selector = DU_SELECTOR_LWLC;
+ pst.selector = ODU_SELECTOR_LWLC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstInst = 0;
pst.srcInst = 0;
pst.dstProcId = DU_PROC;
pst.srcProcId = DU_PROC;
- pst.region = duCb.init.region;
- pst.event = EVENT_MAC_CELL_CONFIG_REQ;
+ pst.region = DU_APP_MEM_REGION;
+ pst.pool = DU_POOL;
+ pst.event = EVENT_MAC_CELL_CONFIG_REQ;
/* Send MAC cell config to MAC */
return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
***************************************************************************/
int duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
{
- S16 ret = ROK;
+ uint8_t actvCellIdx = 0;
+ S16 ret = ROK;
if(macCellCfgCfm->rsp == ROK)
+ {
+ for(actvCellIdx = 0 ; actvCellIdx <duCb.numActvCells ; actvCellIdx++)
{
- if(macCellCfgCfm->transId == duCb.duMacCellCfg->transId)
- {
- /* free the memory allocated during sending macCellCfg request */
- DU_FREE(duCb.duMacCellCfg->sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
- DU_FREE(duCb.duMacCellCfg,sizeof(MacCellCfg));
- duCb.duMacCellCfg = NULLP;
-
- /* Build and send GNB-DU config update */
- ret = BuildAndSendDUConfigUpdate();
-
- /* TODO: Trigger cell start req once cell up slot ind is received*/
- /* Build and Send Cell Start Req to MAC */
- ret = duBuildAndSendMacCellStartReq();
-
- }
- else
- {
- /* transaction ID missmatch */
- DU_LOG("\n transaction ID mismatch in macCellCfg");
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("\nMac cell cfg failed");
- ret = RFAILED;
+ if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
+ {
+ duCb.duMacCellCfg = NULLP;
+ /* Build and send GNB-DU config update */
+ ret = BuildAndSendDUConfigUpdate();
+
+ /* TODO: Trigger cell start req once cell up slot ind is received*/
+ /* Build and Send Cell Start Req to MAC */
+ ret = duBuildAndSendMacCellStartReq();
+
+ }
}
- return ret;
+ }
+ else
+ {
+ DU_LOG("\nMac cell cfg failed");
+ ret = RFAILED;
+ }
+ return ret;
}
/*******************************************************************
duSendEgtpSlotInd();
#endif
- if((pst->selector == DU_SELECTOR_LWLC) || (pst->selector == DU_SELECTOR_TC))
+ if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotInfo));
return ROK;
cellStartInfo->cellId = duCb.actvCellLst[id]->cellInfo.nrEcgi.cellId;
/* Fill Pst */
- pst.selector = DU_MAC_LWLC;
+ pst.selector = ODU_SELECTOR_LWLC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstInst = 0;
cellStopInfo->cellId = duCb.actvCellLst[0]->cellId;
/* Fill Pst */
- pst.selector = DU_MAC_LWLC;
+ pst.selector = ODU_SELECTOR_LWLC;
pst.srcEnt = ENTDUAPP;
pst.dstEnt = ENTRG;
pst.dstInst = 0;
}
}
}
- if((pst->selector == DU_SELECTOR_LWLC) || (pst->selector == DU_SELECTOR_TC))
+ if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellStopId, sizeof(MacCellStopInfo));
return ROK;