Pst rspPst;
cfgRsp->cellId = ueCfg->cellId;
+ cfgRsp->ueId = ueCfg->ueId;
cfgRsp->crnti = ueCfg->crnti;
- GET_UE_ID(ueCfg->crnti, cfgRsp->ueId);
cfgRsp->rsp = result;
/* Filling response post */
bool isLcIdValid = FALSE;
ueCb->ueCfg.cellId = ueCfg->cellId;
+ ueCb->ueCfg.ueId = ueCfg->ueId;
ueCb->ueCfg.crnti = ueCfg->crnti;
+ ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo;
if(ueCfg->macCellGrpCfgPres == true)
{
memcpy(&ueCb->ueCfg.macCellGrpCfg , &ueCfg->macCellGrpCfg, sizeof(SchMacCellGrpCfg));
}
}
- ueCb->state = SCH_UE_STATE_ACTIVE;
if(ueCfg->ambrCfg)
{
SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
* ****************************************************************/
uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
- uint8_t ueId, lcIdx, ret = ROK;
+ uint8_t lcIdx = 0, ret = ROK;
SchCellCb *cellCb = NULLP;
SchUeCb *ueCb = NULLP;
SchUeCfgRsp cfgRsp;
cellCb = getSchCellCb(pst->event, inst, ueCfg);
/* Search if UE already configured */
- GET_UE_ID(ueCfg->crnti, ueId);
- ueCb = &cellCb->ueCb[ueId -1];
- if(ueCb)
- {
- if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
- {
- DU_LOG("\nDEBUG --> SCH : CRNTI %d already configured ", ueCfg->crnti);
- SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_OK, &cfgRsp);
- return ROK;
- }
- }
- else
+ ueCb = &cellCb->ueCb[ueCfg->ueId - 1];
+
+ if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
{
- DU_LOG("\nERROR --> SCH : SchUeCb not found at MacSchAddUeConfigReq() ");
- SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp);
- return RFAILED;
+ DU_LOG("\nDEBUG --> SCH : CRNTI %d already configured ", ueCfg->crnti);
+ SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_OK, &cfgRsp);
+ return ROK;
}
/* Fill received Ue Configuration in UeCb */
memset(ueCb, 0, sizeof(SchUeCb));
- ueCb->ueId = ueId;
+ ueCb->ueId = ueCfg->ueId;
ueCb->crnti = ueCfg->crnti;
- ueCb->state = SCH_UE_STATE_ACTIVE;
+
ret = fillSchUeCb(inst, ueCb, ueCfg);
if(ret == ROK)
{
- cellCb->numActvUe++;
- SET_ONE_BIT(ueCb->ueId, cellCb->actvUeBitMap);
+ /* If UE has initiated RACH and then UE context is created, it means UE is
+ * active now.
+ * Else if UE context is created before RACH, this means that UE is being
+ * handed-in from source DU */
+ if(cellCb->raCb[ueCb->ueId-1].tcrnti == ueCb->crnti)
+ {
+ cellCb->numActvUe++;
+ SET_ONE_BIT(ueCb->ueId, cellCb->actvUeBitMap);
+ ueCb->state = SCH_UE_STATE_ACTIVE;
+ }
+ else
+ {
+ ueCb->state = SCH_UE_HANDIN_IN_PROGRESS;
+ }
+
ueCb->cellCb = cellCb;
ueCb->srRcvd = false;
ueCb->bsrRcvd = false;