Merge remote-tracking branch 'origin/develop' into NR_BWP_config

This commit is contained in:
francescomani
2022-06-27 12:33:41 +02:00
143 changed files with 3192 additions and 1839 deletions
+2 -2
View File
@@ -357,7 +357,8 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
memcpy(msg->rrc_container, sduP, sdu_lenP);
msg->rrc_container_length=sdu_lenP;
itti_send_msg_to_task(TASK_DU_F1, 0, tmp);
return(0);
return 0;
}
protocol_ctxt_t ctxt;
@@ -370,7 +371,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
nr_rrc_gNB_decode_ccch(&ctxt, sduP, sdu_lenP, NULL, CC_id);
}
}
return 0;
}
+67 -258
View File
@@ -42,6 +42,7 @@
#include <nr/nr_common.h>
#include <softmodem-common.h>
#include "executables/softmodem-common.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "asn1_msg.h"
#include "../nr_rrc_proto.h"
@@ -198,8 +199,7 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
asn_enc_rval_t enc_rval;
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
const gNB_RrcConfigurationReq *configuration = &rrc->configuration;
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
@@ -226,11 +226,18 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n");
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
frequency_range_t frequency_range = band<100?FR1:FR2;
int ssb_subcarrier_offset;
if(frequency_range == FR1)
ssb_subcarrier_offset = (configuration->ssb_SubcarrierOffset<24) ? (configuration->ssb_SubcarrierOffset<<*scc->ssbSubcarrierSpacing) : configuration->ssb_SubcarrierOffset;
else
ssb_subcarrier_offset = configuration->ssb_SubcarrierOffset;
int scs_scaling = 1<<*scc->ssbSubcarrierSpacing;
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
scs_scaling = scs_scaling*3;
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
scs_scaling = scs_scaling>>2;
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
int ssb_subcarrier_offset = 31; // default value for NSA
if (get_softmodem_params()->sa) {
ssb_subcarrier_offset = absolute_diff%(12*scs_scaling);
if(frequency_range == FR1)
ssb_subcarrier_offset <<= *scc->ssbSubcarrierSpacing;
}
mib->message.choice.mib->ssb_SubcarrierOffset = ssb_subcarrier_offset&15;
/*
@@ -1180,6 +1187,8 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
ubwp->bwp_Common->genericParameters.cyclicPrefix = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix;
}
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
ubwp->bwp_Common->rach_ConfigCommon = NULL;
ubwp->bwp_Common->pusch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
ubwp->bwp_Common->pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon;
@@ -1192,125 +1201,17 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
ubwp->bwp_Dedicated->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
ubwp->bwp_Dedicated->pucch_Config->choice.setup=pucch_Config;
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
pucch_Config->resourceSetToReleaseList = NULL;
NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
pucchresset0->pucch_ResourceSetId = 0;
NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
*pucchresset0id0=0;
ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
pucchresset0->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
pucchresset1->pucch_ResourceSetId = 1;
NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
*pucchresset1id0=1;
ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
pucchresset1->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
pucch_Config->resourceToReleaseList = NULL;
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=0;
pucchres0->startingPRB=(8+uid) % (curr_bwp/2);
LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
pucchres0->format.choice.format0->initialCyclicShift=0;
pucchres0->format.choice.format0->nrofSymbols=1;
pucchres0->format.choice.format0->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
pucchres2->pucch_ResourceId=1;
pucchres2->startingPRB=0;
pucchres2->intraSlotFrequencyHopping=NULL;
pucchres2->secondHopPRB=NULL;
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
pucchres2->format.choice.format2->nrofPRBs=8;
pucchres2->format.choice.format2->nrofSymbols=1;
pucchres2->format.choice.format2->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
pucch_Config->format2->choice.setup = pucchfmt2;
pucchfmt2->interslotFrequencyHopping=NULL;
pucchfmt2->additionalDMRS=NULL;
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
pucchfmt2->nrofSlots=NULL;
pucchfmt2->pi2BPSK=NULL;
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
config_pucch_resset1(pucch_Config, NULL);
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
// PUCCH config - Scheduling request configuration
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
schedulingRequestResourceConfig->schedulingRequestID = 0;
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40; // 40 slot period
// note: make sure that there is no issue here. Later choose the RNTI accordingly.
// Here we would be limited to 3 UEs on this resource (1 1/2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 7,8,9).
// This should be a temporary resource until the first RRCReconfiguration gives new pucch resources.
// Check for above configuration and exit for now if it is not the case
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
"SCS != 30kHz\n");
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
*schedulingRequestResourceConfig->resource = 0;
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
pucch_Config->schedulingRequestResourceToReleaseList=NULL;
pucch_Config->multi_CSI_PUCCH_ResourceList=NULL;
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
long *delay[8];
for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i]));
AssertFatal(configuration->minRXTXTIME >=2 && configuration->minRXTXTIME <7, "check minRXTXTIME %d\n",configuration->minRXTXTIME);
*delay[i] = i+configuration->minRXTXTIME;
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
}
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
pucchspatial->pucch_SpatialRelationInfoId = 1;
pucchspatial->servingCellId = NULL;
if(configuration->do_CSIRS) {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
}
else {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
pucchspatial->referenceSignal.choice.ssb_Index = 0;
}
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
pucchspatial->p0_PUCCH_Id = 1;
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
pucch_Config->spatialRelationInfoToReleaseList=NULL;
pucch_Config->pucch_PowerControl=calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = 0;
pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
p00->p0_PUCCH_Id=1;
p00->p0_PUCCH_Value = 0;
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
pucch_Config->pucch_PowerControl->pathlossReferenceRSs = NULL;
scheduling_request_config(scc, pucch_Config);
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
// PUSCH config
ubwp->bwp_Dedicated->pusch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pusch_Config));
@@ -1463,11 +1364,13 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
}
void fill_initial_SpCellConfig(int uid,
NR_SpCellConfig_t *SpCellConfig,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration)
{
const gNB_RrcConfigurationReq *configuration) {
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
@@ -1490,81 +1393,11 @@ void fill_initial_SpCellConfig(int uid,
initialUplinkBWP->pucch_Config->choice.setup=pucch_Config;
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
pucch_Config->resourceSetToReleaseList = NULL;
NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
pucchresset0->pucch_ResourceSetId = 0;
NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
*pucchresset0id0=0;
ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
pucchresset0->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
pucchresset1->pucch_ResourceSetId = 1;
NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
*pucchresset1id0=1;
ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
pucchresset1->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
pucch_Config->resourceToReleaseList = NULL;
// configure one single PUCCH0 opportunity for initial connection procedure
// one symbol (13)
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=0;
//pucchres0->startingPRB=0;
pucchres0->startingPRB=(8+uid) % (curr_bwp/2);
LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
pucchres0->format.choice.format0->initialCyclicShift=0;
pucchres0->format.choice.format0->nrofSymbols=1;
pucchres0->format.choice.format0->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
pucchres2->pucch_ResourceId=1;
pucchres2->startingPRB=0;
pucchres2->intraSlotFrequencyHopping=NULL;
pucchres2->secondHopPRB=NULL;
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
pucchres2->format.choice.format2->nrofPRBs=8;
pucchres2->format.choice.format2->nrofSymbols=1;
pucchres2->format.choice.format2->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
pucch_Config->format2->choice.setup = pucchfmt2;
pucchfmt2->interslotFrequencyHopping=NULL;
pucchfmt2->additionalDMRS=NULL;
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
pucchfmt2->nrofSlots=NULL;
pucchfmt2->pi2BPSK=NULL;
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
pucchspatial->pucch_SpatialRelationInfoId = 1;
pucchspatial->servingCellId = NULL;
if(configuration->do_CSIRS) {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
}
else {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
pucchspatial->referenceSignal.choice.ssb_Index = 0;
}
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
pucchspatial->p0_PUCCH_Id = 1;
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
config_pucch_resset1(pucch_Config, NULL);
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
@@ -1713,31 +1546,9 @@ void fill_initial_SpCellConfig(int uid,
srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0;
ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0);
// configure Scheduling request
// 40 slot period
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
schedulingRequestResourceConfig->schedulingRequestID = 0;
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
"SCS != 30kHz\n");
scheduling_request_config(scc, pucch_Config);
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
*schedulingRequestResourceConfig->resource = 0;
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
long *delay[8];
for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i]));
AssertFatal(configuration->minRXTXTIME >= 2 && configuration->minRXTXTIME < 7,
"minRXTXTIME is %d but should be within [2,7)\n", configuration->minRXTXTIME);
*delay[i] = i + configuration->minRXTXTIME;
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
}
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
@@ -1893,7 +1704,7 @@ void fill_initial_SpCellConfig(int uid,
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
*ssbres00 = 0;
*ssbres00 = 0;
ASN_SEQUENCE_ADD(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
csires1->bwp_Id = 0;
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
@@ -1913,8 +1724,8 @@ void fill_initial_SpCellConfig(int uid,
}
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
pucchcsires1->uplinkBandwidthPartId=0;
pucchcsires1->pucch_Resource=1;
pucchcsires1->uplinkBandwidthPartId = 0;
pucchcsires1->pucch_Resource = *pucch_Config->resourceSetToAddModList->list.array[1]->resourceList.list.array[0];
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
if (pdsch_AntennaPorts > 1) {
@@ -2139,7 +1950,7 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR
return rlc_BearerConfig;
}
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority ) {
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority) {
cellGroupConfig->cellGroupId = 0;
cellGroupConfig->rlc_BearerToReleaseList = NULL;
@@ -2167,6 +1978,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
const gNB_RrcConfigurationReq* configuration) {
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
if (SpCellConfig == NULL) return;
NR_ServingCellConfigCommon_t *scc = configuration ? configuration->scc : NULL;
@@ -2185,9 +1997,9 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
}
}
}
}
void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
@@ -2208,36 +2020,33 @@ void fill_initial_cellGroupConfig(int uid,
cellGroupConfig->rlc_BearerToReleaseList = NULL;
/* mac CellGroup Config */
if (1) {
mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
if (1) {
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
struct NR_SchedulingRequestToAddMod *schedulingrequestlist;
schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
schedulingrequestlist->schedulingRequestId = 0;
schedulingrequestlist->sr_ProhibitTimer = CALLOC(1,sizeof(*schedulingrequestlist->sr_ProhibitTimer));
*(schedulingrequestlist->sr_ProhibitTimer) = 0;
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
}
mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
struct NR_TAG *tag=calloc(1,sizeof(*tag));
tag->tag_Id = 0;
tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
}
mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
struct NR_TAG *tag=calloc(1,sizeof(*tag));
tag->tag_Id = 0;
tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
struct NR_SchedulingRequestToAddMod *schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
schedulingrequestlist->schedulingRequestId = 0;
schedulingrequestlist->sr_ProhibitTimer = NULL;
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
cellGroupConfig->mac_CellGroupConfig = mac_CellGroupConfig;
physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig));
@@ -2247,8 +2056,8 @@ void fill_initial_cellGroupConfig(int uid,
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,servingcellconfigdedicated,configuration);
fill_initial_SpCellConfig(uid,cellGroupConfig,scc,servingcellconfigdedicated,configuration);
cellGroupConfig->sCellToAddModList = NULL;
cellGroupConfig->sCellToReleaseList = NULL;
+1 -1
View File
@@ -102,7 +102,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer);
void fill_initial_SpCellConfig(int uid,
NR_SpCellConfig_t *SpCellConfig,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration);
+205 -2
View File
@@ -331,6 +331,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
int rbsize,
int mcs_table) {
NR_Phy_Parameters_t *phy_Parameters = &cap->phy_Parameters;
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
nr_bandnr->bandNR = band;
@@ -344,8 +345,8 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
}
else{
cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1));
NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1;
phy_Parameters->phy_ParametersFR1 = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFR1));
NR_Phy_ParametersFR1_t *phy_fr1 = phy_Parameters->phy_ParametersFR1;
phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1));
*phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported;
}
@@ -366,6 +367,9 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
*fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256;
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list, fs_cc);
}
phy_Parameters->phy_ParametersFRX_Diff = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFRX_Diff));
phy_Parameters->phy_ParametersFRX_Diff->pucch_F0_2WithoutFH = NULL;
}
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc,
@@ -454,6 +458,205 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
}
}
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time) {
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
long *delay[8];
for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i]));
*delay[i] = i+min_feedback_time;
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
}
}
// PUCCH resource set 0 for configuration with O_uci <= 2 bits and/or a positive or negative SR (section 9.2.1 of 38.213)
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap) {
NR_PUCCH_ResourceSet_t *pucchresset = calloc(1,sizeof(*pucchresset));
pucchresset->pucch_ResourceSetId = 0;
NR_PUCCH_ResourceId_t *pucchid=calloc(1,sizeof(*pucchid));
*pucchid=0;
ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchid);
pucchresset->maxPayloadSize=NULL;
if(uecap) {
long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F0 without frequency hopping. Current configuration is without FH\n");
}
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=*pucchid;
pucchres0->startingPRB= (8 + uid) % curr_bwp;
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
pucchres0->format.choice.format0->initialCyclicShift=0;
pucchres0->format.choice.format0->nrofSymbols=1;
pucchres0->format.choice.format0->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
}
// PUCCH resource set 1 for configuration with O_uci > 2 bits (currently format2)
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap) {
NR_PUCCH_ResourceSet_t *pucchresset=calloc(1,sizeof(*pucchresset));
pucchresset->pucch_ResourceSetId = 1;
NR_PUCCH_ResourceId_t *pucchressetid=calloc(1,sizeof(*pucchressetid));
*pucchressetid=2;
ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchressetid);
pucchresset->maxPayloadSize=NULL;
if(uecap) {
long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F2 without frequency hopping. Current configuration is without FH\n");
}
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
pucchres2->pucch_ResourceId=*pucchressetid;
pucchres2->startingPRB=0;
pucchres2->intraSlotFrequencyHopping=NULL;
pucchres2->secondHopPRB=NULL;
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
pucchres2->format.choice.format2->nrofPRBs=8;
pucchres2->format.choice.format2->nrofSymbols=1;
pucchres2->format.choice.format2->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
pucch_Config->format2->choice.setup = pucchfmt2;
pucchfmt2->interslotFrequencyHopping=NULL;
pucchfmt2->additionalDMRS=NULL;
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
pucchfmt2->nrofSlots=NULL;
pucchfmt2->pi2BPSK=NULL;
// to check UE capabilities for that in principle
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
}
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) {
pucch_Config->pucch_PowerControl = calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
p00->p0_PUCCH_Id = 1;
p00->p0_PUCCH_Value = 0;
pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
pucch_Config->pucch_PowerControl->pathlossReferenceRSs = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->pathlossReferenceRSs));
struct NR_PUCCH_PathlossReferenceRS *PL_ref_RS = calloc(1,sizeof(*PL_ref_RS));
PL_ref_RS->pucch_PathlossReferenceRS_Id = 0;
if(do_csirs) {
PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_csi_RS_Index;
PL_ref_RS->referenceSignal.choice.csi_RS_Index = 0;
}
else {
PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index;
PL_ref_RS->referenceSignal.choice.ssb_Index = 0;
}
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,PL_ref_RS);
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
pucch_Config->spatialRelationInfoToReleaseList=NULL;
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
pucchspatial->pucch_SpatialRelationInfoId = 1;
pucchspatial->servingCellId = NULL;
if(do_csirs) {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
}
else {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
pucchspatial->referenceSignal.choice.ssb_Index = 0;
}
pucchspatial->pucch_PathlossReferenceRS_Id = PL_ref_RS->pucch_PathlossReferenceRS_Id;
pucchspatial->p0_PUCCH_Id = p00->p0_PUCCH_Id;
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
}
void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig,
NR_ServingCellConfigCommon_t *scc) {
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
int sr_slot = 1; // in FDD SR in slot 1
if(tdd)
sr_slot = tdd->nrofDownlinkSlots; // SR in the first uplink slot
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
if(sr_slot<10){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl10 = sr_slot;
return;
}
if(sr_slot<20){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl20 = sr_slot;
return;
}
if(sr_slot<40){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = sr_slot;
return;
}
if(sr_slot<80){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl80 = sr_slot;
return;
}
if(sr_slot<160){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl160 = sr_slot;
return;
}
if(sr_slot<320){
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl320 = sr_slot;
return;
}
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl640 = sr_slot;
}
void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
NR_PUCCH_Config_t *pucch_Config) {
// format with <=2 bits in pucch resource set 0
NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[0];
// assigning the 1st pucch resource in the set to scheduling request
NR_PUCCH_ResourceId_t *pucchressetid = pucchresset->resourceList.list.array[0];
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
schedulingRequestResourceConfig->schedulingRequestID = 0;
set_SR_periodandoffset(schedulingRequestResourceConfig, scc);
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
*schedulingRequestResourceConfig->resource = *pucchressetid;
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
}
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
NR_SpCellConfig_t *SpCellConfig,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
+6 -1
View File
@@ -120,6 +120,12 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc,
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
int curr_bwp);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time);
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
NR_PUCCH_Config_t *pucch_Config);
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_CSI_MeasConfig_t *csi_MeasConfig,
int uid,
@@ -138,5 +144,4 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
int rbsize,
int mcs_table);
#endif
+2 -1
View File
@@ -447,7 +447,8 @@ typedef struct {
NR_BCCH_BCH_Message_t mib;
NR_BCCH_BCH_Message_t *mib_DU;
NR_BCCH_DL_SCH_Message_t *siblock1_DU;
NR_SIB1_t *siblock1_DU;
//NR_BCCH_DL_SCH_Message_t *siblock1_DU;
NR_SIB1_t *sib1;
NR_SIB2_t *sib2;
NR_SIB3_t *sib3;
+3 -2
View File
@@ -120,7 +120,7 @@ rrc_gNB_generate_SecurityModeCommand(
rrc_gNB_ue_context_t *const ue_context_pP
);
uint8_t
uint8_t
rrc_gNB_get_next_transaction_identifier(
module_id_t gnb_mod_idP
);
@@ -209,7 +209,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
void
rrc_gNB_generate_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP);
rrc_gNB_ue_context_t *ue_context_pP,
NR_CellGroupConfig_t *cell_groupConfig_from_DU);
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
const NR_SRB_ToAddModList_t * const srb2add_listP,
+476 -100
View File
@@ -99,6 +99,7 @@
#include <openair2/X2AP/x2ap_eNB.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
#include <openair2/RRC/NR/nr_rrc_proto.h>
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "BIT_STRING.h"
#include "assertions.h"
@@ -164,9 +165,8 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
LOG_I(NR_RRC,"Done init_NR_SI\n");
if (NODE_IS_MONOLITHIC(rrc->node_type)){
if (NODE_IS_MONOLITHIC(rrc->node_type) || NODE_IS_DU(rrc->node_type)){
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
@@ -276,7 +276,6 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
NR_CellGroupConfig_t *cgc = get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : NULL;
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
@@ -472,7 +471,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
rrc_mac_config_req_gNB(rrc_instance_p->module_id,
rrc_instance_p->configuration.ssb_SubcarrierOffset,
rrc_instance_p->configuration.pdsch_AntennaPorts,
rrc_instance_p->configuration.pusch_AntennaPorts,
rrc_instance_p->configuration.sib1_tda,
@@ -808,8 +806,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
}
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
@@ -838,7 +836,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
void
rrc_gNB_generate_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP
rrc_gNB_ue_context_t *ue_context_pP,
NR_CellGroupConfig_t *cell_groupConfig_from_DU
)
//-----------------------------------------------------------------------------
{
@@ -861,7 +860,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
uint8_t drb_id_to_setup_start = 1;
uint8_t nb_drb_to_setup = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
NR_CellGroupConfig_t *cellGroupConfig;
NR_CellGroupConfig_t *cellGroupConfig = NULL;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
@@ -1017,9 +1016,17 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
}
memset(buffer, 0, sizeof(buffer));
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
if(cell_groupConfig_from_DU == NULL){
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities or
// bearer IDs for the DRBs
fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup, rrc->um_on_default_drb, (drb_id_to_setup_start < 2) ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
}
else{
LOG_I(NR_RRC, "Master cell group originating from the DU \n");
cellGroupConfig = cell_groupConfig_from_DU;
}
fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup, rrc->um_on_default_drb, (drb_id_to_setup_start < 2) ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
xid,
*SRB_configList2,
@@ -1075,7 +1082,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
@@ -1420,7 +1426,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
NR_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid];
NR_DRB_Identity_t *drb_id_p = NULL;
// uint8_t nr_DRB2LCHAN[8];
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
ue_context_pP->ue_context.ue_reestablishment_timer = 0;
@@ -1459,7 +1464,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
NULL,
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
/* Refresh SRBs/DRBs */
if (!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti);
nr_rrc_rlc_config_asn1_req(ctxt_pP,
@@ -1469,49 +1473,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
NULL,
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
}
else if(SRB_configList!=NULL || DRB_configList!=NULL){
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_SETUP_REQ (message_p);
req->gNB_CU_ue_id = 0;
req->gNB_DU_ue_id = 0;
req->rnti = ue_context_pP->ue_context.rnti;
req->mcc = rrc->configuration.mcc[0];
req->mnc = rrc->configuration.mnc[0];
req->mnc_digit_length = rrc->configuration.mnc_digit_length[0];
req->nr_cellid = rrc->nr_cellid;
if(SRB_configList!=NULL){
req->srbs_to_be_setup = malloc(SRB_configList->list.count*sizeof(f1ap_srb_to_be_setup_t));
req->srbs_to_be_setup_length = SRB_configList->list.count;
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
for (int i = 0; i < SRB_configList->list.count; i++){
if(SRB_configList->list.array[i]->srb_Identity > 1){
SRBs[i].srb_id = SRB_configList->list.array[i]->srb_Identity;
SRBs[i].lcid = SRB_configList->list.array[i]->srb_Identity;
}
}
}
if(DRB_configList!=NULL){
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
req->drbs_to_be_setup = malloc(DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
req->drbs_to_be_setup_length = DRB_configList->list.count;
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
LOG_I(RRC, "Length of DRB list:%d, %d \n", DRB_configList->list.count, req->drbs_to_be_setup_length);
for (int i = 0; i < DRB_configList->list.count; i++){
DRBs[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
DRBs[i].rlc_mode = RLC_MODE_AM;
DRBs[i].up_ul_tnl[0].tl_address = inet_addr(rrc->eth_params_s.my_addr);
DRBs[i].up_ul_tnl[0].port=rrc->eth_params_s.my_portd;
DRBs[i].up_ul_tnl_length = 1;
DRBs[i].up_dl_tnl[0].tl_address = inet_addr(rrc->eth_params_s.remote_addr);
DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd;
DRBs[i].up_dl_tnl_length = 1;
}
LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
}
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
}
#endif
/* Set the SRB active in UE context */
@@ -1996,7 +1957,6 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP
gNB_RrcConfigurationReq *configuration = &RC.nrrrc[ctxt_pP->module_id]->configuration;
rrc_mac_config_req_gNB(ctxt_pP->module_id,
configuration->ssb_SubcarrierOffset,
configuration->pdsch_AntennaPorts,
configuration->pusch_AntennaPorts,
configuration->sib1_tda,
@@ -2814,11 +2774,76 @@ rrc_gNB_decode_dcch(
ul_dcch_msg);
}
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
rrc_gNB_generate_dedicatedRRCReconfiguration(ctxt_pP, ue_context_p);
} else {
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
if(!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)){
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
rrc_gNB_generate_dedicatedRRCReconfiguration(ctxt_pP, ue_context_p, NULL);
} else {
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
}
}
else{
/*Generate a UE context setup request message towards the DU to provide the UE
*capability info and get the updates on master cell group config from the DU*/
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_SETUP_REQ (message_p);
//UE_IDs will be extracted from F1AP layer
req->gNB_CU_ue_id = 0;
req->gNB_DU_ue_id = 0;
req->rnti = ue_context_p->ue_context.rnti;
req->mcc = RC.nrrrc[ctxt_pP->module_id]->configuration.mcc[0];
req->mnc = RC.nrrrc[ctxt_pP->module_id]->configuration.mnc[0];
req->mnc_digit_length = RC.nrrrc[ctxt_pP->module_id]->configuration.mnc_digit_length[0];
req->nr_cellid = RC.nrrrc[ctxt_pP->module_id]->nr_cellid;
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
/*Instruction towards the DU for SRB2 configuration*/
req->srbs_to_be_setup = malloc(1*sizeof(f1ap_srb_to_be_setup_t));
req->srbs_to_be_setup_length = 1;
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
SRBs[0].srb_id = 2;
SRBs[0].lcid = 2;
/*Instruction towards the DU for DRB configuration and tunnel creation*/
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
req->drbs_to_be_setup_length = 1;
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
LOG_I(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
DRBs[0].drb_id = 1;
DRBs[0].rlc_mode = RLC_MODE_AM;
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt_pP->module_id]->eth_params_s.my_addr);
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt_pP->module_id]->eth_params_s.my_portd;
DRBs[0].up_ul_tnl_length = 1;
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt_pP->module_id]->eth_params_s.remote_addr);
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt_pP->module_id]->eth_params_s.remote_portd;
DRBs[0].up_dl_tnl_length = 1;
}
if( ul_dcch_msg->message.choice.c1->choice.ueCapabilityInformation->criticalExtensions.present ==
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation ) {
struct NR_UE_CapabilityRAT_ContainerList *ue_CapabilityRAT_ContainerList =
ul_dcch_msg->message.choice.c1->choice.ueCapabilityInformation->criticalExtensions.choice.ueCapabilityInformation->ue_CapabilityRAT_ContainerList;
if(ue_CapabilityRAT_ContainerList!=NULL){
LOG_I(NR_RRC, "ue_CapabilityRAT_ContainerList is present \n");
req->cu_to_du_rrc_information = calloc(1,sizeof(cu_to_du_rrc_information_t));
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList = calloc(1,4096);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_CapabilityRAT_ContainerList,
NULL,
ue_CapabilityRAT_ContainerList,
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList,
4096);
AssertFatal (enc_rval.encoded > 0, "ASN1 ue_CapabilityRAT_ContainerList encoding failed (%s, %jd)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length = (enc_rval.encoded+7)>>3;
}
else{
LOG_I(NR_RRC, "ue_CapabilityRAT_ContainerList is not present \n");
}
}
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
}
break;
@@ -2931,11 +2956,8 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
memset(mib->message.choice.mib,0,sizeof(struct NR_MIB));
memcpy(mib->message.choice.mib, mib_DU->message.choice.mib, sizeof(struct NR_MIB));
rrc->carrier.SIB1 = malloc(f1_setup_req->sib1_length[i]);
rrc->carrier.sizeof_SIB1 = f1_setup_req->sib1_length[i];
memcpy((void *)rrc->carrier.SIB1,f1_setup_req->sib1[i],f1_setup_req->sib1_length[i]);
dec_rval = uper_decode_complete(NULL,
&asn_DEF_NR_BCCH_DL_SCH_Message,
&asn_DEF_NR_SIB1, //&asn_DEF_NR_BCCH_DL_SCH_Message,
(void **)&rrc->carrier.siblock1_DU,
f1_setup_req->sib1[i],
f1_setup_req->sib1_length[i]);
@@ -2945,12 +2967,12 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
dec_rval.consumed );
// Parse message and extract SystemInformationBlockType1 field
NR_BCCH_DL_SCH_Message_t *bcch_message = rrc->carrier.siblock1_DU;
AssertFatal(bcch_message->message.present == NR_BCCH_DL_SCH_MessageType_PR_c1,
"bcch_message->message.present != NR_BCCH_DL_SCH_MessageType_PR_c1\n");
AssertFatal(bcch_message->message.choice.c1->present == NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1,
"bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
rrc->carrier.sib1 = rrc->carrier.siblock1_DU;
if ( LOG_DEBUGFLAG(DEBUG_ASN1)){
LOG_I(NR_RRC, "Printing received SIB1 container inside F1 setup request message:\n");
xer_fprint(stdout, &asn_DEF_NR_SIB1,(void *)rrc->carrier.sib1);
}
rrc->carrier.physCellId = f1_setup_req->cell[i].nr_pci;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).gNB_CU_name = rrc->node_name;
@@ -3278,6 +3300,94 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(message_p);
uint32_t incoming_teid = 0;
if(req->cu_to_du_rrc_information!=NULL){
if(req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList!=NULL){
LOG_I(NR_RRC, "Length of ue_CapabilityRAT_ContainerList is: %d \n", (int) req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length);
struct NR_UE_CapabilityRAT_ContainerList *ue_CapabilityRAT_ContainerList = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_UE_CapabilityRAT_ContainerList,
(void **)&ue_CapabilityRAT_ContainerList,
(uint8_t *)req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList,
(int) req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
AssertFatal(1==0,"UE Capability RAT ContainerList decode error\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_UE_CapabilityRAT_ContainerList, ue_CapabilityRAT_ContainerList, 1 );
return;
}
//To fill ue_context.UE_Capability_MRDC, ue_context.UE_Capability_nr ...
int NR_index = -1;
for(int i = 0;i < ue_CapabilityRAT_ContainerList->list.count; i++){
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
NR_RAT_Type_nr){
LOG_I(NR_RRC, "DU received NR_RAT_Type_nr UE capabilities Info through the UE Context Setup Request from the CU \n");
if(ue_context_p->ue_context.UE_Capability_nr){
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
ue_context_p->ue_context.UE_Capability_nr = 0;
}
dec_rval = uper_decode(NULL,
&asn_DEF_NR_UE_NR_Capability,
(void**)&ue_context_p->ue_context.UE_Capability_nr,
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.buf,
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size,
0,0);
if(LOG_DEBUGFLAG(DEBUG_ASN1)){
xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
}
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)){
LOG_E(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" Failed to decode nr UE capabilities (%zu bytes)\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(&ctxt),dec_rval.consumed);
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
ue_context_p->ue_context.UE_Capability_nr = 0;
}
ue_context_p->ue_context.UE_Capability_size =
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size;
if(NR_index != -1){
LOG_E(NR_RRC,"fatal: more than 1 eutra capability\n");
exit(1);
}
NR_index = i;
}
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
NR_RAT_Type_eutra_nr){
LOG_I(NR_RRC, "DU received NR_RAT_Type_eutra_nr UE capabilities Info through the UE Context Setup Request from the CU \n");
if(ue_context_p->ue_context.UE_Capability_MRDC){
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
ue_context_p->ue_context.UE_Capability_MRDC = 0;
}
dec_rval = uper_decode(NULL,
&asn_DEF_NR_UE_MRDC_Capability,
(void**)&ue_context_p->ue_context.UE_Capability_MRDC,
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.buf,
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size,
0,0);
if(LOG_DEBUGFLAG(DEBUG_ASN1)){
xer_fprint(stdout,&asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
}
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)){
LOG_E(NR_RRC,PROTOCOL_NR_RRC_CTXT_FMT" Failed to decode nr UE capabilities (%zu bytes)\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(&ctxt),dec_rval.consumed);
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,ue_context_p->ue_context.UE_Capability_MRDC);
ue_context_p->ue_context.UE_Capability_MRDC = 0;
}
ue_context_p->ue_context.UE_MRDC_Capability_size =
ue_CapabilityRAT_ContainerList->list.array[i]->ue_CapabilityRAT_Container.size;
}
if(ue_CapabilityRAT_ContainerList->list.array[i]->rat_Type ==
NR_RAT_Type_eutra){
//TODO
}
}
}
}
uint8_t drb_id_to_setup_start = 0;
uint8_t nb_drb_to_setup = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
@@ -3331,11 +3441,25 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
}
}
NR_CellGroupConfig_t *cellGroupConfig;
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup, rrc->um_on_default_drb, SRB2_config ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
if (req->srbs_to_be_setup_length > 0 || req->drbs_to_be_setup_length>0)
// FIXME: fill_mastercellGroupConfig() won't fill the right priorities or
// bearer IDs for the DRBs
fill_mastercellGroupConfig(cellGroupConfig, ue_context_p->ue_context.masterCellGroup, rrc->um_on_default_drb, SRB2_config ? 1 : 0, drb_id_to_setup_start, nb_drb_to_setup, drb_priority);
apply_macrlc_config(rrc, ue_context_p, &ctxt);
if(req->rrc_container_length > 0){
mem_block_t *pdcp_pdu_p = get_free_mem_block(req->rrc_container_length, __func__);
memcpy(&pdcp_pdu_p->data[0], req->rrc_container, req->rrc_container_length);
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, req->rrc_container_length, pdcp_pdu_p);
LOG_I(F1AP, "Printing RRC Container of UE context setup request: \n");
for (int j=0; j<req->rrc_container_length; j++){
printf("%02x ", pdcp_pdu_p->data[j]);
}
printf("\n");
}
/* Fill the UE context setup response ITTI message to send to F1AP */
resp->gNB_CU_ue_id = req->gNB_CU_ue_id;
resp->rnti = ctxt.rnti;
@@ -3370,17 +3494,174 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
else{
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context setup request at the DU\n");
}
resp->du_to_cu_rrc_information = calloc(1,1024*sizeof(uint8_t));
/* fixme:
* Here we should be encoding the updates on cellgroupconfig based on the content of UE capabilities
*/
resp->du_to_cu_rrc_information = calloc(1, sizeof(du_to_cu_rrc_information_t));
resp->du_to_cu_rrc_information->cellGroupConfig = calloc(1,1024);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
(void *)cellGroupConfig,
resp->du_to_cu_rrc_information,
ue_context_p->ue_context.masterCellGroup, //(void *)cellGroupConfig,
resp->du_to_cu_rrc_information->cellGroupConfig,
1024);
resp->du_to_cu_rrc_information_length = (enc_rval.encoded+7)>>3;
if (enc_rval.encoded == -1) {
LOG_E(F1AP,"Could not encode ue_context.masterCellGroup, failed element %s\n",enc_rval.failed_type->name);
exit(-1);
}
resp->du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded+7)>>3;
free(cellGroupConfig);
itti_send_msg_to_task (TASK_DU_F1, ctxt.module_id, message_p);
}
static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * req=&F1AP_UE_CONTEXT_MODIFICATION_REQ(msg_p);
protocol_ctxt_t ctxt;
ctxt.rnti = req->rnti;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
gNB_MAC_INST *mac = RC.nrmac[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p =
rrc_gNB_get_ue_context(rrc, ctxt.rnti);
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_RESP);
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_MODIFICATION_RESP(message_p);
uint32_t incoming_teid = 0;
NR_CellGroupConfig_t *cellGroupConfig = NULL;
/* Configure SRB2 */
NR_SRB_ToAddMod_t *SRB2_config = NULL;
NR_SRB_ToAddModList_t *SRB_configList = NULL;
uint8_t SRBs_before_new_addition = 0;
if(req->srbs_to_be_setup_length>0){
if(ue_context_p->ue_context.SRB_configList == NULL){
LOG_W(NR_RRC, "The SRB list of the UE context is empty before the addition of new SRB at the DU \n");
ue_context_p->ue_context.SRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.SRB_configList));
}
SRB_configList = ue_context_p->ue_context.SRB_configList;
SRBs_before_new_addition = SRB_configList->list.count;
for (int i=0; i<req->srbs_to_be_setup_length; i++){
SRB2_config = CALLOC(1, sizeof(*SRB2_config));
SRB2_config->srb_Identity = req->srbs_to_be_setup[i].srb_id;
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config);
}
}
/* Configure DRB */
NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t *DRB_configList = NULL;
if(req->drbs_to_be_setup_length>0){
if(ue_context_p->ue_context.DRB_configList == NULL){
ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList));
}
DRB_configList = ue_context_p->ue_context.DRB_configList;
for (int i=0; i<req->drbs_to_be_setup_length; i++){
DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id;
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i];
transport_layer_addr_t addr;
memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8;
extern instance_t DUuniqInstance;
incoming_teid=newGtpuCreateTunnel(DUuniqInstance,
req->rnti,
drb_p.drb_id,
drb_p.drb_id,
drb_p.up_ul_tnl[0].teid,
addr,
drb_p.up_ul_tnl[0].port,
DURecvCb);
}
}
if(req->srbs_to_be_setup_length>0 || req->drbs_to_be_setup_length>0){
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
uint8_t drb_id_to_setup_start = 1;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
fill_mastercellGroupConfig(cellGroupConfig,
ue_context_p->ue_context.masterCellGroup,
rrc->um_on_default_drb,
drb_id_to_setup_start < 2 ? 1 : 0,
drb_id_to_setup_start,
req->drbs_to_be_setup_length,
drb_priority);
apply_macrlc_config(rrc, ue_context_p, &ctxt);
}
if(req->ReconfigComplOutcome == RRCreconf_failure){
LOG_W(NR_RRC, "CU reporting RRC Reconfiguration failure \n");
}
else if(req->ReconfigComplOutcome == RRCreconf_success){
LOG_I(NR_RRC, "CU reporting RRC Reconfiguration success \n");
if(ue_context_p->ue_context.DRB_configList!=NULL){
LOG_I(NR_RRC, "Send first DDD buffer status reporting towards the CU through an ITTI message to gtp-u \n");
uint8_t drb_id = ue_context_p->ue_context.DRB_configList->list.array[0]->drb_Identity;
rnti_t rnti = ue_context_p->ue_context.rnti;
int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(rnti, drb_id);
LOG_I(NR_RRC, "Reported in DDD drb_id:%d, rnti:%d\n", drb_id, rnti);
MessageDef *msg = itti_alloc_new_message_sized(TASK_RRC_GNB, 0, GTPV1U_DU_BUFFER_REPORT_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t));
gtpv1u_DU_buffer_report_req_t *req=&GTPV1U_DU_BUFFER_REPORT_REQ(msg);
req->pdusession_id = drb_id;
req->rnti = rnti;
req->buffer_availability = rlc_tx_buffer_space; //10000000; //Hardcoding to be removed and read the actual RLC buffer availability instead
extern instance_t DUuniqInstance;
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
}
}
/* Fill the UE context setup response ITTI message to send to F1AP */
resp->gNB_CU_ue_id = req->gNB_CU_ue_id;
resp->rnti = ctxt.rnti;
if(DRB_configList){
if(DRB_configList->list.count > 0){
resp->drbs_to_be_setup = calloc(1,DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
resp->drbs_to_be_setup_length = DRB_configList->list.count;
for (int i=0; i<DRB_configList->list.count; i++){
resp->drbs_to_be_setup[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
resp->drbs_to_be_setup[i].rlc_mode = RLC_MODE_AM;
resp->drbs_to_be_setup[i].up_dl_tnl[0].teid = incoming_teid;
resp->drbs_to_be_setup[i].up_dl_tnl[0].tl_address = inet_addr(mac->eth_params_n.my_addr);
resp->drbs_to_be_setup[i].up_dl_tnl_length = 1;
}
}
else{
LOG_W(NR_RRC, "No DRB added upon reception of F1 UE context modification request with a DRB to setup list\n");
}
}
if(SRB_configList){
if(SRB_configList->list.count >0 && SRBs_before_new_addition < SRB_configList->list.count){
resp->srbs_to_be_setup = calloc(1,req->srbs_to_be_setup_length*sizeof(f1ap_srb_to_be_setup_t));
resp->srbs_to_be_setup_length = req->srbs_to_be_setup_length;
for (int i=SRBs_before_new_addition; i<SRB_configList->list.count; i++){
resp->srbs_to_be_setup[i-SRBs_before_new_addition].srb_id = SRB_configList->list.array[i]->srb_Identity;
}
}
else{
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context modification request at the DU\n");
}
}
else{
LOG_W(NR_RRC, "No SRB added upon reception of F1 UE Context modification request at the DU\n");
}
//if(cellGroupConfig != NULL) {
resp->du_to_cu_rrc_information = calloc(1,sizeof(du_to_cu_rrc_information_t));
resp->du_to_cu_rrc_information->cellGroupConfig = calloc(1,1024);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
ue_context_p->ue_context.masterCellGroup, //(void *)cellGroupConfig,
resp->du_to_cu_rrc_information->cellGroupConfig,
1024);
resp->du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded+7)>>3;
//}
itti_send_msg_to_task (TASK_DU_F1, ctxt.module_id, message_p);
}
static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
@@ -3396,8 +3677,8 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_CellGroupConfig,
(void **)&cellGroupConfig,
(uint8_t *)resp->du_to_cu_rrc_information,
(int) resp->du_to_cu_rrc_information_length);
(uint8_t *)resp->du_to_cu_rrc_information->cellGroupConfig,
(int) resp->du_to_cu_rrc_information->cellGroupConfig_length);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
AssertFatal(1==0,"Cell group config decode error\n");
@@ -3412,20 +3693,89 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
}
if(cellGroupConfig->rlc_BearerToAddModList!=NULL){
if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){
LOG_I(NR_RRC, "rlc_BearerToAddModList not empty before filling it \n");
free(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList);
int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count;
for(int i=ue_ctxt_rlc_Bearers; i<ue_ctxt_rlc_Bearers + cellGroupConfig->rlc_BearerToAddModList->list.count; i++){
ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list,
cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]);
}
}
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
else{
LOG_W(NR_RRC, "Empty rlc_BearerToAddModList at ue_context of the CU before filling the updates from UE context setup response \n");
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
sizeof(*cellGroupConfig->rlc_BearerToAddModList));
}
}
xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup);
if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig);
} else {
rrc_gNB_generate_defaultRRCReconfiguration(&ctxt, ue_context_p);
}
free(cellGroupConfig->rlc_BearerToAddModList);
free(cellGroupConfig);
}
static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, const char *msg_name, instance_t instance){
f1ap_ue_context_setup_t * resp=&F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
protocol_ctxt_t ctxt;
ctxt.rnti = resp->rnti;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
ctxt.eNB_index = instance;
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(rrc, ctxt.rnti);
NR_CellGroupConfig_t *cellGroupConfig = NULL;
if(resp->du_to_cu_rrc_information->cellGroupConfig!=NULL){
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_CellGroupConfig,
(void **)&cellGroupConfig,
(uint8_t *)resp->du_to_cu_rrc_information->cellGroupConfig,
(int) resp->du_to_cu_rrc_information->cellGroupConfig_length);
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
AssertFatal(1==0,"Cell group config decode error\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_CellGroupConfig, cellGroupConfig, 1 );
return;
}
//xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, cellGroupConfig);
if(ue_context_p->ue_context.masterCellGroup == NULL){
ue_context_p->ue_context.masterCellGroup = calloc(1, sizeof(NR_CellGroupConfig_t));
}
if(cellGroupConfig->rlc_BearerToAddModList!=NULL){
if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){
int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count;
for(int i=ue_ctxt_rlc_Bearers; i<ue_ctxt_rlc_Bearers + cellGroupConfig->rlc_BearerToAddModList->list.count; i++){
ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list,
cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]);
}
}
else{
LOG_W(NR_RRC, "Empty rlc_BearerToAddModList at ue_context of the CU before filling the updates from UE context setup response \n");
ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
memcpy(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList, cellGroupConfig->rlc_BearerToAddModList,
sizeof(*cellGroupConfig->rlc_BearerToAddModList));
}
}
LOG_I(NR_RRC, "Updated master cell group configuration stored at the UE context of the CU:\n");
xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup);
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig);
free(cellGroupConfig->rlc_BearerToAddModList);
free(cellGroupConfig);
}
}
unsigned int mask_flip(unsigned int x) {
return((((x>>8) + (x<<8))&0xffff)>>6);
}
@@ -3627,15 +3977,27 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
// Remove here the MAC and RRC context when RRC is not connected or gNB is not connected to CN5G
if(ue_context_p->ue_context.StatusRrc < NR_RRC_CONNECTED || ue_context_p->ue_context.gNB_ue_ngap_id == 0) {
mac_remove_nr_ue(nrmac, ctxt_pP->rnti);
rrc_rlc_remove_ue(ctxt_pP);
pdcp_remove_UE(ctxt_pP);
if(!NODE_IS_CU(RC.nrrrc[ctxt_pP->instance]->node_type)){
mac_remove_nr_ue(nrmac, ctxt_pP->rnti);
rrc_rlc_remove_ue(ctxt_pP);
pdcp_remove_UE(ctxt_pP);
/* remove RRC UE Context */
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti);
if (ue_context_p) {
rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p);
LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti);
/* remove RRC UE Context */
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti);
if (ue_context_p) {
rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p);
LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti);
}
}
// In case of CU trigger UE context release command towards the DU
else{
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD);
f1ap_ue_context_release_cmd_t *rel_cmd=&F1AP_UE_CONTEXT_RELEASE_CMD (message_p);
rel_cmd->rnti = ctxt_pP->rnti;
rel_cmd->cause = F1AP_CAUSE_RADIO_NETWORK;
rel_cmd->cause_value = 10; // 10 = F1AP_CauseRadioNetwork_normal_release
itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, message_p);
}
}
@@ -3821,17 +4183,30 @@ void *rrc_gnb_task(void *args_p) {
rrc_gNB_process_f1_setup_req(&F1AP_SETUP_REQ(msg_p));
break;
case NR_DU_RRC_DL_INDICATION:
rrc_process_DU_DL(msg_p, msg_name_p, instance);
break;
case NR_DU_RRC_DL_INDICATION:
rrc_process_DU_DL(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_SETUP_REQ:
rrc_DU_process_ue_context_setup_request(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_SETUP_REQ:
rrc_DU_process_ue_context_setup_request(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_SETUP_RESP:
rrc_CU_process_ue_context_setup_response(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_SETUP_RESP:
rrc_CU_process_ue_context_setup_response(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_MODIFICATION_RESP:
rrc_CU_process_ue_context_modification_response(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
rrc_DU_process_ue_context_modification_request(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_RELEASE_CMD:
LOG_W(NR_RRC, "Received F1AP_UE_CONTEXT_RELEASE_CMD for processing at the RRC layer of the DU. Processing function "
"implementation is pending\n");
break;
/* Messages from X2AP */
case X2AP_ENDC_SGNB_ADDITION_REQ:
@@ -4102,5 +4477,6 @@ void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe)
message_p = itti_alloc_new_message(TASK_RRC_GNB, 0, RRC_SUBFRAME_PROCESS);
RRC_SUBFRAME_PROCESS(message_p).ctxt = *ctxt;
RRC_SUBFRAME_PROCESS(message_p).CC_id = CC_id;
LOG_D(NR_RRC, "Time in RRC: %u/ %u \n", frame, subframe);
itti_send_msg_to_task(TASK_RRC_GNB, ctxt->module_id, message_p);
}
+40 -2
View File
@@ -307,7 +307,6 @@ nr_rrc_pdcp_config_security(
//uint8_t *k_kdf = NULL;
static int print_keys= 1;
/* Derive the keys from kgnb */
if (SRB_configList != NULL) {
nr_derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
@@ -1050,7 +1049,46 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
// TEST
// ue_context_p->ue_context.pdusession[0].status = PDU_SESSION_STATUS_DONE;
// rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(&ctxt, ue_context_p, 0);
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p);
if(!NODE_IS_CU(RC.nrrrc[ctxt.module_id]->node_type)){
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, NULL);
}
else{
/*Generate a UE context modification request message towards the DU to instruct the DU
*for SRB2 and DRB configuration and get the updates on master cell group config from the DU*/
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_MODIFICATION_REQ (message_p);
req->rnti = ue_context_p->ue_context.rnti;
req->mcc = RC.nrrrc[ctxt.module_id]->configuration.mcc[0];
req->mnc = RC.nrrrc[ctxt.module_id]->configuration.mnc[0];
req->mnc_digit_length = RC.nrrrc[ctxt.module_id]->configuration.mnc_digit_length[0];
req->nr_cellid = RC.nrrrc[ctxt.module_id]->nr_cellid;
/*Instruction towards the DU for SRB2 configuration*/
req->srbs_to_be_setup = malloc(1*sizeof(f1ap_srb_to_be_setup_t));
req->srbs_to_be_setup_length = 1;
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
SRBs[0].srb_id = 2;
SRBs[0].lcid = 2;
/*Instruction towards the DU for DRB configuration and tunnel creation*/
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
req->drbs_to_be_setup_length = 1;
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
LOG_D(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
DRBs[0].drb_id = 1;
DRBs[0].rlc_mode = RLC_MODE_AM;
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.my_addr);
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.my_portd;
DRBs[0].up_ul_tnl_length = 1;
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.remote_addr);
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.remote_portd;
DRBs[0].up_dl_tnl_length = 1;
itti_send_msg_to_task (TASK_CU_F1, ctxt.module_id, message_p);
}
return(0);
}
}
-2
View File
@@ -349,7 +349,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
// configure MAC and RLC
if (NODE_IS_DU(rrc->node_type)) {
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
@@ -362,7 +361,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
ue_context_p->ue_context.secondaryCellGroup);
} else {
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
+41 -142
View File
@@ -337,128 +337,26 @@ void fill_default_nsa_uplinkBWP(NR_BWP_Uplink_t *ubwp,
/// BWP dedicated configuration
if (!ubwp->bwp_Dedicated) {
if (!ubwp->bwp_Dedicated)
ubwp->bwp_Dedicated = calloc(1,sizeof(*ubwp->bwp_Dedicated));
}
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,275);
ubwp->bwp_Dedicated->pucch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pucch_Config));
ubwp->bwp_Dedicated->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
ubwp->bwp_Dedicated->pucch_Config->choice.setup=pucch_Config;
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
pucch_Config->resourceSetToReleaseList = NULL;
NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
pucchresset0->pucch_ResourceSetId = 0;
NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
*pucchresset0id0=1;
ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
pucchresset0->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
pucchresset1->pucch_ResourceSetId = 1;
NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
*pucchresset1id0=2;
ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
pucchresset1->maxPayloadSize=NULL;
ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
pucch_Config->resourceToReleaseList = NULL;
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
config_pucch_resset1(pucch_Config, NULL);
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
int curr_bwp = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,275);
pucchres0->pucch_ResourceId=1;
pucchres0->startingPRB= (8 + uid) % curr_bwp;
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
pucchres0->format.choice.format0->initialCyclicShift=0;
pucchres0->format.choice.format0->nrofSymbols=1;
pucchres0->format.choice.format0->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
pucchres2->pucch_ResourceId=2;
pucchres2->startingPRB=0;
pucchres2->intraSlotFrequencyHopping=NULL;
pucchres2->secondHopPRB=NULL;
pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
pucchres2->format.choice.format2->nrofPRBs=8;
pucchres2->format.choice.format2->nrofSymbols=1;
pucchres2->format.choice.format2->startingSymbolIndex=13;
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
pucch_Config->format2->choice.setup = pucchfmt2;
pucchfmt2->interslotFrequencyHopping=NULL;
pucchfmt2->additionalDMRS=NULL;
pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
*pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
pucchfmt2->nrofSlots=NULL;
pucchfmt2->pi2BPSK=NULL;
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
// for scheduling requestresource
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
schedulingRequestResourceConfig->schedulingRequestID = 0;
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10;
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl10 = 7;
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
*schedulingRequestResourceConfig->resource = 1;
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
pucch_Config->schedulingRequestResourceToReleaseList=NULL;
pucch_Config->multi_CSI_PUCCH_ResourceList=NULL;
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
long *delay[8];
for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i]));
*delay[i] = i + configuration->minRXTXTIME;
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
}
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
pucchspatial->pucch_SpatialRelationInfoId = 1;
pucchspatial->servingCellId = NULL;
if(configuration->do_CSIRS) {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
}
else {
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
pucchspatial->referenceSignal.choice.ssb_Index = 0;
}
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
pucchspatial->p0_PUCCH_Id = 1;
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
pucch_Config->spatialRelationInfoToReleaseList=NULL;
pucch_Config->pucch_PowerControl=calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = 0;
pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4));
*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = 0;
pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
p00->p0_PUCCH_Id=1;
p00->p0_PUCCH_Value = 0;
ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
pucch_Config->pucch_PowerControl->pathlossReferenceRSs = NULL;
scheduling_request_config(servingcellconfigcommon, pucch_Config);
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
ubwp->bwp_Dedicated->pusch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pusch_Config));
ubwp->bwp_Dedicated->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
@@ -648,40 +546,33 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList));
ASN_SEQUENCE_ADD(&secondaryCellGroup->rlc_BearerToAddModList->list, RLC_BearerConfig);
secondaryCellGroup->mac_CellGroupConfig=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig));
secondaryCellGroup->mac_CellGroupConfig->drx_Config = NULL;
secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig));
secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
NR_SchedulingRequestToAddMod_t *SchedulingRequestConf = calloc(1,sizeof(*SchedulingRequestConf));
SchedulingRequestConf->schedulingRequestId = 0; //Could be changed
SchedulingRequestConf->sr_ProhibitTimer = calloc(1,sizeof(*SchedulingRequestConf->sr_ProhibitTimer));
*SchedulingRequestConf->sr_ProhibitTimer = NR_SchedulingRequestToAddMod__sr_ProhibitTimer_ms16;
SchedulingRequestConf->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n32;
ASN_SEQUENCE_ADD(&secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list,SchedulingRequestConf);
secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToReleaseList = NULL;
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = secondaryCellGroup->mac_CellGroupConfig;
secondaryCellGroup->mac_CellGroupConfig->bsr_Config=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->bsr_Config));
secondaryCellGroup->mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
secondaryCellGroup->mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf160;
secondaryCellGroup->mac_CellGroupConfig->tag_Config=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->tag_Config));
secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList));
mac_CellGroupConfig=calloc(1,sizeof(*mac_CellGroupConfig));
mac_CellGroupConfig->drx_Config = NULL;
mac_CellGroupConfig->bsr_Config=calloc(1,sizeof(*mac_CellGroupConfig->bsr_Config));
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf160;
mac_CellGroupConfig->tag_Config=calloc(1,sizeof(*mac_CellGroupConfig->tag_Config));
mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
struct NR_TAG *tag=calloc(1,sizeof(*tag));
tag->tag_Id = 0;
tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
ASN_SEQUENCE_ADD(&secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
secondaryCellGroup->mac_CellGroupConfig->phr_Config = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->phr_Config));
secondaryCellGroup->mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup));
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf20;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf0;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB3;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->multiplePHR=false;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->dummy=false;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_Type2OtherCell = false;
secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_ModeOtherCG = NR_PHR_Config__phr_ModeOtherCG_real;
secondaryCellGroup->mac_CellGroupConfig->skipUplinkTxDynamic=false;
secondaryCellGroup->mac_CellGroupConfig->ext1 = NULL;
ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
mac_CellGroupConfig->phr_Config = calloc(1,sizeof(*mac_CellGroupConfig->phr_Config));
mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
mac_CellGroupConfig->phr_Config->choice.setup = calloc(1,sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf20;
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf0;
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB3;
mac_CellGroupConfig->phr_Config->choice.setup->multiplePHR=false;
mac_CellGroupConfig->phr_Config->choice.setup->dummy=false;
mac_CellGroupConfig->phr_Config->choice.setup->phr_Type2OtherCell = false;
mac_CellGroupConfig->phr_Config->choice.setup->phr_ModeOtherCG = NR_PHR_Config__phr_ModeOtherCG_real;
mac_CellGroupConfig->skipUplinkTxDynamic=false;
mac_CellGroupConfig->ext1 = NULL;
secondaryCellGroup->physicalCellGroupConfig = calloc(1,sizeof(*secondaryCellGroup->physicalCellGroupConfig));
secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH=NULL;
secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH=NULL;
@@ -1140,6 +1031,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList= NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToReleaseList = NULL;
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
struct NR_SchedulingRequestToAddMod *schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
schedulingrequestlist->schedulingRequestId = 0;
schedulingrequestlist->sr_ProhibitTimer = NULL;
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig));
NR_PUSCH_ServingCellConfig_t *pusch_scc = calloc(1,sizeof(*pusch_scc));
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->present = NR_SetupRelease_PUSCH_ServingCellConfig_PR_setup;