From: Harshita Lal Date: Fri, 18 Feb 2022 13:53:40 +0000 (+0000) Subject: Merge "[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-420] GNB-DU Configuration Query and... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=1dc4874f3806146823871718c4450d4d77444947;hp=-c;p=o-du%2Fl2.git Merge "[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-420] GNB-DU Configuration Query and response" --- 1dc4874f3806146823871718c4450d4d77444947 diff --combined src/cu_stub/cu_stub.c index 397103623,c8724d7e1..1694a14dd --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@@ -204,16 -204,10 +204,16 @@@ void readCuCfg( } cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du); + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].duIpAddr.ipV4Addr = ipv4_du; + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].duIpAddr.ipV6Pres = false; + cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &ipv4_cu); - - cuCb.cuCfgParams.sctpParams.duPort = g_cfg.DU_Port; - cuCb.cuCfgParams.sctpParams.cuPort = g_cfg.CU_Port; + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].cuIpAddr.ipV4Addr = ipv4_cu; + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].cuIpAddr.ipV6Pres = false; + + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].duPort = g_cfg.DU_Port; + cuCb.cuCfgParams.sctpParams.sctpAssoc[0].cuPort = g_cfg.CU_Port; + cuCb.cuCfgParams.sctpParams.numDu = 1; #else cuCb.cuCfgParams.sctpParams.numDu = 0; numDu = &cuCb.cuCfgParams.sctpParams.numDu; @@@ -263,6 -257,40 +263,40 @@@ } /* End of readCuCfg */ + /******************************************************************* + * + * @brief Initiates inter DU handover + * + * @details + * + * Function : initiateInterDuHandover + * + * Functionality: Initiates the first procedure of inter-DU + * handover i.eG GNB-DU configuration query to source DU + * + * @params[in] Source DU Id + * Target DU Id + * UE Id to be handed off + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t ueId) + { + DuDb *duDb = NULLP; + CuUeCb *ueCb = NULLP; + + duDb = getDuDb(sourceDuId); + if(duDb) + ueCb = &duDb->ueCb[ueId-1]; + if(ueCb) + ueCb->state = HANDOVER_IN_PROGRESS; + + DU_LOG("\nINFO --> CU_STUB: Inter-DU Handover Started for ueId [%d] from DU ID [%d] to DU ID [%d]", \ + ueId, sourceDuId, targetDuId); + BuildAndSendUeContextModificationReq(sourceDuId, ueCb, QUERY_CONFIG); + } + /******************************************************************* * * @brief Handles Console input @@@ -295,8 -323,9 +329,9 @@@ void *cuConsoleHandler(void *args while(true) { + ch = getchar(); /* Send DL user data to CU when user enters 'd' on console */ - if((ch = getchar()) == 'd') + if(ch == 'd') { /* Change #if 0 to #if 1 to take input from user */ @@@ -350,6 -379,21 +385,21 @@@ #endif continue; } + + /* Start Handover procedure towards DU when 'h' is received from console input */ + else if(ch == 'h') + { + uint32_t sourceDuId, targetDuId, ueId; + + DU_LOG("\nEnter Source DU ID for Inter-DU Handover"); + scanf("%d", &sourceDuId); + DU_LOG("\nEnter Target DU ID for Inter-DU Handover"); + scanf("%d", &targetDuId); + DU_LOG("\nEnter DU UE F1AP ID to be handed over"); + scanf("%d", &ueId); + + initiateInterDuHandover(sourceDuId, targetDuId, ueId); + } } } /**********************************************************************