*
* Functionality: Fills Default UL LC Cfg
*
- *
+ * @params[in] UlLcCfg *ulLcCfg
+ * @return void
*****************************************************************/
void fillDefaultUlLcCfg(UlLcCfg *ulLcCfg)
{
*
* Functionality: Fills Initial DL Bandwidth Part
*
+ * @params[in] InitialDlBwp *initDlBwp
+ * @return void
*
*****************************************************************/
void fillDefaultInitDlBwp(InitialDlBwp *initDlBwp)
*
* Functionality: Fills Initial UL Bandwidth Part
*
+ * @params[in] InitialUlBwp *initUlBwp
+ * @return void
*
*****************************************************************/
void fillDefaultInitUlBwp(InitialUlBwp *initUlBwp)
*
* Functionality: Fills Sp Cell Group Info
*
+ * @params[in] SpCellCfg *spCell
+ * @return void
*
*****************************************************************/
void fillDefaultSpCellGrpInfo(SpCellCfg *spCell)
*
* Functionality: Fills Physical Cell Group Info
*
+ * @params[in] PhyCellGrpCfg *cellGrp
+ * @return void
*
*****************************************************************/
void fillDefaultPhyCellGrpInfo(PhyCellGrpCfg *cellGrp)
*
* Functionality: Fills Mac Cell Group Info
*
+ * @params[in] MacCellGrpCfg *cellGrp
+ * @return void
*
*****************************************************************/
void fillDefaultMacCellGrpInfo(MacCellGrpCfg *cellGrp)
}
}
-
+/******************************************************************
+ *
+ * @brief Function to fill Mac Lc Cfg for SRB1
+ *
+ * @details
+ *
+ * Function : fillMacSrb1LcCfg
+ *
+ * Functionality: Function to fill Mac Lc cfg for SRB1
+ *
+ * @params[in] LcCfg *lcCfg, LcCfg *ueSetReqDb
+ * @return void
+ *****************************************************************/
void fillMacSrb1LcCfg(LcCfg *macLcCfg)
{
*
* Functionality: Function to fill the Lc cfg from ueSetupReqDb
*
+ * @params[in] LcCfg *lcCfg, LcCfg *ueSetReqDb
+ * @return ROK/RFAILED
*
*****************************************************************/
if(!lcCfg->drbQos)
{
DU_LOG("\nDU APP: Memory Alloc failed at drQos at fillMacLcCfgToAddMod()");
- ret = RFAILED;
+ return RFAILED;
}
}
if(ret == ROK)
lcCfg->drbQos = NULLP;
}
- /* Filling SNSSAI */
- if(ueSetReqDb->snssai && ret == ROK)
+ if(ret == ROK)
{
- if(!lcCfg->snssai)
+ if(ueSetReqDb->snssai)
{
- DU_ALLOC_SHRABL_BUF(lcCfg->snssai, sizeof(Snssai));
if(!lcCfg->snssai)
{
- DU_LOG("\nDU APP: Memory Alloc failed at snnsai at fillMacLcCfgToAddMod()");
- ret = RFAILED;
+ DU_ALLOC_SHRABL_BUF(lcCfg->snssai, sizeof(Snssai));
+ if(!lcCfg->snssai)
+ {
+ DU_LOG("\nDU APP: Memory Alloc failed at snnsai at fillMacLcCfgToAddMod()");
+ ret = RFAILED;
+ }
}
+ if(ret == ROK)
+ {
+ /* Filling SNSSAI */
+ memcpy(lcCfg->snssai, ueSetReqDb->snssai, sizeof(Snssai));
+ }
+ else
+ {
+ lcCfg->snssai = NULLP;
+ if(lcCfg->drbQos)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
+ lcCfg->drbQos = NULLP;
+ }
+ return ret;
+ }
}
- if(ret == ROK)
- {
- memcpy(lcCfg->snssai, ueSetReqDb->snssai, sizeof(Snssai));
- }
- }
- else
- {
- lcCfg->snssai = NULLP;
- if(lcCfg->drbQos)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
- lcCfg->drbQos = NULLP;
- }
+ else
+ lcCfg->snssai = NULLP;
}
lcCfg->ulLcCfgPres = ueSetReqDb->ulLcCfgPres;
memcpy(&lcCfg->ulLcCfg, &ueSetReqDb->ulLcCfg, sizeof(UlLcCfg));
*
* Functionality: Function to copy bit Rate from ueSetupReqDb
*
+ * @params[in] MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate
+ * @return ROK/RFAILED
*
*****************************************************************/
*
* Functionality: Builds and Send UE ReConfig Request to MAC
*
- * @Params[in] MacUeCfg *
+ * @Params[in] MacUeCfg pointer
* @return ROK - success
* RFAILED - failure
*
*
* Functionality: Function to return Drb LcId
*
- *Returns: lcId - SUCCESS
+ * Returns: lcId - SUCCESS
* RFAILED - FAILURE
*****************************************************************/
*
* Functionality: Fills MacUeCfg
*
+ * @params[in] cellId, ueIdx, crnti,
+ * UeContextSetupDb pointer,
+ * MacUeCfg pointer
+ * @return ROK/RFAILED
*
*****************************************************************/
uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
*
* Functionality: Fills Rlc AM Information
*
+ * @params[in] AmBearerCfg *amCfg
+ * @return void
*
*****************************************************************/
void fillDefaultAmInfo(AmBearerCfg *amCfg)
*
* Functionality: Fills RLC UM Bi Directional Information
*
+ * @params[in] UmBiDirBearerCfg *umBiDirCfg
+ * @return void
*
*****************************************************************/
void fillDefaultUmBiInfo(UmBiDirBearerCfg *umBiDirCfg)
*
* Functionality: Fills RLC UM Uni Directional Info
*
+ * @params[in] UmUniDirUlBearerCfg *UmUlCfg
+ * @return void
*
*****************************************************************/
void fillDefaultUmUlInfo(UmUniDirUlBearerCfg *UmUlCfg)
*
* Functionality: Fills RLC UM Uni Directional DL Info
*
+ * @params[in] UmUniDirDlBearerCfg *UmDlCfg
+ * @return void
*
*****************************************************************/
void fillDefaultUmDlInfo(UmUniDirDlBearerCfg *UmDlCfg)
*
* Functionality: Builds Rlc Mode Default Configuration
*
+ * @params[in] rlcMode, RlcBearerCfg *lcCfg
+ * @return ROK/RFAILED
*
*****************************************************************/
uint8_t fillDefaultRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *lcCfg)
{
+
if(lcCfg)
{
switch(rlcMode)
DU_ALLOC_SHRABL_BUF(lcCfg->u.amCfg, sizeof(AmBearerCfg));
if(lcCfg->u.amCfg)
fillDefaultAmInfo(lcCfg->u.amCfg);
+ else
+ {
+ DU_LOG("\n DU_APP: Memory Alloc failed at AmCfg at fillDefaultRlcModeCfg()");
+ return RFAILED;
+ }
}
break;
}
DU_ALLOC_SHRABL_BUF(lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
if(lcCfg->u.umBiDirCfg)
fillDefaultUmBiInfo(lcCfg->u.umBiDirCfg);
+ else
+ {
+ DU_LOG("\n DU_APP: Memory Alloc failed at UmBiDirCfg at fillDefaultRlcModeCfg()");
+ return RFAILED;
+ }
}
break;
}
DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
if(lcCfg->u.umUniDirUlCfg)
fillDefaultUmUlInfo(lcCfg->u.umUniDirUlCfg);
+ else
+ {
+ DU_LOG("\n DU_APP: Memory Alloc failed at UmUniDirUlCfg at fillDefaultRlcModeCfg()");
+ return RFAILED;
+ }
}
break;
}
DU_ALLOC_SHRABL_BUF(lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
if(lcCfg->u.umUniDirDlCfg)
fillDefaultUmDlInfo(lcCfg->u.umUniDirDlCfg);
+ else
+ {
+ DU_LOG("\n DU_APP: Memory Alloc failed at UmUniDirDlCfg at fillDefaultRlcModeCfg()");
+ return RFAILED;
+ }
}
break;
}
}
return ROK;
}
-void fillRlcSrb1LcCfg(RlcBearerCfg *rlcLcCfg)
+
+/*******************************************************************
+ *
+ * @brief Function to fill Rlc Lc Cfg for SRB1
+ *
+ * @details
+ *
+ * Function : fillRlcSrb1LcCfg
+ *
+ * Functionality:
+ * Function to fill Rlc Lc Cfg for SRB1
+ *
+ * @params[in] Pointer to RlcBearerCfg
+ * @return ROK/RFAILED
+ *
+ *****************************************************************/
+
+uint8_t fillRlcSrb1LcCfg(RlcBearerCfg *rlcLcCfg)
{
+ uint8_t ret = ROK;
+
rlcLcCfg->rbId = SRB1_LCID;
rlcLcCfg->rbType = RB_TYPE_SRB;
rlcLcCfg->lcId = SRB1_LCID;
rlcLcCfg->lcType = LCH_DCCH;
rlcLcCfg->rlcMode = RLC_AM;
rlcLcCfg->configType = CONFIG_ADD;
- fillDefaultRlcModeCfg(rlcLcCfg->rlcMode, rlcLcCfg);
+ ret = fillDefaultRlcModeCfg(rlcLcCfg->rlcMode, rlcLcCfg);
+ return ret;
}
/*******************************************************************
/* Initial RB being Added */
rlcUeCfg->cellId = cellId;
rlcUeCfg->ueIdx = ueIdx;
- fillRlcSrb1LcCfg(&rlcUeCfg->rlcLcCfg[0]);
- rlcUeCfg->numLcs++;
+ ret = fillRlcSrb1LcCfg(&rlcUeCfg->rlcLcCfg[0]);
+ if(ret == ROK)
+ rlcUeCfg->numLcs++;
+ else
+ memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
}
else
{
/*Filling RlcUeCfg */
rlcUeCfg->cellId = cellId;
rlcUeCfg->ueIdx = ueIdx;
- for(dbIdx = 0; dbIdx < ueCfgDb->numRlcLcs; dbIdx++)
+ for(dbIdx = 0; (dbIdx < ueCfgDb->numRlcLcs && ret == ROK); dbIdx++)
{
- fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
+ ret = fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\n DU_APP: Failed to fill Rlc Mode at fillRlcUeCfg()");
+ memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
+ return ret;
+ }
/* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
{
return RFAILED;
}
/* Fill Pst */
- FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_CONFIG_REQ);
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_CREATE_REQ);
/* Copying ueCb to a sharable buffer */
DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCfg));
uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
{
uint8_t ret = ROK;
- uint8_t ueIdx, cellIdx;
if(cfgRsp)
{
if(cfgRsp->result == MAC_DU_APP_RSP_OK)
{
- cellIdx = (cfgRsp->cellId -1);
- ueIdx = (cfgRsp->ueIdx -1);
-
- if(pst->event == EVENT_MAC_UE_CONFIG_RSP)
+ if(pst->event == EVENT_MAC_UE_CREATE_RSP)
{
DU_LOG("\nDU APP : MAC UE Create Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.macUeCfgState = UE_CONFIG_COMPLETE;
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
}
else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
DU_LOG("\nDU APP : MAC UE Reconfig Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
}
}
ret = RFAILED;
}
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
}
else
{
return ret;
}
+
/*******************************************************************
*
* @brief Processes UE create Req to RLC UL
RlcUeCfg *rlcUeCfg = NULLP;
Pst pst;
- fillRlcUeCfg(cellId, ueIdx, NULL, duRlcUeCfg);
- FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_CONFIG_REQ);
+ ret = fillRlcUeCfg(cellId, ueIdx, NULL, duRlcUeCfg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nDU_APP: Failed to fill Rlc Ue Cfg at duBuildAndSendUeCreateReqToRlc()");
+ return ret;
+ }
+ FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_CREATE_REQ);
/* Copying ueCfg to a sharable buffer */
DU_ALLOC_SHRABL_BUF(rlcUeCfg, sizeof(RlcUeCfg));
if(rlcUeCfg)
uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp)
{
uint8_t ret = ROK;
- uint8_t ueIdx, cellIdx;
if(cfgRsp)
{
if(cfgRsp->result == RLC_DU_APP_RSP_OK)
{
- cellIdx = (cfgRsp->cellId -1);
- ueIdx = (cfgRsp->ueIdx -1);
-
- if(pst->event == EVENT_RLC_UE_CONFIG_RSP)
+ if(pst->event == EVENT_RLC_UE_CREATE_RSP)
{
DU_LOG("\nDU_APP: RLC UE Create Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcUeCfgState = UE_CONFIG_COMPLETE;
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ rlcUeCfg.rlcUeCfgState = UE_CREATE_COMPLETE;
}
else if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
{
DU_LOG("\nDU_APP: RLC UE Reconfig Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
{
memset(macUeCfg, 0, sizeof(MacUeCfg));
ret = fillMacUeCfg(cellId, ueIdx, crnti, ueCfgDb, macUeCfg);
- if(ret == ROK)
+ if(ret == RFAILED)
+ DU_LOG("\nDU_APP: Failed to fill Mac Ue Cfg at duBuildAndSendUeReCfgReqToMac()");
+ else
ret = sendUeReCfgReqToMac(macUeCfg);
}
else