X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_ue_mgr.c;h=85c166339514cd5193876ca20caa8c0b347674c9;hb=c9ee9d5360e8cad2cb2f807f5ebfabe9304d88c4;hp=9f010d4d9e19d3b2191222ecbdf69198218ab3d5;hpb=38ebc92a011353b8b2d9401efa4173c79114fa1c;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_ue_mgr.c b/src/5gnrsch/sch_ue_mgr.c index 9f010d4d9..85c166339 100644 --- a/src/5gnrsch/sch_ue_mgr.c +++ b/src/5gnrsch/sch_ue_mgr.c @@ -539,19 +539,23 @@ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) memset(ueCb, 0, sizeof(SchUeCb)); ueCb->ueId = ueCfg->ueId; ueCb->crnti = ueCfg->crnti; - if(ueCb->crnti) - ueCb->state = SCH_UE_STATE_ACTIVE; - else - ueCb->state = SCH_UE_HANDIN_IN_PROGRESS; ret = fillSchUeCb(inst, ueCb, ueCfg); if(ret == ROK) { - if(ueCb->state == SCH_UE_STATE_ACTIVE) + /* 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;