X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fdu_app%2Fdu_f1ap_msg_hdl.c;h=524fe270fdd79e9cb056e9a9a0f2f2a6870747da;hb=70e1fb5996d93ef4973ffb654ee6a66228e9031c;hp=0ab9f3b85301cfb48dfeb1c0548501e00240c6a3;hpb=c5c410562096194a3f6836ab1a6a48b315c60974;p=o-du%2Fl2.git diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 0ab9f3b85..524fe270f 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -103,10 +103,8 @@ #include "GTPTunnel.h" #ifdef O1_ENABLE - -#include "Config.h" +#include "ConfigInterface.h" extern StartupConfig g_cfg; - #endif DuCfgParams duCfgParam; @@ -9291,93 +9289,100 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo) * ****************************************************************/ void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap) { - UE_NR_Capability_t *ueNrCap; + UE_NR_Capability_t *ueNrCap=NULLP; - if(ueCap) + if(!ueCap) + { + memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo)); + memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo)); + } + else + { ueNrCap = (UE_NR_Capability_t *)ueCap; - /* Filling DL modulation info */ - if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsDownlinkPerCC && \ + /* Filling DL modulation info */ + if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsDownlinkPerCC && \ ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0] && \ ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL) - { - switch(*(ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL)) { - case ModulationOrder_qpsk: - { - ueCfg->dlModInfo.modOrder = MOD_ORDER_QPSK; - break; - } - case ModulationOrder_qam16: - { - ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM16; - break; - } - case ModulationOrder_qam64: - { - ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM64; - ueCfg->dlModInfo.mcsIndex = PDSCH_MCS_INDEX; - ueCfg->dlModInfo.mcsTable = MCS_TABLE_QAM64; - break; - } - case ModulationOrder_qam256: - { - ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM256; - break; - } - default: - { - DU_LOG("\nERROR --> DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration"); - memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo)); - break; - } + switch(*(ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL)) + { + case ModulationOrder_qpsk: + { + ueCfg->dlModInfo.modOrder = MOD_ORDER_QPSK; + break; + } + case ModulationOrder_qam16: + { + ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM16; + break; + } + case ModulationOrder_qam64: + { + ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM64; + ueCfg->dlModInfo.mcsIndex = PDSCH_MCS_INDEX; + ueCfg->dlModInfo.mcsTable = MCS_TABLE_QAM64; + break; + } + case ModulationOrder_qam256: + { + ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM256; + break; + } + default: + { + DU_LOG("\nERROR --> DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration"); + memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo)); + break; + } + } + } + else + { + memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo)); } - } - else - { - memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo)); - } - /* Filling UL modulation info */ - if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsUplinkPerCC && \ + /* Filling UL modulation info */ + if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsUplinkPerCC && \ ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0] && \ ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL) - { - switch(*(ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL)) { - case ModulationOrder_qpsk: - { - ueCfg->ulModInfo.modOrder = MOD_ORDER_QPSK; - break; - } - case ModulationOrder_qam16: - { - ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM16; - ueCfg->ulModInfo.mcsIndex = PUSCH_MCS_INDEX; - ueCfg->ulModInfo.mcsTable = MCS_TABLE_QAM64; - break; - } - case ModulationOrder_qam64: - { - ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM64; - break; - } - case ModulationOrder_qam256: - { - ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM256; - break; - } - default: - { - DU_LOG("\nERROR --> DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration"); - memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo)); - break; - } + switch(*(ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL)) + { + case ModulationOrder_qpsk: + { + ueCfg->ulModInfo.modOrder = MOD_ORDER_QPSK; + break; + } + case ModulationOrder_qam16: + { + ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM16; + ueCfg->ulModInfo.mcsIndex = PUSCH_MCS_INDEX; + ueCfg->ulModInfo.mcsTable = MCS_TABLE_QAM64; + break; + } + case ModulationOrder_qam64: + { + ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM64; + break; + } + case ModulationOrder_qam256: + { + ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM256; + break; + } + default: + { + DU_LOG("\nERROR --> DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration"); + memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo)); + break; + } + } + } + else + { + memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo)); } - } - else - { - memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo)); } } @@ -12639,7 +12644,81 @@ uint8_t BuildAndSendUeContextReleaseComplete(uint32_t gnbCuUeF1apId, uint32_t /*TODO: To add trigger for UE context release complete, once the operations of UE context * release command are done*/ } +/******************************************************************* +* +* @brief added free part for the memory allocated by aper_decoder +* +* @details +* +* Function : freeAperDecodeUeContextReleaseCommand +* +* Functionality: added free part for the memory allocated by aper_decoder +* +* @params[in] F1AP_PDU_t *f1apMsg +* @return void +* +* ****************************************************************/ +void freeAperDecodeUeContextReleaseCommand(F1AP_PDU_t *f1apMsg) +{ + uint8_t ieIdx=0; + UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP; + ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand; + + if(ueContextReleaseCommand->protocolIEs.list.array) + { + for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++) + { + if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]) + { + switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id) + { + case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID: + break; + case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID: + break; + case ProtocolIE_ID_id_Cause: + break; + case ProtocolIE_ID_id_RRCContainer: + { + if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf) + { + free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf); + } + break; + } + default : + DU_LOG("\nERROR --> F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\ + ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id); + break; + } + } + free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]); + } + free(ueContextReleaseCommand->protocolIEs.list.array); + } +} +/******************************************************************* +* +* @brief processing of UE Context Release Command +* +* @details +* +* Function : procF1UeContextReleaseCommand +* +* Functionality: processing of UE Context Release Command +* +* @params[in] F1AP_PDU_t *f1apMsg +* @return void +* +* ****************************************************************/ +uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg) +{ + /*TODO: processing of DL RRC Msg Transfer to RLC->SCH->MAC-LOWER-MAC->PHY, if RRC container is received */ + + freeAperDecodeUeContextReleaseCommand(f1apMsg); + return ROK; +} /************************************************************** * * @brief Handles received F1AP message and sends back response @@ -12764,6 +12843,11 @@ void F1APMsgHdlr(Buffer *mBuf) procF1UeContextModificationReq(f1apMsg); break; } + case InitiatingMessage__value_PR_UEContextReleaseCommand: + { + procF1UeContextReleaseCommand(f1apMsg); + break; + } default: { DU_LOG("\nERROR --> F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",