Commit 6c1c711e authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

1. NR gNB Application use ITTI transmit config. to RRC

2.NR RRC do_SERVINGCELLCONFIGCOMMON for all of common config. will be transmit to lower layer by rrc_mac_config_req_gNB"
parent 5e1c6029
......@@ -364,9 +364,9 @@ file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
set(nr_rrc_h ${nr_rrc_h} ${NR_RRC_FULL_DIR}/asn1_constants.h)
set_source_files_properties(${nr_rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c)
include_directories ("${NR_RRC_FULL_DIR}")
#add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
# ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c)
#include_directories ("${NR_RRC_FULL_DIR}")
# add the command to generate the source code
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
......
......@@ -91,7 +91,7 @@ typedef struct {
/// NB_IoT RRC context variables
//struct eNB_RRC_INST_NB_IoT_s **nb_iot_rrc;
/// NR RRC context variables
struct gNB_RRC_INST_s **nr_rrc;
struct gNB_RRC_INST_s **nrrrc;
/// MAC context variables
struct eNB_MAC_INST_s **mac;
/// NB_IoT MAC context variables
......
......@@ -84,6 +84,10 @@ typedef boolean_t eNB_flag_t;
#define ENB_FLAG_NO FALSE
#define ENB_FLAG_YES TRUE
typedef boolean_t gNB_flag_t;
#define GNB_FLAG_NO FALSE
#define GNB_FLAG_YES TRUE
typedef boolean_t srb_flag_t;
#define SRB_FLAG_NO FALSE
#define SRB_FLAG_YES TRUE
......@@ -236,6 +240,9 @@ typedef struct protocol_ctxt_s {
#define UE_INSTANCE_TO_MODULE_ID( iNSTANCE ) iNSTANCE - NB_eNB_INST
#define ENB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
//NR
#define GNB_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD
#define GNB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
#define MODULE_ID_TO_INSTANCE(mODULE_iD, iNSTANCE, eNB_fLAG) \
if(eNB_fLAG == ENB_FLAG_YES) \
......
......@@ -280,28 +280,34 @@ typedef struct NRRrcConfigurationReq_s {
//NR DL SCS-SpecificCarrier
uint32_t DL_offsetToCarrier[MAX_NUM_CCs];
long DL_SubcarrierSpacing[MAX_NUM_CCs];
long DL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
long DL_SCS_SpecificCarrier_k0[MAX_NUM_CCs];
uint32_t DL_carrierBandwidth[MAX_NUM_CCs];
//NR BWP-DownlinkCommon
uint32_t DL_locationAndBandwidth[MAX_NUM_CCs];
long DL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
lte_prefix_type_t DL_BWP_prefix_type[MAX_NUM_CCs];
//NR FrequencyInfoUL
long UL_FreqBandIndicatorNR[MAX_NUM_CCs];
long UL_absoluteFrequencyPointA[MAX_NUM_CCs];
long FrequencyInfoUL_p_Max[MAX_NUM_CCs];
long frequencyShift7p5khz[MAX_NUM_CCs];
lte_prefix_type_t UL_additionalSpectrumEmission[MAX_NUM_CCs]
long UL_p_Max[MAX_NUM_CCs];
long ULfrequencyShift7p5khz[MAX_NUM_CCs];
//NR UL SCS-SpecificCarrier
uint32_t UL_offsetToCarrier[MAX_NUM_CCs];
long UL_SubcarrierSpacing[MAX_NUM_CCs];
long UL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
long UL_SCS_SpecificCarrier_k0[MAX_NUM_CCs];
uint32_t UL_carrierBandwidth[MAX_NUM_CCs];
// NR BWP-UplinkCommon
uint32_t UL_locationAndBandwidth[MAX_NUM_CCs];
long UL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs];
long ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon
long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon
long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access
......@@ -394,6 +400,7 @@ typedef struct NRRrcConfigurationReq_s {
long PDCCH_interleaverSize[MAX_NUM_CCs];
long PDCCH_shiftIndex[MAX_NUM_CCs];
long PDCCH_precoderGranularity[MAX_NUM_CCs]; //Corresponds to L1 parameter 'CORESET-precoder-granuality'
long PDCCH_TCI_StateId[MAX_NUM_CCs];
BOOLEAN_t tci_PresentInDCI[MAX_NUM_CCs];
//NR PDCCH-ConfigCommon commonSearchSpaces
......
......@@ -92,7 +92,7 @@ static void configure_nrrrc(uint32_t gnb_id)
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (RC.nr_rrc[gnb_id]) {
RCconfig_NRRRC(msg_p,gnb_id, RC.nr_rrc[gnb_id]);
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n");
......
......@@ -67,31 +67,34 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
//NR DL SCS-SpecificCarrier
uint32_t DL_offsetToCarrier = 0;
int32_t DL_SubcarrierSpacing = 0;
int32_t DL_SCS_SubcarrierSpacing = 0;
int32_t DL_SCS_SpecificCarrier_k0 = 0;
uint32_t DL_carrierBandwidth = 0;
// NR BWP-DownlinkCommon
uint32_t DL_locationAndBandwidth = 0;
long DL_BWP_SubcarrierSpacing = 0;
char* DL_BWP_prefix_type = NULL;
//NR FrequencyInfoUL
int32_t UL_FreqBandIndicatorNR = 0;
int32_t UL_absoluteFrequencyPointA = 0;
int32_t FrequencyInfoUL_p_Max = 0;
int32_t frequencyShift7p5khz = 0;
uint32_t UL_additionalSpectrumEmission = 0;
int32_t UL_p_Max = 0;
int32_t UL_frequencyShift7p5khz = 0;
//NR UL SCS-SpecificCarrier
uint32_t UL_offsetToCarrier = 0;
int32_t UL_SubcarrierSpacing = 0;
int32_t UL_SCS_SubcarrierSpacing = 0;
int32_t UL_SCS_SpecificCarrier_k0 = 0;
uint32_t UL_carrierBandwidth = 0;
// NR BWP-UplinkCommon
uint32_t UL_locationAndBandwidth = 0;
long UL_BWP_SubcarrierSpacing = 0;
char* UL_BWP_prefix_type = NULL;
int32_t subCarrierSpacingCommon = 0;
uint32_t pdcch_ConfigSIB1 = 0;
int32_t frequencyOffsetSSB = 0;
int32_t ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0;
int32_t ServingCellConfigCommon_ssb_periodicityServingCell = 0;
int32_t ServingCellConfigCommon_dmrs_TypeA_Position = 0;
int32_t NIA_SubcarrierSpacing = 0;
......@@ -489,19 +492,19 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, DL_offsetToCarrier);
}
if (strcmp(DL_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
if (strcmp(DL_SCS_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, DL_SubcarrierSpacing);
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_SCS_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, DL_SCS_SubcarrierSpacing);
}
switch (DL_SCS_SpecificCarrier_k0) {
......@@ -536,6 +539,33 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, DL_locationAndBandwidth);
}
if (strcmp(DL_BWP_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_BWP_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, DL_BWP_SubcarrierSpacing);
}
if (!DL_BWP_prefix_type){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d define %s: NORMAL,EXTENDED!\n",
RC.config_file_name, i, GNB_CONFIG_STRING_DL_PREFIX_TYPE);
}else if (strcmp(DL_BWP_prefix_type, "NORMAL") == 0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_prefix_type[j] = NORMAL;
}else if (strcmp(DL_BWP_prefix_type, "EXTENDED") == 0) {
NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_prefix_type[j] = EXTENDED;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_BWP_prefix_type choice: NORMAL or EXTENDED !\n",
RC.config_file_name, i, DL_BWP_prefix_type);
}
/////////////////////////////////NR FrequencyInfoUL//////////////////////////////
NRRRC_CONFIGURATION_REQ (msg_p).UL_FreqBandIndicatorNR[j] = UL_FreqBandIndicatorNR;
if ((UL_FreqBandIndicatorNR <1) || (UL_FreqBandIndicatorNR > 1024)){
......@@ -549,14 +579,22 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, UL_absoluteFrequencyPointA);
}
NRRRC_CONFIGURATION_REQ (msg_p).FrequencyInfoUL_p_Max[j] = FrequencyInfoUL_p_Max;
if ((FrequencyInfoUL_p_Max <-30) || (FrequencyInfoUL_p_Max > 33)){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for FrequencyInfoUL_p_Max choice: -30..33 !\n",
RC.config_file_name, i, FrequencyInfoUL_p_Max);
NRRRC_CONFIGURATION_REQ (msg_p).UL_additionalSpectrumEmission[j] = UL_additionalSpectrumEmission;
if ((UL_additionalSpectrumEmission <0) || (UL_additionalSpectrumEmission > 7)){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for UL_additionalSpectrumEmission choice: 0..7 !\n",
RC.config_file_name, i, UL_additionalSpectrumEmission);
}
NRRRC_CONFIGURATION_REQ (msg_p).UL_p_Max[j] = UL_p_Max;
if ((UL_p_Max <-30) || (UL_p_Max > 33)){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for UL_p_Max choice: -30..33 !\n",
RC.config_file_name, i, UL_p_Max);
}
if (strcmp(frequencyShift7p5khz, "TRUE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).frequencyShift7p5khz[j] = FrequencyInfoUL__frequencyShift7p5khz_true;
if (strcmp(UL_frequencyShift7p5khz, "TRUE") == 0) {
RRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = FrequencyInfoUL__frequencyShift7p5khz_true; //enum true = 0
}else if{
RRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = 1;//false
}
/////////////////////////////////NR UL SCS-SpecificCarrier///////////////////////////
......@@ -566,18 +604,18 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, UL_offsetToCarrier);
}
if (strcmp(UL_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, UL_SubcarrierSpacing);
if (strcmp(UL_SCS_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_SCS_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, UL_SCS_SubcarrierSpacing);
}
switch (UL_SCS_SpecificCarrier_k0) {
......@@ -623,6 +661,47 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, UL_locationAndBandwidth);
}
if (strcmp(UL_BWP_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_BWP_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, UL_BWP_SubcarrierSpacing);
}
if (!UL_BWP_prefix_type){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d define %s: NORMAL,EXTENDED!\n",
RC.config_file_name, i, GNB_CONFIG_STRING_DL_PREFIX_TYPE);
}else if (strcmp(UL_BWP_prefix_type, "NORMAL") == 0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_prefix_type[j] = NORMAL;
}else if (strcmp(UL_BWP_prefix_type, "EXTENDED") == 0) {
NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_prefix_type[j] = EXTENDED;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_BWP_prefix_type choice: NORMAL or EXTENDED !\n",
RC.config_file_name, i, UL_BWP_prefix_type);
}
if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"shortBitmap")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap;
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"mediumBitmap")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap;
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"longBitmap")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap;
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"NOTHING")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_NOTHING;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for ServingCellConfigCommon_ssb_PositionsInBurst_PR choice !\n",
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR);
}
switch (ServingCellConfigCommon_ssb_periodicityServingCell) {
case 5:
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms5;
......@@ -654,7 +733,6 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
break;
}
switch (ServingCellConfigCommon_dmrs_TypeA_Position) {
case 2:
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_dmrs_TypeA_Position[j] = ServingCellConfigCommon__dmrs_TypeA_Position_pos2;
......@@ -672,13 +750,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (strcmp(NIA_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
}else if (strcmp(NIA_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
}else if (strcmp(NIA_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
}else if (strcmp(NIA_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
}else if (strcmp(NIA_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for NIA_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
RC.config_file_name, i, NIA_SubcarrierSpacing);
......@@ -693,13 +771,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
/////////////////////////////////NR TDD-UL-DL-ConfigCommon///////////////////////////
if (strcmp(referenceSubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
}else if (strcmp(referenceSubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
}else if (strcmp(referenceSubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
}else if (strcmp(referenceSubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
}else if (strcmp(referenceSubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for referenceSubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
......@@ -708,19 +786,19 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (strcmp(dl_UL_TransmissionPeriodicity,"ms0p5")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p5;
}else if (strcmp(pusch_alpha,"ms0p625")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms0p625")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p625;
}else if (strcmp(pusch_alpha,"ms1")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms1")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1;
}else if (strcmp(pusch_alpha,"ms1p25")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms1p25")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1p25;
}else if (strcmp(pusch_alpha,"ms2")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms2")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2;
}else if (strcmp(pusch_alpha,"ms2p5")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms2p5")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2p5;
}else if (strcmp(pusch_alpha,"ms5")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms5")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms5;
}else if (strcmp(pusch_alpha,"ms10")==0) {
}else if (strcmp(dl_UL_TransmissionPeriodicity,"ms10")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms10;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for dl_UL_TransmissionPeriodicity choice: minusinfinity,ms0p5,ms0p625,ms1,ms1p25,ms2,ms2p5,ms5,ms10 !\n",
......@@ -1182,13 +1260,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (strcmp(prach_msg1_SubcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
}else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
}else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
}else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
}else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for prach_msg1_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
......@@ -1207,7 +1285,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
}
if (strcmp(msg3_transformPrecoding , "ENABLE") == 0){
NRRRC_CONFIGURATION_REQ (msg_p).msg3_transformPrecoding[j] = RACH_ConfigCommon__msg3_transformPrecoding_enabled;
NRRRC_CONFIGURATION_REQ (msg_p).msg3_transformPrecoding[j] = TRUE;
}
////////////////////////////////NR RACH-ConfigGeneric//////////////////////////////
......@@ -1334,7 +1412,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
/////////////////////////////////NR PUSCH-ConfigCommon///////////////////////////
if (strcmp(groupHoppingEnabledTransformPrecoding , "ENABLE") == 0){
NRRRC_CONFIGURATION_REQ (msg_p).groupHoppingEnabledTransformPrecoding[j] = PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled;
NRRRC_CONFIGURATION_REQ (msg_p).groupHoppingEnabledTransformPrecoding[j] = TRUE;
}
NRRRC_CONFIGURATION_REQ (msg_p).msg3_DeltaPreamble[j] = msg3_DeltaPreamble;
......@@ -1464,13 +1542,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz15")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz15;
}else if (strcmp(pusch_alpha,"kHz30")==0) {
}else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz30")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz30;
}else if (strcmp(pusch_alpha,"kHz60")==0) {
}else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz60")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz60;
}else if (strcmp(pusch_alpha,"kHz120")==0) {
}else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz120")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz120;
}else if (strcmp(pusch_alpha,"kHz240")==0) {
}else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz240")==0) {
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz240;
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPattern_subcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n",
......@@ -1588,11 +1666,17 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, PDCCH_precoderGranularity);
}
NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_TCI_StateId[j] = PDCCH_TCI_StateId;
if ((PDCCH_TCI_StateId <0) || (PDCCH_TCI_StateId>63)){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDCCH_TCI_StateId choice: 0..63 !\n",
RC.config_file_name, i, PDCCH_TCI_StateId);
}
if (strcmp(tci_PresentInDCI , "ENABLE") == 0){
NRRRC_CONFIGURATION_REQ (msg_p).tci_PresentInDCI[j] = ControlResourceSet__tci_PresentInDCI_enabled;
NRRRC_CONFIGURATION_REQ (msg_p).tci_PresentInDCI[j] = TRUE;
}
//////////////////////////////////NR PDCCH commonControlResourcesSets///////////////////////////
//////////////////////////////////NR PDCCH commonSearchSpaces///////////////////////////
NRRRC_CONFIGURATION_REQ (msg_p).SearchSpaceId[j] = SearchSpaceId;
if ((SearchSpaceId <0) || (SearchSpaceId>39)){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpaceId choice: 0..39 !\n",
......
......@@ -244,28 +244,34 @@ typedef enum {
//NR DL SCS-SPECIFICCARRIER
#define GNB_CONFIG_STRING_DL_OFFSETTOCARRIER "DL_offsetToCarrier"
#define GNB_CONFIG_STRING_DL_SUBCARRIERSPACING "DL_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING "DL_SCS_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0 "DL_SCS_SpecificCarrier_k0"
#define GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH "DL_carrierBandwidth"
// NR BWP-DOWNLINKCOMMON
#define GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH "DL_locationAndBandwidth"
#define GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING "DL_BWP_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE "DL_BWP_prefix_type"
//NR FREQUENCYINFOUL
#define GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR "UL_FreqBandIndicatorNR"
#define GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA "UL_absoluteFrequencyPointA"
#define GNB_CONFIG_STRING_FREQUENCYINFOUL_P_MAX "FrequencyInfoUL_p_Max"
#define GNB_CONFIG_STRING_FREQUENCYSHIFT7P5KHZ "frequencyShift7p5khz"
#define GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION "UL_additionalSpectrumEmission"
#define GNB_CONFIG_STRING_UL_P_MAX "UL_p_Max"
#define GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ "UL_frequencyShift7p5khz"
//NR UL SCS-SPECIFICCARRIER
#define GNB_CONFIG_STRING_UL_OFFSETTOCARRIER "UL_offsetToCarrier"
#define GNB_CONFIG_STRING_UL_SUBCARRIERSPACING "UL_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING "UL_SCS_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0 "UL_SCS_SpecificCarrier_k0"
#define GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH "UL_carrierBandwidth"
// NR BWP-UPLINKCOMMON
#define GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH "UL_locationAndBandwidth"
#define GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING "UL_BWP_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE "UL_BWP_prefix_type"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR "ServingCellConfigCommon_ssb_PositionsInBurst_PR"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL "ServingCellConfigCommon_ssb_periodicityServingCell"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION "ServingCellConfigCommon_dmrs_TypeA_Position"
#define GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING "NIA_SubcarrierSpacing"
......@@ -357,6 +363,7 @@ typedef enum {
#define GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE "PDCCH_interleaverSize"
#define GNB_CONFIG_STRING_PDCCH_SHIFTINDEX "PDCCH_shiftIndex"
#define GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY "PDCCH_precoderGranularity"
#define GNB_CONFIG_STRING_PDCCH_TCI_STATEID "PDCCH_TCI_StateId"
#define GNB_CONFIG_STRING_TCI_PRESENTINDCI "tci_PresentInDCI"
//NR PDCCH-ConfigCommon commonSearchSpaces
......@@ -412,19 +419,25 @@ typedef enum {
{GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR, NULL, 0, iptr:&DL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&DL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_OFFSETTOCARRIER, NULL, 0, iptr:&DL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SUBCARRIERSPACING, NULL, 0, iptr:&DL_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&DL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&DL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH, NULL, 0, iptr:&DL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&DL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&DL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE, NULL, 0, iptr:&DL_BWP_prefix_type, defintval:0, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR, NULL, 0, iptr:&UL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&UL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_FREQUENCYINFOUL_P_MAX, NULL, 0, iptr:&FrequencyInfoUL_p_Max, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_FREQUENCYSHIFT7P5KHZ, NULL, 0, iptr:&frequencyShift7p5khz, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION, NULL, 0, iptr:&UL_additionalSpectrumEmission, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_P_MAX, NULL, 0, iptr:&UL_p_Max, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ, NULL, 0, iptr:&UL_frequencyShift7p5khz, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_OFFSETTOCARRIER, NULL, 0, iptr:&UL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SUBCARRIERSPACING, NULL, 0, iptr:&UL_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&UL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&UL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH, NULL, 0, iptr:&UL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&UL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&UL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, iptr:&UL_BWP_prefix_type, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, iptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, iptr:&NIA_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
......@@ -494,6 +507,7 @@ typedef enum {
{GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE, NULL, 0, iptr:&PDCCH_interleaverSize, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_SHIFTINDEX, NULL, 0, iptr:&PDCCH_shiftIndex, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY, NULL, 0, iptr:&PDCCH_precoderGranularity, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_TCI_STATEID, NULL, 0, iptr:&PDCCH_TCI_StateId, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_TCI_PRESENTINDCI, NULL, 0, iptr:&tci_PresentInDCI, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SEARCHSPACEID, NULL, 0, iptr:&SearchSpaceId, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID, NULL, 0, iptr:&commonSearchSpaces_controlResourceSetId, defintval:0, TYPE_UINT, 0}, \
......@@ -552,18 +566,24 @@ typedef enum {
#define GNB_CONFIG_DL_SCS_SPECIFICCARRIER_K0_IDX
#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX
#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX
#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX
#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX
#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX
#define GNB_CONFIG_FREQUENCYINFOUL_P_MAX_IDX
#define GNB_CONFIG_FREQUENCYSHIFT7P5KHZ_IDX
#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX;
#define GNB_CONFIG_UL_P_MAX_IDX
#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX
#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX
#define GNB_CONFIG_UL_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_SCS_SPECIFICCARRIER_K0_IDX
#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX
#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX
#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX
#define GNB_CONFIG_SUBCARRIERSPACINGCOMMON_IDX
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX
#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX
#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX
......@@ -633,6 +653,7 @@ typedef enum {
#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX
#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX
#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX
#define GNB_CONFIG_SEARCHSPACEID_IDX
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX
......
......@@ -72,7 +72,7 @@
//#include "SystemInformation.h"
#include "SIB1.h"
#include "ServingCellConfigCommon.h"
//#include "SIB-Type.h"
//#include "BCCH-DL-SCH-Message.h"
......@@ -82,7 +82,7 @@
#include "MeasObjectToAddModList.h"
#include "ReportConfigToAddModList.h"
#include "MeasIdToAddModList.h"
#include "enb_config.h"
#include "gnb_config.h"
#endif
#if defined(ENABLE_ITTI)
......@@ -495,6 +495,523 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
return((enc_rval.encoded+7)/8);
}
uint8_t do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
int CC_id
#if defined(ENABLE_ITTI)
,gNB_RrcConfigurationReq *configuration
#endif
)
{
// ServingCellConfigCommon //
struct FrequencyInfoDL **frequencyinfordl = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->frequencyInfoDL;
BWP_DownlinkCommon_t **bwp_downlinkcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->initialDownlinkBWP;
UplinkConfigCommon_t **uplinkconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->uplinkConfigCommon;
UplinkConfigCommon_t **supplementaryuplinkconfig = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->supplementaryUplinkConfig;
/////RateMatchPatternLTE_CRS_t **lte_crs_tomatcharound = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->lte_CRS_ToMatchAround;
struct ServingCellConfigCommon__rateMatchPatternToAddModList **ratematchpatterntoaddmodlist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToAddModList;
struct RateMatchPattern *ratematchpattern;
struct ServingCellConfigCommon__rateMatchPatternToReleaseList **ratematchpatterntoreleaselist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToReleaseList;
RateMatchPatternId_t *ratematchpatternid;
struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon;
struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon2;
// FrequencyInfoDL //
FreqBandIndicatorNR_t *dl_frequencyBandList;
struct SCS_SpecificCarrier *dl_scs_SpecificCarrierList;
// BWP_DownlinkCommon //
ControlResourceSet_t *bwp_dl_controlresourceset;
TCI_StateId_t *TCI_StateId;
SearchSpace_t *bwp_dl_searchspace;
struct PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation;
// UplinkConfigCommon //
FreqBandIndicatorNR_t *ul_frequencyBandList;
struct SCS_SpecificCarrier *ul_scs_SpecificCarrierList;
// PUSCH_ConfigCommon //
struct PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation;
//------------------------------------Start Fill ServingCellConfigCommon------------------------------------//
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->physCellId = configuration->Nid_cell[CC_id];
(*ssb_positionsinburst)->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap){
(*ssb_positionsinburst)->choice.shortBitmap.buf = MALLOC(1);
(*ssb_positionsinburst)->choice.shortBitmap.size = 1;
(*ssb_positionsinburst)->choice.shortBitmap.bits_unused = 4;
(*ssb_positionsinburst)->choice.shortBitmap.buf[0] = 0x0f;
}else if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){
(*ssb_positionsinburst)->choice.mediumBitmap.buf = MALLOC(1);
(*ssb_positionsinburst)->choice.mediumBitmap.size = 1;
(*ssb_positionsinburst)->choice.mediumBitmap.bits_unused = 0;
(*ssb_positionsinburst)->choice.mediumBitmap.buf[0] = 0xff;
}else if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap){
(*ssb_positionsinburst)->choice.longBitmap.buf = MALLOC(8);
(*ssb_positionsinburst)->choice.longBitmap.size = 8;
(*ssb_positionsinburst)->choice.longBitmap.bits_unused = 0;
(*ssb_positionsinburst)->choice.longBitmap.buf[0] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[1] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[2] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[3] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[4] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[5] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[6] = 0xff;
(*ssb_positionsinburst)->choice.longBitmap.buf[7] = 0xff;
}
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id];
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->dmrs_TypeA_Position = configuration->ServingCellConfigCommon_dmrs_TypeA_Position[CC_id];
ratematchpattern = CALLOC(1,sizeof(struct RateMatchPattern));
memset(&ratematchpattern,0,sizeof(struct RateMatchPattern));
ratematchpattern->rateMatchPatternId = configuration->rateMatchPatternId[CC_id];
ratematchpattern->patternType.present = configuration->RateMatchPattern_patternType[CC_id];
if(ratematchpattern->patternType.present == RateMatchPattern__patternType_PR_bitmaps){
ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf = MALLOC(35);
ratematchpattern->patternType.choice.bitmaps.resourceBlocks.size = 35;
ratematchpattern->patternType.choice.bitmaps.resourceBlocks.bits_unused = 5;
ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf[0] = 0x07;
for (int i =1;i<=34;i++ ){
ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf[i] =0xff;
}
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present = configuration->symbolsInResourceBlock[CC_id];
if(ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present == RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot){
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf=MALLOC(2);
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.size=2;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.bits_unused=2;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf[0]=0x3f;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf[1]=0xff;
}else if(ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present == RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots){
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf=MALLOC(4);
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.size=4;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.bits_unused=4;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[0]=0x0f;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[1]=0xff;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[2]=0xff;
ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[3]=0xff;
}
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern = CALLOC(1,sizeof(struct RateMatchPattern__patternType__bitmaps__periodicityAndPattern));
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present = configuration->periodicityAndPattern[CC_id];
if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.buf = MALLOC(1);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.size = 1;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.bits_unused = 6;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.buf[0] =0x03;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.buf = MALLOC(1);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.size = 1;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.bits_unused = 4;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.buf[0] = 0x0f;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.buf = MALLOC(1);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.size = 1;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.bits_unused = 3;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.buf[0] = 0x1f;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.buf = MALLOC(1);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.size = 1;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.bits_unused = 0;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.buf[0] = 0xff;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf = MALLOC(2);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.size = 2;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.bits_unused = 6;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf[0] = 0x03;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf[1] = 0xff;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf = MALLOC(3);
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.size = 3;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.bits_unused = 4;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[0] = 0x0f;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[1] = 0xff;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[2] = 0xff;
}else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40){
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf = MALLOC(5)
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.size = 5;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.bits_unused = 0;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[0] = 0xff;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[1] = 0xff;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[2] = 0xff;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[3] = 0xff;
ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[4] = 0xff;
}
}else if(ratematchpattern->patternType.present == RateMatchPattern__patternType_PR_controlResourceSet){
ratematchpattern->patternType.choice.controlResourceSet = RateMatchPattern_controlResourceSet[CC_id];
}
ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t));
ratematchpattern->subcarrierSpacing = configuration->RateMatchPattern_subcarrierSpacing[CC_id];
ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id];
ASN_SEQUENCE_ADD(&(*ratematchpatterntoaddmodlist)->list,&ratematchpattern);
ratematchpatternid = CALLOC(1,sizeof(RateMatchPatternId_t));
memset(&ratematchpatternid,0,sizeof(RateMatchPatternId_t));
ratematchpatternid = configuration->rateMatchPatternId[CC_id];
ASN_SEQUENCE_ADD(&(*ratematchpatterntoreleaselist)->list,&ratematchpatternid);
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->subcarrierSpacing = configuration->NIA_SubcarrierSpacing[CC_id];
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ss_PBCH_BlockPower = configuration->ServingCellConfigCommon_ss_PBCH_BlockPower[CC_id];
//Fill FrequencyInfoDL //
(*frequencyinfordl)->absoluteFrequencySSB = configuration->absoluteFrequencySSB[CC_id];
(*frequencyinfordl)->ssb_SubcarrierOffset = CALLOC(1,sizeof(long));
(*frequencyinfordl)->ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset[CC_id];
dl_frequencyBandList = CALLOC(1,sizeof(FreqBandIndicatorNR_t));
memset(&dl_frequencyBandList,0,sizeof(FreqBandIndicatorNR_t));
dl_frequencyBandList = configuration->DL_FreqBandIndicatorNR[CC_id];
ASN_SEQUENCE_ADD(&(*frequencyinfordl)->frequencyBandList.list,&dl_frequencyBandList);
(*frequencyinfordl)->absoluteFrequencyPointA = configuration->DL_absoluteFrequencyPointA[CC_id];
dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct SCS_SpecificCarrier));
memset(&dl_scs_SpecificCarrierList,0,sizeof(struct SCS_SpecificCarrier));
dl_scs_SpecificCarrierList->offsetToCarrier = configuration->DL_offsetToCarrier[CC_id];
dl_scs_SpecificCarrierList->subcarrierSpacing = configuration->DL_SCS_SubcarrierSpacing[CC_id];
dl_scs_SpecificCarrierList->k0 = configuration->DL_SCS_SpecificCarrier_k0[CC_id];
dl_scs_SpecificCarrierList->carrierBandwidth = configuration->DL_carrierBandwidth[CC_id];
ASN_SEQUENCE_ADD(&(*frequencyinfordl)->scs_SpecificCarrierList.list,&dl_scs_SpecificCarrierList);
//Fill BWP_DownlinkCommon -> genericParameters //
(*bwp_downlinkcommon)->genericParameters.locationAndBandwidth = configuration->DL_locationAndBandwidth[CC_id];
(*bwp_downlinkcommon)->genericParameters.subcarrierSpacing = configuration->DL_BWP_SubcarrierSpacing[CC_id];
if(configuration->DL_BWP_prefix_type[CC_id]){
(*bwp_downlinkcommon)->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
(*bwp_downlinkcommon)->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended;
}
//Fill BWP_DownlinkCommon -> pdcch_ConfigCommon //
(*bwp_downlinkcommon)->pdcch_ConfigCommon = CALLOC(1,sizeof(struct PDCCH_ConfigCommon));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceSIB1 = CALLOC(1,sizeof(SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->pagingSearchSpace = CALLOC(1,sizeof(SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_SearchSpace = CALLOC(1,sizeof(SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_ControlResourceSet = CALLOC(1,sizeof(ControlResourceSetId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceSIB1 = configuration->searchSpaceSIB1[CC_id];
(*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceOtherSystemInformation = configuration->searchSpaceOtherSystemInformation[CC_id];
(*bwp_downlinkcommon)->pdcch_ConfigCommon->pagingSearchSpace = configuration->pagingSearchSpace[CC_id];
(*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_SearchSpace = configuration->ra_SearchSpace[CC_id];
(*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_ControlResourceSet = configuration->rach_ra_ControlResourceSet[CC_id];
//Fill BWP_DownlinkCommon -> pdcch_ConfigCommon -> ControlResourceSet list //
(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonControlResourcesSets = CALLOC(1,sizeof(struct PDCCH_ConfigCommon__commonControlResourcesSets));
bwp_dl_controlresourceset = CALLOC(1,sizeof(ControlResourceSet_t));
memset(&bwp_dl_controlresourceset,0,sizeof(ControlResourceSet_t));
bwp_dl_controlresourceset->controlResourceSetId = configuration->PDCCH_common_controlResourceSetId[CC_id];
//BIT STRING (SIZE (45))
bwp_dl_controlresourceset->frequencyDomainResources.buf =MALLOC(6);
bwp_dl_controlresourceset->frequencyDomainResources.size = 6;
bwp_dl_controlresourceset->frequencyDomainResources.bits_unused = 3;
bwp_dl_controlresourceset->frequencyDomainResources.buf[0] = 0x1f;
bwp_dl_controlresourceset->frequencyDomainResources.buf[1] = 0xff;
bwp_dl_controlresourceset->frequencyDomainResources.buf[2] = 0xff;
bwp_dl_controlresourceset->frequencyDomainResources.buf[3] = 0xff;
bwp_dl_controlresourceset->frequencyDomainResources.buf[4] = 0xff;
bwp_dl_controlresourceset->frequencyDomainResources.buf[5] = 0xff;
bwp_dl_controlresourceset->frequencyDomainResources.buf[6] = 0xff;
bwp_dl_controlresourceset->duration = configuration->PDCCH_common_ControlResourceSet_duration[CC_id];
bwp_dl_controlresourceset->cce_REG_MappingType.present = configuration->PDCCH_cce_REG_MappingType[CC_id];
if(bwp_dl_controlresourceset->cce_REG_MappingType == ControlResourceSet__cce_REG_MappingType_PR_interleaved ){
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.reg_BundleSize = configuration->PDCCH_reg_BundleSize[CC_id];
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.interleaverSize = configuration->PDCCH_interleaverSize[CC_id];
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.shiftIndex = configuration->PDCCH_shiftIndex[CC_id];
}else if(bwp_dl_controlresourceset->cce_REG_MappingType == ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved){
bwp_dl_controlresourceset->cce_REG_MappingType.choice.nonInterleaved = NULL;
}
bwp_dl_controlresourceset->precoderGranularity = configuration->PDCCH_precoderGranularity[CC_id];
bwp_dl_controlresourceset->tci_StatesPDCCH = CALLOC(1,sizeof(struct ControlResourceSet__tci_StatesPDCCH));
TCI_StateId = CALLOC(1,sizeof(TCI_StateId_t));
memset(&TCI_StateId,0,sizeof(TCI_StateId_t));
TCI_StateId = configuration->PDCCH_TCI_StateId[CC_id];
ASN_SEQUENCE_ADD(&bwp_dl_controlresourceset->tci_StatesPDCCH->list,&TCI_StateId);
if(configuration->tci_PresentInDCI[CC_id]){
bwp_dl_controlresourceset->tci_PresentInDCI = CALLOC(1,sizeof(long));
bwp_dl_controlresourceset->tci_PresentInDCI = ControlResourceSet__tci_PresentInDCI_enabled;
}
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID = CALLOC(1,sizeof(pdcch_DMRS_ScramblingID));
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf = MALLOC(2);
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->size = 2;
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->bits_unused = 0;
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf[0] = 0xff;
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf[1] = 0xff;
ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonControlResourcesSets->list,&bwp_dl_controlresourceset);
//Fill BWP_DownlinkCommon -> pdcch_ConfigCommon -> SearchSpace list //
(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonSearchSpaces = CALLOC(1,sizeof(struct PDCCH_ConfigCommon__commonSearchSpaces));
bwp_dl_searchspace = CALLOC(1,sizeof(SearchSpace_t));
memset(&bwp_dl_searchspace,0,sizeof(SearchSpace_t));
bwp_dl_searchspace->searchSpaceId = configuration->SearchSpaceId[CC_id];
bwp_dl_searchspace->controlResourceSetId = CALLOC(1,sizeof(ControlResourceSetId_t));
bwp_dl_searchspace->controlResourceSetId = configuration->commonSearchSpaces_controlResourceSetId[CC_id];
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset = CALLOC(1,sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_choice[CC_id];
if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl1 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl1[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl2 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl2[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl4 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl4[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl5 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl5[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl8 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl8[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl10 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl10[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl16 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl16[CC_id];
}else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20){
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl20 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl20[CC_id];
}
bwp_dl_searchspace->monitoringSymbolsWithinSlot = CALLOC(1,sizeof(BIT_STRING_t));
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf=MALLOC(2);
bwp_dl_searchspace->monitoringSymbolsWithinSlot->size=2;
bwp_dl_searchspace->monitoringSymbolsWithinSlot->bits_unused=2;
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[0]=0x3f;
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[1]=0xff;
bwp_dl_searchspace->nrofCandidates = CALLOC(1,sizeof(struct SearchSpace__nrofCandidates));
bwp_dl_searchspace->nrofCandidates->aggregationLevel1 = configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id];
bwp_dl_searchspace->nrofCandidates->aggregationLevel2 = configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id];
bwp_dl_searchspace->nrofCandidates->aggregationLevel4 = configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id];
bwp_dl_searchspace->nrofCandidates->aggregationLevel8 = configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id];
bwp_dl_searchspace->nrofCandidates->aggregationLevel16 = configuration->SearchSpace_nrofCandidates_aggregationLevel16[CC_id];
bwp_dl_searchspace->searchSpaceType = CALLOC(1,sizeof(struct SearchSpace__searchSpaceType));
bwp_dl_searchspace->searchSpaceType->present = configuration->SearchSpace_searchSpaceType[CC_id];
if(bwp_dl_searchspace->searchSpaceType->present == SearchSpace__searchSpaceType_PR_common){
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0 = CALLOC(1,sizeof(struct SearchSpace__searchSpaceType__common__dci_Format2_0));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3 = CALLOC(1,sizeof(struct struct SearchSpace__searchSpaceType__common__dci_Format2_3));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->monitoringPeriodicity = CALLOC(1,sizeof(long));
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->monitoringPeriodicity = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id];
bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->nrofPDCCH_Candidates = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id];
}else if (bwp_dl_searchspace->searchSpaceType->present == SearchSpace__searchSpaceType_PR_ue_Specific){
bwp_dl_searchspace->searchSpaceType->choice.ue_Specific.dci_Formats = configuration->dci_Formats[CC_id];
}
ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonSearchSpaces->list,&bwp_dl_searchspace);
//Fill BWP_DownlinkCommon -> pdsch_ConfigCommon //
(*bwp_downlinkcommon)->pdsch_ConfigCommon = CALLOC(1,sizeof(struct PDSCH_ConfigCommon));
(*bwp_downlinkcommon)->pdsch_ConfigCommon->pdsch_AllocationList = CALLOC(1,sizeof(struct PDSCH_ConfigCommon__pdsch_AllocationList));
bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long));
bwp_dl_timedomainresourceallocation->k0 = configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id];
bwp_dl_timedomainresourceallocation->mappingType = configuration->PDSCH_TimeDomainResourceAllocation_mappingType[CC_id];
bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf=MALLOC(1);
bwp_dl_timedomainresourceallocation->startSymbolAndLength.size=1;
bwp_dl_timedomainresourceallocation->startSymbolAndLength.bits_unused=1;
bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf[0]=0x7f;
ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdsch_ConfigCommon->pdsch_AllocationList->list,&bwp_dl_timedomainresourceallocation);
//Fill UplinkConfigCommon //
//Fill UplinkConfigCommon -> FrequencyInfoUL //
(*uplinkconfigcommon)->frequencyInfoUL = CALLOC(1,sizeof(struct FrequencyInfoUL));
(*uplinkconfigcommon)->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct MultiFrequencyBandListNR));
ul_frequencyBandList = CALLOC(1,sizeof(FreqBandIndicatorNR_t));
memset(&ul_frequencyBandList,0,sizeof(FreqBandIndicatorNR_t));
ul_frequencyBandList = configuration->UL_FreqBandIndicatorNR[CC_id];
ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->frequencyInfoUL->frequencyBandList->list,&ul_frequencyBandList);
(*uplinkconfigcommon)->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(ARFCN_ValueNR_t));
(*uplinkconfigcommon)->frequencyInfoUL->absoluteFrequencyPointA = configuration->UL_absoluteFrequencyPointA[CC_id];
ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct SCS_SpecificCarrier));
memset(&dl_scs_SpecificCarrierList,0,sizeof(struct SCS_SpecificCarrier));
ul_scs_SpecificCarrierList->offsetToCarrier = configuration->UL_offsetToCarrier[CC_id];
ul_scs_SpecificCarrierList->subcarrierSpacing = configuration->UL_SCS_SubcarrierSpacing[CC_id];
ul_scs_SpecificCarrierList->k0 = configuration->UL_SCS_SpecificCarrier_k0[CC_id];
ul_scs_SpecificCarrierList->carrierBandwidth = configuration->UL_carrierBandwidth[CC_id];
ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->frequencyInfoUL->scs_SpecificCarriers.list,&ul_scs_SpecificCarrierList);
(*uplinkconfigcommon)->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(AdditionalSpectrumEmission_t));
(*uplinkconfigcommon)->frequencyInfoUL->p_Max = CALLOC(1,sizeof(P_Max_t));
(*uplinkconfigcommon)->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->frequencyInfoUL->additionalSpectrumEmission = configuration->UL_additionalSpectrumEmission[CC_id];
(*uplinkconfigcommon)->frequencyInfoUL->p_Max = configuration->UL_p_Max[CC_id];
(*uplinkconfigcommon)->frequencyInfoUL->frequencyShift7p5khz = configuration->UL_frequencyShift7p5khz[CC_id];
//Fill UplinkConfigCommon -> BWP-UplinkCommon //
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> genericParameters//
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.locationAndBandwidth = configuration->UL_locationAndBandwidth[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.subcarrierSpacing = configuration->UL_BWP_SubcarrierSpacing[CC_id];
if(configuration->UL_BWP_prefix_type[CC_id]){
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended;
}
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> RACH_ConfigCommon//
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(RACH_ConfigCommon_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->totalNumberOfRA_Preambles = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->totalNumberOfRA_Preambles = configuration->rach_totalNumberOfRA_Preambles[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB = CALLOC(1,sizeof(struct RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[CC_id];
if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[CC_id];
}
if(configuration->rach_groupBconfigured[CC_id]){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured = CALLOC(1,sizeof(struct RACH_ConfigCommon__groupBconfigured));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA = configuration->numberOfRA_PreamblesGroupA[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB = configuration->rach_messagePowerOffsetGroupB[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA = configuration->rach_numberOfRA_PreamblesGroupA[CC_id];
}
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ra_ContentionResolutionTimer = configuration->rach_ra_ContentionResolutionTimer[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB = CALLOC(1,sizeof(RSRP_Range_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(RSRP_Range_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB = configuration->rsrp_ThresholdSSB[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB_SUL = configuration->rsrp_ThresholdSSB_SUL[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present = configuration->prach_RootSequenceIndex_choice[CC_id];
if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present == RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.choice.l839 = configuration->prach_RootSequenceIndex_l839[CC_id];
}else if ((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present == RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.choice.l139 = configuration->prach_RootSequenceIndex_l139[CC_id];
}
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg1_SubcarrierSpacing = configuration->prach_msg1_SubcarrierSpacing[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->restrictedSetConfig = configuration->restrictedSetConfig[CC_id];
if(configuration->msg3_transformPrecoding[CC_id]){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg3_transformPrecoding = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg3_transformPrecoding = RACH_ConfigCommon__msg3_transformPrecoding_enabled;
}
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> RACH_ConfigCommon -> RACH_ConfigGeneric_t//
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex = configuration->prach_ConfigurationIndex[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.msg1_FDM = configuration->prach_msg1_FDM[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.msg1_FrequencyStart = configuration->prach_msg1_FrequencyStart[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.zeroCorrelationZoneConfig = configuration->zeroCorrelationZoneConfig[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower = configuration->preambleReceivedTargetPower[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.preambleTransMax = configuration->preambleTransMax[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.powerRampingStep = configuration->powerRampingStep[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.ra_ResponseWindow = configuration->ra_ResponseWindow[CC_id];
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> PUSCH_ConfigCommon//
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(PUSCH_ConfigCommon_t));
if(configuration->groupHoppingEnabledTransformPrecoding[CC_id]){
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->groupHoppingEnabledTransformPrecoding = PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled;
}
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->pusch_AllocationList = CALLOC(1,sizeof(struct PUSCH_ConfigCommon__pusch_AllocationList));
pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(struct PUSCH_TimeDomainResourceAllocation));
memset(&pusch_configcommontimedomainresourceallocation,0,sizeof(struct PUSCH_TimeDomainResourceAllocation));
pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long));
pusch_configcommontimedomainresourceallocation->k2 = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id];
pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id];
pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf = MALLOC(1);
pusch_configcommontimedomainresourceallocation->startSymbolAndLength.size = 1;
pusch_configcommontimedomainresourceallocation->startSymbolAndLength.bits_unused = 1;
pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf[0] = 0x7f;
ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->pusch_AllocationList->list,&pusch_configcommontimedomainresourceallocation);
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->msg3_DeltaPreamble = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->msg3_DeltaPreamble = configuration->msg3_DeltaPreamble[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->p0_NominalWithGrant = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->p0_NominalWithGrant = configuration->p0_NominalWithGrant[CC_id];
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> PUCCH_ConfigCommon//
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(PUCCH_ConfigCommon_t));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon = CALLOC(1,sizeof(BIT_STRING_t));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId = CALLOC(1,sizeof(BIT_STRING_t));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->p0_nominal = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_GroupHopping = configuration->pucch_GroupHopping[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->p0_nominal = configuration->p0_nominal[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->buf = MALLOC(1);
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->size = 1;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->bits_unused = 4;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->buf[0] = 0x0f;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf = MALLOC(2);
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->size = 2
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->bits_unused = 6;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf[0] = 0x03;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf[1] = 0xff;
//Fill supplementaryUplinkConfig //
memcpy(&(*uplinkconfigcommon), &(*supplementaryuplinkconfig), sizeof(UplinkConfigCommon_t));//The Same structre
//Fill TDD_UL_DL_ConfigCommon //
(*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t));
(*tdd_ul_dl_configurationcommon)->dl_UL_TransmissionPeriodicity = CALLOC(1,sizeof(long));
(*tdd_ul_dl_configurationcommon)->nrofDownlinkSlots = CALLOC(1,sizeof(long));
(*tdd_ul_dl_configurationcommon)->nrofDownlinkSymbols = CALLOC(1,sizeof(long));
(*tdd_ul_dl_configurationcommon)->nrofUplinkSlots = CALLOC(1,sizeof(long));
(*tdd_ul_dl_configurationcommon)->nrofUplinkSymbols = CALLOC(1,sizeof(long));
(*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = configuration->referenceSubcarrierSpacing[CC_id];
(*tdd_ul_dl_configurationcommon)->dl_UL_TransmissionPeriodicity = configuration->dl_UL_TransmissionPeriodicity[CC_id];
(*tdd_ul_dl_configurationcommon)->nrofDownlinkSlots = configuration->nrofDownlinkSlots[CC_id];
(*tdd_ul_dl_configurationcommon)->nrofDownlinkSymbols = configuration->nrofDownlinkSymbols[CC_id];
(*tdd_ul_dl_configurationcommon)->nrofUplinkSlots = configuration->nrofUplinkSlots[CC_id];
(*tdd_ul_dl_configurationcommon)->nrofUplinkSymbols = configuration->nrofUplinkSymbols[CC_id];
memcpy(&(*tdd_ul_dl_configurationcommon), &(*tdd_ul_dl_configurationcommon2), sizeof(struct TDD_UL_DL_ConfigCommon));//The Same structre
}
//------------------------------------------------------------------------------
/*
uint8_t do_SIB23(uint8_t Mod_id,
......
......@@ -20,11 +20,11 @@
/*! \file RRC/LITE/defs_NR.h
* \brief NR RRC struct definitions and function prototypes
* \author Navid Nikaein, Raymond Knopp and WEI-TAI CHEN
* \author Navid Nikaein, Raymond Knopp
* \date 2010 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, kroempa@gmail.com.tw
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_RRC_DEFS_NR_H__
......@@ -45,6 +45,8 @@
#include "SIB1.h"
//#include "SystemInformation.h"
//#include "RRCConnectionReconfiguration.h"
#include "RRCReconfigurationComplete.h"
#include "RRCReconfiguration"
//#include "RRCConnectionReconfigurationComplete.h"
//#include "RRCConnectionSetup.h"
//#include "RRCConnectionSetupComplete.h"
......@@ -59,6 +61,7 @@
//#include "AS-Context.h"
#include "UE-NR-Capability.h"
#include "MeasResults.h"
#include "ServingCellConfigCommon.h"
#endif
//-------------------
......@@ -389,78 +392,35 @@ typedef struct rrc_gNB_ue_context_s {
typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB_NR;
uint8_t sizeof_MIB_NR;
uint8_t *SIB1_NR;
uint8_t sizeof_SIB1_NR;
/*
uint8_t *SIB23_NB_IoT;
uint8_t sizeof_SIB23_NB_IoT;
*/
uint8_t *MIB;
uint8_t sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
uint8_t *SERVINGCELLCONFIGCOMMON;
uint8_t sizeof_SERVINGCELLCONFIGCOMMON;
/*
//not actually implemented in OAI
uint8_t *SIB4_NB_IoT;
uint8_t sizeof_SIB4_NB_IoT;
uint8_t *SIB5_NB_IoT;
uint8_t sizeof_SIB5_NB_IoT;
uint8_t *SIB14_NB_IoT;
uint8_t sizeof_SIB14_NB_IoT;
uint8_t *SIB16_NB_IoT;
uint8_t sizeof_SIB16_NB_IoT;
*/
//TS 36.331 V14.2.1
// uint8_t *SIB15_NB;
// uint8_t sizeof_SIB15_NB;
// uint8_t *SIB20_NB;
// uint8_t sizeof_SIB20_NB;
// uint8_t *SIB22_NB;
// uint8_t sizeof_SIB22_NB;
//implicit parameters needed
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_eNB; //number of tx antenna port
int p_rx_eNB; //number of receiving antenna ports
int p_gNB; //number of tx antenna port
int p_rx_gNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
uint16_t physCellId;
//are the only static one (memory has been already allocated)
BCCH_BCH_Message_t mib_NR;
BCCH_BCH_Message_t mib;
/*
BCCH_DL_SCH_Message_NR_t siblock1_NB_IoT; //SIB1-NB
BCCH_DL_SCH_Message_NR_t systemInformation_NB_IoT; //SI
*/
SIB1_t *sib1_NR;
/*
SIB2_t *sib2_NR;
SIB3_t *sib3_NR;
//not implemented yet
SIB4_t *sib4_NR;
SIB5_t *sib5_NR;
*/
SIB1_t *sib1;
ServingCellConfigCommon_t *servingcellconfigcommon;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
SRB_INFO_NR MCCH_MESS[8];// MAX_MBSFN_AREA
/*future implementation TS 36.331 V14.2.1
SystemInformationBlockType15_NB_r14_t *sib15;
SystemInformationBlockType20_NB_r14_t *sib20;
SystemInformationBlockType22_NB_r14_t *sib22;
uint8_t SCPTM_flag;
uint8_t sizeof_SC_MCHH_MESS[];
SC_MCCH_Message_NR_t scptm;*/
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
......@@ -484,6 +444,7 @@ typedef struct gNB_RRC_INST_s {
#if defined(ENABLE_ITTI)
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
......
......@@ -41,7 +41,7 @@
#include "LAYER2/MAC/proto.h"
#include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h"
#include "RRC/LITE/NR/asn1_msg.h"
#include "RRC/NR/asn1_msg.h"
///ASN.1 header files
//#include "RRCConnectionRequest.h"
......@@ -127,10 +127,10 @@ openair_nrrrc_on(
LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_buffer (&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
}
}
......@@ -153,16 +153,16 @@ init_NR_SI(
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
// copy basic parameters
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->prefix_type[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->prefix_type[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
///MIB
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB_NR = 0;
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].MIB_NR = (uint8_t*) malloc16(4);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB_NR = do_MIB_NR(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],0,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = 0;
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].MIB = (uint8_t*) malloc16(4);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = do_MIB_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id],0,
#ifdef ENABLE_ITTI
configuration->ssb_SubcarrierOffset[CC_id],
configuration->pdcch_ConfigSIB1[CC_id],
......@@ -174,12 +174,12 @@ init_NR_SI(
);
///SIB1
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_NR = 0;
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_NR = (uint8_t*) malloc16(32);
AssertFatal(RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_NR!
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = 0;
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);
AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1!
= NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for NR SIB1 allocated\n",PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_NR = do_SIB1_NR(&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id],
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = do_SIB1_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id],
ctxt_pP->module_id,
CC_id
#if defined(ENABLE_ITTI)
......@@ -187,17 +187,26 @@ init_NR_SI(
#endif
);
AssertFatal(RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 != 255,"FATAL, RC.nr_rrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1_NR == 255");
AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 != 255,"FATAL, RC.nrrrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1 == 255");
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Ncp,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sib1->freqBandIndicator,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SERVINGCELLCONFIGCOMMON = do_SERVINGCELLCONFIGCOMMON(ctxt_pP->module_id,
CC_id
#if defined(ENABLE_ITTI)
,configuration
#endif
);
rrc_mac_config_req_gNB(ctxt_pP->module_id, CC_id,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sib1->freqBandIndicator,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
0, // rnti
(BCCH_BCH_Message_t *)
&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].mib
(BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
(ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id]servingcellconfigcommon
);
}
......@@ -206,34 +215,34 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
protocol_ctxt_t ctxt;
int CC_id;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, ENB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
LOG_I(NR_RRC,PROTOCOL_NRRRC_CTXT_FMT" Init...\n",PROTOCOL_NRRRC_CTXT_ARGS(&ctxt));
#if OCP_FRAMEWORK
while ( RC.nr_rrc[gnb_mod_idP] == NULL ) {
LOG_E(NR_RRC, "RC.nr_rrc not yet initialized, waiting 1 second\n");
while ( RC.nrrrc[gnb_mod_idP] == NULL ) {
LOG_E(NR_RRC, "RC.nrrrc not yet initialized, waiting 1 second\n");
sleep(1);
}
#endif
AssertFatal(RC.nr_rrc[gnb_mod_idP] != NULL, "RC.nr_rrc not initialized!");
AssertFatal(RC.nrrrc[gnb_mod_idP] != NULL, "RC.nrrrc not initialized!");
AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
#ifdef ENABLE_ITTI
AssertFatal(configuration!=NULL,"configuration input is null\n");
#endif
RC.nr_rrc[ctxt.module_id]->Nb_ue = 0;
RC.nrrrc[ctxt.module_id]->Nb_ue = 0;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
}
uid_linear_allocator_init(&nr_rrc.nr_rrc[ctxt.module_id]->uid_allocator);
RB_INIT(&RC.nr_rrc[ctxt.module_id]->rrc_ue_head);
uid_linear_allocator_init(&nrrrc.nrrrc[ctxt.module_id]->uid_allocator);
RB_INIT(&RC.nrrrc[ctxt.module_id]->rrc_ue_head);
RC.nr_rrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nr_rrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nrrrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nrrrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
memcpy(&RC.nr_rrc[ctxt.module_id]->configuration,configuration,sizeof(gNB_RrcConfigurationReq));
memcpy(&RC.nrrrc[ctxt.module_id]->configuration,configuration,sizeof(gNB_RrcConfigurationReq));
/// System Information INIT
......@@ -243,21 +252,21 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (j = 0; j < NUM_MAX_CBA_GROUP; j++) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[j] = CBA_OFFSET + j;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[j] = CBA_OFFSET + j;
}
if (RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups > NUM_MAX_CBA_GROUP) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups = NUM_MAX_CBA_GROUP;
if (RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups > NUM_MAX_CBA_GROUP) {
RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups = NUM_MAX_CBA_GROUP;
}
LOG_D(NR_RRC,
PROTOCOL_NRRRC_CTXT_FMT" Initialization of 4 cba_RNTI values (%x %x %x %x) num active groups %d\n",
PROTOCOL_NRRRC_CTXT_ARGS(&ctxt),
gnb_mod_idP, RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[0],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[1],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[2],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[3],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups);
gnb_mod_idP, RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[0],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[1],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[2],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[3],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups);
}
#endif
......@@ -270,8 +279,8 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
#endif
);
for (int ue_id = 0; ue_id < NUMBER_OF_UE_MAX; ue_id++){
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0;
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t*) malloc16(256);
RC.nrrrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t*) malloc16(256);
}
}//END for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
......@@ -279,14 +288,14 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
//rrc_init_NR_global_param();
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
openair_rrc_top_init_gNB(RC.nr_rrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
openair_rrc_top_init_gNB(RC.nrrrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
}
openair_nrrrc_on(&ctxt);
return 0;
}//END openair_rrc_eNB_configuration
}//END openair_rrc_gNB_configuration
///---------------------------------------------------------------------------------------------------------------///
......@@ -320,7 +329,7 @@ void* rrc_gnb_task(void* args_p){
break;
case MESSAGE_TEST:
LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name_p);
LOG_I(RRC, "[gNB %d] Received %s\n", instance, msg_name_p);
break;
/* Messages from MAC */
......@@ -374,16 +383,16 @@ void* rrc_gnb_task(void* args_p){
/* Nothing to do. Apparently everything is done in S1AP processing */
//LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n",
//instance, msg_name_p);
if (rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)
&& rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0) {
rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
if (rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)
&& rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0) {
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
}
break;
#endif
/* Messages from eNB app */
/* Messages from gNB app */
case NRRRC_CONFIGURATION_REQ:
LOG_I(NR_RRC, "[gNB %d] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p));
openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(instance), &NRRRC_CONFIGURATION_REQ(msg_p));
......@@ -414,35 +423,35 @@ openair_rrc_top_init_gNB(int eMBMS_active,uint8_t HO_active)
/* for no gcc warnings */
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_eNB_INST=%d\n", RC.nb_inst);
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_gNB_INST=%d\n", RC.nb_nr_inst);
if (RC.nb_inst > 0) {
LOG_I(RRC,"[eNB] handover active state is %d \n", HO_active);
if (RC.nb_nr_inst > 0) {
LOG_I(RRC,"[gNB] handover active state is %d \n", HO_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
RC.nr_rrc[module_id]->HO_flag = (uint8_t)HO_active;
for (module_id=0; module_id<NB_gNB_INST; module_id++) {
RC.nrrrc[module_id]->HO_flag = (uint8_t)HO_active;
}
#if defined(Rel10) || defined(Rel14)
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
LOG_I(RRC,"[gNB] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
for (module_id=0; module_id<NB_gNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nr_rrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
RC.nrrrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
}
}
#endif
#ifdef CBA
for (module_id=0; module_id<RC.nb_inst; module_id++) {
for (module_id=0; module_id<RC.nb_nr_inst; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nr_rrc[module_id]->carrier[CC_id].num_active_cba_groups = cba_group_active;
RC.nrrrc[module_id]->carrier[CC_id].num_active_cba_groups = cba_group_active;
}
}
#endif
}//END if (RC.nb_inst > 0)
}//END if (RC.nb_nr_inst > 0)
}
\ No newline at end of file
......@@ -275,19 +275,25 @@ gNBs =
DL_FreqBandIndicatorNR = 0;
DL_absoluteFrequencyPointA = 0;
DL_offsetToCarrier = 0;
DL_SubcarrierSpacing = 0;
DL_SCS_SubcarrierSpacing = 0;
DL_SCS_SpecificCarrier_k0 = 0;
DL_carrierBandwidth = 0;
DL_locationAndBandwidth = 0;
DL_BWP_SubcarrierSpacing = 0;
DL_BWP_prefix_type = "NORMAL";
UL_FreqBandIndicatorNR = 0;
UL_absoluteFrequencyPointA = 0;
FrequencyInfoUL_p_Max = 0;
frequencyShift7p5khz = 0;
UL_additionalSpectrumEmission = 0;
UL_p_Max = 0;
UL_frequencyShift7p5khz = 0;
UL_offsetToCarrier = 0;
UL_SubcarrierSpacing = 0;
UL_SCS_SubcarrierSpacing = 0;
UL_SCS_SpecificCarrier_k0 = 0;
UL_carrierBandwidth = 0;
UL_locationAndBandwidth = 0;
UL_BWP_SubcarrierSpacing = 0;
UL_BWP_prefix_type = 0;
ServingCellConfigCommon__ssb_PositionsInBurst_PR = 0;
ServingCellConfigCommon_ssb_periodicityServingCell = 0;
ServingCellConfigCommon_dmrs_TypeA_Position = 0;
NIA_SubcarrierSpacing = 0;
......@@ -357,6 +363,7 @@ gNBs =
PDCCH_interleaverSize = 0;
PDCCH_shiftIndex = 0;
PDCCH_precoderGranularity = 0;
PDCCH_TCI_StateId = 0;
tci_PresentInDCI = NULL;
SearchSpaceId = 0;
commonSearchSpaces_controlResourceSetId = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment