+++ /dev/null
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:6-u18.04-nng as ubuntu
-
-ADD . /opt/o-du-l2
-WORKDIR /opt/o-du-l2
-
-RUN apt-get update && apt-get install -y libpcap-dev
-
-RUN cd build/odu && make clean_ric ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
-
memset(macCellCb, 0, sizeof(MacCellCb));
macCb.macCell = macCellCb;
macCb.macCell->cellId = macCellCfg->cellId;
- /* Send cell cfg to scheduler */
+
+ MAC_ALLOC(cellCb->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
+ if(cellCb->macCellCfg.sib1Cfg.sib1Pdu == NULLP)
+ {
+ DU_LOG("\nMAC : macCellCb is NULL at handling of sib1Pdu of macCellCfg\n");
+ return RFAILED;
+ }
+ memcpy(cellCb->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
+
+ /* Send cell cfg to scheduler */
ret = MacSchCellCfgReq(pst, macCellCfg);
if(ret != ROK)
{
MacCellCfgCfm macCellCfgCfm;
macCellCfgCfm.rsp = RSP_NOK;
- macCellCfgCfm.transId = macCellCfg->transId;
+ macCellCfgCfm.cellId = macCellCfg->cellId;
macCellCfgFillCfmPst(pst,&cfmPst);
ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
}
+ else
+ {
+ if(macCellCfg->prachCfg.fdm[0].numUnusedRootSeq != 0)
+ {
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->prachCfg.fdm[0].unsuedRootSeq,
+ macCellCfg->prachCfg.fdm[0].numUnusedRootSeq* sizeof(uint8_t));
+ }
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg ,sizeof(MacCellCfg));
+ }
+
#ifdef INTEL_WLS
LwrMacEnqueueWlsBlock();
#endif
cmMemset((U8 *)&pst, 0, sizeof(Pst));
cellCb = rgCb[macCb.macInst].cell;
- macCellCfgCfm.transId = cellCb->macCellCfg.transId;
+ macCellCfgCfm.cellId = cellCb->macCellCfg.cellId;
macCellCfgCfm.rsp = response;
memcpy((void *)&pst, (void *)&rgCb[macCb.macInst].rgInit.lmPst, sizeof(Pst));
}
/* pack the transaction ID in CNF structure */
+ CMCHKPK(SPkU16, macCellCfgCfm->cellId, mBuf);
CMCHKPK(SPkU8, macCellCfgCfm->rsp, mBuf);
- CMCHKPK(SPkU16, macCellCfgCfm->transId, mBuf);
return SPstTsk(pst,mBuf);
}
if(pst->selector == ODU_SELECTOR_LC)
{
/* unpack the transaction ID in CNF structure */
- CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
CMCHKUNPK(SUnpkU8, &(macCellCfgCfm.rsp), mBuf);
-
+ CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.cellId), mBuf);
return (*func)(pst, &macCellCfgCfm);
}
else
typedef struct macCellCfg
{
- U16 transId; /* Trans Id */
U16 cellId; /* Cell Id */
U8 numTlv; /* Number of configuration TLVs */
U8 carrierId; /* Carrired Index */
typedef struct macCellCfgCfm
{
+ U16 cellId;
uint8_t rsp;
- U16 transId;
}MacCellCfgCfm;
typedef struct slotInfo
/* Now remove this cell from configured list and move to active list */
duCb.cfgCellLst[nci-1] = NULL;
duCb.actvCellLst[nci-1] = cellCb;
-
+ duCb.numActvCells++;
/* Build and send Mac Cell Cfg for the number of active cells */
ret = duBuildAndSendMacCellCfg();
if(ret != ROK)
duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
if(duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq != 0)
{
- DU_ALLOC(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq,
- NUM_UNUSED_ROOT_SEQ * sizeof(U8));
- if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
- {
- DU_LOG("\nDU_APP : Memory allocation failed");
- RETVALUE(RFAILED);
- }
- *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
- }
+ DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq,
+ NUM_UNUSED_ROOT_SEQ * sizeof(uint8_t));
+ if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
+ {
+ DU_LOG("\nDU_APP : Memory allocation failed");
+ RETVALUE(RFAILED);
+ }
+ *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
+ }
duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
duCfgParam.macCellCfg.prachCfg.raContResTmr = RA_CONT_RES_TIMER;
/* fill SIB1 configuration */
duCfgParam.macCellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
- DU_ALLOC(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
+ DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
duCfgParam.macCellCfg.sib1Cfg.sib1NewTxPeriod = SIB1_NEW_TX_PERIOD;
CellCfgParams cellInfo; /* Cell info */
Bool firstSlotIndRcvd;
CellStatus cellStatus; /* Cell status */
- uint32_t numActvUes; /* Total Active UEs */
+ uint32_t numActvUes; /* Total Active UEs */
DuUeCb ueCb[DU_MAX_UE]; /* UE CONTEXT */
}DuCellCb;
//DuLSapCb **macSap; /* MAC SAP */
Bool f1Status; /* Status of F1 connection */
Bool e2Status; /* Status of E2 connection */
+ uint8_t numCfgCells;
DuCellCb* cfgCellLst[DU_MAX_CELLS]; /* List of cells at DU APP of type DuCellCb */
+ uint8_t numActvCells;
DuCellCb* actvCellLst[DU_MAX_CELLS]; /* List of cells activated/to be activated of type DuCellCb */
/* pointer to store the address of macCellCfg params used to send du-app to MAC */
MacCellCfg *duMacCellCfg; /* pointer to store params while sending DU-APP to MAC */
}
duCb.numUe = 0;
memset(duCb.ueCcchCtxt, 0, DU_MAX_UE * sizeof(UeCcchCtxt));
-
+ duCb.numCfgCells = 0;
+ duCb.numActvCells = 0;
SSetProcId(DU_PROC);
return ROK;
nci = (U16)cell->cellInfo.nrEcgi.cellId;
duCb.cfgCellLst[nci-1] = cell;
+ duCb.numCfgCells++;
}
}
if(ret != RFAILED)
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 = ODU_SELECTOR_LWLC;
pst.srcEnt = ENTDUAPP;
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;
}
/*******************************************************************