X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_f1ap_msg_hdl.c;h=fdf6168467f741655fac4484000a8b60bb4b7927;hb=6ffefa70d25f1f2e9a5879d4eb8f3af6379b54a9;hp=e5bbb6e559112b37fe6fb70b6e4e8f8c0863ff87;hpb=5f2265d1147690ddea19312492150bcad7cf5c1b;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index e5bbb6e55..fdf616846 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -8438,7 +8438,9 @@ void FreeUeContextReleaseCommand(F1AP_PDU_t *f1apMsg) uint8_t BuildAndSendUeContextReleaseCommand(uint32_t duId, uint8_t cuUeF1apId, uint8_t duUeF1apId) { bool memAllocFailed = false; - uint8_t ieIdx = 0,elementCnt = 0, ret = RFAILED, bufLen=0; + uint8_t duIdx = 0, ieIdx = 0,elementCnt = 0, ret = RFAILED, bufLen=0; + DuDb *duDb; + CuUeCb *ueCb; F1AP_PDU_t *f1apMsg = NULLP; UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP; @@ -8468,7 +8470,13 @@ uint8_t BuildAndSendUeContextReleaseCommand(uint32_t duId, uint8_t cuUeF1apId, u ueContextReleaseCommand =&f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand; - elementCnt = 4; + SEARCH_DU_DB(duIdx, duId, duDb); + ueCb = &duDb->ueCb[duUeF1apId-1]; + if(ueCb->state == UE_HANDOVER_IN_PROGRESS) + elementCnt = 3; + else + elementCnt = 4; + ueContextReleaseCommand->protocolIEs.list.count = elementCnt; ueContextReleaseCommand->protocolIEs.list.size = elementCnt*sizeof(UEContextReleaseCommand_t*); @@ -8495,6 +8503,7 @@ uint8_t BuildAndSendUeContextReleaseCommand(uint32_t duId, uint8_t cuUeF1apId, u { break; } + ieIdx=0; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject; @@ -8509,34 +8518,36 @@ uint8_t BuildAndSendUeContextReleaseCommand(uint32_t duId, uint8_t cuUeF1apId, u UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =duUeF1apId; + /* Cause of UE context release */ ieIdx++; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_Cause; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present=\ - UEContextReleaseCommandIEs__value_PR_Cause; + UEContextReleaseCommandIEs__value_PR_Cause; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.Cause.present = Cause_PR_radioNetwork; ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.Cause.choice.radioNetwork=\ - CauseRadioNetwork_normal_release; - - /* RRC Container for RRC release */ - ieIdx++; - ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_RRCContainer; - ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore; - ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present = \ - UEContextReleaseCommandIEs__value_PR_RRCContainer; - char secModeBuf[7]={ 0x00, 0x05, 0x13, 0x00, 0x00, 0x00, 0x00}; - bufLen =7; - ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size = bufLen; - CU_ALLOC(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, - ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size); - if(!ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf) - { - DU_LOG("\nERROR --> F1AP : Memory allocation for BuildAndSendUeContextReleaseCommand failed"); - break; + CauseRadioNetwork_normal_release; + if(ueCb->state != UE_HANDOVER_IN_PROGRESS) + { + /* RRC Container for RRC release */ + ieIdx++; + ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_RRCContainer; + ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore; + ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.present = \ + UEContextReleaseCommandIEs__value_PR_RRCContainer; + char secModeBuf[7]={ 0x00, 0x05, 0x13, 0x00, 0x00, 0x00, 0x00}; + bufLen =7; + ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size = bufLen; + CU_ALLOC(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, + ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size); + if(!ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf) + { + DU_LOG("\nERROR --> F1AP : Memory allocation for BuildAndSendUeContextReleaseCommand failed"); + break; + } + memset(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, 0, bufLen); + memcpy(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, secModeBuf, bufLen); } - memset(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, 0, bufLen); - memcpy(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, secModeBuf, bufLen); - xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg); /* Encode the UE Context Release Command type as APER */