return RFAILED;
}
}
- else if(ueCb->state == UE_HANDOVER_IN_PROGRESS)
+ else
{
if(ueCb->hoInfo.HOType == Inter_DU_HO)
{
}
else if(ueCb->hoInfo.HOType == Xn_Based_Inter_CU_HO)
{
- BuildAndSendHOReqAck(ueCb, recvBuf, recvBufLen);
+ BuildAndSendHOReqAck(ueCb, duToCuRrcContainer->buf, duToCuRrcContainer->size);
}
}
if(duDb->ueCb[duUeF1apId-1].state == UE_HANDOVER_IN_PROGRESS)
{
- uint8_t ueIdx = 0;
- uint8_t srcDuId = duDb->ueCb[duUeF1apId-1].hoInfo.srcNodeId;
- DuDb *srcDuDb = NULLP;
-
- /* In target DU DB, mark UE as active and delete HO info */
- duDb->ueCb[duUeF1apId-1].state = UE_ACTIVE;
- memset(&duDb->ueCb[duUeF1apId-1].hoInfo, 0, sizeof(HandoverInfo));
-
- /* Release UE context in source DU because the UE is now
- * attached to target DU */
- SEARCH_DU_DB(duIdx, srcDuId, srcDuDb);
- for(ueIdx = 0; ueIdx < srcDuDb->numUe; ueIdx++)
+ if(duDb->ueCb[duUeF1apId-1].hoInfo.HOType == Inter_DU_HO)
{
- if(srcDuDb->ueCb[ueIdx].gnbCuUeF1apId == cuUeF1apId)
+ uint8_t ueIdx = 0;
+ uint8_t srcDuId = duDb->ueCb[duUeF1apId-1].hoInfo.srcNodeId;
+ DuDb *srcDuDb = NULLP;
+
+ /* Release UE context in source DU because the UE is now
+ * attached to target DU */
+ SEARCH_DU_DB(duIdx, srcDuId, srcDuDb);
+ for(ueIdx = 0; ueIdx < srcDuDb->numUe; ueIdx++)
{
- ret = BuildAndSendUeContextReleaseCommand(srcDuId, srcDuDb->ueCb[ueIdx].gnbCuUeF1apId, srcDuDb->ueCb[ueIdx].gnbDuUeF1apId);
- if(ret != ROK)
+ if(srcDuDb->ueCb[ueIdx].gnbCuUeF1apId == cuUeF1apId)
{
- DU_LOG("\nINFO --> F1AP: Failed to build and send UE context release command to source DU Id [%d]", srcDuId);
+ ret = BuildAndSendUeContextReleaseCommand(srcDuId, srcDuDb->ueCb[ueIdx].gnbCuUeF1apId, srcDuDb->ueCb[ueIdx].gnbDuUeF1apId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nINFO --> F1AP: Failed to build and send UE context release command to source DU Id [%d]", srcDuId);
+ }
+ break;
}
- break;
}
}
+ else
+ {
+ BuildAndSendUeContextRelease(&duDb->ueCb[duUeF1apId-1]);
+ }
+
+ /* In target DU DB, mark UE as active and delete HO info */
+ duDb->ueCb[duUeF1apId-1].state = UE_ACTIVE;
+ memset(&duDb->ueCb[duUeF1apId-1].hoInfo, 0, sizeof(HandoverInfo));
return ret;
}
break;
duUeF1apId = ueCtxtModRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
ueCb = &duDb->ueCb[duUeF1apId-1];
- if((ueCb->state == UE_HANDOVER_IN_PROGRESS) && (ueCb->hoInfo.HOType == Xn_Based_Inter_CU_HO))
+ /* In case UE context modification response is received at source GNB CU from source GNB DU
+ * for a UE in handover, send HO request to target GNB only if not sent already.
+ * If HO Req is already sent to target GNB, and an HO Req Ack is received, then
+ * ueCb->hoInfo.cuUeF1apIdTgt will be non-zero
+ */
+ if((ueCb->state == UE_HANDOVER_IN_PROGRESS) && (ueCb->hoInfo.HOType == Xn_Based_Inter_CU_HO) && \
+ (ueCb->hoInfo.cuUeF1apIdTgt == 0))
{
BuildAndSendHOReq(ueCb, recvBuf, recvBufLen);
}